code: def check_response(
      response,
      response_len=1,
      semgrex_len=1,
      source_index=1,
      target_index=3,
      reln="obj",
  ):
      assert len(response.result) == response_len
      assert len(response.result[0].result) == semgrex_len
      for semgrex_result in response.result[0].result:
          assert len(semgrex_result.match) == 1
          assert semgrex_result.match[0].matchIndex == source_index
          for match in semgrex_result.match:
              assert len(match.node) == 2
              assert match.node[0].name == "source"
              assert match.node[0].matchIndex == source_index
              assert match.node[1].name == "target"
              assert match.node[1].matchIndex == target_index
              assert len(match.reln) == 1
              assert match.reln[0].name == "zzz"
              assert match.reln[0].reln == reln
  
file_path: stanza/stanza/tests/server/test_semgrex.py
imports: import pytest
  import stanza
  import stanza.server.semgrex
  from stanza.protobuf import SemgrexRequest
  from stanza.models.common.doc import Document
  from stanza.tests import *
label_desc: Use image node_id 1 for calling a global function with example usage: check_response(response, response_len, semgrex_len, source_index, target_index, reln) without return types