#NEWLINE# @ apply_wraps #NEWLINE# def apply( self , other ) : #NEWLINE# #INDENT# if self . _use_relativedelta : #NEWLINE# #INDENT# other = as_datetime ( other ) #NEWLINE# #UNINDENT# if ( len ( self . kwds ) > 0 ) : #NEWLINE# #INDENT# tzinfo = getattr ( other , 'tzinfo' , None ) #NEWLINE# if ( ( tzinfo is not None ) and self . _use_relativedelta ) : #NEWLINE# #INDENT# other = other . replace ( tzinfo = None ) #NEWLINE# #UNINDENT# if ( self . n > 0 ) : #NEWLINE# #INDENT# for i in range ( self . n ) : #NEWLINE# #INDENT# other = ( other + self . _offset ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for i in range ( ( - self . n ) ) : #NEWLINE# #INDENT# other = ( other - self . _offset ) #NEWLINE# #UNINDENT# #UNINDENT# if ( ( other is not None ) and self . _use_relativedelta ) : #NEWLINE# #INDENT# other = tslib . _localize_pydatetime ( other , tzinfo ) #NEWLINE# #UNINDENT# return as_timestamp ( other ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( other + timedelta ( self . n ) )