This will parse and sort the building options defined in the '{}'
    constructor. Will only allow one of each argument
172219
def _parse_building_options(string):
    
    contents = _get_contents_between(string, '{', '}')
    unsorted_options = contents.split(',')
    _check_parameters(unsorted_options, ('@', '/', '\\', '^'))

    output_directory = None
    output_format = None
    building_directory = None
    for option in unsorted_options:
        if option[0] == '@':
            if output_format:
                raise ValueError(MULTIPLE_CONFLICTING_BUILD_OPTIONS)
            output_format = option[1:]
        elif option[0] in ('/', '\\'):
            if output_directory:
                raise ValueError(MULTIPLE_CONFLICTING_BUILD_OPTIONS)
            output_directory = option[1:]
        elif option[0] == '^':
            if building_directory:
                raise ValueError(MULTIPLE_CONFLICTING_BUILD_OPTIONS)
            building_directory = option[1:]

    string = string[:string.index('{')]
    return output_directory, output_format, building_directory, string
1203126
function parseOptions(input, callback, keyValueDelim, groupDelim) {
    var groups = groupDelim ? input.split(groupDelim) : [input];
    for (var i in groups) {
      if (typeof groups[i] !== "string") {
        continue;
      }
      var kv = groups[i].split(keyValueDelim);
      if (kv.length !== 2) {
        continue;
      }
      var k = kv[0];
      var v = kv[1];
      callback(k, v);
    }
  }
319902
def find_or_build(cls, **kwargs):
        
        keys = kwargs.pop('keys') if 'keys' in kwargs else []
        return cls.first(**subdict(kwargs, keys)) or cls.build(**kwargs)
285835
function processOptions(options) {
  // Parse preset names
  const presets = (options.presets || []).map(presetName => {
    const preset = loadBuiltin(availablePresets, presetName);

    if (preset) {
      // workaround for babel issue
      // at some point, babel copies the preset, losing the non-enumerable
      // buildPreset key; convert it into an enumerable key.
      if (
        isArray(preset) &&
        typeof preset[0] === "object" &&
        preset[0].hasOwnProperty("buildPreset")
      ) {
        preset[0] = { ...preset[0], buildPreset: preset[0].buildPreset };
      }
    } else {
      throw new Error(
        `Invalid preset specified in Babel options: "${presetName}"`,
      );
    }
    return preset;
  });

  // Parse plugin names
  const plugins = (options.plugins || []).map(pluginName => {
    const plugin = loadBuiltin(availablePlugins, pluginName);

    if (!plugin) {
      throw new Error(
        `Invalid plugin specified in Babel options: "${pluginName}"`,
      );
    }
    return plugin;
  });

  return {
    babelrc: false,
    ...options,
    presets,
    plugins,
  };
}
294516
function _processOptions (options) {
        // Options parsing
        var
            name,
            maxLen;
        if (options instanceof Array) {
            options = gpf.Parameter.parse([{
                name: "port",
                type: "number",
                defaultValue: 80,
                prefix: "port"
            }, {
                name: "root",
                type: "string",
                defaultValue: ".",
                prefix: "root"
            }, {
                name: "chunkSize",
                type: "number",
                defaultValue: 65536,
                prefix: "chunk"
            }, gpf.Parameter.VERBOSE, gpf.Parameter.HELP], options);
        }
        // Server boot trace
        console.log("GPF " + gpf.version() + " web server");
        if (options.root === ".") {
            options.root = process.cwd();
        }
        if (options.verbose) {
            maxLen = 0;
            for (name in options) {
                if (options.hasOwnProperty(name)) {
                    if (name.length > maxLen) {
                        maxLen = name.length;
                    }
                }
            }
            ++maxLen;
            for (name in options) {
                if (options.hasOwnProperty(name)) {
                    console.log([
                        "\t",
                        name,
                        (new Array(maxLen - name.length + 1)).join(" "),
                        ": ",
                        options[name]
                    ].join(""));
                }
            }
        }
        return options;
    }
