Adjust the locations of the ast nodes, offsetting them
    to the new lineno and column offset
515053
def adjust_locations(ast_node, first_lineno, first_offset):
    

    line_delta = first_lineno - 1

    def _fix(node):
        if 'lineno' in node._attributes:
            lineno = node.lineno
            col = node.col_offset

            # adjust the offset on the first line
            if lineno == 1:
                col += first_offset

            lineno += line_delta

            node.lineno = lineno
            node.col_offset = col

        for child in iter_child_nodes(node):
            _fix(child)

    _fix(ast_node)
527949
def _add_offsets_to_token_nodes(self):
        
        for edge_index in self._textual_relation_ids:
            token_node_index = self.edges[edge_index].source
            self.nodes[token_node_index].onset = self.edges[edge_index].onset
            self.nodes[token_node_index].offset = self.edges[edge_index].offset
1339256
def alignXY(self):
        """"""

        # figure out what data we have and will align to
        xVals=[]
        xCols=[x for x in range(self.nCols) if self.colTypes[x]==3]
        yCols=[x for x in range(self.nCols) if self.colTypes[x]==0]
        xCols,yCols=np.array(xCols),np.array(yCols)
        for xCol in xCols:
            xVals.extend(self.colData[xCol])
        #xVals=list(np.round(set(xVals),5))
        xVals=list(sorted(list(set(xVals))))

        # prepare our new aligned dataset
        newData=np.empty(len(xVals)*self.nCols)
        newData[:]=np.nan
        newData=newData.reshape(len(xVals),self.nCols)
        oldData=np.round(self.data,5)

        # do the alignment
        for xCol in xCols:
            columnsToShift=[xCol]
            for col in range(xCol+1,self.nCols):
                if self.colTypes[col]==0:
                    columnsToShift.append(col)
                else:
                    break
            # determine how to move each row
            for row in range(len(oldData)):
                oldXvalue=oldData[row,xCol]
                if oldXvalue in xVals:
                    newRow=xVals.index(oldXvalue)
                    newData[newRow,columnsToShift]=oldData[row,columnsToShift]

        # commit changes
        newData[:,0]=xVals
        self.data=newData
        self.onex()
376091
private void adjustOverhead(final ObjectGraphNode node) {
		ObjectGraphNode[] originalChildren = new ObjectGraphNode[node.getChildCount()];
		int dataSize = 0;

		for (int i = 0; i < node.getChildCount(); i++) {
			ObjectGraphNode childNode = (ObjectGraphNode) node.getChildAt(i);
			dataSize += childNode.getSize();
			originalChildren[i] = childNode;
		}

		node.removeAll();

		// Figure out the list overhead.
		// All the original children will be included refs, as they have already been visited.
		visitComplexType(node);
		node.setSize(node.getSize() - originalChildren.length * ObjectGraphNode.OBJREF_SIZE);

		// re-attach the old children
		node.removeAll();

		for (int i = 0; i < originalChildren.length; i++) {
			node.add(originalChildren[i]);
		}
	}
1269405
function position() {
    var start = { line: lineno, column: column };
    return function(node){
      node.position = new Position(start);
      whitespace();
      return node;
    };
  }
319565
def mapToAbsPosition(self, line, column):
        
        block = self.document().findBlockByNumber(line)
        if not block.isValid():
            raise IndexError("Invalid line index %d" % line)
        if column >= block.length():
            raise IndexError("Invalid column index %d" % column)
        return block.position() + column
1347053
def normalize_bboxes(bboxes, rows, cols):
    """"""
    return [normalize_bbox(bbox, rows, cols) for bbox in bboxes]
808095
def set_column_stretch(self, column=0, stretch=10):
        
        self._layout.setColumnStretch(column, stretch)
        return self
719173
function(node) {
    if (node) {
        this.start = {
            line: node.start.line,
            column: node.start.column
        };
        this.end = {
            line: node.end.line,
            column: node.end.column
        };
        this.offset = {
            start: node.start.offset,
            end: node.end.offset
        };
    }
}
211506
function(node) {
        // Re-adjust the offset to match the parent container
        // is() fails when checking against window
        if (container[0] !== window) {
            var conOffset = container.offset();

            left -= conOffset.left;
            top -= conOffset.top;
        }
    }
