code: def main():
      args = arg_parse()
  
      # ---- Set up configs ----
      cfg = get_cfg_defaults()
      cfg.merge_from_file(args.cfg)
      cfg.freeze()
      seed.set_seed(cfg.SOLVER.SEED)
  
      # ---- Fetch ABIDE fMRI timeseries ----
      fetch_abide_pcp(
          data_dir=cfg.DATASET.ROOT,
          pipeline=cfg.DATASET.PIPELINE,
          band_pass_filtering=True,
          global_signal_regression=False,
          derivatives=cfg.DATASET.ATLAS,
          quality_checked=False,
          SITE_ID=cfg.DATASET.SITE_IDS,
          verbose=1,
      )
  
      # ---- Read Phenotypic data ----
      pheno_file = os.path.join(
          cfg.DATASET.ROOT,
          "ABIDE_pcp/Phenotypic_V1_0b_preprocessed1.csv",
      )
      pheno_info = pd.read_csv(pheno_file, index_col=0)
  
      # ---- Read timeseries from files ----
      data_dir = os.path.join(
          cfg.DATASET.ROOT,
          "ABIDE_pcp/%s/filt_noglobal" % cfg.DATASET.PIPELINE,
      )
      use_idx = []
      time_series = []
      for i in pheno_info.index:
          data_file_name = "%s_%s.1D" % (
              pheno_info.loc[i, "FILE_ID"],
              cfg.DATASET.ATLAS,
          )
          data_path = os.path.join(data_dir, data_file_name)
          if os.path.exists(data_path):
              time_series.append(np.loadtxt(data_path, skiprows=0))
              use_idx.append(i)
  
      # ---- Use "DX_GROUP" (autism vs control) as labels, and "SITE_ID" as covariates ----
      pheno = pheno_info.loc[
          use_idx, ["SITE_ID", "DX_GROUP"]
      ].reset_index(drop=True)
  
      # ---- Extracting Brain Networks Features ----
      correlation_measure = ConnectivityMeasure(
          kind="correlation", vectorize=True
      )
      brain_networks = correlation_measure.fit_transform(time_series)
  
      # ---- Machine Learning for Multi-site Data ----
      print("Baseline")
      estimator = RidgeClassifier()
      results = cross_validation.leave_one_group_out(
          brain_networks,
          pheno["DX_GROUP"].values,
          pheno["SITE_ID"].values,
          estimator,
      )
      print(pd.DataFrame.from_dict(results))
  
      print("Domain Adaptation")
      estimator = CoIRLS(
          kernel=cfg.MODEL.KERNEL,
          lambda_=cfg.MODEL.LAMBDA_,
          alpha=cfg.MODEL.ALPHA,
      )
      results = cross_validation.leave_one_group_out(
          brain_networks,
          pheno["DX_GROUP"].values,
          pheno["SITE_ID"].values,
          estimator,
          use_domain_adaptation=True,
      )
      print(pd.DataFrame.from_dict(results))
  
file_path: pykale/examples/multisite_neuroimg_adapt/main.py
imports: import argparse
  import os
  import numpy
  import pandas
  from config import get_cfg_defaults
  from nilearn.connectome import ConnectivityMeasure
  from nilearn.datasets import fetch_abide_pcp
  from sklearn.linear_model import RidgeClassifier
  import kale.utils.seed
  from kale.evaluate import cross_validation
  from kale.pipeline.multi_domain_adapter import CoIRLS
label_desc: Use image node_id 2 for calling a global function with example usage: main() without return types