opts = { entries: { <repr>: <path> } , bundler: { flags: [] , command: "" } }
770579
function handleEntryPoints(opts, io, nextHandler) {
  var entries = opts.entries
    , bundlerOpts

  bundlerOpts = opts.bundler

  if(!bundlerOpts || !bundlerOpts.legacy) {
    return nextHandler
  }

  if(!opts.entries || !opts.bundler) {
    return nextHandler
  }

  return handle

  function handle(server, req, resp, parsed) {
    if(!(parsed.pathname in entries) && !('browserify' in parsed.query)) {
      return nextHandler(server, req, resp, parsed)
    }

    var entryPath = entries[parsed.pathname]
      , args = bundlerOpts.flags.slice()
      , bundler
      , output

    if(entryPath) {
      args.unshift(entryPath)
    }

    args.unshift(bundlerOpts.command)
    parsed.loggedPathname = ansicolors.magenta(
        parsed.pathname + ' -> ' + args.map(toLocal).join(' ')
    )
    args.shift()

    bundler = spawn(bundlerOpts.command, args)
    bundler.stderr.pipe(accumError(io.error, resp))
    resp.setHeader('content-type', 'text/javascript')
    bundler.stdout.pipe(resp)
  }

  function toLocal(file) {
    return file.replace(opts.cwd, '.')
  }
}
1073711
function normalize(opts) {
	if (typeof opts === 'string') {
		opts = {path: opts};
	}
	opts.path = path.resolve(opts.path);
	return opts;
}
134921
function getFilterPattern(options) {
	var pattern;

	// if the --dev flag is passed, generate a bundle with the
	// node_modules dependencies AND StealJS @config graph
	if (options.dev) {
		pattern = ["node_modules/**/*", "package.json"];
	}
	// make a bundle of dependencies in node_modules folder
	// when the --deps flag is used
	else if (options.deps) {
		pattern = "node_modules/**/*";
	}

	return pattern;
}
259678
function config(opts) {
  if (!opts) return;
  if (opts.baseUrl) _baseUrl = parse(opts.baseUrl).bareId + '/';

  if (opts.paths) {
    Object.keys(opts.paths).forEach(path => {
      let alias = opts.paths[path];
      _paths[cleanPath(path)] = cleanPath(alias);
    });
  }

  if (opts.bundles) {
    Object.keys(opts.bundles).forEach(bundleName => {
      const spaces = opts.bundles[bundleName];
      if (Array.isArray(spaces)) {
        _bundles[bundleName] = {
          user: arrayToHash(spaces),
          package: arrayToHash([])
        };
      } else {
        _bundles[bundleName] = {
          nameSpace: spaces.nameSpace || null,
          user: arrayToHash(spaces.user || []),
          package: arrayToHash(spaces.package || [])
        };
      }
    });
  }
}
1319305
function(file, opts) {
	if (util.isObject(file) || util.isArray(file)) {
		return file;
	}

	var options = util.extend({
		asText: false, // true, false, 'pretty'
		javascript: false, // true, false
		scope: '', // directory to look for initial file
		variables: {
			// contains a key->value object with variables to @extends
		}
	}, opts);

	file = util.template(file, options.variables);

	/*****************************************************************************
	*  Initialize
	*****************************************************************************/

	var file_path;

	// If the file path is absolute use it
	// If not then prepend the current scope of the previous file.
	if (path.resolve(file) === path.normalize(file)) {
		file_path = path.normalize(file);
	}
	else {
		file_path = path.normalize(
			options.scope ? options.scope + '/' + file : file
		);
	}
	var class_json = parseFile(file_path, options);

	// Stores JSON objects of files that have to be merged together:
	// ["a", "b"]
	var file_list = util.isArray(class_json[indicators.EXTENDS]) ?
		class_json[indicators.EXTENDS] :
		class_json[indicators.EXTENDS] != null ?
			[ class_json[indicators.EXTENDS] ] :
			[];

	// Delete @extends from base_json to avoid infinitive recursion
	delete class_json[indicators.EXTENDS];

	// Push class_json to the path list:
	file_list.push(class_json);
	/*****************************************************************************
	*  Merge file by file
	*****************************************************************************/

	// default config for each file required:
	// set asText = false so we get an object returned
	// set scope = file's directory so there can be relative references
	var json_config = util.defaults({
		asText: false,
		scope: path.dirname(file_path),

		// _as is a hack so that we know its we are calling the function recursive
		_as: ANTI_SANITIZER
	}, options);

	// super_json is our output, start by containing first file in array
	var super_json = fromFile(file_list.shift(), json_config);

	// TODO: Figure out when to sanitize super_json hopefully we don't have to
	//   santize all returns. I'm not sure about this, and I'm not sure if we
	//   can even sanitize super_json when we return it.
	//   Is super_json used by anyone recursively?

	while (file_list.length) {
		var json = fromFile(file_list.shift(), json_config);

		merge(super_json, json);
	}

	// If this file is called from the outside eg json_merger.from...
	//   File('file_which_doesnt_extends_another_file.json')
	//   we need to sanitize the file and remove all indicators
	if (options._as != ANTI_SANITIZER) {
		super_json = util.sanitizeValue(super_json);
	}

	/*****************************************************************************
	*  Return super_json
	*****************************************************************************/
	if (options.asText) {
		return stringify(super_json, options);
	}
	else {
		return super_json;
	}
}
579015
function RegistryClientV1(opts) {
    var self = this;
    assert.object(opts, 'opts');
    assert.string(opts.name, 'opts.name');
    assert.optionalObject(opts.log, 'opts.log');
    assert.optionalString(opts.username, 'opts.username');
    assert.optionalString(opts.password, 'opts.password');
    assert.optionalBool(opts.insecure, 'opts.insecure');
    assert.optionalString(opts.scheme, 'opts.scheme');
    // TODO: options to control the trust db for CA verification
    // TODO add passing through other restify options
    // Restify/Node HTTP client options.
    // opt.agent (optional, bool or object)
    assert.optionalString(opts.userAgent, 'opts.userAgent');
    // opts.proxy (optional, bool or object or string);

    this.log = opts.log
        ? opts.log.child({
                component: 'registry',
                serializers: restifyClients.bunyan.serializers
            })
        : bunyan.createLogger({
                name: 'registry',
                serializers: restifyClients.bunyan.serializers
            });

    this.insecure = Boolean(opts.insecure);
    this.repo = common.parseRepo(opts.name);
    if (opts.scheme) {
        this.repo.index.scheme = opts.scheme;
    } else if (common.isLocalhost(this.repo.index.name)) {
        // Per docker.git:registry/config.go#NewServiceConfig we special
        // case localhost to allow HTTP. Note that this lib doesn't do
        // the "try HTTPS, then fallback to HTTP if allowed" thing that
        // docker-docker does, we'll just prefer HTTP for localhost.
        this.repo.index.scheme = 'http';
    }

    if (opts.username && opts.password) {
        var buffer = new Buffer(opts.username + ':' + opts.password, 'utf8');
        this._authorization = 'Basic ' + buffer.toString('base64');
    }
    this._ensuredSession = false;
    this._cookieJar = new tough.CookieJar();

    this._indexUrl = common.urlFromIndex(this.repo.index);

    this._commonHttpClientOpts = {
        log: this.log,
        agent: opts.agent,
        proxy: opts.proxy,
        rejectUnauthorized: !this.insecure,
        userAgent: opts.userAgent || common.DEFAULT_USERAGENT
    };
    this._clientsToClose = [];

    Object.defineProperty(this, '_indexApi', {
        get: function () {
            if (self.__indexApi === undefined) {
                self.__indexApi = self._createClient('json', self._indexUrl);
            }
            return this.__indexApi;
        }
    });

    /*
     * The registry endpoint can vary. By default one can infer it from
     * the repo. E.g. "quay.io/foo" has a registry host of "quay.io". For
     * repos not specifying and index, e.g. "busybox" or "trentm/blah", the
     * default index is "index.docker.io", for which the default registry host
     * is registry-1.docker.io.
     *
     * Typically that is all you need. However two others things can happen:
     * - The `listRepoImgs` response can redirect to a totally different
     *   registry. E.g. Docker Hub does this for the "rhel7" image. And/or:
     * - The `listRepoImgs` can (typically does, always does?) include a
     *   X-Docker-Endpoints header with a registry host to use.
     *   See `_ensureSession` below.
     *
     * The properties below are to lazily determine and use the registry
     * URL after `_ensureSession` has been run to provide redirects and/or
     * endpoints.
     */
    Object.defineProperty(this, '_registryUrl', {
        get: function () {
            assert.ok(self._ensuredSession,
                'getting _registryUrl before session');
            if (self.__registryUrl === undefined) {
                if (self._endpoints && self._endpoints.length > 0) {
                    self.__registryUrl = self._endpoints[0];
                } else if (self.repo.index.official) {
                    self.__registryUrl = DEFAULT_REGISTRY_URL_V1;
                } else {
                    self.__registryUrl = common.urlFromIndex(self.repo.index);
                }
                self.log.trace({_registryUrl: self.__registryUrl},
                    'set _registryUrl');
            }
            return self.__registryUrl;
        }
    });
    Object.defineProperty(this, '_registryHost', {
        get: function () {
            if (self.__registryHost === undefined) {
                self.__registryHost = mod_url.parse(self._registryUrl).host;
            }
            return self.__registryHost;
        }
    });
    Object.defineProperty(this, '_registryApi', {
        get: function () {
            if (self.__registryApi === undefined) {
                self.__registryApi = self._createClient(
                    'json', self._registryUrl);
            }
            return self.__registryApi;
        }
    });
}
805804
def _opt_to_args(cls, opt, val):
        
        no_value = (
            "alloptions", "all-logs", "batch", "build", "debug",
            "experimental", "list-plugins", "list-presets", "list-profiles",
            "noreport", "quiet", "verify"
        )
        count = ("verbose",)
        if opt in no_value:
            return ["--%s" % opt]
        if opt in count:
            return ["--%s" % opt for d in range(0, int(val))]
        return ["--" + opt + "=" + val]
