class_docstr: Metropolis acceptance criterion
  
  Parameters
  ----------
  T : float
      The "temperature" parameter for the accept or reject criterion.
  random_state : None or `np.random.RandomState` object
      Random number generator used for acceptance test
docstr: If new energy is lower than old, it will always be accepted.
  If new is higher than old, there is a chance it will be accepted,
  less likely for larger differences.
docstr_tok: ["If","new","energy","is","lower","than","old",",","it","will","always","be","accepted",".","If","new","is","higher","than","old",",","there","is","a","chance","it","will","be","accepted",",","less","likely","for","larger","differences","."]
code: def accept_reject(self, energy_new, energy_old):
      """
      If new energy is lower than old, it will always be accepted.
      If new is higher than old, there is a chance it will be accepted,
      less likely for larger differences.
      """
      w = math.exp(min(0, -float(energy_new - energy_old) * self.beta))
      rand = self.random_state.rand()
      return w >= rand
  
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 2 for calling the Metropolis obj's underlying member method code with example usage: obj.accept_reject(energy_new, energy_old) and returns: unknown