def _rewrite_and_copy(src_file, dst_file, project_name):
    # Create temp file
    fh, abs_path = mkstemp()

    with io.open(abs_path, 'w', encoding='utf-8') as new_file:
        with io.open(src_file, 'r', encoding='utf-8') as old_file:
            for line in old_file:
                new_line = line.replace('#{project}', project_name). \
                    replace('#{project|title}', project_name.title())
                new_file.write(new_line)

    # Copy to new file
    shutil.copy(abs_path, dst_file)
    os.close(fh)
Comments.
dataset/ETHPy150Open hustlzp/Flask-Boost/flask_boost/cli.py/_rewrite_and_copy--crossover with--dataset/ETHPy150Open pytest-dev/pytest-bdd/tests/feature/test_scenario.py/comments