Upgrade the current bubble, should mimic init as much as possible(experimental)
184456
def cli(ctx, oldversion):
    """"""
    # print ctx.bubble
    path = ctx.home
    bubble_file_name = path + '/.bubble'
    config_file = path + '/config/config.yaml'

    if file_exists(bubble_file_name):
        pass
    else:
        with open(bubble_file_name, 'w') as dot_bubble:
            dot_bubble.write('bubble=' + metadata.version)
            dot_bubble.write('\nconfig=' + config_file)

        ctx.say_green('Initialised a  new bubble in [%s]' %
                      click.format_filename(bubble_file_name))

    create_dir(ctx, path + '/config/')
    create_dir(ctx, path + '/logs/')
    create_dir(ctx, path + '/export/')
    create_dir(ctx, path + '/import/')
    create_dir(ctx, path + '/remember/')
    create_dir(ctx, path + '/remember/archive')

    rules_file = path + '/config/rules.bubble'
    if file_exists(bubble_file_name):
        pass
    else:
        with open(rules_file, 'w') as rules:
            rules.write(get_example_rules_bubble())
            ctx.say_green('Created an example rules in [%s]' %
                          click.format_filename(rules_file))

    rule_functions_file = path + '/custom_rule_functions.py'
    if file_exists(rule_functions_file):
        pass
    else:
        with open(rule_functions_file, 'w') as rule_functions:
            rule_functions.write(get_example_rule_functions())
            ctx.say_green('Created an example rule_functions in [%s]' %
                          click.format_filename(rule_functions_file))

    ctx.say_green('Bubble upgraded')
248714
def update(self):
        
        # We need to save the console and state and restore it
        console = self.console
        aux = self.aux
        state = yield from self._get_container_state()

        yield from self.reset()
        yield from self.create()
        self.console = console
        self.aux = aux
        if state == "running":
            yield from self.start()
211263
def up(self):
        '''  '''
        # Set new flags
        flags = self.ifflags | IFF_UP
        self.ifflags = flags
        self.get_mtu()
448272
function reprovisionInstance(uuid, image_uuid, callback) {
    assert.string(uuid, 'uuid');
    assert.string(image_uuid, 'image_uuid');

    var opts = {};
    opts.image_uuid = image_uuid;

    return (this.put(sprintf('/instances/%s/upgrade', uuid), opts, callback));
}
322682
def instance(cls, conn, pkg_name='openquake.server.db.schema.upgrades'):
        
        try:
            # upgrader is an UpgradeManager instance defined in the __init__.py
            upgrader = importlib.import_module(pkg_name).upgrader
        except ImportError:
            raise SystemExit(
                'Could not import %s (not in the PYTHONPATH?)' % pkg_name)
        if not upgrader.read_scripts():
            raise SystemExit(
                'The upgrade_dir does not contain scripts matching '
                'the pattern %s' % upgrader.pattern)
        curs = conn.cursor()
        # check if there is already a versioning table
        curs.execute("SELECT name FROM sqlite_master "
                     "WHERE name=%r" % upgrader.version_table)
        versioning_table = curs.fetchall()
        # if not, run the base script and create the versioning table
        if not versioning_table:
            upgrader.init(conn)
            conn.commit()
        return upgrader
1351606
def update(self, instance, oldValue, newValue, subKey):
    """"""
    histogram = self.__get__(instance, None)
    histogram[subKey] += newValue - oldValue
284126
function bubble_up(i) {
    var p = parent(i);
    while (p >= 0 && tree[i][key] < tree[p][key]) {

      /* swap with parent */
      tree[i] = tree.splice(p, 1, tree[i])[0];

      /* go up one level */
      i = p;
      p = parent(i);
    }
  }
251608
def change(self, key, value):
        """"""
        self.obj[key] = value
        self.changes.append("Updating build:{}.{}={}"
                            .format(self.obj['name'], key, value))
        return self
1130042
def update(self, iteration, fobj):
        """""""
        self.bst.update(self.dtrain, iteration, fobj)
1055419
def update_rba(self, current_extent):
        # type: (int) -> None
        '''
        
        '''
        if not self._initialized:
            raise pycdlibexception.PyCdlibInternalError('This IsoHybrid object is not yet initialized')

        self.rba = current_extent
1094293
function init(options) {
    if (options === void 0) { options = {}; }
    if ('debug' in options) {
        diag.debug.enabled = options.debug;
        Q.longStackSupport = options.debug;
    }
    if ('serverUrl' in options) {
        var myURL = url.parse(options.serverUrl);
        if (!myURL.protocol && !myURL.host) {
            return Q.reject(new Error(options.serverUrl + " is not an accepted Url, please add a Host and a Protocol."));
        }
    }
    _.assignWith(exports.initOptions, cloneServerInitOptions(options), function (left, right) { return _.isUndefined(right) ? left : right; });
    if ('push' in options) {
        exports.initOptions.push = _.cloneDeep(options.push);
    }
    return device.ready;
}
1072307
def pre_init(self, value, obj):
        """"""

        try:
            if obj._state.adding:
                # Make sure the primary key actually exists on the object before
                # checking if it's empty. This is a special case for South datamigrations
                # see: https://github.com/bradjasper/django-jsonfield/issues/52
                if getattr(obj, "pk", None) is not None:
                    if isinstance(value, six.string_types):
                        try:
                            return json.loads(value, **self.load_kwargs)
                        except ValueError:
                            raise ValidationError(_("Enter valid JSON"))

        except AttributeError:
            # south fake meta class doesn't create proper attributes
            # see this:
            # https://github.com/bradjasper/django-jsonfield/issues/52
            pass

        return value
753449
def _post_init(self):
        """"""
        if WIN:
            self._find_devices_win()
        elif MAC:
            self._find_devices_mac()
        else:
            self._find_devices()
        self._update_all_devices()
        if NIX:
            self._find_leds()
1128267
function _updateSingleton() {
    if (!options.singletons) {
      return;
    }
    if (process.rebusinstances[folder]) {
      // Somebody added instance already.
      return;
    }
    // Save this instance to return the same for the same folder.
    process.rebusinstances[folder] = instance;
  }
372101
private void updateIncrementalSimonsIncrease(long inc, long now) {
		for (Simon simon : incrementalSimons.values()) {
			((CounterImpl) simon).increasePrivate(inc, now);
		}
	}
1327532
def init(name, runtime):
    """"""
    runtime = click.unstyle(runtime)

    stdout.write(
        style.format_command(
            'Initializing',
            '%s %s %s' % (name, style.gray('@'), style.green(runtime))
        )
    )

    config = Config(os.getcwd())
    config.set('runtime', runtime)
    config.save()

    generate.main(['init', name], standalone_mode=False)
    run.main(['python', 'manage.py', 'migrate'])
1080782
def upgrade():
    """"""
    op.create_table(
        'records_buckets',
        sa.Column(
            'record_id',
            sqlalchemy_utils.types.uuid.UUIDType(),
            nullable=False),
        sa.Column(
            'bucket_id',
            sqlalchemy_utils.types.uuid.UUIDType(),
            nullable=False),
        sa.ForeignKeyConstraint(['bucket_id'], [u'files_bucket.id'], ),
        sa.ForeignKeyConstraint(['record_id'], [u'records_metadata.id'], ),
        sa.PrimaryKeyConstraint('record_id', 'bucket_id')
    )