Updates the data in every L{Directory} object.
        
        @type peStr: str
        @param peStr: C{str} representation of the L{PE} object.
        
        @rtype: str
        @return: A C{str} representation of the L{PE} object.
770327
def _updateDirectoriesData(self, peStr):
        
        dataDirs = self.ntHeaders.optionalHeader.dataDirectory
        wr = utils.WriteData(data)
        
        for dir in dataDirs:
            dataToWrite = str(dir.info)
            if len(dataToWrite) != dir.size.value and self._verbose:
                print excep.DataLengthException("Warning: current size of %s directory does not match with dataToWrite length %d." % (dir.size.value, len(dataToWrite)))
            wr.setOffset(self.getOffsetFromRva(dir.rva.value))
            wr.write(dataToWrite)
        return str(wr)
746482
def update_script_from_item(self, item):
        

        script, path_to_script, script_item = item.get_script()

        # build dictionary
        # get full information from script
        dictator = list(script_item.to_dict().values())[0]  # there is only one item in the dictionary

        for instrument in list(script.instruments.keys()):
            # update instrument
            script.instruments[instrument]['settings'] = dictator[instrument]['settings']
            # remove instrument
            del dictator[instrument]


        for sub_script_name in list(script.scripts.keys()):
            sub_script_item = script_item.get_subscript(sub_script_name)
            self.update_script_from_item(sub_script_item)
            del dictator[sub_script_name]

        script.update(dictator)
        # update datefolder path
        script.data_path = self.gui_settings['data_folder']
102208
private  QueueCursor updateCursorForDBObject(JSONObject dbObject, QueueCursor cursor) {

        if (dbObject == null) return cursor;

        Iterator<String> keys = dbObject.keys();
        if (keys.hasNext()) {
            String key = keys.next();
            cursor.setLastId(key);
            try {
                cursor.setData(dbObject.getJSONArray(key));
            } catch (JSONException e) {
                cursor.setLastId(null);
                cursor.setData(null);
            }
        }

        return cursor;
    }
487
def command_update(prog_name, prof_mgr, prof_name, prog_args):

	
	
	# Retrieve arguments
	parser = argparse.ArgumentParser(
		prog=prog_name
	)
	parser.add_argument(
		"components",
		metavar="comps",
		nargs=argparse.REMAINDER,
		help="system components"
	)
	args = parser.parse_args(prog_args)
	
	# Profile load
	prof_stub = prof_mgr.load(prof_name)
	
	# Collect component stubs
	comp_stubs = []
	if len(args.components) == 0:
		raise Exception("Empty component list")
	for comp_name in args.components:
		comp_stub = prof_stub.component(comp_name)
		component_exists(prof_stub, comp_stub)
		comp_stubs.append(comp_stub)
		
	context = prof_stub.context()
	
	# Create delete plan
	plan = []
	for comp_stub in comp_stubs:
		comp_stub.delete(context, plan)
		
	# Execute delete plan
	for op in plan:
		operation_execute(op, context)
		
	# Update component stub list
	for op in plan:
		comp_stub = prof_stub.component(op.name())
		if comp_stub not in comp_stubs:
			comp_stubs.append(comp_stub)
	
	# Create insert plan
	plan = []
	for comp_stub in comp_stubs:
		comp_stub.insert(context, plan)
		
	# Execute insert plan
	for op in plan:
		operation_execute(op, context)
237677
def update(self, update):
        

        params = shlex.split(update)
        if params[0] in self.addr:
            self.addr[params[0]].update(*params)

        else:
            a = Addr(self)
            # add both name and IP address
            self.addr[params[0]] = a
            self.addr[params[1]] = a
            a.update(*params)
            self.notify("addrmap_added", *[a], **{})
861031
def update_clr(self, aclr, bclr):
        
        print(aclr, bclr, file=sys.stderr)
        otype = self.otype

        if otype == 1:
            if aclr.orientation == '+':
                aclr.end = self.qstop
            else:
                aclr.start = self.qstart
            if bclr.orientation == '+':
                bclr.start = self.sstop + 1
            else:
                bclr.end = self.sstart - 1

        elif otype == 3:
            aclr.start = aclr.end

        elif otype == 4:
            bclr.start = bclr.end

        print(aclr, bclr, file=sys.stderr)
108731
def update(self, pbar):
        ''

        if pbar.currval == 0:
            return 'ETA:  --:--:--'
        elif pbar.finished:
            return 'Time: %s' % self.format_time(pbar.seconds_elapsed)
        else:
            elapsed = pbar.seconds_elapsed
            eta = elapsed * pbar.maxval / pbar.currval - elapsed
            return 'ETA:  %s' % self.format_time(eta)
