def boolean_flag(parser, name, default=False, help=None):
dest = name.replace('<STR_LIT:->', '<STR_LIT:_>')<EOL>parser.add_argument("<STR_LIT>" + name, action="<STR_LIT:store_true>", default=default, dest=dest, help=help)<EOL>parser.add_argument("<STR_LIT>" + name, action="<STR_LIT>", dest=dest)<EOL>
Add a boolean flag to argparse parser.

    Parameters
    ----------
    parser: argparse.Parser
        parser to add the flag to
    name: str
        --<name> will enable the flag, while --no-<name> will disable it
    default: bool or None
        default value of the flag
    help: str
        help string for the flag