def AddCmd(command_name, cmd_factory, **kwargs):
  cmd = cmd_factory(command_name, flags.FlagValues(), **kwargs)

  if not isinstance(cmd, Cmd):
    raise AppCommandsError('Command must be an instance of commands.Cmd')

  _AddCmdInstance(command_name, cmd, **kwargs)
Calculate format decision state information and move onto the next token.
dataset/ETHPy150Open google/google-apputils/google/apputils/appcommands.py/AddCmd--crossover with--dataset/ETHPy150Open google/yapf/yapf/yapflib/format_decision_state.py/FormatDecisionState._MoveStateToNextToken