Get the latest src_uri for a stage 3 tarball.

        Returns (str):
            Latest src_uri from gentoo's distfiles mirror.
977934
def src_file(self):
        
        try:
            src_uri = (curl[Gentoo._LATEST_TXT] | tail["-n", "+3"]
                       | cut["-f1", "-d "])().strip()
        except ProcessExecutionError as proc_ex:
            src_uri = "NOT-FOUND"
            LOG.error("Could not determine latest stage3 src uri: %s",
                      str(proc_ex))
        return src_uri
11246
def return_current_uri_subpage(self):
        
        uri = post_slash("%s%s/%s/%s" % (post_slash(self.current_dir()),
                         self.slots['page'], self.slots['item'],
                         self.slots['subpage']))
        return uri
534686
def versioned_url(self):
        ''''''
        if self.url is None:
            return None
        return self.url.format(version=self.version)
333945
def GetTARInfo(self):
    
    if not self._tar_info:
      location = getattr(self.path_spec, 'location', None)
      if location is None:
        raise errors.PathSpecError('Path specification missing location.')

      if not location.startswith(self._file_system.LOCATION_ROOT):
        raise errors.PathSpecError('Invalid location in path specification.')

      if len(location) == 1:
        return None

      tar_file = self._file_system.GetTARFile()
      try:
        self._tar_info = tar_file.getmember(location[1:])
      except KeyError:
        pass

    return self._tar_info
155202
def _get_roots(self):
        
        region = self._get_session().region_name or r'[\w-]+'
        return (
                # S3 scheme
                # - s3://<bucket>/<key>
                's3://',

                # Virtual-hosted–style URL
                # - http://<bucket>.s3.amazonaws.com/<key>
                # - https://<bucket>.s3.amazonaws.com/<key>
                # - http://<bucket>.s3-<region>.amazonaws.com/<key>
                # - https://<bucket>.s3-<region>.amazonaws.com/<key>
                _re.compile(r'https?://[\w.-]+\.s3\.amazonaws\.com'),
                _re.compile(
                    r'https?://[\w.-]+\.s3-%s\.amazonaws\.com' % region),

                # Path-hosted–style URL
                # - http://s3.amazonaws.com/<bucket>/<key>
                # - https://s3.amazonaws.com/<bucket>/<key>
                # - http://s3-<region>.amazonaws.com/<bucket>/<key>
                # - https://s3-<region>.amazonaws.com/<bucket>/<key>
                _re.compile(r'https?://s3\.amazonaws\.com'),
                _re.compile(r'https?://s3-%s\.amazonaws\.com' % region),

                # Transfer acceleration URL
                # - http://<bucket>.s3-accelerate.amazonaws.com
                # - https://<bucket>.s3-accelerate.amazonaws.com
                # - http://<bucket>.s3-accelerate.dualstack.amazonaws.com
                # - https://<bucket>.s3-accelerate.dualstack.amazonaws.com
                _re.compile(
                    r'https?://[\w.-]+\.s3-accelerate\.amazonaws\.com'),
                _re.compile(
                    r'https?://[\w.-]+\.s3-accelerate\.dualstack'
                    r'\.amazonaws\.com'))
204662
def _compute_version_info():
    
    ray_version = ray.__version__
    python_version = ".".join(map(str, sys.version_info[:3]))
    pyarrow_version = pyarrow.__version__
    return ray_version, python_version, pyarrow_version
949754
def existing_versions(self):
        
        import glob
        pattern = self.fname + '_*' + self.ext
        for fname in glob.glob1(self.dpath, pattern):
            fpath = join(self.dpath, fname)
            yield fpath
353649
def print_download_uri(self, version, source):
        

        if version == "dev":
            pkg_type = "subversion"
            source = True
        elif source:
            pkg_type = "source"
        else:
            pkg_type = "egg"

        #Use setuptools monkey-patch to grab url
        url = get_download_uri(self.project_name, version, source,
                self.options.pypi_index)
        if url:
            print("%s" % url)
        else:
            self.logger.info("No download URL found for %s" % pkg_type)
1292934
def get_url(client, name, version, wheel=False, hashed_format=False):
    
    try:
        release_urls = client.release_urls(name, version)
        release_data = client.release_data(name, version)
    except BaseException:  # some kind of error with client
        logger.debug('Client: {0} Name: {1} Version: {2}.'.format(
            client, name, version))
        raise exceptions.MissingUrlException(
            "Some kind of error while communicating with client: {0}.".format(
                client), exc_info=True)

    url = ''
    md5_digest = None

    if not wheel:
        # Prefered archive is tar.gz
        if len(release_urls):
            zip_url = zip_md5 = ''
            for release_url in release_urls:
                if release_url['url'].endswith("tar.gz"):
                    url = release_url['url']
                    md5_digest = release_url['md5_digest']
                if release_url['url'].endswith(".zip"):
                    zip_url = release_url['url']
                    zip_md5 = release_url['md5_digest']
            if url == '':
                url = zip_url or release_urls[0]['url']
                md5_digest = zip_md5 or release_urls[0]['md5_digest']
        elif release_data:
            url = release_data['download_url']
    else:
        # Only wheel is acceptable
        for release_url in release_urls:
            if release_url['url'].endswith("none-any.whl"):
                url = release_url['url']
                md5_digest = release_url['md5_digest']
                break
    if not url:
        raise exceptions.MissingUrlException(
            "Url of source archive not found.")

    if url == 'UNKNOWN':
        raise exceptions.MissingUrlException(
            "{0} package has no sources on PyPI, Please ask the maintainer "
            "to upload sources.".format(release_data['name']))

    if not hashed_format:
        url = ("https://files.pythonhosted.org/packages/source"
               "/{0[0]}/{0}/{1}").format(name, url.split("/")[-1])

    return (url, md5_digest)
