r"""Build started tag info.

        :param tag: tag name
        :param attrs: tag attributes. Default：``None``.
        :type attrs: dict or None
        :rtype: str
511264
def tag_start(self, tag, attrs=None):
        
        """
        return '<%s %s>' % (tag, self.build_attr(attrs)) if attrs else '<%s>' % tag
663790
def call(self, tag_name: str, *args, **kwargs):
        """"""
        if hasattr(self, tag_name):
            getattr(self, tag_name)(*args, **kwargs)
927397
def add_tag(self, tag):
        
        if tag not in self._tags:
            self._tags[tag] = dict()
820044
def tags(self):
        
        if self._tags is None:
            LOG.debug('need to build tags')
            self._tags = {}

            if hasattr(self.Meta, 'tags_spec') and (self.Meta.tags_spec is not None):
                LOG.debug('have a tags_spec')
                method, path, param_name, param_value = self.Meta.tags_spec[:4]
                kwargs = {}
                filter_type = getattr(self.Meta, 'filter_type', None)
                if filter_type == 'arn':
                    kwargs = {param_name: [getattr(self, param_value)]}
                elif filter_type == 'list':
                    kwargs = {param_name: [getattr(self, param_value)]}
                else:
                    kwargs = {param_name: getattr(self, param_value)}
                if len(self.Meta.tags_spec) > 4:
                    kwargs.update(self.Meta.tags_spec[4])
                LOG.debug('fetching tags')
                self.data['Tags'] = self._client.call(
                    method, query=path, **kwargs)
                LOG.debug(self.data['Tags'])

            if 'Tags' in self.data:
                _tags = self.data['Tags']
                if isinstance(_tags, list):
                    for kvpair in _tags:
                        if kvpair['Key'] in self._tags:
                            if not isinstance(self._tags[kvpair['Key']], list):
                                self._tags[kvpair['Key']] = [self._tags[kvpair['Key']]]
                            self._tags[kvpair['Key']].append(kvpair['Value'])
                        else:
                            self._tags[kvpair['Key']] = kvpair['Value']
                elif isinstance(_tags, dict):
                    self._tags = _tags
        return self._tags
905613
private boolean inStartSet(String tag) {
        return
            // noun
            tag.startsWith("NN") ||
            // adjective
            tag.startsWith("JJ") ||
            // adverb
            tag.startsWith("RB") ||
            // cardinal number
            tag.startsWith("CD");
    }
456388
def _handle_start_relation(self, attrs):
        
        self._curr = {
            'attributes': dict(attrs),
            'members': [],
            'rel_id': None,
            'tags': {}
        }
        if attrs.get('id', None) is not None:
            self._curr['rel_id'] = int(attrs['id'])
            del self._curr['attributes']['id']
1049081
def tag(**tags):
    
    transaction = execution_context.get_transaction()
    if not transaction:
        error_logger.warning("Ignored tags %s. No transaction currently active.", ", ".join(tags.keys()))
    else:
        transaction.tag(**tags)
1341245
function startTagToTokens(startTag) {
            const tokens = [startTag.tagOpen]

            for (const attr of startTag.attributes) {
                tokens.push(attr)
            }

            tokens.push(startTag.tagClose)

            return tokens
                .filter(t => Boolean(t))
                .sort((a, b) => a.range[0] - b.range[0])
        }
716412
def tag(self, *tag, **kwtags):
        """"""
        if not tag:
            pass
        elif len(tag) == 1 and isinstance(tag[0], dict):
            self._meta.update(tag[0])
        else:
            raise TypeError('Tags must be provided as key-word arguments or '
                            'a dictionary')
        self._meta.update(kwtags)
        return self
13424
def handle_starttag(self, tag, attrs):
    '''
    
    '''
    if tag == 'a' and ( ('class', 'download-pdf') in attrs or ('id', 'download-pdf') in attrs ):
        for attr in attrs:
          if attr[0] == 'href':
            self.download_link = 'http://www.nature.com' + attr[1]
1201308
def _handle_tag(self, tag, attrs, self_closing):
        

        if tag.lower() == 'img':
            attrs = self._image_attrs(attrs)

        # Remap the attributes
        out_attrs = []
        for key, val in attrs:
            if (key.lower() == 'href'
                    or (key.lower() == 'src' and not tag.lower() == 'img')):
                out_attrs.append((key, links.resolve(
                    val, self._search_path, self._config.get('absolute'))))
            else:
                out_attrs.append((key, val))

        self.append(
            utils.make_tag(
                tag,
                out_attrs,
                self_closing))
961243
def render_tag(attrs=None, content=None):
    
    builder = '<pre><code{attrs}>{content}</code></pre>'
    return builder.format(
        attrs=flatatt(attrs) if attrs else '',
        content=escape(text_value(content)),
    )
829398
def start_tag(self) -> str:
        """"""
        tag = '<' + self.tag
        attrs = self._get_attrs_by_string()
        if attrs:
            tag = ' '.join((tag, attrs))
        return tag + '>'
819753
def add_tag(name, start, stop)
      @attr_tags << InlineTag.new(SM::Attribute.bitmap_for(name), start, stop)
    end
282818
def _set_attr(self, attribute):
        

        self.tags.add(attribute)
        self.song.save()
881211
def _init_tag(self, tag):
        
        self._element = tag

        self._parseIsTag()
        self._parseIsComment()

        if not self._istag or self._iscomment:
            self._tagname = self._element
        else:
            self._parseTagName()

        if self._iscomment or not self._istag:
            return

        self._parseIsEndTag()
        self._parseIsNonPairTag()

        if self._istag and (not self._isendtag) or "=" in self._element:
            self._parseParams()
1312021
def tag(self, tokens):
        """"""
        # Lazy load model first time we tag
        if not self.classes:
            self.load(self.model)
        prev, prev2 = self.START
        tags = []
        for i, token in enumerate(tokens):
            tag = self.tagdict.get(token)
            if not tag:
                features = self._get_features(i, tokens, prev, prev2)
                tag = self.perceptron.predict(features)
            tags.append((token, tag))
            prev2 = prev
            prev = tag
        return tags