class_docstr: Callback that streams epoch results to a csv file.
  
  Supports all values that can be represented as a string,
  including 1D iterables such as `np.ndarray`.
  
  Example:
  
      ```python
      csv_logger = CSVLogger('training.log')
      model.fit(X_train, Y_train, callbacks=[csv_logger])
      ```
code: def on_train_begin(self, logs=None):
      if self.append:
          if os.path.exists(self.filename):
              with open(self.filename, "r" + self.file_flags) as f:
                  self.append_header = not bool(len(f.readline()))
          mode = "a"
      else:
          mode = "w"
      self.csv_file = io.open(
          self.filename, mode + self.file_flags, **self._open_args
      )
  
file_path: elegy/elegy/callbacks/csv_logger.py
imports: import collections
  import csv
  import io
  import os
  import typing
  import numpy
  import six
  from .callback import Callback
label_desc: Use image node_id 2 for calling the CSVLogger obj's underlying member method code with example usage: obj.on_train_begin(logs) without return types