Checks the outdated scenario.
1) A key is added
2) Add fr translation
3) Update default translation => key become outdated
4) Update en translation => key is still outdated
5) Update fr translation => key is no longer outdated
487442
@Test
    public void outdated_scenario() throws JSONException {
        httpPost("keys", jsonKey.toString(), 201);

        try {
            // Add two outdated translations
            sendTranslationUpdate("zztranslation", EN, true);
            sendTranslationUpdate("translation", FR, true);

            // Update the default translation
            jsonKey.put("translation", "updated translation");
            httpPut("keys/" + keyName, jsonKey.toString(), 200);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update English translations
            sendTranslationUpdate("updated translation", EN, false);

            // The key should remain outdated
            assertOutdatedStatus(true);

            // Update French translations
            sendTranslationUpdate("updated translation", FR, false);

            // Now, all the translation have been updated
            assertOutdatedStatus(false);

        } finally {
            // clean the repo
            httpDelete("keys/" + keyName, 204);
        }
    }
1221613
public function change()
    {
        $tableName = 'language_translations';
        if (!$this->hasTable($tableName)) {
            $tableName = 'translations';
        }

        $table = $this->table($tableName);
        if (!$table->hasColumn('is_active')) {
            $table->addColumn('is_active', 'boolean', [
                'default' => 0,
                'null' => false,
            ]);
        }
        $table->update();
    }
680358
def _check_version():
    """"""
    from ._config import APP_NAME

    if VersionCache.load(APP_NAME).is_fresh:
        return

    from pkg_resources import parse_version
    from renku.version import __version__

    version = parse_version(__version__)
    allow_prereleases = version.is_prerelease

    latest_version = find_latest_version(
        'renku', allow_prereleases=allow_prereleases
    )

    if version < latest_version:
        click.secho(
            'You are using renku version {version}, however version '
            '{latest_version} is available.\n'
            'You should consider upgrading ...'.format(
                version=__version__,
                latest_version=latest_version,
            ),
            fg='yellow',
            bold=True,
        )

    VersionCache(pypi_version=str(latest_version)).dump(APP_NAME)
971037
def changed(self, key):
        
        if self._prev_dict is None:
            return True
        return self.previous(key) != self.get(key)
223339
def _is_updated(old_conf, new_conf):
    '''
    
    '''
    changed = {}

    # Dirty json hacking to get parameters in the same format
    new_conf = _json_to_unicode(salt.utils.json.loads(
        salt.utils.json.dumps(new_conf, ensure_ascii=False)))
    old_conf = salt.utils.json.loads(salt.utils.json.dumps(old_conf, ensure_ascii=False))

    for key, value in old_conf.items():
        oldval = six.text_type(value).lower()
        if key in new_conf:
            newval = six.text_type(new_conf[key]).lower()
        if oldval == 'null' or oldval == 'none':
            oldval = ''
        if key in new_conf and newval != oldval:
            changed[key] = {'old': oldval, 'new': newval}
    return changed
750860
def _warn_if_deprecated(key):
    

    d = _get_deprecated_option(key)
    if d:
        if d.msg:
            print(d.msg)
            warnings.warn(d.msg, DeprecationWarning)
        else:
            msg = "'%s' is deprecated" % key
            if d.removal_ver:
                msg += ' and will be removed in %s' % d.removal_ver
            if d.rkey:
                msg += ", please use '%s' instead." % d.rkey
            else:
                msg += ', please refrain from using it.'

            warnings.warn(msg, DeprecationWarning)
        return True
    return False
610809
def _validate_version(connection, dsn):
    
    try:
        version = get_stored_version(connection)
    except VersionIsNotStored:
        logger.debug('Version not stored in the db: assuming new database creation.')
        version = SCHEMA_VERSION
        _update_version(connection, version)
    assert isinstance(version, int)

    if version > 10 and version < 100:
        raise DatabaseError('You are trying to open an old SQLite database.')

    if _migration_required(connection):
        migrate(connection, dsn)
832243
def update(self, quiet=False, prefix='[polyglot_data] '):
    
    self.clear_status_cache()
    for pkg in self.packages():
      if self.status(pkg) == self.STALE:
        self.download(pkg, quiet=quiet, prefix=prefix)
1167419
private Response assertOutdatedStatus(boolean outdated) throws JSONException {
        Response response = httpGet("keys/" + keyName);
        JSONObject actual = new JSONObject(response.asString());
        Assertions.assertThat(actual.getBoolean("outdated")).isEqualTo(outdated);
        return response;
    }
