code: def test_query_narrowing():
      def script():
          import streamlit as st
  
          st.text("1")
          with st.expander("open"):
              st.text("2")
              st.text("3")
          st.text("4")
  
      at = AppTest.from_function(script).run()
      assert len(at.text) == 4
      # querying elements via a block only returns the elements in that block
      assert len(at.get("expandable")[0].text) == 2
  
file_path: streamlit/lib/tests/streamlit/testing/app_test_test.py
imports: import pytest
  from streamlit.testing.v1 import AppTest
label_desc: Use image node_id 10 for calling a global function with example usage: test_query_narrowing() without return types