def parse_result(self, d):
        """Parses the output of :meth:`to_mongo` when the result is a dict or returns an expression
        that can be evaluated lazily.

        Args:
            d: the result dict or None

        Returns:
            the list of field values or a lazy partial result
        """
        if self._lazy:
            # Return a function to be called on a single result value
            # For performance, x is assumed to be the value itself
            # (e.g. the result of doc[self._big_result])
            if not self._raw and self._field is not None:
                fcn = self._field.to_python
                level = self._num_list_fields
                return lambda x, _f=_transform_values, _g=fcn, _lv=level: _f(
                    x, _g, level=_lv
                )
            else:
                return lambda x: x

        if self._big_result:
            values = [di[self._big_field] for di in d]
        else:
            values = d["values"]

        if self._raw:
            return values

        if self._field is not None:
            fcn = self._field.to_python
            level = 1 + self._num_list_fields

            return _transform_values(values, fcn, level=level)

        return values
Parses the output of :meth:`to_mongo` when the result is a dict or returns an expression
        that can be evaluated lazily.

        Args:
            d: the result dict or None

        Returns:
            the list of field values or a lazy partial result
        
fiftyone/core/aggregations.py