#NEWLINE# def apply( self , other ) : #NEWLINE# #INDENT# if isinstance ( other , ( datetime , np . datetime64 , date ) ) : #NEWLINE# #INDENT# return ( as_timestamp ( other ) + self ) #NEWLINE# #UNINDENT# if isinstance ( other , timedelta ) : #NEWLINE# #INDENT# return ( other + self . delta ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( other , type ( self ) ) : #NEWLINE# #INDENT# return type ( self ) ( ( self . n + other . n ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ApplyTypeError ( ( 'Unhandled type: %s' % type ( other ) . __name__ ) )