def _max_depth(z):
    """get maximal length of lists stored in a dictionary"""
    depth = 0
    for _, v in z.items():
        if type(v) is list or type(v) is tuple:
            depth = max(depth, len(v))
    return depth