from pathlib import Path


def _validate_magics_flake8_warnings(actual: str, test_nb_path: Path) -> bool:
    """Validate the results of notebooks with warnings."""
    expected = (
        f"{str(test_nb_path)}:cell_1:1:1: F401 'random.randint' imported but unused\n"
        f"{str(test_nb_path)}:cell_1:2:1: F401 'IPython.get_ipython' imported but unused\n"
        f"{str(test_nb_path)}:cell_3:6:21: E231 missing whitespace after ','\n"
        f"{str(test_nb_path)}:cell_3:11:10: E231 missing whitespace after ','\n"
    )
    return actual == expected