def __call__(self, command, shell):
    if isinstance(command, Command):
        method = getattr(SHELL_COMMANDS[shell], command.name)
        return method(*command.args, **command.kwargs)
    elif isinstance(command, RawCommand):
        if (shell == command.required_shell):
            return command.command
    else:
        raise TypeError(f('command must be Command or RawCommand not {}', type(command)))
def __call__(self, command, shell):
    if isinstance(command, Command):
        method = getattr(SHELL_COMMANDS[shell], command.name)
        return method(*command.args, **command.kwargs)
    elif isinstance(command, RawCommand):
        if (shell == command.required_shell):
            return command.command
    else:
        raise TypeError(f('command must be Command or RawCommand not {}', type(command)))