def _download_and_extract_results(self, master_api, build_id, download_dir):
        download_artifacts_url = master_api.url('build', build_id, 'result')
        download_filepath = os.path.join(download_dir, BuildArtifact.ARTIFACT_FILE_NAME)
        response = self._network.get(download_artifacts_url)

        if response.status_code == http.client.OK:
            # save tar file to disk, decompress, and delete
            with open(download_filepath, 'wb') as file:
                chunk_size = 500 * 1024
                for chunk in response.iter_content(chunk_size):
                    file.write(chunk)

            extract_tar(download_filepath, delete=True)
Save the text to disk.
dataset/ETHPy150Open box/ClusterRunner/test/framework/functional/base_functional_test_case.py/BaseFunctionalTestCase._download_and_extract_results--crossover with--dataset/ETHPy150Open enthought/envisage/envisage/plugins/text_editor/editor/text_editor_handler.py/TextEditorHandler.save