code: def test_output(inp, input_mem_type, output_type):
      # Required assumptions for cudf outputs:
      if output_type in ("cudf", "dataframe", "series"):
          assume(inp.dtype not in UNSUPPORTED_CUDF_DTYPES)
      if output_type == "series":
          assume(not _multidimensional(inp.shape))
  
      # Generate CumlArray from input and perform conversion.
      with using_memory_type(input_mem_type):
          arr = CumlArray(inp)
      res = arr.to_output(output_type)
  
      # Check output type
      if output_type == "numba":  # TODO: is this still needed?
          # using correct numba ndarray check
          assert cuda.devicearray.is_cuda_ndarray(res)
      elif output_type == "cudf":
          assert isinstance(
              res,
              CudfDataFrame
              if _multidimensional(inp.shape)
              else CudfSeries,
          )
      elif output_type == "pandas":
          assert isinstance(
              res,
              PandasDataFrame
              if _multidimensional(inp.shape)
              else PandasSeries,
          )
      else:
          assert isinstance(res, _OUTPUT_TYPES_MAPPING[output_type])
  
      def assert_data_equal_(res):
          # Check output data equality
          if isinstance(res, CudfSeries):
              # A simple equality check `assert cudf.Series(inp).equals(res)`
              # does not work for with multi-dimensional data.
              assert CudfSeries(np.ravel(inp)).equals(res)
          elif isinstance(res, PandasSeries):
              assert PandasSeries(np.ravel(inp)).equals(res)
          elif isinstance(res, CudfDataFrame):
              # Assumption required because of:
              #   https://github.com/rapidsai/cudf/issues/12266
              assume(not np.isnan(res.to_numpy()).any())
  
              assert CudfDataFrame(inp).equals(res)
          elif isinstance(res, PandasDataFrame):
              assert PandasDataFrame(inp).equals(res)
          else:
              assert np.array_equal(
                  to_nparray(inp), to_nparray(res), equal_nan=True
              )
  
      assert_data_equal_(res)
  
imports: import gc
  import operator
  import pickle
  import pytest
  from copy import deepcopy
  from cuml.internals.array import CumlArray, _order_to_strides, array_to_memory_order
  from cuml import global_settings
  from cuml.internals.mem_type import MemoryType
  from cuml.internals.memory_utils import _get_size_from_shape, determine_array_memtype, using_memory_type
  from cuml.internals.safe_imports import cpu_only_import, cpu_only_import_from, gpu_only_import, gpu_only_import_from
  from cuml.testing.strategies import UNSUPPORTED_CUDF_DTYPES, create_cuml_array_input, cuml_array_dtypes, cuml_array_input_types, cuml_array_inputs, cuml_array_orders, cuml_array_output_types, cuml_array_shapes, cuml_array_mem_types
  from cuml.testing.utils import normalized_shape, series_squeezed_shape, squeezed_shape, to_nparray
  from hypothesis import assume, given, settings
  from hypothesis import strategies
label_desc: Use image node_id 13 for calling a global function with example usage: test_output(inp, input_mem_type, output_type) without return types