Parse all dependencies
176724
function depends (targets) {
    debug('Depends: start parse dependencies');
    targets = prepare.targets(targets).filter(directories);
    debug('Depends: target : ' + targets);
    targets.forEach(parse_node_module);
}
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())
}
35748
def ParseMultiple(self, result_dicts):
    """"""
    status = rdf_client.SoftwarePackage.InstallState.INSTALLED

    packages = []
    for result_dict in result_dicts:
      result = result_dict.ToDict()

      # InstalledOn comes back in a godawful format such as '7/10/2013'.
      installed_on = self.AmericanDateToEpoch(result.get("InstalledOn", ""))
      packages.append(
          rdf_client.SoftwarePackage(
              name=result.get("HotFixID"),
              description=result.get("Caption"),
              installed_by=result.get("InstalledBy"),
              install_state=status,
              installed_on=installed_on))

    if packages:
      yield rdf_client.SoftwarePackages(packages=packages)
1109876
def parse(self):
        
        try:
            data = toml.loads(self.obj.content, _dict=OrderedDict)
            if data:
                for package_type in ['packages', 'dev-packages']:
                    if package_type in data:
                        for name, specs in data[package_type].items():
                            # skip on VCS dependencies
                            if not isinstance(specs, basestring):
                                continue
                            if specs == '*':
                                specs = ''
                            self.obj.dependencies.append(
                                Dependency(
                                    name=name, specs=SpecifierSet(specs),
                                    dependency_type=filetypes.pipfile,
                                    line=''.join([name, specs]),
                                    section=package_type
                                )
                            )
        except (toml.TomlDecodeError, IndexError) as e:
            pass
440283
def Dependencies(tools):
    
    dependencies = []
    if tools:
        path_dirs = PathDirs()
        man = Template(join(path_dirs.meta_dir, 'plugin_manifest.cfg'))
        for section in man.sections()[1]:
            # don't worry about dealing with tool if it's not running
            running = man.option(section, 'running')
            if not running[0] or running[1] != 'yes':
                continue
            t_name = man.option(section, 'name')[1]
            t_branch = man.option(section, 'branch')[1]
            t_version = man.option(section, 'version')[1]
            t_identifier = {'name': t_name,
                            'branch': t_branch,
                            'version': t_version}
            options = man.options(section)[1]
            if 'docker' in options:
                d_settings = json.loads(man.option(section,
                                                   'docker')[1])
                if 'links' in d_settings:
                    for link in json.loads(d_settings['links']):
                        if link in tools:
                            dependencies.append(t_identifier)
    return dependencies
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
1105493
def _install_dependencies(self, ui, debug):
        """"""
        for dep_t, dep_l in self.dependencies:
            if not dep_l:
                continue
            pkg_mgr = self.get_package_manager(dep_t)
            pkg_mgr.works()
            to_resolve = []
            for dep in dep_l:
                if not pkg_mgr.is_pkg_installed(dep):
                    to_resolve.append(dep)
            if not to_resolve:
                # nothing to install, let's move on
                continue
            to_install = pkg_mgr.resolve(*to_resolve)
            confirm = self._ask_to_confirm(ui, pkg_mgr, *to_install)
            if not confirm:
                msg = 'List of packages denied by user, exiting.'
                raise exceptions.DependencyException(msg)

            type(self).install_lock = True
            # TODO: we should do this more systematically (send signal to cl/gui?)
            logger.info('Installing dependencies, sit back and relax ...',
                        extra={'event_type': 'dep_installation_start'})
            if ui == 'cli' and not debug:  # TODO: maybe let every manager to decide when to start
                event = threading.Event()
                t = EndlessProgressThread(event)
                t.start()
            installed = pkg_mgr.install(*to_install)
            if ui == 'cli' and not debug:
                event.set()
                t.join()
                if installed:
                    logger.info(' Done.')
                else:
                    logger.error(' Failed.')
            type(self).install_lock = False

            log_extra = {'event_type': 'dep_installation_end'}
            if not installed:
                msg = 'Failed to install dependencies, exiting.'
                logger.error(msg, extra=log_extra)
                raise exceptions.DependencyException(msg)
            else:
                logger.info('Successfully installed dependencies!', extra=log_extra)
18210
function getDependencies(jsSource) {
  const lines = jsSource.split('\n');
  const dependencies = {
    ol: pkg.version
  };
  for (let i = 0, ii = lines.length; i < ii; ++i) {
    const line = lines[i];
    const importMatch = line.match(importRegEx);
    if (importMatch) {
      const imp = importMatch[1];
      if (!imp.startsWith('ol/') && imp != 'ol') {
        const parts = imp.split('/');
        let dep;
        if (imp.startsWith('@')) {
          dep = parts.slice(0, 2).join('/');
        } else {
          dep = parts[0];
        }
        if (dep in pkg.devDependencies) {
          dependencies[dep] = pkg.devDependencies[dep];
        }
      }
    }
  }
  return dependencies;
}
46565
def read_dependencies(filename):
    
    dependencies = []
    filepath = os.path.join('requirements', filename)
    with open(filepath, 'r') as stream:
        for line in stream:
            package = line.strip().split('#')[0].strip()
            if package and package.split(' ')[0] != '-r':
                dependencies.append(package)
    return dependencies
