#NEWLINE# def gauge( self , key , gauge = None , default = float ( 'nan' ) ) : #NEWLINE# #INDENT# if ( key not in self . _gauges ) : #NEWLINE# #INDENT# if ( gauge is None ) : #NEWLINE# #INDENT# gauge = SimpleGauge ( default ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not isinstance ( self , Gauge ) ) : #NEWLINE# #INDENT# if ( not callable ( gauge ) ) : #NEWLINE# #INDENT# raise TypeError ( 'gauge getter not callable' ) #NEWLINE# #UNINDENT# gauge = CallbackGauge ( gauge ) #NEWLINE# #UNINDENT# #UNINDENT# self . _gauges [ key ] = gauge #NEWLINE# #UNINDENT# return self . _gauges [ key ]