Load arguments prefixed with '@' from file as string

        :param args: Arguments passed from command line
        :type args: list
169224
def _expand_prefixed_files(args):
        
        for arg, _ in enumerate(args):
            if args[arg].startswith('@'):
                try:
                    logger.debug('Attempting to read file %s', args[arg][1:])
                    with open(args[arg][1:], 'r') as f:
                        content = f.read()
                    args[arg] = content
                except IOError:
                    # Leave arg unmodified
                    logger.debug('File Error: Failed to open %s, assume not a file', args[arg][1:])
        return args
1138027
public List<String> load(String[] args) throws IOException {
    setLogLevel(Level.WARNING);

    mappings.addJreMappings();

    // Create a temporary directory as the sourcepath's first entry, so that
    // modified sources will take precedence over regular files.
    fileUtil.setSourcePathEntries(new ArrayList<>());

    ArgProcessor processor = new ArgProcessor();
    processor.processArgs(args);
    postProcessArgs();

    return processor.sourceFiles;
  }
539224
def parse_args(logged_line)
      block_contents = logged_line[/\{(.*?)\}/, 1]
      args = block_contents ? block_contents.split(";").map {|arg| arg.strip } : []
    end
564879
def load_from_file(cls, filename_prefix):
    """"""
    filename = cls._filename(filename_prefix)
    lines, _ = cls._read_lines_from_file(filename)
    # Strip wrapping single quotes
    vocab_list = [line[1:-1] for line in lines]
    return cls(vocab_list=vocab_list)
1117515
def load_parameters(self, path):
        
        nn.load_parameters(path)
        for v in self.get_modules():
            if not isinstance(v, tuple):
                continue
            prefix, module = v
            for k, v in module.__dict__.items():
                if not isinstance(v, nn.Variable):
                    continue
                pname = k
                name = "{}/{}".format(prefix, pname)
                # Substitute
                param0 = v
                param1 = nn.parameter.pop_parameter(name)
                if param0 is None:
                    raise ValueError(
                        "Model does not have {} parameter.".format(name))
                param0.d = param1.d.copy()
                nn.logger.info("`{}` loaded.)".format(name))
1360850
def _parse_arguments(arguments=None):
    """"""
    dir_hash = hashlib.sha1(os.getcwd().encode("utf-8")).hexdigest()

    parser = argparse.ArgumentParser(description="""Find spelling errors""")
    parser.add_argument("files",
                        nargs="*",
                        metavar=("FILE"),
                        help="""read FILE""",
                        type=str)
    parser.add_argument("--spellcheck-cache",
                        help="""path to spell-checking cache file""",
                        default=None)
    parser.add_argument("--technical-terms",
                        help="""path to file to source technical terms from""",
                        default=None)
    parser.add_argument("--stamp-file-path",
                        help="""path to directory to store cached results""",
                        default=os.path.join(tempfile.gettempdir(),
                                             "jobstamps",
                                             "spellcheck_linter",
                                             dir_hash))

    return parser.parse_args(arguments)
769216
def _parse_args(cls):
        
        cls.parser = argparse.ArgumentParser()
        cls.parser.add_argument(
            "symbol", help="Symbol for horizontal line", nargs="*")
        cls.parser.add_argument(
            "--color", "-c", help="Color of the line", default=None, nargs=1)
        cls.parser.add_argument(
            "--version", "-v", action="version", version="0.13")

        return cls.parser
