def stream_remote_local_validate(
    remote: Optional[str],
    local: Optional[str],
    split: Optional[str],
):
    """Check that, if needed, the local/split directory exists.

    Args:
        remote (Optional[str]): Remote path to the dataset.
        local (Optional[str]): Local path to the dataset.
        split (Optional[str]): Subdirectory specifying which dataset split to use, if any.
    """
    if remote is None or (local == remote):
        if local is not None and os.path.isdir(local):
            contents = set(os.listdir(local))
            if split is not None and split not in contents:
                raise ValueError(
                    f'Local directory {local} does not contain split {split}',
                )
Check that, if needed, the local/split directory exists.

    Args:
        remote (Optional[str]): Remote path to the dataset.
        local (Optional[str]): Local path to the dataset.
        split (Optional[str]): Subdirectory specifying which dataset split to use, if any.
    
llmfoundry/data/data.py