<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def importance(p_todo, p_ignore_weekend=config().ignore_weekends()):
 """ Calculates the importance of the given task. Returns an importance of zero when the task has been completed. If p_ignore_weekend is True, the importance value of the due date will be calculated as if Friday is immediately followed by Monday. This in case of a todo list at the office and you don't work during the weekends (you don't, right?) """

    result = 2

    priority = p_todo.priority()
    result += IMPORTANCE_VALUE[priority] if priority in IMPORTANCE_VALUE else 0

    if p_todo.has_tag(config().tag_due()):
        days_left = p_todo.days_till_due()

        if days_left >= 7 and days_left < 14:
            result += 1
        elif days_left >= 2 and days_left < 7:
            result += 2
        elif days_left >= 1 and days_left < 2:
            result += 3
        elif days_left >= 0 and days_left < 1:
            result += 5
        elif days_left < 0:
            result += 6

    if p_ignore_weekend and is_due_next_monday(p_todo):
        result += 1

    if p_todo.has_tag(config().tag_star()):
        result += 1

    return result if not p_todo.is_completed() else 0