def METHOD_NAME(photos_library: str | pathlib.Path) -> pathlib.Path:
    """Returns path to Photos database file for Photos library
    Args:
        photos_library: path to Photos library; may be path to the root of the library or the photos.db file
    Returns: pathlib.Path to Photos database file
    """
    photos_library = pathlib.Path(photos_library)
    if photos_library.is_file():
        return photos_library
    photos_version = get_photos_library_version(photos_library)
    if photos_version < 5:
        if photos_library.is_dir():
            photos_library = photos_library / "database" / "photos.db"
    elif photos_library.is_dir():
        photos_library = photos_library / "database" / "Photos.sqlite"
    return photos_library