383ea0326ae103b5d5e0b62ed9c3cb18510c5b9e,distributed/comm/tcp.py,TCP,write,#TCP#Any#Any#Any#,229

Before Change


        try:
            nframes = len(frames)
            lengths = [nbytes(frame) for frame in frames]
            length_bytes = struct.pack(f"Q{nframes}Q", nframes, *lengths)

            frames = [length_bytes, *frames]
            lengths = [len(length_bytes), *lengths]

After Change


            // trick to enque all frames for writing beforehand
            for each_frame in frames:
                each_frame_nbytes = nbytes(each_frame)
                if each_frame_nbytes:
                    stream._write_buffer.append(each_frame)
                    stream._total_write_index += each_frame_nbytes

            // start writing frames
            stream.write(b"")
        except StreamClosedError as e:
            self.stream = None
            self._closed = True
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: dask/distributed
Commit Name: 383ea0326ae103b5d5e0b62ed9c3cb18510c5b9e
Time: 2021-02-17
Author: jakirkham@gmail.com
File Name: distributed/comm/tcp.py
Class Name: TCP
Method Name: write


Project Name: dmnfarrell/pandastable
Commit Name: 1af2719c4940dafca58ac9a1bafc41d9add6ffa5
Time: 2014-02-15
Author: farrell.damien@gmail.com@c7c09e87-b3be-f776-313c-63292bcc8aec
File Name: plotting.py
Class Name: MPLoptions
Method Name: showDialog


Project Name: lanpa/tensorboardX
Commit Name: f4a6c738beabc312a848804e5c4d4f384919f026
Time: 2020-06-29
Author: prafullasd@gmail.com
File Name: tensorboardX/summary.py
Class Name:
Method Name: audio


Project Name: dmnfarrell/pandastable
Commit Name: 9f223207e3a7b4623ad1dc2e52ec73a71b429fc6
Time: 2015-08-31
Author: farrell.damien@gmail.com
File Name: pandastable/stats.py
Class Name: StatsViewer
Method Name: summary