def _get_dependencies(documents, deps_mode=True):
  doc_set = set()

  for doc in documents:
    stack = [doc]
    while stack:
      curr_doc = stack.pop()
      if curr_doc not in doc_set:
        doc_set.add(curr_doc)
        if deps_mode:
          deps_set = set(curr_doc.dependencies.all())
        else:
          deps_set = set(curr_doc.children.all())
        stack.extend(deps_set - doc_set)

  return doc_set
Initialize the translations catalog.
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/api2.py/_get_dependencies--crossover with--dataset/ETHPy150Open lad1337/XDM/site-packages/babel/support.py/Translations.__init__