def write(self, data, file_path, replace=False):
        if os.path.exists(file_path) and not replace:
            raise Exception('File %s already exists.' % file_path)

        with open(file_path, 'w') as f:
            f.write(data)
dataset/ETHPy150Open StackStorm/st2/st2exporter/st2exporter/exporter/file_writer.py/TextFileWriter.write/original