code: def _get_videos_for_filter(video_filter, sort_field=None, sort_dir=SortDirection.asc, pagination_conf=None):
      videos = Video.objects.filter(**video_filter)
      paginator_context = {}
      if sort_field:
          videos = videos.order_by(sort_field.value, "edx_video_id")
          if sort_dir == SortDirection.desc:
              videos = videos.reverse()
      if pagination_conf:
          videos_per_page = pagination_conf.get('videos_per_page')
          paginator = Paginator(videos, videos_per_page)
          videos = paginator.page(pagination_conf.get('page_number'))
          paginator_context = {
              'current_page':   videos.number,
              'total_pages': videos.paginator.num_pages,
              'items_on_one_page':videos_per_page
          }
      return (VideoSerializer(video).data for video in videos), paginator_context