Get the path to a unique temporary directory to which server build assets will be emitted.
Uniqueness is required for when multiple `serve` / `build` invocations are running concurrently.
500064
function getServerBuildDirectory(): string {
  // Generate a random string to ensure uniqueness
  const buildToken = crypto.randomBytes(16).toString('hex');
  return path.resolve(os.tmpdir(), `nucleate-${buildToken}`);
}
1104705
def _TempRootPath():
  """"""
  # `FLAGS.test_tmpdir` is defined only in test environment, so we can't expect
  # for it to be always defined.
  test_tmpdir = (
      compatibility.Environ("TEST_TMPDIR", default=None) or
      FLAGS.get_flag_value("test_tmpdir", default=None))

  if not os.path.exists(test_tmpdir):
    # TODO: We add a try-catch block to avoid rare race condition.
    # In Python 3 the exception being thrown is way more specific
    # (`FileExistsError`) but in Python 2 `OSError` is the best we can do. Once
    # support for Python 2 is dropped we can switch to catching that and remove
    # the conditional (EAFP).
    try:
      os.makedirs(test_tmpdir)
    except OSError as err:
      logging.error(err)

  # TODO(hanuszczak): Investigate whether this check still makes sense.
  if platform.system() == "Windows":
    return None

  return test_tmpdir
483903
public static String uniquePath(String name, String ext) throws IOException
    {
        File file = File.createTempFile(name, ext);
        String path = file.getAbsolutePath();
        file.delete();

        return path;
    }
327456
def build(self, output_path=""):
        """"""

        self.output_path = self.checkOutputPath(output_path)
        self._buildStaticFiles()
        self.final_url = self._buildTemplates()
        printDebug("Done.", "comment")
        printDebug("=> %s" % (self.final_url), "comment")
        return self.final_url
134793
def fixture
      pwd  = FileUtils.pwd
      path = File.expand_path(File.join(pwd, "spec/.fixtures/#{rand(99999)}"))

      FileUtils.mkdir_p(path)
      FileUtils.cd(path)

      yield(path)

    ensure
      FileUtils.cd pwd
      FileUtils.rm_rf(path) if File.exists?(path)
    end
1141537
def _get_cache_dir(candidate):
    """"""
    if candidate:
        return candidate

    import distutils.dist  # suppress(import-error)
    import distutils.command.build  # suppress(import-error)
    build_cmd = distutils.command.build.build(distutils.dist.Distribution())
    build_cmd.finalize_options()
    cache_dir = os.path.abspath(build_cmd.build_temp)

    # Make sure that it is created before anyone tries to use it
    try:
        os.makedirs(cache_dir)
    except OSError as error:
        if error.errno != errno.EEXIST:
            raise error

    return cache_dir
1244378
def url(self):
        
        endpoint = 'buildinfo?buildID=%d' % self.build_id
        return posixpath.join(self.connection.weburl, endpoint)
1101742
function (name) {
		var isProduction = config.env.isProduction();
		var asset = (isProduction) ? manifest.assets[name] : environment.findAsset(name);
		if (!asset) {
			return '';
		}
		var mountPath = config.argv && (config.argv['mount-path'] || '');

		return (
			isProduction ?
				path.join(mountPath, config.web.publicResources, asset) :
				path.join(mountPath, config.web.resources, asset.digestPath)
		);
	}
1332859
def __get_file_path(self, path, saltenv='base'):
        '''
        
        '''
        try:
            path = self._check_proto(path)
        except MinionError as err:
            # Local file path
            if not os.path.isfile(path):
                log.warning(
                    'specified file %s is not present to generate hash: %s',
                    path, err
                )
                return None
            else:
                return path
        return self._find_file(path, saltenv)
190914
def local_cache_path(remote_url):
    """"""
    local_name = RESERVED_PATH_CHARS.sub("_", remote_url)
    return os.path.join(gettempdir(), local_name)
393488
function getUniqueName(dirName, shortened, buildTypeSuffix) {
		if (!usedBundleNames[dirName + shortened + buildTypeSuffix]) {
			return dirName + shortened + buildTypeSuffix + "";
		}else {
			return dirName + shortened + "-" + (bundleCounter++) + buildTypeSuffix + "";
		}
	}
291815
def path_in_cache(self, filename, metahash):
        
        cpath = self._genpath(filename, metahash)
        if os.path.exists(cpath):
            return cpath
        else:
            raise CacheMiss
381751
def compute_public_path(source, dir, options={})
      JasmineRails::OfflineAssetPaths.disabled ? super : compute_asset_path(source, options)
    end
607068
def export_path(self, relname, export_dir=None):
        
        # removing inner slashed to avoid creating intermediate directories
        name, ext = relname.replace('/', '-').rsplit('.', 1)
        newname = '%s_%s.%s' % (name, self.calc_id, ext)
        if export_dir is None:
            export_dir = self.export_dir
        return os.path.join(export_dir, newname)
1276014
def get_path(src):  # pragma: no cover
    
    res = None
    while not res:
        if res is False:
            print(colored('You must provide a path to an existing directory!', 'red'))
        print('You need a local clone or release of (a fork of) '
              'https://github.com/{0}'.format(src))
        res = input(colored('Local path to {0}: '.format(src), 'green', attrs=['blink']))
        if res and Path(res).exists():
            return Path(res).resolve()
        res = False
44866
function getBuildGradlePath() {
    var target = path.join("platforms", "android", "app", "build.gradle");
    if (fs.existsSync(target)) {
        return target;
    }

    return path.join("platforms", "android", "build.gradle");
}
171158
def persistent_cookie_path
      if ENV["SPACESHIP_COOKIE_PATH"]
        path = File.expand_path(File.join(ENV["SPACESHIP_COOKIE_PATH"], "spaceship", self.user, "cookie"))
      else
        [File.join(self.fastlane_user_dir, "spaceship"), "~/.spaceship", "/var/tmp/spaceship", "#{Dir.tmpdir}/spaceship"].each do |dir|
          dir_parts = File.split(dir)
          if directory_accessible?(File.expand_path(dir_parts.first))
            path = File.expand_path(File.join(dir, self.user, "cookie"))
            break
          end
        end
      end

      return path
    end