<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def discard_events(library, session, event_type, mechanism):
 """Discards event occurrences for specified event types and mechanisms in a session. Corresponds to viDiscardEvents function of the VISA library. :param library: the visa library wrapped by ctypes. :param session: Unique logical identifier to a session. :param event_type: Logical event identifier. :param mechanism: Specifies event handling mechanisms to be dicarded. (Constants.VI_QUEUE, .VI_HNDLR, .VI_SUSPEND_HNDLR, .VI_ALL_MECH) :return: return value of the library call. :rtype: :class:`pyvisa.constants.StatusCode` """

    return library.viDiscardEvents(session, event_type, mechanism)