f863a6804ba1f46c3f216c6ba75b642b9b61ad17,lore/pipelines/holdout.py,Base,encode_x,#Base#Any#,140

Before Change


        encoded = OrderedDict()
        for encoder in self.encoders:
            transformed = encoder.transform(self.read_column(data, encoder.source_column))
            if hasattr(encoder, "sequence_length"):
                for i in range(encoder.sequence_length):
                    encoded[encoder.sequence_name(i)] = transformed.iloc[:, i]
            else:
                encoded[encoder.name] = transformed
        
        for column in self.index:
            encoded[column] = self.read_column(data, column)
        
        // Using a DataFrame as a container temporarily requires double the memory,

After Change


        encoded = OrderedDict()
        if self.multiprocessing:
            pool = multiprocessing.Pool(self.workers)
            results = []
            for encoder in self.encoders:
                results.append((encoder, pool.apply_async(self.transform, (encoder, data))))

            for encoder, result in results:
                self.merged_transformed(encoded, encoder, result.get())
    
        else:
            for encoder in self.encoders:
                self.merged_transformed(encoded, encoder, self.transform(encoder, data))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 6

Instances


Project Name: instacart/lore
Commit Name: f863a6804ba1f46c3f216c6ba75b642b9b61ad17
Time: 2018-02-01
Author: montanalow@users.noreply.github.com
File Name: lore/pipelines/holdout.py
Class Name: Base
Method Name: encode_x


Project Name: jazzband/django-debug-toolbar
Commit Name: ad110e020cbae062ba024d91223df519af3adc96
Time: 2011-07-12
Author: dcramer@gmail.com
File Name: debug_toolbar/panels/template.py
Class Name: TemplateDebugPanel
Method Name: content


Project Name: allenai/allennlp
Commit Name: adeb1b1278619ff2d74d4fd82825e50a36f95ff4
Time: 2020-03-27
Author: dirkg@allenai.org
File Name: allennlp/data/token_indexers/pretrained_transformer_indexer.py
Class Name: PretrainedTransformerIndexer
Method Name: _add_encoding_to_vocabulary_if_needed


Project Name: jsalt18-sentence-repl/jiant
Commit Name: 1cc985368e1cd5909fbea41335ef80230a5042cb
Time: 2018-06-17
Author: wang.alex.c@gmail.com
File Name: src/preprocess.py
Class Name:
Method Name: process_task


Project Name: MTG/freesound
Commit Name: 79dadfb89e9fb05d0361fcbe3e3b4604905a2955
Time: 2019-09-04
Author: frederic.font@upf.edu
File Name: sounds/templatetags/display_pack.py
Class Name:
Method Name: display_pack