@imm_action('set flag', target_class='args', prep='on', obj_msg_class="flags", self_object=True)
def add_flag(source, target, obj, **_):
    try:
        flag_id = target[0]
    except __HOLE__:
        raise ActionError("Flag id required.")
    try:
        flag_value = target[1]
    except IndexError:
        flag_value = 'None'
    try:
        flag_value = str_to_primitive(flag_value)
    except ValueError:
        raise ActionError("Cannot parse {}".format(flag_value))
    obj.flags[flag_id] = flag_value
    source.display_line("Flag {} set to {} on {}.".format(flag_id, flag_value, obj.name))
dataset/ETHPy150Open genzgd/Lampost-Mud/lampost/mud/immortal.py/add_flag