Find the fn tags included in the competing interest
510383
def competing_interests(soup, fntype_filter):
    

    competing_interests_section = extract_nodes(soup, "fn-group", attr="content-type", value="competing-interest")
    if not competing_interests_section:
        return None
    fn = extract_nodes(first(competing_interests_section), "fn")
    interests = footnotes(fn, fntype_filter)

    return interests
793683
def search_tags_as_filters(tags):
    """"""
    # set dicts
    actions = {}
    contacts = {}
    formats = {}
    inspire = {}
    keywords = {}
    licenses = {}
    md_types = dict()
    owners = defaultdict(str)
    srs = {}
    unused = {}
    # 0/1 values
    compliance = 0
    type_dataset = 0
    # parsing tags
    print(len(tags.keys()))
    i = 0
    for tag in sorted(tags.keys()):
        i += 1
        # actions
        if tag.startswith("action"):
            actions[tags.get(tag, tag)] = tag
            continue
        # compliance INSPIRE
        elif tag.startswith("conformity"):
            compliance = 1
            continue
        # contacts
        elif tag.startswith("contact"):
            contacts[tags.get(tag)] = tag
            continue
        # formats
        elif tag.startswith("format"):
            formats[tags.get(tag)] = tag
            continue
        # INSPIRE themes
        elif tag.startswith("keyword:inspire"):
            inspire[tags.get(tag)] = tag
            continue
        # keywords
        elif tag.startswith("keyword:isogeo"):
            keywords[tags.get(tag)] = tag
            continue
        # licenses
        elif tag.startswith("license"):
            licenses[tags.get(tag)] = tag
            continue
        # owners
        elif tag.startswith("owner"):
            owners[tags.get(tag)] = tag
            continue
        # SRS
        elif tag.startswith("coordinate-system"):
            srs[tags.get(tag)] = tag
            continue
        # types
        elif tag.startswith("type"):
            md_types[tags.get(tag)] = tag
            if tag in ("type:vector-dataset", "type:raster-dataset"):
                type_dataset += 1
            else:
                pass
            continue
        # ignored tags
        else:
            unused[tags.get(tag)] = tag
            continue

    # override API tags to allow all datasets filter - see #
    if type_dataset == 2:
        md_types["Donnée"] = "type:dataset"
    else:
        pass
    # printing
    # print("There are:"
    #       "\n{} actions"
    #       "\n{} contacts"
    #       "\n{} formats"
    #       "\n{} INSPIRE themes"
    #       "\n{} keywords"
    #       "\n{} licenses"
    #       "\n{} owners"
    #       "\n{} SRS"
    #       "\n{} types"
    #       "\n{} unused".format(len(actions),
    #                            len(contacts),
    #                            len(formats),
    #                            len(inspire),
    #                            len(keywords),
    #                            len(licenses),
    #                            len(owners),
    #                            len(srs),
    #                            len(md_types),
    #                            len(unused)
    #                            ))
    # storing dicts
    tags_parsed = {
        "actions": actions,
        "compliance": compliance,
        "contacts": contacts,
        "formats": formats,
        "inspire": inspire,
        "keywords": keywords,
        "licenses": licenses,
        "owners": owners,
        "srs": srs,
        "types": md_types,
        "unused": unused,
    }

    # method ending
    return tags_parsed
512639
function tagMatcher($tag_name, $close_tags = null)
    {
        $expr = $this->_tag_expr;

        if ($close_tags) {
            $options = implode("|", array_merge(array($tag_name), $close_tags));
            $closer = sprintf("(?:%s)", $options);
        } else {
            $closer = $tag_name;
        }

        $expr = sprintf($expr, $tag_name, $closer);
        return sprintf("/%s/%s", $expr, $this->_re_flags);
    }
668870
def make_article_info_competing_interests(self, article_info_div):
        
        #Check for author-notes
        con_expr = "./front/article-meta/author-notes/fn[@fn-type='conflict']"
        conflict = self.article.root.xpath(con_expr)
        if not conflict:
            return
        conflict_div = etree.SubElement(article_info_div,
                                        'div',
                                        {'id': 'conflict'})
        b = etree.SubElement(conflict_div, 'b')
        b.text = 'Competing Interests: '
        fn_p = conflict[0].find('p')
        if fn_p is not None:
            append_all_below(conflict_div, fn_p)
