code: def pomodoro(self):
          
          if not self._initialized:
              self._init()
  
          cached_until = self.py3.time_in(0)
          if self._running:
              self._time_left = ceil(self._end_time - time())
              time_left = ceil(self._time_left)
          else:
              time_left = ceil(self._time_left)
  
          vals = {"ss": int(time_left), "mm": int(ceil(time_left / 60))}
  
          if self.py3.format_contains(self.format, "mmss"):
              hours, rest = divmod(time_left, 3600)
              mins, seconds = divmod(rest, 60)
  
              if hours:
                  vals["mmss"] = u"%d%s%02d%s%02d" % (
                      hours,
                      self.format_separator,
                      mins,
                      self.format_separator,
                      seconds,
                  )
              else:
                  vals["mmss"] = u"%d%s%02d" % (mins, self.format_separator, seconds)
  
          if self.py3.format_contains(self.format, "bar"):
              vals["bar"] = self._setup_bar()
  
          formatted = self.format.format(**vals)
  
          if self._running:
              if self._active:
                  format = self.format_active
              else:
                  format = self.format_break
          else:
              if self._active:
                  format = self.format_stopped
              else:
                  format = self.format_break_stopped
              cached_until = self.py3.CACHE_FOREVER
  
          response = {
              "full_text": format.format(
                  breakno=self._break_number, format=formatted, **vals
              ),
              "cached_until": cached_until,
          }
  
          if self._alert:
              response["urgent"] = True
              self._alert = False
  
          if not self._running:
              response["color"] = self.py3.COLOR_BAD
          else:
              if self._active:
                  response["color"] = self.py3.COLOR_GOOD
              else:
                  response["color"] = self.py3.COLOR_DEGRADED
  
          return response
docs: Pomodoro response handling and countdown