code: def build_method_map(self, prototype, prefix=''):
          
          if not isinstance(prototype, dict):
              prototype = dict((method, getattr(prototype, method))
                               for method in dir(prototype)
                               if not method.startswith('_'))
  
          for attr, method in prototype.items():
              if callable(method):
                  self[prefix + attr] = method
docs: Add prototype methods to the dispatcher.
  
          Parameters
          ----------
          prototype : object or dict
              Initial method mapping.
              If given prototype is a dictionary then all callable objects will
              be added to dispatcher.
              If given prototype is an object then all public methods will
              be used.
          prefix: string, optional
              Prefix of methods