def testRegex(self):
    agg = aggregation.Aggregation({
        'a' : {
            ('success', re.compile("[1-3][0-9][0-9]")):  [aggregation.Sum(dataFormat = aggregation.DataFormats.DIRECT)],
            ('error', re.compile("[4-5][0-9][0-9]")):  [aggregation.Sum(dataFormat = aggregation.DataFormats.DIRECT)]
        }})
    agg.addSource('source1', {'a': {'200': 10, '302': 10, '404': 1, '500': 3}})
    result = agg.result()
    self.assertEquals(result['a']['success']['sum'], 20)
    self.assertEquals(result['a']['error']['sum'], 4)
Extracts a bytestring from a CFData object
dataset/ETHPy150Open Cue/scales/src/greplin/scales/aggregation_test.py/AggregationTest.testRegex--crossover with--dataset/ETHPy150Open wbond/oscrypto/oscrypto/_osx/_core_foundation_cffi.py/CFHelpers.cf_data_to_bytes