#NEWLINE# def normalize_hide( val ) : #NEWLINE# #INDENT# hide_vals = ( None , False , 'out' , 'stdout' , 'err' , 'stderr' , 'both' , True ) #NEWLINE# if ( val not in hide_vals ) : #NEWLINE# #INDENT# err = "'hide' got {0!r} which is not in {1!r}" #NEWLINE# raise ValueError ( err . format ( val , hide_vals ) ) #NEWLINE# #UNINDENT# if ( val in ( None , False ) ) : #NEWLINE# #INDENT# hide = ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( val in ( 'both' , True ) ) : #NEWLINE# #INDENT# hide = ( 'out' , 'err' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( val == 'stdout' ) : #NEWLINE# #INDENT# hide = ( 'out' , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( val == 'stderr' ) : #NEWLINE# #INDENT# hide = ( 'err' , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# hide = ( hide , ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return hide