testing/libfuzzer/gen_fuzzer_owners.py
def FindGroupsAndDepsInDeps(deps_list, build_dir):
  """Return list of groups, as well as their deps, from a list of deps."""
  groups = []
  deps_for_groups = {}
  for deps in deps_list:
    output = subprocess.check_output(
        [GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps]).decode(
                'utf8')
    needle = 'Type: '
    for line in output.splitlines():
      if needle and not line.startswith(needle):
        continue
      if needle == 'Type: ':
        if line != 'Type: group':
          break
        groups.append(deps)
        assert deps not in deps_for_groups
        deps_for_groups[deps] = []
        needle = 'Direct dependencies'
      elif needle == 'Direct dependencies':
        needle = ''
      else:
        assert needle == ''
        if needle == line:
          break
        deps_for_groups[deps].append(line.strip())

  return groups, deps_for_groups
Return list of groups, as well as their deps, from a list of deps.
Return list of groups, as well as their deps, from a list of deps.
Return list of groups as well as their deps from a list of deps .
def FindGroupsAndDepsInDeps(deps_list, build_dir):
  groups = []
  deps_for_groups = {}
  for deps in deps_list:
    output = subprocess.check_output(
        [GNPath(), 'desc', '--fail-on-unused-args', build_dir, deps]).decode(
                'utf8')
    needle = 'Type: '
    for line in output.splitlines():
      if needle and not line.startswith(needle):
        continue
      if needle == 'Type: ':
        if line != 'Type: group':
          break
        groups.append(deps)
        assert deps not in deps_for_groups
        deps_for_groups[deps] = []
        needle = 'Direct dependencies'
      elif needle == 'Direct dependencies':
        needle = ''
      else:
        assert needle == ''
        if needle == line:
          break
        deps_for_groups[deps].append(line.strip())
  return groups, deps_for_groups
def FindGroupsAndDepsInDeps ( deps_list , build_dir ) : groups = [ ] deps_for_groups = { } for deps in deps_list : output = subprocess . check_output ( [ GNPath ( ) , 'desc' , '--fail-on-unused-args' , build_dir , deps ] ) . decode ( 'utf8' ) needle = 'Type: ' for line in output . splitlines ( ) : if needle and not line . startswith ( needle ) : continue if needle == 'Type: ' : if line != 'Type: group' : break groups . append ( deps ) assert deps not in deps_for_groups deps_for_groups [ deps ] = [ ] needle = 'Direct dependencies' elif needle == 'Direct dependencies' : needle = '' else : assert needle == '' if needle == line : break deps_for_groups [ deps ] . append ( line . strip ( ) ) return groups , deps_for_groups
Return list of groups, as well as their deps, from a list of deps.
Return list of groups as well as their deps from a list of deps .
"""Return list of groups, as well as their deps, from a list of deps."""
deps_list
build_dir