Used to determine which BOM to take.
Currently we only have these tags: eap, eap7.
517336
private Set<String> getTargetTechnologies()
    {
        WindupConfigurationModel wc = grCtx.getUnique(WindupConfigurationModel.class);
        Iterable<TechnologyReferenceModel> targetTechnologies = wc.getTargetTechnologies();
        Set<String> techs = new HashSet<>();
        for (TechnologyReferenceModel tech : targetTechnologies)
        {
            techs.add(tech.getTechnologyID());
        }
        return techs;
    }
157057
def where_entry_tag(query, tag):
    
    if isinstance(tag, (list, set, tuple)):
        tags = [t.lower() for t in tag]
        return orm.select(e for e in query for t in e.tags if t.key in tags)
    return orm.select(e for e in query for t in e.tags if t.key == tag.lower())
1365156
function processTags (content, version, versions, file) {
  const tags = quantum.select(content)
    .selectAll(['added', 'updated', 'deprecated', 'removed', 'bugfix'], {recursive: true})
    .filter(tag => {
      const tagHasKnownVersion = versions.indexOf(tag.ps()) > -1

      if (!tagHasKnownVersion) {
        file.warning({
          module: 'quantum-version',
          problem: `Unexpected version "${tag.ps()}" found in @${tag.type()}`,
          resolution: `Correct the versions list, or the tag version. The versions list for this page is [${versions.join(', ')}]`
        })
        tag.remove()
      }

      return tagHasKnownVersion
    })

  tags.filter(t => t.type() === 'added').forEach(addedTag => {
    // If the content has not yet been added, remove it
    if (versionABeforeVersionB(version, addedTag.ps(), versions)) {
      addedTag.parent().remove()
    } else if (addedTag.ps() !== version) {
      // If the content was added in a previous version, remove the added tag
      addedTag.remove()
    }
  })

  tags.filter(t => t.type() === 'updated').forEach(updatedTag => {
    if (updatedTag.ps() !== version) {
      updatedTag.remove()
    }
  })

  tags.filter(t => t.type() === 'bugfix').forEach(bugfixTag => {
    if (bugfixTag.ps() !== version) {
      bugfixTag.remove()
    }
  })

  tags.filter(t => t.type() === 'deprecated').forEach(deprecatedTag => {
    if (versionABeforeVersionB(version, deprecatedTag.ps(), versions)) {
      deprecatedTag.remove()
    }
  })

  tags.filter(t => t.type() === 'removed').forEach(removedTag => {
    // if the content was removed in a previous version, remove it
    if (versionABeforeVersionB(removedTag.ps(), version, versions)) {
      removedTag.parent().remove()
    } else if (removedTag.ps() === version) {
      // If it was removed in this version, remove any deprecated tag
      removedTag.parent().removeChildOfType('deprecated')
    } else {
      // Otherwise, the content has not been removed yet, so just remove the
      // 'removed' tag. It is not yet its time.
      removedTag.remove()
    }
  })
}
1192860
protected function findBOM($string)
    {

        foreach ($this->byteOrderMarks as $name => $bom) {
            if (substr($string, 0, strlen($bom)) === $bom) {
                return $bom;
            }
        }

        return '';
    }
1033587
def _eb_env_tags(envs, session_factory, retry):
    """"""

    client = local_session(session_factory).client('elasticbeanstalk')

    def process_tags(eb_env):
        try:
            eb_env['Tags'] = retry(
                client.list_tags_for_resource,
                ResourceArn=eb_env['EnvironmentArn'])['ResourceTags']
        except client.exceptions.ResourceNotFoundException:
            return
        return eb_env

    # Handle API rate-limiting, which is a problem for accounts with many
    # EB Environments
    return list(map(process_tags, envs))
362839
def match_criterion(self, tag):
        '''
        '''
        return tag.name == self.reference_tag_name and \
            tag.attrs.get('kind', '') == self.reference_tag_kind
524291
def get_protein_modification_language(identifier_qualified: ParserElement) -> ParserElement:
    """"""
    pmod_identifier = MatchFirst([
        identifier_qualified,
        pmod_default_ns,
        pmod_legacy_ns
    ])

    return pmod_tag + nest(
        Group(pmod_identifier)(IDENTIFIER) +
        Optional(
            WCW +
            amino_acid(PMOD_CODE) +
            Optional(
                WCW +
                ppc.integer(PMOD_POSITION)
            )
        )
    )
1204009
def _extract_tag_value(self, entity, tag_name):
        
        if tag_name not in TAG_EXTRACTORS:
            self.warning("{0} isn't a supported tag".format(tag_name))
            return

        # Check for already extracted tags
        if "_tag_values" not in entity:
            entity["_tag_values"] = {}

        if tag_name not in entity["_tag_values"]:
            entity["_tag_values"][tag_name] = TAG_EXTRACTORS[tag_name](entity)

        return entity["_tag_values"][tag_name]
150660
def _get_pdb_id(self, elem, **kwargs):
        ''''''
        id = elem.attrib['ID']
        if self.restrict_to_transmembrane_proteins:
            tmp = elem.attrib['TMP']
            assert(tmp == 'no' or tmp == 'yes' or tmp == 'not')
            if tmp == 'yes':
                self.ids[id] = PDBTM._get_tm_type(elem)
        else:
            self.ids[id] = self.ids.get(id, 0) + 1
