Convert the Argument object to a tuple use in :meth:`~argparse.ArgumentParser.add_argument` calls on the parser
336859
def convert_to_argument(self):
        '''
            
        '''

        field_list = [
            "action", "nargs", "const", "default", "type",
            "choices", "required", "help", "metavar", "dest"
        ]

        return (
            self.name,
            {
                field: getattr(self, field) for field in field_list if getattr(self, field) is not None
            }
        )
138209
def _add(self, name, *args, **kw):
        
        argname = list(self.argdict)[self._argno]
        if argname != name:
            raise NameError(
                'Setting argument %s, but it should be %s' % (name, argname))
        self._group.add_argument(*args, **kw)
        self.all_arguments.append((args, kw))
        self.names.append(name)
        self._argno += 1
1167563
def p_arg_list(p):
    
    if len(p) == 2:
        p[0] = node.expr_list([p[1]])
    elif len(p) == 4:
        p[0] = p[1]
        p[0].append(p[3])
    else:
        assert 0
    assert isinstance(p[0], node.expr_list)
291993
def args(self):  # as args tuple
        '''
        '''
        return (self.base, self.item, self.leng, self.refs,
                self.both, self.kind, self.type)
274332
def add_arguments(self, parser):
        
        parser.description = __doc__
        parser.formatter_class = argparse.RawDescriptionHelpFormatter
        parser.add_argument("--debug", action="store_true", help="Debug level logging")
        parser.add_argument(
            "--force",
            action="store_true",
            help="Import even if local database is not empty",
        )
        parser.add_argument("--clear", action="store_true", help="Clear local database")
        parser.add_argument(
            "--cert-pub",
            dest="cert_pem_path",
            action="store",
            help="Path to PEM formatted public key of certificate",
        )
        parser.add_argument(
            "--cert-key",
            dest="cert_key_path",
            action="store",
            help="Path to PEM formatted private key of certificate",
        )
        parser.add_argument(
            "--public",
            action="store_true",
            help="Do not use certificate even if available",
        )
        parser.add_argument(
            "--timeout",
            type=float,
            action="store",
            default=DEFAULT_TIMEOUT_SEC,
            help="Timeout for D1 API call to the source MN",
        )
        parser.add_argument(
            "--workers",
            type=int,
            action="store",
            default=DEFAULT_N_WORKERS,
            help="Max number workers making concurrent connections to the source MN",
        )
        parser.add_argument(
            "--object-page-size",
            type=int,
            action="store",
            default=d1_common.const.DEFAULT_SLICE_SIZE,
            help="Number of objects to retrieve in each listObjects() call",
        )
        parser.add_argument(
            "--log-page-size",
            type=int,
            action="store",
            default=d1_common.const.DEFAULT_SLICE_SIZE,
            help="Number of log records to retrieve in each getLogRecords() call",
        )
        parser.add_argument(
            "--major",
            type=int,
            action="store",
            help="Use API major version instead of finding by connecting to CN",
        )
        parser.add_argument(
            "--only-log", action="store_true", help="Only import event logs"
        )
        parser.add_argument(
            "--max-obj",
            type=int,
            action="store",
            help="Limit number of objects to import",
        )
        parser.add_argument("baseurl", help="Source MN BaseURL")
941664
def add_arguments(self, parser):
        
        subparsers = parser.add_subparsers(help='sub-command help',
                                           dest='command')

        add_parser = partial(_add_subparser, subparsers, parser)

        add_parser('list', help="list concurrency triggers")
        add_parser('drop', help="drop  concurrency triggers")
        add_parser('create', help="create concurrency triggers")

        parser.add_argument('-d', '--database',
                            action='store',
                            dest='database',
                            default=None,
                            help='limit to this database')

        parser.add_argument('-t', '--trigger',
                            action='store',
                            dest='trigger',
                            default=None,
                            help='limit to this trigger name')
426918
def add_arguments(self, parser):
        '''

        '''
        commands = set(name[3:] for name in dir(self) if name.startswith('do_'))
        parser.add_argument('action', help='action to run', nargs='?',
                            choices=list(commands))
        parser.add_argument('arguments', help='arguments specific to ACTION',
                            nargs=argparse.REMAINDER)
421864
def AddArg(self, argument):
    
    self.args.append(argument)
    if len(self.args) > self.number_of_args:
      raise errors.ParseError('Too many arguments for this expression.')

    elif len(self.args) == self.number_of_args:
      return True

    return False
1290370
def assign_arguments(args = {})
			result_parts = parts.map { |part| assign_argument(part, args) }.compact
			self.class.merge result_parts.unshift(nil)
		end
696617
def set_args(self, **kwargs):
        
        try:
            kwargs_items = kwargs.iteritems()
        except AttributeError:
            kwargs_items = kwargs.items()
        for key, val in kwargs_items:
            self.args[key] = val
180541
def register_arguments(self, parser):
        
        parser.add_argument('x', type=int, help='the first value')
        parser.add_argument('y', type=int, help='the second value')
881277
def str_args(args):
    
    res = []
    for x in args:
        if isinstance(x, tuple) and len(x) == 2:
            key, value = x
            if value and str_arg(value):
                res += ["%s=%s" % (key, str_arg(value))]
        else:
            res += [str_arg(x)]
    return ', '.join(res)
943896
def argparser_factory(self):
        

        return ArgumentParser(
            prog=self.prog, description=self.__doc__, add_help=False,
        )
610618
def _fill_argparser(self, parser):
        
        for key, val in self._options.items():
            add_argument(parser, key, val)
694763
def add_arguments(cls, parser, sys_arg_list=None):
        
        parser.add_argument('--tcp_check_interval',
                            dest='tcp_check_interval',
                            required=False, default=2, type=float,
                            help="TCP health-test interval in seconds, "
                                 "default 2 "
                                 "(only for 'tcp' health monitor plugin)")
        parser.add_argument('--tcp_check_port',
                            dest='tcp_check_port',
                            required=False, default=22, type=int,
                            help="Port for TCP health-test, default 22 "
                                 "(only for 'tcp' health monitor plugin)")
        return ["tcp_check_interval", "tcp_check_port"]
352270
def parse_arguments():
    
    parser = argparse.ArgumentParser()

    parser.add_argument('file', metavar="FILE", nargs='+',
                        help='file to be made executable')
    parser.add_argument("-p", "--python", metavar="VERSION",
                        help="python version (2 or 3)")
    parser.add_argument('-v', '--version', action='version',
                        version='%(prog)s ' + __version__, help='show version')
    parser.add_argument('-r', '--recursive', action='store_true',
                        help='recursively iterate the directories')

    args = parser.parse_args()
    return args
1327323
def add_option(self, *args, **kwargs):
        """"""
        if self.parseTool == 'argparse':
            if args and args[0] == '':   # no short option
                args = args[1:]
            return self.parser.add_argument(*args, **kwargs)
        else:
            return self.parser.add_option(*args, **kwargs)