1177928
def find(fn, record):
    
    values_result = fn(record.values())
    keys_result = [k for k, v in record.items() if v == values_result]
    return {keys_result[0]: values_result}
1268719
def _indexable_tags(self):
        """"""
        tags = current_app.extensions.get("tags")
        if not tags or not tags.supports_taggings(self):
            return ""

        default_ns = tags.entity_default_ns(self)
        return [t for t in tags.entity_tags(self) if t.ns == default_ns]
675384
def get_tags(self, use_cached=True):
        """"""
        device_json = self.get_device_json(use_cached)
        potential_tags = device_json.get("dpTags")
        if potential_tags:
            return list(filter(None, potential_tags.split(",")))
        else:
            return []
1182485
public final String getTags(final Priority priority) {
        if (priority == Priority.HIGH) {
            return high;
        }
        else if (priority == Priority.NORMAL) {
            return normal;
        }
        else {
            return low;
        }
    }
1024008
def competition_urls(self):
    """"""
    return [
        KaggleFile(self._competition_name, fname).to_url()
        for fname in self.competition_files  # pylint: disable=not-an-iterable
    ]
808888
def get(self):
        
        open_tracking = {}
        if self.enable is not None:
            open_tracking["enable"] = self.enable

        if self.substitution_tag is not None:
            open_tracking["substitution_tag"] = self.substitution_tag.get()
        return open_tracking
799130
def get_tags(self, tagtype):
        '''  '''
        return [t for t in self.__tags if t.tagtype == tagtype]
548098
def do_list(lookup, term):
    """"""

    space = lookup.keys()
    matches = fnmatch.filter(space, term)

    return [(m, translate(lookup, m)) for m in matches]
871792
function findGroupsByCheck(groups, compareFn) {
    var foundGroups = groups.filter(compareFn);
    groups.forEach(function(group) {
        var subFound = findGroupsByCheck(group.getGroups(), compareFn);
        if (subFound.length > 0) {
            foundGroups = foundGroups.concat(subFound);
        }
    });
    return foundGroups;
}
291614
private static function getFeedItemIdsForCampaignFeed($campaignFeed)
    {
        $feedItemIds = [];

        if ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::IN) {
            // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
            // Extract feed items if applicable.
            $feedItemIds = array_merge(
                $feedItemIds,
                self::getFeedItemIdsFromArgument($campaignFeed->getMatchingFunction())
            );
        } elseif ($campaignFeed->getMatchingFunction()->getOperator() === FunctionOperator::AND_VALUE) {
            foreach ($campaignFeed->getMatchingFunction()->getLhsOperand() as $argument) {
                // Check if matchingFunction is of the form IN(FEED_ITEM_ID,{xxx,xxx}).
                // Extract feed items if applicable.
                if ($argument instanceof FunctionOperand) {
                    if ($argument->getValue()->getOperator() === FunctionOperator::IN) {
                        $feedItemIds = array_merge(
                            $feedItemIds,
                            self::getFeedItemIdsFromArgument($argument->getValue())
                        );
                    }
                }
            }
        }

        return $feedItemIds;
    }
113265
def view_all_tags(ctx, param, value):
    
    # To make sure this function executed only when the flag was called
    if not value or ctx.resilient_parsing:
        return
    avail_tags = dict()
    print("\nMultiQC Available module tag groups:\n")
    for mod_dict in filter(lambda mod:isinstance(mod, dict), config.module_order):
        mod_key, mod_val = list(mod_dict.items())[0]
        tags = list(mod_val.get('module_tag', []))
        for t in tags:
            if t not in avail_tags:
                avail_tags[t] = []
            avail_tags[t].append(mod_key)
    for t in sorted(avail_tags.keys(), key=lambda s: s.lower()):
        print (" - {}:".format(t))
        for ttgs in avail_tags[t]:
            print ("   - {}".format(ttgs))
    ctx.exit()
890976
def select_one(self, tag):
        """"""

        tags = self.select(tag, limit=1)
        return tags[0] if tags else None
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