def METHOD_NAME(parts):
  num_alts = 0
  first_alt_index = -1
  for i, part in enumerate(parts):
    if part.tag == word_part_e.BracedAltPart:
      num_alts += 1
      if num_alts == 1:
        first_alt_index = i
      elif num_alts == 2:
        break  # don't need to count anymore
  # NOTE: There are TWO recursive calls here, not just one -- one for
  # nested {}, and one for adjacent {}.  Thus it's hard to do iteratively.
  if num_alts == 0:
    return [parts]
  elif num_alts == 1:
    suffix = parts[first_alt_index+1 : ]
    return _BraceExpandOne(parts, first_alt_index, [suffix])
  else:
    # Now call it on the tail
    tail_parts = parts[first_alt_index+1 : ]
    suffixes = METHOD_NAME(tail_parts)  # recursive call
    return _BraceExpandOne(parts, first_alt_index, suffixes)