Get the value specified by the args, in the file specified by th name
7752
def with_file(name, *args)
      logger.debug "with_file(#{name.inspect}, #{args.inspect})"
      result = args.inject(config_for(name)) { |v, i|
        logger.debug "v = #{v.inspect}, i = #{i.inspect}"
        case v
          when Hash
            v[i.to_s]
          when Array
            i.is_a?(Integer) ? v[i] : nil
          else
            nil
        end
      }
      logger.debug "with_file(#{name.inspect}, #{args.inspect}) => #{result.inspect}"
      result
    end
22979
def parse_args(arguments, apply_config=False):
    """"""
    parser = create_parser()
    args = parser.parse_args(arguments)

    if not args.files and not args.list_fixes:
        parser.error('incorrect number of arguments')

    args.files = [decode_filename(name) for name in args.files]

    if apply_config:
        parser = read_config(args, parser)
        args = parser.parse_args(arguments)
        args.files = [decode_filename(name) for name in args.files]

    if '-' in args.files:
        if len(args.files) > 1:
            parser.error('cannot mix stdin and regular files')

        if args.diff:
            parser.error('--diff cannot be used with standard input')

        if args.in_place:
            parser.error('--in-place cannot be used with standard input')

        if args.recursive:
            parser.error('--recursive cannot be used with standard input')

    if len(args.files) > 1 and not (args.in_place or args.diff):
        parser.error('autopep8 only takes one filename as argument '
                     'unless the "--in-place" or "--diff" args are '
                     'used')

    if args.recursive and not (args.in_place or args.diff):
        parser.error('--recursive must be used with --in-place or --diff')

    if args.in_place and args.diff:
        parser.error('--in-place and --diff are mutually exclusive')

    if args.max_line_length <= 0:
        parser.error('--max-line-length must be greater than 0')

    if args.select:
        args.select = _split_comma_separated(args.select)

    if args.ignore:
        args.ignore = _split_comma_separated(args.ignore)
    elif not args.select:
        if args.aggressive:
            # Enable everything by default if aggressive.
            args.select = set(['E', 'W'])
        else:
            args.ignore = _split_comma_separated(DEFAULT_IGNORE)

    if args.exclude:
        args.exclude = _split_comma_separated(args.exclude)
    else:
        args.exclude = set([])

    if args.jobs < 1:
        # Do not import multiprocessing globally in case it is not supported
        # on the platform.
        import multiprocessing
        args.jobs = multiprocessing.cpu_count()

    if args.jobs > 1 and not args.in_place:
        parser.error('parallel jobs requires --in-place')

    if args.line_range:
        if args.line_range[0] <= 0:
            parser.error('--range must be positive numbers')
        if args.line_range[0] > args.line_range[1]:
            parser.error('First value of --range should be less than or equal '
                         'to the second')

    return args
1211624
def get_args(stream_spec, overwrite_output=False):
    """"""
    nodes = get_stream_spec_nodes(stream_spec)
    args = []
    # TODO: group nodes together, e.g. `-i somefile -r somerate`.
    sorted_nodes, outgoing_edge_maps = topo_sort(nodes)
    input_nodes = [node for node in sorted_nodes if isinstance(node, InputNode)]
    output_nodes = [node for node in sorted_nodes if isinstance(node, OutputNode)]
    global_nodes = [node for node in sorted_nodes if isinstance(node, GlobalNode)]
    filter_nodes = [node for node in sorted_nodes if isinstance(node, FilterNode)]
    stream_name_map = {(node, None): str(i) for i, node in enumerate(input_nodes)}
    filter_arg = _get_filter_arg(filter_nodes, outgoing_edge_maps, stream_name_map)
    args += reduce(operator.add, [_get_input_args(node) for node in input_nodes])
    if filter_arg:
        args += ['-filter_complex', filter_arg]
    args += reduce(operator.add, [_get_output_args(node, stream_name_map) for node in output_nodes])
    args += reduce(operator.add, [_get_global_args(node) for node in global_nodes], [])
    if overwrite_output:
        args += ['-y']
    return args
331522
def file_arg(arg):
    
    prefix = 'file://'

    if arg.startswith(prefix):
        return os.path.abspath(arg[len(prefix):])
    else:
        msg = 'Invalid file argument "{}", does not begin with "file://"'
        raise argparse.ArgumentTypeError(msg.format(arg))
657843
public String getValue(String name) {
    for( Entry e : commandLineArgs )
      if( name.equals(e.name) ) return e.val;
    return System.getProperty("h2o.arg."+name);
  }
