code: def default(self, obj):
      if isinstance(obj, types.FunctionType):
          return self._to_cloudpickle(obj)
      try:
          return super(TuneFunctionEncoder, self).default(obj)
      except Exception:
          if log_once(f"tune_func_encode:{str(obj)}"):
              logger.debug(
                  "Unable to encode. Falling back to cloudpickle."
              )
          return self._to_cloudpickle(obj)
  
file_path: ray/python/ray/tune/utils/serialization.py
imports: import json
  import logging
  import types
  from ray import cloudpickle
  from ray._private.utils import binary_to_hex, hex_to_binary
  from ray.util.annotations import DeveloperAPI
  from ray.util.debug import log_once
label_desc: Use image node_id 1 for calling the TuneFunctionEncoder obj's underlying member method code with example usage: obj.default(obj) and returns: self, super, self