code: def helper_fun(datasetname, alg_type, params_exp):
      """helper function for running different algorithms
  
      args:
          datasetname = dataset
          alg_type = type of the optimization algorithm
          params_exp = hyperparameters
      """
      feature_vecs, labels, w_opt = getattr(Mydatasets(), datasetname)()
      privacy_dp = params_exp["total"]
      params_exp["total"] = eps_to_zcdp(
          privacy_dp, (1.0 / len(labels)) ** 2
      )
      log_reg = MyLogisticRegression(feature_vecs, labels)
      alg_dict, filename_params = prepare_alg_dict(
          alg_type, datasetname, privacy_dp, params_exp, log_reg
      )
      compare_algs = CompareAlgs(log_reg, w_opt, params_exp)
      result = RunReleaseStats(compare_algs, alg_dict).summarize_stats()
      result["num-samples"] = len(labels)
      with open(
          "src/results/" + filename_params, "w", encoding="utf8"
      ) as json_file:
          json.dump(result, json_file)
  
file_path: privacy/research/dp_newton/src/run.py
imports: import argparse
  import json
  from dataset_loader import Mydatasets
  from my_logistic_regression import MyLogisticRegression
  import numpy
  from opt_algs import CompareAlgs, DoubleNoiseMech, gd_priv, private_newton
  from scipy.optimize import fsolve
label_desc: Use image node_id 3 for calling a global function with example usage: helper_fun(datasetname, alg_type, params_exp) without return types