class_docstr: Clearing house for multiple dispatch functionality. This class extends
  `<multipledispatch.Dispatcher>` by: (i) generalizing the argument encoding
  convention during method lookup, (ii) implementing `__getitem__` as a dedicated
  method lookup function.
class_docstr_tok: ["Clearing","house","for","multiple","dispatch","functionality",".","This","class","extends","`","<","multipledispatch.Dispatcher",">","`","by",":","(","i",")","generalizing","the","argument","encoding","convention","during","method","lookup",",","(","ii",")","implementing","`","__getitem__","`","as","a","dedicated","method","lookup","function","."]
docstr: Multiply dispatches a call to a collection of methods.
  
  Args:
      args: A set of arguments that act as identifiers for a stored method.
      kwargs: Optional keyword arguments passed to the retrieved method.
  
  Returns:
      The result of evaluating `func(*args, **kwargs)`, where `func` is
      the function obtained via method lookup.
docstr_tok: ["Multiply","dispatches","a","call","to","a","collection","of","methods",".","Args",":","args",":","A","set","of","arguments","that","act","as","identifiers","for","a","stored","method",".","kwargs",":","Optional","keyword","arguments","passed","to","the","retrieved","method",".","Returns",":","The","result","of","evaluating","`","func","(","*","args",",","*","*","kwargs",")","`",",","where","`","func","`","is","the","function","obtained","via","method","lookup","."]
code: def __call__(self, *args: Any, **kwargs: Any) -> Any:
      r"""Multiply dispatches a call to a collection of methods.
  
      Args:
          args: A set of arguments that act as identifiers for a stored method.
          kwargs: Optional keyword arguments passed to the retrieved method.
  
      Returns:
          The result of evaluating `func(*args, **kwargs)`, where `func` is
          the function obtained via method lookup.
      """
      types = self.encode_args(args)
      func = self.__getitem__(types=types)
      try:
          return func(*args, **kwargs)
      except MDNotImplementedError:
          # Traverses registered methods in order, yields whenever a match is found
          funcs = self.dispatch_iter(*types)
          next(
              funcs
          )  # burn first, same as self.__getitem__(types=types)
          for func in funcs:
              try:
                  return func(*args, **kwargs)
              except MDNotImplementedError:
                  pass
  
          raise NotImplementedError(
              f"Matching functions for {self.name:s}: {str_signature(types):s} "
              "found, but none completed successfully"
          )
  
file_path: botorch/botorch/utils/dispatcher.py
imports: from __future__ import annotations
  from inspect import getsource, getsourcefile
  from typing import Any, Callable, Optional, Tuple, Type
  from multipledispatch.dispatcher import Dispatcher, MDNotImplementedError, str_signature
label_desc: Use image node_id 3 for calling the Dispatcher obj's underlying member method code with example usage: obj.__call__() and returns: func, func