TODO: Move to some common util
197104
private static int intFromBigEndian(final byte[] array, final int index) {
        return ((array[index     ] & 0xff) << 24) |
                ((array[index + 1] & 0xff) << 16) |
                ((array[index + 2] & 0xff) <<  8) |
                ((array[index + 3] & 0xff)      );
    }
86733
def -(other)
      other = other.to_key_path
      raise KeyError unless prefix?(other)

      super(other.length)
    end
948848
function common(words) {
  return _.map(words, function(o) {
    return o.word.toLowerCase();
  }).sort();
}
1118080
def do_mv(self, from_path, to_path, nothing = ''):
        """"""
        self.n.doMove(self.current_path + from_path,
                      self.current_path + to_path)
878182
function moveToValue(value) {
    const left = 100 * (value - this.min) / (this.max - this.min);
    Dom.css(this.$elements.button, { left: `${left}%` });
}
118361
def moveToPoint(self, xxx_todo_changeme):
        
        (x,y) = xxx_todo_changeme
        self.set_x(float(self.get_x()) + float(x))
        self.set_y(float(self.get_y()) + float(y))
499353
function CliDispatch (action, dir, baseDir) {
  this.action = action
  this.dir = dir
  this.baseDir = baseDir
}
922784
function occupySlice(
  targetArr: Array<?string>,
  start: number,
  end: number,
  componentKey: string
): void {
  // eslint-disable-next-line no-plusplus
  for (let ii = start; ii < end; ii++) {
    // eslint-disable-next-line no-param-reassign
    targetArr[ii] = componentKey;
  }
}
1299766
def add_moveTo(self, x, y):
        
        moveTo = self._add_moveTo()
        pt = moveTo._add_pt()
        pt.x, pt.y = x, y
        return moveTo
1344959
function(cb) {
		var todos = [], prevTodos;
		var model = this;

		open().then(function(db){
			var os = db.transaction(["todos"], "readwrite")
				.objectStore("todos");

			var req = os.openCursor();

			req.onsuccess = function(e){
				var cursor = e.target.result;
				if(cursor){
					todos.push(cursor.value);
					cursor.continue();
				} else {
					prevTodos = todos.slice();
					cb.call(model, todos);
					done();
				}
			};

			function done(){
				(todos || []).forEach(function(todo){
					os.put(todo);
				});
				prevTodos.forEach(function(todo){
					if(todos.indexOf(todo) === -1) {
						os["delete"](todo.text);
					}
				});
			}
		});
	  }
787484
public static <T, K> boolean move(List<T> list, K key,
			Function<T, K> keyMapper, int n) {
		if (n == 0)
			return false;

		if (n > 0)
			return moveDown(list, key, keyMapper, n);

		return moveUp(list, key, keyMapper, -n);
	}
295941
def +(other)
      SearchAtom.new(@records.clone.merge!(other.records) { |key, _old, _new|
                                                            _old + _new
                                                          })
    end
399680
function makeMove(child, afterNode, toIndex) {
	  // NOTE: Null values reduce hidden classes.
	  return {
	    type: ReactMultiChildUpdateTypes.MOVE_EXISTING,
	    content: null,
	    fromIndex: child._mountIndex,
	    fromNode: ReactReconciler.getHostNode(child),
	    toIndex: toIndex,
	    afterNode: afterNode
	  };
	}
663923
def move(self):
        """"""
        if not os.path.isdir(self.outdir):
            os.makedirs(self.outdir)
        shutil.move(self.tmpdir, os.path.join(self.outdir, self.name))
981771
function move(root, nextTag, isVirtual) {
      if (isVirtual)
        { moveVirtual.apply(this, [root, nextTag]); }
      else
        { safeInsert(root, this.root, nextTag.root); }
    }
337710
private void introduceMoveOperation() {
        for (int i = 0; i < diffs.size(); i++) {
            Diff diff1 = diffs.get(i);

            // if not remove OR add, move to next diff
            if (!(Operation.REMOVE == diff1.getOperation() ||
                    Operation.ADD == diff1.getOperation())) {
                continue;
            }

            for (int j = i + 1; j < diffs.size(); j++) {
                Diff diff2 = diffs.get(j);
                if (!diff1.getValue().equals(diff2.getValue())) {
                    continue;
                }

                Diff moveDiff = null;
                if (Operation.REMOVE == diff1.getOperation() &&
                        Operation.ADD == diff2.getOperation()) {
                    JsonPointer relativePath = computeRelativePath(diff2.getPath(), i + 1, j - 1, diffs);
                    moveDiff = new Diff(Operation.MOVE, diff1.getPath(), relativePath);

                } else if (Operation.ADD == diff1.getOperation() &&
                        Operation.REMOVE == diff2.getOperation()) {
                    JsonPointer relativePath = computeRelativePath(diff2.getPath(), i, j - 1, diffs); // diff1's add should also be considered
                    moveDiff = new Diff(Operation.MOVE, relativePath, diff1.getPath());
                }
                if (moveDiff != null) {
                    diffs.remove(j);
                    diffs.set(i, moveDiff);
                    break;
                }
            }
        }
    }
1157841
function common_start(params) {
      params.umecob = params.umecob || umecob;
      var configs = get_current_setting(params);
      /* execute start functions */
      for (var i in configs.start) {
        configs.start[i].call(configs, params);
      }
      return configs;
    }