append appropriate closing tag(s) (for each Liquid block), to the `head` if the
 partitioning resulted in leaving the closing tag somewhere in the `tail` partition.
179436
def sanctify_liquid_tags(head)
      modified  = false
      tag_names = head.scan(LIQUID_TAG_REGEX)
      tag_names.flatten!
      tag_names.reverse_each do |tag_name|
        next unless liquid_block?(tag_name)
        next if head =~ endtag_regex_stash(tag_name)

        modified = true
        head << "\n{% end#{tag_name} %}"
      end

      print_build_warning if modified
      head
    end
55474
function(tag, line_number, offset) {
  while (!canContain(this.tip.t, tag)) {
    this.finalize(this.tip, line_number);
  }

  var column_number = offset + 1; // offset 0 = column 1
  var newBlock = makeBlock(tag, line_number, column_number);
  this.tip.children.push(newBlock);
  newBlock.parent = this.tip;
  this.tip = newBlock;
  return newBlock;
}
782571
def add_tag(self, name, value):
        

        self.tags.append(Tag(name, value))
439643
def innerHTML(self):
        '''
            
        '''

        # If a self-closing tag, there are no contents
        if self.isSelfClosing is True:
            return ''

        # Assemble all the blocks.
        ret = []

        # Iterate through blocks
        for block in self.blocks:
            # For each block:
            #   If a tag, append the outer html (start tag, contents, and end tag)
            #   Else, append the text node directly

            if isinstance(block, AdvancedTag):
                ret.append(block.outerHTML)
            else:
                ret.append(block)
        
        return ''.join(ret)
622061
private void addToPartition(Block<S, L> block) {
        ElementReference ref = partition.referencedAdd(block);
        block.setPartitionReference(ref);
    }
501268
def _put_bucket_tagging(self):
        """"""
        all_tags = self.s3props['tagging']['tags']
        all_tags.update({'app_group': self.group, 'app_name': self.app_name})
        tag_set = generate_s3_tags.generated_tag_data(all_tags)

        tagging_config = {'TagSet': tag_set}

        self.s3client.put_bucket_tagging(Bucket=self.bucket, Tagging=tagging_config)
        LOG.info("Adding tagging %s for Bucket", tag_set)
1034896
private static StringBuffer doAppendTextInsideTag(StringBuffer buffer, String text, String tag, Map<String, String> attributes)
	{
		return appendClosingTag(appendOpeningTag(buffer, tag, attributes).append(text), tag);
	}
450335
def append(self, value):
        
        if self._avm is not None and not self.terminated:
            path = self._last_path
            if path:
                path += '.'
            self[path + LIST_HEAD] = value
            self._last_path = path + LIST_TAIL
            self[self._last_path] = AVM()
        else:
            raise TdlError('Cannot append to a closed list.')
1316520
public function postFlush(): void
    {
        if (empty($this->tags)) {
            return;
        }

        $this->purger->purge($this->tags);
        $this->tags = [];
    }
1017253
private void writeTag() {
        if (dataPos == dataSize)
            return;
        int tag = data[dataPos++];
        if (isEOC(tag) && (data[dataPos] == 0)) {
            dataPos++;  // skip length
            writeTag();
        } else
            newData[newDataPos++] = (byte)tag;
    }
218081
void writeTagNoClear(long bucketIndex, int posInBucket, long tag) {
		long tagStartIdx = getTagOffset(bucketIndex, posInBucket);
		// BIT BANGIN YEAAAARRHHHGGGHHH
		for (int i = 0; i < bitsPerTag; i++) {
			// second arg just does bit test in tag
			if ((tag & (1L << i)) != 0) {
				memBlock.set(tagStartIdx + i);
			}
		}
	}
764807
def appendChild(self, child):
        '''
            
        '''

        # Associate parentNode of #child to this tag
        child.parentNode = self

        # Associate owner document to child and all children recursive
        ownerDocument = self.ownerDocument

        child.ownerDocument = ownerDocument
        for subChild in child.getAllChildNodes():
            subChild.ownerDocument = ownerDocument

        # Our tag cannot be self-closing if we have a child tag
        self.isSelfClosing = False

        # Append to both "children" and "blocks"
        self.children.append(child)
        self.blocks.append(child)
        return child
1356443
def handle_endtag(self, tag):
        
        self.log.debug( u'Encountered an end tag : {0}'.format(tag) )
        if tag in self.sanitizelist:
            self.level -= 1
            return
        if tag in self.unclosedTags:
            return
        if self.isNotPurify or tag in self.whitelist_keys:
            self.data.append(u'</%s>' % tag)
603642
def handle_endtag(self, tagName):
        '''
            
        '''
        inTag = self._inTag
        try:
            # Handle closing tags which should have been closed but weren't
            foundIt = False
            for i in range(len(inTag)):
                if inTag[i].tagName == tagName:
                    foundIt = True
                    break

            if not foundIt:
                sys.stderr.write('WARNING: found close tag with no matching start.\n')
                return

            while inTag[-1].tagName != tagName:
                oldTag = inTag.pop()
                if oldTag.tagName in PREFORMATTED_TAGS:
                    self.inPreformatted -= 1

                self.currentIndentLevel -= 1

            inTag.pop()
            if tagName != INVISIBLE_ROOT_TAG:
                self.currentIndentLevel -= 1
            if tagName in PREFORMATTED_TAGS:
                self.inPreformatted -= 1
        except:
            pass
1133933
def append(label, block)
      if store.key?(label.to_sym) && store[label.to_sym].respond_to?(:<<)
        store[label.to_sym] << block
      else
        store[label.to_sym] = []
        store[label.to_sym] << block
      end
    end
759947
def should_expand(self, tag):
        """"""
        return self.indentation is not None and tag and (
            not self.previous_indent or (
                tag.serializer == 'list'
                and tag.subtype.serializer in ('array', 'list', 'compound')
            ) or (
                tag.serializer == 'compound'
            )
        )
1158308
def insert_tag(tag, before, root):
    
    if not before:
        root.childs.append(tag)
        tag.parent = root
        return

    if type(before) in [tuple, list]:
        before = first(before)

    # check that `before` is double linked
    if not hasattr(before, "parent"):
        raise ValueError("Input must be double-linked!")

    # put it before first existing identifier
    parent = before.parent
    parent.childs.insert(
        parent.childs.index(before),
        tag
    )
    tag.parent = parent