161603
def load_data(self, filename, *args, **kwargs):
        
        # load text data
        data = super(MixedTextXLS, self).load_data(filename)
        # iterate through sheets in parameters
        for sheet_params in self.parameters.itervalues():
            # iterate through the parameters on each sheet
            for param, pval in sheet_params.iteritems():
                pattern = pval.get('pattern', EFG_PATTERN)  # get pattern
                re_meth = pval.get('method', 'search')  # get re method
                # whitelist re methods, getattr could be considered harmful
                if re_meth in RE_METH:
                    re_meth = getattr(re, pval.get('method', 'search'))
                else:
                    msg = 'Only', '"%s", ' * len(RE_METH) % tuple(RE_METH)
                    msg += 'regex methods are allowed.'
                    raise AttributeError(msg)
                # if not isinstance(data[param], basestring):
                #     re_meth = lambda p, dp: [re_meth(p, d) for d in dp]
                match = re_meth(pattern, data[param])  # get matches
                if match:
                    try:
                        match = match.groups()
                    except AttributeError:
                        match = [m.groups() for m in match]
                    npdata = np.array(match, dtype=float).squeeze()
                    data[param] = npdata * UREG(str(pval.get('units') or ''))
                else:
                    raise MixedTextNoMatchError(re_meth, pattern, data[param])
        return data
748604
def load_args(args):
    
    config = kaptan.Kaptan(handler='yaml')
    conf_parent = os.path.expanduser('~')
    conf_app = '.clancy'
    conf_filename = 'config.yaml'

    conf_dir = os.path.join(conf_parent, conf_app)
    for loc in [os.curdir, conf_dir]:
        configpath = os.path.join(loc, conf_filename)
        try:
            if os.path.isfile(configpath):
                config.import_config(configpath)
                break
        except (ValueError, ParserError, ScannerError):
            warn("Ignoring invalid valid yaml file {}".format(configpath))

    config = (config.configuration_data
              if config.configuration_data is not None else {})

    # Prepend '--' to conf file keys so it matches docopt. This is the dumbest
    # thing in the world.
    for key, val in config.items():
        config['--'+key] = val
        del config[key]

    return validate(merge(args, config))
393879
def load_config_from_cli_arguments(self, *args, **kwargs):
        
        self._load_config_from_cli_argument(key='handlers_package', **kwargs)
        self._load_config_from_cli_argument(key='auth', **kwargs)
        self._load_config_from_cli_argument(key='user_stream', **kwargs)
        self._load_config_from_cli_argument(key='min_seconds_between_errors', **kwargs)
        self._load_config_from_cli_argument(key='sleep_seconds_on_consecutive_errors', **kwargs)
953474
def load_prefix_file!
      @prefixes = {}
      File.open("#{File.dirname(__FILE__)}/../../mac-prefixes.txt", 'r').each_line do |line|
        line.strip!
        next if line.empty? || line.start_with?('#', '//')
        oui, organization = line.split(' ', 2)
        @prefixes[oui.to_sym] = organization
      end
    end
1221945
def parse_args(args=sys.argv[1:]):
    
    parser = argparse.ArgumentParser()
    parser.add_argument('-a', '--address', help='address to listen on, default localhost',
                                default='localhost')
    parser.add_argument('-p', '--port', help='port to listen on, default 1234',
                                default=1234, type=int)
    parser.add_argument('-d', '--directory', help='directory to serve, default .',
                                default='.')
    parser.add_argument('-n', '--noindex', help='do not show directory indexes',
                                default=False, action='store_true')
    loglevel = parser.add_mutually_exclusive_group()
    loglevel.add_argument('-v', '--verbose', help='verbose logging',
                                default=False, action='store_true')
    loglevel.add_argument('-q', '--quiet', help='quiet logging',
                                default=False, action='store_true')
    return parser.parse_args(args)
1219492
def load_arguments(self, command):
        
        from knack.arguments import ArgumentsContext

        self.cli_ctx.raise_event(EVENT_CMDLOADER_LOAD_ARGUMENTS, cmd_tbl=self.command_table, command=command)
        try:
            self.command_table[command].load_arguments()
        except KeyError:
            return

        # ensure global 'cmd' is ignored
        with ArgumentsContext(self, '') as c:
            c.ignore('cmd')

        self._apply_parameter_info(command, self.command_table[command])
1156406
def cmd_loadfile(args):
    ''''''
    if len(args) != 1:
        fileargs = " ".join(args)
    else:
        fileargs = args[0]
    if not os.path.exists(fileargs):
        print("Error loading file ", fileargs);
        return
    if os.name == 'nt':
        #convert slashes in Windows
        fileargs = fileargs.replace("\\", "/")
    loadfile(fileargs.strip('"'))
