code: def normalized_axes_tuple(axes, ndim):
      
      try:
          axes, axes_in = (int(axes),), axes
      except TypeError:
          axes, axes_in = tuple(int(axis) for axis in axes), axes
          if any(axis != axis_in for axis, axis_in in zip(axes, axes_in)):
              raise ValueError('`axes` may only contain integers, got {}'
                               ''.format(axes_in))
      else:
          if axes[0] != axes_in:
              raise TypeError('`axes` must be integer or sequence, got {}'
                              ''.format(axes_in))
  
      if len(set(axes)) != len(axes):
          raise ValueError('`axes` may not contain duplicate entries')
  
      ndim, ndim_in = int(ndim), ndim
      if ndim <= 0:
          raise ValueError('`ndim` must be positive, got {}'.format(ndim_in))
  
      axes_arr = np.array(axes)
      axes_arr[axes_arr < 0] += ndim
      if np.any((axes_arr < 0) | (axes_arr >= ndim)):
          raise ValueError('all `axes` entries must satisfy -{0} <= axis < {0}, '
                           'got {1}'.format(ndim, axes_in))
  
      return tuple(axes_arr)
docs: Return a tuple of ``axes`` converted to positive integers.
  
      This function turns negative entries into equivalent positive
      ones according to standard Python indexing "from the right".
  
      Parameters
      ----------
      axes : int or sequence of ints
          Single integer or integer sequence of arbitrary length.
          Duplicate entries are not allowed. All entries must fulfill
          ``-ndim <= axis <= ndim - 1``.
      ndim : positive int
          Number of available axes determining the valid axis range.
  
      Returns
      -------
      axes_list : tuple of ints
          The converted tuple of axes.
  
      Examples
      --------
      Normalizing a sequence of axes:
  
      >>> normalized_axes_tuple([0, -1, 2], ndim=3)
      (0, 2, 2)
  
      Single integer works, too:
  
      >>> normalized_axes_tuple(-3, ndim=3)
      (0,)