def _get_speed(event):
    """
    A helper function to extract the speed from an event.
    """
    if event.get('code', "").lower() == "progress" and isinstance(event['details'], dict):
        return event['details'].get("mbps")