code: def get_summary_str(
      results,
      true_params,
      get_l1_slsqp_results,
      get_l1_cvxopt_results,
      print_summaries,
  ):
      """
      Gets a string summarizing the results.
      """
      #### Extract specific results
      results_ML = results["results_ML"]
      RMSE_ML = get_RMSE(results_ML, true_params)
      if get_l1_slsqp_results:
          results_l1_slsqp = results["results_l1_slsqp"]
      if get_l1_cvxopt_results:
          results_l1_cvxopt_cp = results["results_l1_cvxopt_cp"]
  
      #### Format summaries
      # Short summary
      print_str = "\n\n=========== Short Error Summary ============"
      print_str += (
          "\n\n The maximum likelihood fit RMS error = %.4f" % RMSE_ML
      )
      if get_l1_slsqp_results:
          RMSE_l1_slsqp = get_RMSE(results_l1_slsqp, true_params)
          print_str += (
              "\n The l1_slsqp fit RMS error = %.4f" % RMSE_l1_slsqp
          )
      if get_l1_cvxopt_results:
          RMSE_l1_cvxopt_cp = get_RMSE(
              results_l1_cvxopt_cp, true_params
          )
          print_str += (
              "\n The l1_cvxopt_cp fit RMS error = %.4f"
              % RMSE_l1_cvxopt_cp
          )
      # Parameters
      print_str += "\n\n\n============== Parameters ================="
      print_str += "\n\nTrue parameters: \n%s" % true_params
      # Full summary
      if print_summaries:
          print_str += "\n" + results_ML.summary().as_text()
          if get_l1_slsqp_results:
              print_str += "\n" + results_l1_slsqp.summary().as_text()
          if get_l1_cvxopt_results:
              print_str += (
                  "\n" + results_l1_cvxopt_cp.summary().as_text()
              )
      else:
          print_str += (
              "\n\nThe maximum likelihood params are \n%s"
              % results_ML.params
          )
          if get_l1_slsqp_results:
              print_str += (
                  "\n\nThe l1_slsqp params are \n%s"
                  % results_l1_slsqp.params
              )
          if get_l1_cvxopt_results:
              print_str += (
                  "\n\nThe l1_cvxopt_cp params are \n%s"
                  % results_l1_cvxopt_cp.params
              )
      # Return
      return print_str
  
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 4 for calling a global function with example usage: get_summary_str(results, true_params, get_l1_slsqp_results, get_l1_cvxopt_results, print_summaries) and returns: print_str