#NEWLINE# def _parse_args( ) : #NEWLINE# #INDENT# parser = argparse . ArgumentParser ( description = 'Interactive browser of convolutional weights. Up/down keys switch layers. Left/right keys switch units.' ) #NEWLINE# parser . add_argument ( '-i' , '--input' , required = True , help = '.pkl file of model' ) #NEWLINE# result = parser . parse_args ( ) #NEWLINE# if ( os . path . splitext ( parser . input ) [ 1 ] != '.pkl' ) : #NEWLINE# #INDENT# print ( ( 'Expected --input to end in .pkl, got %s.' % result . input ) ) #NEWLINE# sys . exit ( 1 ) #NEWLINE# #UNINDENT# return result