def test_facet_statistical(self):
        FacetTest.index_data([
                {'id': 1, 'value': 1},
                {'id': 2, 'value': 1},
                {'id': 3, 'value': 1},
                {'id': 4, 'value': 2},
                {'id': 5, 'value': 2},
                {'id': 6, 'value': 3},
                {'id': 7, 'value': 3},
                {'id': 8, 'value': 3},
                {'id': 9, 'value': 4},
            ])
        FacetTest.refresh()

        qs = (self.get_s()
              .facet_raw(created1={
                    'statistical': {
                        'field': 'value'
                    }
              })
            )
        data = qs.facet_counts()
        stat = data['created1']
        eq_(stat.count, 9)
        eq_(stat._type, u'statistical')
        eq_(stat.min, 1.0)
        eq_(stat.sum_of_squares, 54.0)
        eq_(stat.max, 4.0)
        eq_(stat.std_deviation, 1.0304020550550783)
        eq_(stat.variance, 1.0617283950617287)
        eq_(stat.total, 20.0)
        eq_(stat.mean, 2.2222222222222223)
Position the builder before the given instruction.
dataset/ETHPy150Open mozilla/elasticutils/elasticutils/tests/test_query.py/FacetTest.test_facet_statistical--crossover with--dataset/ETHPy150Open jrk/llvm-py/llvm/core.py/Builder.position_before