from datetime import datetime


def is_branch_active(branch):
    """
    Checks to see if the branch is active by seeing if there are valid SLAs
    tied to the branch
    :param branch: a ComponentBranch object
    :return: a boolean
    """
    slas = branch.slas.all()
    today = datetime.utcnow().date()
    for sla in slas:
        if sla.eol >= today:
            # If the branch has at least one SLA that hasn't gone EOL, it is
            # still active
            return True

    return False