code: def combine_references(mts: List[MatrixTable]) -> MatrixTable:
      fd = hl.vds.VariantDataset.ref_block_max_length_field
      n_with_ref_max_len = len([mt for mt in mts if fd in mt.globals])
      any_ref_max = n_with_ref_max_len > 0
      all_ref_max = n_with_ref_max_len == len(mts)
  
      # if some mts have max ref len but not all, drop it
      if any_ref_max and not all_ref_max:
          mts = [mt.drop(fd) if fd in mt.globals else mt for mt in mts]
  
      mts = [
          mt.drop("ref_allele") if "ref_allele" in mt.row else mt
          for mt in mts
      ]
  
      ts = hl.Table.multi_way_zip_join(
          [localize(mt) for mt in mts], "data", "g"
      )
      combined = combine_r(ts, fd if all_ref_max else None)
      return unlocalize(combined)
  
imports: import math
  from typing import Collection, Optional, Set, Union, List, Tuple, Dict
  import hail
  from hail import MatrixTable, Table
  from hail.experimental.function import Function
  from hail.expr import StructExpression, unify_all, construct_expr
  from hail.expr.expressions import expr_bool, expr_str
  from hail.genetics.reference_genome import reference_genome_type
  from hail.ir import Apply, TableMapRows
  from hail.typecheck import oneof, sequenceof, typecheck
  from ..variant_dataset import VariantDataset
label_desc: Use image node_id 9 for calling a global function with example usage: combine_references(mts) and returns: unlocalize