Used to download firmware or filter set.
        
        :param data: binary string to push via serial 
        :param um_update: flag whether to update umanager
778051
def download(self,data,um_update=False):
        
        
        self.open_umanager()
        self.ser.write(''.join((self.cmd_download,self.cr)))
        if self.read_loop(lambda x: x.endswith(self.xmodem_crc),self.timeout):
            if self.xmodem.send(StringIO.StringIO(data)):
                log.info("Data sent")
            else:
                raise Dam1021Error(4,"Error during file download")
        else:
            raise Dam1021Error(3,"uManager is not ready to accept a data")
      
        if self.read_loop(lambda x: x.lower().find(self.reprogram_ack) != -1,self.timeout):
            skr_sum = hashlib.sha1(data).hexdigest()
            log.info("File downloaded. Data SHA-1 checksum: {}".format(skr_sum))
        else:
            raise Dam1021Error(5,"uManager accepted data and not reprogrammed")

        if um_update:
            self.ser.write(''.join((self.cmd_update,self.cr)))
            if self.read_loop(lambda x: x.lower().find(self.update_confirmation) != -1,self.timeout*self.umanager_waitcoeff):
                self.ser.write(self.update_ack)
            else:
                raise Dam1021Error(13,"Error during update command invocation")

            if self.read_loop(lambda x: x.lower().find(self.update_reset) != -1,self.timeout*self.umanager_waitcoeff):
                log.info("uManager updated")
            else:
                raise Dam1021Error(14,"Update failed")
        else:
            self.close_umanager()            


        return skr_sum
1373283
async def update_firmware(self,
                              filename: str,
                              loop: asyncio.AbstractEventLoop = None,
                              explicit_modeset: bool = True) -> str:
        
        # ensure there is a reference to the port
        if self.simulating:
            return 'Did nothing (simulating)'

        smoothie_update._ensure_programmer_executable()

        if not self.is_connected():
            self._connect_to_port()

        # get port name
        port = self._connection.port

        if explicit_modeset:
            # set smoothieware into programming mode
            self._smoothie_programming_mode()
            # close the port so other application can access it
            self._connection.close()

        # run lpc21isp, THIS WILL TAKE AROUND 1 MINUTE TO COMPLETE
        update_cmd = 'lpc21isp -wipe -donotstart {0} {1} {2} 12000'.format(
            filename, port, self._config.serial_speed)
        kwargs: Dict[str, Any] = {'stdout': asyncio.subprocess.PIPE}
        if loop:
            kwargs['loop'] = loop
        proc = await asyncio.create_subprocess_shell(
            update_cmd, **kwargs)
        rd: bytes = await proc.stdout.read()  # type: ignore
        res = rd.decode().strip()
        await proc.communicate()

        # re-open the port
        self._connection.open()
        # reset smoothieware
        self._smoothie_reset()
        # run setup gcodes
        self._setup()

        return res
1007837
def stream_download(self, data, callback):
        # type: (Union[requests.Response, ClientResponse], Callable) -> Iterator[bytes]
        
        block = self.config.connection.data_block_size
        try:
            # Assume this is ClientResponse, which it should be if backward compat was not important
            return cast(ClientResponse, data).stream_download(block, callback)
        except AttributeError:
            try:
                # Assume this is the patched requests.Response from "send"
                return data._universal_http_response.stream_download(block, callback)  # type: ignore
            except AttributeError:
                # Assume this is a raw requests.Response
                from .universal_http.requests import RequestsClientResponse
                response = RequestsClientResponse(None, data)
                return response.stream_download(block, callback)
97317
def soft_target_update(self):
    
    for target_param, local_param in zip(self.target.parameters(), self.local.parameters()):
      target_param.data.copy_(self.tau * local_param.data + (1.0 - self.tau) * target_param.data)
786701
def as_download(self, data, block_num=-1):
        
        size = len(data)
        type_ = c_byte * len(data)
        cdata = type_.from_buffer_copy(data)
        return self.library.Cli_AsDownload(self.pointer, block_num,
                                           byref(cdata), size)
1228751
private void deliverDeviceUpdate(final DeviceUpdate update) {
        for (DeviceUpdateListener listener : getUpdateListeners()) {
            try {
                listener.received(update);
            } catch (Throwable t) {
                logger.warn("Problem delivering device update to listener", t);
            }
        }
    }
