parameters: (cls, data, name=None, dtype=None)
return_statement: return cls._simple_new(data, dtype=dtype, name=name)
docstring: Create RangeIndex from a range object.
  
          Returns
          -------
          RangeIndex
docstring_summary: Create RangeIndex from a range object.
docstring_tokens: Create RangeIndex from a range object .
function: def from_range(cls, data, name=None, dtype=None):
          """
          Create RangeIndex from a range object.
  
          Returns
          -------
          RangeIndex
          """
          if not isinstance(data, range):
              raise TypeError(
                  f"{cls.__name__}(...) must be called with object coercible to a "
                  f"range, {repr(data)} was passed"
              )
  
          cls._validate_dtype(dtype)
          return cls._simple_new(data, dtype=dtype, name=name)
function_tokens: def from_range ( cls , data , name = None , dtype = None ) : if not isinstance ( data , range ) : raise TypeError ( f"{cls.__name__}(...) must be called with object coercible to a " f"range, {repr(data)} was passed" ) cls . _validate_dtype ( dtype ) return cls . _simple_new ( data , dtype = dtype , name = name )