import collections


def get_acr_parent_id_map(acrs):
  """Get mappings from parent id to all children."""
  parent_map = collections.defaultdict(set)
  for acr in acrs:
    if acr.parent_id:
      parent_map[acr.parent_id].add(acr)
  return parent_map