<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def set_1to1(self, dict_name, key1, key2):
        '''Set two keys to be equal in a 1-to-1 mapping.

        Within `dict_name`, `key1` is set to `key2`, and `key2` is set
        to `key1`.

        This always requires a session lock.

        :param str dict_name: dictionary to update
        :param str key1: first key/value
        :param str key2: second key/value

        '''
        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
            redis.call("hset", KEYS[2], ARGV[2], ARGV[3])
            redis.call("hset", KEYS[2], ARGV[3], ARGV[2])
        else
            -- ERROR: No longer own the lock
            return -1
        end
        ''')
        res = script(keys=[self._lock_name,
                           self._namespace(dict_name)],
                     args=[self._session_lock_identifier,
                           self._encode(key1),
                           self._encode(key2)])
        if res == -1:
            raise EnvironmentError()