def parent_subfolders(self, ident, ann_id=None):
        '''An unordered generator of parent subfolders for ``ident``.

        ``ident`` can either be a ``content_id`` or a tuple of
        ``(content_id, subtopic_id)``.

        Parent subfolders are limited to the annotator id given.

        :param ident: identifier
        :type ident: ``str`` or ``(str, str)``
        :param str ann_id: Username
        :rtype: generator of ``(folder_id, subfolder_id)``
        '''
        ann_id = self._annotator(ann_id)
        cid, _ = normalize_ident(ident)
        for lab in self.label_store.directly_connected(ident):
            folder_cid = lab.other(cid)
            subfolder_sid = lab.subtopic_for(folder_cid)
            if not folder_cid.startswith('topic|'):
                continue
            folder = self.unwrap_folder_content_id(folder_cid)
            subfolder = self.unwrap_subfolder_subtopic_id(subfolder_sid)
            if folder['annotator_id'] != ann_id:
                continue
            yield (folder['folder_id'], subfolder)
def parent_subfolders ( self , ident , ann_id = None ) : ann_id = self . _annotator ( ann_id ) cid , _ = normalize_ident ( ident ) for lab in self . label_store . directly_connected ( ident ) : folder_cid = lab . other ( cid ) subfolder_sid = lab . subtopic_for ( folder_cid ) if not folder_cid . startswith ( 'topic|' ) : continue folder = self . unwrap_folder_content_id ( folder_cid ) subfolder = self . unwrap_subfolder_subtopic_id ( subfolder_sid ) if folder [ 'annotator_id' ] != ann_id : continue yield ( folder [ 'folder_id' ] , subfolder )
An unordered generator of parent subfolders for ``ident``.

        ``ident`` can either be a ``content_id`` or a tuple of
        ``(content_id, subtopic_id)``.

        Parent subfolders are limited to the annotator id given.

        :param ident: identifier
        :type ident: ``str`` or ``(str, str)``
        :param str ann_id: Username
        :rtype: generator of ``(folder_id, subfolder_id)``