URL  URL for the download cradle
10388
def options(self, context, module_options):
        '''
        
        '''

        if not 'URL' in module_options:
            context.log.error('URL option is required!')
            exit(1)

        self.url = module_options['URL']
901687
def url(self):
        """"""
        return URL.format(http=self.web_proto, host=self.host, port=self.port)
1055021
def url(self, host):
        """"""
        path = '/'.join(str(v) for v in self._path)
        return 'coaps://{}:5684/{}'.format(host, path)
613432
def remote_url(connector, env, repo, filename):
    
    dl_base = connector.base_url.replace('/pulp/api/v2', '/pulp/repos')

    repoid = '%s-%s' % (repo, env)

    _r = connector.get('/repositories/%s/' % repoid)
    if not _r.status_code == Constants.PULP_GET_OK:
        # maybe the repo name is the repoid
        _r = connector.get('/repositories/%s/' % repo)
        if not _r.status_code == Constants.PULP_GET_OK:
            raise JuicerPulpError("%s was not found as a repoid. Status code %s returned by pulp" % \
                    (repoid, _r.status_code))

    repo = juicer.utils.load_json_str(_r.content)['display_name']

    link = '%s/%s/%s/%s' % (dl_base, env, repo, filename)

    return link
1330448
private JnlpResource locateResource( DownloadRequest dreq )
            throws IOException, ErrorResponseException
    {
        if ( dreq.getVersion() == null )
        {
            return handleBasicDownload( dreq );
        }
        else
        {
            return handleVersionRequest( dreq );
        }
    }
773426
def get_url(data_name, next_data_indices = {})
      if next_data_indices.empty?
        next_data_indices = { nextStartIndex: 0, nextLikeStartIndex: 0, nextThumbStartIndex: 0 }
      else
        next_data_indices = next_data_indices.dup
      end

      next_data_indices[:webname] = @webname
      next_data_indices[:pat] = Downloader.get_pat

      DATA_FEED_URLS[data_name] % next_data_indices
    end
694644
function _prep_download_url(){

    var engine = new impl_engine(golr_response);
    //engine.method('GET');
    //engine.use_jsonp(true);
    var gman = new golr_manager(gserv, gconf, engine, 'async');
	
    gman.set_personality('annotation');
    gman.add_query_filter('document_category', 'annotation', ['*']);
	
    // gman.set_results_count(download_count);
    var field_list = [ // from GAF
	'source', // c1
	'bioentity_internal_id', // c2; not bioentity
	'bioentity_label', // c3
	'qualifier', // c4
	'annotation_class', // c5
	'reference', // c6
	'evidence_type', // c7
	'evidence_with', // c8
	'aspect', // c9
	'bioentity_name', // c10
	'synonym', // c11
	'type', // c12
	'taxon', // c13
	'date', // c14
	'assigned_by', // c15
	'annotation_extension_class', // c16
	'bioentity_isoform' // c17
    ];
    // gman.set('fl', field_list.join(','));
    // //manager.set('rows', arg_hash['rows']);
    // gman.set('csv.encapsulator', '');
    // gman.set('csv.separator', '%09');
    // gman.set('csv.header', 'false');
    // gman.set('csv.mv.separator', '|');
    // gman.set('start', _random_number(5));

    //gman.set('start', _random_number(5));
    gman.set_extra('&start=' + _random_number(4));
    //console.log(gman.get_download_url(field_list, { 'rows': lines }));
    return gman.get_download_url(field_list, { 'rows': lines });
}
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)
1003906
def download(url):
    """"""
    session = requests.Session()
    session.mount('file://', FileAdapter())

    try:
        res = session.get(url)
    except requests.exceptions.ConnectionError as e:
        raise e

    res.raise_for_status()

    return res
