code: def transform_gvcf(
      mt: MatrixTable,
      reference_entry_fields_to_keep: Collection[str],
      info_to_keep: Optional[Collection[str]] = None,
  ) -> VariantDataset:
      """Transforms a GVCF into a single sample VariantDataSet
  
      The input to this should be some result of :func:`.import_vcf`
      ``array_elements_required=False``.
  
      There is an assumption that this function will be called on a matrix table
      with one column (or a localized table version of the same).
  
      Parameters
      ----------
      mt : :class:`.MatrixTable`
          The GVCF being transformed.
      reference_entry_fields_to_keep : :class:`list` of :class:`str`
          Genotype fields to keep in the reference table. If empty, the first
          10,000 reference block rows of ``mt`` will be sampled and all fields
          found to be defined other than ``GT``, ``AD``, and ``PL`` will be entry
          fields in the resulting reference matrix in the dataset.
      info_to_keep : :class:`list` of :class:`str`
          Any ``INFO`` fields in the GVCF that are to be kept and put in the ``gvcf_info`` entry
          field. By default, all ``INFO`` fields except ``END`` and ``DP`` are kept.
  
      Returns
      -------
      :obj:`.VariantDataset`
          A single sample variant dataset
  
      Notes
      -----
      This function will parse the following allele specific annotations from
      pipe delimited strings into proper values. ::
  
          AS_QUALapprox
          AS_RAW_MQ
          AS_RAW_MQRankSum
          AS_RAW_ReadPosRankSum
          AS_SB_TABLE
          AS_VarDP
  
      """
      ref_mt = make_reference_matrix_table(
          mt, reference_entry_fields_to_keep
      )
      var_mt = make_variants_matrix_table(mt, info_to_keep)
      return VariantDataset(
          ref_mt, var_mt._key_rows_by_assert_sorted("locus", "alleles")
      )
  
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 6 for calling a global function with example usage: transform_gvcf(mt, reference_entry_fields_to_keep, info_to_keep) and returns: VariantDataset