def METHOD_NAME(file_no: int) -> Generator[Tuple[Path, BinaryIO], None, None]:
    if TYPE_CHECKING:
        # this is here because mypy gets a bit confused
        assert output_dir is not None
    fp = Path(output_dir) / f"{file_name_stem}_{str(file_no).zfill(6)}.nt"
    with open(fp, "wb") as fh:
        yield fp, fh