code: def test_data_dir():
      prev_data_dir = data_dir()
      system = platform.system()
      # Test that data_dir() returns the proper default value when MXNET_HOME is not set
      with environment("MXNET_HOME", None):
          if system == "Windows":
              assert_equal(
                  data_dir(),
                  op.join(os.environ.get("APPDATA"), "mxnet"),
              )
          else:
              assert_equal(
                  data_dir(), op.join(op.expanduser("~"), ".mxnet")
              )
      # Test that data_dir() responds to an explicit setting of MXNET_HOME
      with environment("MXNET_HOME", "/tmp/mxnet_data"):
          assert_equal(data_dir(), "/tmp/mxnet_data")
      # Test that this test has not disturbed the MXNET_HOME value existing before the test
      assert_equal(data_dir(), prev_data_dir)
  
file_path: mxnet/tests/python/unittest/test_base.py
imports: import mxnet
  from numpy.testing import assert_equal
  from mxnet.base import data_dir
  from mxnet.test_utils import environment
  from mxnet.util import getenv
  from common import with_environment
  import os
  import logging
  import os.path
  import platform
  import pytest
label_desc: Use image node_id 3 for calling a global function with example usage: test_data_dir() without return types