'Sets the token in the DataContainer to point to the variable specified
in set_token_path. Usually set_token_path will be one of:
* (\'id\',) - When the data container doesn\'t support repeated params
* (\'id\', 3) - When it does
* A DataToken instance which holds the path
:raises: An exception when the DataContainer does NOT contain the
specified path in *args to find the variable
:return: The token if we were able to set it in the DataContainer'

def set_token(self, set_token_path):

    override_token = False
    try:
        token_path = set_token_path.get_path()
        override_token = True
    except AttributeError:
        token_path = set_token_path
    for (key, val, i_token_path, setter) in self.iter_setters():
        if (i_token_path == token_path):
            if override_token:
                token = set_token_path
            elif isinstance(val, DataToken):
                token = val
            else:
                token = DataToken(key, val, i_token_path)
            setter(token)
            self.token = token
            return token
    path_str = (lambda path: ('(%s)' % ',    '.join([str(i) for i in path])))
    ppath = path_str(token_path)
    vpath = '    -    '.join([path_str(p) for (_, _, p, _) in self.iter_setters()])
    if vpath:
        msg = 'Invalid    token    path    "%s".    Valid    paths    are:    %s'
        raise RuntimeError((msg % (ppath, vpath)))
    else:
        msg = 'Invalid    token    path    "%s".    No    valid    paths    for    "%s"'
        raise RuntimeError((msg % (ppath, self.get_type())))
