Update config
@param {function} updater - This function is passed in current config and it returns new config.
972402
async function updateConfig(updater) {
  await isReady();
  const newConfig = updater(config);
  validateSchema(
    configSchema,
    newConfig,
    'Please fix the config being used in Bolt CLI.',
  );
  // console.log('new config:');
  // console.log(newConfig);
  config = newConfig;
  if (config.prod) {
    process.env.NODE_ENV = 'production';
  }
  return config;
}
440840
function updatePropertyConfiguration () {

  // Fetch extensions implementing .updatePropertyConfiguration(...) method
  let extensions = _.filter(this.extensions, (extension) => {
    return extension.implemented.updatePropertyConfiguration;
  });

  // Create a proxy .updatePropertyConfiguration(...) method
  this.updatePropertyConfiguration =  (propertyConfiguration) => {
    // Execute all extensions' .updatePropertyConfiguration(...) method
    _.forEach(extensions, (extension) => {
      extension.updatePropertyConfiguration(propertyConfiguration);
    });
  };

}
1331822
def updater_loop(self):
        
        self.updater_running = True
        while (self.updater_running):
            self.send_updates()
            sleep(self.updateinterval)
912450
async def updateconfig(self):
        ""
        exists = {}
        for s in self.connections:
            exists[(s.protocol.vhost, s.rawurl)] = s
        self._createServers(self, '', exists = exists)
        for _,v in exists.items():
            await v.shutdown()
            self.connections.remove(v)
184268
public static void update(final FileUpdater updater, final File destFile) throws UpdateException {
        final File lockFile = new File(destFile.getAbsolutePath() + ".lock");
        final File newDestFile = new File(destFile.getAbsolutePath() + ".new");

        try {
            // synchronize writing to file within this jvm
            synchronized (UpdateUtils.class) {
                final FileChannel channel = new RandomAccessFile(lockFile, "rw").getChannel();

                //acquire file lock to block external jvm (commandline) from writing to file
                final FileLock lock = channel.lock();
                try {
                    FileUtils.copyFileStreams(destFile, newDestFile);
                    updater.updateFile(newDestFile);
                    if (newDestFile.isFile() && newDestFile.length() > 0) {
                        moveFile(newDestFile, destFile);
                    } else {
                        throw new UpdateException("Result file was empty or not present: " + newDestFile);
                    }
                } catch (FileUpdaterException e) {
                    throw new UpdateException(e);
                } finally {
                    lock.release();
                    channel.close();
                }
            }
        } catch (IOException e) {
            throw new UpdateException("Unable to get and write file: " +
                    e.toString(), e);
        }
    }
470428
public void setUpdater(ComputationGraphUpdater updater) {
        if (solver == null) {
            solver = new Solver.Builder().configure(conf()).listeners(getListeners()).model(this).build();
        }
        solver.getOptimizer().setUpdaterComputationGraph(updater);
    }
510903
function(propName, updater) {
    var updaterName, handler;

    if(!isFunction(updater)) {
      updaterName = 'update' + propName[0].toUpperCase() + propName.slice(1);
      updater = this.governor[updaterName];
    }

    if(updater) {
      this.then(function(advisorEvent, deferred, consequenceActions, streamEvent) {
        var currVal = this.props[propName].value;
        var updaterArgs = [currVal].concat(advisorEvent, streamEvent);
        var retVal = updater.apply(this, updaterArgs);

        // Only trigger a reactive change if the value has actually changed;
        // if(!isEqual(retVal, currVal)) this.props[propName] = retVal;
        this.props[propName] = retVal

        deferred.resolve(retVal);
      });
    } else {
      throw new Error('An updater function was not specified and governor.' + updaterName + ' is not defined');
    }

    return this;
  }
43248
function defaultUpdateFunction(instance, data) {
    if (instance.isMatreshkaArray) {
        instance.recreate(data);
    } else if (instance.isMatreshkaObject) {
        instance.setData(data, { replaceData: true });
    } else {
        // for other objects just extend them with given data
        nofn.assign(instance, data);
    }
}
1131811
public function setUpdater($updater)
    {
        if (!is_string($this->updatedByAttribute) || empty($this->updatedByAttribute)) {
            return false;
        }
        if ($updater instanceof Binary && $updater->getType() == Binary::TYPE_UUID) {
            return $this->{$this->updatedByAttribute} = $updater;
        }
        if ($updater instanceof $this->hostClass || $updater instanceof IdentityInterface) {
            return $this->{$this->updatedByAttribute} = new Binary($updater->getGUID(), Binary::TYPE_UUID);
        }
        if (is_string($updater) && preg_match(Number::GUID_REGEX, $updater)) {
            return $this->{$this->updatedByAttribute} = new Binary(Number::guid_bin($updater), Binary::TYPE_UUID);
        }
        if (strlen($updater) == 16) {
            return $this->{$this->updatedByAttribute} = new Binary($updater, Binary::TYPE_UUID);
        }
        return false;
    }
