from typing import Any
import uuid


def is_valid_uuid(val: Any) -> bool:
    """Check if a string is a valid uuid."""
    try:
        uuid.UUID(str(val))
        return True
    except ValueError:
        return False