def get_node_proto(graph_proto, node_name):
  """Get a `NodeProto` from `GraphProto` by node name.

  Args:
    graph_proto: A `GraphProto`.
    node_name: Name of the node.

  Returns:
    A `NodeProto` or None.
  """
  for node_proto in graph_proto.nodes:
    if node_proto.name == node_name:
      return node_proto
  return None