def _aggregate_counts(child_counts):
  """Return aggregated node count as int."""
  if not child_counts:
    return 1
  elif len(child_counts) == 1:
    return child_counts[0]
  elif len(child_counts) == 2:
    return child_counts[0] * child_counts[1]
  else:
    raise ValueError
Return aggregated node count as int.
language/compgen/nqg/model/induction/codelength_utils.py