code: def arange(start, stop=None, step=1, dtype=None):
      """Returns an array with evenly spaced values within a given interval.
  
      Values are generated within the half-open interval [start, stop). The first
      three arguments are mapped like the ``range`` built-in function, i.e. start
      and step are optional.
  
      Args:
          start: Start of the interval.
          stop: End of the interval.
          step: Step width between each pair of consecutive values.
          dtype: Data type specifier. It is inferred from other arguments by
              default.
  
      Returns:
          cupy.ndarray: The 1-D array of range values.
  
      .. seealso:: :func:`numpy.arange`
  
      """
      if dtype is None:
          if any(
              numpy.dtype(type(val)).kind == "f"
              for val in (start, stop, step)
          ):
              dtype = float
          else:
              dtype = int
  
      if stop is None:
          stop = start
          start = 0
  
      if step is None:
          step = 1
  
      size = int(numpy.ceil((stop - start) / step))
      if size <= 0:
          return cupy.empty((0,), dtype=dtype)
  
      if numpy.dtype(dtype).type == numpy.bool_:
          if size > 2:
              raise TypeError(
                  "arange() is only supported for booleans "
                  "when the result has at most length 2."
              )
          if size == 2:
              return cupy.array(
                  [start, start - step], dtype=numpy.bool_
              )
          else:
              return cupy.array([start], dtype=numpy.bool_)
  
      ret = cupy.empty((size,), dtype=dtype)
      typ = numpy.dtype(dtype).type
      _arange_ufunc(typ(start), typ(step), ret, dtype=dtype)
      return ret
  
file_path: cupy/cupy/_creation/ranges.py
imports: import math
  import numpy
  import cupy
  from cupy import _core
label_desc: Use image node_id 1 for calling a global function with example usage: arange(start, stop, step, dtype) and returns: ret, cupy, cupy, cupy