code: def get(self, session):
          
          idle = self.idle_connections
          if idle:
              connection = idle.pop(0)
              connection.lock(session)
              if self.idle_start:
                  with self._lock:
                      self.idle_start = None
              return connection.handle
          raise NoIdleConnectionsError(self.id)
docs: Return an idle connection and assign the session to the connection
  
          :param queries.Session session: The session to assign
          :rtype: psycopg2.extensions.connection
          :raises: NoIdleConnectionsError