Retrieves course wide transcript preferences

    Arguments:
        course_id (str): course id
766764
def get_transcript_preferences(course_id):
    
    try:
        transcript_preference = TranscriptPreference.objects.get(course_id=course_id)
    except TranscriptPreference.DoesNotExist:
        return

    return TranscriptPreferenceSerializer(transcript_preference).data
1275358
def rate_entry_courses(self, topic_id, entry_id, course_id, rating=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - topic_id
        """ID"""
        path["topic_id"] = topic_id

        # REQUIRED - PATH - entry_id
        """ID"""
        path["entry_id"] = entry_id

        # OPTIONAL - rating
        """A rating to set on this entry. Only 0 and 1 are accepted."""
        if rating is not None:
            data["rating"] = rating

        self.logger.debug("POST /api/v1/courses/{course_id}/discussion_topics/{topic_id}/entries/{entry_id}/rating with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/courses/{course_id}/discussion_topics/{topic_id}/entries/{entry_id}/rating".format(**path), data=data, params=params, no_data=True)
973191
def get_question(self):
        
        question_map = dict(self._my_map['question'])
        question_map['learningObjectiveIds'] = self._my_map['learningObjectiveIds']
        return Question(osid_object_map=question_map,
                        runtime=self._runtime,
                        proxy=self._proxy)
1204578
def show_page_courses(self, url, course_id):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - url
        """ID"""
        path["url"] = url

        self.logger.debug("GET /api/v1/courses/{course_id}/pages/{url} with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/pages/{url}".format(**path), data=data, params=params, single_item=True)
299631
def relevant_transcripts(self, var_g):
        """"""
        tx = self.hdp.get_tx_for_region(var_g.ac, self.alt_aln_method, var_g.posedit.pos.start.base,
                                        var_g.posedit.pos.end.base)
        return [e["tx_ac"] for e in tx]
325631
def get_courses(self):
        
        log.info("Listing Courses...")
        courses = json.loads(self._get('/api/courses').text)["courses"]
        courses = [Course.from_response(course) for course in courses]
        log.debug("Courses: %s" % [str(entry) for entry in courses])
        return courses
633001
def user_courses(self):
        '''
            
        '''
        registered = self.courses.filter(active__exact=True).distinct()
        return (self.tutor_courses() | registered).distinct()
1019795
def retrieve_all_quiz_reports(self, quiz_id, course_id, includes_all_versions=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - course_id
        """ID"""
        path["course_id"] = course_id

        # REQUIRED - PATH - quiz_id
        """ID"""
        path["quiz_id"] = quiz_id

        # OPTIONAL - includes_all_versions
        """Whether to retrieve reports that consider all the submissions or only
        the most recent. Defaults to false, ignored for item_analysis reports."""
        if includes_all_versions is not None:
            params["includes_all_versions"] = includes_all_versions

        self.logger.debug("GET /api/v1/courses/{course_id}/quizzes/{quiz_id}/reports with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/courses/{course_id}/quizzes/{quiz_id}/reports".format(**path), data=data, params=params, all_pages=True)
915071
def list_courses(self):
        
        reply = get_page(self._session, OPENCOURSE_MEMBERSHIPS, json=True)
        course_list = reply['linked']['courses.v1']
        slugs = [element['slug'] for element in course_list]
        return slugs
1192627
function getPreference(id) {
    var callback = preConditions.getCallback(arguments[arguments.length - 1]);

    showWarning();

    return preferencesModule.get(id, callback);
  }
1016995
def get_cds_ranges_for_transcript(self, transcript_id):
        
        
        headers = {"content-type": "application/json"}
        
        self.attempt = 0
        ext = "/overlap/id/{}?feature=cds".format(transcript_id)
        r = self.ensembl_request(ext, headers)
        
        cds_ranges = []
        for cds_range in json.loads(r):
            if cds_range["Parent"] != transcript_id:
                continue
            
            start = cds_range["start"]
            end = cds_range["end"]
            
            cds_ranges.append((start, end))
        
        return cds_ranges
79194
public function get_course($courseid) {
        global $DB;
        if (!array_key_exists($courseid, $this->courses)) {
            $ctxquery = context_helper::get_preload_record_columns_sql('ctx');
            $sql = "SELECT c.id,c.visible,c.fullname,c.shortname,c.cacherev, $ctxquery
            FROM {course} c JOIN {context} ctx ON ctx.contextlevel = ? AND ctx.instanceid=c.id
            WHERE c.id = ?";
            $params = array(CONTEXT_COURSE, $courseid);
            $this->courses[$courseid] = $DB->get_record_sql($sql, $params);
            context_helper::preload_from_record($this->courses[$courseid]);
        }
        return $this->courses[$courseid];
    }
1263822
def myfoo(i,s, course=['s'],gg=2,fdf=3,**d):
    
    print ('data:',d)
    if course:
        print (course)
        return course.get('id')
    else:
        print("No Course!")
        return None
137677
def details(self):
        
        params = {'wsfunction': 'core_course_get_categories',
                  'criteria[0][key]': 'id',
                  'criteria[0][value]': self.category_id}

        params.update(self.request_params)

        return requests.post(self.api_url, params=params, verify=False)
560514
def get_enrollment_history_by_regid(regid,
                                    verbose='true',
                                    transcriptable_course='all',
                                    changed_since_date='',
                                    include_unfinished_pce_course_reg=False):
    
    return _json_to_enrollment_list(
        _enrollment_search(regid, verbose, transcriptable_course,
                           changed_since_date),
        include_unfinished_pce_course_reg)
405576
def enrollment_search_by_regid(regid,
                               verbose='true',
                               transcriptable_course='all',
                               changed_since_date='',
                               include_unfinished_pce_course_reg=True):
    
    return _json_to_term_enrollment_dict(
        _enrollment_search(regid, verbose, transcriptable_course,
                           changed_since_date),
        include_unfinished_pce_course_reg)
1264167
def get_course_list_name(curriculum_abbr, course_number, section_id,
                         quarter, year):
    
    return "%s%s%s_%s%s" % (
        _get_list_name_curr_abbr(curriculum_abbr),
        course_number,
        section_id.lower(),
        quarter.lower()[:2],
        str(year)[-2:]
        )