class_docstr: Class for benchmarking nonlinear least squares solvers.
class_docstr_tok: ["Class","for","benchmarking","nonlinear","least","squares","solvers","."]
code: def track_all(self, problem_name, result_type):
      problem = self.problems[problem_name]
  
      if problem.lb is not None or problem.ub is not None:
          raise NotImplementedError
  
      ftol = 1e-5
  
      if result_type == "average time":
          n_runs = 10
          t0 = time.time()
          for _ in range(n_runs):
              leastsq(
                  problem.fun,
                  problem.x0,
                  Dfun=problem.jac,
                  ftol=ftol,
                  full_output=True,
              )
          return (time.time() - t0) / n_runs
  
      x, cov_x, info, message, ier = leastsq(
          problem.fun,
          problem.x0,
          Dfun=problem.jac,
          ftol=ftol,
          full_output=True,
      )
      if result_type == "nfev":
          return info["nfev"]
      elif result_type == "success":
          return int(problem.check_answer(x, ftol))
      else:
          raise NotImplementedError
  
imports: import os
  import time
  import inspect
  import json
  import traceback
  from collections import defaultdict
  import numpy
  from .None import test_functions
  from .None import go_benchmark_functions
  from .common import Benchmark, is_xslow, safe_import
  from .lsq_problems import extract_lsq_problems
label_desc: Use image node_id 1 for calling the BenchLeastSquares obj's underlying member method code with example usage: obj.track_all(problem_name, result_type) and returns: unknown, info, int