code: def main():
      """
      Provides a CLI for the demo.
      """
      usage = "usage: %prog [options] mode"
      usage += "\n" + docstr
      parser = OptionParser(usage=usage)
      # base_alpha
      parser.add_option(
          "-a",
          "--base_alpha",
          help="Size of regularization param (the param actully used will "
          "automatically scale with data size in this demo) "
          "[default: %default]",
          dest="base_alpha",
          action="store",
          type="float",
          default=0.01,
      )
      # num_samples
      parser.add_option(
          "-N",
          "--num_samples",
          help="Number of data points to generate for fit "
          "[default: %default]",
          dest="N",
          action="store",
          type="int",
          default=500,
      )
      # get_l1_slsqp_results
      parser.add_option(
          "--get_l1_slsqp_results",
          help="Do an l1 fit using slsqp. [default: %default]",
          action="store_true",
          dest="get_l1_slsqp_results",
          default=False,
      )
      # get_l1_cvxopt_results
      parser.add_option(
          "--get_l1_cvxopt_results",
          help="Do an l1 fit using cvxopt. [default: %default]",
          action="store_true",
          dest="get_l1_cvxopt_results",
          default=False,
      )
      # num_nonconst_covariates
      parser.add_option(
          "--num_nonconst_covariates",
          help="Number of covariates that are not constant "
          "(a constant will be prepended) [default: %default]",
          dest="num_nonconst_covariates",
          action="store",
          type="int",
          default=10,
      )
      # noise_level
      parser.add_option(
          "--noise_level",
          help="Level of the noise relative to signal [default: %default]",
          dest="noise_level",
          action="store",
          type="float",
          default=0.2,
      )
      # cor_length
      parser.add_option(
          "--cor_length",
          help="Correlation length of the (Gaussian) independent variables"
          "[default: %default]",
          dest="cor_length",
          action="store",
          type="float",
          default=2,
      )
      # num_zero_params
      parser.add_option(
          "--num_zero_params",
          help="Number of parameters equal to zero for every target in "
          "logistic regression examples.  [default: %default]",
          dest="num_zero_params",
          action="store",
          type="int",
          default=8,
      )
      # num_targets
      parser.add_option(
          "-J",
          "--num_targets",
          help="Number of choices for the endogenous response in "
          "multinomial logit example [default: %default]",
          dest="num_targets",
          action="store",
          type="int",
          default=3,
      )
      # print_summaries
      parser.add_option(
          "-s",
          "--print_summaries",
          help="Print the full fit summary. [default: %default]",
          action="store_true",
          dest="print_summaries",
          default=False,
      )
      # save_arrays
      parser.add_option(
          "--save_arrays",
          help="Save exog/endog/true_params to disk for future use. "
          "[default: %default]",
          action="store_true",
          dest="save_arrays",
          default=False,
      )
      # load_old_arrays
      parser.add_option(
          "--load_old_arrays",
          help="Load exog/endog/true_params arrays from disk.  "
          "[default: %default]",
          action="store_true",
          dest="load_old_arrays",
          default=False,
      )
  
      (options, args) = parser.parse_args()
  
      assert len(args) == 1
      mode = args[0].lower()
  
      run_demo(mode, **options.__dict__)
  
file_path: statsmodels/statsmodels/examples/l1_demo/demo.py
imports: from optparse import OptionParser
  import statsmodels.api
  import scipy
  from scipy import linalg
  from scipy import stats
label_desc: Use image node_id 1 for calling a global function with example usage: main() without return types