Get an argument list with dependencies resolved
763849
private function _resolveArgs(array $args)
        {
            $resolved = array();
            foreach ($args as $argDefinition) {
                switch ($argDefinition['type']) {
                    case 'lookup':
                        $resolved[] = $this->_lookupRecursive($argDefinition['item']);
                        break;
                    case 'value':
                        $resolved[] = $argDefinition['item'];
                        break;
                }
            }

            return $resolved;
        }
79697
def dependency_resolver(dependencies):
    

    items = dict((key, set(dependencies[key])) for key in dependencies)
    resolved_dependencies = []
    while items:
        batch = set(item for value in items.values() for item in value) - set(items.keys())
        batch.update(key for key, value in items.items() if not value)
        resolved_dependencies.append(batch)
        items = dict(((key, value - batch) for key, value in items.items() if value))
    return resolved_dependencies
388844
def extract_dependencies(pipe_def=None, pipe_generator=None):
    """"""
    if pipe_def:
        pydeps = gen_dependencies(pipe_def)
    elif pipe_generator:
        pydeps = pipe_generator(Context(describe_dependencies=True))
    else:
        raise Exception('Must supply at least one kwarg!')

    return sorted(set(pydeps))
834686
def get_cli():
    """"""
    parser = argparse.ArgumentParser(
        prog="auto_version",
        description="auto version v%s: a tool to control version numbers" % __version__,
    )
    parser.add_argument(
        "--target",
        action="append",
        default=[],
        help="Files containing version info. "
        "Assumes unique variable names between files. (default: %s)."
        % (config.targets,),
    )
    parser.add_argument(
        "--bump",
        choices=SemVerSigFig,
        help="Bumps the specified part of SemVer string. "
        "Use this locally to correctly modify the version file.",
    )
    parser.add_argument(
        "--news",
        "--file-triggers",
        action="store_true",
        dest="file_triggers",
        help="Detects need to bump based on presence of files (as specified in config).",
    )
    parser.add_argument(
        "--set",
        help="Set the SemVer string. Use this locally to set the project version explicitly.",
    )
    parser.add_argument(
        "--set-patch-count",
        action="store_true",
        help="Sets the patch number to the commit count.",
    )
    parser.add_argument(
        "--lock",
        action="store_true",
        help="Locks the SemVer string. "
        "Lock will remain for another call to autoversion before being cleared.",
    )
    parser.add_argument(
        "--release",
        action="store_true",
        default=False,
        help="Marks as a release build, which flags the build as released.",
    )
    parser.add_argument(
        "--version",
        action="store_true",
        default=False,
        help="Prints the version of auto_version itself (self-version).",
    )
    parser.add_argument("--config", help="Configuration file path.")
    parser.add_argument(
        "-v",
        "--verbosity",
        action="count",
        default=0,
        help="increase output verbosity. " "can be specified multiple times",
    )
    return parser.parse_known_args()
668275
def _fix_deps_repos(self, dependencies):
        
        requires = []
        for dep in dependencies:
            if dep in self.repo_pkg_names:
                requires.append(dep)
        return requires
797727
def dependencies(self):
        
        result = []
        dependencies = javabridge.get_collection_wrapper(
            javabridge.call(self.jobject, "getDependencies", "()Ljava/util/List;"))
        for dependency in dependencies:
            result.append(Dependency(dependency))
        return result
1002030
function DependenciesNotResolvedError(dependencies){
  superError.call(
    this,
    'DependenciesNotResolvedError',
    util.format('Dependencies cannot be resolved: %s', dependencies.join(','))
  );

  this.dependencies = dependencies;
}
518726
def calculate_dependencies():
        
        order = []
        for group in toposort(dependencies):
            priority_sorted_group = sorted(group, key=lambda x: (priorities[x], x))
            order.extend(priority_sorted_group)

        return order
779118
function mapDependencies(dependencies) {
  var deps;

  deps = (dependencies) ? Object.keys(dependencies) : [];

  return deps.map(function(name) {
    return {
      name: name,
      version: dependencies[name]
    };
  });
}
245626
function getBundlesForArgument(arg)
{
    // handles mix.bower(['package1', 'package2'])
    if (_.isArray(arg)) {
        return [new Bundle(arg)];
    }

    // handles mix.bower('namedBundle') where namedBundle is defined in bower.json
    if (_.isString(arg)) {
        return [new Bundle(BOWER_JSON.bundles[arg], arg)];
    }

    // handles mix.bower(), which uses all bundle definitions in bower.json
    if (BOWER_JSON.bundles && BOWER_JSON.bundles.length) {
        return _.map(BOWER_JSON.bundles || [], function (packages, name) {
            return new Bundle(packages, name);
        });
    }

    // handles mix.bower() when no "bundles" property, uses all from the
    // "dependencies" property as fallback
    if (BOWER_JSON.dependencies) {
        var packages = Object.keys(BOWER_JSON.dependencies);
        return [ new Bundle(packages) ];
    }

    return [];
}
114530
def _resolve_deps(self, depmap):
    """"""
    deps = defaultdict(lambda: OrderedSet())
    for category, depspecs in depmap.items():
      dependencies = deps[category]
      for depspec in depspecs:
        dep_address = Address.parse(depspec)
        try:
          self.context.build_graph.maybe_inject_address_closure(dep_address)
          dependencies.add(self.context.build_graph.get_target(dep_address))
        except AddressLookupError as e:
          raise AddressLookupError('{}\n  referenced from {} scope'.format(e, self.options_scope))
    return deps
