generate the final output path
341157
private Optional<IncludeAllPageWithOutput> addOutputInformation(IncludeAllPage pages, FileResource baseResource, Path includeAllBasePath, Locale locale) {

    // depth = 0 is the file that has the include-all directive
    if (pages.depth == 0) {
      return of(new IncludeAllPageWithOutput(pages, pages.files.get(0), pages.files.get(0).getPath(), locale));
    }

    Path baseResourceParentPath = baseResource.getPath().getParent();
    
    Optional<FileResource> virtualResource = pages.files.stream().findFirst()
        .map(fr -> new VirtualPathFileResource(baseResourceParentPath.resolve(includeAllBasePath.relativize(fr.getPath()).toString()), fr));

    return virtualResource.map(vr -> {
      Path finalOutputPath = outputPathExtractor.apply(vr).normalize();
      return new IncludeAllPageWithOutput(pages, vr, finalOutputPath, locale);
    });
  }
616416
private void processOutputDirectory() {
        final String root = outputDirectory.getAbsolutePath();
        final String leaf = PhaseTwoApplication.DIR_ARTIFACT;
        final String path = asPath(root, leaf);
        final File phaseIIPath = new File(path);

        // Fail if the working path doesn't contain a phase II artifact
        if (!phaseIIPath.isDirectory()) {
            error(NOT_A_PHASE2_DIR + ": " + phaseIIPath);
            failUsage();
        }

        // Fail if the working path doesn't contain any proto-networks
        final File[] networks =
                phaseIIPath.listFiles(new GlobalProtonetworkFilter());
        if (networks.length == 0) {
            final String err = Strings.NO_GLOBAL_PROTO_NETWORK;
            error(err + " in: " + phaseIIPath);
            failUsage();
        }

        // Fail if the working path contains more than one proto-network
        if (networks.length > 1) {
            error(EXPECTED_ONE_NETWORK + ", found " + networks.length);
            failUsage();
        }

        // Create the directory artifact or fail
        artifactPath = createDirectoryArtifact(outputDirectory, DIR_ARTIFACT);

        reconstituteNetwork(networks[0]);
    }
1274639
def _generate_output_dir(settings, path):
        

        relpath = os.path.relpath(settings.root,path)
        count = relpath.count(os.sep) + 1

        return relpath+os.path.sep, count
742342
function generate (projectPatch, source, done) {
  shell.mkdir('-p', projectPatch)
  shell.cp('-Rf', source, projectPatch)
  done()
}
570061
def output_file(self, _container):
        """"""
        p = local.path(_container)
        if p.exists():
            if not ui.ask("Path '{0}' already exists."
                          " Overwrite?".format(p)):
                sys.exit(0)
        CFG["container"]["output"] = str(p)
198661
def output(self):
        
        if not self.path_output:
            self.output_to_fd(sys.stdout)
        else:
            with open(self.path_output, "w") as out:
                self.output_to_fd(out)
55793
function generate(path, command, template) {
        var paths = getPaths(path);
        template = template || fs_1.readFileSync(// read in our script template.
        path_1.resolve(constants_1.PARGV_ROOT, 'completion.sh.tpl'), 'utf-8');
        template = template.replace(/{{app_name}}/g, paths.appName); // replace app name.
        template = template.replace(/{{app_reply_command}}/g, command); // replace the command.
        var script = template.replace(/{{app_path}}/g, paths.appPath); // replace the path.
        var sourceScript = srcTpl;
        sourceScript = sourceScript.replace(/{{app_name}}/g, paths.appName);
        sourceScript = sourceScript.replace(/{{app_completions_path}}/g, paths.completionsPath);
        return {
            paths: paths,
            command: command,
            script: script,
            sourceScript: sourceScript
        };
    }
169939
def output_files(self):
        
        for dep in self.subgraph.successors(self.address):
            dep_rule = self.subgraph.node[dep]['target_obj']
            for dep_file in dep_rule.output_files:
                yield self.translate_path(dep_file, dep_rule).lstrip('/')
11706
public function getOutputPath() : ?string 
    {
        if ( ! $this->hasOutputPath()) {
            $this->setOutputPath($this->getDefaultOutputPath());
        }
        return $this->outputPath;
    }