1122367
def get_arg(context, index):
    """"""
    if index < len(context.argstreams):
        arg = ""
        chunk = yield context.argstreams[index].read()
        while chunk:
            arg += chunk
            chunk = yield context.argstreams[index].read()

        raise tornado.gen.Return(arg)
    else:
        raise TChannelError()
788464
def getargs():
    
    parser = argparse.ArgumentParser(description='\
    Select paths from a directory tree.')
    parser.add_argument("-a", "--hidden", action="store_false",
                        help="Show all hidden paths too.")
    parser.add_argument("-r", "--relative", action="store_true",
                        help="Output relative paths.")
    parser.add_argument("path", type=chkpath, nargs='?',
                        default=".", help="A valid path.")
    return parser.parse_args()
472803
def find_parameter(self, name):
        """"""
        name = self.normalize_name(name)
        arg = self.args.get(name)
        return None if arg is None else arg.parameter
995601
def _read_arg(arg):
    

    # If arg is None, just return it back
    if arg is None:
        arg_out = arg

    else:
        # If len(arg) == 1 and arg[0] is a valid filepath, read it as a grp file
        if len(arg) == 1 and os.path.exists(arg[0]):
            arg_out = grp.read(arg[0])
        else:
            arg_out = arg

        # Make sure that arg_out is a list of strings
        assert isinstance(arg_out, list), "arg_out must be a list."
        assert type(arg_out[0]) == str, "arg_out must be a list of strings."

    return arg_out
277918
def _get_arg_info(self):
        '''
        
        '''
        ret_dict = {
            'args': [],
            #'frame': None,
            'line': 'Unknown',
            'file': 'Unknown',
            'arg_names': []
        }
        arg_vals = self.arg_vals
        #modname = self.modname

        c = self.call
        ret_dict.update(c.info)

        if len(arg_vals) > 0:
            args = []

            if len(ret_dict['arg_names']) > 0:
                # match the found arg names to their respective values
                for i, arg_name in enumerate(ret_dict['arg_names']):
                    args.append({'name': arg_name, 'val': arg_vals[i]})

            else:
                # we can't autodiscover the names, in an interactive shell session?
                for i, arg_val in enumerate(arg_vals):
                    args.append({'name': 'Unknown {}'.format(i), 'val': arg_val})

            ret_dict['args'] = args

        return ret_dict
565281
def get_command_str(args):
    
    single_quote = "'"
    double_quote = '"'
    for i, value in enumerate(args):
        if " " in value and double_quote not in value:
            args[i] = '"%s"' % value
        elif " " in value and single_quote not in value:
            args[i] = "'%s'" % value
    return " ".join(args)
1005583
def get_argv_for_command(self):
        
        argv = [a for a in self.argv]
        argv.insert(0, self.prog_name)
        return argv
506787
def get_arguments(self, name: str, strip: bool = True) -> List[str]:
        

        # Make sure `get_arguments` isn't accidentally being called with a
        # positional argument that's assumed to be a default (like in
        # `get_argument`.)
        assert isinstance(strip, bool)

        return self._get_arguments(name, self.request.arguments, strip)
235559
def get(self, *args, **kwargs):
        ''''''
        # We'll go through all of our required args and make sure they're
        # present
        required = [arg for arg in self._args if arg not in kwargs]
        if len(args) < len(required):
            raise TypeError('Missing arguments %s' % required[len(args):])
        required = list(zip(required, args))
        args = args[len(required):]

        # Now we'll look through our defaults, if there are any
        defaulted = [(name, default) for name, default in self._defaults
            if name not in kwargs]
        overridden = list(zip([d[0] for d in defaulted], args))
        args = args[len(overridden):]
        defaulted = defaulted[len(overridden):]

        # And anything left over is in varargs
        if args and not self._varargs:
            raise TypeError('Too many arguments provided')

        return ArgTuple(required, overridden, defaulted, args, kwargs)
478889
def get_val(self):
        
        with open(os.path.join(self._base, self._attr), 'r') as file_obj:
            return int(file_obj.readline())
798432
def get(args):
    """"""
    from . import config
    for key in args.key.split("."):
        config = getattr(config, key)
    print(json.dumps(config))
958464
def _get_command_args(self, command, args):
        ''''''
        command_args = {}
        command_argument_names =\
            command.__code__.co_varnames[:command.__code__.co_argcount]

        for varname in command_argument_names:
            if varname == 'args':
                command_args['args'] = args
            elif varname in self.provide_args:
                command_args[varname] = self.provide_args[varname]
            else:
                command_args[varname] = getattr(args, varname)
        return command_args