code: def test_output_type_context_mgr(global_output_type, context_type):
      dataset = get_small_dataset("numba")
  
      test_type = "cupy" if global_output_type != "cupy" else "numpy"
      cuml.set_global_output_type(test_type)
  
      # use cuml context manager
      with cuml.using_output_type(context_type):
          dbscan_float = cuml.DBSCAN(eps=1.0, min_samples=1)
          dbscan_float.fit(dataset)
  
          res = dbscan_float.labels_
  
          if context_type == "numba":
              assert is_cuda_array(res)
          else:
              assert isinstance(res, test_output_types[context_type])
  
      # use cuml again outside the context manager
  
      dbscan_float = cuml.DBSCAN(eps=1.0, min_samples=1)
      dbscan_float.fit(dataset)
  
      res = dbscan_float.labels_
      assert isinstance(res, test_output_types[test_type])
  
file_path: cuml/python/cuml/tests/test_module_config.py
imports: from numba.cuda import is_cuda_array, as_cuda_array
  from cuml.internals.safe_imports import cpu_only_import
  import cuml
  import pytest
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 4 for calling a global function with example usage: test_output_type_context_mgr(global_output_type, context_type) without return types