#NEWLINE# def _remove_instance( vevent , instance ) : #NEWLINE# #INDENT# "remove a recurrence instance from a VEVENT's RRDATE list\n\n    :type vevent: icalendar.cal.Event\n    :type instance: datetime.datetime\n    " #NEWLINE# if isinstance ( vevent [ 'RDATE' ] , list ) : #NEWLINE# #INDENT# rdates = [ leaf . dt for tree in vevent [ 'RDATE' ] for leaf in tree . dts ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# rdates = [ vddd . dt for vddd in vevent [ 'RDATE' ] . dts ] #NEWLINE# #UNINDENT# rdates = [ one for one in rdates if ( one != instance ) ] #NEWLINE# vevent . pop ( 'RDATE' ) #NEWLINE# if ( rdates != [ ] ) : #NEWLINE# #INDENT# vevent . add ( 'RDATE' , rdates )