code: def to_output_type(array, output_type, order="F"):
      """Used to convert arrays while creating datasets
      for testing.
  
      Parameters
      ----------
      array : array
          Input array to convert
      output_type : string
          Type of to convert to
  
      Returns
      -------
      Converted array
      """
      if output_type == "scipy_csr":
          return cpu_sparse.csr_matrix(array.get())
      if output_type == "scipy_csc":
          return cpu_sparse.csc_matrix(array.get())
      if output_type == "scipy_coo":
          return cpu_sparse.coo_matrix(array.get())
      if output_type == "cupy_csr":
          if array.format in ["csc", "coo"]:
              return array.tocsr()
          else:
              return array
      if output_type == "cupy_csc":
          if array.format in ["csr", "coo"]:
              return array.tocsc()
          else:
              return array
      if output_type == "cupy_coo":
          if array.format in ["csr", "csc"]:
              return array.tocoo()
          else:
              return array
  
      if cpu_sparse.issparse(array):
          if output_type == "numpy":
              return array.todense()
          elif output_type == "cupy":
              return cp.array(array.todense())
          else:
              array = array.todense()
      elif gpu_sparse.issparse(array):
          if output_type == "numpy":
              return array.get().todense()
          elif output_type == "cupy":
              return array.todense()
          else:
              array = array.todense()
  
      cuml_array = input_to_cuml_array(array, order=order)[0]
      if output_type == "series" and len(array.shape) > 1:
          output_type = "cudf"
  
      output = cuml_array.to_output(output_type)
  
      if output_type in ["dataframe", "cudf"]:
          renaming = {i: "c" + str(i) for i in range(output.shape[1])}
          output = output.rename(columns=renaming)
  
      return output
  
imports: from cuml.common import input_to_cuml_array
  from scipy.sparse import coo_matrix
  from scipy.sparse import csc_matrix
  from cupyx.scipy.sparse import coo_matrix
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals.safe_imports import gpu_only_import
  from cuml.internals.safe_imports import cpu_only_import
  import pytest
  from cuml.datasets import make_classification, make_blobs
  from cuml.internals.safe_imports import cpu_only_import_from
label_desc: Use image node_id 1 for calling a global function with example usage: to_output_type(array, output_type, order) and returns: output, cpu_sparse, cpu_sparse, cpu_sparse, array, array, array, array, array, array, array, cp, array, array