from typing import Optional


def prepare_basis(basis: Optional[str]) -> Optional[str]:
    """
    Prepares a basis set string
    """
    if basis is None:
        return basis

    if basis == "":
        return None

    if basis == "null":
        return None

    return basis.lower()