Yeah it's definitely python. It could be some sort of program made to find the size of a file? The last few strings at the end kinda look like this
getSize(fileobject):
fileobject.seek(0,2) # move the cursor to the end of the file
size = fileobject.tell()
return size
Looks like a lot of work for simply finding some sort of file size. I'm probably wrong though, I don't code that much.