@utilities.arguments_not_none<EOL><INDENT>def get_gradebook_columns_by_query(self, gradebook_column_query):<DEDENT>
<EOL>and_list = list()<EOL>or_list = list()<EOL>for term in gradebook_column_query._query_terms:<EOL><INDENT>if '<STR_LIT>' in gradebook_column_query._query_terms[term] and '<STR_LIT>' in gradebook_column_query._query_terms[term]:<EOL><INDENT>and_list.append(<EOL>{'<STR_LIT>': [{term: {'<STR_LIT>': gradebook_column_query._query_terms[term]['<STR_LIT>']}},<EOL>{term: {'<STR_LIT>': gradebook_column_query._query_terms[term]['<STR_LIT>']}}]})<EOL><DEDENT>else:<EOL><INDENT>and_list.append({term: gradebook_column_query._query_terms[term]})<EOL><DEDENT><DEDENT>for term in gradebook_column_query._keyword_terms:<EOL><INDENT>or_list.append({term: gradebook_column_query._keyword_terms[term]})<EOL><DEDENT>if or_list:<EOL><INDENT>and_list.append({'<STR_LIT>': or_list})<EOL><DEDENT>view_filter = self._view_filter()<EOL>if view_filter:<EOL><INDENT>and_list.append(view_filter)<EOL><DEDENT>if and_list:<EOL><INDENT>query_terms = {'<STR_LIT>': and_list}<EOL>collection = JSONClientValidated('<STR_LIT>',<EOL>collection='<STR_LIT>',<EOL>runtime=self._runtime)<EOL>result = collection.find(query_terms).sort('<STR_LIT>', DESCENDING)<EOL><DEDENT>else:<EOL><INDENT>result = []<EOL><DEDENT>return objects.GradebookColumnList(result, runtime=self._runtime, proxy=self._proxy)<EOL>
Gets a list of gradebook columns matching the given query.

        arg:    gradebook_column_query
                (osid.grading.GradebookColumnQuery): the gradebook
                column query
        return: (osid.grading.GradebookColumnList) - the returned
                ``GradebookColumnList``
        raise:  NullArgument - ``gradebook_column_query`` is ``null``
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure
        raise:  Unsupported - ``gradebook_column_query`` is not of this
                service
        *compliance: mandatory -- This method must be implemented.*