code: def remove_connection(cls, pid, connection):
          
          cls._ensure_pool_exists(pid)
          cls._pools[pid].remove(connection)
docs: Remove a connection from the pool, closing it if is open.
  
          :param str pid: The pool ID
          :param connection: The connection to remove
          :type connection: psycopg2.extensions.connection
          :raises: ConnectionNotFoundError