class_docstr: Utility to find and replace the `source_type` in Python objects.
  
  `source_type` can either be a single type or a tuple of multiple types.
  
  The caller must first call `find_nodes()`, then compute a replacement table and
  pass it to `replace_nodes`.
  
  This uses cloudpickle under the hood, so all sub-objects that are not `source_type`
  must be serializable.
  
  Args:
      source_type: the type(s) of object to find and replace. Default to DAGNodeBase.
docstr: Hook for reducing objects.
  
  Objects of `self.source_type` are saved to `self._found` and a global map so
  they can later be replaced.
  
  All other objects fall back to the default `CloudPickler` serialization.
docstr_tok: ["Hook","for","reducing","objects",".","Objects","of","`","self.source_type","`","are","saved","to","`","self._found","`","and","a","global","map","so","they","can","later","be","replaced",".","All","other","objects","fall","back","to","the","default","`","CloudPickler","`","serialization","."]
code: def reducer_override(self, obj):
      """Hook for reducing objects.
  
      Objects of `self.source_type` are saved to `self._found` and a global map so
      they can later be replaced.
  
      All other objects fall back to the default `CloudPickler` serialization.
      """
      if isinstance(obj, self.source_type):
          index = len(self._found)
          self._found.append(obj)
          return _get_node, (id(self), index)
  
      return super().reducer_override(obj)
  
file_path: ray/python/ray/dag/py_obj_scanner.py
imports: import io
  from typing import Any, Dict, Generic, List, Tuple, Type, TypeVar, Union
  import pickle
  import ray
  from ray.dag.base import DAGNodeBase
label_desc: Use image node_id 2 for calling the _PyObjScanner obj's underlying member method code with example usage: obj.reducer_override(obj) and returns: super, _get_node,  id,  index