def write(self):
    if (self.contents is None):
        create_file(self.file_path)
    else:
        ensure_parent_dir_exists(self.file_path)
        self._write(self.file_path, self.contents)
def write(self):
    if (self.contents is None):
        create_file(self.file_path)
    else:
        ensure_parent_dir_exists(self.file_path)
        self._write(self.file_path, self.contents)