code: def test_missing_and_intersect_samples_spark(spark, rg):
      n_sample = 50
      n_cov = 5
      n_pheno = 5
      genotype_df = pd.DataFrame(rg.random((n_sample, 1)))
      # here we're simulating dropping a sample from phenotypes and covariates
      phenotype_df = pd.DataFrame(
          random_phenotypes((n_sample, n_pheno), rg)
      )[1:]
      phenotype_df.loc[[1, 3, 5], 1] = np.nan
      covariate_df = pd.DataFrame(rg.random((n_sample, n_cov)))[1:]
      glow = run_logistic_regression_spark(
          spark,
          genotype_df,
          phenotype_df,
          covariate_df,
          intersect_samples=True,
          genotype_sample_ids=genotype_df.index.values.astype(
              str
          ).tolist(),
      )
      # drop sample from genotypes so that input samples are aligned
      baseline = statsmodels_baseline(
          genotype_df[1:], phenotype_df, covariate_df
      )
      assert regression_results_equal(glow, 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 15 for calling a global function with example usage: test_missing_and_intersect_samples_spark(spark, rg) without return types