Looks up the path for the resource based on the inputed relative path.
        
        :param      relpath | <str>
        
        :return     <str>
969706
def find(self, relpath, rsc=None, useFilepath=None):
        
        self.init()
        
        # load the default resource information
        if rsc is None:
            try:
                key = relpath.replace('\\', '/').split('/')[0]
                rsc = self.default(key)
            except IndexError:
                return ''
        
        # determine the filepath location
        relpath = os.path.normpath(nativestring(relpath))
        rscpath = self.resourcePath()
        
        if useFilepath is None:
            useFilepath = self.useFilepath()
        
        # return from the filesystem
        if useFilepath and rscpath:
            if rsc and isinstance(rsc, XResourceManager):
                return rsc.find(relpath, useFilepath=useFilepath)
            elif rsc:
                filepath = os.path.join(rscpath, rsc, relpath)
            else:
                filepath = os.path.join(rscpath, relpath)
            
            if os.path.exists(filepath):
                return filepath
        
        # return resource
        if isinstance(rsc, XResourceManager):
            return rsc.find(relpath, useFilepath=useFilepath)
        elif rsc:
            return ':{0}/{1}'.format(rsc, relpath.replace(os.path.sep, '/'))
        else:
            return ':{0}'.format(relpath.replace(os.path.sep, '/'))
343881
def get_formatted_relative_path(self, path):
        
        if self.format_relative_path and \
                (path.startswith('./') or path.startswith('.\\')):
            return path[2:]
        else:
            return path
180925
def ensure_dir_path(self, path, relative=False):
        
        if not relative:
            rel_path = self.relpath(path)
        else:
            rel_path = path

        # Locator
        if self.is_locator(rel_path, relative=True):
            path = path.rstrip('/')

        # Directory
        elif rel_path:
            path = path.rstrip('/') + '/'
        # else: root
        return path
684680
def relpath(self):
        
        cwd = self.__class__(os.getcwd())
        return cwd.relpathto(self)
900978
def get_path(self, path=''):
        

        if not path:
            host = self.resource_config.backup_location
            if ':' not in host:
                scheme = self.resource_config.backup_type
                if not scheme or scheme.lower() == self.DEFAULT_FILE_SYSTEM.lower():
                    scheme = self.file_system
                scheme = re.sub('(:|/+).*$', '', scheme, re.DOTALL)
                host = re.sub('^/+', '', host)
                host = '{}://{}'.format(scheme, host)
            path = host

        url = UrlParser.parse_url(path)

        if url[UrlParser.SCHEME].lower() in AUTHORIZATION_REQUIRED_STORAGE:
            if UrlParser.USERNAME not in url or not url[UrlParser.USERNAME]:
                url[UrlParser.USERNAME] = self.resource_config.backup_user
            if UrlParser.PASSWORD not in url or not url[UrlParser.PASSWORD]:
                url[UrlParser.PASSWORD] = self._api.DecryptPassword(self.resource_config.backup_password).Value
        try:
            result = UrlParser.build_url(url)
        except Exception as e:
            self._logger.error('Failed to build url: {}'.format(e))
            raise Exception('ConfigurationOperations', 'Failed to build path url to remote host')
        return result
561476
def s3path(self, rel_path):
        """"""
        import urlparse

        path = self.path(rel_path, public_url=True)

        parts = list(urlparse.urlparse(path))

        parts[0] = 's3'
        parts[1] = self.bucket_name

        return urlparse.urlunparse(parts)
1260966
def split_locator(self, path):
        
        relative = self.relpath(path)
        try:
            locator, tail = relative.split('/', 1)
        except ValueError:
            locator = relative
            tail = ''
        return locator, tail
1042507
def path_to_url(path, relative_to = nil)
      # Find the parent path we're in
      path = Pathname.new(path).realpath
      base = load_paths.find { |lp| path.to_s =~ /\A#{Regexp.escape(lp.realpath.to_s)}/ }

      path = path.relative_path_from(base).cleanpath

      if relative_to
        relative_path_to_url(path, relative_to, base).to_s
      else
        "/#{path}"
      end
    end
443483
def pretty_relpath(path, start):
    '''
    
    '''
    relpath = os.path.relpath(path, start)
    if relpath.startswith('..'):
        return path
    return relpath
1093288
def get_subpath(self, subpath: str):
        """"""
        for d in self._path:
            if os.path.exists(os.path.join(d, subpath)):
                return os.path.join(d, subpath)
        raise FileNotFoundError
566095
def get_dir_relpath(base, relpath):
    
    from os import path
    xbase = path.abspath(path.expanduser(base))
    if not path.isdir(xbase):
        return path.join(xbase, relpath)
    
    if relpath[0:2] == "./":
        return path.join(xbase, relpath[2::])
    else:
        from os import chdir, getcwd
        cd = getcwd()
        chdir(xbase)
        result = path.abspath(relpath)
        chdir(cd)
        return result
1246831
private String getRootPath(String path, int rootLevel, ResourceResolver resourceResolver) {
    String rootPath = Path.getAbsoluteParent(path, rootLevel, resourceResolver);

    // strip off everything after first "." - root path may be passed with selectors/extension which is not relevant
    if (StringUtils.contains(rootPath, ".")) {
      rootPath = StringUtils.substringBefore(rootPath, ".");
    }

    return rootPath;
  }
918946
def path(self, which=None):
        
        if which in ('refresh',):
            return '{0}/{1}'.format(
                super(SmartProxy, self).path(which='self'),
                which
            )
        return super(SmartProxy, self).path(which)
490178
def get_absolute_path(some_path):
    
    if os.path.isabs(some_path):
        return some_path
    else:
        return evaluate_relative_path(os.getcwd(), some_path)
1218932
def relpath(self):
        
        here = os.path.abspath(os.path.curdir)
        relpath = os.path.relpath(self.fpath, here)
        return relpath
704664
def _sub_resource(self, path):
        
        if path not in self.resource_map:
            self.resource_map[path] = Resource(
                path, self.fetch, self.resource_map,
                default_headers=self.default_headers)
        return self.resource_map[path]
80123
def relative_path(path)
      base_dir = Dir.pwd

      return path[(base_dir.length + 1)..-1] if path.start_with?(base_dir)

      path_name = Pathname.new(File.expand_path(path))
      path_name.relative_path_from(Pathname.new(base_dir)).to_s
    end