@contextmanager
    def clone_with_new_dockerfile(self, conf, docker_file):
        log.info("Copying context to add a different dockerfile")
        self.close()
        with a_temp_file() as tmpfile:
            old_t = os.stat(self.tmpfile.name).st_size > 0
            if old_t:
                shutil.copy(self.tmpfile.name, tmpfile.name)

            with tarfile.open(tmpfile.name, mode="a") as t:
                conf.add_docker_file_to_tarfile(docker_file, t)
                yield ContextWrapper(t, tmpfile)
Checking selecting values from an Index (long flavor)
dataset/ETHPy150Open realestate-com-au/harpoon/harpoon/ship/context.py/ContextWrapper.clone_with_new_dockerfile--crossover with--dataset/ETHPy150Open PyTables/PyTables/tables/tests/test_indexvalues.py/SelectValuesTestCase.test03c