code: def check_errors(dash_duo, specs):
      # Order-agnostic check of all the errors shown.
      # This is not fully general - despite the selectors below, it only applies
      # to front-end errors with no back-end errors in the list.
      cnt = len(specs)
      dash_duo.wait_for_text_to_equal(
          dash_duo.devtools_error_count_locator, str(cnt)
      )
  
      found = []
      for i in range(cnt):
          msg = dash_duo.find_elements(".dash-fe-error__title")[i].text
          dash_duo.find_elements(".test-devtools-error-toggle")[
              i
          ].click()
          dash_duo.wait_for_element(
              ".dash-backend-error,.dash-fe-error__info"
          )
          has_BE = dash_duo.driver.execute_script(
              "return document.querySelectorAll('.dash-backend-error').length"
          )
          txt_selector = (
              ".dash-backend-error"
              if has_BE
              else ".dash-fe-error__info"
          )
          txt = dash_duo.wait_for_element(txt_selector).text
          dash_duo.find_elements(".test-devtools-error-toggle")[
              i
          ].click()
          dash_duo.wait_for_no_elements(".dash-backend-error")
          found.append((msg, txt))
  
      orig_found = found[:]
  
      for i, (message, snippets) in enumerate(specs):
          for j, (msg, txt) in enumerate(found):
              if msg == message and all(
                  snip in txt for snip in snippets
              ):
                  print(j)
                  found.pop(j)
                  break
          else:
              raise AssertionError(
                  (
                      "error {} ({}) not found with text:\n"
                      "  {}\nThe found messages were:\n---\n{}"
                  ).format(
                      i,
                      message,
                      "\n  ".join(snippets),
                      "\n---\n".join(
                          "{}\n{}".format(msg, txt)
                          for msg, txt in orig_found
                      ),
                  )
              )
  
      # ensure the errors didn't leave items in the pendingCallbacks queue
      assert (
          dash_duo.driver.execute_script("return document.title")
          == "Dash"
      )
  
imports: import flask
  import pytest
  from dash import Dash, Input, Output, State, MATCH, ALL, ALLSMALLER, html, dcc
  from dash.testing import wait
label_desc: Use image node_id 1 for calling a global function with example usage: check_errors(dash_duo, specs) without return types