#NEWLINE# def __init__( self , * args ) : #NEWLINE# #INDENT# if ( len ( args ) == 2 ) : #NEWLINE# #INDENT# self . colors = list ( i ) #NEWLINE# self . intervals = [ 0.0 , 1.0 ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( args ) > 0 ) : #NEWLINE# #INDENT# if ( ( len ( args ) % 2 ) != 0 ) : #NEWLINE# #INDENT# raise ValueError ( 'len(args) should be even' ) #NEWLINE# #UNINDENT# self . colors = [ args [ i ] for i in range ( 1 , len ( args ) , 2 ) ] #NEWLINE# self . intervals = [ args [ i ] for i in range ( 0 , len ( args ) , 2 ) ] #NEWLINE# #UNINDENT# #UNINDENT# assert ( len ( self . colors ) == len ( self . intervals ) )