719f9dcc37a8b4ffacdeb89f091349048aef8732,app/grandchallenge/algorithms/models.py,Job,create_result,#Job#,442

Before Change


    def create_result(self, *, result: dict):
        instance, _ = Result.objects.get_or_create(job_id=self.pk)
        instance.output = result
        instance.save()

    def get_absolute_url(self):
        return reverse("algorithms:jobs-detail", kwargs={"pk": self.pk})

After Change


            output_civ.value = result
            output_civ.save()
        except ObjectDoesNotExist:
            output_civ = ComponentInterfaceValue.objects.create(
                interface=interface, value=result
            )
            self.outputs.add(output_civ)

    def get_absolute_url(self):
        return reverse("algorithms:jobs-detail", kwargs={"pk": self.pk})
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: comic/grand-challenge.org
Commit Name: 719f9dcc37a8b4ffacdeb89f091349048aef8732
Time: 2020-06-25
Author: 12661555+jmsmkn@users.noreply.github.com
File Name: app/grandchallenge/algorithms/models.py
Class Name: Job
Method Name: create_result


Project Name: comic/grand-challenge.org
Commit Name: 73311d5d4822186f493eb6775cd619b1c57303f1
Time: 2020-10-02
Author: 12661555+jmsmkn@users.noreply.github.com
File Name: app/grandchallenge/serving/tasks.py
Class Name:
Method Name: create_download


Project Name: matthewwithanm/django-imagekit
Commit Name: a6ef72027be6a6fb62b41acaed0340a8d8d91830
Time: 2013-05-24
Author: m@tthewwithanm.com
File Name: tests/test_sourcegroups.py
Class Name:
Method Name: test_abstract_model_signals


Project Name: okfn-brasil/serenata-de-amor
Commit Name: a9346cb8b8282272b8e9237fbe72955fba3d1bb2
Time: 2017-07-06
Author: cuducos@users.noreply.github.com
File Name: jarbas/core/management/commands/tweets.py
Class Name: Command
Method Name: save_tweet