Generate script dependencies

@param array $maybe_dependencies
@return array
12283
public static function generate_script_dependencies( $maybe_dependencies ) {
		$dependencies = [];
		foreach ( $maybe_dependencies as $dependency ) {
			if ( ! wp_script_is( $dependency, 'enqueued' ) && ! wp_script_is( $dependency, 'registered' ) ) {
				continue;
			}
			$dependencies[] = $dependency;
		}
		return $dependencies;
	}
574231
protected function resolveDependencies(array $dependencies)
    {
        foreach ($dependencies as $dependency => $type) {
            call_user_func_array([$this, $type], [$dependency]);
        }
    }
370894
def external_dependencies(self):
        
        found = []
        for dep in self.dependent_images:
            if isinstance(dep, six.string_types):
                if dep not in found:
                    yield dep
                    found.append(dep)
1162288
private function getDependenciesRecursive($path, $dependencies = [])
    {
        $raw = $this->resolver->raw($path);
        if ($raw !== null) {
            $path = $raw;
        }

        preg_match_all('#%([^/\\\\]+)%#', $path, $matches);
        foreach ($matches[1] as $alias) {
            if (!in_array($alias, $dependencies, true)) {
                $dependencies[] = $alias;
            }

            if (isset($this->resolving[$alias])) {
                throw new PathResolutionException('Failed to resolve path dependencies. Infinite recursion detected.');
            }

            $this->resolving[$alias] = true;
            try {
                $dependencies = $this->getDependenciesRecursive($alias, $dependencies);
            } finally {
                unset($this->resolving[$alias]);
            }
        }

        return $dependencies;
    }
303655
public static function checkPlatformDependencies($dependencies) {
        if (is_array($dependencies)) {
            foreach ($dependencies as $depName => $depRequire) {
                switch ($depName) {
                    case 'php':
                        if (self::satisfies(PHP_VERSION, $depRequire)) {
                            unset($dependencies[$depName]);
                        }
                        break;
                    default:
                        break;
                }
            }
        }
        return $dependencies;
    }
1300918
protected function getScriptDeps($section)
    {
        $dependencies = $this->getDependencies();
        $deps = isset($dependencies['scripts']) ? $dependencies['scripts'] : [];

        return isset($deps[$section]) ? $deps[$section] : [];
    }
61359
protected function mockDependencies()
    {
        $dependencies = $this->getDependencyMapping();

        foreach ($dependencies as $interface => $memberName) {
            if (!isset($this->$memberName)) {
                $this->$memberName = Mockery::mock($interface);
            }

            // Update with the actual instance.
            $dependencies[$interface] = $this->$memberName;
        }

        return $dependencies;
    }
952360
protected function enforce_dependencies() {
        // Get the plan.
        $plan = $this->controller->get_plan();
        // Get the tasks as a var so we can iterate by reference.
        $tasks = $plan->get_tasks();
        $changes = 0;
        foreach ($tasks as &$task) {
            // Store as a var so we can iterate by reference.
            $settings = $task->get_settings();
            foreach ($settings as &$setting) {
                // Get all dependencies for iteration by reference.
                $dependencies = $setting->get_dependencies();
                foreach ($dependencies as &$dependency) {
                    // Enforce each dependency.
                    if ($dependency->enforce()) {
                        $changes++;
                    }
                }
            }
        }
        // Store the number of settings that changed through enforcement.
        $this->dependencychanges = $changes;
        return ($changes > 0);
    }
856272
protected function getDependencies(array $identifiers): array
    {
        $dependencies = [];

        foreach ($identifiers as $index => $identifier) {
            $dependencies[$index] = !$identifier->optional || $this->container->has($identifier->key)
                ? $this->container->get($identifier->key)
                : null;
        };

        return $dependencies;
    }
