The tr element prior in sequence to the tr this cell appears in.
        Raises |ValueError| if called on a cell in the top-most row.
516009
def _tr_above(self):
        
        tr_lst = self._tbl.tr_lst
        tr_idx = tr_lst.index(self._tr)
        if tr_idx == 0:
            raise ValueError('no tr above topmost tr')
        return tr_lst[tr_idx-1]
665308
def previous_element(name = nil)
      if siblings = parent.children
        found = nil
        siblings.each do |node|
          return found if node.equal?(self)
          found = node if node.tag? && (name.nil? || node.name == name)
        end
      end
      nil
    end
153986
public function prev()
    {
        if ($this->position <= $this->startColumn) {
            throw new PHPExcel_Exception(
                "Column is already at the beginning of range (" .
                PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . " - " .
                PHPExcel_Cell::stringFromColumnIndex($this->endColumn) . ")"
            );
        }

        do {
            --$this->position;
        } while (($this->onlyExistingCells) &&
            (!$this->subject->cellExistsByColumnAndRow($this->position, $this->rowIndex)) &&
            ($this->position >= $this->startColumn));
    }
1208719
def getTableMisnestedNodePosition(self):
        """"""
        # The foster parent element is the one which comes before the most
        # recently opened table element
        # XXX - this is really inelegant
        lastTable = None
        fosterParent = None
        insertBefore = None
        for elm in self.openElements[::-1]:
            if elm.name == "table":
                lastTable = elm
                break
        if lastTable:
            # XXX - we should really check that this parent is actually a
            # node here
            if lastTable.parent:
                fosterParent = lastTable.parent
                insertBefore = lastTable
            else:
                fosterParent = self.openElements[
                    self.openElements.index(lastTable) - 1]
        else:
            fosterParent = self.openElements[0]
        return fosterParent, insertBefore
505958
int getTertiaryBefore(long p, int s, int t) {
        assert((t & ~Collation.ONLY_TERTIARY_MASK) == 0);
        int index;
        int previousTer;
        long secTer;
        if(p == 0) {
            if(s == 0) {
                index = (int)elements[IX_FIRST_TERTIARY_INDEX];
                // Gap at the beginning of the tertiary CE range.
                previousTer = 0;
            } else {
                index = (int)elements[IX_FIRST_SECONDARY_INDEX];
                previousTer = Collation.BEFORE_WEIGHT16;
            }
            secTer = elements[index] & ~SEC_TER_DELTA_FLAG;
        } else {
            index = findPrimary(p) + 1;
            previousTer = Collation.BEFORE_WEIGHT16;
            secTer = getFirstSecTerForPrimary(index);
        }
        long st = ((long)s << 16) | t;
        while(st > secTer) {
            if((int)(secTer >> 16) == s) { previousTer = (int)secTer; }
            assert((elements[index] & SEC_TER_DELTA_FLAG) != 0);
            secTer = elements[index++] & ~SEC_TER_DELTA_FLAG;
        }
        assert(secTer == st);
        return previousTer & 0xffff;
    }
928895
def _preceding_siblings(
            self, qname: Union[QualName, bool] = None) -> List[InstanceNode]:
        """"""
        if qname and self.qual_name != qname:
            return []
        res = []
        en = self
        for _ in self.before:
            en = en.previous()
            res.append(en)
        return res
310847
function focusToFirstTd(sq, range, $tr, tableMgr) {
  const nextFocusCell = $tr.find('td').get(0);
  range.setStart(nextFocusCell, 0);
  range.collapse(true);

  tableMgr.setLastCellNode(nextFocusCell);
  sq.setSelection(range);
}
1321300
def _grid_col(self):
        
        tr = self._tr
        idx = tr.tc_lst.index(self)
        preceding_tcs = tr.tc_lst[:idx]
        return sum(tc.grid_span for tc in preceding_tcs)
711632
function before (el, newEl) {
  if (typeof newEl === 'string') {
    return el.insertAdjacentHTML('beforebegin', newEl)
  } else {
    return el.parentNode.insertBefore(newEl, el)
  }
}
864858
def _prior_headerfooter(self):
        """"""
        preceding_sectPr = self._sectPr.preceding_sectPr
        return (
            None if preceding_sectPr is None
            else _Header(preceding_sectPr, self._document_part, self._hdrftr_index)
        )
1262217
def GetCellValue (self, column, row = None, default = None):
                
                if row == None:
                        (row, column) = ParseCellSpec(column)
                if row in self:
                        return self[row].GetCellValue(column, default)
                return default
1213893
def find_previous(element, l):
    
    length = len(l)
    for index, current in enumerate(l):
        # current is the last element
        if length - 1 == index:
            return current

        # current is the first element
        if index == 0:
            if element < current:
                return None

        if current <= element < l[index+1]:
            return current
387058
public boolean isBefore(T element) {
    if (element == null) { return false; }
    return comparator.compare(element, max) > 0;
  }
771736
def precedes(self, other):
        """"""
        try:
            ancestor = next(commonancestors(AbstractElement, self, other))
        except StopIteration:
            raise Exception("Elements share no common ancestor")
        #now we just do a depth first search and see who comes first
        def callback(e):
            if e is self:
                return True
            elif e is other:
                return False
            return None
        result = ancestor.depthfirstsearch(callback)
        if result is None:
            raise Exception("Unable to find relation between elements! (shouldn't happen)")
        return result
675009
public void previsit(Collection<? extends IRenderingElement> elements) {
        Deque<IRenderingElement> queue = new ArrayDeque<>(2 * elements.size());
        queue.addAll(elements);

        FreqMap<Color> strokeFreq = new FreqMap<>();
        FreqMap<Color> fillFreq = new FreqMap<>();
        FreqMap<Double> strokeWidthFreq = new FreqMap<>();

        while (!queue.isEmpty()) {
            IRenderingElement element = queue.poll();
            // wrappers first
            if (element instanceof Bounds) {
                queue.add(((Bounds) element).root());
            } else if (element instanceof MarkedElement) {
                queue.add(((MarkedElement) element).element());
            } else if (element instanceof ElementGroup) {
                for (IRenderingElement child : (ElementGroup) element)
                    queue.add(child);
            } else if (element instanceof LineElement) {
                strokeFreq.add(((LineElement) element).color);
                strokeWidthFreq.add(scaled(((LineElement) element).width));
            } else if (element instanceof GeneralPath) {
                if (((GeneralPath) element).fill)
                    fillFreq.add(((GeneralPath) element).color);
            } else {
                // ignored
            }
        }

        if (!defaultsWritten) {
            defaultFill = fillFreq.getMostFrequent();
            defaultStroke = strokeFreq.getMostFrequent();
            Double strokeWidth = strokeWidthFreq.getMostFrequent();
            if (strokeWidth != null)
                defaultStrokeWidth = toStr(strokeWidth);
        }
    }
1188225
private Object getPreviousElement() {
        Object element = null;
        while (currentIndex >= startIndex && element == null) {
            currentIndex--;
            element = getElement();
        }
        return element;
    }
647960
def get_sequence_value(node):
        
        assert node.datatype() == 15
        data = defaultdict(list)
        cols = []
        for i in range(node.numValues()):
            row = node.getValue(i)
            if i == 0:  # Get the ordered cols and assume they are constant
                cols = [str(row.getElement(_).name()) for _ in range(row.numElements())]

            for cidx in range(row.numElements()):
                col = row.getElement(cidx)
                data[str(col.name())].append(XmlHelper.as_value(col))
        return pd.DataFrame(data, columns=cols)