Returns the path where the ESLint is bootstrapped.

    :param string task_workdir: The task's working directory
    :returns: The path where ESLint is bootstrapped and whether or not it is configured
    :rtype: (string, bool)
18187
def eslint_supportdir(self, task_workdir):
    
    bootstrapped_support_path = os.path.join(task_workdir, 'eslint')

    # TODO(nsaechao): Should only have to check if the "eslint" dir exists in the task_workdir
    # assuming fingerprinting works as intended.

    # If the eslint_setupdir is not provided or missing required files, then
    # clean up the directory so that Pants can install a pre-defined eslint version later on.
    # Otherwise, if there is no configurations changes, rely on the cache.
    # If there is a config change detected, use the new configuration.
    if self.eslint_setupdir:
      configured = all(os.path.exists(os.path.join(self.eslint_setupdir, f))
                       for f in self._eslint_required_files)
    else:
      configured = False
    if not configured:
      safe_mkdir(bootstrapped_support_path, clean=True)
    else:
      try:
        installed = all(filecmp.cmp(
          os.path.join(self.eslint_setupdir, f), os.path.join(bootstrapped_support_path, f))
        for f in self._eslint_required_files)
      except OSError:
        installed = False

      if not installed:
        self._configure_eslinter(bootstrapped_support_path)
    return bootstrapped_support_path, configured
560219
public static Path getTaskOutputPath(JobConf conf, String name) 
  throws IOException {
    // ${mapred.out.dir}
    Path outputPath = getOutputPath(conf);
    if (outputPath == null) {
      throw new IOException("Undefined job output-path");
    }

    OutputCommitter committer = conf.getOutputCommitter();
    Path workPath = outputPath;
    TaskAttemptContext context = new TaskAttemptContext(conf,
                TaskAttemptID.forName(conf.get("mapred.task.id")));
    if (committer instanceof FileOutputCommitter) {
      workPath = ((FileOutputCommitter)committer).getWorkPath(context,
                                                              outputPath);
    }
    
    // ${mapred.out.dir}/_temporary/_${taskid}/${name}
    return new Path(workPath, name);
  }
978079
def setup_path(invoke_minversion=None):
    """"""
    # print("INVOKE.tasks: setup_path")
    if not os.path.isdir(TASKS_VENDOR_DIR):
        print("SKIP: TASKS_VENDOR_DIR=%s is missing" % TASKS_VENDOR_DIR)
        return
    elif os.path.abspath(TASKS_VENDOR_DIR) in sys.path:
        # -- SETUP ALREADY DONE:
        # return
        pass

    use_vendor_bundles = os.environ.get("INVOKE_TASKS_USE_VENDOR_BUNDLES", "no")
    if need_vendor_bundles(invoke_minversion):
        use_vendor_bundles = "yes"

    if use_vendor_bundles == "yes":
        syspath_insert(0, os.path.abspath(TASKS_VENDOR_DIR))
        if setup_path_for_bundle(INVOKE_BUNDLE, pos=1):
            import invoke
            bundle_path = os.path.relpath(INVOKE_BUNDLE, os.getcwd())
            print("USING: %s (version: %s)" % (bundle_path, invoke.__version__))
    else:
        # -- BEST-EFFORT: May rescue something
        syspath_append(os.path.abspath(TASKS_VENDOR_DIR))
        setup_path_for_bundle(INVOKE_BUNDLE, pos=len(sys.path))

    if DEBUG_SYSPATH:
        for index, p in enumerate(sys.path):
            print("  %d.  %s" % (index, p))
24654
def search_worker(self, regex, directory_path, names, binary=False,
                      callback=None):
        
        try:
            result = DirectoryResult(directory_path)
            def find_matches(name):
                full_path = path.join(directory_path, name)
                file_contents = get_file_contents(full_path, binary)
                start = 0
                match = regex.search(file_contents, start)
                while match:
                    result.put(name, file_contents, match)
                    start = match.end()
                    match = regex.search(file_contents, start)
            for name in names:
                try:
                    find_matches(name)
                except IOError:
                    pass
            if callback:
                callback(result)
        except KeyboardInterrupt, e:
            exit(1)
53427
private List<String> buildLaunchTaskArgs(TaskControllerContext context) {
    List<String> commandArgs = new ArrayList<String>(3);
    String taskId = context.task.getTaskID().toString();
    String jobId = getJobId(context);
    LOG.debug("getting the task directory as: " 
        + getTaskCacheDirectory(context));
    commandArgs.add(getDirectoryChosenForTask(
        new File(getTaskCacheDirectory(context)), 
        context));
    commandArgs.add(jobId);
    if(!context.task.isTaskCleanupTask()) {
      commandArgs.add(taskId);
    }else {
      commandArgs.add(taskId + TaskTracker.TASK_CLEANUP_SUFFIX);
    }
    return commandArgs;
  }
149880
def configure_task_directory(self):
        
        self._display_question(
            "Please choose a directory in which to store the course/task files. By default, the tool will put them in the current "
            "directory")
        task_directory = None
        while task_directory is None:
            task_directory = self._ask_with_default("Task directory", ".")
            if not os.path.exists(task_directory):
                self._display_error("Path does not exists")
                if self._ask_boolean("Would you like to retry?", True):
                    task_directory = None

        if os.path.exists(task_directory):
            self._display_question("Demonstration tasks can be downloaded to let you discover INGInious.")
            if self._ask_boolean("Would you like to download them ?", True):
                try:
                    filename, _ = urllib.request.urlretrieve(
                        "https://api.github.com/repos/UCL-INGI/INGInious-demo-tasks/tarball")
                    with tarfile.open(filename, mode="r:gz") as thetarfile:
                        members = thetarfile.getmembers()
                        commonpath = os.path.commonpath([tarinfo.name for tarinfo in members])

                        for member in members:
                            member.name = member.name[len(commonpath) + 1:]
                            if member.name:
                                thetarfile.extract(member, task_directory)

                    self._display_info("Successfully downloaded and copied demonstration tasks.")
                except Exception as e:
                    self._display_error("An error occurred while copying the directory: %s" % str(e))
        else:
            self._display_warning("Skipping copying the 'test' course because the task dir does not exists")

        return {"tasks_directory": task_directory}
