I have the following function implemented in Matlab (I am not familiar with this programming language) to read and open binary file for MNIST dataset. I want to convert this