code: def test_formatting():
      def test_0d():
          a = np.array(np.pi)
          _a = a.asnumpy()
          assert "{:0.3g}".format(a) == "{:0.3g}".format(_a)
          assert "{:0.3g}".format(a[()]) == "{:0.3g}".format(_a[()])
  
      def test_nd_format():
          a = np.array([np.pi])
          assert_exception("{:30}".format, TypeError, a)
  
      def test_nd_no_format():
          a = np.array([np.pi])
          _a = a.asnumpy()
          assert "{}".format(a) == "{}".format(_a)
          b = np.arange(8).reshape(2, 2, 2)
          assert "{}".format(a) == "{}".format(_a)
  
      device = mx.device.current_device()
      if str(device)[:3] != "gpu":
          test_0d()
          test_nd_format()
          test_nd_no_format()
  
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 11 for calling a global function with example usage: test_formatting() without return types