<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def all_coarse_grains(indices):
 """Generator over all possible |CoarseGrains| of these indices. Args: indices (tuple[int]):
 Node indices to coarse grain. Yields: CoarseGrain: The next |CoarseGrain| for ``indices``. """

    for partition in all_partitions(indices):
        for grouping in all_groupings(partition):
            yield CoarseGrain(partition, grouping)