code: def test_skat_negative_weights_errors(skat_model):
      skat_name, skat = skat_model
      genotypes = [
          [2, 1, 1, 1, 0, 1, 1, 2, 1, 1, 2, 1, 0, 0, 1],
          [1, 0, 1, 1, 1, 2, 0, 2, 1, 1, 0, 1, 1, 0, 0],
          [0, 2, 0, 0, 2, 1, 1, 2, 2, 1, 1, 1, 0, 1, 1],
          [1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 0],
      ]
      covariates = [
          [1],
          [1],
          [0],
          [0],
          [0],
          [0],
          [0],
          [0],
          [0],
          [0],
          [0],
          [0],
          [1],
          [1],
          [0],
      ]
      phenotypes = [0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0]
      weights = [-1, 0, 1, -1]
  
      mt = hl.utils.range_matrix_table(4, 15)
      mt = mt.annotate_entries(
          GT=hl.unphased_diploid_gt_index_call(
              hl.literal(genotypes)[mt.row_idx][mt.col_idx]
          )
      )
      mt = mt.annotate_cols(
          phenotype=hl.literal(phenotypes)[mt.col_idx],
          cov1=hl.literal(covariates)[mt.col_idx][0],
      )
      mt = mt.annotate_rows(weight=hl.literal(weights)[mt.row_idx])
      mt = mt.annotate_globals(group=0)
      ht = skat(
          mt.group,
          mt.weight,
          mt.phenotype,
          mt.GT.n_alt_alleles(),
          [1.0, mt.cov1],
      )
      try:
          ht.collect()
      except Exception as exc:
          assert (
              skat_name
              + ": every weight must be positive, in group 0, the weights were: [-1.0,0.0,1.0,-1.0]"
              in exc.args[0]
          )
      else:
          assert False
  
imports: import hail
  import pytest
  from hail.utils import FatalError, HailUserError
  from ..helpers import resource, test_timeout, qobtest
label_desc: Use image node_id 1 for calling a global function with example usage: test_skat_negative_weights_errors(skat_model) without return types