code: def patch_varname_getter():
      """
      Patches streamlit.elements.doc_string so _get_variable_name()
      works outside ScriptRunner.
      """
      import inspect
  
      parent_frame_filename = inspect.getouterframes(
          inspect.currentframe()
      )[2].filename
  
      return mock.patch(
          "streamlit.elements.doc_string.SCRIPTRUNNER_FILENAME",
          parent_frame_filename,
      )
  
file_path: streamlit/lib/tests/streamlit/elements/doc_string_test.py
imports: import os
  from unittest import mock
  import streamlit
  from tests.delta_generator_test_case import DeltaGeneratorTestCase
label_desc: Use image node_id 1 for calling a global function with example usage: patch_varname_getter() and returns: mock