3b3f8bd00c463e441600673141ff2de608880c9a,deeppavlov/datasets/dialog_dataset.py,DialogDataset,batch_generator,#DialogDataset#Any#Any#Any#,58

Before Change


            return data[idx["start"]: idx["end"]]

        data = self.data[data_type]
        dialog_indices = self._dialog_indices(data)
        num_dialogs = len(dialog_indices)
        order = list(range(num_dialogs))
        if shuffle:
            random.shuffle(order)
        for i in range((num_dialogs - 1) // batch_size + 1):
            print("Getting dialogs =", [dialog_indices[o] for o in
                                        order[i*batch_size:(i+1)*batch_size]])
            yield list(itertools.chain.from_iterable(
                _dialog(dialog_indices[o])\
                for o in order[i*batch_size:(i+1)*batch_size]))

    @staticmethod
    def _dialog_indices(data):
        dialog_indices = []
        i, last_idx = 0, 0

After Change


            self.random_state = random.getstate()
            random.setstate(rs)
        for i in order:
            for x, y in dialogs[i]:
                yield [x], [y]

    @staticmethod
    def _dialogs(data):
        dialogs = []
        for x, y in data:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: deepmipt/DeepPavlov
Commit Name: 3b3f8bd00c463e441600673141ff2de608880c9a
Time: 2018-02-05
Author: yoptar@gmail.com
File Name: deeppavlov/datasets/dialog_dataset.py
Class Name: DialogDataset
Method Name: batch_generator


Project Name: OpenNMT/OpenNMT-py
Commit Name: 23dffb96ac95827a3af89f6ff027d254284ba93c
Time: 2019-02-08
Author: guillaumekln@users.noreply.github.com
File Name: onmt/inputters/inputter.py
Class Name: DatasetLazyIter
Method Name: __iter__


Project Name: google/deepvariant
Commit Name: 2f5667b2065568a3c774d76abddb43d726da8c75
Time: 2018-04-13
Author: no-reply@google.com
File Name: third_party/nucleus/util/ranges.py
Class Name:
Method Name: bed_parser