code: def test_block_variants_and_samples(spark):
      variant_df = (
          spark.read.format("vcf")
          .load("test-data/combined.chr20_18210071_18210093.g.vcf")
          .withColumn("values", expr("genotype_states(genotypes)"))
      )
      sample_ids = ["HG00096", "HG00268", "NA19625"]
      block_gt, index_map = wgr_functions.block_variants_and_samples(
          variant_df,
          sample_ids,
          variants_per_block=10,
          sample_block_count=2,
      )
      expected_block_gt = glow.transform(
          "block_variants_and_samples",
          variant_df,
          variants_per_block=10,
          sample_block_count=2,
      )
      assert block_gt.collect() == expected_block_gt.collect()
      assert index_map == {
          "1": ["HG00096", "HG00268"],
          "2": ["NA19625"],
      }
  
file_path: glow/python/glow/wgr/tests/test_block_variants_and_samples.py
imports: from glow import glow
  from glow.wgr import wgr_functions
  import pytest
  from pyspark.sql import Row
  from pyspark.sql.functions import expr
  from pyspark.sql.utils import AnalysisException
label_desc: Use image node_id 2 for calling a global function with example usage: test_block_variants_and_samples(spark) without return types