28935ea4d7796ada4ad387e79c4357b21c5b9ad6,app/grandchallenge/reader_studies/models.py,ReaderStudy,add_ground_truth,#ReaderStudy#,394

Before Change


                if key == "images":
                    continue
                question = self.questions.get(question_text=key)
                if question.answer_type == Question.ANSWER_TYPE_BOOL:
                    if gt[key] not in ["1", "0"]:
                        raise ValidationError(
                            "Expected 1 or 0 for answer type BOOL."
                        )
                    _answer = bool(int(gt[key]))
                else:
                    _answer = gt[key]
                Answer.validate(
                    creator=user,
                    question=question,
                    images=images,

After Change


                if key == "images":
                    continue
                question = self.questions.get(question_text=key)
                _answer = json.loads(gt[key])
                if question.answer_type == Question.ANSWER_TYPE_CHOICE:
                    try:
                        option = question.options.get(title=_answer)
                        _answer = option.pk
                    except CategoricalOption.DoesNotExist:
                        raise ValidationError(
                            f"Option "{_answer}" is not valid for question {question.question_text}"
                        )
                if (
                    question.answer_type
                    == Question.ANSWER_TYPE_MULTIPLE_CHOICE
                ):
                    _answer = list(
                        question.options.filter(title__in=_answer).values_list(
                            "pk", flat=True
                        )
                    )
                Answer.validate(
                    creator=user,
                    question=question,
                    images=images,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: comic/grand-challenge.org
Commit Name: 28935ea4d7796ada4ad387e79c4357b21c5b9ad6
Time: 2020-03-26
Author: 57257130+MikeOverkamp-diag@users.noreply.github.com
File Name: app/grandchallenge/reader_studies/models.py
Class Name: ReaderStudy
Method Name: add_ground_truth


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: af164f572888a7ebdd2e6d297f6e35d98d598e53
Time: 2021-03-15
Author: tohaowu@google.com
File Name: perfkitbenchmarker/providers/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: UpdateInterruptibleVmStatus


Project Name: ray-project/ray
Commit Name: 92c2e41dfdb30756a5872578b38b34cd34722d76
Time: 2020-05-24
Author: dooku.wt@antfin.com
File Name: python/ray/state.py
Class Name: GlobalState
Method Name: profile_table


Project Name: QUANTAXIS/QUANTAXIS
Commit Name: 3c857b194b02141ea0fb79a178c4229433430354
Time: 2017-05-08
Author: yutiansut@qq.com
File Name: QUANTAXIS/QAFetch/QATushare.py
Class Name:
Method Name: QA_fetch_get_stock_info