code: def set_np_default_dtype(
      is_np_default_dtype=True,
  ):  # pylint: disable=redefined-outer-name
      """Turns on/off NumPy default dtype semantics, because mxnet.numpy.ndarray use
      32 bit data storage as default (e.g. float32 and int 32) while offical NumPy use
      64 bit data storage as default (e.g. float64 and int64).
      This is turned off by default for keeping backward compatibility.
  
      Please note that this is designed as an infrastructure for the incoming
      MXNet-NumPy operators. Legacy operators registered in the modules
      `mx.nd` and `mx.sym` are not guaranteed to behave like their counterparts
      in NumPy within this semantics.
  
      Parameters
      ----------
      active : bool
          Indicates whether to turn on/off NumPy default dtype semantics.
  
      Returns
      -------
          A bool value indicating the previous state of NumPy default dtype semantics.
  
      Example
      -------
      >>> import mxnet as mx
      >>> from mxnet import npx
      >>> prev_state = npx.set_np_default_dtype(True)
      >>> print(prev_state)
      False
      >>> print(npx.is_np_default_dtype())
      True
      """
      global _set_np_default_dtype_logged
      if is_np_default_dtype:
          if not _set_np_default_dtype_logged:
              import logging
  
              logging.info(
                  "NumPy array default dtype has been changed from flaot32 to float64 in your code."
              )
              _set_np_default_dtype_logged = True
      prev = ctypes.c_bool()
      check_call(
          _LIB.MXSetIsNumpyDefaultDtype(
              ctypes.c_bool(is_np_default_dtype), ctypes.byref(prev)
          )
      )
      return prev.value
  
imports: import ctypes
  import functools
  import inspect
  import threading
  import tempfile
  import platform
  from contextlib import contextmanager
  from struct import calcsize
  from .base import _LIB, check_call, c_str, py_str, numeric_types, integer_types, long, _MAX_VALUE_64_BIT_UNSIGNED_, _MAX_VALUE_64_BIT_SIGNED_, _MAX_VALUE_FLOAT32_REPRESENT_
label_desc: Use image node_id 29 for calling a global function with example usage: set_np_default_dtype(is_np_default_dtype) and returns: prev