Insert the function doc `cells` at their correct position and updates `pos_dict`.
437652
def insert_cells(cells, pos_dict, ft_name, append=False):
    ""
    idx = get_insert_idx(pos_dict, ft_name)
    if append or idx == -1: cells += [get_doc_cell(ft_name), get_empty_cell()]
    else:
        cells.insert(idx, get_doc_cell(ft_name))
        cells.insert(idx+1, get_empty_cell())
        pos_dict = update_pos(pos_dict, ft_name, 2)
    return cells, pos_dict
86937
def __insert_wrapper(func):
        """"""
        def check_func(self, key, new_item, instance=0):
            if key not in self.keys():
                raise KeyError("%s not a key in label" % (key))
            if not isinstance(new_item, (list, OrderedMultiDict)):
                raise TypeError("The new item must be a list or PVLModule")
            if isinstance(new_item, OrderedMultiDict):
                new_item = list(new_item)
            return func(self, key, new_item, instance)
        return check_func
178169
def updateRPYLocations(self):
        ''''''
        # Locations
        self.rollText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+(2*self.vertSize)-(self.vertSize/10.0)))
        self.pitchText.set_position((self.leftPos+(self.vertSize/10.0),-0.97+self.vertSize-(0.5*self.vertSize/10.0)))
        self.yawText.set_position((self.leftPos+(self.vertSize/10.0),-0.97))
        # Font Size
        self.rollText.set_size(self.fontSize)
        self.pitchText.set_size(self.fontSize)
        self.yawText.set_size(self.fontSize)
201254
def update_positions(self, positions):
        '''
        '''
        sphs_verts = self.sphs_verts_radii.copy()
        sphs_verts += positions.reshape(self.n_spheres, 1, 3)

        self.tr.update_vertices(sphs_verts)
        self.poslist = positions
552706
def set_cells(self, cells_location):
        

        if ':' in cells_location:
            pathname, func_name = cells_location.split(':')
        else:
            pathname = cells_location
            func_name = 'cells'

        check_isfile(pathname)

        try:
            self.cells = get_func(func_name, pathname)
        except SyntaxError as e:
            fatal(traceback.format_exc(limit=1))

        return pathname, func_name
1326668
def insert(self, index, p_object):
        
        key = self._get_object_key(p_object)
        if key in self._col_dict:
            raise KeyError()
        self._col_list.insert(index, p_object)
        self._col_dict[key] = p_object
455221
def insert_function(self, fname, ftype):
        ""
        index = self.insert_id(fname, SharedData.KINDS.FUNCTION, [SharedData.KINDS.GLOBAL_VAR, SharedData.KINDS.FUNCTION], ftype)
        self.table[index].set_attribute("Params",0)
        return index
685707
def keep_tc_pos(func):
    
    @functools.wraps(func)
    def wrapper(editor, *args, **kwds):
        """ Decorator """
        sb = editor.verticalScrollBar()
        spos = sb.sliderPosition()
        pos = editor.textCursor().position()
        retval = func(editor, *args, **kwds)
        text_cursor = editor.textCursor()
        text_cursor.setPosition(pos)
        editor.setTextCursor(text_cursor)
        sb.setSliderPosition(spos)
        return retval
    return wrapper
1034169
def push(cell)
      cell = Workbook::Cell.new(cell, {row:self}) unless cell.class == Workbook::Cell
      super(cell)
    end
733212
def add_cell(self, keypath, cell):
        
        keypath = keypath[:] # copy
        inner = self  # the most inner dict where cell is added
        cellname = keypath  # the name of the cell
        assert keypath not in self, "Already exists: %s " % (str(keypath))
        if isinstance(keypath, list):
            while len(keypath) > 1:
                cellname = keypath.pop(0)
                if cellname not in inner:
                    inner.__dict__['p'][cellname] = DictCell()
                inner = inner[cellname] # move in one
            cellname = keypath[0]
        # now we can add 'cellname'->(Cell) to inner (DictCell)
        inner.__dict__['p'][cellname] = cell
        return inner[cellname]
1022377
def move_pos(line=1, column=1, file=sys.stdout):
    
    move.pos(line=line, col=column).write(file=file)
405824
def update_position(self, loc):
        """"""
        # This ensures that the new value of the location is set before
        # any other updates take place.
        self._loc = loc
        super(SkewXTick, self).update_position(loc)
888528
def _save(self, objects, old_pos, new_pos):
        """"""
        to_shift = objects.exclude(pk=self.pk) if self.pk else objects

        # If not set, insert at end.
        if self.sort_order is None:
            self._move_to_end(objects)

        # New insert.
        elif not self.pk and not old_pos:
            # Increment `sort_order` on objects with:
            #     sort_order > new_pos.
            to_shift = to_shift.filter(sort_order__gte=self.sort_order)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order decreased.
        elif old_pos and new_pos < old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Increment `sort_order` on objects with:
            #     sort_order >= new_pos and sort_order < old_pos
            to_shift = to_shift.filter(sort_order__gte=new_pos, sort_order__lt=old_pos)
            self._update(to_shift)
            self.sort_order = new_pos

        # self.sort_order increased.
        elif old_pos and new_pos > old_pos:
            self._move_to_end(objects)
            super(Orderable, self).save()
            # Decrement sort_order on objects with:
            #     sort_order <= new_pos and sort_order > old_pos.
            to_shift = to_shift.filter(sort_order__lte=new_pos, sort_order__gt=old_pos)
            to_shift.update(sort_order=models.F('sort_order') - 1)
            self.sort_order = new_pos
2850
def update_position(params):
    
    cx = params.plane_x0 + params.plane_w / 2.0
    cy = params.plane_y0 + params.plane_h / 2.0
    params.mb_cx, params.mb_cy = get_coords(cx, cy, params)
95331
def _fill_function(func, globals, defaults, dict, module, closure_values):
    
    func.__globals__.update(globals)
    func.__defaults__ = defaults
    func.__dict__ = dict
    func.__module__ = module

    cells = func.__closure__
    if cells is not None:
        for cell, value in zip(cells, closure_values):
            if value is not _empty_cell_value:
                cell_set(cell, value)

    return func
805736
def update_cursor_position(self, line, index):
        """"""
        value = 'Line {}, Col {}'.format(line + 1, index + 1)
        self.set_value(value)
824009
function(){
		var pos = this.getpos(0);
		if(this.prevPos.equals(pos)){ return;}

		var cell = this.prevPos.getc();
		if(!cell.isnull){
			if(cell.qnum!==-1){
				var dir = this.prevPos.getdir(pos,2);
				if(dir!==cell.NDIR){
					cell.setQdir(cell.qdir!==dir?dir:0);
					cell.draw();
				}
			}
		}
		this.prevPos = pos;
	}