631022
def get_deps(self):
        
        if self.repo == "rlw":
            dependencies = {}
            rlw_deps = Utils().read_file(_meta_.conf_path + "rlworkman.deps")
            for line in rlw_deps.splitlines():
                if line and not line.startswith("#"):
                    pkgs = line.split(":")
                    dependencies[pkgs[0]] = pkgs[1]
            if self.name in dependencies.keys():
                return dependencies[self.name].split()
            else:
                return ""
        else:
            PACKAGES_TXT = Utils().read_file("{0}{1}_repo/PACKAGES.TXT".format(
                _meta_.lib_path, self.repo))
            for line in PACKAGES_TXT.splitlines():
                if line.startswith("PACKAGE NAME:"):
                    pkg_name = split_package(line[14:].strip())[0]
                if line.startswith("PACKAGE REQUIRED:"):
                    if pkg_name == self.name:
                        if line[18:].strip():
                            return self._req_fix(line)
750136
def dependencies(self, sort=False):
        
        alldeps = []
        if sort:
            def key(obj):
                # sort deps such that we get functions, variables, self.
                if not isinstance(obj, Variable):
                    return (0, 0)
                else:
                    return (1, obj.vtype)
            
            deps = sorted(self._deps, key=key)
        else:
            deps = self._deps
        
        for dep in deps:
            alldeps.extend(dep.dependencies(sort=sort))
        alldeps.append(self)
        return alldeps
348190
def dependency_tree(args = {}, &bl)
      dependencies = {}
      args = {:recursive    => true,
              :dev_deps     => true,
              :matching     => :latest,
              :dependencies => dependencies}.merge(args)

      process = []
      deps.each do |dep|
        resolved = nil
        begin
          resolved = Polisher::Gem.matching(dep, args[:matching])
        rescue
        end
        yield self, dep, resolved
        process << resolved unless resolved.nil?
      end

      process.each { |dep|
        dependencies.merge!(dep.dependency_tree(args, &bl))
      }

      dependencies
    end
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;
}
1125917
function lookForExternalDependencies( jsFiles ) {
  const
  javascriptSources = [],
  resources = {};

  for ( const jsFileName of Object.keys( jsFiles ) ) {
    const depFileName = `${jsFileName}.dep`;
    if ( Project.srcOrLibPath( depFileName ) ) {
      const depFile = new Source( Project, depFileName );
      try {
        const
        json = depFile.read(),
        dependencies = ToloframeworkPermissiveJson.parse( json );
        // Looking for Javascript dependencies.
        lookForExternalDependenciesJS( dependencies.js, javascriptSources );
        // Looking for other dependencies.
        lookForExternalDependenciesRES( dependencies.res, resources, depFile );
      } catch ( ex ) {
        Fatal.fire(
          `Unable to parse JSON file "${depFile.getAbsoluteFilePath()}"!\n${ex}`,
          Project.srcOrLibPath( jsFileName )
        );
      }
    }
  }

  return {
    js: javascriptSources,
    res: resources
  };
}
912219
def build_dependencies(self):
        
        highest = self.dsm or self.root
        if self is highest:
            highest = LeafNode()
        for _import in self.parse_code():
            target = highest.get_target(_import['target'])
            if target:
                what = _import['target'].split('.')[-1]
                if what != target.name:
                    _import['what'] = what
                _import['target'] = target
            self.dependencies.append(Dependency(source=self, **_import))
