e9a52a115be4970db2abdeb921ca0a790ed30809,app/server/views.py,ProjectDocsAPI,get_queryset,#ProjectDocsAPI#,156

Before Change



        project = get_object_or_404(Project, pk=project_id)
        isnull = self.request.query_params.get("is_checked") == "true"
        if project.is_type_of(Project.DOCUMENT_CLASSIFICATION):
            queryset = queryset.filter(doc_annotations__isnull=isnull).distinct()
        elif project.is_type_of(Project.SEQUENCE_LABELING):
            queryset = queryset.filter(seq_annotations__isnull=isnull).distinct()
        elif project.is_type_of(Project.Seq2seq):
            queryset = queryset.filter(seq2seq_annotations__isnull=isnull).distinct()
        else:
            queryset = queryset

        return queryset


class AnnotationsAPI(generics.ListCreateAPIView):

After Change



        project = get_object_or_404(Project, pk=project_id)
        is_null = self.request.query_params.get("is_checked") == "true"
        queryset = Factory.get_documents(project, is_null).distinct()

        return queryset

Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: chakki-works/doccano
Commit Name: e9a52a115be4970db2abdeb921ca0a790ed30809
Time: 2018-07-26
Author: hiroki.nakayama.py@gmail.com
File Name: app/server/views.py
Class Name: ProjectDocsAPI
Method Name: get_queryset


Project Name: chakki-works/doccano
Commit Name: 7406183a0c7ca72f202a0e8b6f132e90bdbf21c7
Time: 2018-08-02
Author: hiroki.nakayama.py@gmail.com
File Name: app/server/views.py
Class Name: DataDownloadAPI
Method Name: get


Project Name: AlexsLemonade/refinebio
Commit Name: 99d2d1aced54a9673b9e25b6c1f992acd20535e1
Time: 2019-08-16
Author: arielsvn@gmail.com
File Name: common/data_refinery_common/rna_seq.py
Class Name:
Method Name: should_run_tximport