code: def range(
      *args,
      dtype=None,
      layout=None,
      device=None,
      requires_grad=False,
  ):
      if len(args) == 1:
          end = args[0]
          start = 0
          step = 1
      elif len(args) == 2:
          end = args[1]
          start = args[0]
          step = 1
      elif len(args) == 3:
          start, end, step = args
      else:
          ivy.utils.assertions.check_true(
              len(args) == 1 or len(args) == 3,
              "only 1 or 3 positional arguments are supported",
          )
      range_vec = []
      elem = start
      while 1:
          range_vec = range_vec + [elem]
          elem += step
          if start == end:
              break
          if start < end:
              if elem > end:
                  break
          else:
              if elem < end:
                  break
      return ivy.array(range_vec, dtype=dtype, device=device)
  
imports: import ivy
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back, to_ivy_shape
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  import ivy.functional.frontends.torch
label_desc: Use image node_id 22 for calling a global function with example usage: range() and returns: ivy