code: def set_trace(self, frame=None, break_=True):
          
          # We are already tracing, do nothing
          trace_log.info(
              'Setting trace %s (stepping %s) (current_trace: %s)' % (
                  pretty_frame(frame or sys._getframe().f_back), self.stepping,
                  sys.gettrace()
              )
          )
          if self.stepping or self.closed:
              return
          self.reset()
          trace = (
              self.trace_dispatch
              if trace_log.level >= 30 else self.trace_debug_dispatch
          )
          trace_frame = frame = frame or sys._getframe().f_back
          while frame:
              frame.f_trace = trace
              frame = frame.f_back
          self.state = Step(trace_frame) if break_ else Running(trace_frame)
          sys.settrace(trace)
docs: Break at current state