return the text of specific (identified by attribute "id") label tag
 For page containing
     <label id="preferred_ide">TestWise</label>
 label_with_id("preferred_ids") # => TestWise
 label_with_id("preferred_ids", :index => 2) # => TestWise
161232
def label_with_id(label_id, options = {})
      if options && options[:index] then
        label(:id => label_id.to_s, :index => options[:index]).text
      else
        label(:id, label_id.to_s).text
      end
    end
288629
def detect_tag(filename):
    
    with fileutil.opened(filename, "rb") as file:
        file.seek(0)
        header = file.read(10)
        file.seek(0)
        if len(header) < 10:
            raise NoTagError("File too short")
        if header[0:3] != b"ID3":
            raise NoTagError("ID3v2 tag not found")
        if header[3] not in _tag_versions or header[4] != 0:
            raise TagError("Unknown ID3 version: 2.{0}.{1}"
                           .format(*header[3:5]))
        cls = _tag_versions[header[3]]
        offset = 0
        length = Syncsafe.decode(header[6:10]) + 10
        if header[3] == 4 and header[5] & _TAG24_FOOTER:
            length += 10
        return (cls, offset, length)
1230825
def get_labels(term_ids: list) -> dict:
    
    term_labels = {}
    for term_id in term_ids:
        term = get_terms(term_id)
        term_labels[term_id] = term[0].get("label", "")

    return term_labels
185366
def get_name_and_value(self, label_type):
        
        if label_type in self._label_values:
            return self._label_values[label_type]
        else:
            return (label_type, self._df_labels[label_type])
453689
def label_to_original_label_otu_by_id(otu_by_id):
    
    for val in otu_by_id.values():
        orig = val.get('^ot:originalLabel')
        if orig is None:
            label = val.get('@label')
            if label:
                del val['@label']
                val['^ot:originalLabel'] = label
1164472
def tag(value):
    
    rdict = load_feedback()
    tests = rdict.setdefault("tests", {})
    tests["*auto-tag-" + str(hash(str(value)))] = str(value)
    save_feedback(rdict)
28671
private LabelId getNextId() {
        TypeImpl<?, ?> metaConcept = (TypeImpl<?, ?>) getMetaConcept();
        Integer currentValue = metaConcept.vertex().property(Schema.VertexProperty.CURRENT_LABEL_ID);
        if (currentValue == null) {
            currentValue = Schema.MetaSchema.values().length + 1;
        } else {
            currentValue = currentValue + 1;
        }
        //Vertex is used directly here to bypass meta type mutation check
        metaConcept.property(Schema.VertexProperty.CURRENT_LABEL_ID, currentValue);
        return LabelId.of(currentValue);
    }
464002
private JLabel getFoundCountValueLabel() {
		if (foundCountValueLabel == null) {
			foundCountValueLabel = new JLabel();
			foundCountValueLabel.setText(ZERO_REQUESTS_LABEL_TEXT);
		}
		return foundCountValueLabel;
	}
17907
def get_state_identifier_for_page(self, page):
        
        for identifier, page_info in list(self.tabs.items()):
            if page_info["page"] is page:  # reference comparison on purpose
                return identifier
932365
def tag2id(self, xs):
        
        if isinstance(xs, list):
            return [self._tag2id.get(x, self.UNK) for x in xs]
        return self._tag2id.get(xs, self.UNK)
502069
def __query_with_label(cat_id_arr, label=None, num=8, kind='1'):
        '''
        
        '''
        return TabPost.select().join(
            TabPost2Tag,
            on=(TabPost.uid == TabPost2Tag.post_id)
        ).where(
            (TabPost.kind == kind) &
            (TabPost2Tag.tag_id << cat_id_arr) &  # the "<<" operator signifies an "IN" query
            (TabPost.extinfo['def_tag_arr'].contains(label))
        ).order_by(
            TabPost.time_create.desc()
        ).limit(num)
1257078
def get_id_by_name(tag_name, kind='z'):
        '''
        
        '''
        recs = TabTag.select().where(
            (TabTag.name == tag_name) & (TabTag.kind == kind)
        )
        logger.info('tag count of {0}: {1} '.format(tag_name, recs.count()))
        # the_id = ''
        if recs.count() == 1:
            the_id = recs.get().uid
        elif recs.count() > 1:
            rec0 = None
            for rec in recs:
                # Only keep one.
                if rec0:
                    TabPost2Tag.delete().where(TabPost2Tag.tag_id == rec.uid).execute()
                    TabTag.delete().where(TabTag.uid == rec.uid).execute()
                else:
                    rec0 = rec

            the_id = rec0.uid
        else:
            the_id = MLabel.create_tag(tag_name)
        return the_id
377784
def _get_label(self, urn):
        
        node = self.resolver.getTextualNode(textId=urn)
        r = render_template(
            "cts/GetLabel.xml",
            request_urn=str(urn),
            full_urn=node.urn,
            metadata={
                "groupname": [(literal.language, str(literal)) for literal in node.metadata.get(RDF_NAMESPACES.CTS.groupname)],
                "title": [(literal.language, str(literal)) for literal in node.metadata.get(RDF_NAMESPACES.CTS.title)],
                "description": [(literal.language, str(literal)) for literal in node.metadata.get(RDF_NAMESPACES.CTS.description)],
                "label": [(literal.language, str(literal)) for literal in node.metadata.get(RDF_NAMESPACES.CTS.label)]
            },
            citation=Markup(node.citation.export(Mimetypes.XML.CTS))
        )
        return r, 200, {"content-type": "application/xml"}
995430
def get_tag(self, tagtype):
        ''' '''
        for tag in self.__tags:
            if tag.tagtype == tagtype:
                return tag
        return None
401010
def get_label(key):
    
    if key in rel:
        if mpl.rcParams['text.usetex']:
            return rel[key]['label_latex']
        else:
            return rel[key]['label_mpl']
    else:
        return key
620055
def getLabel(self):
        
        response = xmlparser(
            self.retriever.getLabel(urn=str(self.urn))
        )

        self._parse_request(
            response.xpath("//ti:reply/ti:label", namespaces=XPATH_NAMESPACES)[0]
        )

        return self.metadata
1293862
def label(self, value):
        
        return self._labels.get(value) or text.pretty(self(value))