ensures structure is dirty and at pos newIndex and writable at level 0
197612
public void gotoFreshPosWritable1(int oldIndex, int newIndex, int xor) {
        stabilize(oldIndex);
        gotoFreshPosWritable0(oldIndex, newIndex, xor);
    }
1201530
private void ensureIndexIsUnlocked(String dataDir) {

        Collection<File> lockFiles = new ArrayList<File>(2);
        lockFiles.add(
            new File(
                CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "index") + "write.lock"));
        lockFiles.add(
            new File(
                CmsFileUtil.addTrailingSeparator(CmsFileUtil.addTrailingSeparator(dataDir) + "spellcheck")
                    + "write.lock"));
        for (File lockFile : lockFiles) {
            if (lockFile.exists()) {
                lockFile.delete();
                LOG.warn(
                    "Forcely unlocking index with data dir \""
                        + dataDir
                        + "\" by removing file \""
                        + lockFile.getAbsolutePath()
                        + "\".");
            }
        }
    }
233815
def init_write_index(es_write, es_write_index):
    
    logging.info("Initializing index: " + es_write_index)
    es_write.indices.delete(es_write_index, ignore=[400, 404])
    es_write.indices.create(es_write_index, body=MAPPING_GIT)
1253664
public long clean(final int currentRevisionIndex, final int revisionIndex)
	{

		if (first == null) {
			return 0;
		}
		else if (this.set.isEmpty()) {
			this.first = null;
			this.size = 0;
			return 0;
		}

		ChronoStorageBlock next, prev, current = first;
		boolean remove;

		do {
			remove = false;

			if (current.isDelivered()) {

				next = current.getCounterNext();

				if (next != null) {
					if (current.getRevisionCounter() + 1 == next
							.getRevisionCounter()) {
						remove = true;
					}
				}

			}
			else if (current.getIndexNext() == null
					&& current.getIndexPrev() == null) {

				remove = (current.getRevisionIndex() < currentRevisionIndex)
						|| (current.getRevisionIndex() == revisionIndex);
			}

			if (remove) {
				// System.out.println("Clearn CFR : " +
				// current.getRevisionCounter());

				prev = current.getCounterPrev();
				next = current.getCounterNext();

				current.setCounterNext(null);
				current.setCounterPrev(null);

				if (prev != null) {
					prev.setCounterNext(next);
				}
				if (next != null) {
					next.setCounterPrev(prev);
				}
				if (current == first) {
					this.first = next;
				}

				this.size -= current.length();
				current = next;
			}

			if (current != null) {
				current = current.getCounterNext();
			}

		}
		while (current != null);

		return this.size;
	}
611279
function clean(collection) {
    var ns = /\S/;
    collection.each(function(el) {
        var d = el,
            n = d.firstChild,
            ni = -1,
            nx;
        while (n) {
            nx = n.nextSibling;
            if (n.nodeType == 3 && !ns.test(n.nodeValue)) {
                d.removeChild(n);
            } else {
                n.nodeIndex = ++ni; // FIXME not sure what this is for, and causes IE to bomb (the setter) - @rem
            }
            n = nx;
        }
    });
}
1169690
private void writeIndex(int entryAddress,
                          byte []entryBuffer, int offset, int length)
  {
    long address = _segment.getAddress() + entryAddress;

    if (_segment.length() < entryAddress + length) {
      throw new IllegalStateException(L.l("offset=0x{0} length={1}", entryAddress, length));
    }
    //try (StoreWrite os = _readWrite.openWrite(address, BLOCK_SIZE)) {
    _sOut.write(address, entryBuffer, offset, length);
    
    _isDirty = true;
    // }
  }
1103463
void reset()
  {
    _deleteNode = null;
    _deleteIndex = 0;
    _targetNode = null;
    _targetIndex = 0;
    _type = NONE;
    _notFound = true;
  }
