code: def add(cls, pid, connection):
          
          with cls._lock:
              cls._ensure_pool_exists(pid)
              cls._pools[pid].add(connection)
docs: Add a new connection and session to a pool.
  
          :param str pid: The pool id
          :type connection: psycopg2.extensions.connection
          :param connection: The connection to add to the pool