Release the lock.

        This requires you to actually have owned the lock.  On return
        you definitely do not own it, but if somebody else owned it
        before calling this function, they still do.

        :param str identifier: the session lock identifier
        :return: :const:`True` if you actually did own the lock,
          :const:`False` if you didn't

def _release_lock(self, identifier):
        '''Release the lock.

        This requires you to actually have owned the lock.  On return
        you definitely do not own it, but if somebody else owned it
        before calling this function, they still do.

        :param str identifier: the session lock identifier
        :return: :const:`True` if you actually did own the lock,
          :const:`False` if you didn't

        '''
        conn = redis.Redis(connection_pool=self.pool)
        script = conn.register_script('''
        if redis.call("get", KEYS[1]) == ARGV[1]
        then
            return redis.call("del", KEYS[1])
        else
            return -1
        end
        ''')
        num_keys_deleted = script(keys=[self._lock_name],
                                  args=[identifier])
        return (num_keys_deleted == 1)