code: def _create_rs_generator(random_state):
      if hasattr(random_state, "__module__"):
          rs_type = (
              random_state.__module__
              + "."
              + type(random_state).__name__
          )
      else:
          rs_type = type(random_state).__name__
  
      rs = None
      if rs_type == "NoneType" or rs_type == "int":
          rs = da.random.RandomState(
              seed=random_state, RandomState=cp.random.RandomState
          )
      elif rs_type == "cupy.random.generator.RandomState":
          rs = da.random.RandomState(RandomState=random_state)
      elif rs_type == "dask.array.random.RandomState":
          rs = random_state
      else:
          raise ValueError(
              "random_state type must be int, CuPy RandomState \
                            or Dask RandomState"
          )
      return rs
  
imports: from cuml.dask.common.utils import get_client
  from cuml.dask.common.input_utils import DistributedDataHandler
  from cuml.common import with_cupy_rmm
  from cuml.dask.datasets.utils import _create_delayed
  from cuml.dask.datasets.utils import _get_labels
  from cuml.dask.datasets.utils import _get_X
  from cuml.internals.safe_imports import gpu_only_import
  import dask.array
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 1 for calling a global function with example usage: _create_rs_generator(random_state) and returns: rs