57373
def _get_dependencies_from_kwargs(self, args):
        
        if not isinstance(args, dict):
            raise TypeError('"kwargs" must be a dictionary')

        dependency_names = set()
        for arg in args.values():
            new_names = self._check_arg(arg)
            dependency_names.update(new_names)
        return dependency_names
1014609
def resolve_multi_dependency(type, arguments)
      if arguments.size == 0
        fail HungryFormException, "No arguments for #{type.upcase} comparison: #{arguments}"
      end

      result = type == :and

      arguments.each do |argument|
        return !result unless resolve_dependency(argument)
      end

      result
    end
23381
def _compute_dependencies(self):
        """"""
        dm = self.__dep_map = {None: []}

        reqs = []
        # Including any condition expressions
        for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
            reqs.extend(parse_requirements(req))

        def reqs_for_extra(extra):
            for req in reqs:
                if not req.marker or req.marker.evaluate({'extra': extra}):
                    yield req

        common = frozenset(reqs_for_extra(None))
        dm[None].extend(common)

        for extra in self._parsed_pkg_info.get_all('Provides-Extra') or []:
            s_extra = safe_extra(extra.strip())
            dm[s_extra] = list(frozenset(reqs_for_extra(extra)) - common)

        return dm
1075405
def collect_lockfile_dependencies(lockfile_data):
    """"""
    output = {}

    for dependencyName, installedVersion in lockfile_data.items():
        output[dependencyName] = {
            'source': 'example-package-manager',
            'installed': {'name': installedVersion},
        }

    return output
884923
def getArguments(names, local_dict=None, global_dict=None):
    """"""
    call_frame = sys._getframe(2)

    clear_local_dict = False
    if local_dict is None:
        local_dict = call_frame.f_locals
        clear_local_dict = True
    try:
        frame_globals = call_frame.f_globals
        if global_dict is None:
            global_dict = frame_globals

        # If `call_frame` is the top frame of the interpreter we can't clear its 
        # `local_dict`, because it is actually the `global_dict`.
        clear_local_dict = clear_local_dict and not frame_globals is local_dict

        arguments = []
        for name in names:
            try:
                a = local_dict[name]
            except KeyError:
                a = global_dict[name]
            arguments.append(numpy.asarray(a))
    finally:
        # If we generated local_dict via an explicit reference to f_locals,
        # clear the dict to prevent creating extra ref counts in the caller's scope
        # See https://github.com/pydata/numexpr/issues/310
        if clear_local_dict:
            local_dict.clear()

    return arguments
1007706
private String[] getClosureCompilerArgs(GlobalPostProcessingContext ctx, List<JoinableResourceBundle> tmpBundles,
			Map<String, String> resultBundlePathMapping) {

		List<String> args = new ArrayList<>();
		JawrConfig config = ctx.getJawrConfig();
		List<JoinableResourceBundle> bundles = new ArrayList<>(tmpBundles);

		// Handle All closure parameters defined in Jawr config
		initCompilerClosureArgumentsFromConfig(args, config);

		String excludedBundlesProp = config.getProperty(JAWR_JS_CLOSURE_BUNDLES_EXCLUDED, "");
		List<String> excludedBundles = Arrays
				.asList(excludedBundlesProp.replaceAll(" ", "").split(MODULE_DEPENDENCIES_SEPARATOR));

		// handle user specified modules
		Map<String, JoinableResourceBundle> bundleMap = new HashMap<>();
		for (JoinableResourceBundle bundle : bundles) {
			if (!excludedBundles.contains(bundle.getName())) {
				bundleMap.put(bundle.getName(), bundle);
			}
		}

		String modules = config.getProperty(JAWR_JS_CLOSURE_MODULES);
		List<String> depModulesArgs = new ArrayList<>();

		List<String> globalBundleDependencies = getGlobalBundleDependencies(ctx, excludedBundles);

		// Initialize the modules arguments
		initModulesArgs(resultBundlePathMapping, args, bundles, bundleMap, modules, depModulesArgs,
				globalBundleDependencies);

		// handle the other bundles
		for (JoinableResourceBundle bundle : bundles) {
			if (!excludedBundles.contains(bundle.getName())) {
				generateBundleModuleArgs(args, bundleMap, resultBundlePathMapping, bundle, globalBundleDependencies);
			}
		}

		// Add dependency modules args after to conform to dependency definition
		// of closure args
		args.addAll(depModulesArgs);

		if (LOGGER.isDebugEnabled()) {
			StringBuilder strArg = new StringBuilder();
			for (String arg : args) {
				strArg.append(arg).append(" ");
			}

			LOGGER.debug("Closure Compiler Args : " + strArg.toString());
		}
		return args.toArray(new String[] {});
	}