parameters: (arbitrary, nan_as_null=None, **kwargs)
return_statement: return as_index(
          column.as_column(
              arbitrary, dtype=kwargs.get("dtype", None), nan_as_null=nan_as_null
          ),
          **kwargs,
      )
docstring: Create an Index from an arbitrary object
  
      Currently supported inputs are:
  
      * ``Column``
      * ``Buffer``
      * ``Series``
      * ``Index``
      * numba device array
      * numpy array
      * pyarrow array
      * pandas.Categorical
  
      Returns
      -------
      result : subclass of Index
          - CategoricalIndex for Categorical input.
          - DatetimeIndex for Datetime input.
          - GenericIndex for all other inputs.
docstring_summary: Create an Index from an arbitrary object
docstring_tokens: Create an Index from an arbitrary object
function: def as_index(arbitrary, nan_as_null=None, **kwargs) -> BaseIndex:
      """Create an Index from an arbitrary object
  
      Currently supported inputs are:
  
      * ``Column``
      * ``Buffer``
      * ``Series``
      * ``Index``
      * numba device array
      * numpy array
      * pyarrow array
      * pandas.Categorical
  
      Returns
      -------
      result : subclass of Index
          - CategoricalIndex for Categorical input.
          - DatetimeIndex for Datetime input.
          - GenericIndex for all other inputs.
      """
      kwargs = _setdefault_name(arbitrary, **kwargs)
      if isinstance(arbitrary, cudf.MultiIndex):
          return arbitrary
      elif isinstance(arbitrary, BaseIndex):
          if arbitrary.name == kwargs["name"]:
              return arbitrary
          idx = arbitrary.copy(deep=False)
          idx.rename(kwargs["name"], inplace=True)
          return idx
      elif isinstance(arbitrary, ColumnBase):
          return _index_from_data({kwargs.get("name", None): arbitrary})
      elif isinstance(arbitrary, cudf.Series):
          return as_index(arbitrary._column, nan_as_null=nan_as_null, **kwargs)
      elif isinstance(arbitrary, (pd.RangeIndex, range)):
          return RangeIndex(
              start=arbitrary.start,
              stop=arbitrary.stop,
              step=arbitrary.step,
              **kwargs,
          )
      elif isinstance(arbitrary, pd.MultiIndex):
          return cudf.MultiIndex.from_pandas(arbitrary, nan_as_null=nan_as_null)
      elif isinstance(arbitrary, cudf.DataFrame):
          return cudf.MultiIndex.from_frame(arbitrary)
      return as_index(
          column.as_column(
              arbitrary, dtype=kwargs.get("dtype", None), nan_as_null=nan_as_null
          ),
          **kwargs,
      )
function_tokens: def as_index ( arbitrary , nan_as_null = None , * * kwargs ) -> BaseIndex : kwargs = _setdefault_name ( arbitrary , * * kwargs ) if isinstance ( arbitrary , cudf . MultiIndex ) : return arbitrary elif isinstance ( arbitrary , BaseIndex ) : if arbitrary . name == kwargs [ "name" ] : return arbitrary idx = arbitrary . copy ( deep = False ) idx . rename ( kwargs [ "name" ] , inplace = True ) return idx elif isinstance ( arbitrary , ColumnBase ) : return _index_from_data ( { kwargs . get ( "name" , None ) : arbitrary } ) elif isinstance ( arbitrary , cudf . Series ) : return as_index ( arbitrary . _column , nan_as_null = nan_as_null , * * kwargs ) elif isinstance ( arbitrary , ( pd . RangeIndex , range ) ) : return RangeIndex ( start = arbitrary . start , stop = arbitrary . stop , step = arbitrary . step , * * kwargs , ) elif isinstance ( arbitrary , pd . MultiIndex ) : return cudf . MultiIndex . from_pandas ( arbitrary , nan_as_null = nan_as_null ) elif isinstance ( arbitrary , cudf . DataFrame ) : return cudf . MultiIndex . from_frame ( arbitrary ) return as_index ( column . as_column ( arbitrary , dtype = kwargs . get ( "dtype" , None ) , nan_as_null = nan_as_null ) , * * kwargs , )