class_docstr: Interface is Gradio's main high-level class, and allows you to create a web-based GUI / demo
  around a machine learning model (or any Python function) in a few lines of code.
  You must specify three parameters: (1) the function to create a GUI for (2) the desired input components and
  (3) the desired output components. Additional parameters can be used to control the appearance
  and behavior of the demo.
  
  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")
      demo.launch()
  Demos: hello_world, hello_world_3, gpt2_xl
  Guides: quickstart, key-features, sharing-your-app, interface-state, reactive-interfaces, advanced-interface-features, setting-up-a-gradio-demo-for-maximum-performance
code: def attach_flagging_events(
      self, flag_btns: list[Button] | None, clear_btn: ClearButton
  ):
      if not (
          flag_btns
          and self.interface_type
          in (
              InterfaceTypes.STANDARD,
              InterfaceTypes.OUTPUT_ONLY,
              InterfaceTypes.UNIFIED,
          )
      ):
          return
  
      if self.allow_flagging == "auto":
          flag_method = FlagMethod(
              self.flagging_callback, "", "", visual_feedback=False
          )
          flag_btns[
              0
          ].click(  # flag_btns[0] is just the "Submit" button
              flag_method,
              inputs=self.input_components,
              outputs=None,
              preprocess=False,
              queue=False,
              show_api=False,
          )
          return
  
      if self.interface_type == InterfaceTypes.UNIFIED:
          flag_components = self.input_components
      else:
          flag_components = (
              self.input_components + self.output_components
          )
  
      for flag_btn, (label, value) in zip(
          flag_btns, self.flagging_options
      ):
          assert isinstance(value, str)
          flag_method = FlagMethod(self.flagging_callback, label, value)
          flag_btn.click(
              lambda: Button(value="Saving...", interactive=False),
              None,
              flag_btn,
              queue=False,
              show_api=False,
          )
          flag_btn.click(
              flag_method,
              inputs=flag_components,
              outputs=flag_btn,
              preprocess=False,
              queue=False,
              show_api=False,
          )
          clear_btn.click(
              flag_method.reset,
              None,
              flag_btn,
              queue=False,
              show_api=False,
          )
  
imports: from __future__ import annotations
  import inspect
  import json
  import os
  import warnings
  import weakref
  from typing import TYPE_CHECKING, Any, Callable, Literal
  from gradio_client.documentation import document, set_documentation_group
  from gradio import Examples, utils
  from gradio.blocks import Blocks
  from gradio.components import Button, ClearButton, Component, DuplicateButton, Markdown, State, get_component_instance
  from gradio.data_classes import InterfaceTypes
  from gradio.events import Events, on
  from gradio.exceptions import RenderError
  from gradio.flagging import CSVLogger, FlaggingCallback, FlagMethod
  from gradio.layouts import Accordion, Column, Row, Tab, Tabs
  from gradio.pipelines import load_from_pipeline
  from gradio.themes import ThemeClass
label_desc: Use image node_id 11 for calling the Interface obj's underlying member method code with example usage: obj.attach_flagging_events(flag_btns, clear_btn) without return types