tools/disable_tests/conditions.py
def generate_condition_groups(terms: List[Terminal]) -> List[Set[Terminal]]:
  """Partition a list of Terminals by their 'group' attribute."""

  by_group = collections.defaultdict(set)
  ungrouped = []
  for term in terms:
    if term.group is not None:
      by_group[term.group].add(term)
    else:
      # Every Terminal without a 'group' attribute gets its own group, as
      # they're not mutually exclusive with anything.
      ungrouped.append({term})

  groups = list(by_group.values())
  groups += ungrouped

  return groups
Partition a list of Terminals by their 'group' attribute.
Partition a list of Terminals by their 'group' attribute.
Partition a list of Terminals by their ' group ' attribute .
def generate_condition_groups(terms: List[Terminal]) -> List[Set[Terminal]]:
  by_group = collections.defaultdict(set)
  ungrouped = []
  for term in terms:
    if term.group is not None:
      by_group[term.group].add(term)
    else:
      ungrouped.append({term})
  groups = list(by_group.values())
  groups += ungrouped
  return groups
def generate_condition_groups ( terms : List [ Terminal ] ) -> List [ Set [ Terminal ] ] : by_group = collections . defaultdict ( set ) ungrouped = [ ] for term in terms : if term . group is not None : by_group [ term . group ] . add ( term ) else : ungrouped . append ( { term } ) groups = list ( by_group . values ( ) ) groups += ungrouped return groups
Partition a list of Terminals by their 'group' attribute.
Partition a list of Terminals by their ' group ' attribute .
"""Partition a list of Terminals by their 'group' attribute.""" # Every Terminal without a 'group' attribute gets its own group, as # they're not mutually exclusive with anything.
terms
List[Terminal]