def deepsize(obj, max_depth=4):
    def _recurse(o, dct, depth):
        if max_depth >= 0 and depth > max_depth:
            return
        for ref in get_referents(o):
            idr = id(ref)
            if not idr in dct:
                dct[idr] = (ref, getsizeof(ref, default=0))
                _recurse(ref, dct, depth+1)
    sizedict = {}
    _recurse(obj, sizedict, 0)
    #count = len(sizedict) + 1
    size = getsizeof(obj) + sum([p[1] for p in sizedict.values()])
    return size

# lazy load handler
Send a message to a user.
dataset/ETHPy150Open evennia/evennia/evennia/utils/utils.py/deepsize--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/notify/instapush.py/InstapushNotificationService.send_message