def get_pytypes_len_gen():
    try:
        yield "{\n"

        def get_total_size(obj, n=0):
            if n > 10:
                return 0
            obj_len = 0
            try:
                if callable(getattr(obj, '__len__', False)):
                    obj_len += int(obj.__len__())
            except:
                pass
            for a in gc.get_referents(obj):
                obj_len += get_total_size(a, n + 1)
            return obj_len

        for ob in gc.get_objects():
            if getattr(ob, '__len__', False):
                yield "\"" + repr(type(ob)) + ":" + str(id(ob)) + "\": [" + str(len(ob)) \
                      + ", " + str(get_total_size(ob)) + "]\n"

    except Exception as e:
        yield "\"error\":\"" + repr(e).replace("\"", "\\\"") + "\"\n"
    yield "}\n"
dataset/ETHPy150Open paypal/support/support/meta_service/meta_service.py/get_pytypes_len_gen/original