from contextlib import contextmanager
from pathlib import Path
from os import remove
from typing import Callable


@contextmanager
def after_end(cb_fun: Callable):
    """
    with after_end(cb_fun) as cb_fun:
        ...
    """
    try:
        yield cb_fun
    finally:
        cb_fun()

6d600ba89a1a3bbeabcb934f3f488a3e6a3f8155
<mask token>

<mask token>


@contextmanager
def after_end(cb_fun: Callable):
    """
    with after_end(cb_fun) as cb_fun:
        ...
    """
    try:
        yield cb_fun
    finally:
        cb_fun()

from contextlib import contextmanager
from pathlib import Path
from os import remove
from typing import Callable


@contextmanager
def after_end(cb_fun: Callable):
    """
    with after_end(cb_fun) as cb_fun:
        ...
    """
    try:
        yield cb_fun
    finally:
        cb_fun()