899111
function optionBuilder(options) {
  options = options || {};

  var results = {stdin: [], args: [], files: []};
  Object.keys(options).map(function (option) {
    var p4option = p4options[option];
    if (!p4option) return;
    if (p4option.category !== 'unary') {
      if ((options[option] || {}).constructor !== p4option.type) return;
    }
    if (p4option.category === 'stdin') {
      results.stdin.push(p4option.cmd + options[option]);
      if (results.args.indexOf('-i') < 0) results.args.push('-i');
    } else if (p4option.cmd) {
      results.args.push(p4option.cmd);
      if (p4option.category === 'mixed') results.args.push(options[option]);
    } else {
      results.files = results.files.concat(options[option]);
    }
  });
  return results;
}
1307611
function processOptions(opt) {
        keys(opt).forEach(function (key) {
            var value = opt[key];
            if (typeof value === 'string') {
                opt[key] = grunt.template.process(value);
            } else if (Array.isArray(value)) {
                opt[key] = value.slice().map(function (i) {
                    return grunt.template.process(i);
                });
            }
        });
    }
781493
def _parse_args():
    
    parser = argparse.ArgumentParser(description='rain - a new sort of automated builder.')
    
    parser.add_argument('action', help='what shall we do?', default='build', nargs='?',
                        choices=['build',
                                 'ls',
                                 'keep'] + removal_cmds)

    parser.add_argument('-c', '--count', type=int, default=1,
                        help='a count of items on which to operate. [default: %(default)s]')

    parser.add_argument('--keep', type=int, default=-1,
                        help='how many builds should we keep around? [default: %(default)s]')

    parser.add_argument('-v', '--verbose', action='count', default=0, help='Be more verbose. (can be repeated)')

    parser.add_argument('--version', default=False, action='store_true',
                        help='print version number and exit. [default: %(default)s]')

    return parser.parse_args()
958259
function parseOptions(opts) {
  opts = opts || {};
  var argv = [];
  var options = {};
  var process_argv = process.argv;
  for (var i = 2; i < process_argv.length; i++) {
    if (process_argv[i].indexOf('--') == 0) {
      var arg = process_argv[i];
      if (arg.indexOf("=") > 0) {
        var arg_kv = arg.split('=');
        arg = arg_kv[0];
        arg = arg.replace('--','');
        arg = replaceAll(arg, '-', '_');
        options[arg] = arg_kv[1];
        if (typeof opts[arg] == 'string') {
          if (opts[arg] == 'int' || opts[arg] == 'integer') {
            options[arg] = parseInt(options[arg]);
          } else if (opts[arg] == 'float') {
            options[arg] = parseFloat(options[arg]);
          }
        } else if (typeof opts[arg] == 'object') {
          if (opts[arg].type == 'array') {
            var sep = opts[arg].separator || opts[arg].sep || ',';
            options[arg] = options[arg].split(sep);
          }
        }
      } else {
        arg = arg.replace('--','');
        arg = replaceAll(arg, '-', '_');
        options[arg] = true;
      }
    } else {
      argv.push(process_argv[i]);
    }
  }
  options.argv = argv;
  return options;
}
1346147
def parse_options(cls, line, ns={}):
        
        parsed = cls.parse(line, ns=ns)
        options_list = []
        for spec in sorted(parsed.keys()):
            options = parsed[spec]
            merged = {}
            for group in options.values():
                merged = dict(group.kwargs, **merged)
            options_list.append(Options(spec, **merged))
        return options_list
