code: def sim_cov_shift(train, test, p_nonmarr=0.75, val=False):
      """Simulate covariate shift by biasing training set toward married"""
      data = pd.concat((train, test))
      data.loc[:, "race"] = data["race"].str.strip()
      data.loc[:, "sex"] = data["sex"].str.strip()
      data.loc[:, "marital-status"] = data["marital-status"].str.strip()
      data.index = pd.Index(range(data.shape[0]))
      data_married = data["marital-status"] == "Married-civ-spouse"
      p_married = (
          0.5 + data_married.mean() - p_nonmarr
      ) / data_married.mean()
      train_p = (
          data_married * p_married + (1 - data_married) * p_nonmarr
      )
      train_ind = np.random.binomial(1, train_p) == 1
      train_cs = data[train_ind]
      test_cs = data[~train_ind]
      if val:
          train_cs, val_cs = train_test_split(train_cs)
          return train_cs, val_cs, test_cs
      else:
          return train_cs, test_cs
  
file_path: autogluon/eda/tests/unittests/test_shift.py
imports: import os
  import tempfile
  import numpy
  import pandas
  from sklearn.model_selection import train_test_split
  import autogluon.eda.analysis
  import autogluon.eda.visualization
label_desc: Use image node_id 2 for calling a global function with example usage: sim_cov_shift(train, test, p_nonmarr, val) and returns: train_cs,  val_cs,  test_cs, train_cs,  test_cs