def _subgroup(group, *args, **kwargs):
def decorator(f):<EOL><INDENT>f.required = kwargs.pop('<STR_LIT>', True)<EOL>if '<STR_LIT>' in kwargs:<EOL><INDENT>if not hasattr(f, '<STR_LIT>'):  <EOL><INDENT>f._argnames = []<EOL><DEDENT>for p in kwargs['<STR_LIT>']:<EOL><INDENT>f._argnames += p._argnames if hasattr(p, '<STR_LIT>') else []<EOL><DEDENT>kwargs['<STR_LIT>'] = [p.parser for p in kwargs['<STR_LIT>']]<EOL><DEDENT>if '<STR_LIT>' not in kwargs:<EOL><INDENT>kwargs['<STR_LIT>'] = f.__doc__<EOL><DEDENT>if args == ():<EOL><INDENT>f.parser = group._subparsers.add_parser(f.__name__, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>f.parser = group._subparsers.add_parser(*args, **kwargs)<EOL><DEDENT>f.parser.set_defaults(**{'<STR_LIT>' + group.__name__: f})<EOL>f.climax = True<EOL>for arg in getattr(f, '<STR_LIT>', []):<EOL><INDENT>f.parser.add_argument(*arg[<NUM_LIT:0>], **arg[<NUM_LIT:1>])<EOL><DEDENT>f._subparsers = f.parser.add_subparsers()<EOL>f.command = partial(_subcommand, f)<EOL>f.group = partial(_subgroup, f)<EOL>return f<EOL><DEDENT>return decorator<EOL>
Decorator to define a subgroup.

    This decorator is used for the group's @group decorator.