code: def random_state(state=None):
      """
      Helper function for processing random_state arguments.
  
      Parameters
      ----------
      state : int, np.random.RandomState, None.
          If receives an int, passes to np.random.RandomState() as seed.
          If receives an np.random.RandomState object, just returns object.
          If receives `None`, returns np.random.
          If receives anything else, raises an informative ValueError.
          Default None.
  
      Returns
      -------
      np.random.RandomState
      """
  
      if is_integer(state):
          return np.random.RandomState(state)
      elif isinstance(state, np.random.RandomState):
          return state
      elif state is None:
          return np.random
      else:
          raise ValueError(
              "random_state must be an integer, a numpy "
              "RandomState, or None"
          )
  
imports: import collections
  from datetime import datetime, timedelta
  from functools import partial
  import inspect
  import numpy
  from pandas._libs import lib, tslibs
  import pandas.compat
  from pandas.compat import PY36, OrderedDict, iteritems
  from pandas.core.dtypes.cast import construct_1d_object_array_from_listlike
  from pandas.core.dtypes.common import is_array_like, is_bool_dtype, is_extension_array_dtype, is_integer
  from pandas.core.dtypes.generic import ABCIndex, ABCIndexClass, ABCSeries
  from pandas.core.dtypes.inference import _iterable_not_string
  from pandas.core.dtypes.missing import isna, isnull, notnull
label_desc: Use image node_id 26 for calling a global function with example usage: random_state(state) and returns: np, state, np