Applied pylint-amnesty
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# lint-amnesty, pylint: disable=missing-module-docstring
|
||||
import logging
|
||||
import time
|
||||
|
||||
@@ -128,7 +129,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
|
||||
return Response(response)
|
||||
|
||||
def _required_course_depth(self, request, all_requested):
|
||||
def _required_course_depth(self, request, all_requested): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
if get_bool_param(request, 'units', all_requested):
|
||||
# The num_blocks metric for "units" requires retrieving all blocks in the graph.
|
||||
return None
|
||||
@@ -151,7 +152,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
highlights_enabled=highlights_setting.is_enabled(),
|
||||
)
|
||||
|
||||
def _subsections_quality(self, course, request):
|
||||
def _subsections_quality(self, course, request): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
subsection_unit_dict = self._get_subsections_and_units(course, request)
|
||||
num_block_types_per_subsection_dict = {}
|
||||
for subsection_key, unit_dict in six.iteritems(subsection_unit_dict):
|
||||
@@ -167,7 +168,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
num_block_types=self._stats_dict(list(six.itervalues(num_block_types_per_subsection_dict))),
|
||||
)
|
||||
|
||||
def _units_quality(self, course, request):
|
||||
def _units_quality(self, course, request): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
subsection_unit_dict = self._get_subsections_and_units(course, request)
|
||||
num_leaf_blocks_per_unit = [
|
||||
unit_info['num_leaf_blocks']
|
||||
@@ -179,7 +180,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
num_blocks=self._stats_dict(num_leaf_blocks_per_unit),
|
||||
)
|
||||
|
||||
def _videos_quality(self, course):
|
||||
def _videos_quality(self, course): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
video_blocks_in_course = modulestore().get_items(course.id, qualifiers={'category': 'video'})
|
||||
videos, __ = get_videos_for_course(course.id)
|
||||
videos_in_val = list(videos)
|
||||
@@ -227,7 +228,7 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
return cls._get_all_children(course)
|
||||
|
||||
@classmethod
|
||||
def _get_all_children(cls, parent):
|
||||
def _get_all_children(cls, parent): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
store = modulestore()
|
||||
children = [store.get_item(child_usage_key) for child_usage_key in cls._get_children(parent)]
|
||||
visible_children = [
|
||||
@@ -242,14 +243,14 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
return visible_chidren
|
||||
|
||||
@classmethod
|
||||
def _get_children(cls, parent):
|
||||
def _get_children(cls, parent): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
if not hasattr(parent, 'children'):
|
||||
return []
|
||||
else:
|
||||
return parent.children
|
||||
|
||||
@classmethod
|
||||
def _get_leaf_blocks(cls, unit):
|
||||
def _get_leaf_blocks(cls, unit): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
def leaf_filter(block):
|
||||
return (
|
||||
block.location.block_type not in ('chapter', 'sequential', 'vertical') and
|
||||
@@ -257,11 +258,11 @@ class CourseQualityView(DeveloperErrorViewMixin, GenericAPIView):
|
||||
)
|
||||
|
||||
return [
|
||||
block for block in
|
||||
block for block in # lint-amnesty, pylint: disable=unnecessary-comprehension
|
||||
traverse_pre_order(unit, cls._get_visible_children, leaf_filter)
|
||||
]
|
||||
|
||||
def _stats_dict(self, data):
|
||||
def _stats_dict(self, data): # lint-amnesty, pylint: disable=missing-function-docstring
|
||||
if not data:
|
||||
return dict(
|
||||
min=None,
|
||||
|
||||
Reference in New Issue
Block a user