code: def line_from_nodes(self, u, v):
          
          try:
              line = nx.get_edge_attributes(self, 'line')[(u, v)]
          except:
              try:
                  line = nx.get_edge_attributes(self, 'line')[(v, u)]
              except:
                  raise nx.NetworkXError('Line between ``u`` and ``v`` not '
                                         'included in the graph.')
  
          return line
docs: Get line between two nodes ``u`` and ``v``.
  
          Parameters
          ----------
          u : :class:`~.grid.components.Component`
              One adjacent node
          v : :class:`~.grid.components.Component`
              The other adjacent node
  
          Returns
          -------
          Line
              Line segment connecting ``u`` and ``v``.