#NEWLINE# def __init__( self , axis = None , keepdims = False ) : #NEWLINE# #INDENT# self . keepdims = keepdims #NEWLINE# if ( axis is None ) : #NEWLINE# #INDENT# self . axis = None #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if isinstance ( axis , int ) : #NEWLINE# #INDENT# self . axis = ( axis , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( axis , tuple ) and all ( ( isinstance ( a , int ) for a in axis ) ) ) : #NEWLINE# #INDENT# if ( len ( set ( axis ) ) != len ( axis ) ) : #NEWLINE# #INDENT# raise ValueError ( 'duplicate value in axis: ({})' . format ( ', ' . join ( map ( str , axis ) ) ) ) #NEWLINE# #UNINDENT# self . axis = axis #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'None, int or tuple of int are required' )