code: def test_ref_block_max_len_patch():
      vds = hl.vds.read_vds(
          os.path.join(resource("vds"), "1kg_chr22_5_samples.vds")
      )
      if "ref_block_max_len" in vds.reference_data.globals:
          vds.reference_data = vds.reference_data.drop(
              "ref_block_max_len"
          )
  
      max_rb_len = vds.reference_data.aggregate_entries(
          hl.agg.max(
              vds.reference_data.END
              - vds.reference_data.locus.position
              + 1
          )
      )
      with hl.TemporaryDirectory() as tmpdir:
          vds_path = os.path.join(tmpdir, "to_patch.vds")
          vds.write(vds_path)
  
          hl.vds.store_ref_block_max_length(vds_path)
  
          vds2 = hl.vds.read_vds(vds_path)
          assert (
              hl.eval(
                  vds2.reference_data.index_globals()[
                      hl.vds.VariantDataset.ref_block_max_length_field
                  ]
              )
              == max_rb_len
          )
  
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 28 for calling a global function with example usage: test_ref_block_max_len_patch() without return types