code: def read_vds(
      path,
      *,
      intervals=None,
      n_partitions=None,
      _assert_reference_type=None,
      _assert_variant_type=None,
      _warn_no_ref_block_max_length=True,
  ) -> "VariantDataset":
      """Read in a :class:`.VariantDataset` written with :meth:`.VariantDataset.write`.
  
      Parameters
      ----------
      path: :obj:`str`
  
      Returns
      -------
      :class:`.VariantDataset`
      """
      if intervals or not n_partitions:
          reference_data = hl.read_matrix_table(
              VariantDataset._reference_path(path), _intervals=intervals
          )
          variant_data = hl.read_matrix_table(
              VariantDataset._variants_path(path), _intervals=intervals
          )
      else:
          assert n_partitions is not None
          reference_data = hl.read_matrix_table(
              VariantDataset._reference_path(path)
          )
          intervals = reference_data._calculate_new_partitions(
              n_partitions
          )
          assert len(intervals) > 0
          reference_data = hl.read_matrix_table(
              VariantDataset._reference_path(path), _intervals=intervals
          )
          variant_data = hl.read_matrix_table(
              VariantDataset._variants_path(path), _intervals=intervals
          )
  
      vds = VariantDataset(reference_data, variant_data)
      if (
          VariantDataset.ref_block_max_length_field
          not in vds.reference_data.globals
      ):
          fs = hl.current_backend().fs
          metadata_file = os.path.join(path, extra_ref_globals_file)
          if fs.exists(metadata_file):
              with fs.open(metadata_file, "r") as f:
                  metadata = json.load(f)
                  vds.reference_data = (
                      vds.reference_data.annotate_globals(**metadata)
                  )
          elif _warn_no_ref_block_max_length:
              warning(
                  "You are reading a VDS written with an older version of Hail."
                  "\n  Hail now supports much faster interval filters on VDS, but you'll need to run either"
                  "\n  `hl.vds.truncate_reference_blocks(vds, ...)` and write a copy (see docs) or patch the"
                  "\n  existing VDS in place with `hl.vds.store_ref_block_max_length(vds_path)`."
              )
  
      return vds
  
imports: import os
  import hail
  from hail.matrixtable import MatrixTable
  from hail.typecheck import typecheck_method
  from hail.utils.java import info, warning
  from hail.genetics import ReferenceGenome
  import json
label_desc: Use image node_id 1 for calling a global function with example usage: read_vds(path) and returns: vds