Returns a line for the cursor as position *pos*

        :param pos: mouse cursor position
        :type pos: :qtdoc:`QPoint`
        :returns: :qtdoc:`QLine` -- position between items (indicates where drops will go)
165337
def cursor(self, pos):
        
        index = self.splitAt(pos)

        if len(self._rects[index[0]])-1 < index[1]:
            if index[1] == 0:
                # empty row
                x = 0
            else:
                rect = self._rects[index[0]][index[1]-1]
                x = rect.x() + rect.width()
        else:
            rect = self._rects[index[0]][index[1]]
            x = rect.x()

        y0 = index[0]*(ROW_HEIGHT + ROW_SPACE) + ROW_SPACE
        y1 = y0 + ROW_HEIGHT

        # adjust for scrolled viewport
        x -= self.horizontalScrollBar().value()
        y0 -= self.verticalScrollBar().value()
        y1 -= self.verticalScrollBar().value()
        
        return QtCore.QLine(x,y0,x,y1)
442479
def nearestPoint(self, pos):
        
        # lookup subpaths
        for x, y, path in self._subpaths:
            if path.contains(pos):
                return (x, y)
        
        return (None, None)
1010479
def get_mouse_pos(self, window_pos=None):
    """"""
    window_pos = window_pos or pygame.mouse.get_pos()
    # +0.5 to center the point on the middle of the pixel.
    window_pt = point.Point(*window_pos) + 0.5
    for surf in reversed(self._surfaces):
      if (surf.surf_type != SurfType.CHROME and
          surf.surf_rect.contains_point(window_pt)):
        surf_rel_pt = window_pt - surf.surf_rect.tl
        world_pt = surf.world_to_surf.back_pt(surf_rel_pt)
        return MousePos(world_pt, surf)
490712
def line_nbr_from_position(self, y_pos):
        
        editor = self._editor
        height = editor.fontMetrics().height()
        for top, line, block in editor.visible_blocks:
            if top <= y_pos <= top + height:
                return line
        return -1
1287126
function(pos) {
      var doc = this.doc, line = getLine(doc, pos.line).text;
      var start = pos.ch, end = pos.ch;
      if (line) {
        var helper = this.getHelper(pos, "wordChars");
        if ((pos.xRel < 0 || end == line.length) && start) --start; else ++end;
        var startChar = line.charAt(start);
        var check = isWordChar(startChar, helper)
          ? function(ch) { return isWordChar(ch, helper); }
          : /\s/.test(startChar) ? function(ch) {return /\s/.test(ch);}
          : function(ch) {return !/\s/.test(ch) && !isWordChar(ch);};
        while (start > 0 && check(line.charAt(start - 1))) --start;
        while (end < line.length && check(line.charAt(end))) ++end;
      }
      return new Range(Pos(pos.line, start), Pos(pos.line, end));
    }
108879
function(pos){
		var pos0 = this.cursor.getaddr();
		this.cursor.setaddr(pos);
		pos0.draw();
		pos.draw();
	}
1248150
function(pos) {
    var container = this.docCtrl.container;
    var component = container.getComponent(pos[0]);
    return this.getPositionFromComponent(component, pos[1]);
  }
281592
def cursor_position(self):
        
        cpos = self.ui_content.cursor_position
        y, x = self._rowcol_to_yx[cpos.y, cpos.x]
        return Point(x=x - self._x_offset, y=y - self._y_offset)
1084547
def get_record_pos(self, record):
        
        if self.is_stopword_record(record):
            return '~' + record.pos
        else:
            return record.pos
786346
def set_pos(self, pos):
        
        self.pos = pos
        if pos is not None and self.typ is not None:
            self.typ._v_pos = pos
        return self
129629
def pos_to_linecol(text, pos):
    
    line_start = text.rfind("\n", 0, pos) + 1
    line = text.count("\n", 0, line_start) + 1
    col = pos - line_start
    return line, col
1107311
def get_position():
    
    e = Quartz.CGEventCreate(None)
    point = Quartz.CGEventGetLocation(e)
    return (point.x, point.y)
694
def map_position(pos):
    """"""

    posiction_dict = dict(zip(range(1, 17), [i for i in range(30, 62) if i % 2]))
    return posiction_dict[pos]
992930
def _get_pos(self):
        
        if self._canvas.height >= self._max_height:
            return 0
        else:
            return self._canvas.start_line / (self._max_height - self._canvas.height + 1)
1094404
def get_cursor_position(self):
        """"""
        # TODO would this be cleaner as a parameter?
        in_stream = self.in_stream

        query_cursor_position = u"\x1b[6n"
        self.write(query_cursor_position)

        def retrying_read():
            while True:
                try:
                    c = in_stream.read(1)
                    if c == '':
                        raise ValueError("Stream should be blocking - should't"
                                         " return ''. Returned %r so far",
                                         (resp,))
                    return c
                except IOError:
                    raise ValueError(
                        'cursor get pos response read interrupted'
                    )
                    # find out if this ever really happens - if so, continue

        resp = ''
        while True:
            c = retrying_read()
            resp += c
            m = re.search('(?P<extra>.*)'
                          '(?P<CSI>\x1b\[|\x9b)'
                          '(?P<row>\\d+);(?P<column>\\d+)R', resp, re.DOTALL)
            if m:
                row = int(m.groupdict()['row'])
                col = int(m.groupdict()['column'])
                extra = m.groupdict()['extra']
                if extra:
                    if self.extra_bytes_callback:
                        self.extra_bytes_callback(
                            extra.encode(in_stream.encoding)
                        )
                    else:
                        raise ValueError(("Bytes preceding cursor position "
                                          "query response thrown out:\n%r\n"
                                          "Pass an extra_bytes_callback to "
                                          "CursorAwareWindow to prevent this")
                                         % (extra,))
                return (row - 1, col - 1)
1007043
def get_cursor_position(self, file_path):
        
        try:
            map = json.loads(self._settings.value('cachedCursorPosition'))
        except TypeError:
            map = {}
        try:
            pos = map[file_path]
        except KeyError:
            pos = 0
        if isinstance(pos, list):
            # changed in pyqode 2.6.3, now we store the cursor position
            # instead of the line and column  (faster)
            pos = 0
        return pos
579760
def linecol_to_pos(text, line, col):
    
    nth_newline_offset = 0
    for i in range(line - 1):
        new_offset = text.find("\n", nth_newline_offset)
        if new_offset < 0:
            raise ValueError("Text does not have {0} lines."
                             .format(line))
        nth_newline_offset = new_offset + 1
    offset = nth_newline_offset + col
    if offset > len(text):
        raise ValueError("Line {0} column {1} is not within the text"
                         .format(line, col))
    return offset