code: def test_end_to_end_conversion_via_intermediate(
      inp, output_type, mem_type
  ):
      mem_type = MemoryType.from_str(mem_type)
      # This test requires a lot of assumptions in combination with cuDF
      # intermediates.
  
      # Assumptions required for cuDF limitations:
      assume(
          # Not all dtypes are supported by cuDF.
          not (
              output_type in ("cudf", "pandas", "dataframe", "series")
              and inp.dtype in UNSUPPORTED_CUDF_DTYPES
          )
      )
      assume(
          # Can't convert multidimensional arrays to a Series.
          not (output_type == "series" and len(inp.shape) > 1)
      )
  
      assume(
          # Cannot convert from DataFrame to CumlArray wihthout explicitly
          # specifying shape, dtype, and order.
          not (
              output_type == "dataframe"
              or (output_type == "cudf" and len(inp.shape) > 1)
              or (output_type == "pandas" and len(inp.shape) > 1)
          )
      )
  
      with using_memory_type(mem_type):
          # First conversion:
          array = CumlArray(data=inp)
          _assert_equal(inp, array)
  
          # Second conversion via intermediate
          intermediate = array.to_output(output_type)
  
          # Cupy does not support masked arrays.
          cai = getattr(
              intermediate, "__cuda_array_interface__", dict()
          )
          assume(cai.get("mask") is None)
  
          array2 = CumlArray(data=intermediate)
          _assert_equal(inp, array2)
  
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 14 for calling a global function with example usage: test_end_to_end_conversion_via_intermediate(inp, output_type, mem_type) without return types