def serialize_bytes(units, ranges):
        parts = []
        for begin, end in ranges:
            if end is None:
                if begin >= 0:
                    parts.append('%s-' % begin)
                else:
                    parts.append(str(begin))
            else:
                if begin < 0:
                    raise ValueError(
                        "(%r, %r) should have a non-negative first value" % (begin, end))
                if end < 0:
                    raise ValueError(
                        "(%r, %r) should have a non-negative second value" % (begin, end))
                parts.append('%s-%s' % (begin, end))
        return '%s=%s' % (units, ','.join(parts))
test (complex expression on) aggregate (should work for annotate either)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/webob_0_9/webob/byterange.py/Range.serialize_bytes--crossover with--dataset/ETHPy150Open chrisglass/django_polymorphic/polymorphic/tests.py/PolymorphicTests.test_polymorphic__complex_aggregate