def invoke(*args, **kwargs):
self, callback = args[:<NUM_LIT:2>]<EOL>ctx = self<EOL>if isinstance(callback, Command):<EOL><INDENT>other_cmd = callback<EOL>callback = other_cmd.callback<EOL>ctx = Context(other_cmd, info_name=other_cmd.name, parent=self)<EOL>if callback is None:<EOL><INDENT>raise TypeError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>for param in other_cmd.params:<EOL><INDENT>if param.name not in kwargs and param.expose_value:<EOL><INDENT>kwargs[param.name] = param.get_default(ctx)<EOL><DEDENT><DEDENT><DEDENT>args = args[<NUM_LIT:2>:]<EOL>with augment_usage_errors(self):<EOL><INDENT>with ctx:<EOL><INDENT>return callback(*args, **kwargs)<EOL><DEDENT><DEDENT>
Invokes a command callback in exactly the way it expects.  There
        are two ways to invoke this method:

        1.  the first argument can be a callback and all other arguments and
            keyword arguments are forwarded directly to the function.
        2.  the first argument is a click command object.  In that case all
            arguments are forwarded as well but proper click parameters
            (options and click arguments) must be keyword arguments and Click
            will fill in defaults.

        Note that before Click 3.2 keyword arguments were not properly filled
        in against the intention of this code and no context was created.  For
        more information about this change and why it was done in a bugfix
        release see :ref:`upgrade-to-3.2`.