def move_all(self, from_dict, to_dict):
        '''Move everything from one dictionary to another.

        This can be expensive if the source dictionary is large.

        This always requires a session lock.

        :param str from_dict: source dictionary
        :param str to_dict: destination dictionary

        '''
        if self._session_lock_identifier is None:
            raise ProgrammerError('must acquire lock first')
        conn = redis.Redis(connection_pool=self.pool)
        script = conn.register_script('''
        if redis.call("get", KEYS[1]) == ARGV[1]
        then
            local count = 0
            local keys = redis.call('ZRANGE', KEYS[3], 0, -1)
            for i, next_key in ipairs(keys) do
                -- get the value and priority for this key
                local next_val = redis.call("hget", KEYS[2], next_key)
                local next_priority = redis.call("zscore", KEYS[3], next_key)
                -- remove item of from_dict
                redis.call("zrem", KEYS[3], next_key)
                -- also remove from hash
                redis.call("hdel", KEYS[2], next_key)
                -- put it in to_dict
                redis.call("hset",  KEYS[4], next_key, next_val)
                redis.call("zadd", KEYS[5], next_priority, next_key)
                count = count + 1
            end
            return count
        else
            -- ERROR: No longer own the lock
            return 0
        end
        ''')
        num_moved = script(keys=[self._lock_name,
                                 self._namespace(from_dict), 
                                 self._namespace(from_dict) + 'keys',
                                 self._namespace(to_dict),
                                 self._namespace(to_dict) + 'keys'],
                           args=[self._session_lock_identifier])
        return num_moved
Move everything from one dictionary to another.

        This can be expensive if the source dictionary is large.

        This always requires a session lock.

        :param str from_dict: source dictionary
        :param str to_dict: destination dictionary