code: def numpy_scalar_to_python(scalar):
      
      scalar_type = type(scalar)
      if np.issubclass_(scalar_type, np.float_):
          return float(scalar)
      elif np.issubclass_(scalar_type, np.int_):
          return int(scalar)
      return scalar
docs: Converts a NumPy scalar to a regular python type.