Returns a restclients.GradeRoster for the passed Section model and
    instructor Person.
183443
def get_graderoster(section, instructor, requestor):
    
    label = GradeRoster(section=section,
                        instructor=instructor).graderoster_label()
    url = "{}/{}".format(graderoster_url, encode_section_label(label))
    headers = {"Accept": "text/xhtml",
               "Connection": "keep-alive",
               "X-UW-Act-as": requestor.uwnetid}

    response = SWS_GradeRoster_DAO().getURL(url, headers)

    if response.status != 200:
        root = etree.fromstring(response.data)
        msg = root.find(".//*[@class='status_description']").text.strip()
        raise DataFailureException(url, response.status, msg)

    return GradeRoster(data=etree.fromstring(response.data.strip()),
                       section=section,
                       instructor=instructor)
1156594
private static void getClassPathesFromClassLoader(URLClassLoader ucl, ArrayList<Resource> pathes) {
	ClassLoader pcl = ucl.getParent();
	// parent first
	if (pcl instanceof URLClassLoader) getClassPathesFromClassLoader((URLClassLoader) pcl, pathes);

	ResourceProvider frp = ResourcesImpl.getFileResourceProvider();
	// get all pathes
	URL[] urls = ucl.getURLs();
	for (int i = 0; i < urls.length; i++) {
	    Resource file = frp.getResource(urls[i].getPath());
	    if (file.exists()) pathes.add(ResourceUtil.getCanonicalResourceEL(file));
	}

    }
105830
def response_class(self, cls):
        
        s = self._clone()
        s._response_class = cls
        return s
122394
def _get_nested_class(self, nested_depth, relation_info):
        
        class NestedModelPermissionSerializer(ModelPermissionsSerializer):

            """ Default nested class for relation. """

            class Meta:
                model = relation_info.related_model
                depth = nested_depth - 1
                nested_context = self.context
                fields = '__all__'

        return NestedModelPermissionSerializer
115502
def get_joint_sections(section,
                       include_instructor_not_on_time_schedule=True):
    
    joint_sections = []

    for url in section.joint_section_urls:
        section = get_section_by_url(url,
                                     include_instructor_not_on_time_schedule)
        joint_sections.append(section)

    return joint_sections
449660
def get_class(cls, name_or_sl):
        """"""
        try:
            return cls.sl_map[int(name_or_sl)]

        except TypeError as e:
            raise TypeError("Bad name or sl: {} : {}".format(name_or_sl, e))
        except ValueError:
            try:
                return cls.class_map[name_or_sl.lower()]
            except (KeyError, ValueError):
                raise NotASummaryName("Value '{}' is not a valid summary level".format(name_or_sl))
143792
def get_teachers(self):
        """"""
        users = User.objects.filter(user_type="teacher")
        users = users.exclude(id__in=EXTRA)
        # Add possible exceptions handling here
        users = users | User.objects.filter(id__in=[31863, 32327, 32103, 33228])

        return users
559540
def _get_manager_class(self, register_callables=False):
        

        class _EvaluatorSyncManager(managers.BaseManager):
            """
            A custom BaseManager.
            Please see the documentation of `multiprocessing` for more
            information.
            """
            pass

        inqueue = queue.Queue()
        outqueue = queue.Queue()
        namespace = Namespace()

        if register_callables:
            _EvaluatorSyncManager.register(
                "get_inqueue",
                callable=lambda: inqueue,
                )
            _EvaluatorSyncManager.register(
                "get_outqueue",
                callable=lambda: outqueue,
                )
            _EvaluatorSyncManager.register(
                "get_state",
                callable=self._get_secondary_state,
                )
            _EvaluatorSyncManager.register(
                "set_state",
                callable=lambda v: self._secondary_state.set(v),
                )
            _EvaluatorSyncManager.register(
                "get_namespace",
                callable=lambda: namespace,
                )


        else:
            _EvaluatorSyncManager.register(
                "get_inqueue",
                )
            _EvaluatorSyncManager.register(
                "get_outqueue",
                )
            _EvaluatorSyncManager.register(
                "get_state",
                )
            _EvaluatorSyncManager.register(
                "set_state",
                )
            _EvaluatorSyncManager.register(
                "get_namespace",
                )
        return _EvaluatorSyncManager
963663
def get_queryset(self, request):
        ''' '''
        qs = super(SubmissionAdmin, self).get_queryset(request)
        if request.user.is_superuser:
            return qs
        else:
            return qs.filter(Q(assignment__course__tutors__pk=request.user.pk) | Q(assignment__course__owner=request.user)).distinct()
572904
def get_section_by_url(url,
                       include_instructor_not_on_time_schedule=True):
    
    if not course_url_pattern.match(url):
        raise InvalidSectionURL(url)

    return _json_to_section(
        get_resource(url),
        include_instructor_not_on_time_schedule=(
            include_instructor_not_on_time_schedule))
584420
def get_client_class(self, client_class_name):
        """"""
        request_url = self._build_url(['ClientClass', client_class_name])
        return self._do_request('GET', request_url)
1234907
def get_assessment_offered(self):
        
        # Implemented from template for osid.learning.Activity.get_objective
        if not bool(self._my_map['assessmentOfferedId']):
            raise errors.IllegalState('assessment_offered empty')
        mgr = self._get_provider_manager('ASSESSMENT')
        if not mgr.supports_assessment_offered_lookup():
            raise errors.OperationFailed('Assessment does not support AssessmentOffered lookup')
        lookup_session = mgr.get_assessment_offered_lookup_session(proxy=getattr(self, "_proxy", None))
        lookup_session.use_federated_bank_view()
        return lookup_session.get_assessment_offered(self.get_assessment_offered_id())
1108237
def get_assessment_section(section_id, runtime=None, proxy=None):
    """"""
    from .mixins import LoadedSection
    collection = JSONClientValidated('assessment',
                                     collection='AssessmentSection',
                                     runtime=runtime)
    result = collection.find_one(dict({'_id': ObjectId(section_id.get_identifier())}))
    return LoadedSection(osid_object_map=result, runtime=runtime, proxy=proxy)
360657
def error_class_for(status)
      case status
      when 400 then Esi::ApiBadRequestError
      when 401 then Esi::UnauthorizedError
      when 403 then Esi::ApiForbiddenError
      when 404 then Esi::ApiNotFoundError
      when 502 then Esi::TemporaryServerError
      when 503 then Esi::RateLimitError
      else Esi::ApiUnknownError
      end
    end
1205187
public ClientInterface getRestClient(){
		if(restClient == null) {
			synchronized (this) {
				if(restClient == null) {
					restClient = ElasticSearchHelper.getRestClientUtil();
				}
			}
		}
		return restClient;
	}
121775
def get_class_students(self, xqdm, kcdm, jxbh):
        
        return self.query(GetClassStudents(xqdm, kcdm, jxbh))
804621
def get_sections_for_teacher(id, opts = {})
      data, _status_code, _headers = get_sections_for_teacher_with_http_info(id, opts)
      return data
    end