code: def test_multi_offset_with_missing(spark, rg):
      num_samples = 25
      num_pheno = 24
      num_geno = 18
      contigs = ["chr1", "chr2", "chr3"]
      genotype_df = pd.DataFrame(rg.random((num_samples, num_geno)))
      phenotype_df = pd.DataFrame(
          random_phenotypes((num_samples, num_pheno), rg)
      )
      phenotype_df.iloc[0, 0] = np.nan
      phenotype_df.iloc[1, 0] = np.nan
      covariate_df = pd.DataFrame(rg.random((num_samples, 2)))
      offset_index = pd.MultiIndex.from_product(
          [phenotype_df.index, contigs]
      )
      offset_df = pd.DataFrame(
          rg.random((num_samples * len(contigs), num_pheno)),
          index=offset_index,
      )
      extra_cols = pd.DataFrame({"contigName": contigs * 6})
      results = run_logistic_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(contig, level=1) for contig in contigs] * 6,
      )
      assert regression_results_equal(results, baseline)
  
imports: from pyspark.sql.types import ArrayType, DoubleType
  import glow.gwas.log_reg
  import glow.gwas.functions
  import statsmodels.api
  import pandas
  import numpy
  import pytest
label_desc: Use image node_id 22 for calling a global function with example usage: test_multi_offset_with_missing(spark, rg) without return types