code: def check_if_args_kwargs_serializable(
      args: Sequence[Any], kwargs: Dict[str, Any]
  ):
      """Check if parameters to a function are serializable by ray.
  
      Args:
          args: arguments to be checked.
          kwargs: keyword arguments to be checked.
  
      Raises:
          NoteSerializable if either args are kwargs are not serializable
              by ray.
      """
      for arg in args:
          try:
              # if the object is truly serializable we should be able to
              # ray.put and ray.get it.
              ray.get(ray.put(arg))
          except TypeError as e:
              raise NotSerializable(
                  "RLModule constructor arguments must be serializable. "
                  f"Found non-serializable argument: {arg}.\n"
                  f"Original serialization error: {e}"
              )
      for k, v in kwargs.items():
          try:
              # if the object is truly serializable we should be able to
              # ray.put and ray.get it.
              ray.get(ray.put(v))
          except TypeError as e:
              raise NotSerializable(
                  "RLModule constructor arguments must be serializable. "
                  f"Found non-serializable keyword argument: {k} = {v}.\n"
                  f"Original serialization error: {e}"
              )
  
imports: import base64
  from collections import OrderedDict
  import importlib
  import io
  import zlib
  from typing import Any, Dict, Optional, Sequence, Type, Union
  import numpy
  import ray
  from ray.rllib.utils.annotations import DeveloperAPI
  from ray.rllib.utils.gym import try_import_gymnasium_and_gym
  from ray.rllib.utils.error import NotSerializable
  from ray.rllib.utils.spaces.flexdict import FlexDict
  from ray.rllib.utils.spaces.repeated import Repeated
  from ray.rllib.utils.spaces.simplex import Simplex
label_desc: Use image node_id 8 for calling a global function with example usage: check_if_args_kwargs_serializable(args, kwargs) without return types