code: def get_handler(ptr, method):
      
      obj = CACHE.get(ptr, None)
      if obj is None:
          raise BridgeReferenceError(
              "Reference id={} never existed or has already been destroyed"
              .format(ptr))
      elif not hasattr(obj, method):
          raise NotImplementedError("{}.{} is not implemented.".format(obj,
                                                                       method))
      return obj, getattr(obj, method)
docs: Dereference the pointer and return the handler method.