create a done file to avoid re-doing the mon deployment
193314
def create_done_path(done_path, uid=-1, gid=-1):
    """"""
    with open(done_path, 'wb'):
        pass
    os.chown(done_path, uid, gid);
470365
public void copyReferencedArtifactsToDeployFolder() {
        File deploy = new File(karafBase, "deploy");
        String[] fileEndings = new String[] { "jar", "war", "zip", "kar", "xml" };
        ProvisionOption<?>[] options = subsystem.getOptions(ProvisionOption.class);
        for (ProvisionOption<?> option : options) {
            try {
                File target = createUnique(option.getURL(), deploy, fileEndings);
                FileUtils.copyURLToFile(new URL(option.getURL()), target);
            }
            // CHECKSTYLE:SKIP
            catch (Exception e) {
                // well, this can happen...
            }
        }
    }
455108
function generate(target, data, done) {
        var files = this.files,
            dest = null,
            paths = [],
            promises = [],
            folders = [];

        //by default, we generate a table of contents called readme.md
        var options = this.options({
            contentsEnabled: true,
            contentsFile: 'readme.md',
            contentsTitle: 'Documentation',
            templateDir: null
        });

        //map the list of files we'll be generating documentation for
        files.forEach(function(group) {
            dest = group.dest;
            group.src.filter(function(file) {
                var obj = {
                    filename: path.basename(file),
                    folder: path.dirname(file),
                    path: file
                };

                if(options.pathFilter)
                    obj.folder = obj.folder.replace(options.pathFilter, '');

                folders.push(obj);
            });
        });

        //map the set of folders, sort, and generate documentation
        folders = _(folders)
            .groupBy(function(p) { return p.folder; })
            .sortBy(function(p) { return p.length && p[0].folder; })
            .map(function(group) {
                var file = group.length && group[0] || {};
                return {
                    name: file.folder,
                    path: file.path.replace(file.filename, ''),
                    files: group,
                    fileData: {}
                };
            })
            .each(function(folder) {
                var def = Q.defer();

                //queue the promise for the docs, and ensure the target exists (can safely run on an existing folder)
                promises.push(def.promise);
                grunt.file.mkdir(dest +'/'+ folder.name);

                //generate the docs for the folder, resolving the promise when complete
                jsdox.generateForDir(folder.path, dest +'/'+ folder.name, options.templateDir, def.resolve, function(file, fileData) {
                    folder.fileData[file] = fileData;
                });
            });

        //when all docs have been generated, build the table of contents, if needed (this stuff should be moved into a template)
        Q.all(promises).then(function() {
            if(!options.contentsEnabled) return done();

            var buf = [],
                w = function() { buf.push.apply(buf, arguments); };

            w(options.contentsTitle || 'Documentation', '===');

            folders.forEach(function(folder) {
                var docs = [];

                //derive the set of documents we *actually* generated docs for; that way we only add documented
                //code to the table of contents
                folder.files.forEach(function(file) {
                    //reset the path, pointing to the markdown file, and set the file data parsed by jsdox
                    file.path = path.join(file.folder, file.filename.replace('.js', '')).replace(/^\//, '');
                    file.data = folder.fileData[file.filename]||{};
                    if(grunt.file.exists(dest, file.path + '.md')) docs.push(file);
                });

                if(docs.length > 0) {
                    w(folder.name || 'Root', '---');
                    w('name | overview', ':-- | :--');
                    docs.forEach(function(file) {
                        w('['+ file.path +'.js]('+ file.path + '.md' + ') | '+ (file.data.overview?'_'+ file.data.overview +'_':''));
                    });
                    w('- - -');
                }

                w('\n');
            });

            //write out the table of contents, and complete the async generate task
            fs.writeFileSync(path.join(dest, (options.contentsFile || 'readme.md')), buf.join('\n'));
            done();
        });
    }
639079
function(file, file_done) {
    var item = {};
    item.file_path = path.join(nell_site[type_path_key], file);
    item.file_output = generateOutputDetails(nell_site, file, type);
    item.link = item.file_output.link_path;

    var processContent = concat(function(err, file_content_raw) {
      if (err) {
        return file_done(err);
      }
      item.file_content_raw = file_content_raw;
      item.file_metadata = mde.metadata(item.file_content_raw);
      item.file_content = mde.content(item.file_content_raw);

      async.series([
        function(callback) {
          processMarkdown(nell_site, item, callback);
        },
        function(callback) {
          nell_site[type_plural].push(item);
          callback();
        }
      ], file_done);
    });

    var fh = fs.createReadStream(item.file_path, {encoding: 'utf8'});
    fh.on('error', file_done);
    fh.pipe(processContent);
  }
546604
def create_file_manage_actions(self, fnames):
        """"""
        only_files = all([osp.isfile(_fn) for _fn in fnames])
        only_modules = all([osp.splitext(_fn)[1] in ('.py', '.pyw', '.ipy')
                            for _fn in fnames])
        only_notebooks = all([osp.splitext(_fn)[1] == '.ipynb'
                              for _fn in fnames])
        only_valid = all([encoding.is_text_file(_fn) for _fn in fnames])
        run_action = create_action(self, _("Run"), icon=ima.icon('run'),
                                   triggered=self.run)
        edit_action = create_action(self, _("Edit"), icon=ima.icon('edit'),
                                    triggered=self.clicked)
        move_action = create_action(self, _("Move..."),
                                    icon="move.png",
                                    triggered=self.move)
        delete_action = create_action(self, _("Delete..."),
                                      icon=ima.icon('editdelete'),
                                      triggered=self.delete)
        rename_action = create_action(self, _("Rename..."),
                                      icon=ima.icon('rename'),
                                      triggered=self.rename)
        open_external_action = create_action(self, _("Open With OS"), 
                                             triggered=self.open_external)
        ipynb_convert_action = create_action(self, _("Convert to Python script"),
                                             icon=ima.icon('python'),
                                             triggered=self.convert_notebooks)
        copy_file_clipboard_action = (
            create_action(self, _("Copy"),
                          QKeySequence(get_shortcut('explorer', 'copy file')),
                          icon=ima.icon('editcopy'),
                          triggered=self.copy_file_clipboard))
        save_file_clipboard_action = (
            create_action(self, _("Paste"),
                          QKeySequence(get_shortcut('explorer', 'paste file')),
                          icon=ima.icon('editpaste'),
                          triggered=self.save_file_clipboard))
        copy_absolute_path_action = (
            create_action(self, _("Copy Absolute Path"), QKeySequence(
                get_shortcut('explorer', 'copy absolute path')),
                          triggered=self.copy_absolute_path))
        copy_relative_path_action = (
            create_action(self, _("Copy Relative Path"), QKeySequence(
                get_shortcut('explorer', 'copy relative path')),
                          triggered=self.copy_relative_path))
        
        actions = []
        if only_modules:
            actions.append(run_action)
        if only_valid and only_files:
            actions.append(edit_action)
        
        if sys.platform == 'darwin':
            text=_("Show in Finder")
        else:
            text=_("Show in Folder")
        external_fileexp_action = create_action(self, text, 
                                triggered=self.show_in_external_file_explorer)        
        actions += [delete_action, rename_action]
        basedir = fixpath(osp.dirname(fnames[0]))
        if all([fixpath(osp.dirname(_fn)) == basedir for _fn in fnames]):
            actions.append(move_action)
        actions += [None]
        actions += [copy_file_clipboard_action, save_file_clipboard_action,
                    copy_absolute_path_action, copy_relative_path_action]
        if not QApplication.clipboard().mimeData().hasUrls():
            save_file_clipboard_action.setDisabled(True)
        actions += [None]
        if only_files:
            actions.append(open_external_action)
        actions.append(external_fileexp_action)
        actions.append([None])
        if only_notebooks and nbexporter is not None:
            actions.append(ipynb_convert_action)

        # VCS support is quite limited for now, so we are enabling the VCS
        # related actions only when a single file/folder is selected:
        dirname = fnames[0] if osp.isdir(fnames[0]) else osp.dirname(fnames[0])
        if len(fnames) == 1 and vcs.is_vcs_repository(dirname):
            commit_slot = lambda : self.vcs_command([dirname], 'commit')
            browse_slot = lambda : self.vcs_command([dirname], 'browse')
            vcs_ci = create_action(self, _("Commit"),
                                   icon=ima.icon('vcs_commit'),
                                   triggered=commit_slot)
            vcs_log = create_action(self, _("Browse repository"),
                                    icon=ima.icon('vcs_browse'),
                                    triggered=browse_slot)
            actions += [None, vcs_ci, vcs_log]

        return actions
178331
function cover( done ) {
	gulp.src( [ './src/**/*.js' ] )
		.pipe( istanbul() )
		.pipe( istanbul.hookRequire() )
		.on( 'finish', function() {
			done( runSpecs() );
		} );
}
310563
function copy (src, dest, dirname, done) {
      fsCompare.mtime(src, dest, function (err, diff) {
        if (err) return done(err)
        if (diff === 1) {
          if (fs.copyFile) fs.copyFile(src, dest, fin)
          else pump(fs.createReadStream(src), fs.createWriteStream(dest), fin)
        }
      })
      function fin (err) {
        if (err) return done(err)
        created(dirname, dest)
        done()
      }
    }
1115901
def prepare
      started_at = DateTime.now.to_s
      prepare_deploy
      prepare_common_installation
      puppet_installation
      create_prepare_checkpoint(started_at)
    end
107108
def init
      File.exist?(EXCLUDE_FILE) ? @logger.info('skip: creation excludes.d') : create_exclude_config
      Dir.exist?(ROLE_DIR) ? @logger.info('skip: creation roles.d') : create_roles_dir
      Dir.exist?(USER_DIR) ? @logger.info('skip: creation users.d') : create_users_dir
    end
61186
def make(directory):
    """"""

    if os.path.exists(directory):
        if os.path.isdir(directory):
            click.echo('Directory already exists')
        else:
            click.echo('Path exists and is not a directory')
        sys.exit()

    os.makedirs(directory)
    os.mkdir(os.path.join(directory, 'jsons'))
    copy_default_config(os.path.join(directory, 'config.yaml'))
702076
function(file, done){
      var ext = path.extname(file);
      if(!ssr.helpers.shouldIgnore(file) && ['.jade', '.ejs', '.md', '.styl', '.less', '.scss', '.sass', '.coffee', 'pug'].indexOf(ext) === -1){
        var localPath = path.resolve(outputPath, file);
        fs.mkdirp(path.dirname(localPath), function(err){
          fs.copy(path.resolve(setup.publicPath, file), localPath, done);
        });
      }else{
        done();
      }
    }
1369536
function init (done) {
    var node = tools.match_ext(filename, 'node')
    var json = tools.match_ext(filename, 'json')

    done(null, {
      content: content,
      json: json,
      node: node,
      // all other files are considered as javascript files.
      js: !node && !json,
    })
  }
1248965
function copyFile (src, done) {
        var dest = path.join(outdir, path.relative(compiler.dirname, src))
        var dirname = utils.dirname(dest)

        if (dirname === dest) {
          copy(src, dest, compiler.dirname, done)
        } else {
          mkdirp(dirname, function (err) {
            if (err) return done(err)
            copy(src, dest, compiler.dirname, done)
          })
        }
      }
1049740
function(project, relativeFilePath, appPath){
			var deferred = new Deferred();
			var self = this;

			if(project.ContentLocation === relativeFilePath){
				/* use the project root as deployment path */
				deferred.resolve({
					path: relativeFilePath,
					appPath: appPath
				});

				return deferred;
			}

			/* use the project as deployment path */
			deferred.resolve({
				path: relativeFilePath,
				appPath: appPath || "" /* Note that the appPath has to be updated as well */
			});

			return deferred;
		}
583455
def deploy(overwrite=False):
    
    check_settings()
    if overwrite:
        rmvirtualenv()
    deploy_funcs = [deploy_project,deploy_templates, deploy_static, deploy_media,  deploy_webconf, deploy_wsgi]
    if not patch_project() or overwrite:
        deploy_funcs = [deploy_db,mkvirtualenv,pip_install_requirements] + deploy_funcs
    for func in deploy_funcs: func()
133047
function (done) {
      var p = clone(pkg);
      delete p.devDependencies;
      var content = JSON.stringify(p, null, 2);
      write_if_not_exists('package.json', content, done);
    }
889539
function(file, done){
      process.nextTick(function () {
        terra.render(file, function(error, body){
          if(error){
            done(error);
          }else{
            if(body){
              var dest = path.resolve(outputPath, ssr.helpers.outputPath(file));
              fs.mkdirp(path.dirname(dest), function(err){
                fs.writeFile(dest, body, done);
              });
            }else{
              done();
            }
          }
        });
      });
    }