The removal of the .sh extension means that 1) the OS thinks it's an executable and will try to run it instead of opening it with an editor 2) the editor doesn't recognise that it's python so there is no highlighting etc. Generally I see no reason for having removed the extension and I think we should put it back (also same for other scripts where extensions have been removed)
L164 seems to be a debug statement which was forgotten to be removed, I don't see the reason for having a long dump of dsids that are going to be processed and this is more clearly visible from the following printout statements which are clearer