1391067c332600b9273d47221f2b27d4b1895414,brian2/utils/debugging.py,std_silent,__exit__,#std_silent#Any#Any#Any#,43

Before Change


        if exc_type is not None or self.alwaysprint:
            self.newout.flush()
            self.newerr.flush()
            self.old_stdout.write(self.newout.getvalue())
            self.old_stderr.write(self.newerr.getvalue())
            self.old_stdout.flush()
            self.old_stderr.flush()

After Change



    def __exit__(self, exc_type, exc_value, traceback):
        if not self.alwaysprint:
            std_silent.dest_stdout.flush()
            std_silent.dest_stderr.flush()
            if exc_type is not None:
                out = open(std_silent.dest_fname_stdout, "r").read()
                err = open(std_silent.dest_fname_stderr, "r").read()
            os.dup2(self.orig_out_fd, 1)
            os.dup2(self.orig_err_fd, 2)
            os.close(self.orig_out_fd)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: brian-team/brian2
Commit Name: 1391067c332600b9273d47221f2b27d4b1895414
Time: 2014-11-13
Author: dan.goodman@ens.fr
File Name: brian2/utils/debugging.py
Class Name: std_silent
Method Name: __exit__


Project Name: scikit-optimize/scikit-optimize
Commit Name: 44be9703a0744caf78b8b61319be0db281e91d6a
Time: 2018-04-06
Author: scott_graham@bose.com
File Name: skopt/tests/test_space.py
Class Name:
Method Name: test_space_from_yaml


Project Name: tensorflow/models
Commit Name: dc8c6ce1c6487e4a0f49dd16453fbdac4e1ad1c8
Time: 2019-07-15
Author: saberkun@users.noreply.github.com
File Name: official/bert/model_training_utils.py
Class Name:
Method Name: run_customized_training_loop