class_docstr: Registry with predicate-based lookup.
  
  See the documentation for `register_checkpoint_saver` and
  `register_serializable` for reasons why predicates are required over a
  class-based registry.
  
  Since this class is used for global registries, each object must be registered
  to unique names (an error is raised if there are naming conflicts). The lookup
  searches the predicates in reverse order, so that later-registered predicates
  are executed first.
docstr: Registers a candidate object under the package, name and predicate.
docstr_tok: ["Registers","a","candidate","object","under","the","package",",","name","and","predicate","."]
code: def register(self, package, name, predicate, candidate):
      """Registers a candidate object under the package, name and predicate."""
      if not isinstance(package, str) or not isinstance(name, str):
          raise TypeError(
              f"The package and name registered to a {self.name} must be strings, "
              f"got: package={type(package)}, name={type(name)}"
          )
      if not callable(predicate):
          raise TypeError(
              f"The predicate registered to a {self.name} must be callable, "
              f"got: {type(predicate)}"
          )
      registered_name = package + "." + name
      if not _VALID_REGISTERED_NAME.match(registered_name):
          raise ValueError(
              f"Invalid registered {self.name}. Please check that the package and "
              f"name follow the regex '{_VALID_REGISTERED_NAME.pattern}': "
              f"(package='{package}', name='{name}')"
          )
      if registered_name in self._registered_map:
          raise ValueError(
              f"The name '{registered_name}' has already been registered to a "
              f"{self.name}. Found: {self._registered_map[registered_name]}"
          )
  
      self._registered_map[registered_name] = candidate
      self._registered_predicates[registered_name] = predicate
      self._registered_names.append(registered_name)
  
imports: import collections
  import re
  from absl import logging
  from tensorflow.python.util import tf_inspect
label_desc: Use image node_id 3 for calling the _PredicateRegistry obj's underlying member method code with example usage: obj.register(package, name, predicate, candidate) without return types