Returns list of first level dependencies of the given installed dap
    or dap from Dapi  if not installed
    If a location is specified, this only checks for dap installed in that path
    and return [] if the dap is not located there
191338
def _get_dependencies_of(name, location=None):
    '''
    
    '''
    if not location:
        detailed_dap_list = get_installed_daps_detailed()
        if name not in detailed_dap_list:
            return _get_api_dependencies_of(name)
        location = detailed_dap_list[name][0]['location']

    meta = '{d}/meta/{dap}.yaml'.format(d=location, dap=name)
    try:
        data = yaml.load(open(meta), Loader=Loader)
    except IOError:
        return []
    return data.get('dependencies', [])
791620
function getDepsFromDataObject(data, lookup) {
  var results = {};
  if (categories.length == 0) {
    for(var k in data.dependencies) {
      var dep = extractDep(data.dependencies[k]);
      results[k]=dep;
    }
  }

  if (lookup) {
    for (var i = 0; i < categories.length; i++) {
      var category = categories[i];
      for(var k in data[category]) {
        var spec = k + "@" + data[category][k];

        var specMatch = lookupSpecMatch(lookup, spec);

        // If there is no match in the lookup then this dependency was "deduped"
        if (specMatch) {
          results[k]=specMatch;
        }
      }
    }
  }
  return results;
}
7683
def dependencies(self):
	
		
		
		try:
			for dep_name in self.__prof.dependencies(self.name()):
				yield self.__comp_stub_reg.get(dep_name)
		except TypeError:
			yield from ()
982916
def get_dependencies(self, filename):
        
        if self.is_partial(filename):
            return self.templates
        elif self.is_template(filename):
            return [self.get_template(filename)]
        elif self.is_static(filename):
            return [filename]
        else:
            return []
60944
def check_files(cls, dap):
        ''''''
        problems = list()
        dirname = os.path.dirname(dap._meta_location)

        if dirname:
            dirname += '/'
        files = [f for f in dap.files if f.startswith(dirname)]
        if len(files) == 1:
            msg = 'Only meta.yaml in dap'
            problems.append(DapProblem(msg, level=logging.WARNING))
            return problems

        files.remove(dirname + 'meta.yaml')

        # Report and remove empty directories until no more are found
        emptydirs = dap._get_emptydirs(files)
        while emptydirs:
            for ed in emptydirs:
                msg = ed + ' is empty directory (may be nested)'
                problems.append(DapProblem(msg, logging.WARNING))
                files.remove(ed)
            emptydirs = dap._get_emptydirs(files)

        if dap.meta['package_name']:
            name = dap.meta['package_name']

            dirs = re.compile('^' + dirname + '((assistants(/(crt|twk|prep|extra))?|snippets)(/' +
                              name + ')?|icons(/(crt|twk|prep|extra|snippets)(/' + name +
                              ')?)?|files|(files/(crt|twk|prep|extra|snippets)|doc)(/' + name +
                              '(/.+)?)?)$')
            regs = re.compile('^' + dirname + '((assistants(/(crt|twk|prep|extra))|snippets)/' +
                              name + r'(/[^/]+)?\.yaml|icons/(crt|twk|prep|extra|snippets)/' +
                              name + r'(/[^/]+)?\.(' + Dap._icons_ext +
                              ')|(files/(crt|twk|prep|extra|snippets)|doc)/' + name + '/.+)$')

            to_remove = []
            for f in files:
                if dap._is_dir(f) and not dirs.match(f):
                    msg = f + '/ is not allowed directory'
                    problems.append(DapProblem(msg))
                    to_remove.append(f)
                elif not dap._is_dir(f) and not regs.match(f):
                    msg = f + ' is not allowed file'
                    problems.append(DapProblem(msg))
                    to_remove.append(f)
            for r in to_remove:
                files.remove(r)

            # Subdir yamls need a chief
            for directory in ['assistants/' + t for t in 'crt twk prep extra'.split()] + \
                    ['snippets']:
                prefix = dirname + directory + '/'
                for f in files:
                    if f.startswith(prefix) and dap._is_dir(f) and f + '.yaml' not in files:
                        msg = f + '/ present, but ' + f + '.yaml missing'
                        problems.append(DapProblem(msg))

        # Missing assistants and/or snippets
        if not dap.assistants_and_snippets:
            msg = 'No Assistants or Snippets found'
            problems.append(DapProblem(msg, level=logging.WARNING))

        # Icons
        icons = [dap._strip_leading_dirname(i) for i in dap.icons(strip_ext=True)] # we need to report duplicates
        assistants = set([dap._strip_leading_dirname(a) for a in dap.assistants])  # duplicates are fine here

        duplicates = set([i for i in icons if icons.count(i) > 1])
        for d in duplicates:
            msg = 'Duplicate icon for ' + f
            problems.append(DapProblem(msg, level=logging.WARNING))

        icons = set(icons)
        for i in icons - assistants:
            msg = 'Useless icon for non-exisiting assistant ' + i
            problems.append(DapProblem(msg, level=logging.WARNING))

        for a in assistants - icons:
            msg = 'Missing icon for assistant ' + a
            problems.append(DapProblem(msg, level=logging.WARNING))

        # Source files
        for f in cls._get_files_without_assistants(dap, dirname, files):
            msg = 'Useless files for non-exisiting assistant ' + f
            problems.append(DapProblem(msg, level=logging.WARNING))

        return problems
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
1072657
def get_dependencies(self) -> Optional[List[str]]:
        

        if not self.apt_dependencies:
            return None

        try:
            dependencies = list([str(x).strip() for x in self.apt_dependencies])
        except (TypeError, ValueError):
            raise ArcaMisconfigured("Apk dependencies can't be converted into a list of strings")

        if not len(dependencies):
            return None

        dependencies.sort()

        return dependencies
