code: def test_flag_method_init_called(self, allow_flagging, called):
      flagging.FlagMethod.__init__ = MagicMock()
      flagging.FlagMethod.__init__.return_value = None
      gr.Interface(
          lambda x: x, "text", "text", allow_flagging=allow_flagging
      )
      assert flagging.FlagMethod.__init__.called == called
  
imports: import os
  import tempfile
  from unittest.mock import MagicMock, patch
  import pytest
  import gradio
  from gradio import flagging
label_desc: Use image node_id 1 for calling the TestInterfaceSetsUpFlagging obj's underlying member method code with example usage: obj.test_flag_method_init_called(allow_flagging, called) without return types