code: def check_random_state(random_state):
      if random_state is None:
          return da.random.RandomState()
      elif isinstance(random_state, Integral):
          return da.random.RandomState(random_state)
      elif isinstance(random_state, np.random.RandomState):
          return da.random.RandomState(random_state.randint())
      elif isinstance(random_state, da.random.RandomState):
          return random_state
      else:
          raise TypeError(
              "Unexpected type '{}'".format(type(random_state))
          )
  
imports: import contextlib
  import datetime
  import functools
  import logging
  import warnings
  from collections.abc import Sequence
  from multiprocessing import cpu_count
  from numbers import Integral
  from timeit import default_timer
  import dask
  import dask.array
  import dask.dataframe
  import numpy
  import pandas
  import sklearn.utils.extmath
  import sklearn.utils.validation
  from dask import delayed
  from dask.array.utils import assert_eq
  from dask.dataframe.utils import assert_eq
  from ._utils import ConstantFunction
label_desc: Use image node_id 10 for calling a global function with example usage: check_random_state(random_state) and returns: da, da, da, random_state