code: def require_table_key_variant(ht, method):
      if (
          list(ht.key) != ["locus", "alleles"]
          or not isinstance(ht["locus"].dtype, tlocus)
          or not ht["alleles"].dtype == tarray(tstr)
      ):
          raise ValueError(
              "Method '{}' requires key to be two fields 'locus' (type 'locus<any>') and "
              "'alleles' (type 'array<str>')\n"
              "  Found:{}".format(
                  method,
                  "".join(
                      "\n    '{}': {}".format(k, str(ht[k].dtype))
                      for k in ht.key
                  ),
              )
          )
  
imports: from typing import Union
  import hail
  from hail.expr import Expression, expr_numeric, expr_array, expr_interval, expr_any, construct_expr, construct_variable
  from hail.expr.types import tlocus, tarray, tstr, tstruct, ttuple
  from hail.matrixtable import MatrixTable
  from hail.table import Table
  from hail.typecheck import typecheck, nullable, func_spec, oneof
  from hail.utils import Interval, Struct, new_temp_file, deduplicate
  from hail.utils.misc import plural
  from hail.utils.java import Env, info
  from hail import ir
label_desc: Use image node_id 3 for calling a global function with example usage: require_table_key_variant(ht, method) without return types