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, )

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: 4

Non-data size: 3

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: deepfakes/faceswap
Commit Name: 4fdeb67fba6cfb2193f8ab37a654de434b56baa0
Time: 2019-11-29
Author: 36920800+torzdf@users.noreply.github.com
File Name: tools/lib_alignments/jobs_manual.py
Class Name: MouseHandler
Method Name: update_landmarks


Project Name: uuazed/numerapi
Commit Name: 80e4f15860b6b002f2dd3f420eaeff63e202eb2f
Time: 2017-11-18
Author: wolfgang@steitz.me
File Name: numerapi/numerapi.py
Class Name: NumerAPI
Method Name: upload_predictions


Project Name: studioml/studio
Commit Name: b8b8194113ff35865a3379287ef25e384bb8c3ef
Time: 2017-09-05
Author: peter.zhokhov@sentient.ai
File Name: studio/http_artifact_store.py
Class Name: HTTPArtifactStore
Method Name: _upload_file