2acffc3172ec32e173547ee4c39a01b6c94e74a1,distributed/protocol/core.py,,dumps,#Any#Any#Any#Any#,18

Before Change


        for key, (head, frames) in data.items():
            if "lengths" not in head:
                head["lengths"] = tuple(map(nbytes, frames))
            if "compression" not in head:
                frames = frame_split_size(frames)
                if frames:
                    compression, frames = zip(*map(maybe_compress, frames))
                else:
                    compression = []
                head["compression"] = compression
            head["count"] = len(frames)
            header["headers"][key] = head
            header["keys"].append(key)
            out_frames.extend(frames)

After Change


            // Compress frames that are not yet compressed
            out_compression = []
            _out_frames = []
            for frame, compression in zip(
                frames, head.get("compression") or [None] * len(frames)
            ):
                if compression is None:  // default behavior
                    _frames = frame_split_size(frame)
                    _compression, _frames = zip(*map(maybe_compress, _frames))
                    out_compression.extend(_compression)
                    _out_frames.extend(_frames)
                else:  // already specified, so pass
                    out_compression.append(compression)
                    _out_frames.append(frame)

            head["compression"] = out_compression
            head["count"] = len(_out_frames)
            header["headers"][key] = head
            header["keys"].append(key)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: dask/distributed
Commit Name: 2acffc3172ec32e173547ee4c39a01b6c94e74a1
Time: 2020-03-18
Author: mrocklin@gmail.com
File Name: distributed/protocol/core.py
Class Name:
Method Name: dumps


Project Name: facebookresearch/pythia
Commit Name: 2f337387d6759627bae60284e7fa612268580724
Time: 2020-09-15
Author: vedanujg@gmail.com
File Name: mmf/models/mmf_transformer.py
Class Name: MMFTransformerEmbeddings
Method Name: forward


Project Name: pytorch/pytorch
Commit Name: a0cf5566d88533c5caa7a490beb6eb0760eee9b4
Time: 2021-01-21
Author: wanchaol@users.noreply.github.com
File Name: torch/optim/sgd.py
Class Name: SGD
Method Name: step