Generates the target path for a file
763422
def make_file_path(project_dir, project_name, root, name):
    

    return path.join(make_dir_path(project_dir, root, project_name), name)
16266
def make_path(phase) -> str:
    
    return "{}/{}{}{}".format(conf.instance.output_path, phase.phase_path, phase.phase_name, phase.phase_tag)
753706
def _format_target(self, net, f, idx):
        """"""
        if f is None:
            return None
        if isinstance(f, str):
            f = self.fn_prefix + f.format(
                net=net,
                last_epoch=net.history[idx],
                last_batch=net.history[idx, 'batches', -1],
            )
            return os.path.join(self.dirname, f)
        return f
1046061
function (targetFilePath) {
    var splitPaths = targetFilePath.split('/');
    var targetFilename = splitPaths.pop();
    var targetPath = splitPaths.join('/');
    targetPath = targetPath + '/';
    return [targetPath, targetFilename];
  }
1070309
def filepath(self, filename):
        """"""

        return os.path.join(self.node.full_path, filename)
734221
function (files) {
    if (!_.isArray(files)) files = [files];
    return _.chain(files).map(fss.target).map(function (f) {
        if (!fss.directoryExists(f)) return f;
        return fss.allTargetFilePaths(f);
    }).flatten().uniq().reject(fss.isDotFile).map(pathSuffix).value();
}
70436
def dump_to_path(self, cnf, filepath, **kwargs):
        
        _not_implemented(self, cnf, filepath, **kwargs)
60715
def _genpath(self, filename, mhash):
        
        mhash = mhash.hexdigest()
        return os.path.join(self.mh_cachedir, mhash[0:2], mhash[2:4],
                            mhash, filename)
1293618
function (abspath, targetFilePath, pattern, files, staticBlock) {
        if (targetFilePath in files) {
            grunt.warn('In the file: ' + abspath + ', the target filename: ' + targetFilePath + ' has already defined in this or other html template file.');
        }
        var results = staticBlock.match(pattern);
        if (results) {
            files[targetFilePath] = [];
            for (var index in results) {
                // results[index] could be like below, use staticPattern to fetch real static filepath further.
                // <link href="${request.static_url('zuoyeproject:static/css/bootstrap.css')}" rel="stylesheet" media="screen">
                // <script src="${request.static_url('zuoyeproject:static/editor/common.js')}">
                var result = results[index].match(applyminGlobal.staticPattern);
                if (result === null || result.length < 2) {
                    grunt.warn('Please check whether your "options.staticPattern": ' + applyminGlobal.staticPattern + '\n\ncould be used to fetch the static resource:\n\n' + results[index] + '\n\nin the file ' + '"' + abspath + '"');
                }
                if (!grunt.file.exists(result[1])) {
                    grunt.warn('This file does not exist: "' + result[1] + '"');
                }
                files[targetFilePath].push(result[1]);
            }
        }
    }
463305
private static void printTargetPathList(FileStatus[] targetTmpFiles)
    {
        StringBuilder builder = new StringBuilder();
        builder.append("Preprocess target files:");
        String lineSeparator = System.getProperty("line.separator");

        for (FileStatus targetFile : targetTmpFiles)
        {
            builder.append(targetFile.getPath() + lineSeparator);
        }

        logger.info(builder.toString());
    }
1104996
function determineTargetDir(source, target) {
	return stat(source).
		then(results => results.isDirectory() ? target : path.dirname(target));
}
1082612
def generate_random_upload_path(instance, filename):
    
    return os.path.join(instance.__class__.__name__.lower(), uuid().hex, filename)
66160
def _generator_file(self):
        """'"""
        for path in self.paths:
            if os.path.isfile(path):
                if isvalid(path, self.access, self.extensions,
                           minsize=self.minsize):
                    yield os.path.abspath(path)
            elif os.path.isdir(path):
                for root, _, fnames in self._walker(path):
                    yield from self._generator_rebase(fnames, root)
378565
def target(self):
        
        return [
            os.path.basename(os.path.dirname(f)) for f in self.files
        ]
1265942
private static String getRelativePath(File src, File target) {
        String[] srcComponents = getCanonicalPath(src).replace(File.separatorChar, '/').split("/");
        String[] targetComponents = getCanonicalPath(target).replace(File.separatorChar, '/').split("/");

        if (srcComponents.length > 0 && targetComponents.length > 0 && !targetComponents[0].equals(srcComponents[0])) {
            return null;
        }

        int common = 0;
        for (int minLength = Math.min(srcComponents.length, targetComponents.length); common < minLength; common++) {
            if (!srcComponents[common].equals(targetComponents[common])) {
                break;
            }
        }

        StringBuilder result = new StringBuilder();

        // Paths in a file are relative to the file's directory, so subtract one
        // to skip the final filename component.
        for (int i = common; i < srcComponents.length - 1; i++) {
            if (result.length() != 0) {
                result.append('/');
            }
            result.append("..");
        }

        for (int i = common; i < targetComponents.length; i++) {
            if (result.length() != 0) {
                result.append('/');
            }
            result.append(targetComponents[i]);
        }

        return result.toString();
    }
74740
def makefile(self, tarinfo, targetpath):
        
        source = self.fileobj
        source.seek(tarinfo.offset_data)
        target = bltn_open(targetpath, "wb")
        if tarinfo.sparse is not None:
            for offset, size in tarinfo.sparse:
                target.seek(offset)
                copyfileobj(source, target, size)
        else:
            copyfileobj(source, target, tarinfo.size)
        target.seek(tarinfo.size)
        target.truncate()
        target.close()
632331
def get_build_path(self):
        
        target_path = path.join(settings.BUILD_DIR, self.get_url().lstrip('/'))
        if not self.fs.exists(target_path):
            logger.debug("Creating {}".format(target_path))
            self.fs.makedirs(target_path)
        return os.path.join(target_path, 'index.html')