parameters: (from_arg, to_arg)
return_statement: return sli_func('Distance', from_arg, to_arg)
docstring: Get lateral distances from node(s)/position(s) `from_arg` to node(s) `to_arg`.
  
      The distance between two nodes is the length of its displacement.
  
      If explicit positions are given in the `from_arg` list, they are
      interpreted in the `to_arg` population. Distance is the shortest distance,
      taking into account periodic boundary conditions where applicable.
  
      - If one of `from_arg` or `to_arg` has length 1, and the other is longer,
        the displacement from/to the single item to all other items is given.
      - If `from_arg` and `to_arg` both have more than two elements, they have
        to be of the same length and the distance for each pair is
        returned.
  
      Parameters
      ----------
      from_arg : NodeCollection or tuple/list with tuple(s)/list(s) of floats
          `NodeCollection` of node IDs or tuple/list of position(s)
      to_arg : NodeCollection
          `NodeCollection` of node IDs
  
      Returns
      -------
      tuple:
          Distances between `from` and `to`
  
      See also
      --------
      Displacement: Get vector of lateral displacements between nodes.
      DumpLayerConnections: Write connectivity information to file.
      GetPosition: Return the spatial locations of nodes.
  
      Notes
      -----
      - The functions :py:func:`.GetPosition`, :py:func:`.Displacement` and :py:func:`.Distance`
        only works for nodes local to the current MPI process, if used in a
        MPI-parallel simulation.
  
      Example
      -------
          ::
  
              import nest
  
              # create a spatial population
              s_nodes = nest.Create('iaf_psc_alpha', positions=nest.spatial.grid(shape=[5, 5]))
  
              # distance between node 2 and 3
              print(nest.Distance(s_nodes[1], s_nodes[2]))
  
              # distance between the position (0.0., 0.0) and node 2
              print(nest.Distance([(0.0, 0.0)], s_nodes[1]))
docstring_summary: Get lateral distances from node(s)/position(s) `from_arg` to node(s) `to_arg`.
docstring_tokens: Get lateral distances from node ( s ) / position ( s ) from_arg to node ( s ) to_arg .
function: def Distance(from_arg, to_arg):
      """
      Get lateral distances from node(s)/position(s) `from_arg` to node(s) `to_arg`.
  
      The distance between two nodes is the length of its displacement.
  
      If explicit positions are given in the `from_arg` list, they are
      interpreted in the `to_arg` population. Distance is the shortest distance,
      taking into account periodic boundary conditions where applicable.
  
      - If one of `from_arg` or `to_arg` has length 1, and the other is longer,
        the displacement from/to the single item to all other items is given.
      - If `from_arg` and `to_arg` both have more than two elements, they have
        to be of the same length and the distance for each pair is
        returned.
  
      Parameters
      ----------
      from_arg : NodeCollection or tuple/list with tuple(s)/list(s) of floats
          `NodeCollection` of node IDs or tuple/list of position(s)
      to_arg : NodeCollection
          `NodeCollection` of node IDs
  
      Returns
      -------
      tuple:
          Distances between `from` and `to`
  
      See also
      --------
      Displacement: Get vector of lateral displacements between nodes.
      DumpLayerConnections: Write connectivity information to file.
      GetPosition: Return the spatial locations of nodes.
  
      Notes
      -----
      - The functions :py:func:`.GetPosition`, :py:func:`.Displacement` and :py:func:`.Distance`
        only works for nodes local to the current MPI process, if used in a
        MPI-parallel simulation.
  
      Example
      -------
          ::
  
              import nest
  
              # create a spatial population
              s_nodes = nest.Create('iaf_psc_alpha', positions=nest.spatial.grid(shape=[5, 5]))
  
              # distance between node 2 and 3
              print(nest.Distance(s_nodes[1], s_nodes[2]))
  
              # distance between the position (0.0., 0.0) and node 2
              print(nest.Distance([(0.0, 0.0)], s_nodes[1]))
      """
      if not isinstance(to_arg, NodeCollection):
          raise TypeError("to_arg must be a NodeCollection")
  
      if isinstance(from_arg, np.ndarray):
          from_arg = (from_arg, )
  
      if (len(from_arg) > 1 and len(to_arg) > 1 and not
              len(from_arg) == len(to_arg)):
          raise ValueError("to_arg and from_arg must have same size unless one have size 1.")
  
      return sli_func('Distance', from_arg, to_arg)
function_tokens: def Distance ( from_arg , to_arg ) : if not isinstance ( to_arg , NodeCollection ) : raise TypeError ( "to_arg must be a NodeCollection" ) if isinstance ( from_arg , np . ndarray ) : from_arg = ( from_arg , ) if ( len ( from_arg ) > 1 and len ( to_arg ) > 1 and not len ( from_arg ) == len ( to_arg ) ) : raise ValueError ( "to_arg and from_arg must have same size unless one have size 1." ) return sli_func ( 'Distance' , from_arg , to_arg )