1002970
def UniversalCRTSdkDir(self):
        
        # Set Kit Roots versions for specified MSVC++ version
        if self.vc_ver >= 14.0:
            vers = ('10', '81')
        else:
            vers = ()

        # Find path of the more recent Kit
        for ver in vers:
            sdkdir = self.ri.lookup(self.ri.windows_kits_roots,
                                    'kitsroot%s' % ver)
            if sdkdir:
                break
        return sdkdir or ''
573443
def get_source_contents(self, src_id):
        
        len_out = _ffi.new('unsigned int *')
        must_free = _ffi.new('int *')
        rv = rustcall(_lib.lsm_view_get_source_contents,
                      self._get_ptr(), src_id, len_out, must_free)
        if rv:
            try:
                return _ffi.unpack(rv, len_out[0])
            finally:
                if must_free[0]:
                    _lib.lsm_buffer_free(rv)
484822
def url(self, filetype, base_dir=None, sasdir='sas', **kwargs):
        

        location = self.location(filetype, **kwargs)
        return join(self.remote_base, sasdir, location) if self.remote_base and location else None
1283962
def get_version(path = Dir.pwd, options = {})
      rootdir = normalized_path(path)
      version = (options[:default]) ? options[:default] : FalkorLib.config[:versioning][:default]
      type    = (options[:type])    ? options[:type]    : FalkorLib.config[:versioning][:type]
      source  = (options[:source])  ? options[:source]  : FalkorLib.config[:versioning][:source][ type ]
      puts "type = '#{type}'"
      case type
      when 'file'
        versionfile = File.join( rootdir, source[:filename] )
        puts "versionfile = '#{versionfile}'"
        version = File.read( versionfile ).chomp if File.exist?( versionfile )
      when 'gem'
        getmethod = source[:getmethod ]
        version = eval( getmethod ) unless (getmethod.nil? || getmethod.empty?)
      when 'puppet_module'
        jsonfile = File.join( rootdir, source[:filename] )
        metadata = JSON.parse( IO.read( jsonfile ) )
        version  = metadata["version"]
      end
      version
    end
997415
def current_revision(self, r_stmts):
        
        cur = max([[int(p) for p in r.arg.split("-")] for r in r_stmts])
        return "%4d-%02d-%02d" % tuple(cur)
1042728
def get(self, request, uri):
        
        uri = self.decode_uri(uri)
        revisions = cio.revisions(uri)
        revisions = [list(revision) for revision in revisions]  # Convert tuples to lists
        return self.render_to_json(revisions)
1195984
def get_uri(source):
    

    import gst

    src_info = source_info(source)

    if src_info['is_file']:  # Is this a file?
        return get_uri(src_info['uri'])

    elif gst.uri_is_valid(source):  # Is this a valid URI source for Gstreamer
        uri_protocol = gst.uri_get_protocol(source)
        if gst.uri_protocol_is_supported(gst.URI_SRC, uri_protocol):
            return source
        else:
            raise IOError('Invalid URI source for Gstreamer')
    else:
        raise IOError('Failed getting uri for path %s: no such file' % source)
1043647
def ofx version=@@latest_version
            self._version=version
            response = Faraday.get do |req| 
                req.url "http://www.openframeworks.cc/download/"
            end
            doc = Nokogiri::HTML(response.body)
            latest_version = doc.css("#download-latest-header h2")
            puts "Openframeworks current version is "+ latest_version.text+"\n"
            puts "your os is "+RUBY_PLATFORM.downcase
            config = get_config(version)
            href=config["file"]
            
            if href and href!=""
                p "downing "+href
                uri = URI(href)
                Net::HTTP.start(uri.host,uri.port) do |http|
                    request = Net::HTTP::Get.new uri.request_uri

                    http.request request do |response|
                        open config["filename"], 'w' do |io|
                            response.read_body do |chunk|
                                io.write chunk
                            end
                        end
                    end
                end

                if File.exists?(config["dirname"])
                   puts "openframewors dir #{config['dirname']} exists. pass.." 
                else

                    if RUBY_PLATFORM.downcase.include?("darwin")
                        puts "unzip dir.."
                        destination="."
                        Zip::ZipFile.open(config["filename"]) {|file|

                            file.each do |f| 
                                f_path = File.join(destination, f.name)
                                FileUtils.mkdir_p(File.dirname(f_path))
                                file.extract(f,f_path)
                            end
                        } 
                        #cleanup
                        p "cleanup..."
                        `rm -rf __MACOSX`
                        `rm -rf ofx.zip`
                    elsif RUBY_PLATFORM.downcase.include?("linux")
                        p "tar file... #{config['filename']}"
                        `tar vzxf #{config["filename"]}`
                    end
                end

            end

        end