class_docstr: An interpretation based on pattern matching.
  
  Example usage::
  
      my_interpretation = DispatchedInterpretation("my_interpretation")
  
      # Register a funsor pattern and rule.
      @my_interpretation.register(...)
      def my_impl(cls, *args):
          ...
  
      # Use the new interpretation.
      with my_interpretation:
          ...
class_docstr_tok: ["An","interpretation","based","on","pattern","matching",".","Example","usage",":",":","my_interpretation","=","DispatchedInterpretation","(","``","my_interpretation","''",")","#","Register","a","funsor","pattern","and","rule",".","@","my_interpretation.register","(","...",")","def","my_impl","(","cls",",","*","args",")",":","...","#","Use","the","new","interpretation",".","with","my_interpretation",":","..."]
code: def __init__(self, name="dispatched"):
      super().__init__(name)
      self.registry = registry = KeyedRegistry(
          default=lambda *args: None
      )
  
      if instrument.DEBUG or instrument.PROFILE:
          self.register = lambda *args: lambda fn: registry.register(
              *args
          )(instrument.debug_logged(fn))
      else:
          self.register = registry.register
  
      if instrument.PROFILE:
          COUNTERS = instrument.COUNTERS
  
          def profiled_dispatch(*args):
              name = self.__name__ + ".dispatch"
              start = default_timer()
              result = registry.dispatch(*args)
              COUNTERS["time"][name] += default_timer() - start
              COUNTERS["call"][name] += 1
              COUNTERS["interpretation"][self.__name__] += 1
              return result
  
          self.dispatch = profiled_dispatch
      else:
          self.dispatch = registry.dispatch
  
imports: from abc import ABC, abstractmethod
  from collections.abc import Hashable
  from contextlib import ContextDecorator, contextmanager
  from timeit import default_timer
  from .None import instrument
  from .interpreter import get_interpretation, pop_interpretation, push_interpretation
  from .registry import KeyedRegistry
  from .util import get_backend
label_desc: Use image node_id 1 to create a new DispatchedInterpretation object from inherited base classes: Interpretation with example: obj = DispatchedInterpretation(name)