1343832
function parseDependencies(s) {
    if(s.indexOf('require') == -1) {
      return []
    }
    var index = 0, peek, length = s.length, isReg = 1, modName = 0, res = []
    var parentheseState = 0, parentheseStack = []
    var braceState, braceStack = [], isReturn
    while(index < length) {
      readch()
      if(isBlank()) {
        if(isReturn && (peek == '\n' || peek == '\r')) {
          braceState = 0
          isReturn = 0
        }
      }
      else if(isQuote()) {
        dealQuote()
        isReg = 1
        isReturn = 0
        braceState = 0
      }
      else if(peek == '/') {
        readch()
        if(peek == '/') {
          index = s.indexOf('\n', index)
          if(index == -1) {
            index = s.length
          }
        }
        else if(peek == '*') {
          var i = s.indexOf('\n', index)
          index = s.indexOf('*/', index)
          if(index == -1) {
            index = length
          }
          else {
            index += 2
          }
          if(isReturn && i != -1 && i < index) {
            braceState = 0
            isReturn = 0
          }
        }
        else if(isReg) {
          dealReg()
          isReg = 0
          isReturn = 0
          braceState = 0
        }
        else {
          index--
          isReg = 1
          isReturn = 0
          braceState = 1
        }
      }
      else if(isWord()) {
        dealWord()
      }
      else if(isNumber()) {
        dealNumber()
        isReturn = 0
        braceState = 0
      }
      else if(peek == '(') {
        parentheseStack.push(parentheseState)
        isReg = 1
        isReturn = 0
        braceState = 1
      }
      else if(peek == ')') {
        isReg = parentheseStack.pop()
        isReturn = 0
        braceState = 0
      }
      else if(peek == '{') {
        if(isReturn) {
          braceState = 1
        }
        braceStack.push(braceState)
        isReturn = 0
        isReg = 1
      }
      else if(peek == '}') {
        braceState = braceStack.pop();
        isReg = !braceState
        isReturn = 0
      }
      else {
        var next = s.charAt(index)
        if(peek == ';') {
          braceState = 0
        }
        else if(peek == '-' && next == '-'
          || peek == '+' && next == '+'
          || peek == '=' && next == '>') {
          braceState = 0
          index++
        }
        else {
          braceState = 1
        }
        isReg = peek != ']'
        isReturn = 0
      }
    }
    return res
    function readch() {
      peek = s.charAt(index++)
    }
    function isBlank() {
      return /\s/.test(peek)
    }
    function isQuote() {
      return peek == '"' || peek == "'"
    }
    function dealQuote() {
      var start = index
      var c = peek
      var end = s.indexOf(c, start)
      if(end == -1) {
        index = length
      }
      else if(s.charAt(end - 1) != '\\') {
        index = end + 1
      }
      else {
        while(index < length) {
          readch()
          if(peek == '\\') {
            index++
          }
          else if(peek == c) {
            break
          }
        }
      }
      if(modName) {
        res.push(s.slice(start, index - 1))
        modName = 0
      }
    }
    function dealReg() {
      index--
      while(index < length) {
        readch()
        if(peek == '\\') {
          index++
        }
        else if(peek == '/') {
          break
        }
        else if(peek == '[') {
          while(index < length) {
            readch()
            if(peek == '\\') {
              index++
            }
            else if(peek == ']') {
              break
            }
          }
        }
      }
    }
    function isWord() {
      return /[a-z_$]/i.test(peek)
    }
    function dealWord() {
      var s2 = s.slice(index - 1)
      var r = /^[\w$]+/.exec(s2)[0]
      parentheseState = {
        'if': 1,
        'for': 1,
        'while': 1,
        'with': 1
      }[r]
      isReg = {
        'break': 1,
        'case': 1,
        'continue': 1,
        'debugger': 1,
        'delete': 1,
        'do': 1,
        'else': 1,
        'false': 1,
        'if': 1,
        'in': 1,
        'instanceof': 1,
        'return': 1,
        'typeof': 1,
        'void': 1
      }[r]
      isReturn = r == 'return'
      braceState = {
        'instanceof': 1,
        'delete': 1,
        'void': 1,
        'typeof': 1,
        'return': 1
      }.hasOwnProperty(r);
      modName = /^require\s*\(\s*(['"]).+?\1\s*\)/.test(s2)
      if(modName) {
        r = /^require\s*\(\s*['"]/.exec(s2)[0]
        index += r.length - 2
      }
      else {
        index += /^[\w$]+(?:\s*\.\s*[\w$]+)*/.exec(s2)[0].length - 1
      }
    }
    function isNumber() {
      return /\d/.test(peek)
        || peek == '.' && /\d/.test(s.charAt(index))
    }
    function dealNumber() {
      var s2 = s.slice(index - 1)
      var r
      if(peek == '.') {
        r = /^\.\d+(?:E[+-]?\d*)?\s*/i.exec(s2)[0]
      }
      else if(/^0x[\da-f]*/i.test(s2)) {
        r = /^0x[\da-f]*\s*/i.exec(s2)[0]
      }
      else {
        r = /^\d+\.?\d*(?:E[+-]?\d*)?\s*/i.exec(s2)[0]
      }
      index += r.length - 1
      isReg = 0
    }
  }
1138075
function parseDependenciesList (root, string) {
  return string.split(/\s+/).reduce(function (accumulator, dependency) {
    if (dependency.length > 0) {
      var absolutePath = path.resolve(root, defaultFileExtension(dependency))
      accumulator.push(absolutePath)
    }
    return accumulator
  }, [])
}