CoNLL Universal Dependency format:
0 ID
1 FORM
2 LEMMA
3 UPOS
4 XPOS
5 FEATS
6 HEAD
7 DEPREL
8 MISC
426922
@Override
    public DependencyInstance nextInstance() throws IOException {

        ArrayList<String[]> lstLines = getFileContentAsArray();

        if (lstLines.isEmpty()) {
            return null;
        }

        int length = lstLines.size();
        String[] forms = new String[length + 1];
        String[] lemmas = new String[length + 1];
        String[] cpos = new String[length + 1];
        String[] pos = new String[length + 1];
        String[][] feats = new String[length + 1][];
        String[] deprels = new String[length + 1];
        int[] heads = new int[length + 1];

        forms[0] = "<root>";
        lemmas[0] = "<root-LEMMA>";
        pos[0] = "<root-POS>";
        cpos[0] = pos[0];
        deprels[0] = "<no-type>";
        heads[0] = -1;

        boolean hasLemma = false;

        for (int i = 1; i < length + 1; ++i) {
            String[] parts = lstLines.get(i-1);
            forms[i] = parts[1];
            if (!parts[2].equals("_")) {
                lemmas[i] = parts[2];
                hasLemma = true;
            }

            pos[i] = parts[3];
            cpos[i] = pos[i];

            if (!parts[5].equals("_")) {
                feats[i] = parts[5].split("\\|");
            }

            if (parts[6].equals("_")) {
                System.out.println("Error in sentence:\n");
                System.out.println(parts[0] + " " + parts[1] + " " +  parts[2] + " " + parts[3]);
            }

            heads[i] = Integer.parseInt(parts[6]);
            deprels[i] = parts[7];

        }
        if (!hasLemma) lemmas = null;

        return new DependencyInstance(forms, lemmas, cpos, pos, feats, heads, deprels, null, null);
    }
1309431
def parse_dependencies(dependencies: List[List[str]],
                       patton_config: PattonRunningConfig) -> Dict:
    """"""

    result = {}

    for source_type, source_content in dependencies:

        # Select parser
        parser = DEPENDENCIES_PARSERS[patton_config.source_type]

        if not source_content:
            continue

        if source_type == "cli_input":
            fixed_source = "\n".join(source_content)
        else:
            fixed_source = source_content

        result.update(parser(fixed_source, patton_config))

    return result
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())
}
421809
def parse_dependency_links(file_name):
    
    dependency_links = []
    with open(file_name) as f:
        for line in f:
            if re.match(r'\s*-[ef]\s+', line):
                dependency_links.append(re.sub(r'\s*-[ef]\s+',\
                        '', line))
    return dependency_links
880341
def _load_forms_and_lemmas(self):
		""""""

		rel_path = os.path.join(CLTK_DATA_DIR,
                                'old_english',
                                'model',
                                'old_english_models_cltk',
                                'data',
                                'oe.lemmas')
		path = os.path.expanduser(rel_path)

		self.lemma_dict = {}

		with open(path, 'r') as infile:
			lines = infile.read().splitlines()
			for line in lines:
				forms = line.split('\t')
				
				lemma = forms[0]
				for form_seq in forms:
					indiv_forms = form_seq.split(',')
					for form in indiv_forms:
						form = form.lower()
						lemma_list = self.lemma_dict.get(form, [])
						lemma_list.append(lemma)
						self.lemma_dict[form] = lemma_list

		for form in self.lemma_dict.keys():
			self.lemma_dict[form] = list(set(self.lemma_dict[form]))