721503
function parseClass(params, constructor) {
        var key,
            value,
            saved = {};

        delete params.$locked;

        // Check and save constants to parse later
        if (hasOwn(params, '$constants')) {
            saved.$constants = params.$constants;
            delete params.$constants;
        }

        // Check and save finals to parse later
        if (hasOwn(params, '$finals')) {
            saved.$finals = params.$finals;
            delete params.$finals;
        }

        // Parse members
        parseMembers(params, constructor);

        // Parse constants
        if (saved.$constants) {
            for (key in saved.$constants) {
                value = saved.$constants[key];

                constructor[$class].staticProperties[key] = value;
                constructor[key] = value;
            }
        }

        // Parse finals
        if (saved.$finals) {
            parseMembers(saved.$finals, constructor, true);
        }
    }
1157991
function (options) {
        options = options || {};
        var qs = '';
        if (typeof options === 'string') {
            qs = options;
            options = this.parseOptions(qs);
        }

        for (var key in options) {
            if (!(key in DEFAULT_OPTIONS)) {
                throw new Error('No such option.');
            }
        }
        if (qs.length && !Object.keys(options).length) {
            throw new Error('Invalid argument syntax.');
        }

        this.options = extend(DEFAULT_OPTIONS, options);
    }
70578
function parsePropertyList( root, libs, com, indent ) {
  var first = true;
  var out = '[';
  libs.compileChildren( root );
  root.children.forEach( function( child ) {
    if ( child.type != libs.Tree.TAG ) {
      if ( child.type == libs.Tree.TEXT || child.type == libs.Tree.ENTITY ) {
        if ( child.text.trim( ).length === 0 ) {
          return;
        }
        if ( first ) {
          first = false;
        } else {
          out += ",";
        }
        out += "\n" + indent + JSON.stringify( child.text );
      }
      return;
    }
    if ( first ) {
      first = false;
    } else {
      out += ",";
    }
    out += "\n" + indent;
    if (isWidget( child )) {
      out += parseWidget( child, libs, com, indent + '  ' );
    } else {
      out += parseElement( child, libs, com, indent + '  ' );
    }
  });

  out += ']';
  com.prop[root.name] = out;
}
744526
function parseArgs(args) {
  var options = {
    arch: process.arch,
    platform: process.platform,
    force: process.env.npm_config_force === 'true',
  };

  options.args = args.filter(function(arg) {
    if (arg === '-f' || arg === '--force') {
      options.force = true;
      return false;
    } else if (arg.substring(0, 13) === '--target_arch') {
      options.arch = arg.substring(14);
    } else if (arg === '-d' || arg === '--debug') {
      options.debug = true;
    } else if (arg.substring(0, 13) === '--libsass_ext' && arg.substring(14) !== 'no') {
      options.libsassExt = true;
    }

    return true;
  });

  return options;
}
985192
function parseOptions(options) {
    let functions = true;
    let classes = true;
    let variables = true;
    let typedefs = true;

    if (typeof options === "string") {
        functions = options !== "nofunc";
    } else if (typeof options === "object" && options !== null) {
        functions = options.functions !== false;
        classes = options.classes !== false;
        variables = options.variables !== false;
        typedefs = options.typedefs !== false;
    }

    return { functions, classes, variables, typedefs };
}
651515
def parse_options(args) # :nodoc:
      option_parser_class = self.class.const_get("#{options[:subcommand_option_handling_strategy].to_s.capitalize}CommandOptionParser")
      OptionParsingResult.new.tap { |parsing_result|
        parsing_result.arguments = args
        parsing_result = @global_option_parser.parse!(parsing_result)
        option_parser_class.new(@accepts).parse!(parsing_result, options[:argument_handling_strategy])
      }
    end
999523
def parse_options(options, arg_split:':', valuesep: '=', opt_default: true, keyed_sep: "/")
			return {} unless options
			parsed_options={}
			options=options.split(arg_split) unless options.is_a?(Enumerable)
			options.each do |optvalue|
				opt,value=DR::SimpleParser.parse_namevalue(optvalue,sep: valuesep, default: opt_default)
				parsed_options.set_keyed_value(opt,value, sep: keyed_sep)
			end
			return parsed_options
		end