Create a tag script if the given QName is a taglib invocation, or return null
to handle it like a literal static tag.
333548
private TagScript createTagScript(QName n, Map<?, ?> attributes) throws JellyException {
        TagLibrary lib = context.getTagLibrary(n.getNamespaceURI());
        if(lib!=null) {
            String localName = n.getLocalPart();

            TagScript tagScript = lib.createTagScript(localName, null/*this parameter appears to be unused.*/);
            if (tagScript==null)    tagScript = lib.createTagScript(localName.replace('_','-'), null);

            if (tagScript!=null) {
                if (attributes != null) {
                    for (Entry e : attributes.entrySet()) {
                        Object v = e.getValue();
                        if (v!=null)
                            tagScript.addAttribute(e.getKey().toString(), new ConstantExpression(v));
                    }
                }

                return tagScript;
            }
        }

        // otherwise treat it as a literal.
        return null;
    }
1345901
@Deprecated
	public static Tag getTag(Channel channel, String tagName) {
		Collection<Tag> tag = Collections2.filter(channel.getTags(),
				new TagNamePredicate(tagName));
		if (tag.size() == 1)
			return tag.iterator().next();
		else
			return null;
	}
527087
function (scanner, tag) {
  if (getClangle(scanner))
    return tag;

  if (getSlash(scanner)) {
    if (! getClangle(scanner))
      scanner.fatal("Expected `>` after `/`");
    tag.isSelfClosing = true;
    return tag;
  }

  return null;
}
1276849
public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException
    {
        if (containsNamespace(ns))
        {
            Map<String, TagHandlerFactory> map = _factories.get(ns);
            if (map == null)
            {
                map = new HashMap<String, TagHandlerFactory>();
                _factories.put(ns, map);
            }
            TagHandlerFactory f = map.get(localName);
            if (f != null)
            {
                return f.createHandler(tag);
            }
        }
        
        return null;
    }
38614
def _maybe_init_tags(self, run_id, tag_to_metadata):
    
    cursor = self._db.cursor()
    # TODO: for huge numbers of tags (e.g. 1000+), this is slower than just
    # querying for the known tag names explicitly; find a better tradeoff.
    cursor.execute('SELECT tag_name, tag_id FROM Tags WHERE run_id = ?',
                   (run_id,))
    tag_to_id = {row[0]: row[1] for row in cursor.fetchall()
                 if row[0] in tag_to_metadata}
    new_tag_data = []
    for tag, metadata in six.iteritems(tag_to_metadata):
      if tag not in tag_to_id:
        tag_id = self._create_id()
        tag_to_id[tag] = tag_id
        new_tag_data.append((run_id, tag_id, tag, time.time(),
                             metadata.display_name,
                             metadata.plugin_data.plugin_name,
                             self._make_blob(metadata.plugin_data.content)))
    cursor.executemany(
        """
        INSERT INTO Tags (
          run_id, tag_id, tag_name, inserted_time, display_name, plugin_name,
          plugin_data
        ) VALUES (?, ?, ?, ?, ?, ?, ?)
        """,
        new_tag_data)
    return tag_to_id
83373
function createDom(tagName, opt_className) {
  var element = document.createElement(tagName);
  if (opt_className) {
    element.className = opt_className;
  }
  return element;
}
328990
function (element, containerTag) {
    if (element && element.hasChildNodes)
      for (var i = 0; i < element.childNodes.length; ++i)
        if (element.childNodes[i].tagName == containerTag)
          return element.childNodes[i];
  
    return null;
  }
428037
public TagHandler getHandler(Tag tag) {
        if (handlers.containsKey(tag.getName())) {
            return handlers.get(tag.getName());
        }
        return null;
    }
1305252
private static String tagify(Object thisObj, String tag,
                                 String attribute, Object[] args)
    {
        String str = ScriptRuntime.toString(thisObj);
        StringBuilder result = new StringBuilder();
        result.append('<');
        result.append(tag);
        if (attribute != null) {
            result.append(' ');
            result.append(attribute);
            result.append("=\"");
            result.append(ScriptRuntime.toString(args, 0));
            result.append('"');
        }
        result.append('>');
        result.append(str);
        result.append("</");
        result.append(tag);
        result.append('>');
        return result.toString();
    }
816457
def create_tag(tag_name, kind='z'):
        '''
        
        '''
        cur_recs = TabTag.select().where(
            (TabTag.name == tag_name) &
            (TabTag.kind == kind)
        )
        if cur_recs.count():
            uid = cur_recs.get().uid

            # TabTag.delete().where(
            #     (TabTag.name == tag_name) &
            #     (TabTag.kind == kind)
            # ).execute()
        else:
            uid = tools.get_uu4d_v2()  # Label with the ID of v2.
            while TabTag.select().where(TabTag.uid == uid).count() > 0:
                uid = tools.get_uu4d_v2()

            TabTag.create(
                uid=uid,
                slug=uid,
                name=tag_name,
                order=1,
                count=0,
                kind='z',
                tmpl=9,
                pid='zzzz',
            )
        return uid
838949
public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException
    {
        for (int i = 0; i < this.libraries.length; i++)
        {
            if (this.libraries[i].containsTagHandler(ns, localName))
            {
                return this.libraries[i].createTagHandler(ns, localName, tag);
            }
        }
        return null;
    }
621788
function( tagName ) {
            var element = document.createElement( tagName ),
                style   = element.style;

            style.background = "transparent none";
            style.border     = "none";
            style.margin     = "0px";
            style.padding    = "0px";
            style.position   = "static";

            return element;
        }
1068653
def handle_starttag(self, tagName, attributeList, isSelfClosing=False):
        '''
            
        '''
        newTag = AdvancedHTMLParser.handle_starttag(self, tagName, attributeList, isSelfClosing)
        self._indexTag(newTag)

        return newTag
154580
def qtag(tag):
    
    prefix, tagroot = tag.split(':')
    uri = nsmap[prefix]
    return '{%s}%s' % (uri, tagroot)
82873
def tag(self, name, attrs=None, selfclosing=None):
        """"""
        if self.disable_tags > 0:
            return

        if name in self.linkable_tags and attrs and len(attrs) > 0:
            for attrib in attrs:
                if attrib[0] in self.linkable_attrs:
                    attrib[1] = INTERNAL_LINK.sub('{\g<1>}', attrib[1])

        super().tag(name, attrs, selfclosing)
46275
function elem(tagName) {
    if (!utils.isString(tagName)) {
        return null;
    }

    // element at the very least has name and fn to render itself
    var e = {
        tag: tagName
    };

    // add other values to the element based on the input argument
    if (arguments.length > 1) {
        for (var i = 1, len = arguments.length; i < len; ++i) {
            var arg = arguments[i];

            if (utils.isArray(arg)) {
                if (e.children && e.children.length) {
                    e.children = e.children.concat(arg);
                }
                else {
                    e.children = arg;
                }
            }
            else if (utils.isObject(arg) && arg.hasOwnProperty('tag')) {
                e.children = e.children || [];
                e.children.push(arg);
            }
            else if (utils.isObject(arg) && arg.tag && arg.toString) {
                e.children = [arg];
            }
            else if (utils.isObject(arg)) {
                e.attributes = arg;
            }
            else if (utils.isString(arg)) {
                e.text = arg;
            }
        }
    }

    return e;
}
208595
public void openTag(final QName tag,
                      final String attrName,
                      final String attrVal) throws IOException {
    blanks();
    openTagSameLine(tag, attrName, attrVal);
    newline();
    indent += 2;
  }