eba587e7549e252036f2500e9a3b3a18a778b335,dataset/batch_image.py,ImagesBatch,assemble,#ImagesBatch#Any#,250

Before Change


            raise RuntimeError("Could not assemble the batch")

        component = kwargs.get("component", "images")
        try:
            new_images = np.stack(all_res)
        except ValueError as e:
            message = str(e)
            if "must have the same shape" in message:
                min_shape = np.array([x.shape for x in all_res]).min(axis=0)
                all_res = [arr[:min_shape[0], :min_shape[1]].copy() for arr in all_res]
                new_images = np.stack(all_res)
        setattr(self, component, new_images)
        return self

    @action

After Change



        components = kwargs.get("components", "images")
        if isinstance(components, (list, tuple)):
            all_res = list(zip(*all_res))
        else:
            components = [components]
            all_res = [all_res]
        for component, res in zip(components, all_res):
            self.assemble_component(all_res, component)
            setattr(self, component, new_data)
        return self

    @action
    def convert_to_pil(self, components="images"):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: analysiscenter/batchflow
Commit Name: eba587e7549e252036f2500e9a3b3a18a778b335
Time: 2017-11-17
Author: rhudor@gmail.com
File Name: dataset/batch_image.py
Class Name: ImagesBatch
Method Name: assemble


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 89b43bbd55550d5c103a8b06281d9bc62e533680
Time: 2019-08-05
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAData/data_resample.py
Class Name:
Method Name: QA_data_min_resample


Project Name: huggingface/neuralcoref
Commit Name: c59f0d1b133fb0523c1137fe134586fe822f2720
Time: 2018-04-05
Author: thomwolf@gmail.com
File Name: neuralcoref/document.py
Class Name: Document
Method Name: add_utterances