code: def test_subset_contigs(rg):
      num_samples = 25
      num_pheno = 25
      contigs = ["chr1", "chr2", "chr3"]
      phenotype_df = pd.DataFrame(rg.random((num_samples, num_pheno)))
      offset_index = pd.MultiIndex.from_product(
          [phenotype_df.index, contigs]
      )
      offset_df = pd.DataFrame(
          rg.random((num_samples * 3, num_pheno)), index=offset_index
      )
      state = lr._create_YState(
          phenotype_df.to_numpy(),
          phenotype_df,
          offset_df,
          ~np.isnan(phenotype_df.to_numpy()),
          np.float64,
          None,
      )
      assert set(state.keys()) == set(contigs)
      state = lr._create_YState(
          phenotype_df.to_numpy(),
          phenotype_df,
          offset_df,
          ~np.isnan(phenotype_df.to_numpy()),
          np.float64,
          ["chr1", "chr3"],
      )
      assert set(state.keys()) == set(["chr1", "chr3"])
  
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 38 for calling a global function with example usage: test_subset_contigs(rg) without return types