Get special options patch, cols, and splits if analysis in emp module
497787
def _emp_extra_options(options):
    

    # Check that metadata is valid
    metadata_path = os.path.normpath(os.path.join(options['param_dir'],
                                                  options['metadata']))
    if not os.path.isfile(metadata_path):
        raise IOError, ("Path to metadata file %s is invalid." %
                        metadata_path)
    options['metadata_path'] = metadata_path

    # Using subset if given, create and store patch
    subset = options.get('subset', '')
    options['patch'] = emp.Patch(metadata_path, subset)

    # If cols or splits not given in options, make empty strings
    if 'cols' not in options.keys():
        options['cols'] = ''
    if 'splits' not in options.keys():
        options['splits'] = ''

    return options
496338
def parse_md_code_options(options):
    """"""

    metadata = []
    while options:
        name_and_value = re.split(r'[\s=]+', options, maxsplit=1)
        name = name_and_value[0]

        # Equal sign in between name and what's next?
        if len(name_and_value) == 2:
            sep = options[len(name):-len(name_and_value[1])]
            has_value = sep.find('=') >= 0
            options = name_and_value[1]
        else:
            has_value = False
            options = ''

        if not has_value:
            metadata.append((name, None))
            continue

        try:
            value = loads(options)
            options = ''
        except JSONDecodeError as err:
            try:
                split = err.colno - 1
            except AttributeError:
                # str(err) is like: "ValueError: Extra data: line 1 column 7 - line 1 column 50 (char 6 - 49)"
                match = re.match(r'.*char ([0-9]*)', str(err))
                split = int(match.groups()[0])

            value = loads(options[:split])
            options = options[split:]

        metadata.append((name, value))

    return metadata
160544
def configured_options(self):
        """"""
        stdout_lines = self._check_output(['config', '--list']).splitlines()
        return {key: value for key, value in [line.split('=') for line in stdout_lines]}
1352713
function getMethods(spec_c, parent) {
  var spec_js = {};
  var methods = _.find(getChildren(spec_c, 'sectiondef'), function(section) {
    var kind = getAttr(section, 'kind');
    return ((kind == 'public-func') || (kind == 'func'));
  });
  if (methods) {
    _.each(methods.children, function(method) {
      var methodName = getText(getChild(method, 'name'), 'name');
      if (methodName[0] != '~') { // filter out destructors
        try {
          var description = getChild(method, 'detaileddescription');
          var methodDescription = getText(description, 'description');
          var paramsSpec = getChildren(method, 'param');
          var params = {};
          if (hasParams(paramsSpec)) {
              params = getParams(paramsSpec, getParamsDetails(description), methodName, parent);
          }
          var returnSpec = getChild(method, 'type');
          var retval = {};
          if (!_.isEmpty(returnSpec)) {
            retval = getReturn(returnSpec, getReturnDetails(description), methodName, parent);
          }
          methodName = getUniqueMethodName(methodName, spec_js, parent);
          spec_js[methodName] = {
            description: methodDescription,
            params: params,
            return: retval
          };
        } catch(e) {
          console.log((parent ? (parent + '.') : '') + methodName + ' is omitted from JS documentation.');
          console.log('  ' + e.toString());
        }
      }
    });
  }
  return spec_js;
}
992790
function patchIt(specs) {
  var original = it;
  var restore = function() {
    it = original;
    xit = it.skip;
  };

  var createSpec = function(name, fn, opts) {
    opts = opts || {};

    var spec = {
      name: name,
      getPromise: function() {
        var start = Date.now();
        return createWrapper(fn, spec.ctx)().then(function(duration) {
          spec.duration = duration;
        });
      },
      duration: 0,
      only: opts.only || null,
      skip: opts.skip || null,
      timeout: null,
      error: null,
      promise: null
    };

    spec.ctx = new ContextProxy(spec);
    specs.push(spec);
  };

  it = function it(name, fn) {
    createSpec(name, fn, {skip: !fn});
  };

  xit = it.skip = function skip(name, fn) {
    createSpec(name, fn, {skip: true});
  };

  it.only = function only(name, fn) {
    createSpec(name, fn, {only: true});
  };

  return restore;
}
819185
function parseOptions(options) {
  let separator
  let transformer

  if (2 === options.length) {
    [separator, transformer] = options
    if (defaultTransformers[transformer]) {
      transformer = defaultTransformers[transformer] /* Don't validate */
      validate({ separator })
    } else {
      validate({ separator, transformer })
    }
  } else if (1 === options.length) {
    const option = options[0]
    if (false === option || 'function' === typeof option) {
      transformer = option /* Don't validate */
    } else if (defaultTransformers[option]) {
      transformer = defaultTransformers[option] /* Don't validate */
    } else {
      separator = option
      validate({ separator })
    }
  }

  return { separator, transformer }
}
397128
def __get_options(self, rouge_args=None):
        
        if self.args:
            options = self.args.split()
        elif rouge_args:
            options = rouge_args.split()
        else:
            options = [
                '-e', self._data_dir,
                '-c', 95,
                '-2',
                '-1',
                '-U',
                '-r', 1000,
                '-n', 4,
                '-w', 1.2,
                '-a',
                ]
            options = list(map(str, options))

        options = self.__add_config_option(options)
        return options
