Return word at *coordinates* (QPoint)
162769
def get_word_at(self, coordinates):
        """"""
        cursor = self.cursorForPosition(coordinates)
        cursor.select(QTextCursor.WordUnderCursor)
        return to_text_string(cursor.selectedText())
1172867
def includePoint(self, p):
        """"""
        if not len(p) == 2:
            raise ValueError("bad sequ. length")
        self.x0, self.y0, self.x1, self.y1 = TOOLS._include_point_in_rect(self, p)
        return self
1178137
def calculate_text_coords(rectangle_coords):
        """"""
        return (int(rectangle_coords[0] + (rectangle_coords[2] - rectangle_coords[0]) / 2),
                int(rectangle_coords[1] + (rectangle_coords[3] - rectangle_coords[1]) / 2))
360357
def coordinates(self, reference=None):
        
        coordinates = [i._coordinates for i in self.get_trace(reference)]
        return functools.reduce(lambda a, b: a + b, coordinates)
671640
def get_word_vector(self, word):
        """"""
        dim = self.get_dimension()
        b = fasttext.Vector(dim)
        self.f.getWordVector(b, word)
        return np.array(b)
638048
def getQwordAtRva(self, rva):
        
        return datatypes.QWORD.parse(utils.ReadData(self.getDataAtRva(rva,  8)))
688920
private int getOrAppendVertex(Coordinate newCoord, Quadtree ptQuad) {
        Envelope queryEnv = new Envelope(newCoord);
        queryEnv.expandBy(epsilon);
        QuadTreeVisitor visitor = new QuadTreeVisitor(epsilon, newCoord);
        try {
            ptQuad.query(queryEnv, visitor);
        } catch (RuntimeException ex) {
            //ignore
        }
        if (visitor.getNearest() != null) {
            return visitor.getNearest().index;
        }
        // Not found then
        // Append to the list and QuadTree
        EnvelopeWithIndex ret = new EnvelopeWithIndex(triVertex.size(), newCoord);
        ptQuad.insert(queryEnv, ret);
        triVertex.add(ret);
        return ret.index;
    }
251672
def qn(self, namespace):
        """"""
        nsmap = {
            'text': 'urn:oasis:names:tc:opendocument:xmlns:text:1.0',
        }
        spl = namespace.split(':')
        return '{{{}}}{}'.format(nsmap[spl[0]], spl[1])
1135802
def getWordAtOffset(self, offset):
        
        return datatypes.WORD.parse(utils.ReadData(self.getDataAtOffset(offset, 2)))
283201
def word(self, position):
        '''
        
        '''
        if 0 <= position < len(self.wordlist):
            return self.wordlist[position]
        else:
            log.warn('position "{}" is not in sentence of length "{}"!'.format(position, len(self.wordlist)))
            raise IndexError()
342863
def get_quantmap(features, acc_col, quantfields):
    """"""
    qmap = {}
    for feature in features:
        feat_acc = feature.pop(acc_col)
        qmap[feat_acc] = {qf: feature[qf] for qf in quantfields}
    return qmap
155643
def mapFromChart( self, x, y ):
        
        grid      = self.gridRect()
        hruler    = self.horizontalRuler()
        vruler    = self.verticalRuler()
        
        xperc     = hruler.percentAt(x)
        yperc     = vruler.percentAt(y)
        
        xoffset   = grid.width() * xperc
        yoffset   = grid.height() * yperc
        
        xpos      = grid.left() + xoffset
        ypos      = grid.bottom() - yoffset
        
        return QPointF(xpos, ypos)
600847
def get_character(self, position, offset=0):
        """"""
        position = self.get_position(position) + offset
        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.End)
        if position < cursor.position():
            cursor.setPosition(position)
            cursor.movePosition(QTextCursor.Right,
                                QTextCursor.KeepAnchor)
            return to_text_string(cursor.selectedText())
        else:
            return ''
1113292
def loc(self):
        ''''''
        try:
            return '{}:{}'.format(*ParseError.loc_info(self.text, self.index))
        except ValueError:
            return '<out of bounds index {!r}>'.format(self.index)
1036684
def get_word_under_cursor(self):
        

        if not re.match(r"^\w+$", foundations.strings.to_string(self.get_previous_character())):
            return QString()

        cursor = self.textCursor()
        cursor.movePosition(QTextCursor.PreviousWord, QTextCursor.MoveAnchor)
        cursor.movePosition(QTextCursor.EndOfWord, QTextCursor.KeepAnchor)
        return cursor.selectedText()
420860
def cursor(self, pos):
        
        row = self.indexAt(pos).row()
        if row == -1:
            row = self.model().rowCount()
        row_height = self.rowHeight(0)
        y = row_height*row
        x = self.width()
        return QtCore.QLine(0,y,x,y)
613995
def yaml_read_kpoints(filename, doc_tag="!Kpoints"):
    """"""
    with YamlTokenizer(filename) as r:
        doc = r.next_doc_with_tag(doc_tag)
        d = yaml.safe_load(doc.text_notag)

        return np.array(d["reduced_coordinates_of_qpoints"])