Return the tags for the parent revision (or None if no single
			parent can be identified).
771876
def get_parent_tags(self, rev=None):
		
		try:
			parent_rev = one(self.get_parent_revs(rev))
		except Exception:
			return None
		return self.get_tags(parent_rev)
112485
def xml_get_tag(xml, tag, parent_tag=None, multi_line=False):
    
    expr_str = '[<:]' + tag + '.*?>(?P<matched_text>.+?)<'
    if parent_tag:
        expr_str = '[<:]' + parent_tag + '.*?>.*?' + expr_str
    expr = re.compile(expr_str, re.DOTALL | re.IGNORECASE)
    if multi_line:
        return expr.findall(xml)
    else:
        if expr.search(xml):
            return expr.search(xml).group('matched_text').strip()
        else:
            return None
1004372
def get_parent_id(self, resource, document):
        
        parent_type = self._get_parent_type(resource)
        if parent_type and document:
            return document.get(parent_type.get('field'))

        return None
982917
def parents( self, node ):
        """"""
        if 'index' in node:
            index = node['index']()
            parents = list(meliaeloader.children( node, index, 'parents' ))
            return parents 
        return []
1346035
public Set<Tag> getDescendantTags(Tag tag)
    {
        Set<Tag> ancestors = new HashSet<>();
        getDescendantTags(tag, ancestors);
        return ancestors;
    }
717997
def _get_revision(self, revision):
        

        is_null = lambda o: len(o) == revision.count('0')

        try:
            self.revisions[0]
        except (KeyError, IndexError):
            raise EmptyRepositoryError("There are no changesets yet")

        if revision in (None, '', 'tip', 'HEAD', 'head', -1):
            return self.revisions[-1]

        is_bstr = isinstance(revision, (str, unicode))
        if ((is_bstr and revision.isdigit() and len(revision) < 12)
            or isinstance(revision, int) or is_null(revision)):
            try:
                revision = self.revisions[int(revision)]
            except Exception:
                raise ChangesetDoesNotExistError("Revision %s does not exist "
                    "for this repository" % (revision))

        elif is_bstr:
            # get by branch/tag name
            _ref_revision = self._parsed_refs.get(revision)
            if _ref_revision:  # and _ref_revision[1] in ['H', 'RH', 'T']:
                return _ref_revision[0]

            _tags_shas = self.tags.values()
            # maybe it's a tag ? we don't have them in self.revisions
            if revision in _tags_shas:
                return _tags_shas[_tags_shas.index(revision)]

            elif not SHA_PATTERN.match(revision) or revision not in self.revisions:
                raise ChangesetDoesNotExistError("Revision %s does not exist "
                    "for this repository" % (revision))

        # Ensure we return full id
        if not SHA_PATTERN.match(str(revision)):
            raise ChangesetDoesNotExistError("Given revision %s not recognized"
                % revision)
        return revision
212803
def get_child_ids(self, parent_alias):
        
        self._cache_init()
        return self._cache_get_entry(self.CACHE_NAME_PARENTS, parent_alias, [])
768458
def check_lato_blog_tag_parent
      tag_parent = LatoBlog::TagParent.find_by(id: lato_blog_tag_parent_id)
      if !tag_parent
        errors.add('Tag parent', 'not exist for the tag')
        throw :abort
        return
      end

      same_language_tag = tag_parent.tags.find_by(meta_language: meta_language)
      if same_language_tag && same_language_tag.id != id
        errors.add('Tag parent', 'has another tag for the same language')
        throw :abort
        return
      end
    end
