#NEWLINE# def __init__( self , img_shape , kernel_size = 7 , batch_size = 5000 , threshold = 0.0001 , channels = None ) : #NEWLINE# #INDENT# self . _img_shape = img_shape #NEWLINE# self . _kernel_size = kernel_size #NEWLINE# self . _batch_size = batch_size #NEWLINE# self . _threshold = threshold #NEWLINE# if ( channels is None ) : #NEWLINE# #INDENT# self . _channels = range ( 3 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( channels , list ) or isinstance ( channels , tuple ) ) : #NEWLINE# #INDENT# self . _channels = channels #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( self , int ) : #NEWLINE# #INDENT# self . _channels = [ channels ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ValueError ( 'channels should be either a list or int' )