code: def dispatch(self, method_frame):
          '''
          Dispatch a method for this protocol.
          '''
          method = self.dispatch_map.get(method_frame.method_id)
          if method:
              callback = self.channel.clear_synchronous_cb(method)
              callback(method_frame)
          else:
              raise self.InvalidMethod(
                  "no method is registered with id: %d" % method_frame.method_idf dispatch(self, method_frame):
          '''
          Dispatch a method for this protocol.
          '''
          method = self.dispatch_map.get(method_frame.method_id)
          if method:
              callback = self.channel.clear_synchronous_cb(method)
              callback(method_frame)
          else:
              raise self.InvalidMethod(
                  "no method is registered with id: %d" % method_frame.method_id)
docs: Dispatch a method for this protocol.