def get_finished(self):
indices  = []<EOL>for idf, v in self.q.items():<EOL><INDENT>if v.poll() != None:<EOL><INDENT>indices.append(idf)<EOL><DEDENT><DEDENT>for i in indices:<EOL><INDENT>self.q.pop(i)<EOL><DEDENT>return indices<EOL>
Clean up terminated processes and returns the list of their ids