def get_num_frames_in_event(event):
    """
    Gets the number of frames in an AGIPD 1M event retrieved from Karabo.

    This function retrieves the number of frames in each event for the detector
    identified by the 'karabo_detector_label' entry in the 'DataRetrievalLayer'
    configuration parameter group.

    NOTE: This function is designed to be injected as a member function into an
    :class:`~onda.utils.data_event.DataEvent` object.

    Arguments:

        event (:class:`~onda.utils.data_event.DataEvent`): an object storing the event
            data.

    Returns:

        int: the number of frames in the event.
    """
    return event.data[event.framework_info['detector_label']]['image.data'
        ].shape[0]
