Updates the start and end attributes by charcount for the element.
343249
def _element_charfix(self, element, charcount):
        """"""
        element.start += charcount
        element.docstart += charcount
        element.end += charcount
        element.docend += charcount
1071555
def addQuickElement(self, name, contents=None, attrs=None, escape=True, cdata=False):
        """"""
        if attrs is None:
            attrs = {}
        self.startElement(name, attrs)
        if contents is not None:
            self.characters(contents, escape=escape, cdata=cdata)
        self.endElement(name)
142064
def addStartTag(contents, startTag):
    '''
        
    '''

    matchObj = DOCTYPE_MATCH.match(contents)
    if matchObj:
        idx = matchObj.end()
    else:
        idx = 0
    return "%s\n%s\n%s" %(contents[:idx], startTag, contents[idx:])
311136
protected function updateStyleAttribute()
    {
        $this->styleString = $this->buildStyleString();

        $this->element->setAttribute('style', $this->styleString);
    }
100934
public void updateAttributes(String targetId, Map<String, String> attributes)
            throws IOException {
        startChangesIfNecessary();
        ResponseWriter writer = getWrapped();
        writer.startElement("attributes", null);
        writer.writeAttribute("id", targetId, null);
        for (Map.Entry<String, String> entry : attributes.entrySet()) {
            writer.startElement("attribute", null);
            writer.writeAttribute("name", entry.getKey(), null);
            writer.writeAttribute("value", entry.getValue(), null);
            writer.endElement("attribute");
        }
        writer.endElement("attributes");
    }
1125026
public JSPStrBuffer replace(int start, int end, String string) {
		sb.replace(start, end, string);
		return this;
	}
1144554
public SpannableStringBuilder replace(int start, int end, CharSequence tb) {
        return replace(start, end, tb, 0, tb.length());
    }
179894
public void startElement(String elemName, Attributes attrs) {
        writeStartElement(elemName, attrs);
        m_tagStack.push(elemName);
    }
301468
@Override
    public void startElement(String uri, String localName, String name, Attributes attributes)
            throws SAXException {
        if ("table".equals(name)) {
            this.currentColumns = new LinkedHashMap<String, Column>();
            this.currentColumnTypes = new TreeMap<String, Integer>(String.CASE_INSENSITIVE_ORDER);
        } else if ("index".equals(name)) {
            this.currentIndex = new Index();
            this.currentIndex.setTable(this.currentTable);
        } else if ("unique".equals(name)) {
            this.currentUnique = new UniqueKey();
            this.currentUnique.setTable(this.currentTable);
        }

        this.chars = new StringBuilder();
    }
1234436
def update_chars(self):
        """"""
        # NOTE: We spoof non-Unix files by returning '\n' on StopIteration
        self.prior_char, self.char = self.char, next(self.characters, '\n')
        self.idx += 1
334733
function (str) {
      var index = this.html.indexOf(str, this.currentChar) + str.length;
      if (index === -1)
        this.currentChar = this.html.length;
      this.currentChar = index;
    }
1263974
public void update(char[] data, int start, int end) {
        int i;

        for (i = start; i < end; i++) {
            if (data[i] == '\n') {
                col = 1;
                line++;
            } else {
                col++;
            }
        }
        ofs += (end - start);
    }
222816
def set_progress_brackets(self, start, end):
        """"""
        self.sep_start = start
        self.sep_end = end
507834
private void appendToBuf(char[] ch, int start, int end) {
        if (start == end) {
            return;
        }
        int neededBufLen = pos + (end - start);
        if (neededBufLen > buf.length) {
            char[] newBuf = new char[neededBufLen];
            System.arraycopy(buf, 0, newBuf, 0, pos);
            if (bufHolder == null) {
                bufHolder = buf; // keep the original around
            }
            buf = newBuf;
        }
        System.arraycopy(ch, start, buf, pos, end - start);
        pos += (end - start);
    }
48404
def apply_attributes(attributed_string, start, length, styles)
      return unless attributed_string && start && length && styles # sanity
      return unless start >= 0 && length > 0 && styles.length > 0  # minimums
      return unless start + length <= attributed_string.length     # maximums

      range = [start, length]

      ATTRIBUTES.each_pair do |method_name, attribute_name|
        value = send method_name, styles
        attributed_string.addAttribute(attribute_name, value: value, range: range) if value
      end
    end
1210395
private void formatAffix2Attribute(boolean isPrefix, Field fieldType,
        StringBuffer buf, int offset, int symbolSize) {
        int begin;
        begin = offset;
        if (!isPrefix) {
            begin += buf.length();
        }

        addAttribute(fieldType, begin, begin + symbolSize);
    }
613637
def update(self, data):
        """"""
        for character in data:
            if PY3:
                ch = character
            else:
                ch = ord(character)
            self.count += 1

            # incr accumulators for triplets
            if self.lastch[1] > -1:
                self.acc[self.tran3(ch, self.lastch[0], self.lastch[1], 0)] +=1
            if self.lastch[2] > -1:
                self.acc[self.tran3(ch, self.lastch[0], self.lastch[2], 1)] +=1
                self.acc[self.tran3(ch, self.lastch[1], self.lastch[2], 2)] +=1
            if self.lastch[3] > -1:
                self.acc[self.tran3(ch, self.lastch[0], self.lastch[3], 3)] +=1
                self.acc[self.tran3(ch, self.lastch[1], self.lastch[3], 4)] +=1
                self.acc[self.tran3(ch, self.lastch[2], self.lastch[3], 5)] +=1
                self.acc[self.tran3(self.lastch[3], self.lastch[0], ch, 6)] +=1
                self.acc[self.tran3(self.lastch[3], self.lastch[2], ch, 7)] +=1

            # adjust last seen chars
            self.lastch = [ch] + self.lastch[:3]