code: def pending_tasks(self, res):
          "Synchronized access to tasks"
          jobs, lock = self._jobs
          with lock:
              return jobs[res].copy(f pending_tasks(self, res):
          "Synchronized access to tasks"
          jobs, lock = self._jobs
          with lock:
              return jobs[res].copy()
docs: Synchronized access to tasks