276006
void overlayLeftShift(
    int           ix)
  {
    for (int j = ix; j < rightMostIndex(); j++)
      _nodeKey[j] = _nodeKey[j+1];
  }
363858
def _swap_columns(self, side):
        """"""
        displayed_cols = self._displayed_cols
        i1 = self._dragged_col_index
        i2 = i1 + 1 if side == 'right' else i1 - 1
        if 0 <= i2 < len(displayed_cols):
            # there is a neighbor, swap columns:
            displayed_cols[i1] = displayed_cols[i2]
            displayed_cols[i2] = self._dragged_col
            self["displaycolumns"] = displayed_cols
            if side == 'left':
                right = self._dragged_col_neighbor_widths[0]
                self._dragged_col_x -= right  # update dragged column x coordinate
                # set new left neighbor width
                if i2 > 0:
                    left = ttk.Treeview.column(self, displayed_cols[i2 - 1], 'width')
                else:
                    left = None
            else:
                left = self._dragged_col_neighbor_widths[1]
                self._dragged_col_x += left  # update x coordinate of dragged column
                # set new right neighbor width
                if i2 < len(displayed_cols) - 1:
                    right = ttk.Treeview.column(self, displayed_cols[i2 + 1], 'width')
                else:
                    right = None
            self._dragged_col_index = i2  # update dragged column index
            self._dragged_col_neighbor_widths = (left, right)
632018
def adjustText(self):
        
        pos = self.cursorPosition()
        self.blockSignals(True)
        super(XLineEdit, self).setText(self.formatText(self.text()))
        self.setCursorPosition(pos)
        self.blockSignals(False)
155791
def set_origin(self, offset):
        """"""
        offset = np.array(offset)
        for node in self.worldbody.findall("./*[@pos]"):
            cur_pos = string_to_array(node.get("pos"))
            new_pos = cur_pos + offset
            node.set("pos", array_to_string(new_pos))
773840
private void adjust(ExtendedCisTrans elem) {

        IBond   middle = elem.getFocus();
        IAtom[] ends   = ExtendedCisTrans.findTerminalAtoms(container, middle);
        IBond[] bonds  = elem.getCarriers().toArray(new IBond[2]);

        IAtom left  = ends[0];
        IAtom right = ends[1];

        int p = parity(elem);
        int q = parity(getAtoms(left, bonds[0].getOther(left), right))
                * parity(getAtoms(right, bonds[1].getOther(right), left));

        // configuration is unspecified? then we add an unspecified bond.
        // note: IDoubleBondStereochemistry doesn't indicate this yet
        if (p == 0) {
            for (IBond bond : container.getConnectedBondsList(left))
                bond.setStereo(IBond.Stereo.NONE);
            for (IBond bond : container.getConnectedBondsList(right))
                bond.setStereo(IBond.Stereo.NONE);
            bonds[0].setStereo(IBond.Stereo.UP_OR_DOWN);
            return;
        }

        // configuration is already correct
        if (p == q) return;

        Arrays.fill(visited, false);
        visited[atomToIndex.get(left)] = true;

        if (ringSearch.cyclic(atomToIndex.get(middle.getBegin()),
                              atomToIndex.get(middle.getEnd()))) {
            return;
        }

        for (int w : graph[atomToIndex.get(right)]) {
            if (!visited[w]) reflect(w, middle);
        }
    }
613424
function setOffsetToRangeLines(baseAndStartLine, endLine) {
                const baseLine = baseAndStartLine
                for (let lineNo = baseLine + 1; lineNo <= endLine; lineNo++) {
                    const offset = offsets.get(lineNo)
                    if (offset) {
                        if (offset.baseline <= baseLine) {
                            offset.baseline = baseLine
                            offset.offset = 1
                        }
                    } else {
                        setOffsetToLine(lineNo, 1, baseLine)
                    }
                }
            }
157707
def fixup_offsets(self, new_start, node):
        """"""
        if hasattr(node, 'start'):
            node.start += new_start
            node.finish += new_start
        for n in node:
            if hasattr(n, 'offset'):
                if hasattr(n, 'start'):
                    n.start += new_start
                    n.finish += new_start
            else:
                self.fixup_offsets(new_start, n)
        return