code: def run(self):
          # type: () -> None
          
          if self.configured_steps.value < self.total_steps.value:
              next_state = ss.ARMED
          else:
              next_state = ss.READY
          try:
              self.transition(ss.RUNNING)
              hook = RunHook
              going = True
              while going:
                  try:
                      self.do_run(hook)
                  except AbortedError:
                      self.abort_queue.put(None)
                      # Wait for a response on the resume_queue
                      should_resume = self.resume_queue.get()
                      if should_resume:
                          # we need to resume
                          hook = ResumeHook
                          self.log.debug("Resuming run")
                      else:
                          # we don't need to resume, just drop out
                          raise
                  else:
                      going = False
              self.abortable_transition(next_state)
          except AbortedError:
              raise
          except Exception as e:
              self.go_to_error_state(e)
              raise
docs: Run a device where configure() has already be called
  
          Normally it will return in Ready state. If setup for multiple-runs with
          a single configure() then it will return in Armed state. If the user
          aborts then it will return in Aborted state. If something goes wrong it
          will return in Fault state. If the user disables then it will return in
          Disabled state.