class_docstr: multipledispatch.Dispatcher uses a generator to yield the
  desired function implementation, which is problematic as TensorFlow's
  autograph is not able to compile code that passes through generators.
  
  This class overwrites the problematic method in the original
  Dispatcher and solely makes use of simple for-loops, which are
  compilable by AutoGraph.
docstr: Returns the first occurrence of a matching function
  
  Based on `multipledispatch.Dispatcher.dispatch_iter`, which
  returns an iterator of matching functions. This method uses
  the same logic to select functions, but simply returns the first
  element of the iterator. If no matching functions are found,
  `None` is returned.
docstr_tok: ["Returns","the","first","occurrence","of","a","matching","function","Based","on","`","multipledispatch.Dispatcher.dispatch_iter","`",",","which","returns","an","iterator","of","matching","functions",".","This","method","uses","the","same","logic","to","select","functions",",","but","simply","returns","the","first","element","of","the","iterator",".","If","no","matching","functions","are","found",",","`","None","`","is","returned","."]
code: def get_first_occurrence(
      self, *types: Types
  ) -> Optional[AnyCallable]:
      """
      Returns the first occurrence of a matching function
  
      Based on `multipledispatch.Dispatcher.dispatch_iter`, which
      returns an iterator of matching functions. This method uses
      the same logic to select functions, but simply returns the first
      element of the iterator. If no matching functions are found,
      `None` is returned.
      """
      n = len(types)
      for signature in self.ordering:
          if len(signature) == n and all(map(issubclass, types, signature)):  # type: ignore[arg-type]
              result: AnyCallable = self.funcs[signature]
              return result
          elif len(signature) and isvariadic(signature[-1]):
              if variadic_signature_matches(types, signature):
                  result = self.funcs[signature]
                  return result
      return None
  
file_path: GPflow/gpflow/utilities/multipledispatch.py
imports: from typing import Any, Callable, Optional, Tuple, Type, TypeVar, Union
  from multipledispatch import Dispatcher
  from multipledispatch.dispatcher import str_signature, variadic_signature_matches
  from multipledispatch.variadic import isvariadic
label_desc: Use image node_id 4 for calling the Dispatcher obj's underlying member method code with example usage: obj.get_first_occurrence() and returns: None, result, result