code: def test_pgenchisq():
      ht = hl.import_table(
          resource("davies-genchisq-tests.tsv"),
          types={
              "c": hl.tfloat64,
              "weights": hl.tarray(hl.tfloat64),
              "k": hl.tarray(hl.tint32),
              "lam": hl.tarray(hl.tfloat64),
              "sigma": hl.tfloat64,
              "lim": hl.tint32,
              "acc": hl.tfloat64,
              "expected": hl.tfloat64,
              "expected_n_iterations": hl.tint32,
          },
      )
      ht = ht.add_index("line_number")
      ht = ht.annotate(line_number=ht.line_number + 1)
      ht = ht.annotate(
          genchisq_result=hl.pgenchisq(
              ht.c,
              ht.weights,
              ht.k,
              ht.lam,
              0.0,
              ht.sigma,
              max_iterations=ht.lim,
              min_accuracy=ht.acc,
          )
      )
      tests = ht.collect()
      for test in tests:
          assert (
              abs(test.genchisq_result.value - test.expected)
              < 0.0000005
          ), str(test)
          assert test.genchisq_result.fault == 0, str(test)
          assert test.genchisq_result.converged == True, str(test)
          assert (
              test.genchisq_result.n_iterations
              == test.expected_n_iterations
          ), str(test)
  
file_path: hail/hail/python/test/hail/expr/test_functions.py
imports: import hail
  import scipy.stats
  import pytest
  from ..helpers import resource
label_desc: Use image node_id 5 for calling a global function with example usage: test_pgenchisq() without return types