@staticmethod<EOL><INDENT>def verify(path):<DEDENT>
valid = False<EOL>try:<EOL><INDENT>h5 = h5py.File(path, mode="<STR_LIT:r>")<EOL><DEDENT>except (OSError, IsADirectoryError):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>if ("<STR_LIT>" in h5.attrs and<EOL>h5.attrs["<STR_LIT>"].lower() == "<STR_LIT>" and<EOL>"<STR_LIT>" in h5):<EOL><INDENT>valid = True<EOL><DEDENT><DEDENT>return valid<EOL>
Verify that `path` has the HyperSpy file format