Return all subjects (tags) in the database except "internal" scheme.
3116
def _get_subject_list_generator(cursor):
    """"""
    subject = None
    last_tagid = None
    cursor.execute(SQL['get-subject-list'])
    for s in cursor.fetchall():
        tagid, tagname, portal_type, count = s

        if tagid != last_tagid:
            # It's a new subject, create a new dict and initialize count
            if subject:
                yield subject
            subject = {'id': tagid,
                       'name': tagname,
                       'count': {'module': 0, 'collection': 0}, }
            last_tagid = tagid

        if tagid == last_tagid and portal_type:
            # Just need to update the count
            subject['count'][portal_type.lower()] = count

    if subject:
        yield subject
792905
def topics(self):
        
        return set(node.tag for node in self.root.iter() if node.attrib)
1368848
def tags( self ):
        
        item  = self.item(self.count() - 1)
        count = self.count()
        if ( item is self._createItem ):
            count -= 1
        
        return [nativestring(self.item(row).text()) for row in range(count)]
1132735
def filter(self, table, users, filter_string):
        """"""
        q = filter_string.lower()
        return [user for user in users
                if (q in user.name.lower() or
                    q in (getattr(user, 'email', None) or '').lower())]
122876
def _filter_schemas(schemas, schema_tables, exclude_table_columns):
    """"""
    return [_filter_schema(s, schema_tables, exclude_table_columns)
            for s in schemas]
987022
def get_for_queryset(self, obj_queryset):
        """"""
        qs = Tag.objects.language(get_language())
        if obj_queryset.count() == 0:
            return qs.none()
        qs = qs.filter(
            tagged_items__object_id__in=[
                obj.id for obj in obj_queryset],
            tagged_items__content_type=ctype_models.ContentType.objects.get_for_model(obj_queryset[0]))  # NOQA
        return qs.distinct()
338389
def entities(self, subject_id):
        
        try:
            return [i["entity_id"] for i in self._cache.find({"subject_id":
                    subject_id})]
        except ValueError:
            return []
950981
def get_effective_tags(self):
        """"""
        tags = self.patroni.tags.copy()
        # _disable_sync could be modified concurrently, but we don't care as attribute get and set are atomic.
        if self._disable_sync > 0:
            tags['nosync'] = True
        return tags
549882
def tables(subjects=None,
           pastDays=None,
           include_inactive=False,
           lang=DEFAULT_LANGUAGE):
    
    request = Request('tables',
                      subjects=subjects,
                      pastDays=pastDays,
                      includeInactive=include_inactive,
                      lang=lang)

    return (Table(table, lang=lang) for table in request.json)
841515
def filtered_entries(self):
        """"""
        return [
            e for e in self.entries if not any(fnmatch.fnmatch(e.name.lower(), p.lower()) for p in self.exclude_list)
        ]
61888
def get_tags(self):
        
        # Lazily load info
        if self.info is None:
            self.get_info()

        if 'tags' in self.info:
            return [structure['tag']['tag'] for structure in self.info['tags']]
        else:
            return []
575552
def filter(self, table, security_groups, filter_string):
        """"""
        query = filter_string.lower()
        return [security_group for security_group in security_groups
                if query in security_group.name.lower()]
851615
def default_entities(self):
        """"""
        return [str(i) for i in range(self.rows + self.columns)]
337229
def _filter_candidates(self, tokens, candidates):
        """"""
        results = []
        for abbr_span, long_span in candidates:
            abbr = tokens[abbr_span[0]:abbr_span[1]]
            long = tokens[long_span[0]:long_span[1]]
            if not all(a in long for a in abbr) and len(''.join(long)) > len(''.join(abbr)):
                results.append((abbr_span, long_span))
        return results
182489
def filtered(self):
        """"""
        if not is_tagged(self.tags, self.opt.tags):
            LOG.info("Skipping %s as it does not have requested tags",
                     self.path)
            return False

        if not specific_path_check(self.path, self.opt):
            LOG.info("Skipping %s as it does not match specified paths",
                     self.path)
            return False

        return True
383596
def get_tags(self, only_autocomplete = False):
        """"""
        return self._to_dict(('id', 'name', 'autocomplete'), self.conn.GetTags(only_autocomplete))
93084
def subjects(self):
        

        for sms in SetMemberSubject.where(subject_set_id=self.id):
            yield sms.links.subject