65633
function getOptions(opts) {
  const mergedOptions = getMergedOptions(opts || {});

  // For saving JSON from mochawesome reporter
  if (mergedOptions.saveJson) {
    mergedOptions.jsonFile = `${getFilename(mergedOptions)}.json`;
  }

  mergedOptions.htmlFile = `${getFilename(mergedOptions)}.html`;
  return mergedOptions;
}
1072423
def _parse_options(entry, options, include_unset=True):
    '''
    
    '''
    log_cfg = {}
    options = shlex.split(options)
    if not options:
        return None

    ## identifier is entry or log?
    if entry.startswith('/'):
        log_cfg['log_file'] = entry
    else:
        log_cfg['entryname'] = entry

    ## parse options
    # NOTE: we loop over the options because values may exist multiple times
    index = 0
    while index < len(options):
        # log file
        if index in [0, (len(options)-1)] and options[index].startswith('/'):
            log_cfg['log_file'] = options[index]

        # check if toggle option
        elif options[index] in option_toggles:
            log_cfg[option_toggles[options[index]]] = True

        # check if flag option
        elif options[index] in option_flags and (index+1) <= len(options):
            log_cfg[option_flags[options[index]]] = int(options[index+1]) if options[index+1].isdigit() else options[index+1]
            index += 1

        # unknown options
        else:
            if 'additional_options' not in log_cfg:
                log_cfg['additional_options'] = []
            if ' ' in options[index]:
                log_cfg['dditional_options'] = "'{}'".format(options[index])
            else:
                log_cfg['additional_options'].append(options[index])

        index += 1

    ## turn additional_options into string
    if 'additional_options' in log_cfg:
        log_cfg['additional_options'] = " ".join(log_cfg['additional_options'])

    ## ensure we have a log_file
    # NOTE: logadm assumes logname is a file if no log_file is given
    if 'log_file' not in log_cfg and 'entryname' in log_cfg:
        log_cfg['log_file'] = log_cfg['entryname']
        del log_cfg['entryname']

    ## include unset
    if include_unset:
        # toggle optioons
        for name in option_toggles.values():
            if name not in log_cfg:
                log_cfg[name] = False

        # flag options
        for name in option_flags.values():
            if name not in log_cfg:
                log_cfg[name] = None

    return log_cfg
518213
function getCommandlineOptions () {
  "use strict";
  var ret = { };
  const knownArgs = {
    "-k": "stopAfterFirstErrors",
    "-h": "printAsHTML",
    "-j": "printAsJSON",
    "-l": "onlyListFailures",
    "-v": "reportPassingFiles"
  };
  while (process.argv.length > 2 && process.argv[2] in knownArgs) {
    ret[knownArgs[process.argv[2]]] = true;
    process.argv.splice(2, 1);
  }
  if (process.argv.length < 3 || Object.keys(process.argv).length === 0 && process.argv.length < 4)
    throw "Usage: "+process.argv[1]+" [-h] [-j] [-l] [-v] [-k] <JSG file> <JSON file..>";
  ret.schema = process.argv[2];
  ret.data = process.argv.slice(3);
  return ret;
}
163744
def _parse_specific_options(self, data):
        
        data['common_flags'] = []
        data['ld_flags'] = []
        data['c_flags'] = []
        data['cxx_flags'] = []
        data['asm_flags'] = []
        for k, v in data['misc'].items():
            if type(v) is list:
                if k not in data:
                    data[k] = []
                data[k].extend(v)
            else:
                if k not in data:
                    data[k] = ''
                data[k] = v
