def flatten_aggregated_list_results(paged_results, item_key):
    """Flatten a split-up list as returned by GCE "aggregatedList" API.

    The compute API's aggregatedList methods return a structure in
    the form:
      {
        items: {
          $group_value_1: {
            $item_key: [$items]
          },
          $group_value_2: {
            $item_key: [$items]
          },
          $group_value_3: {
            "warning": {
              message: "There are no results for ..."
            }
          },
          ...,
          $group_value_n, {
            $item_key: [$items]
          },
        }
      }
    where each "$group_value_n" is a particular element in the
    aggregation, e.g. a particular zone or group or whatever, and
    "$item_key" is some type-specific resource name, e.g.
    "backendServices" for an aggregated list of backend services.

    This method takes such a structure and yields a simple list of
    all $items across all of the groups.

    Args:
        paged_results (list): A list of paged API response objects.
            [{page 1 results}, {page 2 results}, {page 3 results}, ...]
        item_key (str): The name of the key within the inner "items" lists
            containing the objects of interest.

    Returns:
        list: A list of items.
    """
    items = []
    for page in paged_results:
        aggregated_items = page.get('items', {})
        for items_for_grouping in list(aggregated_items.values()):
            for item in items_for_grouping.get(item_key, []):
                items.append(item)
    return items