class_docstr: The default implementation of the FlaggingCallback abstract class. Each flagged
  sample (both the input and output data) is logged to a CSV file with headers on the machine running the gradio app.
  Example:
      import gradio as gr
      def image_classifier(inp):
          return {'cat': 0.3, 'dog': 0.7}
      demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label",
                          flagging_callback=CSVLogger())
  Guides: using-flagging
class_docstr_tok: ["The","default","implementation","of","the","FlaggingCallback","abstract","class",".","Each","flagged","sample","(","both","the","input","and","output","data",")","is","logged","to","a","CSV","file","with","headers","on","the","machine","running","the","gradio","app",".","Example",":","import","gradio","as","gr","def","image_classifier","(","inp",")",":","return","{","'cat","'",":","0.3",",","'dog","'",":","0.7","}","demo","=","gr.Interface","(","fn=image_classifier",",","inputs=","''","image","''",",","outputs=","''","label","''",",","flagging_callback=CSVLogger","(",")",")","Guides",":","using-flagging"]
code: def setup(
      self,
      components: list[Component],
      flagging_dir: str | Path,
  ):
      self.components = components
      self.flagging_dir = flagging_dir
      os.makedirs(flagging_dir, exist_ok=True)
  
imports: from __future__ import annotations
  import csv
  import datetime
  import json
  import os
  import time
  import uuid
  from abc import ABC, abstractmethod
  from collections import OrderedDict
  from pathlib import Path
  from typing import TYPE_CHECKING, Any
  import filelock
  import huggingface_hub
  from gradio_client import utils
  from gradio_client.documentation import document, set_documentation_group
  import gradio
  from gradio import utils
label_desc: Use image node_id 2 for calling the CSVLogger obj's underlying member method code with example usage: obj.setup(components, flagging_dir) without return types