code: def require_col_key_str(dataset: MatrixTable, method: str):
      if (
          not len(dataset.col_key) == 1
          or dataset[next(iter(dataset.col_key))].dtype != hl.tstr
      ):
          raise ValueError(
              f"Method '{method}' requires column key to be one field of type 'str', found "
              f"{list(str(x.dtype) for x in dataset.col_key.values())}"
          )
  
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 2 for calling a global function with example usage: require_col_key_str(dataset, method) without return types