1369786
def missing_tags(self, existing_sdists=None):
        """"""
        if existing_sdists is None:
            existing_sdists = []
        logger.debug("Existing sdists: %s", existing_sdists)
        if self._missing_tags is None:
            missing = []
            existing_sdists = sorted_versions(set(existing_sdists))
            available = set(self.wrapper.vcs.available_tags())
            available_tags = sorted_versions(available)
            available_tags.reverse()
            for tag in available_tags:
                if tag.is_prerelease:
                    logger.warn("Pre-release marker in tag: %s, ignoring", tag)
                    continue
                if tag in existing_sdists:
                    logger.debug(
                        "Tag %s is already available, not looking further",
                        tag)
                    break
                else:
                    missing.append(tag)
                    logger.debug("Tag %s is missing", tag)
            missing.reverse()
            # Convert back to proper strings:
            mapping = {}
            for tag in available:
                mapping[parse_version(tag)] = tag
            self._missing_tags = [mapping[tag] for tag in missing]
        logger.debug("Missing sdists: %s", self._missing_tags)
        return self._missing_tags
305604
def find_tags(self):
        """"""
        listing = self.context.capture('git', 'show-ref', '--tags', check=False)
        for line in listing.splitlines():
            tokens = line.split()
            if len(tokens) >= 2 and tokens[1].startswith('refs/tags/'):
                yield Revision(
                    repository=self,
                    revision_id=tokens[0],
                    tag=tokens[1][len('refs/tags/'):],
                )
904578
def _get_tags(c):
    
    tags_ = []
    for tagstr in c.run("git tag", hide=True).stdout.strip().split("\n"):
        try:
            tags_.append(Version(tagstr))
        # Ignore anything non-semver; most of the time they'll be non-release
        # tags, and even if they are, we can't reason about anything
        # non-semver anyways.
        # TODO: perhaps log these to DEBUG
        except ValueError:
            pass
    # Version objects sort semantically
    return sorted(tags_)
14904
def get_tag_names(self):
        """"""
        root = etree.fromstring(self.xml_full_text.encode('utf-8'))
        return self.get_children_tag_names(root)
116902
def node(self, parent=None, tag='g', attrib=None, **extras):
        """"""
        if parent is None:
            parent = self.root
        attrib = attrib or {}
        attrib.update(extras)

        def in_attrib_and_number(key):
            return key in attrib and isinstance(attrib[key], Number)

        for pos, dim in (('x', 'width'), ('y', 'height')):
            if in_attrib_and_number(dim) and attrib[dim] < 0:
                attrib[dim] = -attrib[dim]
                if in_attrib_and_number(pos):
                    attrib[pos] = attrib[pos] - attrib[dim]

        for key, value in dict(attrib).items():
            if value is None:
                del attrib[key]

            attrib[key] = to_str(value)
            if key.endswith('_'):
                attrib[key.rstrip('_')] = attrib[key]
                del attrib[key]
            elif key == 'href':
                attrib[etree.QName('http://www.w3.org/1999/xlink',
                                   key)] = attrib[key]
                del attrib[key]
        return etree.SubElement(parent, tag, attrib)
633713
def get_tuids_from_revision(self, revision):
        
        result = []
        URL_TO_FILES = self.hg_url / self.config.hg.branch / 'json-info' / revision
        try:
            mozobject = http.get_json(url=URL_TO_FILES, retry=RETRY)
        except Exception as e:
            Log.warning("Unexpected error trying to get file list for revision {{revision}}", cause=e)
            return None

        files = mozobject[revision]['files']

        results = self.get_tuids(files, revision)
        return results
489363
def get_parent_id(element):
        """"""
        if 'parent' in element.attrib:
            return element.attrib['parent']
        else:
            return element.getparent().attrib[add_ns('id')]
174590
def findparent(self, inputtemplates):
        """"""
        for inputtemplate in inputtemplates:
            if self.unique == inputtemplate.unique:
                return inputtemplate.id
        return None
718777
def component_acting_parent_tag(parent_tag, tag):
    
    if parent_tag.name == "fig-group":
        if (len(tag.find_previous_siblings("fig")) > 0):
            acting_parent_tag = first(extract_nodes(parent_tag, "fig"))
        else:
            # Do not return the first fig as parent of itself
            return None
    else:
        acting_parent_tag = parent_tag
    return acting_parent_tag