d082514cff28f46eae936872ee6c311db5843a37,parlai/mturk/core/mturk_manager.py,MTurkManager,_reset_time_logs,#MTurkManager#Any#,116

Before Change



            os.remove(file_lock)
        except Exception as e:
            if os.path.exists(file_lock):
                os.remove(file_lock)
            raise e

    def _log_working_time(self, mturk_worker):
        additional_time = time.time() - mturk_worker.creation_time

After Change


        file_path = os.path.join(parent_dir, TIME_LOGS_FILE_NAME)
        file_lock = os.path.join(parent_dir, TIME_LOGS_FILE_LOCK)
        with LockFile(file_lock) as _lock_file:
            assert _lock_file is not None
            if os.path.exists(file_path):
                if not force:
                    with open(file_path, "rb+") as time_log_file:
                        existing_times = pickle.load(time_log_file)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/ParlAI
Commit Name: d082514cff28f46eae936872ee6c311db5843a37
Time: 2018-06-13
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _reset_time_logs


Project Name: facebookresearch/ParlAI
Commit Name: d082514cff28f46eae936872ee6c311db5843a37
Time: 2018-06-13
Author: jju@fb.com
File Name: parlai/mturk/core/mturk_manager.py
Class Name: MTurkManager
Method Name: _log_working_time


Project Name: arviz-devs/arviz
Commit Name: 72070a417b2e7bf9ac36ab157d93edb05b9eebe7
Time: 2019-01-11
Author: ahartikainen@users.noreply.github.com
File Name: arviz/tests/test_data.py
Class Name: TestIONetCDFUtils
Method Name: test_io_method