docstr: CSV Logger which can write dict result to csv file.
  
  Args:
      output_file(str): filename of the csv file.
  
  Examples:
      ```python
      from parl.utils import CSVLogger
  
      csv_logger = CSVLogger("result.csv")
      csv_logger.log_dict({"loss": 1, "reward": 2})
      csv_logger.log_dict({"loss": 3, "reward": 4})
      ```
  
      The content of the `result.csv`:
      loss,reward
      1,2
      3,4
code: def __init__(self, output_file):
      """CSV Logger which can write dict result to csv file.
  
      Args:
          output_file(str): filename of the csv file.
  
      Examples:
          ```python
          from parl.utils import CSVLogger
  
          csv_logger = CSVLogger("result.csv")
          csv_logger.log_dict({"loss": 1, "reward": 2})
          csv_logger.log_dict({"loss": 3, "reward": 4})
          ```
  
          The content of the `result.csv`:
          loss,reward
          1,2
          3,4
      """
  
      # reference: https://stackoverflow.com/questions/1170214/python-2-csv-writer-produces-wrong-line-terminator-on-windows/1170297#1170297
      self.output_file = open(output_file, "w", newline="")
  
      self.csv_writer = None
      self.lock = threading.Lock()
      self.keys_set = None
  
file_path: PARL/parl/utils/csv_logger.py
imports: import csv
  import threading
label_desc: Use image node_id 1 to create a new CSVLogger object from inherited base classes: object with example: obj = CSVLogger(output_file)