#NEWLINE# def is_npy( filename ) : #NEWLINE# #INDENT# '\n    The first bytes are: x93NUMPY\n    see: https://github.com/numpy/numpy/blob/master/doc/neps/npy-format.rst\n    ' #NEWLINE# from numpy.lib.format import MAGIC_PREFIX #NEWLINE# with open ( infile , 'rb' ) as infile : #NEWLINE# #INDENT# return ( infile . read ( 6 ) == MAGIC_PREFIX )