code: def free(cls, pid, connection):
          
          with cls._lock:
              LOGGER.debug('Freeing %s from pool %s', id(connection), pid)
              cls._ensure_pool_exists(pid)
              cls._pools[pid].free(connection)
docs: Free a connection that was locked by a session
  
          :param str pid: The pool ID
          :param connection: The connection to remove
          :type connection: psycopg2.extensions.connection