def _check_ep(interface, ep_index, ep_dir, ep_type):
    """! @brief Tests an endpoint type and direction."""
    ep = interface[ep_index]
    return (usb.util.endpoint_direction(ep.bEndpointAddress) == ep_dir) \
        and (usb.util.endpoint_type(ep.bmAttributes) == ep_type)
! @brief Tests an endpoint type and direction.