1141670
def patch_modules():
    
    old_call = subprocess.call

    def dummy_call(*args, **kwargs):
        with tempfile.TemporaryFile("wb+") as f:
            kwargs["stdout"] = f
            kwargs["stderr"] = f
            rv = subprocess.Popen(*args, **kwargs).wait()
            f.seek(0)
            click.echo(f.read().decode("utf-8", "replace").rstrip())
        return rv

    subprocess.call = dummy_call

    try:
        yield
    finally:
        subprocess.call = old_call
359838
def options(self, glob=False, **args):
        
        kwargs = {}
        for argname, argarg in args.items():
            if argname == "sort":
                argarg = self._getPattern(argarg)
            if argname not in ["done", "undone"]:
                kwargs[argname] = argarg
        if "done" in args or "undone" in args:
            kwargs["done"] = self._getDone(
                args.get("done"), args.get("undone")
            )

        self.model.setOptions(glob=glob, **kwargs)
694615
function fixOptions (options) {
	if (!options) {
		options = {};
	}

	options.use_sourcemaps = options.use_sourcemaps ? true : false;

	options.babelify = fixBabelify(options.babelify);
	// options.external = fixExternal(options.external);
	options.ignore = fixIgnore(options.ignore);
	options.exclude = fixExclude(options.exclude);
	return options;
}
26644
function (el) {
        var opts = {}, ii, p,
            opts_arr = (el.attr('data-options') || ':').split(';'),
            opts_len = opts_arr.length;

        function isNumber (o) {
          return ! isNaN (o-0) && o !== null && o !== "" && o !== false && o !== true;
        }

        function trim(str) {
          if (typeof str === 'string') return $.trim(str);
          return str;
        }

        // parse options
        for (ii = opts_len - 1; ii >= 0; ii--) {
          p = opts_arr[ii].split(':');

          if (/true/i.test(p[1])) p[1] = true;
          if (/false/i.test(p[1])) p[1] = false;
          if (isNumber(p[1])) p[1] = parseInt(p[1], 10);

          if (p.length === 2 && p[0].length > 0) {
            opts[trim(p[0])] = trim(p[1]);
          }
        }

        return opts;
      }
163856
function calculateOptions(optionsArg, markdown) {
  const optionsEmbedded = getEmbeddedOptions(markdown);
  const options = defaults(optionsArg, defaults(optionsEmbedded, optionDefaults));
  return options;
}
1087829
function getDefaultModules() {
  return {
    rules: [
      {
        test: /\.(ts|tsx)$/,
        include: srcPath,
        loader: 'tslint-loader',
        enforce: 'pre',
        exclude: '/node_modules/'
      },
      {
        test: /\.(ts|tsx)$/,
        include: srcPath,
        loader: 'ts-loader',
        exclude: '/node_modules/'
      },
      {
        test: /\.(js|jsx)$/,
        include: srcPath,
        loader: 'tslint-loader',
        enforce: 'pre',
        exclude: '/node_modules/'
      },
      {
        test: /\.(js|jsx)$/,
        loader: 'babel-loader',
        exclude: '/node_modules/'
      },
      {
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader',
        ]
      },
      {
        test: /\.sass/,
        use: [
          'style-loader',
          'css-loader',
          {
            loader: 'sass-loader',
            options: {
              outputStyle: 'expanded',
              indentedSyntax: true
            }
          }
        ]
      },
      {
        test: /\.scss/,
        use: [
          'style-loader',
          'css-loader',
          {
            loader: 'sass-loader',
            options: {
              outputStyle: 'expanded'
            }
          }
        ]
      },
      {
        test: /\.less/,
        use: [
          'style-loader',
          'css-loader',
          'less-loader'
        ]
      },
      {
        test: /\.styl/,
        use: [
          'style-loader',
          'css-loader',
          'stylus-loader'
        ]
      },
      {
        test: /\.(png|jpg|gif|woff|woff2)$/,
        loader: 'url-loader',
        options: {
          limit: 8192
        }
      },
      {
        test: /\.svg/,
        loader: 'raw-loader',
      },
      {
        test: /\.(mp4|ogg)$/,
        loader: 'file-loader'
      }
    ]
  };
}