<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def is_logged_in(username=None):
 """Checks if user is logged in if `username` is passed check if specified user is logged in username can be a list"""

    if username:
        if not isinstance(username, (list, tuple)):
            username = [username]
        return 'simple_logged_in' in session and get_username() in username
    return 'simple_logged_in' in session