<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_node_by_name(graph, name):
 """Return a node ID given its name."""

    for id, attrs in graph.nodes(data=True):
        if attrs['n'] == name:
            return id