code: def write_cols(self) -> Sequence[Hashable]:
      if self._has_aliases:
          assert not isinstance(self.header, bool)
          if len(self.header) != len(self.cols):
              raise ValueError(
                  f"Writing {len(self.cols)} cols but got {len(self.header)} aliases"
              )
          return self.header
      else:
          # self.cols is an ndarray derived from Index._format_native_types,
          #  so its entries are strings, i.e. hashable
          return cast(Sequence[Hashable], self.cols)
  
imports: from __future__ import annotations
  import csv
  import os
  from typing import TYPE_CHECKING, Any, Hashable, Iterator, Sequence, cast
  import numpy
  from pandas._libs import writers
  from pandas._typing import CompressionOptions, FilePath, FloatFormatType, IndexLabel, StorageOptions, WriteBuffer
  from pandas.util._decorators import cache_readonly
  from pandas.core.dtypes.generic import ABCDatetimeIndex, ABCIndex, ABCMultiIndex, ABCPeriodIndex
  from pandas.core.dtypes.missing import notna
  from pandas.core.indexes.api import Index
  from pandas.io.common import get_handle
label_desc: Use image node_id 20 for calling the CSVFormatter obj's underlying member method code with example usage: obj.write_cols() and returns: self, cast