human
Give me a the Python code you requested given the following:
Complete the below
def deepsize(obj, max_depth=4):

    ''''Get not only size of the given object, but also the size of
    objects referenced by the object, down to `max_depth` distance
    from the object.
    Args:
    obj (object): the object to be measured.
    max_depth (int, optional): maximum referential distance
    from `obj` that `deepsize()` should cover for
    measuring objects referenced by `obj`.
    Returns:
    size (int): deepsize of `obj` in Bytes.
    Notes:
    This measure is necessarily approximate since some
    memory is shared between objects. The `max_depth` of 4 is roughly
    tested to give reasonable size information about database models
    and their handlers.'
    '''
assistant
#Here is the Python code you requested.
    def _recurse(o, dct, depth):
        if (0 <= max_depth < depth):
            return
        for ref in get_referents(o):
            idr = id(ref)
            if (idr not in dct):
                dct[idr] = (ref, getsizeof(ref, default=0))
                _recurse(ref, dct, (depth + 1))
    sizedict = {}
    _recurse(obj, sizedict, 0)
    size = (getsizeof(obj) + sum([p[1] for p in sizedict.values()]))
    return size