Capture path of application, using url or subdomin
164127
public function getApplicationUseNow(){
		$tmp=explode('/', preg_replace('/^[\/]*(.*?)[\/]*$/', '\\1', $_SERVER['REQUEST_URI']));


		foreach ($tmp as $key => $value) {
			if(isset($tmp[$key]) && is_array($this->getApplication()) && array_key_exists($tmp[$key],$this->getApplication())){
				for ($i=0; $i < $key; $i++) {
					array_shift($tmp);
				}
				$app_path = $this->getApplication();
				$app_public = $app_path[$tmp[0]]['path_public'];
				$app_path = $app_path[$tmp[0]]['path_app'];
				$this->setNameApplication($tmp[0]);
			}
		}

		for ($i=0; $i < count($key); $i++) {
			array_shift($tmp);
		}

		if(!isset($app_path)){
			$app_path = $this->getApplication();
			$app_public=$app_path['default']['path_public'];
			$app_path=$app_path['default']['path_app'];
			$this->setNameApplication('default');
		}

		$this->setApplicationName($app_path);
		if(!file_exists(PATH_ROOT.$app_public)){
			throw new \Exception("app_public não foi encontrado em: ".PATH_ROOT.$app_public);
		}else{
			$this->setPublicPath($app_public);
		}

	}
606381
def url2path(url, data=True, ext:str='.tgz'):
    ""
    name = url2name(url)
    return datapath4file(name, ext=ext, archive=False) if data else modelpath4file(name, ext=ext)
693086
def url(self):
        """"""
        return os.path.join(self.path, self.main.value[0])
480330
def get_path(url):
    

    url = urlsplit(url)
    path = url.path
    if url.query:
        path += "?{}".format(url.query)
    return path
321284
def _GeneratorFromPath(path):
  """"""
  if not path:
    raise ValueError('path must be a valid string')
  if io_wrapper.IsTensorFlowEventsFile(path):
    return event_file_loader.EventFileLoader(path)
  else:
    return directory_watcher.DirectoryWatcher(
        path,
        event_file_loader.EventFileLoader,
        io_wrapper.IsTensorFlowEventsFile)
219771
def path_regex(self):
        """"""
        try:
            path = '%s/' % urljoin(self.monthly_build_list_regex,
                                   self.builds[self.build_index])
            if self.application in APPLICATIONS_MULTI_LOCALE \
                    and self.locale != 'multi':
                path = '%s/' % urljoin(path, self.locale)
            return path
        except Exception:
            folder = urljoin(self.base_url, self.monthly_build_list_regex)
            raise errors.NotFoundError("Specified sub folder cannot be found",
                                       folder)
619571
def get_file_name(url):
  """"""
  return os.path.basename(urllib.parse.urlparse(url).path) or 'unknown_name'
681227
function getCurrentUrl() {
	var root = cleanRoot(),
		location = LOCATION(),
		loc = (location.pathname + location.search),
		index = loc.indexOf(root);

	return loc.substr(index + root.length);
}
147023
def geturl(self):
        """"""
        return urlparse.urlunparse((
            self.scheme,
            self.netloc,
            self.path,
            self.params,
            self.query_str,
            self.fragment,
        ))
513606
function() {
    var path = document.location.pathname;
    var parts = path.split(/\//);
    $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
      if (this == '..')
        parts.pop();
    });
    var url = parts.join('/');
    return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
  }
1009309
def url2tmp(self, root, url):
        
        filename = url.rsplit('/', 1)[-1]
        return os.path.join(root, filename)
1133996
function (uri) {
	var lastSlash = uri.lastIndexOf("/");
	var sub;
	if (lastSlash == -1) {
		sub = uri;
	} else {
		sub = uri.substr(lastSlash + 1);
	}
	sub = sub.toLowerCase();
	var parsed = parseModuleName(sub);
	var path = removeFiletype(parsed.modulePath || sub);
	var matches = path.match(/^[\w-\s\.]+/);
	return matches ? matches[0] : "";
}
1034108
def get_url(path, host, port, method="http"):
    
    return urlunsplit(
        (method, "%s:%s" % (host, port), path, "", "")
    )
1259480
def url_path(self):
        ''' 

        '''
        if self.failed:
            return None
        else:
            # TODO should fix invalid URL characters
            return '/' + os.path.splitext(os.path.basename(self._runner.path))[0]
639505
def get_view_url(self, webapp: str = "oc", **kwargs):
        
        # build wbeapp URL depending on choosen webapp
        if webapp in self.WEBAPPS:
            webapp_args = self.WEBAPPS.get(webapp).get("args")
            # check kwargs parameters
            if set(webapp_args) <= set(kwargs):
                # construct and return url
                url = self.WEBAPPS.get(webapp).get("url")

                return url.format(**kwargs)
            else:
                raise TypeError(
                    "'{}' webapp expects {} argument(s): {}."
                    " Args passed: {}".format(
                        webapp, len(webapp_args), webapp_args, kwargs
                    )
                )
        else:
            raise ValueError(
                "'{}' is not a recognized webapp among: {}."
                " Try to register it.".format(self.WEBAPPS.keys(), webapp)
            )
1146040
def link(self):
    """"""
    if not self.IsLink():
      return ''

    location = getattr(self.path_spec, 'location', None)
    if location is None:
      return ''

    return self._file_system.GetDataByPath(location)
371592
def get_path(self, prefix=None, filename=None):
        """"""
        prefix = prefix or settings.FLOW_EXECUTOR['DATA_DIR']

        path = os.path.join(prefix, self.subpath)
        if filename:
            path = os.path.join(path, filename)

        return path