from pathlib import Path


def tmp_dir(tmp_path) -> Path:
    """
    Returns `Path` to the temporary directory.
    If It not exists - creates and returns it.
    """
    dir_path = tmp_path / "tmp_dir"
    if not dir_path.exists():
        dir_path.mkdir()
    return dir_path