def is_user_in_group(user, group):
    """Dermines if a user is in a group.

    Args:
        user: A str representing the user name or id to determine if they are a
            member of the given group
        group: A Group object to check if a user is a member of

    Returns:
        A boolean representing if the given user is a member of the given group
    """
    if user in group.users:
        return True

    if len(group.groups) == 0:
        return False

    for sub_group in group.groups:
        if is_user_in_group(user, sub_group):
            return True

    return False