class_docstr: Single-dispatch generic method descriptor.
  
  Supports wrapping existing descriptors and handles non-descriptor
  callables as instance methods.
class_docstr_tok: ["Single-dispatch","generic","method","descriptor",".","Supports","wrapping","existing","descriptors","and","handles","non-descriptor","callables","as","instance","methods","."]
code: def __get__(self, obj, cls=None):
      if self._method_cache is not None:
          try:
              _method = self._method_cache[obj]
          except TypeError:
              self._method_cache = None
          except KeyError:
              pass
          else:
              return _method
  
      dispatch = self.dispatcher.dispatch
  
      def _method(*args, **kwargs):
          return dispatch(args[0].__class__).__get__(obj, cls)(
              *args, **kwargs
          )
  
      _method.__isabstractmethod__ = self.__isabstractmethod__
      _method.register = self.register
      update_wrapper(_method, self.func)
  
      if self._method_cache is not None:
          self._method_cache[obj] = _method
  
      return _method
  
imports: from abc import get_cache_token
  from collections import namedtuple
  from reprlib import recursive_repr
  from _thread import RLock
label_desc: Use image node_id 3 for calling the singledispatchmethod obj's underlying member method code with example usage: obj.__get__(obj, cls) and returns: _method, dispatch, _method