<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_subcommands(self, command, *args, **kwargs):
 """add subcommands. If command already defined, pass args and kwargs to add_subparsers() method, else to add_parser() method. This behaviour is for convenience, because I mostly use the sequence: If you want to configure your sub_parsers, you can do it with: help = "cmd help" subcommands = dict( title = "title" description = "subcommands description" ) ) """

        subcommands = kwargs.pop('subcommands', None)
        try:
            cmd = self[command]
        except KeyError:
            if 'formatter_class' not in kwargs:
                kwargs['formatter_class'] = self.formatter_class

            cmd = self.add_parser(command, *args, **kwargs)
            args, kwargs = tuple(), dict()

        if subcommands is not None:
            kwargs = subcommands

        child = CommandDecorator(
            argparser = self.argparser,
            commands  = cmd.add_subparsers(*args, **kwargs),
            parent = self,
            name   = command,
            )
        self.children.append(child)

        return child