Returns tuple key rect of above right cell
481284
def get_above_right_key_rect(self):
        """"""

        key_above = self.row - 1, self.col, self.tab
        key_above_right = self.row - 1, self.col + 1, self.tab

        border_width_right = \
            float(self.cell_attributes[key_above]["borderwidth_right"]) / 2.0
        border_width_bottom = \
            float(self.cell_attributes[key_above_right]["borderwidth_bottom"])\
            / 2.0

        rect_above_right = (self.x+self.width, self.y-border_width_bottom,
                            border_width_right, border_width_bottom)
        return key_above_right, rect_above_right
436228
def _recSortKey(r):
        
        return r.seqname, r.start, -r.end, r.type
159904
def is_merged_cell_drawn(self, key):
        

        row, col, tab = key

        # Is key not merged? --> False
        cell_attributes = self.code_array.cell_attributes

        top, left, __ = cell_attributes.get_merging_cell(key)

        # Case 1: Top left cell of merge is visible
        # --> Only top left cell returns True
        top_left_drawn = \
            row == top and col == left and \
            self.IsVisible(row, col, wholeCellVisible=False)

        # Case 2: Leftmost column is visible
        # --> Only top visible leftmost cell returns True

        left_drawn = \
            col == left and \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row-1, col, wholeCellVisible=False)

        # Case 3: Top row is visible
        # --> Only left visible top cell returns True

        top_drawn = \
            row == top and \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row, col-1, wholeCellVisible=False)

        # Case 4: Top row and leftmost column are invisible
        # --> Only top left visible cell returns True

        middle_drawn = \
            self.IsVisible(row, col, wholeCellVisible=False) and \
            not self.IsVisible(row-1, col, wholeCellVisible=False) and \
            not self.IsVisible(row, col-1, wholeCellVisible=False)

        return top_left_drawn or left_drawn or top_drawn or middle_drawn
373515
def get_above_left_key_rect(self):
        """"""

        key_above_left = self.row - 1, self.col - 1, self.tab

        border_width_right = \
            float(self.cell_attributes[key_above_left]["borderwidth_right"]) \
            / 2.0
        border_width_bottom = \
            float(self.cell_attributes[key_above_left]["borderwidth_bottom"]) \
            / 2.0

        rect_above_left = (self.x-border_width_right,
                           self.y-border_width_bottom,
                           border_width_right, border_width_bottom)
        return key_above_left, rect_above_left
308856
def get_below_key_rect(self):
        """"""

        key_below = self.row + 1, self.col, self.tab

        border_width_bottom = \
            float(self.cell_attributes[self.key]["borderwidth_bottom"]) / 2.0

        rect_below = (self.x, self.y+self.height,
                      self.width, border_width_bottom)
        return key_below, rect_below
405716
function reflexRight(right, p, i0, i1) {
    for(var i=i0; i<i1; ++i) {
      var a = right[i]
      var b = right[i+1]
      if(orient(p, a, b) <= 0) {
        cells.push([p[2], a[2], b[2]])
      } else {
        return i
      }
    }
    return i1
  }
60726
def separator(self):
        
        cells = dict([(column, "-" * self.column_widths[column]) for column in self.columns])
        return ColorRow(self, **cells)
710042
def keys(self, full_grid=False):
        
        keys = super(GridSpace, self).keys()
        if self.ndims == 1 or not full_grid:
            return keys
        dim1_keys = sorted(set(k[0] for k in keys))
        dim2_keys = sorted(set(k[1] for k in keys))
        return [(d1, d2) for d1 in dim1_keys for d2 in dim2_keys]
983904
def bisect_key_right(self, key):
        
        _maxes = self._maxes

        if not _maxes:
            return 0

        pos = bisect_right(_maxes, key)

        if pos == len(_maxes):
            return self._len

        idx = bisect_right(self._keys[pos], key)

        return self._loc(pos, idx)
495000
def _get_struct_rect(self):
        """"""
        bc = BitConsumer(self._src)
        nbits = bc.u_get(5)
        if self._read_twips:
            return tuple(bc.s_get(nbits) for _ in range(4))
        else:
            return tuple(bc.s_get(nbits) / 20.0 for _ in range(4))
963327
def cells(self):
        
        return {row_key: {column_key:cell for column_key, cell in zip(self._column_keys, cells)}
                for row_key, cells in self._rows_mapping.items()}
252317
private void overlayRightShift(
    int           ix)
  {
    for (int j = ix; j > 0; j--)
      _nodeKey[j] = _nodeKey[j-1];
  }
115632
def rect_list(self):
        
        rectangle_list = []
        for r in self:
            rectangle_list.append((r.x, r.y, r.width, r.height, r.rid))

        return rectangle_list
446081
def get_rect(self):
        
        if self.handle:
            left, top, right, bottom = win32gui.GetWindowRect(self.handle)
            return RECT(left, top, right, bottom)
        else:
            desktop = win32gui.GetDesktopWindow()
            left, top, right, bottom = win32gui.GetWindowRect(desktop)
            return RECT(left, top, right, bottom)
1312584
def toDict(self):
        
        d = {}
        nindices = self.getNumIndices()
        for i in range(self.getNumRows()):
            row = list(self.getRowByIndex(i))
            if nindices > 1:
                key = tuple(row[:nindices])
            elif nindices == 1:
                key = row[0]
            else:
                key = None
            if len(row) - nindices == 0:
                d[key] = None
            elif len(row) - nindices == 1:
                d[key] = row[nindices]
            else:
                d[key] = tuple(row[nindices:])
        return d
821900
def get_r(self):
        """"""

        start_point, end_point = self._get_right_line_coordinates()
        width = self._get_right_line_width()
        color = self._get_right_line_color()

        return CellBorder(start_point, end_point, width, color)
1168569
def get_rt(self):
        """"""

        cell_above_right = CellBorders(self.cell_attributes,
                                       *self.cell.get_above_right_key_rect())
        return cell_above_right.get_b()