Perform DFS to get all the dependencies of the primary_type
320549
def get_dependencies(primary_type, types):
    
    deps = set()
    struct_names_yet_to_be_expanded = [primary_type]

    while len(struct_names_yet_to_be_expanded) > 0:
        struct_name = struct_names_yet_to_be_expanded.pop()

        deps.add(struct_name)
        fields = types[struct_name]
        for field in fields:
            if field["type"] not in types:
                # We don't need to expand types that are not user defined (customized)
                continue
            elif field["type"] in deps:
                # skip types that we have already encountered
                continue
            else:
                # Custom Struct Type
                struct_names_yet_to_be_expanded.append(field["type"])

    # Don't need to make a struct as dependency of itself
    deps.remove(primary_type)

    return tuple(deps)
380426
def _get_deps(self, tree, include_punct, representation, universal):
        """"""
        if universal:
            converter = self.universal_converter

            if self.universal_converter == self.converter:
                import warnings
                warnings.warn("This jar doesn't support universal "
                              "dependencies, falling back to Stanford "
                              "Dependencies. To suppress this message, "
                              "call with universal=False")
        else:
            converter = self.converter

        if include_punct:
            egs = converter(tree, self.acceptFilter)
        else:
            egs = converter(tree)

        if representation == 'basic':
            deps = egs.typedDependencies()
        elif representation == 'collapsed':
            deps = egs.typedDependenciesCollapsed(True)
        elif representation == 'CCprocessed':
            deps = egs.typedDependenciesCCprocessed(True)
        else:
            # _raise_on_bad_representation should ensure that this
            # assertion doesn't fail
            assert representation == 'collapsedTree'
            deps = egs.typedDependenciesCollapsedTree()
        return self._listify(deps)
1173882
function findDependencies(startFile, class2Path, deps) {
    // Create a new regex object to reset the readIndex
    const depRegEx = /global ([a-zA-Z0-9,\s]+) \*/g;

    // Get global variable
    const contents = fs.readFileSync(startFile).toString();
    /** @type {string[]} */
    let fileDeps = [];
    let fileDepMatch;
    while ((fileDepMatch = depRegEx.exec(contents)) !== null) { // eslint-disable-line no-cond-assign
        const fileDep = fileDepMatch[1];
        fileDeps = fileDeps.concat(fileDep.split(/,\s*/g));
    }

    fileDeps.forEach(dep => {
        // CustomError classes
        if (dep.slice(-5) === 'Error') dep = 'errors';
        if (dep === 'runKeyguard' || dep === 'loadNimiq') dep = 'common';

        if (deps.indexOf(dep) > -1) return;

        deps.push(dep);

        if (dep === 'Nimiq') return;

        const depPath = class2Path.get(dep);
        if (!depPath) throw new Error(`Unknown dependency ${dep} referenced from ${startFile}`);

        // deps are passed by reference
        findDependencies(depPath, class2Path, deps); // recurse
    });

    return deps;
}
803173
def dependency_tree(args = {}, &bl)
      local_args        = Hash[args]
      recursive         = local_args[:recursive]
      retrieve_dev_deps = local_args[:dev_deps]
      matching          = local_args[:matching]
      dependencies      = local_args[:dependencies] || {}
      return dependencies if dependencies.key?(name) && dependencies[name].key?(version)

      dependencies[name]          ||= {}
      dependencies[name][version]   = deps + dev_deps
      args[:dependencies]           = dependencies

      resolved_deps = resolve_tree_deps(args.merge({:deps => deps}),     &bl)
      resolved_dev  = retrieve_dev_deps ? resolve_tree_deps(args.merge({:deps => dev_deps}), &bl) : []

      (resolved_deps + resolved_dev).each { |dep|
        dependencies.merge! dep.dependency_tree(args, &bl)
        args[:dependencies] = dependencies
      } if recursive

      return dependencies
    end
9802
function getDependencies(component, Prism) {
    // Cast require to an Array
    const deps = [].concat(component.require || []);

    if (Prism) {
        return deps.filter(
            dep =>
                // Remove dependencies that are already loaded
                !Prism.languages[dep]
        );
    }
    return deps;
}
1330109
function getAllDependencies() {
    var folder = './' + getBowerFolder();
    var bowerDependencies = fs.readdirSync(folder, {encoding: 'utf8'});

    var dependencyInfos = [];
    bowerDependencies.forEach(function(dirname) {
        var filepath = nodePath.resolve(cwd, folder, dirname, '.bower.json');
        if (fs.existsSync(filepath)) {
            var dependencyInfo = getDependency(filepath);
            dependencyInfo.dirName = dirname;
            dependencyInfos.push(dependencyInfo);
        }
    });

    return dependencyInfos;
}
96147
def missing_dependencies
      missing = []
      dependency_versions(:recursive => false).each do |pkg, target_versions|
        found = false
        target_versions.each do |_target, versions|
          dependency = dependency_for(pkg)
          found = versions.any? { |version| dependency.match?(pkg, version) }
        end
        missing << pkg unless found
      end
      missing
    end
