method replace section
766404
function(func, ctx, partials) {
      var cx = ctx[ctx.length - 1];
      return func.call(cx);
    }
70798
function (out, args) {
            var sections = args.sections;
            for (var i = 0, l = sections.length; i < l; i++) {
                this.__$insertSection(null, sections[i]);
            }
        }
430182
def _DoRepeatedSection(args, context, callback, trace):
    """"""
    
    block = args
    
    items = context.PushSection(block.section_name, block.pre_formatters)
    if items:
        if not isinstance(items, list):
            raise EvaluationError('Expected a list; got %s' % type(items))
        
        last_index = len(items) - 1
        statements = block.Statements()
        alt_statements = block.Statements('alternates with')
        try:
            i = 0
            while True:
                context.Next()
                # Execute the statements in the block for every item in the list.
                # Execute the alternate block on every iteration except the last.  Each
                # item could be an atom (string, integer, etc.) or a dictionary.
                _Execute(statements, context, callback, trace)
                if i != last_index:
                    _Execute(alt_statements, context, callback, trace)
                i += 1
        except StopIteration:
            pass
    
    else:
        _Execute(block.Statements('or'), context, callback, trace)
    
    context.Pop()
1209553
String replace(String source) {
        if (source == null)
            return null;
        Matcher m = PATTERN.matcher(source);
        StringBuffer sb = new StringBuffer();
        while (m.find()) {
            String var = m.group(1);
            String value = values.getProperty(var);
            String replacement = (value != null) ? replace(value) : "";
            m.appendReplacement(sb, Matcher.quoteReplacement(replacement));
        }
        m.appendTail(sb);
        return sb.toString();
    }
1109691
def edit(self, **kwargs):
        
        part = '/library/sections/%s?%s' % (self.key, urlencode(kwargs))
        self._server.query(part, method=self._server._session.put)

        # Reload this way since the self.key dont have a full path, but is simply a id.
        for s in self._server.library.sections():
            if s.key == self.key:
                return s
927653
private void replaceContent(IndexNode other) throws IOException {
      try {
         lock.writeLock().lock();
         this.prefix = other.prefix;
         this.keyParts = other.keyParts;
         this.innerNodes = other.innerNodes;
         this.leafNodes = other.leafNodes;
         this.contentLength = -1;
         this.totalLength = -1;
      } finally {
         lock.writeLock().unlock();
      }

      // don't have to acquire any lock here
      // the only node with offset < 0 is the root - we can't lose reference to it
      if (offset >= 0) {
         store(new Index.IndexSpace(offset, occupiedSpace));
      }
   }
528777
def remove_line(self, section):
        
        self.beginResetModel()
        self.collection.pop(section)
        self.endResetModel()
139500
def del_section(self, section):
        
        if self.config.has_section(section):
            self.config.remove_section(section)
            return (True, self.config.sections())
        return (False, 'Section: ' + section + ' does not exist')
724917
function replaceString(content, search, replace) {
        var index = 0;

        do {
          index = content.indexOf(search, index);

          if (index !== -1) {
            content = content.substring(0, index) + replace + content.substr(index + search.length);
            index += replace.length - search.length + 1;
          }
        } while (index !== -1);

        return content;
      }
245850
def replaceWith(self, param):
        """"""
        i = self.parent().children().index(self)
        # TODO: transfer the children:
        p = self.parent()
        self.parent().removeChild(self)
        p.insertChild(i, param)
        self = param
254900
public static void replaceIsElement(HTMLElement context, String identifier, IsElement newElement) {
        replaceElement(context, identifier, newElement.element());
    }
1194747
def replace(self, old, new):
        """"""
        if old.type != new.type:
            raise TypeError("new instruction has a different type")
        pos = self.instructions.index(old)
        self.instructions.remove(old)
        self.instructions.insert(pos, new)

        for bb in self.parent.basic_blocks:
            for instr in bb.instructions:
                instr.replace_usage(old, new)
512155
function replaceOutputPlaceholders(source, value) {
		var ranges = locateOutputPlaceholder(source);
		
		ranges.reverse().forEach(function(r) {
			source = utils.replaceSubstring(source, value, r);
		});
		
		return source;
	}
196769
def replace(self, text, pattern=None):
        """"""
        cursor = self.textCursor()
        cursor.beginEditBlock()
        if pattern is not None:
            seltxt = to_text_string(cursor.selectedText())
        cursor.removeSelectedText()
        if pattern is not None:
            text = re.sub(to_text_string(pattern),
                          to_text_string(text), to_text_string(seltxt))
        cursor.insertText(text)
        cursor.endEditBlock()
203535
function getSection(document, sectionNumber) {
  var content = markupFiles.getSection(document, sectionNumber);
  return replacements(document, replacements(document, content));
}
64673
public void replaceWithNewInstances(Collection<SSTableReader> toReplace, Collection<SSTableReader> replaceWith)
    {
        replaceReaders(toReplace, replaceWith, true);
    }
623123
protected function replaceSection( $content, $section, $marker )
	{
		$start = 0;
		$len = strlen( $section );
		$marker = '<!-- ' . $marker . ' -->';

		while( ( $start = @strpos( $content, $marker, $start ) ) !== false )
		{
			if( ( $end = strpos( $content, $marker, $start + 1 ) ) !== false ) {
				$content = substr_replace( $content, $section, $start, $end - $start + strlen( $marker ) );
			}

			$start += 2 * strlen( $marker ) + $len;
		}

		return $content;
	}