code: def main(args=None):
      r"""AlphaPy Main Program
  
      Notes
      -----
      (1) Initialize logging.
      (2) Parse the command line arguments.
      (3) Get the model configuration.
      (4) Create the model object.
      (5) Call the main AlphaPy pipeline.
  
      """
  
      # Logging
  
      logging.basicConfig(
          format="[%(asctime)s] %(levelname)s\t%(message)s",
          filename="alphapy.log",
          filemode="a",
          level=logging.INFO,
          datefmt="%m/%d/%y %H:%M:%S",
      )
      formatter = logging.Formatter(
          "[%(asctime)s] %(levelname)s\t%(message)s",
          datefmt="%m/%d/%y %H:%M:%S",
      )
      console = logging.StreamHandler()
      console.setFormatter(formatter)
      console.setLevel(logging.INFO)
      logging.getLogger().addHandler(console)
  
      # Start the pipeline
  
      logger.info("*" * 80)
      logger.info("AlphaPy Start")
      logger.info("*" * 80)
  
      # Argument Parsing
  
      parser = argparse.ArgumentParser(description="AlphaPy Parser")
      parser.add_mutually_exclusive_group(required=False)
      parser.add_argument(
          "--predict", dest="predict_mode", action="store_true"
      )
      parser.add_argument(
          "--train", dest="predict_mode", action="store_false"
      )
      parser.set_defaults(predict_mode=False)
      args = parser.parse_args()
  
      # Read configuration file
  
      specs = get_model_config()
      specs["predict_mode"] = args.predict_mode
  
      # Create directories if necessary
  
      output_dirs = [
          "config",
          "data",
          "input",
          "model",
          "output",
          "plots",
      ]
      for od in output_dirs:
          output_dir = SSEP.join([specs["directory"], od])
          if not os.path.exists(output_dir):
              logger.info("Creating directory %s", output_dir)
              os.makedirs(output_dir)
  
      # Create a model from the arguments
  
      logger.info("Creating Model")
      model = Model(specs)
  
      # Start the pipeline
  
      logger.info("Calling Pipeline")
      model = main_pipeline(model)
  
      # Complete the pipeline
  
      logger.info("*" * 80)
      logger.info("AlphaPy End")
      logger.info("*" * 80)
  
imports: import warnings
  from alphapy.data import get_data
  from alphapy.data import sample_data
  from alphapy.data import shuffle_data
  from alphapy.estimators import get_estimators
  from alphapy.estimators import scorers
  from alphapy.features import apply_transforms
  from alphapy.features import create_crosstabs
  from alphapy.features import create_features
  from alphapy.features import create_interactions
  from alphapy.features import drop_features
  from alphapy.features import remove_lv_features
  from alphapy.features import save_features
  from alphapy.features import select_features
  from alphapy.frame import write_frame
  from alphapy.globals import CSEP, PSEP, SSEP, USEP
  from alphapy.globals import ModelType
  from alphapy.globals import Partition, datasets
  from alphapy.globals import WILDCARD
  from alphapy.model import first_fit
  from alphapy.model import generate_metrics
  from alphapy.model import get_model_config
  from alphapy.model import load_feature_map
  from alphapy.model import load_predictor
  from alphapy.model import make_predictions
  from alphapy.model import Model
  from alphapy.model import predict_best
  from alphapy.model import predict_blend
  from alphapy.model import save_model
  from alphapy.model import save_predictions
  from alphapy.optimize import hyper_grid_search
  from alphapy.optimize import rfecv_search
  from alphapy.plots import generate_plots
  from alphapy.utilities import get_datestamp
  import argparse
  from datetime import datetime
  import logging
  import numpy
  import os
  import pandas
  from sklearn.model_selection import train_test_split
  import sys
label_desc: Use image node_id 4 for calling a global function with example usage: main(args) without return types