code: def test_truncate_reference_blocks():
      vds = hl.vds.read_vds(
          os.path.join(resource("vds"), "1kg_chr22_5_samples.vds")
      )
      rd = vds.reference_data.select_globals()
      rd = rd.filter_entries(rd.GQ > 0)
      vds.reference_data = rd
  
      sampqc_1 = hl.vds.sample_qc(
          vds, gq_bins=(0, 10, 20, 30), dp_bins=()
      ).select("bases_over_gq_threshold")
  
      max_bases = 20
      vds_trunc = hl.vds.truncate_reference_blocks(
          vds, max_ref_block_base_pairs=max_bases
      )
      sampqc_2 = hl.vds.sample_qc(
          vds_trunc, gq_bins=(0, 10, 20, 30), dp_bins=()
      ).select("bases_over_gq_threshold")
  
      rd2 = vds_trunc.reference_data
  
      assert rd2.aggregate_entries(
          hl.agg.all(rd2.END - rd2.locus.position + 1 <= max_bases)
      ), "long ref blocks remain"
      assert sampqc_1._same(sampqc_2), "gq bins aren't the same"
      assert hl.vds.to_dense_mt(vds)._same(
          hl.vds.to_dense_mt(vds_trunc)
      )
  
imports: import os
  import pytest
  import hail
  from hail.utils import new_temp_file
  from hail.vds.combiner.combine import defined_entry_fields
  from ..helpers import resource, test_timeout, qobtest
label_desc: Use image node_id 23 for calling a global function with example usage: test_truncate_reference_blocks() without return types