1020437
def do_update(self, line):
        
        curr_pid, pid_new, input_file = self._split_args(line, 3, 0)
        self._command_processor.science_object_update(curr_pid, input_file, pid_new)
        self._print_info_if_verbose(
            'Added update operation for identifier "{}" to write queue'.format(curr_pid)
        )
1036933
def pbar(iter, desc='', **kwargs):
    
    return tqdm(
        iter,
        desc=('<' + str(datetime.now().strftime("%Y-%m-%d %H:%M:%S")) + '> ' +
              desc),
        dynamic_ncols=True,
        **kwargs)
444050
public synchronized U update(int i, Function<U, U> updater) {
    U updated = updater.apply(this.get(i));
    set(i, updated);
    return updated;
  }
195180
def list_updater(*args):
    
    neg_index = [i for v,i in izip(args, itertools.count()) if v is not None and v < 0]
    if len(neg_index) > 1:
        raise ValueError("Cannot use negative values more than once")
    if not neg_index:
        slice_list = []
        size = 0
        for arg in args:
            if arg is None:
                slice_list.append(size)
                size += 1
            else:
                slice_list.append(slice(size, size + arg))
                size += arg
    else:
        sep = neg_index[0]
        slice_list = []
        size = 0
        for arg in args[:sep]:
            if arg is None:
                slice_list.append(size)
                size += 1
            else:
                slice_list.append(slice(size, size + arg))
                size += arg
        rslice_list = []
        rsize = 0
        for arg in args[:sep:-1]:
            if arg is None:
                rslice_list.append(-1-rsize)
                rsize += 1
            else:
                rslice_list.append(slice(None if not rsize else -rsize, -(rsize + arg)))
                rsize += arg
        slice_list.append(slice(size, rsize))
        slice_list.extend(reversed(rslice_list))
    def inner_wrapper(f):
        @functools.wraps(f)
        def wrapped_updater(keys, values):
            result = f(*[values[s] for s in slice_list])
            return (keys[:len(result)], result)
        return wrapped_updater
    return inner_wrapper
422291
def _renorm(self):
        
        self.demoted = set()
        # convert all to lowest level
        self._demote_all()
        # now promote as needed
        for d in range(self.maxdepth, 2, -1):
            plist = self.pixeldict[d].copy()
            for p in plist:
                if p % 4 == 0:
                    nset = set((p, p+1, p+2, p+3))
                    if p+1 in plist and p+2 in plist and p+3 in plist:
                        # remove the four pixels from this level
                        self.pixeldict[d].difference_update(nset)
                        # add a new pixel to the next level up
                        self.pixeldict[d-1].add(p/4)
        self.demoted = set()
        return
150505
def update(self, E=None, **F):
        
        _AutoDict = self.__class__

        def update_or_set(key, value):
            if isinstance(value, dict):
                self[key] = _AutoDict(obj=value, _root=self._root, _parent=self, _key=key)
            else:
                self[key] = value

        with self.lock() as lock_owner:
            # update E
            if hasattr(E, 'keys') and callable(E.keys):
                for k in E:
                    update_or_set(k, E[k])
            else:
                for k, v in E:
                    update_or_set(k, v)

            # update F
            for k in F:
                update_or_set(k, F[k])

            # save if original caller.
            if lock_owner:
                self._root.save()
240890
def update(self, data):
        
        result = None
        if data:
            _dumps = self._dumps
            data = {
                key: _dumps(value)
                for key, value in data.items()}
            result = self._client.hmset(self.key_prefix, data)
        return result
1058338
def update(self, params, args, data):
        # type: (str, dict, dict) -> Union[List[AppModel], AppModel]
        
        ctx = self._create_context(params, args, data)
        row_id = ctx.get_row_id()

        if row_id is not None:
            model = self._update_one(ctx)
            return None if model is None else model.get_app_model()
        else:
            return app_models(self._update_collection(ctx))
1013581
private void updateMovementVector() {
		dirX = (float) Math.sin(Math.toRadians(ang));
		dirY = (float) -Math.cos(Math.toRadians(ang));
	}
644395
def update(self):
        
        if self._track_changes:
            data = self.to_api_data(restrict_keys=self._track_changes)
            if data:
                response = self.session.patch(self.build_url(''), data=data)
                if not response:
                    return False
                self._track_changes.clear()
        if self._font._track_changes:
            data = self._font.to_api_data(restrict_keys=self._font._track_changes)
            if data:
                response = self.session.patch(self.build_url(self._endpoints.get('font')), data=data)
                if not response:
                    return False
                self._font._track_changes.clear()
        if self._track_background_color:
            if self._background_color is None:
                url = self.build_url(self._endpoints.get('clear_fill'))
                response = self.session.post(url)
            else:
                data = {'color': self._background_color}
                url = self.build_url(self._endpoints.get('fill'))
                response = self.session.patch(url, data=data)
            if not response:
                return False
            self._track_background_color = False

        return True