52995
function writeOpts(opts) {
  return utils.extend({
    flags: opts.flags || (opts.overwrite ? 'w' : 'wx')
  }, opts);
}
331452
function execLinter(bin, args, execaOptions, pathsToLint) {
  const binArgs = args.concat(pathsToLint)

  debug('bin:', bin)
  debug('args: %O', binArgs)
  debug('opts: %o', execaOptions)

  return execa(bin, binArgs, { ...execaOptions })
}
720667
function(opts){
    opts = opts || {};
    this.serverId = opts.serverId;
    this.serverType = opts.serverType;

    this.settings = {};
    this.components = {};
    this._routes = {};

    this.event = new EventEmitter();

    this._base = path.join(__dirname, '../..');
}
1201173
function watchOpts(src) {
    if ((src._pkg && !opts.watchPkgs) || ('watch' in src && !src.watch)) return false;
    return (typeof src.watch === 'object') ? src.watch : {};
  }
218011
def and_filter_from_opts(opts):
    ''''''
    return filters.and_filter(*list(chain.from_iterable([
        o for o in opts.values() if o]
    )))
140636
function(opts) {
    xml2js.opts = opts;
    return opts
      .option('-i, --inputdir [directory]', 'directory for xml files', __dirname + '/xml/mraa')
      .option('-c, --custom [file]', 'json for customizations')
      .option('-t, --typemaps [directory]', 'directory for custom pointer type maps')
      .option('-g, --imagedir [directory]', 'directory to link to where the images will be kept', '')
      .option('-s, --strict', 'leave out methods/variables if unknown type')
  }
