List active courses in an account.

        Retrieve the list of courses in this account.
540758
def list_active_courses_in_account(self, account_id, by_subaccounts=None, by_teachers=None, completed=None, enrollment_term_id=None, enrollment_type=None, hide_enrollmentless_courses=None, include=None, published=None, search_term=None, state=None, with_enrollments=None):
        
        path = {}
        data = {}
        params = {}

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

        # OPTIONAL - with_enrollments
        """If true, include only courses with at least one enrollment.  If false,
        include only courses with no enrollments.  If not present, do not filter
        on course enrollment status."""
        if with_enrollments is not None:
            params["with_enrollments"] = with_enrollments

        # OPTIONAL - enrollment_type
        """If set, only return courses that have at least one user enrolled in
        in the course with one of the specified enrollment types."""
        if enrollment_type is not None:
            self._validate_enum(enrollment_type, ["teacher", "student", "ta", "observer", "designer"])
            params["enrollment_type"] = enrollment_type

        # OPTIONAL - published
        """If true, include only published courses.  If false, exclude published
        courses.  If not present, do not filter on published status."""
        if published is not None:
            params["published"] = published

        # OPTIONAL - completed
        """If true, include only completed courses (these may be in state
        'completed', or their enrollment term may have ended).  If false, exclude
        completed courses.  If not present, do not filter on completed status."""
        if completed is not None:
            params["completed"] = completed

        # OPTIONAL - by_teachers
        """List of User IDs of teachers; if supplied, include only courses taught by
        one of the referenced users."""
        if by_teachers is not None:
            params["by_teachers"] = by_teachers

        # OPTIONAL - by_subaccounts
        """List of Account IDs; if supplied, include only courses associated with one
        of the referenced subaccounts."""
        if by_subaccounts is not None:
            params["by_subaccounts"] = by_subaccounts

        # OPTIONAL - hide_enrollmentless_courses
        """If present, only return courses that have at least one enrollment.
        Equivalent to 'with_enrollments=true'; retained for compatibility."""
        if hide_enrollmentless_courses is not None:
            params["hide_enrollmentless_courses"] = hide_enrollmentless_courses

        # OPTIONAL - state
        """If set, only return courses that are in the given state(s). By default,
        all states but "deleted" are returned."""
        if state is not None:
            self._validate_enum(state, ["created", "claimed", "available", "completed", "deleted", "all"])
            params["state"] = state

        # OPTIONAL - enrollment_term_id
        """If set, only includes courses from the specified term."""
        if enrollment_term_id is not None:
            params["enrollment_term_id"] = enrollment_term_id

        # OPTIONAL - search_term
        """The partial course name, code, or full ID to match and return in the results list. Must be at least 3 characters."""
        if search_term is not None:
            params["search_term"] = search_term

        # OPTIONAL - include
        """- All explanations can be seen in the {api:CoursesController#index Course API index documentation}
        - "sections", "needs_grading_count" and "total_scores" are not valid options at the account level"""
        if include is not None:
            self._validate_enum(include, ["syllabus_body", "term", "course_progress", "storage_quota_used_mb", "total_students", "teachers"])
            params["include"] = include

        self.logger.debug("GET /api/v1/accounts/{account_id}/courses with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/accounts/{account_id}/courses".format(**path), data=data, params=params, all_pages=True)
144446
def accounts(self):
        
        if self._accounts is None:
            self._accounts = AccountList(self)
        return self._accounts
39787
def active_brokers(self):
        """"""
        return {
            broker
            for broker in self._brokers
            if not broker.inactive and not broker.decommissioned
        }
815243
def get_course(id, opts = {})
      data, _status_code, _headers = get_course_with_http_info(id, opts)
      return data
    end
1313639
def find_course_and_crosslistings(self, partial):
        
        course = self.find_course(partial)
        crosslisted = self.crosslisted_with(course.crn)
        return (course,) + tuple(map(self.find_course_by_crn, crosslisted))
1269424
def activities(self):
        
        if self._activities is None:
            self._activities = self._fetch_activities()
        return self._activities
321324
def count_courses(self):
        """"""
        c = 0
        for x in self.tuning:
            if type(x) == list:
                c += len(x)
            else:
                c += 1
        return float(c) / len(self.tuning)
958921
def tutor_courses(self):
        '''
            
        '''
        tutoring = self.user.courses_tutoring.all().filter(active__exact=True)
        owning = self.user.courses.all().filter(active__exact=True)
        result = (tutoring | owning).distinct()
        return result
313250
public List<Session> getSessionsByAccount(String account) {
        String url = WxEndpoint.get("url.care.session.list.byaccount");
        String response = wxClient.get(String.format(url, account));
        logger.debug("list care sessions by care account :{}", response);
        SessionList sessionList = JsonMapper.defaultMapper().fromJson(response, SessionList.class);
        return sessionList.getSessions();
    }
1124912
def get_all(cls, include_disabled=True):
        
        if cls == BaseAccount:
            raise InquisitorError('get_all on BaseAccount is not supported')

        account_type_id = db.AccountType.find_one(account_type=cls.account_type).account_type_id
        qry = db.Account.order_by(desc(Account.enabled), Account.account_type_id, Account.account_name)

        if not include_disabled:
            qry = qry.filter(Account.enabled == 1)

        accounts = qry.find(Account.account_type_id == account_type_id)

        return {res.account_id: cls(res) for res in accounts}
1253677
def list_assignments_for_user(self, user_id, course_id):
        
        path = {}
        data = {}
        params = {}

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

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

        self.logger.debug("GET /api/v1/users/{user_id}/courses/{course_id}/assignments with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("GET", "/api/v1/users/{user_id}/courses/{course_id}/assignments".format(**path), data=data, params=params, no_data=True)
889968
def get_session_list(self, account):
        
        res = self._get(
            'https://api.weixin.qq.com/customservice/kfsession/getsessionlist',
            params={'kf_account': account},
            result_processor=lambda x: x['sessionlist']
        )
        return res
853140
def daily(self):
        
        if self._daily is None:
            self._daily = DailyList(self._version, account_sid=self._solution['account_sid'], )
        return self._daily
650692
def get_sections_for_course(id, opts = {})
      data, _status_code, _headers = get_sections_for_course_with_http_info(id, opts)
      return data
    end
1045888
def list_quizzes_in_course(self, course_id, search_term=None):
        
        path = {}
        data = {}
        params = {}

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

        # OPTIONAL - search_term
        """The partial title of the quizzes to match and return."""
        if search_term is not None:
            params["search_term"] = search_term

        self.logger.debug("GET /api/v1/courses/{course_id}/quizzes 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".format(**path), data=data, params=params, all_pages=True)
469988
def get_for_accounts(self, accounts: List[Account]):
        '''  '''
        account_ids = [acc.guid for acc in accounts]
        query = (
            self.query
            .filter(Split.account_guid.in_(account_ids))
        )
        splits = query.all()
        return splits
357861
def get_active_terms_list():
        """"""

        active_terms_list = cache.get('tandc.active_terms_list')
        if active_terms_list is None:
            active_terms_list = TermsAndConditions.objects.filter(id__in=TermsAndConditions.get_active_terms_ids()).order_by('slug')
            cache.set('tandc.active_terms_list', active_terms_list, TERMS_CACHE_SECONDS)

        return active_terms_list