d7ddc9ca7b7b62657b1e51c66b3f85da679d7b01,parlai/utils/misc.py,TimeLogger,log,#TimeLogger#Any#Any#Any#,274

Before Change


            done = done.value()
        self.tot_time += self.timer.time()
        self.timer.reset()
        log = {}
        log["exs"] = done
        if total > 0:
            log["%done"] = done / total
            if log["%done"] > 0:
                time_left = self.tot_time / log["%done"] - self.tot_time
                log["time_left"] = str(int(time_left)) + "s"
            z = "%.2f" % (100 * log["%done"])
            log["%done"] = str(z) + "%"

        if report:
            log = {**report, **log}

After Change


        if total > 0:
            progress = done / total
            seconds_left = max(0, self.tot_time / progress - self.tot_time)
            eta = timedelta(seconds=int(seconds_left + 0.5))
        else:
            progress = 0
            eta = "unknown"
        elapsed = timedelta(seconds=int(self.tot_time))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: facebookresearch/ParlAI
Commit Name: d7ddc9ca7b7b62657b1e51c66b3f85da679d7b01
Time: 2020-06-12
Author: roller@fb.com
File Name: parlai/utils/misc.py
Class Name: TimeLogger
Method Name: log


Project Name: UFAL-DSG/tgen
Commit Name: 33c643f35b2ce194f5b092bb81994a9668a02a8d
Time: 2014-10-31
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/rank.py
Class Name: PerceptronRanker
Method Name: _training_iter


Project Name: UFAL-DSG/tgen
Commit Name: 33c643f35b2ce194f5b092bb81994a9668a02a8d
Time: 2014-10-31
Author: odusek@ufal.mff.cuni.cz
File Name: tgen/parallel_percrank_train.py
Class Name: ParallelPerceptronRanker
Method Name: train