code: def to_ivy_dtype(dtype_in):
      if dtype_in is None:
          return
      if isinstance(dtype_in, ivy.Dtype):
          return dtype_in
      if isinstance(dtype_in, str):
          if (
              dtype_in.strip("><=")
              in np_frontend.numpy_str_to_type_table
          ):
              return ivy.Dtype(
                  np_frontend.numpy_str_to_type_table[
                      dtype_in.strip("><=")
                  ]
              )
          return ivy.Dtype(dtype_in)
      if ivy.is_native_dtype(dtype_in):
          return ivy.as_ivy_dtype(dtype_in)
      if dtype_in in (int, float, bool):
          return {int: ivy.int64, float: ivy.float64, bool: ivy.bool}[
              dtype_in
          ]
      if isinstance(dtype_in, np_frontend.dtype):
          return dtype_in.ivy_dtype
      if isinstance(dtype_in, type):
          if issubclass(dtype_in, np_frontend.generic):
              return np_frontend.numpy_scalar_to_dtype[dtype_in]
          if hasattr(dtype_in, "dtype"):
              return dtype_in.dtype.ivy_dtype
      else:
          return ivy.as_ivy_dtype(dtype_in)
  
imports: import ivy
  import ivy.functional.frontends.numpy
label_desc: Use image node_id 1 for calling a global function with example usage: to_ivy_dtype(dtype_in) and returns: dtype_in, ivy, ivy, dict, dtype_in, ivy, ivy, np_frontend, dtype_in