#NEWLINE# def unschedule( self , callback , all = True ) : #NEWLINE# #INDENT# "Remove a previously scheduled event.\n\n        :parameters:\n\n            `callback`: :class:`ClockEvent` or a callable.\n                If it's a :class:`ClockEvent` instance, then the callback\n                associated with this event will be canceled if it is\n                scheduled. If it's a callable, then the callable will be\n                unscheduled if it is scheduled.\n            `all`: bool\n                If True and if `callback` is a callable, all instances of this\n                callable will be unscheduled (i.e. if this callable was\n                scheduled multiple times). Defaults to `True`.\n\n        .. versionchanged:: 1.9.0\n            The all parameter was added. Before, it behaved as if `all` was\n            `True`.\n        " #NEWLINE# if isinstance ( callback , ClockEvent ) : #NEWLINE# #INDENT# callback . cancel ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if all : #NEWLINE# #INDENT# for ev in self . _events [ _hash ( callback ) ] [ : ] : #NEWLINE# #INDENT# if ( ev . get_callback ( ) == callback ) : #NEWLINE# #INDENT# ev . cancel ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for ev in self . _events [ _hash ( callback ) ] [ : ] : #NEWLINE# #INDENT# if ( ev . get_callback ( ) == callback ) : #NEWLINE# #INDENT# ev . cancel ( ) #NEWLINE# break