class_docstr: Class to implement adaptive stepsize.
  
  This class wraps the step taking class and modifies the stepsize to
  ensure the true acceptance rate is as close as possible to the target.
  
  Parameters
  ----------
  takestep : callable
      The step taking routine.  Must contain modifiable attribute
      takestep.stepsize
  accept_rate : float, optional
      The target step acceptance rate
  interval : int, optional
      Interval for how often to update the stepsize
  factor : float, optional
      The step size is multiplied or divided by this factor upon each
      update.
  verbose : bool, optional
      Print information about each update
code: def _adjust_step_size(self):
      old_stepsize = self.takestep.stepsize
      accept_rate = float(self.naccept) / self.nstep
      if accept_rate > self.target_accept_rate:
          # We're accepting too many steps.  This generally means we're
          # trapped in a basin.  Take bigger steps
          self.takestep.stepsize /= self.factor
      else:
          # We're not accepting enough steps.  Take smaller steps
          self.takestep.stepsize *= self.factor
      if self.verbose:
          print(
              "adaptive stepsize: acceptance rate %f target %f new "
              "stepsize %g old stepsize %g"
              % (
                  accept_rate,
                  self.target_accept_rate,
                  self.takestep.stepsize,
                  old_stepsize,
              )
          )
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  import math
  from numpy import cos, sin
  import scipy.optimize
  from scipy._lib._util import check_random_state
label_desc: Use image node_id 3 for calling the AdaptiveStepsize obj's underlying member method code with example usage: obj._adjust_step_size() without return types