code: def test_multi_offset(spark, rg):
      num_samples = 25
      num_pheno = 25
      num_geno = 10
      genotype_df = pd.DataFrame(rg.random((num_samples, num_geno)))
      phenotype_df = pd.DataFrame(rg.random((num_samples, num_pheno)))
      covariate_df = pd.DataFrame(rg.random((num_samples, 10)))
      offset_index = pd.MultiIndex.from_product(
          [phenotype_df.index, ["chr1", "chr2"]]
      )
      offset_df = pd.DataFrame(
          rg.random((num_samples * 2, num_pheno)), index=offset_index
      )
      extra_cols = pd.DataFrame({"contigName": ["chr1", "chr2"] * 5})
      results = run_linear_regression_spark(
          spark,
          genotype_df,
          phenotype_df,
          covariate_df,
          offset_df=offset_df,
          extra_cols=extra_cols,
      )
      baseline = statsmodels_baseline(
          genotype_df,
          phenotype_df,
          covariate_df,
          [offset_df.xs("chr1", level=1), offset_df.xs("chr2", level=1)]
          * 5,
      )
      assert regression_results_equal(results, baseline)
  
imports: import functions
  import numpy
  import statsmodels.api
  import pandas
  import glow.gwas.functions
  import glow.gwas.lin_reg
  import pytest
label_desc: Use image node_id 26 for calling a global function with example usage: test_multi_offset(spark, rg) without return types