def is_user_in_group(user, group):
    """
    Return True if user is in the group, False otherwise.

    Args:
      user(str): user name/id
      group(class:Group): group to check user membership against
    """
    result = False
    users = group.get_users()
    if user in users:
        return True

    groups = group.get_groups()
    for group in groups:
        users = group.get_users()
        if user in users:
            return True
        else:
            if group.get_groups():
                result = is_user_in_group(user, group)

    return result