code: def test_qval(
      left: str, right: str, alg: str, qval: int | None
  ) -> None:
      for lib in libraries.get_libs(alg):
          if lib.module_name == "jellyfish":
              ascii = set(string.printable)
              if (set(left) | set(right)) - ascii:
                  continue
  
          conditions = lib.conditions or {}
          internal_func = getattr(textdistance, alg)(
              external=False, **conditions
          )
          external_func = lib.get_function()
          if external_func is None:
              raise RuntimeError("cannot import {}".format(str(lib)))
          # algorithm doesn't support q-grams
          if not hasattr(internal_func, "qval"):
              continue
  
          internal_func.qval = qval
          # if qval unsopporting already set for lib
          s1, s2 = internal_func._get_sequences(left, right)
          if not lib.check_conditions(internal_func, s1, s2):
              continue
          quick_answer = internal_func.quick_answer(s1, s2)
          if quick_answer is not None:
              continue
  
          # test
          int_result = internal_func(left, right)
          s1, s2 = lib.prepare(s1, s2)
          ext_result = external_func(s1, s2)
          assert isclose(
              int_result, ext_result
          ), f"{lib}({repr(s1)}, {repr(s2)})"
  
file_path: textdistance/tests/test_external.py
imports: from __future__ import annotations
  import string
  from math import isclose
  import hypothesis
  import hypothesis.strategies
  import pytest
  import textdistance
  from textdistance.libraries import prototype
label_desc: Use image node_id 2 for calling a global function with example usage: test_qval(left, right, alg, qval) without return types