<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def free(self, connection):
 """Free the connection from use by the session that was using it. :param connection: The connection to free :type connection: psycopg2.extensions.connection :raises: ConnectionNotFoundError """

        LOGGER.debug('Pool %s freeing connection %s', self.id, id(connection))
        try:
            self.connection_handle(connection).free()
        except KeyError:
            raise ConnectionNotFoundError(self.id, id(connection))

        if self.idle_connections == list(self.connections.values()):
            with self._lock:
                self.idle_start = self.time_method()
        LOGGER.debug('Pool %s freed connection %s', self.id, id(connection))