458898
def expand_dependencies_section(section, kwargs):
    """"""
    deps = []

    for dep in section:
        for dep_type, dep_list in dep.items():
            if dep_type in ['call', 'use']:
                deps.extend(Command(dep_type, dep_list, kwargs).run())
            elif dep_type.startswith('if ') or dep_type == 'else':
                deps.append({dep_type: expand_dependencies_section(dep_list, kwargs)})
            else:
                deps.append({dep_type: dep_list})

    return deps
82073
function getDependencies(pkg) {
	if (!pkg) {
		return [];
	}

	if (!isObject(pkg)) {
		$.error('Content from `package.json` must be an `Object`!');
		return [];
	}

	// get all possible dependencies
	const deps = [
		'dependencies', 'devDependencies', 'peerDependencies'
	].filter(key => pkg[key] !== void 0).map(k => Object.keys(pkg[k]));

	return flatten(deps);
}
1165645
function generateModuleAst(moduleInfo) {
    var dependenciesExpr;
    var actualDependencies = moduleInfo.actualDependencies;
    var dependencies = (moduleInfo.dependencies || []).slice(0);

    if (actualDependencies instanceof Array) {
        dependenciesExpr = {
            type: SYNTAX.ArrayExpression,
            elements: []
        };

        var diffDependencies = subtract(
            actualDependencies,
            intersect(dependencies, actualDependencies)
        );
        dependencies.concat(diffDependencies).forEach(function (dependency) {
            dependenciesExpr.elements.push({
                type: SYNTAX.Literal,
                value: dependency,
                raw: '\'' + dependency + '\''
            });
        });
    }

    var defineArgs = [moduleInfo.factoryAst];
    if (dependenciesExpr) {
        defineArgs.unshift(dependenciesExpr);
    }
    var id = moduleInfo.id;
    if (id) {
        defineArgs.unshift({
            type: SYNTAX.Literal,
            value: moduleInfo.id,
            raw: '\'' + moduleInfo.id + '\''
        });
    }

    return {
        type: SYNTAX.CallExpression,
        callee: {
            type: SYNTAX.Identifier,
            name: LITERAL_DEFINE
        },
        arguments: defineArgs
    };
}
983695
protected function getDependencies(array $dependencies, array $parameters)
    {
        $dependenciesArr = array();
        foreach ($dependencies as $parameter) {
            $dependency = $parameter->getClass();
            if (array_key_exists($parameter->name, $parameters)) {
                $dependenciesArr[] = $parameters[$parameter->name];
            } elseif (is_null($dependency)) {
                $dependenciesArr[] = $this->resolveNonClass($parameter);
            } else {
                $dependenciesArr[] = $this->resolveClass($parameter);
            }
        }
        return $dependenciesArr;
    }
503826
public function getDependencies()
    {
        $dependencies = array();

        $file = $this->getFilePath();
        if ($file) {
            $dependencies[] = $file;
        }

        foreach ($this->operations as $operation) {
            foreach ($operation[1] as $argument) {
                if ($argument instanceof self) {
                    $dependencies = array_merge($dependencies, $argument->getDependencies());
                }
            }
        }

        return $dependencies;
    }
561588
protected function getDependencyMapping()
    {
        $constructor = (new ReflectionClass($this->className))
            ->getConstructor();

        $dependencies = [];

        if (!is_null($constructor)) {
            foreach ($constructor->getParameters() as $param) {
                $dependencies[$param->getClass()->getName()] = $param->getName();
            }
        }

        return $dependencies;
    }
796577
private function getConfiguredDependencies($moduleName)
    {
        $config = $this->getModuleConfig($moduleName);

        if (!isset($config['depends'])) {
            return [];
        }

        return is_array($config['depends']) ? $config['depends'] : [$config['depends']];
    }
1109301
public function getDependencies(): array
    {
        $dependencies = [];
        foreach ($this->config['dependencies'] as $dependency) {
            $dependencies[] = $this->wire($dependency);
        }

        return $dependencies;
    }