772915
def update(self, data_and_metadata: DataAndMetadata.DataAndMetadata, state: str, sub_area, view_id) -> None:
        """"""
        self.__state = state
        self.__sub_area = sub_area

        hardware_source_id = self.__hardware_source.hardware_source_id
        channel_index = self.index
        channel_id = self.channel_id
        channel_name = self.name
        metadata = copy.deepcopy(data_and_metadata.metadata)
        hardware_source_metadata = dict()
        hardware_source_metadata["hardware_source_id"] = hardware_source_id
        hardware_source_metadata["channel_index"] = channel_index
        if channel_id is not None:
            hardware_source_metadata["reference_key"] = "_".join([hardware_source_id, channel_id])
            hardware_source_metadata["channel_id"] = channel_id
        else:
            hardware_source_metadata["reference_key"] = hardware_source_id
        if channel_name is not None:
            hardware_source_metadata["channel_name"] = channel_name
        if view_id:
            hardware_source_metadata["view_id"] = view_id
        metadata.setdefault("hardware_source", dict()).update(hardware_source_metadata)

        data = data_and_metadata.data
        master_data = self.__data_and_metadata.data if self.__data_and_metadata else None
        data_matches = master_data is not None and data.shape == master_data.shape and data.dtype == master_data.dtype
        if data_matches and sub_area is not None:
            top = sub_area[0][0]
            bottom = sub_area[0][0] + sub_area[1][0]
            left = sub_area[0][1]
            right = sub_area[0][1] + sub_area[1][1]
            if top > 0 or left > 0 or bottom < data.shape[0] or right < data.shape[1]:
                master_data = numpy.copy(master_data)
                master_data[top:bottom, left:right] = data[top:bottom, left:right]
            else:
                master_data = numpy.copy(data)
        else:
            master_data = data  # numpy.copy(data). assume data does not need a copy.

        data_descriptor = data_and_metadata.data_descriptor
        intensity_calibration = data_and_metadata.intensity_calibration if data_and_metadata else None
        dimensional_calibrations = data_and_metadata.dimensional_calibrations if data_and_metadata else None
        timestamp = data_and_metadata.timestamp
        new_extended_data = DataAndMetadata.new_data_and_metadata(master_data, intensity_calibration=intensity_calibration, dimensional_calibrations=dimensional_calibrations, metadata=metadata, timestamp=timestamp, data_descriptor=data_descriptor)

        self.__data_and_metadata = new_extended_data

        self.data_channel_updated_event.fire(new_extended_data)
        self.is_dirty = True
599907
def perform_update(self, data, instance):
        

        for key, val in data.items():
            setattr(instance, key, val)
176987
def update(self, series_data):
        

        for key in series_data:
            try:
                data_list = list(self.data[key])
                data_list[2] = str(series_data[key])
                self.data[key] = tuple(data_list)
            except KeyError:
                pass
1282892
public void updateProvider(ConsumerConfig config, String providerPath, ChildData data, List<ChildData> currentData)
        throws UnsupportedEncodingException {
        if (LOGGER.isInfoEnabled(config.getAppName())) {
            LOGGER.infoWithApp(config.getAppName(),
                "Receive update provider: path=[" + data.getPath() + "]" + ", data=[" +
                    StringSerializer.decode(data.getData()) + "]" + ", stat=[" + data.getStat() + "]" + ", list=[" +
                    currentData.size() + "]");
        }
        notifyListeners(config, providerPath, currentData, false);
    }
1314484
public void update(ChannelData channelData) {
        synchronized (this.udpChannelConfig) {
            // can't do two updates at the same time
            try {
                this.udpChannelConfig.setChannelData(channelData);
            } catch (ChannelException e) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                    Tr.debug(this, tc, "Error updating config:" + e.getMessage());
                }
            }
        }
    }
280224
def updateReplicationMetadata(
        self, pid, replicaMetadata, serialVersion, vendorSpecific=None
    ):
        
        response = self.updateReplicationMetadataResponse(
            pid, replicaMetadata, serialVersion, vendorSpecific
        )
        return self._read_boolean_response(response)
876067
def update(self, data):
        
        if not data:
            return
        _rk, _dumps = self.get_key, self._dumps
        data = self._client.mset({
            _rk(key): _dumps(value)
            for key, value in data.items()})
183645
def create_update():
    
    update = upkey("update").setResultsName("action")
    returns, none, all_, updated, old, new = map(
        upkey, ["returns", "none", "all", "updated", "old", "new"]
    )
    return_ = returns + Group(
        none | (all_ + old) | (all_ + new) | (updated + old) | (updated + new)
    ).setResultsName("returns")
    return (
        update
        + table
        + update_expr
        + Optional(keys_in)
        + Optional(where)
        + Optional(using)
        + Optional(return_)
        + Optional(throttle)
    )
1120804
def update_source(source, instance)
      begin
        data = instance.fetch
        publish_data(source, data)
      ensure
        @after_update_callback.call
      end
    rescue Exception => ex
      puts "Failed to update #{source}: #{ex.message}"
      puts ex.backtrace
      @error_callback.call(ex)
    end
731011
def _repodata_downloaded(self, worker=None, output=None, error=None):
        """"""
        if worker:
            self._files_downloaded.remove(worker.path)

            if worker.path in self._files_downloaded:
                self._files_downloaded.remove(worker.path)

        if len(self._files_downloaded) == 0:
            self.sig_repodata_updated.emit(list(set(self._repodata_files)))
804750
def _updateRepo(self, func, *args, **kwargs):
        
        # TODO how do we make this properly transactional?
        self._repo.open(datarepo.MODE_WRITE)
        try:
            func(*args, **kwargs)
            self._repo.commit()
        finally:
            self._repo.close()