267515
public void setPosition(int newIndex) {
    if (index != newIndex) {
      if (index == -1 || index > newIndex) {
        pos = 0;
        index = 0;
      } else {
        index++;
        if (length != NULL_LENGTH) {
          pos += length;
        }
      }

      for (; index <= newIndex; index++) {
        if (index != newIndex) {
          int type = this.buf[this.pos++] & 0xff;
          switch (type) {
            case 251:
              break;
            case 252:
              pos += 2 + (0xffff & (((buf[pos] & 0xff) + ((buf[pos + 1] & 0xff) << 8))));
              break;
            case 253:
              pos += 3 + (0xffffff & ((buf[pos] & 0xff)
                  + ((buf[pos + 1] & 0xff) << 8)
                  + ((buf[pos + 2] & 0xff) << 16)));
              break;
            case 254:
              pos += 8 + ((buf[pos] & 0xff)
                  + ((long) (buf[pos + 1] & 0xff) << 8)
                  + ((long) (buf[pos + 2] & 0xff) << 16)
                  + ((long) (buf[pos + 3] & 0xff) << 24)
                  + ((long) (buf[pos + 4] & 0xff) << 32)
                  + ((long) (buf[pos + 5] & 0xff) << 40)
                  + ((long) (buf[pos + 6] & 0xff) << 48)
                  + ((long) (buf[pos + 7] & 0xff) << 56));
              break;
            default:
              pos += type;
              break;
          }
        } else {
          int type = this.buf[this.pos++] & 0xff;
          switch (type) {
            case 251:
              length = NULL_LENGTH;
              this.lastValueNull = BIT_LAST_FIELD_NULL;
              return;
            case 252:
              length = 0xffff & ((buf[pos++] & 0xff)
                  + ((buf[pos++] & 0xff) << 8));
              break;
            case 253:
              length = 0xffffff & ((buf[pos++] & 0xff)
                  + ((buf[pos++] & 0xff) << 8)
                  + ((buf[pos++] & 0xff) << 16));
              break;
            case 254:
              length = (int) ((buf[pos++] & 0xff)
                  + ((long) (buf[pos++] & 0xff) << 8)
                  + ((long) (buf[pos++] & 0xff) << 16)
                  + ((long) (buf[pos++] & 0xff) << 24)
                  + ((long) (buf[pos++] & 0xff) << 32)
                  + ((long) (buf[pos++] & 0xff) << 40)
                  + ((long) (buf[pos++] & 0xff) << 48)
                  + ((long) (buf[pos++] & 0xff) << 56));
              break;
            default:
              length = type;
              break;
          }
          this.lastValueNull = BIT_LAST_FIELD_NOT_NULL;
          return;
        }
      }
    }
    this.lastValueNull = length == NULL_LENGTH ? BIT_LAST_FIELD_NULL : BIT_LAST_FIELD_NOT_NULL;
  }
616937
@Override
	public void setXY(int index, Point2D pt) {
		if (index < 0 || index >= m_pointCount)
			// TODO exception
			throw new IndexOutOfBoundsException();

		_verifyAllStreams();
		// AttributeStreamOfDbl v = (AttributeStreamOfDbl)
		// m_vertexAttributes[0];
		AttributeStreamOfDbl v = (AttributeStreamOfDbl) m_vertexAttributes[0];
		v.write(index * 2, pt);
		notifyModified(DirtyFlags.DirtyCoordinates);
	}
114735
def thrift_print(structure, offset=0):
    
    if not is_thrift_item(structure):
        return str(structure)
    s = str(structure.__class__) + '\n'
    for key in dir(structure):
        if key.startswith('_') or key in ['thrift_spec', 'read', 'write',
                                          'default_spec', 'validate']:
            continue
        s = s + ' ' * offset + key + ': ' + thrift_print(getattr(structure, key)
                                                         , offset+2) + '\n'
    return s
1025426
def dirty(name,
          target,
          user=None,
          username=None,
          password=None,
          ignore_unversioned=False):
    '''
    
    '''
    ret = {'name': name, 'result': True, 'comment': '', 'changes': {}}
    return _fail(ret, 'This function is not implemented yet.')
1072766
def clean
      if @dirty
        @store = FFI::MemoryPointer.new @element_size, @items.size, true

        # copy over
        offset = 0
        @items.each do |item|
          LibC.memcpy(@store + offset, item.pointer, @element_size)
          offset += @element_size
        end

        @dirty = false
      end
    end
399095
function(current, position) {

      var x, newNode, node, firstChild;

      // create a new node
      newNode = current.cloneNode(true);

      // create new node in mirror
      if (position == 'before') {

        // insert element
        current.parentNode.insertBefore(newNode, current);

      }

      // re-init sortable
      hashedit.setupSortable();

      return newNode;

    }
605150
private void logUnexpectedStructure()
   {
      if (m_log != null)
      {
         m_log.println("ABORTED COLUMN - unexpected structure: " + m_currentColumn.getClass().getSimpleName() + " " + m_currentColumn.getName());
      }
   }
277810
def sparse_reindex(self, new_index):
        
        if not isinstance(new_index, splib.SparseIndex):
            raise TypeError("new index must be a SparseIndex")
        values = self.values
        values = values.sp_index.to_int_index().reindex(
            values.sp_values.astype('float64'), values.fill_value, new_index)
        values = SparseArray(values,
                             sparse_index=new_index,
                             fill_value=self.values.fill_value)
        return self._constructor(values, index=self.index).__finalize__(self)
52885
public void repairIndex() throws IOException {
        byte[] currentLargestKey = new byte[keySize];
        int maxChunk = getChunkIndex(getFilledUpFromContentStart());
        for (int currentChunkId = 0; currentChunkId <= maxChunk; currentChunkId++) {
            long currentOffset = (currentChunkId + 1) * getChunkSize() - elementSize;
            if (currentOffset < getFilledUpFromContentStart()) {
                read(currentOffset, currentLargestKey);
            } else {
                read(getFilledUpFromContentStart() - elementSize, currentLargestKey);
            }
            getIndex().setLargestKey(currentChunkId, currentLargestKey);
        }
    }
33221
def index(self, index):
        
        if self._index != index:
            self._dirty = True
        self._index = index