884461
def search_prod_type_tags(self, tipo, ins, tags, pipeline):
        """"""

        drp = self.drps.query_by_name(ins)
        label = drp.product_label(tipo)

        # Strip () is present
        if label.endswith("()"):
            label_alt = label[:-2]
        else:
            label_alt = label

        # search results of these OBs
        for prod in self.prod_table[ins]:
            pk = prod['type'] 
            pt = prod['tags']
            if ((pk == label) or (pk == label_alt)) and tags_are_valid(pt, tags):
                # this is a valid product
                # We have found the result, no more checks
                # Make a copy
                rprod = dict(prod)
                rprod['content'] = numina.store.load(tipo, prod['content'])
                return StoredProduct(**rprod)
        else:
            msg = 'type %s compatible with tags %r not found' % (tipo, tags)
            raise NoResultFound(msg)
191738
private boolean hasTag(String version) {
        for (final String string : Updater.NO_UPDATE_TAG) {
            if (version.contains(string)) {
                return true;
            }
        }
        return false;
    }
448109
@Override
    protected BomFile parseBomFile(String jsonText, String localFileName) {
        JSONObject json = new JSONObject(jsonText);
        String name = json.getString(Constants.NAME);
        String version = getVersion(json, localFileName);
        Map dependencies = getDependenciesFromJson(json, Constants.DEPENDENCIES);
        Map optionalDependencies = getDependenciesFromJson(json, OPTIONAL_DEPENDENCIES);
        String fileName = getFilename(name, version);
        String sha1 = Constants.EMPTY_STRING;
        String resolved = null;
        if(json.has(RESOLVED)) {
            resolved = json.getString(RESOLVED);
        }

        // optional fields for packageJson parser
        if (json.has(SHA1)) {
            sha1 = json.getString(SHA1);
        } else {
            logger.debug("shasum not found in file {}", localFileName);
        }

        RegistryType registryType = getRegistryType(resolved);

        BomFile bom = new BomFile(name, version, sha1, fileName, localFileName, dependencies, optionalDependencies, resolved, registryType);
        return bom;
    }
407833
async function getBaseTag(mode) {
  const tags = await simpleGit.tags();
  // Filter old independent-versioned tags and pre-releases.
  // If cherry-picking for a minor release, ignore patch releases to work from the latest major or minor release.
  const filteredTags = tags.all.filter((tag) => /^v/.test(tag) && !/-/.test(tag) &&
      (mode !== 'minor' || /\.0$/.test(tag)));

  return filteredTags[filteredTags.length - 1];
}
654647
def supported(self, tags=None):
        # type: (Optional[List[Pep425Tag]]) -> bool
        """"""
        if tags is None:  # for mock
            tags = pep425tags.get_supported()
        return bool(set(tags).intersection(self.file_tags))
1209063
def find_package_by_tag(tag)
      if tag.has_ref?
        find_package(tag.repo, tag.ref)
      else
        find_package(tag.repo)
      end
    end
201502
def match(self, version):
        """"""
        return all(spec.match(version) for spec in self.specs)
1073930
def _best_version(fields):
    """"""
    def _has_marker(keys, markers):
        for marker in markers:
            if marker in keys:
                return True
        return False

    keys = []
    for key, value in fields.items():
        if value in ([], 'UNKNOWN', None):
            continue
        keys.append(key)

    possible_versions = ['1.0', '1.1', '1.2', '2.0']

    # first let's try to see if a field is not part of one of the version
    for key in keys:
        if key not in _241_FIELDS and '1.0' in possible_versions:
            possible_versions.remove('1.0')
        if key not in _314_FIELDS and '1.1' in possible_versions:
            possible_versions.remove('1.1')
        if key not in _345_FIELDS and '1.2' in possible_versions:
            possible_versions.remove('1.2')
        if key not in _426_FIELDS and '2.0' in possible_versions:
            possible_versions.remove('2.0')

    # possible_version contains qualified versions
    if len(possible_versions) == 1:
        return possible_versions[0]   # found !
    elif len(possible_versions) == 0:
        raise MetadataConflictError('Unknown metadata set')

    # let's see if one unique marker is found
    is_1_1 = '1.1' in possible_versions and _has_marker(keys, _314_MARKERS)
    is_1_2 = '1.2' in possible_versions and _has_marker(keys, _345_MARKERS)
    is_2_0 = '2.0' in possible_versions and _has_marker(keys, _426_MARKERS)
    if int(is_1_1) + int(is_1_2) + int(is_2_0) > 1:
        raise MetadataConflictError('You used incompatible 1.1/1.2/2.0 fields')

    # we have the choice, 1.0, or 1.2, or 2.0
    #   - 1.0 has a broken Summary field but works with all tools
    #   - 1.1 is to avoid
    #   - 1.2 fixes Summary but has little adoption
    #   - 2.0 adds more features and is very new
    if not is_1_1 and not is_1_2 and not is_2_0:
        # we couldn't find any specific marker
        if PKG_INFO_PREFERRED_VERSION in possible_versions:
            return PKG_INFO_PREFERRED_VERSION
    if is_1_1:
        return '1.1'
    if is_1_2:
        return '1.2'

    return '2.0'