841292
def output_path
      Pathname.new File.join(Massimo.config.output_path, url.sub(/^#{Regexp.escape(Massimo.config.base_url)}/, ''))
    end
479657
def _output_path(
        self,
        ufo_or_font_name,
        ext,
        is_instance=False,
        interpolatable=False,
        autohinted=False,
        is_variable=False,
        output_dir=None,
        suffix=None,
    ):
        """"""

        if isinstance(ufo_or_font_name, basestring):
            font_name = ufo_or_font_name
        elif ufo_or_font_name.path:
            font_name = os.path.splitext(
                os.path.basename(os.path.normpath(ufo_or_font_name.path))
            )[0]
        else:
            font_name = self._font_name(ufo_or_font_name)

        if output_dir is None:
            output_dir = self._output_dir(
                ext, is_instance, interpolatable, autohinted, is_variable
            )
        if not os.path.exists(output_dir):
            os.makedirs(output_dir)

        if suffix:
            return os.path.join(output_dir, "{}-{}.{}".format(font_name, suffix, ext))
        else:
            return os.path.join(output_dir, "{}.{}".format(font_name, ext))
1148862
def outputs(ctx, client, revision, paths):
    
    """
    graph = Graph(client)
    filter = graph.build(paths=paths, revision=revision)
    output_paths = graph.output_paths

    click.echo('\n'.join(graph._format_path(path) for path in output_paths))

    if paths:
        if not output_paths:
            ctx.exit(1)

        from renku.models._datastructures import DirectoryTree
        tree = DirectoryTree.from_list(item.path for item in filter)

        for output in output_paths:
            if tree.get(output) is None:
                ctx.exit(1)
                return
799749
def store_output_files(self, dir_path):
        """"""
        if self.last_result:
            for entry in os.listdir(self.last_result["output_dir"]):
                path = os.path.join(self.last_result["output_dir"], entry)
                if os.path.isfile(path):
                    shutil.copy(path, os.path.join(dir_path, entry))
            shutil.copy(
                self.get_path(OslomRunner.SEED_FILE),
                os.path.join(dir_path, OslomRunner.SEED_FILE))
            args_file = os.path.join(dir_path, OslomRunner.ARGS_FILE)
            with open(args_file, "w") as writer:
                writer.write("{}\n".format(" ".join(self.last_result["args"])))
            self.id_remapper.store_mapping(
                os.path.join(dir_path, OslomRunner.IDS_MAPPING_FILE))
661027
def generate_output_prov(self,
                             final_output,    # type: Dict[Text, Any]
                             process_run_id,  # type: Optional[str]
                             name             # type: Optional[Text]
                            ):   # type: (...) -> None
        """"""
        # Timestamp should be created at the earliest
        timestamp = datetime.datetime.now()

        # For each output, find/register the corresponding
        # entity (UUID) and document it as generated in
        # a role corresponding to the output
        for output, value in final_output.items():
            entity = self.declare_artefact(value)
            if name is not None:
                name = urllib.parse.quote(str(name), safe=":/,#")
                # FIXME: Probably not "main" in nested workflows
                role = self.wf_ns["main/%s/%s" % (name, output)]
            else:
                role = self.wf_ns["main/%s" % output]

            if not process_run_id:
                process_run_id = self.workflow_run_uri

            self.document.wasGeneratedBy(
                entity, process_run_id, timestamp, None, {"prov:role": role})
871758
function getOutputDir(output) {
  var arr = output.split(path.sep);
  arr.pop();
  return arr.join(path.sep);
}
709039
def _get_result_paths(self, data):
        

        result = {}

        # OTU map (mandatory output)
        result['OtuMap'] = ResultPath(Path=self.Parameters['-O'].Value,
                                      IsWritten=True)

        # SumaClust will not produce any output file if the
        # input file was empty, so we create an empty
        # output file
        if not isfile(result['OtuMap'].Path):
            otumap_f = open(result['OtuMap'].Path, 'w')
            otumap_f.close()

        return result
16266
def make_path(phase) -> str:
    
    return "{}/{}{}{}".format(conf.instance.output_path, phase.phase_path, phase.phase_name, phase.phase_tag)