def METHOD_NAME(link_flags, check_oper_status):
    """
    Check link status based on device status flags.
    :param link_flags: Status flags.
    :param check_oper_status: If set, the operational status of the link is
    checked in addition to the administrative status.
    :return:
    """
    iface_up = link_flags & libnl.IfaceStatus.IFF_UP
    if check_oper_status:
        iface_up = iface_up and (link_flags & libnl.IfaceStatus.IFF_RUNNING)
    return bool(iface_up)