Process an incoming update from a remote NetworkTables
768736
def process_update(self, update):
        """"""
        data = json.loads(update)
        NetworkTables.getEntry(data["k"]).setValue(data["v"])
538654
def before_update(mapper, conn, target):
        """"""

        target.name = Table.mangle_name(target.name)

        if isinstance(target, Column):
            raise TypeError('Got a column instead of a table')

        target.update_id(target.sequence_id, False)
483910
def UpdateFlow(self,
                 client_id,
                 flow_id,
                 flow_obj=db.Database.unchanged,
                 flow_state=db.Database.unchanged,
                 client_crash_info=db.Database.unchanged,
                 pending_termination=db.Database.unchanged,
                 processing_on=db.Database.unchanged,
                 processing_since=db.Database.unchanged,
                 processing_deadline=db.Database.unchanged,
                 cursor=None):
    """"""
    updates = []
    args = []
    if flow_obj != db.Database.unchanged:
      updates.append("flow=%s")
      args.append(flow_obj.SerializeToString())
      updates.append("flow_state=%s")
      args.append(int(flow_obj.flow_state))
      updates.append("user_cpu_time_used_micros=%s")
      args.append(
          db_utils.SecondsToMicros(flow_obj.cpu_time_used.user_cpu_time))
      updates.append("system_cpu_time_used_micros=%s")
      args.append(
          db_utils.SecondsToMicros(flow_obj.cpu_time_used.system_cpu_time))
      updates.append("network_bytes_sent=%s")
      args.append(flow_obj.network_bytes_sent)
      updates.append("num_replies_sent=%s")
      args.append(flow_obj.num_replies_sent)

    if flow_state != db.Database.unchanged:
      updates.append("flow_state=%s")
      args.append(int(flow_state))
    if client_crash_info != db.Database.unchanged:
      updates.append("client_crash_info=%s")
      args.append(client_crash_info.SerializeToString())
    if pending_termination != db.Database.unchanged:
      updates.append("pending_termination=%s")
      args.append(pending_termination.SerializeToString())
    if processing_on != db.Database.unchanged:
      updates.append("processing_on=%s")
      args.append(processing_on)
    if processing_since != db.Database.unchanged:
      updates.append("processing_since=FROM_UNIXTIME(%s)")
      args.append(mysql_utils.RDFDatetimeToTimestamp(processing_since))
    if processing_deadline != db.Database.unchanged:
      updates.append("processing_deadline=FROM_UNIXTIME(%s)")
      args.append(mysql_utils.RDFDatetimeToTimestamp(processing_deadline))

    if not updates:
      return

    query = "UPDATE flows SET last_update=NOW(6), "
    query += ", ".join(updates)
    query += " WHERE client_id=%s AND flow_id=%s"

    args.append(db_utils.ClientIDToInt(client_id))
    args.append(db_utils.FlowIDToInt(flow_id))
    updated = cursor.execute(query, args)
    if updated == 0:
      raise db.UnknownFlowError(client_id, flow_id)
872865
def update(self,
               stats,
               duration=3,
               cs_status=None,
               return_to_browser=False):
        
        # Flush display
        logger.debug('Servers list: {}'.format(stats))
        self.flush(stats)

        # Wait
        exitkey = False
        countdown = Timer(self.__refresh_time)
        while not countdown.finished() and not exitkey:
            # Getkey
            pressedkey = self.__catch_key(stats)
            # Is it an exit or select server key ?
            exitkey = (
                pressedkey == ord('\x1b') or pressedkey == ord('q') or pressedkey == 10)
            if not exitkey and pressedkey > -1:
                # Redraw display
                self.flush(stats)
            # Wait 100ms...
            self.wait()

        return self.active_server
1183533
private void updateNetwork(final NetworkContext context, final Handler<AsyncResult<Void>> doneHandler) {
    final CountingCompletionHandler<Void> complete = new CountingCompletionHandler<Void>(context.components().size());
    complete.setHandler(new Handler<AsyncResult<Void>>() {
      @Override
      public void handle(AsyncResult<Void> result) {
        if (result.failed()) {
          new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
        } else {
          new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
        }
      }
    });
    updateComponents(context.components(), complete);
  }
252280
def _rt_state_update(route_table_id, dcidr, router_ip="(none)",
                     instance_id="(none)", eni_id="(none)",
                     old_router_ip="(none)", msg="(none)"):
    
    buf = "inst: %s, eni: %s, r_ip: %-15s, o_r_ip: %-15s, msg: %s" % \
          (instance_id, eni_id, router_ip, old_router_ip, msg)
    CURRENT_STATE.vpc_state.setdefault('route_tables', {}). \
                            setdefault(route_table_id, {})[dcidr] = buf
799037
def update(connection, force_download):
    """"""
    manager.database.update(
        connection=connection,
        force_download=force_download
    )
503364
def _handle_datapath(self, inport, packet):
        '''
        
        '''
        inport = self._switchyard_net.port_by_name(inport)
        portnum = inport.ifnum
        log_info("Processing packet: {}->{}".format(portnum, packet))

        actions = None
        for tnum,t in enumerate(self._tables):
            actions = t.match_packet(portnum, packet)

            # FIXME: this is all wrong/incomplete

            # if match: Update counters Execute instructions:
            #           update action set
            #           update packet/match set fields
            #            update metadata
            # if no match and table miss entry exists, do the above
            # otherwise, drop the packet
        # actions = self._table.match_packet(portnum, packet)
        if actions is None:
            self._send_packet_in(portnum, packet)
        else:
            self._datapath_action(portnum, packet, actions=actions)
