def generate_failures_file(self):
        """
        Only generate a failures.txt file if there were any failed commands for the build.
        """
        failed_atom_directories = self._get_failed_artifact_directories()
        if len(failed_atom_directories) > 0:
            with open(os.path.join(self.build_artifact_dir, 'failures.txt'), 'w') as f:
                f.write("\n".join(failed_atom_directories))
dataset/ETHPy150Open box/ClusterRunner/app/master/build_artifact.py/BuildArtifact.generate_failures_file/original