<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def graph_nodes_from_branch(self, branch):
 """ Returns nodes that are connected by `branch` Args ---- branch: BranchDing0 Description #TODO Returns ------- (:obj:`GridDing0`, :obj:`GridDing0`) 2-tuple of nodes (Ding0 objects) #TODO:Check """

        edges = nx.get_edge_attributes(self._graph, 'branch')
        nodes = list(edges.keys())[list(edges.values()).index(branch)]
        return nodes