1117259
def import_and_get_task(task_path):
    
    module, function = task_path.rsplit('.', 1)
    app_module = importlib.import_module(module)
    app_function = getattr(app_module, function)
    return app_function
191886
def get_env(working_directory=None):
    
    working = working_directory if working_directory else os.getcwd()
    dist_dirs = glob.glob(working + "/f5-*-dist")
    print(dist_dirs)
    dist_dir_re = re.compile('/([^/]+)-dist/?')
    if dist_dirs:
        dist_dir = dist_dirs[0]
        match = dist_dir_re.search(dist_dir)
        if match:
            project_name = match.group(1)
        else:
            print("Unrecognized run location:\n" + working)
            exit_cleanly(errnum=errno.EIO)
    elif '-dist/scripts' in working:
        match = dist_dir_re.search(working)
        if match:
            project_name = match.group(1)
    else:
        print("Unable to determine the *-dist directory from " + working)
        exit_cleanly(errnum=errno.ENOSYS)
    stdeb_cfg = dist_dir + "/deb_dist/stdeb.cfg"
    setup_cfg = working + "/setup.cfg"
    stp_reqs = working + "/setup_requirements.txt"
    scripts = dist_dir + "/scripts"
    env = {'working': working, 'dist_dir': dist_dir, 'stdeb_cfg': stdeb_cfg,
           'setup_requirements': stp_reqs, 'setup_cfg': setup_cfg,
           'scripts': scripts, 'project': project_name}
    return env
1259943
public final File getTaskDirectory() {
        createIfMissing(this.working, "Working");
        try {
            return Files.createTempDirectory(this.working.toPath(), TASK_DIR_PREFIX).toFile();
        } catch (IOException e) {
            throw new AssertionError("Unable to create temporary directory in '" + this.working + "'");
        }
    }
12559
public static PathImpl getLocalWorkDir(ClassLoader loader)
  {
    PathImpl path = _localWorkDir.get(loader);

    if (path != null)
      return path;
    
    path = getTmpWorkDir();

    _localWorkDir.setGlobal(path);
    
    try {
      path.mkdirs();
    } catch (java.io.IOException e) {
    }

    return path;
  }
919073
function(taskname, directory, depth) {

        if( 0 > depth ) {
            grunt.log.error('Task '+taskname+' not found in parent directories with depth '+depth);
            return;
        }

        var taskDir = path.join(directory, nd, taskname);
        var target  = path.join(taskDir, td);

        if( grunt.file.exists(target) ) {
            grunt.loadTasks(target);
            return;
        }

        _load(taskname, path.resolve(directory,up), depth-1);

    }
256442
def _GetMergeTaskStorageFilePath(self, task):
    
    filename = '{0:s}.plaso'.format(task.identifier)
    return os.path.join(self._merge_task_storage_path, filename)
609793
function getTaskCallback(callback) {
  let result = null
  // Get the callback function; throw errors, because we can't log them
  // later until we have identified a task name
  if (typeof callback === 'function') {
    result = callback
  } else if (typeof callback === 'string') {
    let id = callback.trim()
    // treat like a local path if it looks like one
    if (
      id.startsWith('./') ||
      id.startsWith('../') ||
      id.endsWith('.js') ||
      (id.includes('/') && !id.startsWith('@'))
    ) {
      if (path.isAbsolute(id) === false) {
        id = path.join(process.cwd(), id)
      }
    }
    try {
      result = require(id)
    } catch (err) {
      throw new Error(`Could not load module '${id}':\n${err}`)
    }
    if (typeof result !== 'function') {
      throw new Error(
        `Expected module '${id}' to export a function, was ${typeof result}`
      )
    }
  } else {
    throw new Error(
      `Callback argument must be a string or a named function\n${USAGE_INFO}`
    )
  }
  const { displayName, name } = result || {}
  if (typeof displayName !== 'string' && typeof name !== 'string') {
    throw new Error(
      `Callback function cannot be anonymous\n(Use a function declaration or the displayName property.)\n${USAGE_INFO}`
    )
  }
  return result
}
379253
function getPaths(src, baseDir, output) {
    return new Elixir.GulpPaths()
        .src(src, baseDir || config.get('assets.svg.folder'))
        .output(output || config.get('public.svg.outputFolder'));
}
887448
def _GetTaskStorageFilePath(self, task):
    
    filename = '{0:s}.plaso'.format(task.identifier)
    return os.path.join(self._task_storage_path, filename)
320102
def parallel_worker(self, task_num):
        
        while True:
            base, path = self.unsearched.get()
            dirs = self.explore_path(task_num, (base, path))
            for newdir in dirs:
                self.unsearched.put(newdir)
            self.unsearched.task_done()
1245621
function getConfig(dir) {
  dir = path.resolve(dir);

  if (dir.indexOf('.', 2) > 0) {
    // remove extension
    dir = dir.substring(0, dir.indexOf('.', 2));
  }

  if (files.isDirectory(dir)) {
    // default to bootstrap.yaml or bootstrap.yml
    dir = path.join(dir, 'bootstrap');
  }

  return files.getYaml(dir);
}