470527
def deps_tree(self):
        
        dependencies = self.dependencies + [self.name]
        if self.repo == "sbo":
            for dep in dependencies:
                deps = Requires(flag="").sbo(dep)
                if dep not in self.deps_dict.values():
                    self.deps_dict[dep] = Utils().dimensional_list(deps)
        else:
            for dep in dependencies:
                deps = Dependencies(self.repo, self.black).binary(dep, flag="")
                if dep not in self.deps_dict.values():
                    self.deps_dict[dep] = Utils().dimensional_list(deps)
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
38828
function findUnmet (obj, opts) {
  var findUnmetSeen = opts.findUnmetSeen
  if (findUnmetSeen.indexOf(obj) !== -1) return
  findUnmetSeen.push(obj)
  debug("find unmet parent=%s obj=", obj.parent && obj.parent.name, obj.name || obj)
  var deps = obj.dependencies = obj.dependencies || {}

  debug(deps)
  Object.keys(deps)
    .filter(function (d) { return typeof deps[d] === "string" })
    .forEach(function (d) {
      var found = findDep(obj, d)
      debug("finding dep %j", d, found && found.name || found)
      // "foo":"http://blah" and "foo":"latest" are always presumed valid
      if (typeof deps[d] === "string" &&
          semver.validRange(deps[d], true) &&
          found &&
          !semver.satisfies(found.version, deps[d], true)) {
        // the bad thing will happen
        opts.log( "unmet dependency"
                , obj.path + " requires "+d+"@'"+deps[d]
                + "' but will load\n"
                + found.path+",\nwhich is version "+found.version )
        found.invalid = true
      }
      if (found) {
        deps[d] = found
      }
    })

  var peerDeps = obj.peerDependencies = obj.peerDependencies || {}
  Object.keys(peerDeps).forEach(function (d) {
    var dependency

    if (!obj.parent) {
      dependency = obj.dependencies[d]

      // read it as a missing dep
      if (!dependency) {
        obj.dependencies[d] = peerDeps[d]
      }
    } else {
      var r = obj.parent
      while (r && !dependency) {
        dependency = r.dependencies && r.dependencies[d]
        r = r.link ? null : r.parent
      }
    }

    if (!dependency) {
      // mark as a missing dep!
      obj.dependencies[d] = peerDeps[d]
    } else if (!semver.satisfies(dependency.version, peerDeps[d], true)) {
      dependency.peerInvalid = true
    }
  })

  return obj
}
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;
}
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))
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
    }
  }
1121415
def _parse_dependencies(string):
    
    contents = _get_contents_between(string, '(', ')')
    unsorted_dependencies = contents.split(',')
    _check_parameters(unsorted_dependencies, ('?',))

    buildable_dependencies = []
    given_dependencies = []
    for dependency in unsorted_dependencies:
        if dependency[0] == '?':
            given_dependencies.append(dependency[1:])
        else:
            buildable_dependencies.append(dependency)

    string = string[string.index(')') + 1:]
    return buildable_dependencies, given_dependencies, string
393300
def consolidate_dependencies(needs_ipython, child_program,
                             requirement_files, manual_dependencies):
    """"""
    # We get the logger here because it's not defined at module level
    logger = logging.getLogger('fades')

    if needs_ipython:
        logger.debug("Adding ipython dependency because --ipython was detected")
        ipython_dep = parsing.parse_manual(['ipython'])
    else:
        ipython_dep = {}

    if child_program:
        srcfile_deps = parsing.parse_srcfile(child_program)
        logger.debug("Dependencies from source file: %s", srcfile_deps)
        docstring_deps = parsing.parse_docstring(child_program)
        logger.debug("Dependencies from docstrings: %s", docstring_deps)
    else:
        srcfile_deps = {}
        docstring_deps = {}

    all_dependencies = [ipython_dep, srcfile_deps, docstring_deps]

    if requirement_files is not None:
        for rf_path in requirement_files:
            rf_deps = parsing.parse_reqfile(rf_path)
            logger.debug('Dependencies from requirements file %r: %s', rf_path, rf_deps)
            all_dependencies.append(rf_deps)

    manual_deps = parsing.parse_manual(manual_dependencies)
    logger.debug("Dependencies from parameters: %s", manual_deps)
    all_dependencies.append(manual_deps)

    # Merge dependencies
    indicated_deps = {}
    for dep in all_dependencies:
        for repo, info in dep.items():
            indicated_deps.setdefault(repo, set()).update(info)

    return indicated_deps
742588
def log_dependency(dependency)
      log = "#{dependency.name} - "
      log += dependency.source.to_log.to_s
      log += " (#{dependency.version.to_simple})"

      Logger.dot log
      nil
    end
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))
1175296
function getDepends(file, config) {
    var code = fs.readFileSync(file, 'utf8'),
        // only process the first module in file
        meta = ast.parse(code)[0],
        deps = ((meta || {}).dependencies || []).map(function (dep) {
            return idToPath(dep, config);
        });
    return deps;
}
1261536
def needs(self):
        """"""
        result = []
        for dep in self.dependencies:
            module = dep.split(".")[0].lower()
            if module not in result:
                result.append(module)

        return result