1194879
function(updater) {
                    if (!onchanged) {
                        onchanged = function(ev) {
                            if (compute.bound && (ev.batchNum === undefined || ev.batchNum !== batchNum)) {
                                // Get the new value
                                var reads = can.__clearReading();
                                var newValue = func.call(context);
                                can.__setReading(reads);
                                // Call the updater with old and new values
                                updater(newValue, oldValue, ev.batchNum);
                                oldValue = newValue;
                                batchNum = batchNum = ev.batchNum;
                            }
                        };
                    }

                    readInfo = getValueAndBind(func, context, {}, onchanged);
                    oldValue = readInfo.value;

                    setCachedValue(readInfo.value);

                    compute.hasDependencies = !can.isEmptyObject(readInfo.observed);
                }
1147282
function(updater) {
                    for (var name in readInfo.observed) {
                        var ob = readInfo.observed[name];
                        ob.obj.unbind(ob.event, onchanged);
                    }
                }
498468
def synchronize updater
      raise 'Invalid synchronization' unless updater.filename == filename
      real_code = updater.write(@code)
      if real_code == @code
        @version = updater.version
        return self
      end
      synced = Source.new(real_code, filename)
      if synced.parsed?
        synced.version = updater.version
        return synced
      end
      incr_code = updater.repair(@repaired)
      synced = Source.new(incr_code, filename)
      synced.error_ranges.concat (error_ranges + updater.changes.map(&:range))
      synced.code = real_code
      synced.version = updater.version
      synced
    end
929152
def update_function(old, new):
    """"""
    for name in func_attrs:
        try:
            setattr(old, name, getattr(new, name))
        except (AttributeError, TypeError):
            pass
770344
function getUpdatedConfig() {
                var updatedConfig = Object.assign({}, this.baseConfig);

                // override title if slot is used
                if (this.$refs.title) {
                    updatedConfig.title = this.$refs.title;
                    updatedConfig.html = true;
                }

                // override content if slot is used
                if (this.$refs.content) {
                    updatedConfig.content = this.$refs.content;
                    updatedConfig.html = true;
                }

                return updatedConfig
            }
886145
function update(annotationObject, changeSet) {
  const updatedAnnotation = Object.assign({}, annotationObject, changeSet);

  let changeDetected = false;
  Object.keys(updatedAnnotation).forEach((key) => {
    if (updatedAnnotation[key] !== annotationObject[key]) {
      changeDetected = true;
    }
  });

  if (changeDetected) {
    generation += 1;
    updatedAnnotation.generation = generation;
  }

  return updatedAnnotation;
}
492227
def _update_config(args, update_fn, allow_missing=False):
    
    new_i = None
    for i, arg in enumerate(args):
        if (is_std_config_arg(arg) or is_nested_config_arg(arg) or
              (isinstance(arg, (list, tuple)) and is_nested_config_arg(arg[0]))):
            new_i = i
            break
    if new_i is None:
        if allow_missing:
            return args
        else:
            raise ValueError("Could not find configuration in args: %s" % str(args))

    new_arg = args[new_i]
    if is_nested_config_arg(new_arg):
        new_arg["config"] = update_fn(copy.deepcopy(new_arg["config"]))
    elif is_std_config_arg(new_arg):
        new_arg = update_fn(copy.deepcopy(new_arg))
    elif isinstance(arg, (list, tuple)) and is_nested_config_arg(new_arg[0]):
        new_arg_first = new_arg[0]
        new_arg_first["config"] = update_fn(copy.deepcopy(new_arg_first["config"]))
        new_arg = [new_arg_first] + new_arg[1:]
    else:
        raise ValueError("Unexpected configuration dictionary: %s" % new_arg)
    args = list(args)[:]
    args[new_i] = new_arg
    return args
134900
function mutateJsonFile(targetPath, source, mutator) {
  if (!mutator) {
    mutator = source;
    source = null;
  }
  let sourceConfig = source;
  try {
    // console.log('targetPath', targetPath);

    let targetConfig = readJson(targetPath);

    // console.log('source', source);
    if (typeof source === 'string') {
      sourceConfig = readJson(source);
    }
    // console.log('sourceConfig', targetPath, sourceConfig)
    sourceConfig = sourceConfig ? sourceConfig : targetConfig;

    let newConfig = mutator(targetConfig, sourceConfig);

    writeJson(targetPath, newConfig, {spaces: 2});

  } catch (e) {
    log.error('Error: operating on aurelia.json. Reverting to previous version ;{}', e);
    writeJson(targetPath, sourceConfig, {spaces: 2});
  }
}