code: def __init__(self, threshold: int):
      self.threshold = threshold
      self._consequtive_pruned_count = 0
  
imports: import optuna
  import logging
  import sys
label_desc: Use image node_id 1 to create a new StopWhenTrialKeepBeingPrunedCallback object  with example: obj = StopWhenTrialKeepBeingPrunedCallback(threshold)