def station_logo_check()

in broadcast-monitoring/src/consolidate_frame_results/app/checks.py [0:0]


def station_logo_check(frames):
    frames_with_logo = [el['Is_Expected_Logo'] for el in frames if 'Is_Expected_Logo' in el]

    if not frames_with_logo:
        logger.info('No frames with logo result')
        return []

    detected_percent = (frames_with_logo.count(True) / len(frames_with_logo)) * 100
    yield 'Station_Status', detected_percent >= STATION_LOGO_THRESHOLD

    throttled_frames = [el for el in frames if 'Logo_Detect_Error' in el]
    if len(throttled_frames) > 0:
        yield 'Has_Logo_Detect_Error', True