code: def _get_real_axis(ndim, axis):
      if axis is None:
          real_axis = list(range(ndim))
      else:
          if isinstance(axis, int):
              axis = [axis]
          else:
              assert isinstance(axis, (list, tuple))
          real_axis = []
          for ele in axis:
              if ele < 0:
                  ele += ndim
              if ele >= ndim:
                  raise ValueError(
                      f"{ele} exceeds the maximum dimension {ndim}. Received axis={axis}"
                  )
              real_axis.append(ele)
          real_axis.sort()
          real_axis = list(set(real_axis))  # Remove the duplicates
      return real_axis
  
file_path: tvm/python/tvm/topi/reduction.py
imports: from __future__ import absolute_import
  from .None import cpp
label_desc: Use image node_id 1 for calling a global function with example usage: _get_real_axis(ndim, axis) and returns: real_axis