def auto_deserialize(value):
    """
    Deserializes a value from the execution cache.

    Args:
        value: the value to deserialize

    Returns:
        The deserialized value.
    """
    if focu._is_sample_dict(value):
        value = {k: v for k, v in value.items() if k != "_cls"}
        return fo.Sample.from_dict(value)
    elif isinstance(value, dict) and "_cls" in value:
        cls = value["_cls"]
        if cls == "tuple":
            return tuple(auto_deserialize(v) for v in value["values"])
        elif cls == "set":
            return set(auto_deserialize(v) for v in value["values"])
        elif cls == "date":
            return datetime.fromisoformat(value["value"]).date()
        elif cls == "datetime":
            return datetime.fromisoformat(value["value"])
        raise TypeError(f"Cannot deserialize value of type {cls}: {value}")
    elif isinstance(value, str):
        return value
    elif isinstance(value, dict):
        return {str(k): auto_deserialize(v) for k, v in value.items()}
    elif isinstance(value, list):
        return [auto_deserialize(v) for v in value]
    elif isinstance(value, tuple):
        return tuple(auto_deserialize(v) for v in value)
    elif isinstance(value, set):
        return set(auto_deserialize(v) for v in value)
    else:
        return value

    Deserializes a value from the execution cache.

    Args:
        value: the value to deserialize

    Returns:
        The deserialized value.
    
fiftyone/operators/cache/serialization.py