#NEWLINE# def imsave( filename , data , maxval = None , pam = False ) : #NEWLINE# #INDENT# "Write image data to Netpbm file.\n\n    Examples\n    --------\n    >>> image = numpy.array([[0, 1],[65534, 65535]], dtype=numpy.uint16)\n    >>> imsave('_tmp.pgm', image)\n\n    " #NEWLINE# try : #NEWLINE# #INDENT# netpbm = NetpbmFile ( netpbm , maxval = maxval ) #NEWLINE# netpbm . write ( filename , pam = pam ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# netpbm . close ( )