/*
opts: object
appData: appData object to use
apiOpts: optional object, typically default.api

testOpts: otional object
344091
function init(opts) {
	if (!opts || !opts.appData) throw new Error(path.basename(__filename)+ ':' + arguments.callee.name + ': bad opts argument')

	var apiOpts = opts.apiOpts || {}
	state.apiConfigs = apiOpts.apiMap || {}
	if (Array.isArray(apiOpts.path)) state.apiPath = apiOpts.path

	state.deployFolder = opts.appData.launchFolder
}
180144
function Data(options) {
  if (!(this instanceof Data)) {
    return new Data(options);
  }
  var opts = utils.merge({cwd: path.resolve(__dirname, '../../.data')}, options);
  Base.call(this, null, opts);
  this.define('store', utils.store('npm-api', this.options));
}
1058054
function normalizeOptions(options) {

    var opts = {};

    if (typeof options === 'string') {
        opts = {
            url: options
        };
    } else if (_.isPlainObject(options)) {
        opts = _.clone(options);
    }

    return opts;
}
353608
function(app, opts) {
  opts.context = app;
  opts.routeContext = app;
  if(!!opts.rpcClient) {
    return opts.rpcClient.create(opts);
  } else {
    return Client.create(opts);
  }
}
1009591
void setOption(String[] opt) {
	if(!matchOption(opt[0], "hide") && optionLength(opt[0]) > opt.length) {
	    System.err.println("Skipping option '" + opt[0] + "', missing argument");
	    return;
	}
	boolean dash = opt[0].length() > 1 && opt[0].charAt(0) == '-';
	boolean positive = !(opt[0].length() > 1 && opt[0].charAt(dash ? 1 : 0) == '!');
	
	if(matchOption(opt[0], "qualify", true)) {
	    showQualified = positive;
	} else if(matchOption(opt[0], "qualifyGenerics", true)) {
	    showQualifiedGenerics = positive;
	} else if(matchOption(opt[0], "hideGenerics", true)) {
	    hideGenerics = positive;
	} else if(matchOption(opt[0], "horizontal", true)) {
	    horizontal = positive;
	} else if(matchOption(opt[0], "attributes", true)) {
	    showAttributes = positive;
	} else if(matchOption(opt[0], "enumconstants", true)) {
	    showEnumConstants = positive;
	} else if(matchOption(opt[0], "operations", true)) {
	    showOperations = positive;
	} else if(matchOption(opt[0], "enumerations", true)) {
	    showEnumerations = positive;
	} else if(matchOption(opt[0], "constructors", true)) {
	    showConstructors = positive;
	} else if(matchOption(opt[0], "visibility", true)) {
	    showVisibility = positive;
	} else if(matchOption(opt[0], "types", true)) {
	    showType = positive;
	} else if(matchOption(opt[0], "autoSize", true)) {
	    autoSize = positive;
	} else if(matchOption(opt[0], "commentname", true)) {
	    showComment = positive;
	} else if(matchOption(opt[0], "all")) {
	    setAll();
	} else if(matchOption(opt[0], "bgcolor", true)) {
	    bgColor = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "edgecolor", true)) {
	    edgeColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "edgefontcolor", true)) {
	    edgeFontColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "edgefontname", true)) {
	    edgeFontName = positive ? opt[1] : Font.DEFAULT_FONT;
	} else if(matchOption(opt[0], "edgefontsize", true)) {
	    edgeFontSize = positive ? Double.parseDouble(opt[1]) : 10;
	} else if(matchOption(opt[0], "nodefontcolor", true)) {
	    nodeFontColor = positive ? opt[1] : "black";
	} else if(matchOption(opt[0], "nodefontname", true)) {
	    nodeFontName = positive ? opt[1] : Font.DEFAULT_FONT;
	} else if(matchOption(opt[0], "nodefontabstractitalic", true)) {
	    nodeFontAbstractItalic = positive;
	} else if(matchOption(opt[0], "nodefontsize", true)) {
	    nodeFontSize = positive ? Double.parseDouble(opt[1]) : 10;
	} else if(matchOption(opt[0], "nodefontclassname", true)) {
	    nodeFontClassName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefontclasssize", true)) {
	    nodeFontClassSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefonttagname", true)) {
	    nodeFontTagName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefonttagsize", true)) {
	    nodeFontTagSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefontpackagename", true)) {
	    nodeFontPackageName = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "nodefontpackagesize", true)) {
	    nodeFontPackageSize = positive ? Double.parseDouble(opt[1]) : -1;
	} else if(matchOption(opt[0], "nodefillcolor", true)) {
	    nodeFillColor = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "shape", true)) {
	    shape = positive ? Shape.of(opt[1]) : Shape.CLASS;
	} else if(matchOption(opt[0], "output", true)) {
	    outputFileName = positive ? opt[1] : "graph.dot";
	} else if(matchOption(opt[0], "outputencoding", true)) {
	    outputEncoding = positive ? opt[1] : "ISO-8859-1";
	} else if(matchOption(opt[0], "hide", true)) {
	    if (positive) {
		if (opt.length == 1) {
		    hidePatterns.clear();
		    hidePatterns.add(allPattern);
		} else {
		    try {
			hidePatterns.add(Pattern.compile(opt[1]));
		    } catch (PatternSyntaxException e) {
			System.err.println("Skipping invalid pattern " + opt[1]);
		    }
		}
	    } else
		hidePatterns.clear();
	} else if(matchOption(opt[0], "include", true)) {
	    if (positive) {
		try {
		    includePatterns.add(Pattern.compile(opt[1]));
		} catch (PatternSyntaxException e) {
		    System.err.println("Skipping invalid pattern " + opt[1]);
		}
	    } else
		includePatterns.clear();
	} else if(matchOption(opt[0], "apidocroot", true)) {
	    apiDocRoot = positive ? fixApiDocRoot(opt[1]) : null;
	} else if(matchOption(opt[0], "apidocmap", true)) {
	    if (positive)
		setApiDocMapFile(opt[1]);
	    else
		apiDocMap.clear();
	} else if(matchOption(opt[0], "noguillemot", true)) {
	    guilOpen = positive ? "&lt;&lt;" : "\u00ab";
	    guilClose = positive ? "&gt;&gt;" : "\u00bb";
	} else if (matchOption(opt[0], "view", true)) {
	    viewName = positive ? opt[1] : null;
	} else if (matchOption(opt[0], "views", true)) {
	    findViews = positive;
	} else if (matchOption(opt[0], "d", true)) {
	    outputDirectory = positive ? opt[1] : null;
	} else if(matchOption(opt[0], "inferrel", true)) {
	    inferRelationships = positive;
	} else if(matchOption(opt[0], "inferreltype", true)) {
	    if (positive) {
		try {
		    inferRelationshipType = RelationType.valueOf(opt[1].toUpperCase());
		} catch(IllegalArgumentException e) {
		    System.err.println("Unknown association type " + opt[1]);
		}
	    } else 
		inferRelationshipType = RelationType.NAVASSOC;
	} else if(matchOption(opt[0], "inferdepvis", true)) {
	    if (positive) {
		try {
		    Visibility vis = Visibility.valueOf(opt[1].toUpperCase());
		    inferDependencyVisibility = vis;
		} catch(IllegalArgumentException e) {
		    System.err.println("Ignoring invalid visibility specification for " +
			    "dependency inference: " + opt[1]);
		}
	    } else
		inferDependencyVisibility = Visibility.PRIVATE;
	} else if(matchOption(opt[0], "collapsible", true)) {
	    collapsibleDiagrams = positive;
	} else if(matchOption(opt[0], "inferdep", true)) {
	    inferDependencies = positive;
	} else if(matchOption(opt[0], "inferdepinpackage", true)) {
	    inferDepInPackage = positive;
	} else if (matchOption(opt[0], "hideprivateinner", true)) {
	    hidePrivateInner = positive;
	} else if(matchOption(opt[0], "useimports", true)) {
	    useImports = positive;
	} else if (matchOption(opt[0], "collpackages", true)) {
	    if (positive) {
		try {
		    collPackages.add(Pattern.compile(opt[1]));
		} catch (PatternSyntaxException e) {
		    System.err.println("Skipping invalid pattern " + opt[1]);
		}
	    } else
		collPackages.clear();
	} else if (matchOption(opt[0], "compact", true)) {
	    compact = positive;
	} else if (matchOption(opt[0], "postfixpackage", true)) {
	    postfixPackage = positive;
	} else if (matchOption(opt[0], "link")) {
	    addApiDocRoots(opt[1]);
	} else if (matchOption(opt[0], "linkoffline")) {
	    addApiDocRootsOffline(opt[1], opt[2]);
	} else if(matchOption(opt[0], "contextPattern")) {
	    RelationDirection d; RelationType rt;
	    try {
		d = RelationDirection.valueOf(opt[2].toUpperCase());
		if(opt[1].equalsIgnoreCase("all")) {
		    contextRelationPattern = new RelationPattern(d);
		} else {
		    rt = RelationType.valueOf(opt[1].toUpperCase());
		    contextRelationPattern.addRelation(rt, d);
		}
	    } catch(IllegalArgumentException e) {
		
	    }
		
	} else if (matchOption(opt[0], "nodesep", true)) {
	    try {
		nodeSep = positive ? Double.parseDouble(opt[1]) : 0.25;
	    } catch (NumberFormatException e) {
		System.err.println("Skipping invalid nodesep " + opt[1]);
	    }
	} else if (matchOption(opt[0], "ranksep", true)) {
	    try {
		rankSep = positive ? Double.parseDouble(opt[1]) : 0.5;
	    } catch (NumberFormatException e) {
		System.err.println("Skipping invalid ranksep " + opt[1]);
	    }
	} else if (matchOption(opt[0], "dotexecutable")) {
	    dotExecutable = opt[1];
	} else
	    ; // Do nothing, javadoc will handle the option or complain, if needed.
    }
1213027
function(prop) {
    var opt = this.option(prop);
    if (typeof opt === 'undefined') {
      return this.app && this.app.option ? this.app.option(prop) : null;
    }
    return opt;
  }
410969
function(opt){
        // merge with default options
        Object.keys(_options).forEach(function(key){
            _options[key] = opt[key] || _options[key];
        });
    }
87692
function arbitrary (opts) {
    if (!R.is(Array, opts.apps)) {
      return Promise.reject(Error('an appId array is required for arbitrary suggestions'));
    }
    return Promise.all(opts.apps.map((appId) => store.app({appId})));
  }
571122
function loadFromOptions(opts) {
  var defCfg = loadDefault()
  var cfg = opts.config ? loadFromFile(opts.config) : loadDefault()

  // Command line config override file loaded config
  for (var k in opts) {
    defCfg.hasOwnProperty(k) && (defCfg[k] !== opts[k] && (cfg[k] = opts[k]))
  }

  return cfg
}
33691
private void setOption(String opt, List<String> arguments) {
        String[] args = new String[arguments.length() + 1];
        int k = 0;
        args[k++] = opt;
        for (List<String> i = arguments; i.nonEmpty(); i=i.tail) {
            args[k++] = i.head;
        }
        options.append(args);
    }
869962
function opt(argv, arg, index, key) {
    var value = argv[index + 1], equals = arg.indexOf('=');
    if(equals > -1) {
      value = arg.substr(equals + 1);
    }
    if(value && ~keys.indexOf(value)) {
      return value;
    }
    if(arg === option[key]) {
      return modes[key];
    }
  }
211476
function setOptions(bs, options) {
    /**
     * If multiple options were set, act on the immutable map
     * in an efficient way
     */
    if (Object.keys(options).length > 1) {
        bs.setMany(function(item) {
            Object.keys(options).forEach(function(key) {
                item.set(key, options[key]);
                return item;
            });
        });
    } else {
        Object.keys(options).forEach(function(key) {
            bs.setOption(key, options[key]);
        });
    }
}
241255
function(opts) {
  opts = opts || {};

  this.params = {};
  this._params = [];
  this.caseSensitive = opts.caseSensitive;
  this.mergeParams = opts.mergeParams;
  this.strict = opts.strict;
  this.stack = [];
}
507711
function API(opts) {
  opts = opts || {};

  this.verbose = !!opts.verbose;
  this.request = opts.request || request;
  this.baseUrl = opts.baseUrl || BASE_URL;
  var parsedUrl = url.parse(this.baseUrl);
  this.basePath = parsedUrl.path;
  this.baseHost = parsedUrl.protocol + '//' + parsedUrl.host;
  this.timeout = opts.timeout || 50000;

  if (this.verbose) {
    log.setLevel('debug');
  } else {
    log.setLevel('info');
  }
}
193452
function (opts1 /*, …options*/) {
		var result = create(null);
		forEach.call(arguments, function (options) {
			if (!isValue$2(options)) { return; }
			process(Object(options), result);
		});
		return result;
	}
1173440
function setOptName(opt, optKey) {
    var key$ = optKey + '$';
    opts[key$] = opts[key$] || {};
    var name = opt.name || fspath.basename(opt.path);
    while (opts[key$][name]) {
      name = '_' + name;
    }
    opts[key$][name] = opt;
    opt.name = name;
  }
540871
function (configData, platform) {
            var preferences = this.getPreferences(platform),
                type = 'preference';

            _.each(preferences, function (preference) {
                var prefMappingData = preferenceMappingData[platform][preference.attrib.name],
                    target,
                    prefData;

                if (prefMappingData) {
                    prefData = {
                        parent: prefMappingData.parent,
                        type: type,
                        destination: prefMappingData.destination,
                        data: preference
                    };

                    target = prefMappingData.target;
                    if(!configData[target]) {
                        configData[target] = [];
                    }
                    configData[target].push(prefData);
                }
            });
        }