def temp_file_for(path):
    ext = os.path.splitext(path)[1]
    with NamedTemporaryFile(suffix=ext, delete=False) as f:
        return f.name
Recreate a function, replacing some info.
dataset/ETHPy150Open beetbox/beets/beets/util/artresizer.py/temp_file_for--crossover with--dataset/ETHPy150Open pytest-dev/pytest-bdd/pytest_bdd/steps.py/recreate_function