991904
def fetch_url(url, dest, parent_to_remove_before_fetch):
    """"""
    logger.debug('Downloading file {} from {}', dest, url)
    try:
        shutil.rmtree(parent_to_remove_before_fetch)
    except FileNotFoundError:
        pass
    os.makedirs(parent_to_remove_before_fetch)
    # TODO(itamar): Better downloading (multi-process-multi-threaded?)
    # Consider offloading this to a "standalone app" invoked with Docker
    resp = requests.get(url, stream=True)
    with open(dest, 'wb') as fetch_file:
        for chunk in resp.iter_content(chunk_size=32 * 1024):
            fetch_file.write(chunk)
1120668
def api_url(self):
        ''''''
        return pathjoin(Request.path, self.id, url=self.bin.api_url)
1327517
def get_clean_url(self):
        """"""
        if self.needs_auth:
            self.prompt_auth()
        url = RepositoryURL(self.url.full_url)
        url.username = self.username
        url.password = self.password
        return url
656952
def show_download_links(self):
        
        #In case they specify version as 'dev' instead of using -T svn,
        #don't show three svn URI's
        if self.options.file_type == "all" and self.version == "dev":
            self.options.file_type = "svn"

        if self.options.file_type == "svn":
            version = "dev"
        else:
            if self.version:
                version = self.version
            else:
                version = self.all_versions[0]
        if self.options.file_type == "all":
            #Search for source, egg, and svn
            self.print_download_uri(version, True)
            self.print_download_uri(version, False)
            self.print_download_uri("dev", True)
        else:
            if self.options.file_type == "source":
                source = True
            else:
                source = False
            self.print_download_uri(version, source)
        return 0
399593
def get_download_urls(self):
        
        info = self.model._meta.app_label, self.model._meta.model_name
        return [
            url(r'^.+(' + self.upload_to + '/.+)/$', self.file_download_view, name='%s_%s_file_download' % info),
        ]
534227
def _retrieve_download_url():
    
    try:
        # Try to obtain the url from the Open Hydrology json config file.
        with urlopen(config['nrfa']['oh_json_url'], timeout=10) as f:
            remote_config = json.loads(f.read().decode('utf-8'))
        # This is just for testing, assuming a relative local file path starting with ./
        if remote_config['nrfa_url'].startswith('.'):
            remote_config['nrfa_url'] = 'file:' + pathname2url(os.path.abspath(remote_config['nrfa_url']))

        # Save retrieved config data
        _update_nrfa_metadata(remote_config)

        return remote_config['nrfa_url']
    except URLError:
        # If that fails (for whatever reason) use the fallback constant.
        return config['nrfa']['url']
566016
def get_download_urls(self, package_name, version="", pkg_type="all"):
        """"""

        if version:
            versions = [version]
        else:

            #If they don't specify version, show em all.

            (package_name, versions) = self.query_versions_pypi(package_name)

        all_urls = []
        for ver in versions:
            metadata = self.release_data(package_name, ver)
            for urls in self.release_urls(package_name, ver):
                if pkg_type == "source" and urls['packagetype'] == "sdist":
                    all_urls.append(urls['url'])
                elif pkg_type == "egg" and \
                        urls['packagetype'].startswith("bdist"):
                    all_urls.append(urls['url'])
                elif pkg_type == "all":
                    #All
                    all_urls.append(urls['url'])

            #Try the package's metadata directly in case there's nothing
            #returned by XML-RPC's release_urls()
            if metadata and metadata.has_key('download_url') and \
                        metadata['download_url'] != "UNKNOWN" and \
                        metadata['download_url'] != None:
                if metadata['download_url'] not in all_urls:
                    if pkg_type != "all":
                        url = filter_url(pkg_type, metadata['download_url'])
                        if url:
                            all_urls.append(url)
        return all_urls
74758
def url(self):
        """"""
        if self.is_unicode_emoji():
            return Asset(self._state)

        _format = 'gif' if self.animated else 'png'
        url = "https://cdn.discordapp.com/emojis/{0.id}.{1}".format(self, _format)
        return Asset(self._state, url)