Save a new clean version
162814
function saveCleanPeople () {
          var cleanPeople

          return Promise.resolve()
            .then(() => {
              cleanPeople = kb.sym(stats.book.dir().uri + 'clean-people.ttl')
              var sts = []
              for (let i = 0; i < stats.uniques.length; i++) {
                sts = sts.concat(kb.connectedStatements(stats.uniques[i], stats.nameEmailIndex))
              }
              var sz = (new $rdf.Serializer(kb)).setBase(stats.nameEmailIndex.uri)
              log('Serializing index of uniques...')
              var data = sz.statementsToN3(sts)

              return kb.fetcher.webOperation('PUT', cleanPeople, { data: data, contentType: 'text/turtle' })
            })
            .then(function () {
              log('Done uniques log ' + cleanPeople)
              return true
            })
            .catch(function (e) {
              log('Error saving uniques: ' + e)
            })
        }
492485
def clean(ctx, state, dry_run=False, bare=False, user=False):
    """"""
    from ..core import do_clean
    do_clean(ctx=ctx, three=state.three, python=state.python, dry_run=dry_run,
             system=state.system)
771917
def save(self):
        
        task.save_new_environment(self.name, self.datadir, self.target,
            self.ckan_version, self.deploy_target, self.always_prod)
1039385
def clean_python(ctx, dry_run=False):
    """"""
    # MAYBE NOT: "**/__pycache__"
    cleanup_dirs(["build", "dist", "*.egg-info", "**/__pycache__"],
                 dry_run=dry_run)
    if not dry_run:
        ctx.run("py.cleanup")
    cleanup_files(["**/*.pyc", "**/*.pyo", "**/*$py.class"], dry_run=dry_run)
1052369
def save(self):
        """"""
        self._connection.run(['change', '-i'], stdin=format(self), marshal_output=False)
        self._dirty = False
1237016
private void saveNumberOfChecksForUpdatedVersion(String versionDownloadable, int mChecksMade) {
        mChecksMade++;
        SharedPreferences prefs = mActivity.getSharedPreferences(PREFS_FILENAME, 0);
        SharedPreferences.Editor editor = prefs.edit();
        editor.putInt(SUCCESSFUL_CHEKS_PREF_KEY + versionDownloadable, mChecksMade);
        editor.commit();

    }
596526
function clientSave() {

    u.each(sources, function(source) {

      var dirtyFiles = u.filter(source.files, function(file) {
        if (file._dirty) {  // 1 means unsaved, 2 means saving
          file._dirty = 2;  // side effect of filter
          return true;
        }
        return false;
      });

      if (dirtyFiles.length) {

        var files = u.map(dirtyFiles, generator.serializeFile);

        debug('clientSave %s files, %s...', files.length, files[0].text.slice(0,200));

        // static save from browser directly to source
        if (opts.staticHost && source.staticSrc && source.src) {

          // NOTE: subtle difference in data compared to httpClient.put()
          source.src.put(files, function(err, savedFiles) {

            if (err || (u.size(savedFiles) !== u.size(dirtyFiles))) {
              // notify user on save errors
              return notify('error saving files, please check your internet connection');
            }

            u.each(dirtyFiles, function(file) {

              // no collision detection support with static saves (for now)
              file._oldtext = file.text;

              // only mark as clean if unchanged while waiting for save
              if (file._dirty === 2) { delete file._dirty; }
            });

            return source.verbose && notify(u.size(savedFiles) + ' file(s) saved');
          });
        }

        // normal (non-static) save from browser to pub-server
        else {
          httpClient.put({ source:source.name, files:files }, function(err, savedFiles) {

            if (err || (u.size(savedFiles) !== u.size(dirtyFiles))) {
              if (err) { log(err); }
              // notify user on save errors
              return notify('error saving files, please check your internet connection');
            }

            u.each(dirtyFiles, function(file, idx) {

              var savedFile = savedFiles[idx];

              if (typeof savedFile !== 'object') {
                // most likely a collision - must notify user
                return notify('error saving file: ' + savedFile);
              }

              // preserve for next update
              file._oldtext = savedFile.text;

              // only mark as clean if unchanged while waiting for save
              if (file._dirty === 2) { delete file._dirty; }

            });

            return source.verbose && notify(u.size(savedFiles) + ' file(s) saved');
          });
        }
      }
    });
  }
434467
def update(preset, clean):
    

    if self.isactive():
        lib.echo("ERROR: Exit current project first")
        sys.exit(lib.USER_ERROR)

    presets = _extern.github_presets()

    if preset not in presets:
        sys.stdout.write("\"%s\" not found" % preset)
        sys.exit(lib.USER_ERROR)

    lib.echo("Are you sure you want to update \"%s\", "
             "any changes will be lost?: [y/N]: ", newline=False)
    if raw_input().lower() in ("y", "yes"):
        presets_dir = _extern.presets_dir()
        preset_dir = os.path.join(presets_dir, preset)

        repository = presets[preset]

        if clean:
            try:
                _extern.remove_preset(preset)
            except:
                lib.echo("ERROR: Could not clean existing preset")
                sys.exit(lib.USER_ERROR)

        lib.echo("Updating %s.. " % repository)

        try:
            _extern.pull_preset(repository, preset_dir)
        except IOError as e:
            lib.echo(e)
            sys.exit(lib.USER_ERROR)

    else:
        lib.echo("Cancelled")
