Calls clang-apply-fixes on a given directory.
5311
def apply_fixes(args, tmpdir):
  """"""
  invocation = [args.clang_apply_replacements_binary]
  if args.format:
    invocation.append('-format')
  if args.style:
    invocation.append('-style=' + args.style)
  invocation.append(tmpdir)
  subprocess.call(invocation)
124474
def rpc_fix_code_with_black(self, source, directory):
        
        source = get_source(source)
        return fix_code_with_black(source, directory)
1147142
function(inDir, outDir, relativePath, newCache) {
    var ext = this._matchingFileExtension(relativePath);
    var moduleName = relativePath.slice(0, relativePath.length - (ext.length + 1));
    var fullInputPath = path.join(inDir, relativePath);
    var fullOutputPath = path.join(outDir, moduleName + '.' + this.targetExtension);

    var entry = this._transpileThroughCache(
      moduleName,
      fs.readFileSync(fullInputPath, 'utf-8'),
      newCache
    );

    mkdirp.sync(path.dirname(fullOutputPath));
    fs.writeFileSync(fullOutputPath, entry.output);
  }
499353
function CliDispatch (action, dir, baseDir) {
  this.action = action
  this.dir = dir
  this.baseDir = baseDir
}
203436
def call(release, _options = {})
      Dir.chdir(release.build_path.to_s) do
        @pattern.each do |pattern|
          Dir.glob(pattern).each do |file|
            clean_path(release, file)
          end
        end
      end
    end
1310257
def global_fixes():
    """"""
    for function in list(globals().values()):
        if inspect.isfunction(function):
            arguments = _get_parameters(function)
            if arguments[:1] != ['source']:
                continue

            code = extract_code_from_function(function)
            if code:
                yield (code, function)
177671
def ensure_directory(path):
    """"""
    dirname = os.path.dirname(path)
    py31compat.makedirs(dirname, exist_ok=True)
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
542359
public void setCompileDirectory(String directory) {
        if (directory != null && directory.trim().length() > 0) {
            File file = new File(directory);
            if (file.exists() || file.mkdirs()) {
                this.compileDirectory = file;
            }
        }
    }
1141930
function filesInRepository(dir) {
        var ignoreDirs = cog.getOption('ignore_dirs');
        // TODO: Allow an array and move to config.
        var ignoreFiles = /~$/;
        var files = glob.sync(dir ? dir + '/*' : '*');
        var ret = [];
        for (var i = 0; i < files.length; i++) {
            if (fs.lstatSync(files[i]).isDirectory()) {
                // Ignore standard directories of uninterest.
                if (!dir && ignoreDirs.indexOf(files[i]) >= 0) {
                    continue;
                }
                ret = filesInRepository(files[i]).concat(ret);
            } else {
                if (!ignoreFiles.test(files[i])) {
                    ret.push(files[i]);
                }
            }
        }
        return ret;
    }
56198
def _run_lint_on_file_stamped_args(file_path,  # suppress(too-many-arguments)
                                   stamp_file_path,
                                   log_technical_terms_to,
                                   linter_functions,
                                   tool_options,
                                   fix_what_you_can):
    """"""
    dictionary_path = os.path.abspath("DICTIONARY")
    dependencies = [file_path]

    if os.path.exists(dictionary_path):
        dependencies.append(dictionary_path)

    kwargs = OrderedDict()
    kwargs["jobstamps_dependencies"] = dependencies
    kwargs["jobstamps_cache_output_directory"] = stamp_file_path

    if log_technical_terms_to:
        kwargs["jobstamps_output_files"] = [log_technical_terms_to]

    return ((file_path,
             linter_functions,
             tool_options,
             fix_what_you_can),
            kwargs)
961163
def set_cwd(fn):
        
        def wrapped(self, *args, **kwargs):
            log.info('Calling function: %s with args=%s', fn, args if args else [])
            cwd = os.getcwd()
            log.info('Saved cwd: %s', cwd)
            os.chdir(self._cwd)
            log.info('Changing working directory to: %s', self._cwd)
            try:
                return fn(self, *args, **kwargs)
            finally:
                os.chdir(cwd)
                log.info('Restored working directory to: %s', cwd)

        return wrapped
888309
function compileAllFiles (src, isDebug, options)
{
    glob(src,
        function (err, files)
        {
            if (err) throw err;

            for (var i = 0, l = files.length; i < l; i++)
            {
                // only start compilation at root files
                if (sassHelpers.isRootFile(files[i]))
                {
                    compileSingleFile(files[i], isDebug, options);
                }
            }
        }
    );
}
1136299
function resolveApp(dir) {
  if (path.isAbsolute(dir)) return dir;
  return path.join(process.cwd(), dir);
}
1054942
def do_cd(self, arg):
        """"""
        from os import chdir, path
        fullpath = path.abspath(path.expanduser(arg))
        if path.isdir(fullpath):
            chdir(fullpath)
        else:
            msg.err("'{}' is not a valid directory.".format(arg))
467567
function ( pkg, compiler ) {
			if ( !sys.isEmpty( task.data.depends ) && options.resolveAliases && !sys.isEmpty( pkg.dependAliases ) ) {

				compiler.transform( function ( file ) {
					grunt.verbose.writeln( "Transforming " + file );
					function write( buf ) {
						data += buf;
					}

					var data = '';

					return through( write, function () {
						var __aliases = [];
						sys.each( pkg.dependAliases, function ( al ) {
							if ( data.indexOf( "'" + al + "'" ) !== -1 || data.indexOf( '"' + al + '"' ) !== -1 ) {
								__aliases.push( "'" + al + "' : '" + al + "'" );

								data = data.replace( new RegExp( "'" + al + "'", "g" ), "__aliases['" + al + "']" );
								data = data.replace( new RegExp( '"' + al + '"', "g" ), "__aliases['" + al + "']" );
							}
						} );
						if ( !sys.isEmpty( __aliases ) ) {
							var aliasDefinition = "var __aliases = {" + __aliases.join( ",\n" ) + "};\n";

							data = aliasDefinition + data;

						}
						this.queue( data );
						this.queue( null );
					} );

				} );
			}
		}
471101
def _compile(self, target, results_dir, source):
    """"""
    obj = self._objpath(target, results_dir, source)
    safe_mkdir_for(obj)

    abs_source = os.path.join(get_buildroot(), source)

    # TODO: include dir should include dependent work dir when headers are copied there.
    include_dirs = []
    for dep in target.dependencies:
      if self.is_library(dep):
        include_dirs.extend([os.path.join(get_buildroot(), dep.target_base)])

    cmd = [self.cpp_toolchain.compiler]
    cmd.extend(['-c'])
    cmd.extend(('-I{0}'.format(i) for i in include_dirs))
    cmd.extend(['-o' + obj, abs_source])
    cmd.extend(self.get_options().cc_options)

    # TODO: submit_async_work with self.run_command, [(cmd)] as a Work object.
    with self.context.new_workunit(name='cpp-compile', labels=[WorkUnitLabel.COMPILER]) as workunit:
      self.run_command(cmd, workunit)

    self.context.log.info('Built c++ object: {0}'.format(obj))