code: def _check_for_crypto_done(self):
          # type: (Downloader) -> None
          
          cv = self._crypto_offload.done_cv
          while not self.termination_check:
              result = None
              cv.acquire()
              while True:
                  result = self._crypto_offload.pop_done_queue()
                  if result is None:
                      # use cv timeout due to possible non-wake while running
                      cv.wait(0.1)
                      # check for terminating conditions
                      if self.termination_check:
                          break
                  else:
                      break
              cv.release()
              if result is not None:
                  try:
                      final_path, offsets = result
                      with self._transfer_lock:
                          dd = self._dd_map[final_path]
                      self._finalize_chunk(dd, offsets)
                  except KeyError:
                      # this can happen if all of the last integrity
                      # chunks are processed at once
                      pass
docs: Check queue for crypto done
          :param Downloader self: this