code: def test_return_array(
      input_arg: str,
      target_arg: str,
      get_output_type: bool,
      get_output_dtype: bool,
  ):
      """
      Test autowrapping on predict that will set target_type
      """
  
      input_type_X = "numpy"
      input_dtype_X = np.float64
  
      input_type_Y = "cupy"
      input_dtype_Y = np.int32
  
      inner_type = "numba"
      inner_dtype = np.float16
  
      X_in = create_input(input_type_X, input_dtype_X, (10, 10), "F")
      Y_in = create_input(input_type_Y, input_dtype_Y, (10, 10), "F")
  
      def test_func(X, y):
          if not get_output_type:
              cuml.internals.set_api_output_type(inner_type)
  
          if not get_output_dtype:
              cuml.internals.set_api_output_dtype(inner_dtype)
  
          return X
  
      expected_to_fail = (input_arg == "bad" and get_output_type) or (
          target_arg == "bad" and get_output_dtype
      )
  
      try:
          test_func = cuml.internals.api_return_array(
              input_arg=input_arg,
              target_arg=target_arg,
              get_output_type=get_output_type,
              get_output_dtype=get_output_dtype,
          )(test_func)
      except ValueError:
          assert expected_to_fail
          return
      else:
          assert not expected_to_fail
  
      X_out = test_func(X=X_in, y=Y_in)
  
      target_type = None
      target_dtype = None
  
      if not get_output_type:
          target_type = inner_type
      else:
          if input_arg == "y":
              target_type = input_type_Y
          else:
              target_type = input_type_X
  
      if not get_output_dtype:
          target_dtype = inner_dtype
      else:
          if target_arg == "X":
              target_dtype = input_dtype_X
          else:
              target_dtype = input_dtype_Y
  
      assert determine_array_type(X_out) == target_type
  
      assert determine_array_dtype(X_out) == target_dtype
  
imports: from cuml.internals.input_utils import input_to_cuml_array
  from cuml.internals.input_utils import determine_array_type
  from cuml.internals.input_utils import determine_array_dtype
  from cuml.common.array_descriptor import CumlArrayDescriptor
  from cuml.internals.array import CumlArray
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
  import pickle
  import cuml
  import cuml.internals
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 8 for calling a global function with example usage: test_return_array(input_arg, target_arg, get_output_type, get_output_dtype) and returns: X