b8ce0940159022a61a2709e615dade45b53f97ef,sbin/db_mgmt_ref.py,VIADownloads,process_item,#VIADownloads#Any#,73

Before Change



        entry_dict = {}

        for key, val in item.items():
            entry_dict = {"id": key}
            entry_dict.update(val)

        if self.is_update:
            return UpdateOne({"id": key}, {"$set": entry_dict}, upsert=True, )
        else:
            return InsertOne(entry_dict)

After Change


    def process_item(self, item):

        if self.is_update:
            self.queue.put(
                DatabaseAction(
                    action=DatabaseAction.actions.UpdateOne,
                    collection=self.feed_type.lower(),
                    doc=item,
                )
            )
        else:
            self.queue.put(
                DatabaseAction(
                    action=DatabaseAction.actions.InsertOne,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: cve-search/cve-search
Commit Name: b8ce0940159022a61a2709e615dade45b53f97ef
Time: 2020-08-17
Author: paul.tikken@gmail.com
File Name: sbin/db_mgmt_ref.py
Class Name: VIADownloads
Method Name: process_item


Project Name: jantic/DeOldify
Commit Name: 20af68f395798d10da3aedcfb76ba7692f94b0e9
Time: 2019-01-23
Author: jsa169@gmail.com
File Name: fasterai/tensorboard.py
Class Name: ModelHistogramVisualizer
Method Name: write_tensorboard_histograms


Project Name: stratosphereips/StratosphereLinuxIPS
Commit Name: bfff0cb09ae56b722c03f014337346c3a095abea
Time: 2019-04-02
Author: eldraco@gmail.com
File Name: slips.py
Class Name:
Method Name: