def add_trackable_object(self, trackable_object: base.Trackable,
                           name: Optional[str]):
    """Add `trackable_object` to list of objects tracked."""
    if name is None:
      self._trackable_objects.append(trackable_object)
    else:
      module = TFGraphContext.get_module_to_export()
      # The `preprocessing_fn` should always be invoked within a TFGraphContext.
      # If not, module will be None.
      if module is None:
        raise RuntimeError(
            f'No module found to track {name} with. Check that the '
            '`preprocessing_fn` is invoked within a `TFGraphContext` with a '
            'valid `TFGraphContext.module_to_export`.')
      if hasattr(module, name):
        raise ValueError(
            f'An object with name {name} is already being tracked. Check that a '
            'unique name was passed.')
      setattr(module, name, trackable_object)
Add `trackable_object` to list of objects tracked.
tensorflow_transform/annotators.py