873046
def get_dependencies(self):
        
        all_deps = OrderedSet()
        for key, _ in list(self.__config.items()):
            if key in self.__cli:
                continue

            if key.endswith('sources'):
                all_deps |= self.get_sources(key[:len('sources') * -1 - 1])

        for key, _ in list(self.__cli.items()):
            if key.endswith('sources'):
                all_deps |= self.get_sources(key[:len('sources') * -1 - 1])

        if self.conf_file is not None:
            all_deps.add(self.conf_file)

        all_deps.add(self.get_path("sitemap", rel_to_cwd=True))

        cwd = os.getcwd()
        return [os.path.relpath(fname, cwd) for fname in all_deps if fname]
207831
async function fetchAllDependents (name) {
  let pkg = await npm.getLatest(name)
  let deps = Object.keys(pkg.dependencies || {})
  if (!deps.length) return []
  let promises = []
  for (let dep of deps) {
    promises.push(fetchAllDependents(dep))
  }
  for (let subdeps of await Promise.all(promises)) {
    deps = deps.concat(subdeps)
  }
  return _.uniq(deps.sort())
}
9829
def _get_all_refs(self, dep, handled_refs=None):
        
        if handled_refs is None:
            handled_refs = [dep]
        else:
            if dep in handled_refs:
                return []
        res = []
        if dep in self.future_values_key_item:
            res.extend(
                self.future_values_key_item[dep]["dependencies"].values())
            add = []
            for h_d in res:
                add.extend(self._get_all_refs(h_d, handled_refs))
            res.extend(add)
        return list(set(res))