844751
def optparse(*args)
      opts = OptionParser.new

      opts.banner = 'usage: pullr URI [PATH]'

      opts.on('-S','--scm NAME','Source Code Management to use') do |scm|
        @scm = scm
      end

      opts.on('-U','--uri URI','The URI of the repository') do |uri|
        @uri = uri
      end

      opts.on('-u','--update [PATH]','Update the repository') do |path|
        @mode = :update
        @path = (path || Dir.pwd)
      end

      begin
        @args = opts.parse!(args)
      rescue OptionParser::InvalidOption => e
        $stderr.puts e.message
        $stderr.puts opts
        exit -1
      end
    end
667627
def []=(flag, value)
      if o = option(flag)
        o.value = value
      else
        raise ArgumentError, "no option with flag `#{flag}'"
      end
    end
684971
function getOptions(opts, cb) {
  if (typeof opts !== 'object') {
    throw new Error('Invalid: options is not an object.');
  }
  var options = clonedeep(opts || {});

  options.sourceComments = options.sourceComments || false;
  if (options.hasOwnProperty('file')) {
    options.file = getInputFile(options);
  }
  options.outFile = getOutputFile(options);
  options.includePaths = buildIncludePaths(options);
  options.precision = parseInt(options.precision) || 5;
  options.sourceMap = getSourceMap(options);
  options.style = getStyle(options);
  options.indentWidth = getIndentWidth(options);
  options.indentType = getIndentType(options);
  options.linefeed = getLinefeed(options);

  // context object represents node-sass environment
  options.context = { options: options, callback: cb };

  options.result = {
    stats: getStats(options)
  };

  return options;
}
205029
function Routes(opts, items) {
	var self = this;
	opts = opts || {};
	items = items || [];
	debug.assert(self).is('object');
	debug.assert(opts).is('object');
	debug.assert(items).is('array');

	opts = copy(opts);
	self.file = opts.file;
	self.items = copy(items);
	self.changed = opts.changed || false;

	debug.assert(self.items).is('array');

	// Make an object (hash map) as an index for searching targets faster (path + method)
	self.targets = {};
	load_targets(self);

	debug.assert(self.file).is('string');
	debug.assert(self.targets).is('object');
}