List of subject areas of article.
        Note: Requires the FULL view of the article.
974781
def subjectAreas(self):
        
        subjectAreas = self.xml.find('subject-areas', ns)
        try:
            return [a.text for a in subjectAreas]
        except:
            return None
997598
protected function LoadArticleList()
    {
        if (is_null($this->oList)) {
            parent::LoadArticleList();
            if (!is_null($this->oList) && '1' == $this->global->GetUserData(TdbPkgShopListfilter::URL_PARAMETER_IS_NEW_REQUEST)) {
                TdbShop::ResetAllRegisteredActiveVariantsForAllSpots();
                $this->iPage = 0;
                $this->oList->RestorePagingInfoFromSession($this->iPageSize * $this->iPage, $this->iPageSize);
                $this->oList->JumpToPage(0);
            }
        }
    }
861233
def comments(self, article):
        
        return self._query_zendesk(self.endpoint.comments, object_type='comment', id=article)
614636
def get_requires():
    """"""
    requirements = open("requirements.txt", "r").read()
    return list(filter(lambda x: x != "", requirements.split()))
444031
public function getArticleList()
    {
        if ($this->_oActRecommListArticles === null) {
            $this->_oActRecommListArticles = false;

            if (($oRecommList = $this->getActiveRecommList())) {
                $oItemList = $oRecommList->getArticles();

                if ($oItemList->count()) {
                    foreach ($oItemList as $key => $oItem) {
                        if (!$oItem->isVisible()) {
                            $oRecommList->removeArticle($oItem->getId());
                            $oItemList->offsetUnset($key);
                            continue;
                        }

                        $oItem->text = $oRecommList->getArtDescription($oItem->getId());
                    }
                    $this->_oActRecommListArticles = $oItemList;
                }
            }
        }

        return $this->_oActRecommListArticles;
    }
150432
def contents(self):
        """"""
        if not self._source:
            return ' ' * 100  # HACK - make sure that area is big
        contents = self.source.describe()
        return pretty_describe(contents)
1005757
def description(cls):
        """"""
        lines = [s.strip() for s in cls.__doc__.splitlines()]
        note_i = lines.index("Notes")
        return "\n".join(lines[note_i + 2:])
720381
function walkArticles(articles, fn) {
    return Promise.forEach(articles, function(article) {
        return Promise(fn(article))
        .then(function() {
            return walkArticles(article.getArticles(), fn);
        });
    });
}
1318468
def list(self, request, *args, **kwargs):
        """"""
        search_kwargs = {"published": False}

        query_params = get_query_params(self.request)

        for field_name in ("status"):
            if field_name in query_params:
                search_kwargs[field_name] = query_params.get(field_name)

        if "search" in query_params:
            search_kwargs["query"] = query_params.get("search")

        # active/closed are semantics of the Poll model
        # active is analagous to 'published' in Content
        # closed is in relation to the end_date of a Poll
        if "active" in query_params:
            del search_kwargs["published"]
            search_kwargs["active"] = True

        if "closed" in query_params:
            del search_kwargs["published"]
            search_kwargs["closed"] = True

        queryset = self.model.search_objects.search(**search_kwargs)

        page = self.paginate_queryset(queryset)
        if page is not None:
            serializer = self.get_serializer(page, many=True)
            return self.get_paginated_response(serializer.data)

        serializer = self.get_serializer(queryset, many=True)
        return Response(serializer.data)
133440
def extract(self, item):
        

        article_candidates = []

        for extractor in self.extractor_list:
            article_candidates.append(extractor.extract(item))

        article_candidates = self.cleaner.clean(article_candidates)
        article = self.comparer.compare(item, article_candidates)

        item['article_title'] = article.title
        item['article_description'] = article.description
        item['article_text'] = article.text
        item['article_image'] = article.topimage
        item['article_author'] = article.author
        item['article_publish_date'] = article.publish_date
        item['article_language'] = article.language

        return item
471148
def index(self):
        
        self.subjects = list(self.association_map.keys())

        # ensure annotations unique
        for (subj,terms) in self.association_map.items():
            self.association_map[subj] = list(set(self.association_map[subj]))
            
        logging.info("Indexing {} items".format(len(self.subjects)))
        n = 0
        all_objs = set()
        for (subj,terms) in self.association_map.items():
            ancs = self.termset_ancestors(terms)
            all_objs.update(ancs)
            self.subject_to_inferred_map[subj] = ancs
            n = n+1
            if n<5:
                logging.info(" Indexed: {} -> {}".format(subj, ancs))
            elif n == 6:
                logging.info("[TRUNCATING>5]....")
        self.objects = all_objs
139391
def requirements(filename):
    """"""
    with open(filename) as f:
        return [x.strip() for x in f.readlines() if x.strip()]
395397
def load_child_articles_for_section(
        context, section, featured_in_section=None, count=5):
    
    request = context.get('request')
    locale = context.get('locale_code')
    main_language_page = section.get_main_language_page()
    settings = SiteSettings.for_site(request.site) \
        if request else None

    # TODO: Consider caching the pks of these articles using a timestamp on
    # section as the key so tha twe don't always do these joins
    article_ordering = settings and settings.article_ordering_within_section
    order_by = ArticleOrderingChoices.\
        get(settings.article_ordering_within_section).name.lower() \
        if article_ordering \
        and settings.article_ordering_within_section !=\
        ArticleOrderingChoices.CMS_DEFAULT_SORTING\
        else '-first_published_at'

    order_by = order_by if order_by.find('_desc') == -1 \
        else '-{}'.format(order_by.replace('_desc', ''))

    child_articles = ArticlePage.objects.child_of(
        main_language_page).filter(
        language__is_main_language=True).order_by(order_by)

    if featured_in_section is not None:
        child_articles = child_articles.filter(
            featured_in_section=featured_in_section)\
            .order_by('-featured_in_section_start_date')

    related_articles = ArticlePage.objects.filter(
        related_sections__section__slug=main_language_page.slug)
    qs = list(chain(
        get_pages(context, child_articles, locale),
        get_pages(context, related_articles, locale)))

    # Pagination
    if count:
        p = context.get('p', 1)
        paginator = Paginator(qs, count)

        try:
            articles = paginator.page(p)
        except PageNotAnInteger:
            articles = paginator.page(1)
        except EmptyPage:
            articles = paginator.page(paginator.num_pages)
    else:
        articles = qs
    if not locale:
        return articles

    context.update({'articles_paginated': articles})
    return articles
792905
def topics(self):
        
        return set(node.tag for node in self.root.iter() if node.attrib)
1049145
def subject(self):
        """"""
        return Subject([(s.oid, s.value) for s in self.x509.subject])
1343171
def _encode_wiki_sections(sections, vocab):
  """"""
  ids = []
  section_boundaries = []
  for i, section in enumerate(sections):
    if i > 0:
      # Skip including article title
      ids.extend(vocab.encode(_format_title(_normalize_text(section.title))))
    ids.extend(vocab.encode(_normalize_text(section.text)))
    section_boundaries.append(len(ids))

  return ids, section_boundaries
135687
def complete_use(self, text, *_):
        
        return [t + " " for t in REGIONS if t.startswith(text)]