code: def test_np_get_dtype():
      dtypes = [
          _np.int8,
          _np.int32,
          _np.float16,
          _np.float32,
          _np.float64,
          _np.bool,
          _np.bool_,
          "int8",
          "int32",
          "float16",
          "float32",
          "float64",
          "bool",
          None,
      ]
      objects = [
          [],
          (),
          [[1, 2], [3, 4]],
          _np.random.uniform(size=rand_shape_nd(3)),
          _np.random.uniform(size=(3, 0, 4)),
      ]
      for dtype in dtypes:
          for src in objects:
              mx_arr = np.array(src, dtype=dtype)
              assert mx_arr.device == mx.current_device()
              if isinstance(src, mx.nd.NDArray):
                  np_arr = _np.array(
                      src.asnumpy(),
                      dtype=dtype if dtype is not None else _np.float32,
                  )
              else:
                  np_arr = _np.array(
                      src,
                      dtype=dtype if dtype is not None else _np.float32,
                  )
              assert type(mx_arr.dtype) == type(np_arr.dtype)
  
imports: from __future__ import absolute_import
  from __future__ import division
  import itertools
  import os
  import pytest
  import operator
  import numpy
  import mxnet
  from mxnet import np, npx, autograd
  from mxnet.gluon import HybridBlock
  from mxnet.test_utils import same, assert_almost_equal, rand_shape_nd, rand_ndarray, use_np
  from common import retry, TemporaryDirectory, xfail_when_nonstandard_decimal_separator
  from mxnet.test_utils import verify_generator, gen_buckets_probs_with_ppf, assert_exception, is_op_runnable, collapse_sum_like
  from mxnet.ndarray.ndarray import py_slice
  from mxnet.base import integer_types
label_desc: Use image node_id 24 for calling a global function with example usage: test_np_get_dtype() without return types