684924
def save(self, new=None, timeout=2):
        """"""
        if new: self.update(new) # allow two operations (update + save) with a single command
        if not self._updated: return # nothing to do
        thisPkg = os.path.dirname(__file__)
        filename = os.path.join(thisPkg, c.FOLDER_JSON, c.FILE_GAME_VERSIONS)
        fParts = c.FILE_GAME_VERSIONS.split('.')
        newFile = os.path.join(thisPkg, c.FOLDER_JSON, "%s_%s.%s"%(fParts[0], dateFormat.now(), fParts[1]))
        if not os.path.isfile(newFile):
            #fParts = c.FILE_GAME_VERSIONS.split('.')
            #newFile = "%s%s%s_%s.%s"%(c.FOLDER_JSON, os.sep, fParts[0], dateFormat.now(), fParts[1])
            #if not os.path.isfile(newFile):
            #print(filename)
            #print(newFile)
            os.rename(filename, newFile) # backup existing version file
        recordKeys = [(record["version"], record) for record in Handler.ALL_VERS_DATA.values()]
        data = [r for k,r in sorted(recordKeys)] # i.e. get values sorted by version key
        start = time.time()
        while time.time()-start < timeout: # allow multiple retries if multiple processes fight over the version file
            try:
                with open(filename, "wb") as f:
                    f.write(str.encode(json.dumps(data, indent=4, sort_keys=True))) # python3 requires encoding str => bytes to write to file
                self._updated = False
                return
            except IOError: pass # continue waiting for file to be available
        raise # after timeout, prior exception is what matters
1228382
function save(projectRoot, platform, version) {
    var platformsDir = path.join(projectRoot, 'platforms');
    var platformJsonFile = path.join(platformsDir, 'platforms.json');

    var data = {};
    if(fs.existsSync(platformJsonFile)){
        data = getJson(platformJsonFile);
    }
    data[platform] = version;
    fs.writeFileSync(platformJsonFile, JSON.stringify(data, null, 4), 'utf-8');
}
1238363
def save(self, filename='saved.ol.p'):
        
        import dill as pickle
        sv = {
            # 'feature_function': self.feature_function,
            'cl': self.cl

        }
        pickle.dump(sv, open(filename, "wb"))
429817
def clean(ctx, dry_run=False):
    """"""
    # -- VARIATION-POINT 1: Allow user to override in configuration-file
    directories = ctx.clean.directories
    files = ctx.clean.files

    # -- VARIATION-POINT 2: Allow user to add more files/dirs to be removed.
    extra_directories = ctx.clean.extra_directories or []
    extra_files = ctx.clean.extra_files or []
    if extra_directories:
        directories.extend(extra_directories)
    if extra_files:
        files.extend(extra_files)

    # -- PERFORM CLEANUP:
    execute_cleanup_tasks(ctx, cleanup_tasks, dry_run=dry_run)
    cleanup_dirs(directories, dry_run=dry_run)
    cleanup_files(files, dry_run=dry_run)
875660
def clean_except_files(self):
        """"""

        if self.is_finalized:
            self.warn("Can't clean; bundle is finalized")
            return False

        self.log('---- Cleaning ----')
        self.state = self.STATES.CLEANING

        self.commit()

        self.clean_sources()
        self.clean_tables()
        self.clean_partitions()
        self.clean_build()
        self.clean_ingested()
        self.clean_build_state()

        self.state = self.STATES.CLEANED

        self.commit()

        self.log('---- Done Cleaning ----')

        return True
601351
def clean():
    """"""
    shutil.rmtree('{PROJECT_NAME}.egg-info'.format(PROJECT_NAME=PROJECT_NAME), ignore_errors=True)
    shutil.rmtree('build', ignore_errors=True)
    shutil.rmtree('dist', ignore_errors=True)
    shutil.rmtree('htmlcov', ignore_errors=True)
    shutil.rmtree('__pycache__', ignore_errors=True)
744260
public function beforeVersionedSave()
    {
        $this->wasDirty = false;
        if ($this->isDirty && static::$createRevisionOnSave) {
            // update creation time
            $this->Created = time();
            $this->wasDirty = true;
        }
    }
339145
def clean():
    """"""
    d = ['build', 'dist', 'scikits.audiolab.egg-info', HTML_DESTDIR,
            PDF_DESTDIR]
    for i in d:
        paver.path.path(i).rmtree()

    (paver.path.path('docs') / options.sphinx.builddir).rmtree()
1274102
def clean(ctx):
    
    ctx.run(f'python setup.py clean')
    dist = ROOT.joinpath('dist')
    print(f'[clean] Removing {dist}')
    if dist.exists():
        shutil.rmtree(str(dist))