def METHOD_NAME(name: str, value: Union[bool, Path, str]):
    """Set preference and write to .env
    Parameters
    ----------
    name : str
        Preference name
    value : Union[bool, Path, str]
        Preference value
    """
    set_preference(name, value)
    write_to_dotenv("OPENBB_" + name, str(value))