def metrop_select(mr, q, q0):
 if (np.isfinite(mr) and (np.log(uniform()) < mr)):
  return q
 else:
  return q0

def metrop_select ( mr , q , q0 ) : if ( np . isfinite ( mr ) and ( np . log ( uniform ( ) ) < mr ) ) : return q else : return q0
perform rejection/acceptance step for metropolis class samplers .