python code to determine magic number match for file/data