def DatabaseDirectorySize(root_path, extension):
  directories = collections.deque([root_path])
  total_size = 0
  total_files = 0
  while directories:
    directory = directories.popleft()
    try:
      items = os.listdir(directory)
    except OSError:
      continue
    for comp in items:
      if comp == constants.REBALANCE_DIRECTORY:
        continue
      path = os.path.join(directory, comp)
      try:
        statinfo = os.lstat(path)
        if stat.S_ISLNK(statinfo.st_mode):
          continue
        if stat.S_ISDIR(statinfo.st_mode):
          directories.append(path)
        elif stat.S_ISREG(statinfo.st_mode):
          if comp.endswith(extension):
            total_size += statinfo.st_size
            total_files += 1
      except OSError:
        continue
  return total_size, total_files
Extracts the dependencies specified in the source code and returns
dataset/ETHPy150Open google/grr/grr/lib/data_stores/common.py/DatabaseDirectorySize--crossover with--dataset/ETHPy150Open sahana/eden/static/scripts/tools/mergejsmf.py/SourceFile._getRequirements