def METHOD_NAME(self, file_name):
    with open(file_name, "w") as f:
        if file_name.endswith(".csv"):
            delimiter = ","
        elif file_name.endswith(".tsv"):
            delimiter = "\t"
        else:
            return None
        writer = csv.writer(f, delimiter=delimiter)
        writer.writerow(self.columns)
        for r in self.data:
            writer.writerow(r)