code: def ping(self):
          
          while True:
              try:
                  ping_after, session = self._sessions.get(block=False)
              except queue.Empty:  # all sessions in use
                  break
              if ping_after > _NOW():  # oldest session is fresh
                  # Re-add to queue with existing expiration
                  self._sessions.put((ping_after, session))
                  break
              if not session.exists():  # stale
                  session = self._new_session()
                  session.create()
              # Re-add to queue with new expiration
              self.put(session)
docs: Refresh maybe-expired sessions in the pool.
  
          This method is designed to be called from a background thread,
          or during the "idle" phase of an event loop.