408475
def create_args_parser():
    
    parser = argparse.ArgumentParser(
        description='Dialect-aware s-expression indenter', prog='yasi')
    parser.add_argument('files', help='List of files to be indented. '
                        'Will indent from standard input if no files are specified',
                        nargs='*')
    parser.add_argument(
        '-nc', '--no-compact', '--nc', dest='compact',
        help='Do not compact the code, just indent', action='store_false')
    parser.add_argument(
        '-nb', '--no-backup', '--nb', dest='backup', action='store_false',
        help='Do not create a backup file even if --backup-dir is specified ')
    parser.add_argument(
        '-nm', '--no-modify', '--nm', dest='modify',
        help='Do not modify the file', action='store_false')
    parser.add_argument(
        '--diff', '-diff', dest='output_diff',
        help='Prints unified diff of the initial and final result',
        action='store_true')
    parser.add_argument(
        '-nw', '--no-warning', '--nw', dest='warning',
        help='Do not display warnings', action='store_false')
    parser.add_argument(
        '-nr', '--no-rc', '--nr', dest='read_rc',
        help='Ignore any rc files in the current or home folder',
        action='store_false')
    parser.add_argument(
        '--no-output', '-no-output', dest='output',
        help='Suppress output of the indented code', action='store_false')
    parser.add_argument(
        '-c', '--color', '-color', dest='colour_diff',
        help='Display diff text in color', action='store_true')
    parser.add_argument(
        '-ne', '--no-exit', '--ne', dest='exit', action='store_false',
        help='Instructs the program not to exit when a warning is raised.')
    parser.add_argument(
        '-o', dest='output_file',
        help='Path/name of output file', type=str, default='')
    parser.add_argument(
        '--tab', '-tab', dest='tab_size',
        help='Indent with tabs using the specified tabwidth. A tab is assumed \
        equal to 4 spaces by default when expanding the tabs in the input file',
        type=int, default=-1)
    parser.add_argument(
        '--dialect', '-dialect',
        help='Use Scheme keywords', type=str, default='')
    parser.add_argument(
        '-v', '--version', action='version',
        help='Prints script version', version='yasi v%s' % __version__)
    parser.add_argument(
        '-suffix', '--suffix', dest='backup_suffix', help='Backup file suffix',
        type=str, default='.yasi.bak~')
    parser.add_argument(
        '-bd', '--backup-dir', '--bd', '-backup-dir',
        help='The directory where the backup file is to be written',
        type=str, default=os.getcwd())
    parser.add_argument(
        '-is', '--indent-size', '--is',
        help='The number of spaces per indent',
        type=int, default=2)
    parser.add_argument(
        '-di', '--default-indent', '--di',
        help='The indent level to be used in case a ' +
        "function's argument is in the next line. Vim uses 2, the most common being 1.",
        type=int, default=1)
    parser.add_argument(
        '-ic', '--indent-comments', '--ic',
        help='If true, comment lines will be indented possibly ' +
        'messing with any deliberate comment layout', action='store_true')
    parser.add_argument(
        '-uni', '--uniform', '-uniform', '--uni',
        help='Dictates whether the if-clause and else-clause of an if-like' +
        'block should have the same indent level.',
        action='store_true')
    return parser
626098
private static String[] readArgsFile(String argsFile) throws IOException {
    final ArrayList<String> lines = new ArrayList<String>();
    final BufferedReader reader = new BufferedReader(
        new InputStreamReader(
            new FileInputStream(argsFile), "UTF-8"));
    try {
      String line;
      while ((line = reader.readLine()) != null) {
        line = line.trim();
        if (!line.isEmpty() && !line.startsWith("#")) {
          lines.add(line);
        }
      }
    } finally {
      reader.close();
    }
    return lines.toArray(new String [lines.size()]);
  }
911476
def parsed_args(args)
      args.inject({}) do |memo, method|
        memo.merge(method.is_a?(Hash) ? method : { method => nil })
      end
    end