findSecondPassResolutions
547690
function findResolver (reference, resolvers) {
  const refParts = reference.split(':')

  for (const resolver of resolvers) {
    if (resolver.canResolve(refParts)) {
      return resolver.resolver
    }
  }

  return null
}
212263
def _get_template_for_given_resolution(self, res, return_):
        """"""
        path = self._layer_files[self._res_indices[res][0]]
        if return_ == "path":
            return_value = path
        else:
            with rasterio.open(str(path)) as src:
                if return_ == "meta":
                    return_value = src.meta
                elif return_ == "windows":
                    return_value = tuple(src.block_windows())
                else:
                    raise ValueError("'return_' must be 'path', meta' or 'windows'.")
        return return_value
400661
private void
findResolvConf(String file) {
	InputStream in = null;
	try {
		in = new FileInputStream(file);
	}
	catch (FileNotFoundException e) {
		return;
	}
	InputStreamReader isr = new InputStreamReader(in);
	BufferedReader br = new BufferedReader(isr);
	List lserver = new ArrayList(0);
	List lsearch = new ArrayList(0);
	try {
		String line;
		while ((line = br.readLine()) != null) {
			if (line.startsWith("nameserver")) {
				StringTokenizer st = new StringTokenizer(line);
				st.nextToken(); /* skip nameserver */
				addServer(st.nextToken(), lserver);
			}
			else if (line.startsWith("domain")) {
				StringTokenizer st = new StringTokenizer(line);
				st.nextToken(); /* skip domain */
				if (!st.hasMoreTokens())
					continue;
				if (lsearch.isEmpty())
					addSearch(st.nextToken(), lsearch);
			}
			else if (line.startsWith("search")) {
				if (!lsearch.isEmpty())
					lsearch.clear();
				StringTokenizer st = new StringTokenizer(line);
				st.nextToken(); /* skip search */
				while (st.hasMoreTokens())
					addSearch(st.nextToken(), lsearch);
			}
		}
		br.close();
	}
	catch (IOException e) {
	}

	configureFromLists(lserver, lsearch);
}
412912
def getpass(self, prompt, default=None):
        """"""
        return click.prompt(prompt, hide_input=True, default=default)
275788
private List<PassFactory> getMainOptimizationLoop() {
    List<PassFactory> passes = new ArrayList<>();
    if (options.inlineGetters) {
      passes.add(inlineSimpleMethods);
    }

    passes.addAll(getCodeRemovingPasses());

    if (options.getInlineFunctionsLevel() != Reach.NONE) {
      passes.add(inlineFunctions);
    }

    if (options.shouldInlineProperties() && options.isTypecheckingEnabled()) {
      passes.add(inlineProperties);
    }

    if (options.removeUnusedVars || options.removeUnusedLocalVars) {
      if (options.deadAssignmentElimination) {
        passes.add(deadAssignmentsElimination);

        // The Polymer source is usually not included in the compilation, but it creates
        // getters/setters for many properties in compiled code. Dead property assignment
        // elimination is only safe when it knows about getters/setters. Therefore, we skip
        // it if the polymer pass is enabled.
        if (options.polymerVersion == null) {
          passes.add(deadPropertyAssignmentElimination);
        }
      }
    }

    if (options.optimizeCalls) {
      passes.add(optimizeCalls);
    }

    if (options.j2clPassMode.shouldAddJ2clPasses()) {
      passes.add(j2clConstantHoisterPass);
      passes.add(j2clClinitPass);
    }

    assertAllLoopablePasses(passes);
    return passes;
  }
775934
private String[] createResolversIncludesPattern(Collection<AbstractDependencyResolver> dependencyResolvers) {
        Collection<String> resultIncludes = new ArrayList<>();
        // TODO - check if can be done with lambda
        for (AbstractDependencyResolver dependencyResolver : dependencyResolvers) {
            for (String manifestFile : dependencyResolver.getManifestFiles()){
                if (!manifestFile.isEmpty()) {
                    resultIncludes.add(Constants.PATTERN + manifestFile);
                }
            }
        }
        String[] resultArray = new String[resultIncludes.size()];
        resultIncludes.toArray(resultArray);
        return resultArray;
    }
627391
function resolveMethods(classDoc) {
  let methods = classDoc.members.filter(member => member.hasOwnProperty('parameters'));

  if (classDoc.inheritedDoc) {
    methods = methods.concat(resolveMethods(classDoc.inheritedDoc));
  }

  return methods;
}
287647
private PassFactory getCustomPasses(final CustomPassExecutionTime executionTime) {
    return new PassFactory("runCustomPasses", true) {
      @Override
      protected CompilerPass create(final AbstractCompiler compiler) {
        return runInSerial(options.customPasses.get(executionTime));
      }

      @Override
      protected FeatureSet featureSet() {
        return ES_NEXT;
      }
    };
  }