618800
def update
      params[:value].to_s.strip!
      @old_value = @translation_key.category.name
      respond_to do |format|
        if !params[:value].blank? && @translation_key.update_attribute(:name, params[:value])
          format.json { render json: {  new_value: @translation_key.name, new_category: @translation_key.category.name, old_category: @old_value, key_id: @translation_key.id } }
        else
          format.json { render json: @translation_key.errors, status: :unprocessable_entity }
        end
      end
    end
658036
void update()
    {
        mx = x - oldX;
        my = y - oldY;
        oldX = x;
        oldY = y;
    }
859162
protected final void doUpdates(final K key,
            final Function<? super V, ? extends V> mutate) {
        apply(new Update<>(key, mutate));
    }
89329
public boolean updateOrigKey(Map<String,Object> propOrig, String strKey, String strOrigValue, String strNewValue, boolean bOrigChange)
    {
            if (((strNewValue != null) && (!strNewValue.equals(strOrigValue)))
                || ((strNewValue == null) && (strOrigValue != null)))
        {   // If I am using the read value now (and it has changed from the orig value) change the orig value to the read value.
            bOrigChange = true;
            if (strNewValue != null)    
                propOrig.put(strKey, strNewValue);  // Original must reflect the read value in case it changes again.
            else
                propOrig.remove(strKey);  // Original must reflect the read value in case it changes again.
        }
        return bOrigChange;
    }
1051401
def _cache_translation_needs_fallback(instance, language_code, related_name, timeout=cache.default_timeout):
    
    if not appsettings.PARLER_ENABLE_CACHING or not instance.pk or instance._state.adding:
        return

    tr_model = instance._parler_meta.get_model_by_related_name(related_name)
    key = get_translation_cache_key(tr_model, instance.pk, language_code)
    cache.set(key, {'__FALLBACK__': True}, timeout=timeout)
1023220
def ensure_least_updates_possible(self):
        
        constraints = self.get_constraints()
        can_use_original = True
        can_use_updated = True
        satisfied_by_versions = set()
        for constraint in constraints:
            if not constraint.specifier.contains(self.original_version):
                self.can_use_original = False
            if not constraint.specifier.contains(self.updated_version):
                self.can_use_updated = False
            satisfied_by_value = getattr(constraint, "satisfied_by", None)
            if satisfied_by_value:
                satisfied_by = "{0}".format(
                    self.clean_specifier(str(satisfied_by_value.version))
                )
                satisfied_by_versions.add(satisfied_by)
        if can_use_original:
            self.entry_dict = self.lockfile_dict.copy()
        elif can_use_updated:
            if len(satisfied_by_versions) == 1:
                self.entry_dict["version"] = next(iter(
                    sat_by for sat_by in satisfied_by_versions if sat_by
                ), None)
                hashes = None
                if self.lockfile_entry.specifiers == satisfied_by:
                    ireq = self.lockfile_entry.as_ireq()
                    if not self.lockfile_entry.hashes and self.resolver._should_include_hash(ireq):
                        hashes = self.resolver.get_hash(ireq)
                    else:
                        hashes = self.lockfile_entry.hashes
                else:
                    if self.resolver._should_include_hash(constraint):
                        hashes = self.resolver.get_hash(constraint)
                if hashes:
                    self.entry_dict["hashes"] = list(hashes)
                    self._entry.hashes = frozenset(hashes)
        else:
            # check for any parents, since they depend on this and the current
            # installed versions are not compatible with the new version, so
            # we will need to update the top level dependency if possible
            self.check_flattened_parents()
1056234
def accept
      # If translation is accepted do nothing
      unless self.accepted?
        self.translation_key.accepted_translation_in(self.lang)
          .try(:update_attribute, :status, TranslationKey::PENDING)

        # reload the translation key as it has changed
        self.translation_key.reload
        self.update_attribute(:status, ACCEPTED)
      end
    end
444132
def outdated?
      @outdated = []
      fields.each do |fld|
        if fld.transition?
          # call r_trans method with local val to compare local with remote val
          # SomeTrans.remote_transfer_method( l_obj.field )
          virtual_l_val = eval "#{fld.r_trans} l_obj.send( fld.l_name )"
          @outdated << fld if virtual_l_val != r_obj.send( fld.r_name )
        else
          # no transfer method, directly compare values
          @outdated << fld if r_obj.send( fld.r_name ) != l_obj.send( fld.l_name )
        end
      end
      !@outdated.empty?
    end