code: def filter_intervals(
      vds: "VariantDataset",
      intervals,
      *,
      split_reference_blocks: bool = False,
      keep: bool = True,
  ) -> "VariantDataset":
      """Filter intervals in a :class:`.VariantDataset`.
  
      Parameters
      ----------
      vds : :class:`.VariantDataset`
          Dataset in VariantDataset representation.
      intervals : :class:`.Table` or :class:`.ArrayExpression` of type :class:`.tinterval`
          Intervals to filter on.
      split_reference_blocks: :obj:`bool`
          If true, remove reference data outside the given intervals by segmenting reference
          blocks at interval boundaries. Results in a smaller result, but this filter mode
          is more computationally expensive to evaluate.
      keep : :obj:`bool`
          Whether to keep, or filter out (default) rows that fall within any
          interval in `intervals`.
  
      Returns
      -------
      :class:`.VariantDataset`
      """
      if split_reference_blocks and not keep:
          raise ValueError(
              "'filter_intervals': cannot use 'split_reference_blocks' with keep=False"
          )
      return _parameterized_filter_intervals(
          vds,
          intervals,
          keep=keep,
          mode="split_at_boundaries"
          if split_reference_blocks
          else "variants_only",
      )
  
imports: from typing import Sequence
  import hail
  from hail import ir
  from hail.expr import expr_any, expr_array, expr_interval, expr_locus, expr_str, expr_bool
  from hail.matrixtable import MatrixTable
  from hail.methods.misc import require_first_key_field_locus
  from hail.table import Table
  from hail.typecheck import sequenceof, typecheck, nullable, oneof, enumeration, func_spec, dictof
  from hail.utils.java import Env, info, warning
  from hail.utils.misc import divide_null, new_temp_file, wrap_to_list
  from hail.vds.variant_dataset import VariantDataset
label_desc: Use image node_id 11 for calling a global function with example usage: filter_intervals(vds, intervals) and returns: _parameterized_filter_intervals