def get_subparser(parser, command):
<EOL>subparsers_actions = [action for action in parser._actions<EOL>if isinstance(action, argparse._SubParsersAction)]<EOL>for subparsers_action in subparsers_actions:<EOL><INDENT>for choice, subparser in subparsers_action.choices.items():<EOL><INDENT>if choice == command:<EOL><INDENT>return subparser<EOL><DEDENT><DEDENT><DEDENT>return None<EOL>
Retrieve the given subparser from parser