code: def __init__(
      self,
      maxeval=5000,
      progressbar=True,
      logp_func=None,
      dlogp_func=None,
  ):
      self.n_eval = 0
      self.maxeval = maxeval
      self.logp_func = logp_func
      if dlogp_func is None:
          self.use_gradient = False
          self.desc = "logp = {:,.5g}"
      else:
          self.dlogp_func = dlogp_func
          self.use_gradient = True
          self.desc = "logp = {:,.5g}, ||grad|| = {:,.5g}"
      self.previous_x = None
      self.progressbar = progressbar
      if progressbar:
          self.progress = progress_bar(
              range(maxeval), total=maxeval, display=progressbar
          )
          self.progress.update(0)
      else:
          self.progress = range(maxeval)
  
imports: import sys
  import warnings
  from typing import Optional, Sequence
  import numpy
  import pytensor.gradient
  from fastprogress.fastprogress import ProgressBar, progress_bar
  from numpy import isfinite
  from pytensor import Variable
  from scipy.optimize import minimize
  import pymc
  from pymc.blocking import DictToArrayBijection, RaveledVars
  from pymc.initial_point import make_initial_point_fn
  from pymc.model import modelcontext
  from pymc.util import get_default_varnames, get_value_vars_from_user_vars
  from pymc.vartypes import discrete_types, typefilter
label_desc: Use image node_id 1 to create a new CostFuncWrapper object  with example: obj = CostFuncWrapper(maxeval, progressbar, logp_func, dlogp_func)