parameters: (sequences, names=None)
docstring: Construct an index from sequences of data.
  
      A single sequence returns an Index. Many sequences returns a
      MultiIndex.
  
      Parameters
      ----------
      sequences : sequence of sequences
      names : sequence of str
  
      Returns
      -------
      index : Index or MultiIndex
  
      Examples
      --------
      >>> ensure_index_from_sequences([[1, 2, 3]], names=["name"])
      Int64Index([1, 2, 3], dtype='int64', name='name')
  
      >>> ensure_index_from_sequences([["a", "a"], ["a", "b"]], names=["L1", "L2"])
      MultiIndex([('a', 'a'),
                  ('a', 'b')],
                 names=['L1', 'L2'])
  
      See Also
      --------
      ensure_index
docstring_summary: Construct an index from sequences of data.
docstring_tokens: Construct an index from sequences of data .
function: def ensure_index_from_sequences(sequences, names=None):
      """
      Construct an index from sequences of data.
  
      A single sequence returns an Index. Many sequences returns a
      MultiIndex.
  
      Parameters
      ----------
      sequences : sequence of sequences
      names : sequence of str
  
      Returns
      -------
      index : Index or MultiIndex
  
      Examples
      --------
      >>> ensure_index_from_sequences([[1, 2, 3]], names=["name"])
      Int64Index([1, 2, 3], dtype='int64', name='name')
  
      >>> ensure_index_from_sequences([["a", "a"], ["a", "b"]], names=["L1", "L2"])
      MultiIndex([('a', 'a'),
                  ('a', 'b')],
                 names=['L1', 'L2'])
  
      See Also
      --------
      ensure_index
      """
      from pandas.core.indexes.multi import MultiIndex
  
      if len(sequences) == 1:
          if names is not None:
              names = names[0]
          return Index(sequences[0], name=names)
      else:
          return MultiIndex.from_arrays(sequences, names=names)
function_tokens: def ensure_index_from_sequences ( sequences , names = None ) : from pandas . core . indexes . multi import MultiIndex if len ( sequences ) == 1 : if names is not None : names = names [ 0 ] return Index ( sequences [ 0 ] , name = names ) else : return MultiIndex . from_arrays ( sequences , names = names )