(self, entry, name='')
Yields all buckets from an aggregation result object.

        Args:
            entry: result dict from an aggregation request.
            name: name of aggregation results that contains
                all aggregation buckets.

        Yields:
            A dict with each aggregation bucket as well as
            the bucket_name.
Yields all buckets from an aggregation result object.
Yields all buckets from an aggregation result object .
def _get_aggregation_buckets(self, entry, name=''):
        """Yields all buckets from an aggregation result object.

        Args:
            entry: result dict from an aggregation request.
            name: name of aggregation results that contains
                all aggregation buckets.

        Yields:
            A dict with each aggregation bucket as well as
            the bucket_name.
        """
        if 'buckets' in entry:
            for bucket in entry.get('buckets', []):
                bucket['bucket_name'] = name
                yield bucket
        else:
            for key, value in iter(entry.items()):
                if not isinstance(value, dict):
                    continue
                for bucket in self._get_aggregation_buckets(
                        value, name=key):
                    yield bucket
def _get_aggregation_buckets ( self , entry , name = '' ) : if 'buckets' in entry : for bucket in entry . get ( 'buckets' , [ ] ) : bucket [ 'bucket_name' ] = name yield bucket else : for key , value in iter ( entry . items ( ) ) : if not isinstance ( value , dict ) : continue for bucket in self . _get_aggregation_buckets ( value , name = key ) : yield bucket