#NEWLINE# def T( t , step = 30 ) : #NEWLINE# #INDENT# '\n    The TOTP T value (number of time steps since the epoch)\n    ' #NEWLINE# if hasattr ( t , 'timestamp' ) : #NEWLINE# #INDENT# timestamp = t . timestamp ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( t . tzinfo is None ) : #NEWLINE# #INDENT# timestamp = time . mktime ( t . timetuple ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# utc_naive = ( t . replace ( tzinfo = None ) - t . utcoffset ( ) ) #NEWLINE# timestamp = ( utc_naive - datetime . datetime ( 1970 , 1 , 1 ) ) . total_seconds ( ) #NEWLINE# #UNINDENT# #UNINDENT# return ( int ( t ) // step )