code: def test_cleanup():
      from dtale.views import DtaleData
  
      with ExitStack() as stack:
          mock_cleanup = stack.enter_context(
              mock.patch("dtale.global_state.cleanup")
          )
          instance = DtaleData("9999", "user/root/proxy/9999")
          instance.cleanup()
          mock_cleanup.assert_called_once_with("9999")
  
file_path: dtale/tests/dtale/test_instance.py
imports: from collections import namedtuple
  import mock
  import pandas
  import pytest
  from dtale.dash_application.charts import get_url_parser
  from tests import ExitStack
  from tests.dtale import build_data_inst
label_desc: Use image node_id 5 for calling a global function with example usage: test_cleanup() without return types