code: def _convert_to_pandas(data):
      if data is None:
          return None
      elif isinstance(data, tuple):
          return tuple([_convert_to_pandas(d) for d in data])
      elif isinstance(data, (pd.DataFrame, pd.Series)):
          return data
      elif isinstance(data, (cudf.DataFrame, cudf.Series)):
          return data.to_pandas()
      elif isinstance(data, np.ndarray):
          data = np.squeeze(data)
          if data.ndim == 1:
              return pd.Series(data)
          else:
              return pd.DataFrame(data)
      elif isinstance(data, cp.ndarray):
          data = np.squeeze(cp.asnumpy(data))
          if data.ndim == 1:
              return pd.Series(data)
          else:
              return pd.DataFrame(data)
      else:
          raise Exception("Unsupported type %s" % str(type(data)))
  
imports: from cuml.internals.import_utils import has_scipy
  from cuml.internals.safe_imports import gpu_only_import_from
  from cuml.internals import input_utils
  from urllib.request import urlretrieve
  import sklearn.model_selection
  from sklearn.datasets import load_svmlight_file, fetch_covtype
  import cuml.datasets
  from cuml.internals.safe_imports import cpu_only_import
  import os
  import functools
  import gzip
  from cuml.internals.safe_imports import gpu_only_import
label_desc: Use image node_id 16 for calling a global function with example usage: _convert_to_pandas(data) and returns: None, tuple, data, data, pd, pd, pd, pd