'Parse given arguments and return options and positional arguments.
Arguments must be given as a list and are typically sys.argv[1:].
Options are returned as a dictionary where long options are keys. Value
is a string for those options that can be given only one time (if they
are given multiple times the last value is used) or None if the option
is not used at all. Value for options that can be given multiple times
(denoted with \'*\' in the usage) is a list which contains all the given
values and is empty if options are not used. Options not taken
arguments have value False when they are not set and True otherwise.
Positional arguments are returned as a list in the order they are given.
If \'check_args\' is True, this method will automatically check that
correct number of arguments, as parsed from the usage line, are given.
If the last argument in the usage line ends with the character \'s\',
the maximum number of arguments is infinite.
Possible errors in processing arguments are reported using DataError.
Some options have a special meaning and are handled automatically
if defined in the usage and given from the command line:
--escape option can be used to automatically unescape problematic
characters given in an escaped format.
--argumentfile can be used to automatically read arguments from
a specified file. When --argumentfile is used, the parser always
allows using it multiple times. Adding \'*\' to denote that is thus
recommend. A special value \'stdin\' can be used to read arguments from
stdin instead of a file.
--pythonpath can be used to add extra path(s) to sys.path.
--help and --version automatically generate help and version messages.
Version is generated based on the tool name and version -- see __init__
for information how to set them. Help contains the whole usage given to
__init__. Possible <VERSION> text in the usage is replaced with the
given version. Possible <--ESCAPES--> is replaced with available
escapes so that they are wrapped to multiple lines but take the same
amount of horizontal space as <---ESCAPES--->. Both help and version
are wrapped to Information exception.'

def parse_args(self, args):

    args = (self._get_env_options() + list(args))
    args = [system_decode(a) for a in args]
    if self._auto_argumentfile:
        args = self._process_possible_argfile(args)
    (opts, args) = self._parse_args(args)
    if (self._auto_argumentfile and opts.get('argumentfile')):
        raise DataError("Using    '--argumentfile'    option    in    shortened    format    like    '--argumentf'    is    not    supported.")
    (opts, args) = self._handle_special_options(opts, args)
    self._arg_limit_validator(args)
    if self._validator:
        (opts, args) = self._validator(opts, args)
    return (opts, args)
