code: def set_global_output_type(output_type):
      """
      Method to set cuML's single GPU estimators global output type.
      It will be used by all estimators unless overridden in their initialization
      with their own output_type parameter. Can also be overridden by the context
      manager method :func:`using_output_type`.
  
      Parameters
      ----------
      output_type : {'input', 'cudf', 'cupy', 'numpy'} (default = 'input')
          Desired output type of results and attributes of the estimators.
  
          * ``'input'`` will mean that the parameters and methods will mirror the
            format of the data sent to the estimators/methods as much as
            possible. Specifically:
  
            +---------------------------------------+--------------------------+
            | Input type                            | Output type              |
            +=======================================+==========================+
            | cuDF DataFrame or Series              | cuDF DataFrame or Series |
            +---------------------------------------+--------------------------+
            | NumPy arrays                          | NumPy arrays             |
            +---------------------------------------+--------------------------+
            | Pandas DataFrame or Series            | NumPy arrays             |
            +---------------------------------------+--------------------------+
            | Numba device arrays                   | Numba device arrays      |
            +---------------------------------------+--------------------------+
            | CuPy arrays                           | CuPy arrays              |
            +---------------------------------------+--------------------------+
            | Other `__cuda_array_interface__` objs | CuPy arrays              |
            +---------------------------------------+--------------------------+
  
          * ``'cudf'`` will return cuDF Series for single dimensional results and
            DataFrames for the rest.
  
          * ``'cupy'`` will return CuPy arrays.
  
          * ``'numpy'`` will return NumPy arrays.
  
      Examples
      --------
  
      >>> import cuml
      >>> import cupy as cp
      >>> ary = [[1.0, 4.0, 4.0], [2.0, 2.0, 2.0], [5.0, 1.0, 1.0]]
      >>> ary = cp.asarray(ary)
      >>> prev_output_type = cuml.global_settings.output_type
      >>> cuml.set_global_output_type('cudf')
      >>> dbscan_float = cuml.DBSCAN(eps=1.0, min_samples=1)
      >>> dbscan_float.fit(ary)
      DBSCAN()
      >>>
      >>> # cuML output type
      >>> dbscan_float.labels_
      0    0
      1    1
      2    2
      dtype: int32
      >>> type(dbscan_float.labels_)
      <class 'cudf.core.series.Series'>
      >>> cuml.set_global_output_type(prev_output_type)
  
      Notes
      -----
      ``'cupy'`` and ``'numba'`` options (as well as ``'input'`` when using Numba
      and CuPy ndarrays for input) have the least overhead. cuDF add memory
      consumption and processing time needed to build the Series and DataFrames.
      ``'numpy'`` has the biggest overhead due to the need to transfer data to
      CPU memory.
  
      """
      if isinstance(output_type, str):
          output_type = output_type.lower()
  
      # Check for allowed types. Allow 'cuml' to support internal estimators
      if (
          output_type is not None
          and output_type != "cuml"
          and output_type not in INTERNAL_VALID_OUTPUT_TYPES
      ):
          valid_output_types_str = ", ".join(
              [f"'{x}'" for x in VALID_OUTPUT_TYPES]
          )
          raise ValueError(
              f"output_type must be one of {valid_output_types_str}"
              f" or None. Got: {output_type}"
          )
  
      GlobalSettings().output_type = output_type
  
imports: import functools
  import operator
  import re
  from functools import wraps
  from cuml.internals.global_settings import GlobalSettings
  from cuml.internals.device_support import GPU_ENABLED
  from cuml.internals.mem_type import MemoryType
  from cuml.internals.output_type import INTERNAL_VALID_OUTPUT_TYPES, VALID_OUTPUT_TYPES
  from cuml.internals.safe_imports import cpu_only_import_from, gpu_only_import_from, UnavailableNullContext
label_desc: Use image node_id 6 for calling a global function with example usage: set_global_output_type(output_type) without return types