455434
def search_dependencies(self):
        
        result = [self.module.name]
        #First we look at the explicit use references from this module and all
        #its dependencies until the chain terminates.
        stack = self.needs
        while len(stack) > 0:
            module = stack.pop()
            if module in result:
                continue
            
            self.parent.load_dependency(module, True, True, False)
            if module in self.parent.modules:
                for dep in self.parent.modules[module].needs:
                    modname = dep.split(".")[0]
                    if modname not in result:
                        result.append(modname)
                    if modname not in stack:
                        stack.append(modname)

        #Add any incidentals from the automatic construction of code. These can be from
        #executables that use special precision types without importing them or from
        #derived types. Same applies to the local members of this module.
        for ekey, anexec in list(self.executables.items()):
            for dep in anexec.search_dependencies():
                if dep is not None and dep not in result:
                    result.append(dep)

        for member in list(self.members.values()):
            dep = member.dependency()
            if dep is not None and dep not in result:
                result.append(dep)
                        
        return result
1115198
def get_dependencies(requirement, sources):
    
    getters = [
        _get_dependencies_from_cache,
        _cached(_get_dependencies_from_json, sources=sources),
        _cached(_get_dependencies_from_pip, sources=sources),
    ]
    ireq = requirement.as_ireq()
    last_exc = None
    for getter in getters:
        try:
            result = getter(ireq)
        except Exception as e:
            last_exc = sys.exc_info()
            continue
        if result is not None:
            deps, pyreq = result
            reqs = [requirementslib.Requirement.from_line(d) for d in deps]
            return reqs, pyreq
    if last_exc:
        six.reraise(*last_exc)
    raise RuntimeError("failed to get dependencies for {}".format(
        requirement.as_line(),
    ))
154555
def one_for_all(self, deps):
        
        requires, dependencies = [], []
        deps.reverse()
        # Inverting the list brings the
        # dependencies in order to be installed.
        requires = Utils().dimensional_list(deps)
        dependencies = Utils().remove_dbs(requires)
        return dependencies
619667
function getDirectRequires(p) {
      return p.dependencies.filter(function(d) {
        return DIRECT_REQUIRES_REG.test(d);
      }).map(function(d) {
        return "require('"+ getDependencyPath(d, p) +"');";
      }).join('\n');
    }
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
360068
def get_installed_daps(location=None, skip_distro=False):
    ''''''
    if location:
        locations = [location]
    else:
        locations = _data_dirs()
    s = set()
    for loc in locations:
        if skip_distro and loc == DISTRO_DIRECTORY:
            continue
        g = glob.glob('{d}/meta/*.yaml'.format(d=loc))
        for meta in g:
            s.add(meta.split('/')[-1][:-len('.yaml')])
    return s
344364
def _view_deps(self, path, package):
        
        self.size = 0
        packages = []
        dependencies = (Utils().read_file(path + package)).splitlines()
        for dep in dependencies:
            if GetFromInstalled(dep).name():
                ver = GetFromInstalled(dep).version()
                packages.append(dep + ver)
            else:
                dependencies.remove(dep)
        if packages:
            if "--checklist" in self.extra:
                deps, dependencies = [], []
                text = "Found dependencies for the package {0}".format(package)
                backtitle = "{0} {1}".format(self.meta.__all__,
                                             self.meta.__version__)
                status = True
                deps = DialogUtil(packages, text, " Remove ", backtitle,
                                  status).checklist()
                for d in deps:
                    dependencies.append("-".join(d.split("-")[:-1]))
                self.meta.remove_deps_answer = "y"
            else:
                print("")   # new line at start
                self.msg.template(78)
                print("| Found dependencies for the package {0}:".format(
                    package))
                self.msg.template(78)
                for pkg in packages:
                    find = find_package(pkg + self.meta.sp, self.meta.pkg_path)
                    self._sizes(find[0])
                    print("| {0}{1}{2}".format(self.meta.color["RED"], pkg,
                                               self.meta.color["ENDC"]))
                self.msg.template(78)
                self._calc_sizes()
                print("| {0}Size of removed dependencies {1} {2}{3}".format(
                    self.meta.color["GREY"], round(self.size, 2), self.unit,
                    self.meta.color["ENDC"]))
                self.msg.template(78)
        return dependencies