def bound(self, instance):
bounded_dispatcher = CommandDispatcher()<EOL>bounded_dispatcher.commands = self.commands.copy()<EOL>for name in self.commands:<EOL><INDENT>method = getattr(instance, name, None)<EOL>if method and inspect.ismethod(method) and method.__self__ == instance:<EOL><INDENT>bounded_dispatcher.commands[name] = method<EOL><DEDENT><DEDENT>return bounded_dispatcher<EOL>
Return a new dispatcher, which will switch all command functions
with bounded methods of given instance matched by name. It will
match only regular methods.

:param instance: object instance
:type instance: object
:return: new Dispatcher
:rtype: CommandDispatcher