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

def _remove_persistent_module(mod, comment):
    '''
    Remove module from loader.conf. If comment is true only comment line where
    module is.
    '''
    if not mod or mod not in mod_list(True):
        return set()

    if comment:
        __salt__['file.comment'](_LOADER_CONF, _MODULE_RE.format(mod))
    else:
        __salt__['file.sed'](_LOADER_CONF, _MODULE_RE.format(mod), '')

    return set([mod])