class_docstr: Type dispatch table implementation.
  
  A type dispatch table is a list, L, of target types. Given a request type, R,
  the table selects a target type, T, according to the following dispatch rules:
    1. R == T or R is supertype of T (functions are contravariant on args)
    2. There does not exist O in L such that R is supertype of O and O is a
       supertype of T (in other words, T is the closest to R, within list L).
    3. If the above two rules are satisfied by multiple targets, the earliest
       inserted one is chosen.
docstr: Returns the most specific supertype target if it exists in the table.
code: def dispatch(
      self, request: function_type.FunctionType
  ) -> Optional[function_type.FunctionType]:
      """Returns the most specific supertype target if it exists in the table."""
      # For known exact matches.
      if request in self._dispatch_table:
          return request
  
      # For known non-exact matches.
      # (self._dispatch cache does not contain exact matches)
      if request in self._dispatch_cache:
          # Move to the front of LRU cache.
          result = self._dispatch_cache.pop(request)
          self._dispatch_cache[request] = result
          return result
  
      most_specific_supertype = None
      for other in self._dispatch_table:
          if request.is_supertype_of(other):
              if (
                  most_specific_supertype is None
                  or other.is_supertype_of(most_specific_supertype)
              ):
                  most_specific_supertype = other
  
      self._cache_dispatch(request, most_specific_supertype)
      return most_specific_supertype
  
file_path: tensorflow-upstream/tensorflow/core/function/polymorphism/type_dispatch.py
imports: import collections
  from typing import Optional, Iterable
  from tensorflow.core.function.polymorphism import function_type
label_desc: Use image node_id 6 for calling the TypeDispatchTable obj's underlying member method code with example usage: obj.dispatch(request) and returns: most_specific_supertype, request, result