:returns: numeric index associated to the tag
325989
def add(self, tagname, tagvalue):
        
        dic = getattr(self, tagname + '_idx')
        try:
            return dic[tagvalue]
        except KeyError:
            dic[tagvalue] = idx = len(dic)
            getattr(self, tagname).append(tagvalue)
            if idx > TWO16:
                raise InvalidFile('contains more then %d tags' % TWO16)
            return idx
1275470
def homer_stats_table_tagInfo(self):
        

        if len(self.tagdir_data['header']) == 0:
            return None

        headers = OrderedDict()
        headers['UniqPositions'] = {
            'title': 'Uniq Pos',
            'description': 'Numer of Unique Di-Tags Passed Through HOMER',
            'format': '{:,.0f}',
            'modify': lambda x: x * 0.000001,
            'suffix': "M"

        }
        headers['TotalPositions'] = {
            'title': 'Total Pos',
            'description': 'Numer of Total Di-Tags Passed Through HOMER',
            'format': '{:,.0f}',
            'modify': lambda x: x * 0.000001,
            'suffix': "M"
        }
        headers['fragmentLengthEstimate'] = {
            'title': 'fragment Length',
            'description': 'Estimate of Fragnment Length',
            'format': '{:,.0f}'
        }
        headers['peakSizeEstimate'] = {
            'title': 'Peak Size',
            'description': 'Estimate of Peak Size',
            'format': '{:,.0f}'
        }
        headers['tagsPerBP'] = {
            'title': 'tagsPerBP',
            'description': 'average tags Per basepair',
            'format': '{:,.3f}',
        }
        headers['TagsPerPosition'] = {
            'title': 'averageTagsPerPosition',
            'description': 'Average Tags Per Position',
            'format': '{:,.2f}'
        }
        headers['averageTagLength'] = {
            'title': 'TagLength',
            'description': 'Average Tag Length',
            'format': '{:,.0f}'
        }
        headers['averageFragmentGCcontent'] = {
            'title': 'GCcontent',
            'description': 'Average Fragment GC content',
            'max': 1,
            'min': 0,
            'format': '{:,.2f}'
        }
        self.general_stats_addcols(self.tagdir_data['header'], headers, 'HOMER')
1299803
def get_metrics(tag):
    
    if tag is None:
        return metrics.metrics_by_name_list(metrics.metrics())
    else:
        return metrics.metrics_by_tag(tag)
644819
def tag_fig_ordinal(tag):
    
    tag_count = 0
    if 'specific-use' not in tag.attrs:
        # Look for tags with no "specific-use" attribute
        return len(list(filter(lambda tag: 'specific-use' not in tag.attrs,
                          tag.find_all_previous(tag.name)))) + 1
909792
def tag(self, tag):
        
        url = '%s/tags/%s' % (self, tag)
        response = self.http.get(url, auth=self.auth)
        response.raise_for_status()
        return response.json()
579985
def tag_list(self):
        """"""
        tags = [tag.strip() for tag in self.tag_string.split(",")]
        return sorted(filter(None, tags))
451782
def tags(self):
        
        if 'tags' in self._values:
            return self._values['tags']
        self._values['tags'] = copy.deepcopy(self._defaults['tags'])
        return self._values['tags']
351374
def tags(self):
        
        tags = set()
        for i in self:
            tags |= set(i.keys())
        return tags
1201086
protected int getCheckedTagIndex() {
        final int count = getChildCount();
        for (int i = 0; i < count; i++) {
            final TagView tag = getTagAt(i);
            if (tag.isChecked) {
                return i;
            }
        }
        return -1;
    }
280323
def get_tags(self):
    """"""
    return sorted([frozenset(meta_graph.meta_info_def.tags)
                   for meta_graph in self.meta_graphs])
933741
def get_for_tag(self, tag):
        
        tag_filter = {'tag': tag}

        if isinstance(tag, six.integer_types):
            tag_filter = {'tag_id': tag}
        elif isinstance(tag, str):
            tag_filter = {'tag__slug': tag}

        return self.filter(id__in=[
            entry_tag.entry_id
            for entry_tag
            in EntryTag.objects.filter(**tag_filter)
        ])
154148
def v1_tag_associations(tags, tag):
    '''
    '''
    tag = tag.decode('utf-8').strip()
    return {'associations': tags.assocs_by_tag(tag)}
49394
async def get_metrics(self):
        
        metrics = await self.model.get_metrics(self.tag)
        return metrics[self.name]
322458
def tagrefs(self):
        
        n = self._nmembers
        ret = []
        if n:
            tags = _C.array_int32(n)
            refs = _C.array_int32(n)
            k = _C.Vgettagrefs(self._id, tags, refs, n)
            _checkErr('tagrefs', k, "error getting tags and refs")
            for m in xrange(k):
                ret.append((tags[m], refs[m]))

        return ret
916544
def tags(self):
        
        tags = self.attrs.get('RepoTags')
        if tags is None:
            tags = []
        return [tag for tag in tags if tag != '<none>:<none>']
1136780
def get_fd_array_value(tag, count):
    
    if tag.VR == 'OB' or tag.VR == 'UN':
        values = []
        for i in range(count):
            start = i * 8
            stop = (i + 1) * 8
            values.append(struct.unpack('d', tag.value[start:stop])[0])
        return numpy.array(values)
    return tag.value
867600
def _rank_tags(tagged_paired_aligns):
    ''''''
    tag_count_dict = defaultdict(int)
    for paired_align in tagged_paired_aligns:
        tag_count_dict[paired_align.umt] += 1
    tags_by_count = utils.sort_dict(tag_count_dict)
    ranked_tags = [tag_count[0] for tag_count in tags_by_count]
    return ranked_tags