137621
def update_routing_table_from(self, *routers):
        
        for router in routers:
            new_routing_table = self.fetch_routing_table(router)
            if new_routing_table is not None:
                self.routing_table.update(new_routing_table)
                return True
        return False
281275
function(input, callback, context, remoteData)
  {
    var db = this;
    var promise = new Promise();

    promise.success( callback, context || db );

    function checkModel()
    {
      var result = db.parseModel( input, remoteData );

      if ( result !== false && !promise.isComplete() && db.initialized )
      {
        var remoteLoaded = db.remoteLoaded || !db.hasLoad( Load.All );
        var missingModel = (result === null || !result.$isSaved());
        var lazyLoad = db.hasLoad( Load.Lazy );

        if ( lazyLoad && remoteLoaded && missingModel )
        {
          if ( !result )
          {
            result = db.keyHandler.buildObjectFromKey( db.keyHandler.buildKeyFromInput( input ) );
          }

          result.$once( Model.Events.RemoteGets, function()
          {
            if ( !promise.isComplete() )
            {
              if ( isObject( input ) )
              {
                result.$set( input );
              }

              promise.resolve( result.$isSaved() ? result : null );
            }
          });

          result.$refresh( Cascade.All, db.fetchOptions );
        }
        else
        {
          promise.resolve( result );
        }
      }

      return promise.isComplete() ? false : true;
    }

    if ( checkModel() )
    {
      db.ready( checkModel, db, true );
    }

    return promise;
  }
1067656
def update(self, callback=None, errback=None, **kwargs):
        
        if not self.data:
            raise NetworkException('Network not loaded')

        def success(result, *args):
            self.data = result
            self.id = result['id']
            self.name = result['name']
            self.report = self._rest.report(self.id)
            if callback:
                return callback(self)
            else:
                return self

        return self._rest.update(self.id, callback=success, errback=errback,
                                 **kwargs)
857333
def update(cls, resource, new_name, algorithm, ssl_enable, ssl_disable):
        
        params = {}
        if new_name:
            params['name'] = new_name
        if algorithm:
            params['lb'] = {'algorithm': algorithm}
        if ssl_enable:
            params['ssl_enable'] = ssl_enable
        if ssl_disable:
            params['ssl_enable'] = False

        result = cls.call('hosting.rproxy.update', cls.usable_id(resource),
                          params)
        cls.echo('Updating your webaccelerator')
        cls.display_progress(result)
        cls.echo('The webaccelerator have been udated')
        return result
1325964
def update(self, observable, actions):
        """"""
        (addedreaders, removedreaders) = actions
        for reader in addedreaders:
            remotereader = RemoteReader(reader)
            self.remotereaders[reader.name] = remotereader
            name = "".join(reader.name.split(' '))
            name = ":pyscard.smartcard.readers." + "".join(name.split('.'))
            uri = self.daemon.connect(remotereader, name)
        for reader in removedreaders:
            remotereader = self.remotereaders[reader.name]
            self.daemon.disconnect(remotereader)
            del self.remotereaders[reader.name]
        self.pn.listall()
1259029
def update(cls, domain, source, dest_add, dest_del):
        """"""
        result = None

        if dest_add or dest_del:
            current_destinations = cls.get_destinations(domain, source)
            fwds = current_destinations[:]
            if dest_add:
                for dest in dest_add:
                    if dest not in fwds:
                        fwds.append(dest)
            if dest_del:
                for dest in dest_del:
                    if dest in fwds:
                        fwds.remove(dest)

            if ((len(current_destinations) != len(fwds))
                    or (current_destinations != fwds)):
                cls.echo('Updating mail forward %s@%s' % (source, domain))
                options = {'destinations': fwds}
                result = cls.call('domain.forward.update', domain, source,
                                  options)

        return result
1151707
def do_update(pool,request,models):
  ""
  return {k:fkapply(models,pool,process_update,missing_update,k,v) for k,v in request.items()}
664626
protected void update() {
        if(conHandler.shouldStop()) {
            Utils.closeQuietly(this);
            return;
        }

        String line;

        try {
            line = reader.readLine();
        } catch(SocketTimeoutException ex) {
            // Check if the socket has timed out
            if(!dataConnections.isEmpty() && (System.currentTimeMillis() - lastUpdate) >= timeout) {
                Utils.closeQuietly(this);
            }
            return;
        } catch(IOException ex) {
            return;
        }

        if(line == null) {
            Utils.closeQuietly(this);
            return;
        }

        if(line.isEmpty()) return;

        process(line);
    }
214372
async def run_forever(self, relax=0.1, offset=None, timeout=20, allowed_updates=None):
        
        while 1:
            try:
                result = await self._bot.getUpdates(offset=offset,
                                                    timeout=timeout,
                                                    allowed_updates=allowed_updates)

                # Once passed, this parameter is no longer needed.
                allowed_updates = None

                # No sort. Trust server to give messages in correct order.
                for update in result:
                    self._update_handler(update)
                    offset = update['update_id'] + 1

            except CancelledError:
                break
            except exception.BadHTTPResponse as e:
                traceback.print_exc()

                # Servers probably down. Wait longer.
                if e.status == 502:
                    await asyncio.sleep(30)
            except:
                traceback.print_exc()
                await asyncio.sleep(relax)
            else:
                await asyncio.sleep(relax)