Get application media root from real media root URL.
350488
def app_media_url(self):
        """"""
        url = None
        media_dir = self.CLOUD_BROWSER_STATIC_MEDIA_DIR
        if media_dir:
            url = os.path.join(self.MEDIA_URL, media_dir).rstrip('/') + '/'

        return url
912438
def get_root( self, key ):
        """"""
        if key not in self.roots:
            root,self.rows = load( self.filename, include_interpreter = self.include_interpreter )
            self.roots[key] = root
        return self.roots[key]
1049457
def _find_filepath_in_roots(filename):
    """"""
    for root in settings.DJANGO_STATIC_MEDIA_ROOTS:
        filepath = _filename2filepath(filename, root)
        if os.path.isfile(filepath):
            return filepath, root
    # havent found it in DJANGO_STATIC_MEDIA_ROOTS look for apps' files if we're
    #  in DEBUG mode
    if settings.DEBUG:
        try:
            from django.contrib.staticfiles import finders
            absolute_path = finders.find(filename)
            if absolute_path:
                root, filepath = os.path.split(absolute_path)
                return absolute_path, root
        except ImportError:
            pass
    return None, None
713294
def build_absolute_uri(request, relative_url):
    """"""
    webroot = getattr(settings, 'WEBROOT', '')
    if webroot.endswith("/") and relative_url.startswith("/"):
        webroot = webroot[:-1]

    return request.build_absolute_uri(webroot + relative_url)
1118768
def _get_root(self):
        """"""
        _DEFAULT_USER_DETAILS = {"level": 20, "password": "", "sshkeys": []}
        root = {}
        root_table = junos_views.junos_root_table(self.device)
        root_table.get()
        root_items = root_table.items()
        for user_entry in root_items:
            username = "root"
            user_details = _DEFAULT_USER_DETAILS.copy()
            user_details.update({d[0]: d[1] for d in user_entry[1] if d[1]})
            user_details = {
                key: py23_compat.text_type(user_details[key])
                for key in user_details.keys()
            }
            user_details["level"] = int(user_details["level"])
            user_details["sshkeys"] = [
                user_details.pop(key)
                for key in ["ssh_rsa", "ssh_dsa", "ssh_ecdsa"]
                if user_details.get(key, "")
            ]
            root[username] = user_details
        return root
1087198
@SuppressWarnings("unchecked")
  public static <T extends Executable> T getRootExecutable(T m) {
    return (T) EXECUTABLE_GET_ROOT.apply(m);
  }
216496
def full_path(self):
        """"""
        if Path(self.path).is_absolute():
            return self.path
        else:
            return str(self.app_root / self.path)
1178678
def remote_root(self):
    """"""
    return os.path.relpath(self.address.spec_path, self.target_base)
167599
public String getRootPath(Resource resource) {
    int rootLevel = urlHandlerConfig.getSiteRootLevel(resource);
    if (rootLevel > 0) {
      return Path.getAbsoluteParent(resource.getPath(), rootLevel, resource.getResourceResolver());
    }
    return null;
  }
718544
def search_app_root():
        
        while True:

            current = os.getcwd()

            if pathlib.Path("apps.py").is_file():
                return current
            elif pathlib.Path.cwd() == "/":
                raise FileNotFoundError
            else:
                os.chdir("../")
675305
def GetRootFileEntry(self):
    
    path_spec = compressed_stream_path_spec.CompressedStreamPathSpec(
        compression_method=self._compression_method,
        parent=self._path_spec.parent)
    return self.GetFileEntryByPathSpec(path_spec)
1305180
private static function getMediaRootRelative() {
    $config = ObjectFactory::getInstance('configuration');
    $mediaRootAbs = $config->getDirectoryValue('uploadDir', 'Media');
    return self::makeRelative($mediaRootAbs);
  }
1242753
def media_image_url(self):
        """"""
        if self.is_nowplaying:
            base = self.server.construct_url(API_URL)
            try:
                image_id = self.session['NowPlayingItem']['ImageTags']['Thumb']
                image_type = 'Thumb'
            except KeyError:
                try:
                    image_id = self.session[
                        'NowPlayingItem']['ImageTags']['Primary']
                    image_type = 'Primary'
                except KeyError:
                    return None
            url = '{0}/Items/{1}/Images/{2}?width=500&tag={3}&api_key={4}'.format(
                base, self.media_id, image_type, image_id, self.server.api_key)
            return url
        else:
            return None
1199898
protected function root()
    {
        if(isset($_GET['_framework_url_']))
        {
            $url = $_GET['_framework_url_'];
        }
        else return false;

        $parts = explode('/', $url);
        $count = count($parts)-2;
        //
        $path = $parts > 1 ? '../' : '';

        for ($i=0; $i <$count; $i++) 
        { 
            $path .= '../';
        }

        \Vinala\Kernel\Foundation\Application::$path = $path;
        return $path;
    }
252335
function getUrl(file, size, media) {
      media = media || get_media;
      var version = new Date(file.updatedAt).valueOf();
      return media(file.location, size) + '?version=' + version;
    }
1356196
def _parse_uri(uri):
        """"""

        tokens = urlparse(uri)

        if tokens.netloc != '':
            logger.error("Invalid URI: %s", uri)
            raise ValueError("MediaFire URI format error: "
                             "host should be empty - mf:///path")

        if tokens.scheme != '' and tokens.scheme != URI_SCHEME:
            raise ValueError("MediaFire URI format error: "
                             "must start with 'mf:' or '/'")

        return posixpath.normpath(tokens.path)
897444
static String normalizeRootUrl(String rootUrl) {
    Preconditions.checkNotNull(rootUrl, "root URL cannot be null.");
    if (!rootUrl.endsWith("/")) {
      rootUrl += "/";
    }
    return rootUrl;
  }