Applies scripts in order, returning number of scripts applied
4393
def apply!(dir)
      Preconditions.check_state(File.directory?(dir),
                                "Dir[%s] does not exist" % dir)

      count = 0
      @scripts.each_pending(dir) do |filename, path|
        count += 1
        if @dry_run
          puts "[DRY RUN] Applying #{filename}"
          puts path
          puts ""
        else
          print "Applying #{filename}"
          @db.psql_file(filename, path)
          @scripts.record_as_run!(filename)
          puts " Done"
        end
      end
      count
    end
1256297
private static List<File> findPythonScripts(List<File> pythonLibDirectories) {
        List<File> scripts = new ArrayList<>();
        for (File dir : pythonLibDirectories) {
            if (dir.exists()) {
                scripts.addAll(Arrays.asList(dir.listFiles(PYTHON_SCRIPT_FILE_FILTER)));
            }
        }
        return scripts;
    }
1353150
def executables
      scripts = []

      if @bin_dir.directory?
        @bin_dir.entries.each do |path|
          scripts << path.basename.to_s if path.file?
        end
      end

      return scripts
    end
311526
function evalSha(redis, sha, keys, args, callback) {
  if (sha) {
    return redis.evalsha.apply(redis, _.flatten([sha, keys.length, keys, args, callback]));
  }
  return callback(new Error('evalsha called for not loaded script'));
}
49455
function sequence() {
    var funcs = arguments;
    var funcCount = funcs.length;
    return function() {
      var args = arguments;
      for (var i = 0; i < funcCount; i++) {
        args[0] = funcs[i].apply(this, args);
      }
      return args[0];
    };
  }
99053
def script_exists(self, digest, *digests):
        """"""
        return self.execute(b'SCRIPT', b'EXISTS', digest, *digests)
1083227
def partition_scripts(scripts, start_type1, start_type2):
    
    match, other = [], []
    for script in scripts:
        if (HairballPlugin.script_start_type(script) == start_type1 or 
            HairballPlugin.script_start_type(script) == start_type2):
            match.append(script)
        else:
            other.append(script)
    return match, other
464571
function (latestMigrationFile) {
        return function (err, files) {
            if (err) {
                throw err;
            }
            files = _getApplicableMigrations(files, latestMigrationFile);

            var filesRemaining = files.length;
            var parsedMigrations = {};
            console.log('* Number of migration scripts to apply:', filesRemaining);
            if (filesRemaining === 0) {
//                me.client; // TODO : what is this ?
            }

            for (var file in files) {
                if (files.hasOwnProperty(file)) {

                    var filename = files[file];
                    var filepath = _config.migrationFolder + '/' + filename;
                    var parser = new migrationParser(filepath, me.client);
                    parser.on('ready', function () {
                        filesRemaining--;
                        parsedMigrations[basename(this.file)] = this;
                        if (filesRemaining === 0) {
                            var orderedMigrations = _orderMigrations(files, parsedMigrations);

                            // Here is where the migration really takes place
                            me.changelog.apply(orderedMigrations, direction);
                        }
                    });
                }
            }
        }
    }
271761
function(){
		var i, script,
		  scripts = doc[STR_GET_BY_TAG]('script');
		for (i = scripts.length - 1; i > -1 && (script = scripts[i]); i--) {
			if (script.readyState === 'interactive') {
				return script;
			}
		}
	}
884700
function (source, options, verbose) {
    /* Single file import */
    if ( 'string' == typeof source ) {
        return imports(source, options, verbose);
    }

    /* Multiple files import */
    else if ( 'object' == typeof source ) {
        /* Creating scripts holder */
        var scripts = '', result;

        /* Files in array */
        if ( Array.isArray(source) ) {
            source.forEach(function (file, i) {
                var scr = imports(file, options, verbose);

                if ( scr ) {
                    scripts += scr.text;

                    if ( i == 0 ) {
                        result = scr;
                    }
                }
            });

            if ( result ) {
                return result;
            }
        }

        /* Files in object */
        else {
            var start = 0;

            source.forEach(function (file, options) {
                var scr = imports(file, options, verbose);

                if ( scr ) {
                    scripts += scr.text;

                    if ( start == 0 ) {
                        result = scr;
                    }
                }

                start++;
            });

            if ( result ) {
                return result;
            }
        }
    }
}
286904
def Scripts(unicode_dir=_UNICODE_DIR):
  

  scripts = {}

  def DoLine(codes, fields):
    """Process single Scripts.txt line, updating scripts."""
    (_, name) = fields
    scripts.setdefault(name, []).extend(codes)

  ReadUnicodeTable(unicode_dir+"/Scripts.txt", 2, DoLine)
  return scripts
912861
def sequential_apply(task, args, concurrent_tasks=cpu_count * 3,
                     weight=lambda item: 1, key=lambda item: 'Unspecified'):
    
    chunks = split_in_blocks(args[0], concurrent_tasks or 1, weight, key)
    task_args = [(ch,) + args[1:] for ch in chunks]
    return itertools.starmap(task, task_args)
130729
def _makeScriptOrder(gpos):
    
    scripts = []
    for scriptRecord in gpos.ScriptList.ScriptRecord:
        scripts.append(scriptRecord.ScriptTag)
    if "DFLT" in scripts:
        scripts.remove("DFLT")
        scripts.insert(0, "DFLT")
    return sorted(scripts)
1281385
def __run_pre_all(self):
        """"""

        # if the list of delta dirs is [delta1, delta2] the pre scripts of delta2 are
        # executed before the pre scripts of delta1

        for d in reversed(self.dirs):
            pre_all_py_path = os.path.join(d, 'pre-all.py')
            if os.path.isfile(pre_all_py_path):
                print('     Applying pre-all.py...', end=' ')
                self.__run_py_file(pre_all_py_path, 'pre-all')
                print('OK')

            pre_all_sql_path = os.path.join(d, 'pre-all.sql')
            if os.path.isfile(pre_all_sql_path):
                print('     Applying pre-all.sql...', end=' ')
                self.__run_sql_file(pre_all_sql_path)
                print('OK')
658143
function extractScripts($) {
  var scripts = [];
  $('script[src]').each(function() {
    var el  = $(this);
    var src = el.attr('src');
    if(ABS.test(src)) return;
    scripts.push(/^\./.test(src) ? src : './' + src);
    el.remove();
  })
  return scripts;
}
719654
def get_scripts(self):
        
        ret = list()
        for d in self.allpaths:
            scripts = filter(lambda x: x.startswith(self.prefix), os.listdir(d))
            scripts.sort(reverse=(not self.sort_ascending))
            ret = ret + [os.path.join(d, x) for x in scripts]

        return(ret)
534814
protected void prepareSimpleCleaningApproachScripts()
   {
      cleaningScripts.addAll(getFKRemovingScripts());
      cleaningScripts.addAll(getSingleDbWorkspaceCleaningScripts());

      committingScripts.addAll(getFKAddingScripts());

      rollbackingScripts.addAll(getFKAddingScripts());
   }