857013
function getNpmAuditOptions(options) {
    try {
        const auditOptionsFile = pathJoin(
            options.directoryToAudit,
            'audit.opts'
        );
        const content = readFile(auditOptionsFile).toString();

        return content
            .split(/\n|\r/)
            .filter((commandLineOption) =>
                commandLineOption.includes('--audit-level')
            )
            .map((commandLineOption) => commandLineOption.replace(/[\t]/g, ' '))
            .map((commandLineOption) => commandLineOption.trim())
            .reduce(
                (result, commandLineOption) => {
                    const keyValue = getNpmAuditOptionFrom(commandLineOption);
                    if (keyValue.key) {
                        result[keyValue.key] = keyValue.value;
                    }
                    enforceValidValueForAuditLevelIn(result);
                    return result;
                },
                { '--audit-level': 'low' }
            );
    } catch (error) {
        return defaultNpmAuditOptions;
    }
}
1267686
private void resolve(Collection<Tile> resolved, Collection<Tile> toResolve, Tile tile)
    {
        updateTile(resolved, toResolve, tile, -1, 0);
        updateTile(resolved, toResolve, tile, 1, 0);
        updateTile(resolved, toResolve, tile, 0, 1);
        updateTile(resolved, toResolve, tile, 0, -1);

        updateTile(resolved, toResolve, tile, -1, 1);
        updateTile(resolved, toResolve, tile, 1, 1);
        updateTile(resolved, toResolve, tile, -1, -1);
        updateTile(resolved, toResolve, tile, 1, -1);
    }
1117213
function resolveLocal(success, fail, request, options) {
    var path = localPath + request.substring(8);
    resolve(success, fail, path, window.PERSISTENT, UNSANDBOXED, options);
}
918276
private void runCustomPasses(CustomPassExecutionTime executionTime) {
    if (options.customPasses != null) {
      Tracer t = newTracer("runCustomPasses");
      try {
        for (CompilerPass p : options.customPasses.get(executionTime)) {
          process(p);
        }
      } finally {
        stopTracer(t, "runCustomPasses");
      }
    }
  }
244564
function lookForExternalDependenciesRES( _def, resources, depFile ) {
  if ( !_def ) return;
  try {
    const def = convertExternalDependencyDefinition( _def );
    for ( const dep of Object.keys( def ) ) {
      if ( def[ dep ] === "" ) {
        // `res: { "bob/foo.png": "" }` is equivalent to
        // `res: { "bob/foo.png": "bob/foo.png" }`
        def[ dep ] = dep;
      }
      const
      srcDep = Project.srcOrLibPath( `mod/${dep}` ) ||
        Project.srcOrLibPath( dep );
      if ( !srcDep ) {
        Fatal.fire(
          `Unable to find dependency file "${dep}" nor "mod/${dep}"!`,
          depFile.getAbsoluteFilePath()
        );
      }
      resources[ srcDep ] = Project.wwwPath( def[ dep ] );
    }
  } catch ( ex ) {
    Fatal.fire(
      `Unable to parse RES dependencies: ${JSON.stringify(_def)}!\n${ex}`,
      depFile
    );
  }
}
1052053
function getFilters(resourceName, adapterName, operation) {
    var filterConfig = injector.loadModule('filterConfig');
    var filters = { before: [], after: [] };

    if (!filterConfig) { return filters; }

    var levels = [resourceName, adapterName, operation, 'before'];
    filters.before = (traverseFilters(filterConfig, levels, 0) || []).map(function (name) {
        return injector.loadModule(name + 'Filter');
    });

    levels = [resourceName, adapterName, operation, 'after'];
    filters.after = (traverseFilters(filterConfig, levels, 0) || []).map(function (name) {
        return injector.loadModule(name + 'Filter');
    });

    return filters;
}
1272679
protected int getResolutionIndex(double resolution) {
		if (layer instanceof TileBasedLayer) {
			return ((TileBasedLayer) layer).getTileConfiguration().getResolutionIndex(resolution);
		}
		return viewPort.getResolutionIndex(resolution);
	}
838666
function resolve() {
    var resolvedPath = '';
    var resolvedAbsolute = false;
    var hasDomain = false;

    for (var i = arguments.length - 1; i >= -1 && !resolvedAbsolute; i -= 1) {
      var p = (i >= 0) ? arguments[i] : !hasDomain ? cwd() : '';

      if (!hasDomain) {
        hasDomain = isDomain(p);
      }

      if (!isString(p)) {
        throw new TypeError('Arguments to path.resolve must be strings');
      } else if (!p) {
        continue;
      }

      resolvedPath = p + '/' + resolvedPath;
      resolvedAbsolute = p[0] === '/';
    }

    resolvedPath = normalizeArray(resolvedPath.split('/'), !resolvedAbsolute).join('/');
    return ((resolvedAbsolute ? '/' : '') + resolvedPath) || '.';
  }
149959
function findRoutes (dir, fileExtensions) {
  let files = fs.readdirSync(dir)
  let resolve = f => path.join(dir, f)
  let routes = files.filter(f => fileExtensions.indexOf(path.extname(f)) !== -1).map(resolve)
  let dirs = files.filter(f => fs.statSync(path.join(dir, f)).isDirectory()).map(resolve)
  return routes.concat(...dirs.map(subdir => findRoutes(subdir, fileExtensions)))
}