code: def min_scalar_type(a, /):
      if ivy.is_array(a) and a.shape == ():
          a = a.item()
      if np_frontend.isscalar(a):
          validation_dtype = type(a)
          if "int" in validation_dtype.__name__:
              for dtype in all_uint_dtypes:
                  if (
                      np_frontend.iinfo(dtype).min
                      <= a
                      <= np_frontend.iinfo(dtype).max
                  ):
                      return np_frontend.dtype(dtype)
              for dtype in all_int_dtypes:
                  if (
                      np_frontend.iinfo(dtype).min
                      <= a
                      <= np_frontend.iinfo(dtype).max
                  ):
                      return np_frontend.dtype(dtype)
  
          elif "float" in validation_dtype.__name__:
              for dtype in all_float_dtypes:
                  if (
                      np_frontend.finfo(dtype).min
                      <= a
                      <= np_frontend.finfo(dtype).max
                  ):
                      return np_frontend.dtype(dtype)
          elif "complex" in validation_dtype.__name__:
              for dtype in all_complex_dtypes:
                  if (
                      np_frontend.finfo(dtype).min
                      <= a
                      <= np_frontend.finfo(dtype).max
                  ):
                      return np_frontend.dtype(dtype)
          else:
              return np_frontend.dtype(validation_dtype)
      else:
          return np_frontend.dtype(a.dtype)
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
  import ivy.functional.frontends.numpy
label_desc: Use image node_id 2 for calling a global function with example usage: min_scalar_type() and returns: np_frontend, np_frontend, np_frontend, np_frontend, np_frontend, np_frontend