def parse_args(args=None):
import argparse<EOL>from ttfautohint import __version__, libttfautohint<EOL>from ttfautohint.cli import USAGE, DESCRIPTION, EPILOG<EOL>version_string = "<STR_LIT>" % (<EOL>__version__, libttfautohint.version_string)<EOL>if args is None:<EOL><INDENT>capture_sys_exit = False<EOL><DEDENT>else:<EOL><INDENT>capture_sys_exit = True<EOL>if isinstance(args, basestring):<EOL><INDENT>import shlex<EOL>args = shlex.split(args)<EOL><DEDENT><DEDENT>parser = argparse.ArgumentParser(<EOL>prog="<STR_LIT>",<EOL>usage=USAGE,<EOL>description=DESCRIPTION,<EOL>epilog=EPILOG,<EOL>formatter_class=argparse.RawDescriptionHelpFormatter,<EOL>)<EOL>parser.add_argument(<EOL>"<STR_LIT>", nargs="<STR_LIT:?>", metavar="<STR_LIT>", default="<STR_LIT:->",<EOL>type=stdin_or_input_path_type,<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", nargs="<STR_LIT:?>", metavar="<STR_LIT>", default="<STR_LIT:->",<EOL>type=stdout_or_output_path_type,<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", action="<STR_LIT:store_true>", help="<STR_LIT>")<EOL>stem_width_group = parser.add_mutually_exclusive_group(required=False)<EOL>stem_width_group.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=stem_width_mode, metavar="<STR_LIT:S>",<EOL>default=STEM_WIDTH_MODE_OPTIONS,<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>stem_width_group.add_argument(  <EOL>"<STR_LIT>", "<STR_LIT>", type=strong_stem_width, metavar="<STR_LIT:S>",<EOL>help=argparse.SUPPRESS)<EOL>parser.add_argument(<EOL>"<STR_LIT:-c>", "<STR_LIT>", dest="<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>", help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", metavar="<STR_LIT>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", metavar="<STR_LIT>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", dest="<STR_LIT>", metavar="<STR_LIT>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>", dest="<STR_LIT>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", dest="<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:version>",<EOL>version=version_string,<EOL>help="<STR_LIT>")<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", action="<STR_LIT:store_true>",<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help=("<STR_LIT>"<EOL>"<STR_LIT>"))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help=('<STR_LIT>'<EOL>'<STR_LIT>'))<EOL>parser.add_argument(<EOL>"<STR_LIT>", "<STR_LIT>", type=int, metavar="<STR_LIT>",<EOL>default=USER_OPTIONS["<STR_LIT>"],<EOL>help="<STR_LIT>")<EOL>try:<EOL><INDENT>options = vars(parser.parse_args(args))<EOL><DEDENT>except SystemExit:<EOL><INDENT>if capture_sys_exit:<EOL><INDENT>return None<EOL><DEDENT>raise<EOL><DEDENT>if (not capture_sys_exit and<EOL>(options["<STR_LIT>"] is None or options["<STR_LIT>"] is None)):<EOL><INDENT>parser.print_help()<EOL>parser.exit(<NUM_LIT:1>)<EOL><DEDENT>source_date_epoch = os.environ.get("<STR_LIT>")<EOL>if source_date_epoch:<EOL><INDENT>try:<EOL><INDENT>options["<STR_LIT>"] = int(source_date_epoch)<EOL><DEDENT>except ValueError:<EOL><INDENT>import warnings<EOL>warnings.warn(<EOL>UserWarning("<STR_LIT>" % source_date_epoch))<EOL><DEDENT><DEDENT>if options.pop("<STR_LIT>"):<EOL><INDENT>raise NotImplementedError()<EOL><DEDENT>stem_width_options = options.pop("<STR_LIT>")<EOL>strong_stem_width_options = options.pop("<STR_LIT>")<EOL>if strong_stem_width_options:<EOL><INDENT>import warnings<EOL>warnings.warn(<EOL>UserWarning("<STR_LIT>"))<EOL>stem_width_options = strong_stem_width_options<EOL><DEDENT>options.update(stem_width_options)<EOL>return options<EOL>
Parse command line arguments and return a dictionary of options
    for ttfautohint.ttfautohint function.

    `args` can be either None, a list of strings, or a single string,
    that is split into individual options with `shlex.split`.

    When `args` is None, the console's default sys.argv are used, and any
    SystemExit exceptions raised by argparse are propagated.

    If args is a string list or a string, it is assumed that the function
    was not called from a console script's `main` entry point, but from
    other client code, and thus the SystemExit exceptions are muted and
    a `None` value is returned.