def stop_tuning(step):
 if hasattr(step, 'tune'):
  step.tune = False
 elif hasattr(step, 'methods'):
  step.methods = [stop_tuning(s) for s in step.methods]
 return step

def stop_tuning ( step ) : if hasattr ( step , 'tune' ) : step . tune = False elif hasattr ( step , 'methods' ) : step . methods = [ stop_tuning ( s ) for s in step . methods ] return step
stop tuning the current step method .