#NEWLINE# def copy( x ) : #NEWLINE# #INDENT# "Shallow copy operation on arbitrary Python objects.\n\n    See the module's __doc__ string for more info.\n    " #NEWLINE# cls = type ( x ) #NEWLINE# copier = _copy_dispatch . get ( cls ) #NEWLINE# if copier : #NEWLINE# #INDENT# return copier ( x ) #NEWLINE# #UNINDENT# copier = getattr ( cls , '__copy__' , None ) #NEWLINE# if copier : #NEWLINE# #INDENT# return copier ( x ) #NEWLINE# #UNINDENT# reductor = dispatch_table . get ( cls ) #NEWLINE# if reductor : #NEWLINE# #INDENT# rv = reductor ( x ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reductor = getattr ( x , '__reduce_ex__' , None ) #NEWLINE# if reductor : #NEWLINE# #INDENT# rv = reductor ( 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# reductor = getattr ( x , '__reduce__' , None ) #NEWLINE# if reductor : #NEWLINE# #INDENT# rv = reductor ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise Error ( ( 'un(shallow)copyable object of type %s' % cls ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return _reconstruct ( x , rv , 0 )