code: def run_logistic_regression_spark(
      spark,
      genotype_df,
      phenotype_df,
      covariate_df=pd.DataFrame({}),
      extra_cols=pd.DataFrame({}),
      values_column="values",
      **kwargs,
  ):
      pdf = pd.DataFrame(
          {values_column: genotype_df.to_numpy().T.tolist()}
      )
      if not extra_cols.empty:
          pdf = pd.concat([pdf, extra_cols], axis=1)
      pdf["idx"] = pdf.index
      results = (
          lr.logistic_regression(
              spark.createDataFrame(pdf),
              phenotype_df,
              covariate_df,
              correction=lr.correction_none,
              values_column=values_column,
              **kwargs,
          )
          .toPandas()
          .sort_values(["phenotype", "idx"])
          .drop("idx", axis=1)
      )
      return results
  
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 3 for calling a global function with example usage: run_logistic_regression_spark(spark, genotype_df, phenotype_df, covariate_df, extra_cols, values_column) and returns: results