scripts/benchmark/trainer-benchmark.py/Tee/write
class Tee:    def write(self, msg):
        self.stdout.write(msg)
        # strip tqdm codes
        self.file.write(re.sub(r"^.*\r", "", msg, 0, re.M))