def METHOD_NAME(data, parent=None, neighbours=None):
    """
    Read `aggregations` block in data.
    Example
      Input data:
      ```
        aggregation: {
            field1 : {
                buckets: [
                    {key: 'name1', count: 5},
                    {key: 'name2', count: 10}
                ]
            },
            field2: 5,
            field3 : {
                buckets: [
                    {key: 'name3', count: 7}
                ]
            },
        }
      ```
         Result:
      ```
      [{'field2': 5, 'field1_bucket_key': 'name1', 'field1_bucket_count': 5},
      {'field2': 5, 'field1_bucket_key': 'name2', 'field1_bucket_count': 10},
      {'field2': 5, 'field3_bucket_key': 'name3', 'field3_bucket_count': 7}]
      ```
    """
    if not neighbours:
        neighbours = {}
    if isinstance(data, dict):
        branch_l = {}
        for k, v in deepcopy(data).items():
            if _is_branch_list(v):
                branch_l[k] = v
                data.pop(k)
        for k, v in data.items():
            new_parent = f'{parent}_{k}' if parent else k
            neighbours = METHOD_NAME(v, new_parent, neighbours)
        if not branch_l:
            return neighbours
        else:
            res = []
            for k, v in branch_l.items():
                new_parent = f'{parent}_{k}' if parent else k
                if isinstance(v, list):  # buckets
                    new_list = []
                    for elt in v:
                        new_elt = METHOD_NAME(elt, new_parent, neighbours)
                        if isinstance(new_elt, list):
                            new_list += new_elt
                        else:
                            new_list.append(new_elt)
                    res += new_list
                else:
                    res += METHOD_NAME(v, new_parent, neighbours)
            return res
    else:
        return {**{parent: data}, **neighbours}