def METHOD_NAME(mod, comment):
    """
    Remove module from configuration file. If comment is true only comment line
    where module is.
    """
    conf = _get_modules_conf()
    mod_name = _strip_module_name(mod)
    if not mod_name or mod_name not in mod_list(True):
        return set()
    escape_mod = re.escape(mod)
    if comment:
        __salt__["file.comment"](conf, "^[\t ]*{}[\t ]?".format(escape_mod))
    else:
        __salt__["file.sed"](conf, "^[\t ]*{}[\t ]?".format(escape_mod), "")
    return {mod_name}