def flush_if_ended(self):
if self.ended and self.next and len(self.files) == self.transformed:<EOL><INDENT>future = asyncio.ensure_future(self.transformer.flush())<EOL>future.add_done_callback(lambda x: self.next.end_of_stream())<EOL><DEDENT>
Call 'flush' function if all files have been transformed.