code: def test_artic_loader(builtin_pkg):
      symbol = pd.DataFrame(
          [
              {"date": pd.Timestamp("20000101"), "a": 1, "b": 1.0},
              {"date": pd.Timestamp("20000102"), "a": 2, "b": 2.0},
          ]
      ).set_index(["date", "a"])
  
      orig_import = __import__
  
      with ExitStack() as stack:
          mock_arctic = mock.MagicMock()
  
          class MockVersionedItem(object):
              __name__ = "VersionedItem"
  
              def __init__(self):
                  self.data = symbol
                  pass
  
          def import_mock(name, *args, **kwargs):
              if name == "arctic":
                  return mock_arctic
              if name == "arctic.store.versioned_item":
                  return mock_versioned_item
              return orig_import(name, *args, **kwargs)
  
          mock_arctic_class = mock.MagicMock()
          mock_arctic.Arctic.return_value = mock_arctic_class
          mock_arctic_lib = mock.MagicMock()
          mock_arctic_lib.read = mock.Mock(
              return_value=MockVersionedItem()
          )
          mock_arctic_class.get_library = mock.Mock(
              return_value=mock_arctic_lib
          )
          mock_versioned_item = mock.Mock()
          mock_versioned_item.VersionedItem = MockVersionedItem
  
          stack.enter_context(
              mock.patch(
                  "{}.__import__".format(builtin_pkg),
                  side_effect=import_mock,
              )
          )
          mock_show = stack.enter_context(
              mock.patch("dtale.cli.script.show", mock.Mock())
          )
          args = [
              "--port",
              "9999",
              "--arctic-host",
              "test_host",
              "--arctic-library",
              "test_lib",
              "--arctic-symbol",
              "test_symbol",
              "--arctic-start",
              "20000101",
              "--arctic-end",
              "20000102",
          ]
          script.main(args, standalone_mode=False)
          mock_show.assert_called_once()
          _, kwargs = mock_show.call_args
          assert kwargs["data_loader"] is not None
          output = kwargs["data_loader"]()
          pdt.assert_frame_equal(output, symbol)
          mock_arctic.Arctic.assert_called_with("test_host")
          mock_arctic_class.get_library.assert_called_with("test_lib")
          read_args, read_kwargs = mock_arctic_lib.read.call_args
          assert read_args[0] == "test_symbol"
          assert "chunk_range" in read_kwargs
  
          mock_arctic.reset_mock()
          mock_arctic_lib.reset_mock()
          mock_arctic_class.reset_mock()
          mock_show.reset_mock()
  
          args = [
              "--port",
              "9999",
              "--arctic-host",
              "test_host",
              "--arctic-library",
              "test_lib",
              "--arctic-node",
              "test_node",
              "--arctic-start",
              "20000101",
              "--arctic-end",
              "20000102",
          ]
          script.main(args, standalone_mode=False)
          mock_show.assert_called_once()
          _, kwargs = mock_show.call_args
          assert kwargs["data_loader"] is not None
          output = kwargs["data_loader"]()
          pdt.assert_frame_equal(output, symbol)
          mock_arctic.Arctic.assert_called_with("test_host")
          mock_arctic_class.get_library.assert_called_with("test_lib")
          read_args, read_kwargs = mock_arctic_lib.read.call_args
          assert read_args[0] == "test_node"
          assert "chunk_range" in read_kwargs
  
          mock_arctic.reset_mock()
          mock_arctic_lib.reset_mock()
          mock_arctic_class.reset_mock()
          mock_show.reset_mock()
  
          args = [
              "--port",
              "9999",
              "--arctic-host",
              "test_host",
              "--arctic-library",
              "test_lib",
              "--arctic-symbol",
              "test_symbol2",
          ]
          script.main(args, standalone_mode=False)
          mock_show.assert_called_once()
          _, kwargs = mock_show.call_args
          assert kwargs["data_loader"] is not None
          pdt.assert_frame_equal(kwargs["data_loader"](), symbol)
          mock_arctic.Arctic.assert_called_with("test_host")
          mock_arctic_class.get_library.assert_called_with("test_lib")
          mock_arctic_lib.read.assert_called_with("test_symbol2")
  
imports: import os
  import sys
  from imp import reload
  import mock
  import pandas
  import pytest
  from six import PY3
  from dtale.cli import loaders, script
  from dtale.cli.clickutils import run
  from dtale.pandas_util import check_pandas_version
  from tests import ExitStack, pdt
label_desc: Use image node_id 4 for calling a global function with example usage: test_artic_loader(builtin_pkg) and returns: orig_import, mock_arctic, mock_versioned_item