798150
function (allDependencies, patterns) {
    return _.transform(allDependencies, function (result, dependencies, fileType) {
        result[fileType] = _.reject(dependencies, function (dependency) {
            return _.find(patterns, function (pattern) {
                return dependency.match(pattern);
            });
        });
    });
}
879586
def get_dependencies_from_decl(decl, recursive=True):
    
    result = []
    if isinstance(decl, typedef.typedef_t) or \
            isinstance(decl, variable.variable_t):
        return [dependency_info_t(decl, decl.decl_type)]
    if isinstance(decl, namespace.namespace_t):
        if recursive:
            for d in decl.declarations:
                result.extend(get_dependencies_from_decl(d))
        return result
    if isinstance(decl, calldef.calldef_t):
        if decl.return_type:
            result.append(
                dependency_info_t(decl, decl.return_type, hint="return type"))
        for arg in decl.arguments:
            result.append(dependency_info_t(decl, arg.decl_type))
        for exc in decl.exceptions:
            result.append(dependency_info_t(decl, exc, hint="exception"))
        return result
    if isinstance(decl, class_declaration.class_t):
        for base in decl.bases:
            result.append(
                dependency_info_t(
                    decl,
                    base.related_class,
                    base.access_type,
                    "base class"))
        if recursive:
            for access_type in class_declaration.ACCESS_TYPES.ALL:
                result.extend(
                    __find_out_member_dependencies(
                        decl.get_members(access_type), access_type))
        return result
    return result
660173
def _GetDeps(self, dependencies):
    

    for dependency in dependencies:
      dep_desc = self.FindFileByName(dependency)
      yield dep_desc
      for parent_dep in dep_desc.dependencies:
        yield parent_dep
433585
private void getAllDependents(Set<PathEntry> result, String name) {
        Set<String> depNames = dependenctRelativePaths.get(name);
        if (depNames == null) {
            return;
        }
        for (String dep : depNames) {
            PathEntry entry = pathEntries.get(dep);
            if (entry != null) {
                result.add(entry);
                getAllDependents(result, dep);
            }
        }
    }
1355510
def get_dependants(cls, dist):
        """"""
        for package in cls.installed_distributions:
            for requirement_package in package.requires():
                requirement_name = requirement_package.project_name
                # perform case-insensitive matching
                if requirement_name.lower() == dist.lower():
                    yield package
466239
def check_dependencies(dependencies, module):
    
    if type(dependencies) == str:
        dependencies = [dependencies]
    elif type(dependencies) != list:
        raise TypeError('dependencies argument must be of type list or string')

    for dependency in dependencies:
        if dependency not in settings.INSTALLED_APPS:
            raise DependencyError('%s depends on %s, which should be in settings.INSTALLED_APPS' % (module, dependency))
44141
def _get_prelim_dependencies(command_template, all_templates):
    
    deps = []
    for input in command_template.input_parts:
        if '.' not in input.alias:
            continue
        for template in all_templates:
            for output in template.output_parts:
                if input.fuzzy_match(output):
                    deps.append(template)
                    break
    return list(set(deps))
230827
def update_dependency_kinds(apps, schema_editor):
    """"""
    DataDependency = apps.get_model('flow', 'DataDependency')
    for dependency in DataDependency.objects.all():
        # Assume dependency is of subprocess kind.
        dependency.kind = 'subprocess'

        # Check child inputs to determine if this is an IO dependency.
        child = dependency.child
        parent = dependency.parent

        for field_schema, fields in iterate_fields(child.input, child.process.input_schema):
            name = field_schema['name']
            value = fields[name]

            if field_schema.get('type', '').startswith('data:'):
                if value == parent.pk:
                    dependency.kind = 'io'
                    break
            elif field_schema.get('type', '').startswith('list:data:'):
                for data in value:
                    if value == parent.pk:
                        dependency.kind = 'io'
                        break

        dependency.save()
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);
}
637922
def pull_dependencies(collector, image, **kwargs):
    """"""
    for dep in image.commands.dependent_images:
        kwargs["image"] = dep
        pull_arbitrary(collector, **kwargs)