get nodes that belong to a tag
        :param tag: tag name
        :rtype: list of string
165836
def nodes(self, tag):
        
        if tag == '*':
            return sorted(list(set(self.campaign.network.nodes)))
        definitions = self.campaign.network.tags.get(tag)
        if definitions is None:
            return []
        nodes = set()
        for definition in definitions:
            if len(definition.items()) == 0:
                continue
            mode, value = list(definition.items())[0]
            if mode == 'match':
                nodes = nodes.union(
                    set(
                        [
                            node
                            for node in self.campaign.network.nodes
                            if value.match(node)
                        ]
                    )
                )
            elif mode == 'constraint':
                slurm_nodes = os.environ.get('SLURM_JOB_NODELIST')
                if slurm_nodes:
                    nodes = NodeSet(slurm_nodes)
                else:
                    return ConstraintTag(tag, value)
            else:
                assert mode == 'nodes'
                nodes = nodes.union(set(value))
        return sorted(list(nodes))
280323
def get_tags(self):
    """"""
    return sorted([frozenset(meta_graph.meta_info_def.tags)
                   for meta_graph in self.meta_graphs])
611734
def find(self, *tags):
        
        tags = list(map(str, tags))
        return self._client.json('corex.find', {'tags': tags})
992869
def _find_child(self, tag):
        
        tag = self._get_namespace_tag(tag)
        children = self._root.findall(tag)
        if len(children) > 1:
            raise WSDLParseError("Duplicate tag '%s'" % tag)
        if len(children) == 0:
            return None
        return children[0]
469089
def ok_tags(tags: dict) -> bool:
        

        if not tags:
            return True
        depth = 0
        queue = [(i, depth+1) for i in tags.values() if isinstance(i, dict)]
        max_depth = 0
        while queue and max_depth < 2:
            sub, depth = queue.pop()
            max_depth = max(max_depth, depth)
            queue = queue + [(i, depth+1) for i in sub.values() if isinstance(i, dict)]

        return max_depth < 2 and all(isinstance(k, str) and isinstance(tags[k], str) for k in tags)
199980
def get_tags(self, rev=None):
		
		rev = rev or 'HEAD'
		return set(self._invoke('tag', '--points-at', rev).splitlines())
415287
def find_by_tag(self, tag, params={}, **options): 
        
        path = "/tags/%s/tasks" % (tag)
        return self.client.get_collection(path, params, **options)
1244740
def getElementsByTagName(start_node: ParentNode, tag: str) -> NodeList:
    """"""
    _tag = tag.upper()
    return getElementsBy(start_node, lambda node: node.tagName == _tag)
212529
def getElementsByName(self, name):
        '''
            
        '''
        ret = TagCollection()
        if len(self) == 0:
            return ret
        _cmpFunc = lambda tag : bool(tag.name == name)
        for tag in self:
            TagCollection._subset(ret, _cmpFunc, tag)

        return ret
567732
def _read_tags(self):
        
        tags = self._config.get('tags', {})
        logging.info('Tags:')
        for tag_name in tags.keys():
            tag = {}
            tag['Key'] = tag_name
            tag['Value'] = tags[tag_name]
            self._tags.append(tag)
            logging.info('{} = {}'.format(tag_name, tags[tag_name]))

        logging.debug(json.dumps(
            self._tags,
            indent=2,
            sort_keys=True
        ))
        return True
322330
def tags(self):
        
        # See also. Sentence.__repr__().
        ch, I,O,B = self.chunk, INSIDE+"-", OUTSIDE, BEGIN+"-"
        tags = [OUTSIDE for i in range(len(self.sentence.token))]
        for i, tag in enumerate(self.sentence.token): # Default: [WORD, POS, CHUNK, PNP, RELATION, ANCHOR, LEMMA]
            if tag == WORD:
                tags[i] = encode_entities(self.string)
            elif tag == POS and self.type:
                tags[i] = self.type
            elif tag == CHUNK and ch and ch.type:
                tags[i] = (self == ch[0] and B or I) + ch.type
            elif tag == PNP and self.pnp:
                tags[i] = (self == self.pnp[0] and B or I) + "PNP"
            elif tag == REL and ch and len(ch.relations) > 0:
                tags[i] = ["-".join([str(x) for x in [ch.type]+list(reversed(r)) if x]) for r in ch.relations]
                tags[i] = "*".join(tags[i])
            elif tag == ANCHOR and ch:
                tags[i] = ch.anchor_id or OUTSIDE
            elif tag == LEMMA:
                tags[i] = encode_entities(self.lemma or "")
            elif tag in self.custom_tags:
                tags[i] = self.custom_tags.get(tag) or OUTSIDE
        return tags
944445
def get_children_tag_names(self, xml_element):
        """"""
        tags = set()
        tags.add(self.remove_namespace_from_tag(xml_element.tag))

        for element in xml_element.iter(tag=etree.Element):
            if element != xml_element:
                new_tags = self.get_children_tag_names(element)
                if new_tags is not None:
                    tags.update(new_tags)
        return tags
262313
function tag(node, tagName){
    var element = get(node) || document;

    if (tagName == '*' && element.all)
      return arrayFrom(element.all);
    else
      return arrayFrom(element.getElementsByTagName(tagName || '*'));
  }
709579
def _get_tag(repo, name):
    '''
    
    '''
    try:
        return [x for x in _all_tags(repo) if x[0] == name][0]
    except IndexError:
        return False
1291638
def tags(pode, leaf=False):
    '''
    
    '''
    fulltags = [tag for tag in pode[1]['tags']]
    if not leaf:
        return fulltags

    # longest first
    retn = []

    # brute force rather than build a tree.  faster in small sets.
    for size, tag in sorted([(len(t), t) for t in fulltags], reverse=True):
        look = tag + '.'
        if any([r.startswith(look) for r in retn]):
            continue
        retn.append(tag)
    return retn
623729
def extract_nodes(soup, nodename, attr = None, value = None):
    
    tags = soup.find_all(nodename)
    if attr != None and value != None:
        return list(filter(lambda tag: tag.get(attr) == value, tags))
    return list(tags)
800015
function getNodes(tags, context) {
  var keys = objectKeys(tags);
  var returns = [];

  // keys to uppercase to compare to nodeName
  for(var i=0; i<keys.length; i++) keys[i]=keys[i].toUpperCase();

  // if context is tag
  if(keys.indexOf(context.nodeName.toUpperCase()) >= 0) {
    return [context];
  };

  //Mount all top-level child tags within context
  var nodes, el, mount, n;
  for(var i=0; i<keys.length; i++) {
    nodes = context.getElementsByTagName(keys[i]);
    for(n=0; n<nodes.length; n++) {
      el = nodes[n];
      mount = true;
      while(el = el.parentNode) {
        if(keys.indexOf(el.nodeName.toUpperCase()) >= 0) {
          mount = false;
          break;
        }
        if(el === context) break;
      }
      if(mount) returns.push(nodes[n]);
    }
  }  
  return returns;
}