docstr: Output result to the csv file.
  
  Will create the header of the csv file automatically when the function is called for the first time.
  Ususally, the keys of the result should be the same every time you call the function.
  
  Args:
      result(dict)
code: def log_dict(self, result):
      """Output result to the csv file.
  
      Will create the header of the csv file automatically when the function is called for the first time.
      Ususally, the keys of the result should be the same every time you call the function.
  
      Args:
          result(dict)
      """
      with self.lock:
          assert isinstance(result, dict), "the input should be a dict."
          if self.csv_writer is None:
              self.csv_writer = csv.DictWriter(
                  self.output_file, result.keys()
              )
              self.csv_writer.writeheader()
              self.keys_set = set(result.keys())
  
          assert (
              set(result.keys()) == self.keys_set
          ), "The keys of the dict should be the same as before."
  
          self.csv_writer.writerow(
              {
                  k: v
                  for k, v in result.items()
                  if k in self.csv_writer.fieldnames
              }
          )
  
file_path: PARL/parl/utils/csv_logger.py
imports: import csv
  import threading
label_desc: Use image node_id 2 for calling the CSVLogger obj's underlying member method code with example usage: obj.log_dict(result) without return types