https://maidsafe.readme.io/docs/dns-get-file-unauth
 get_file_unauth("thegoogle", "www", "index.html")
197072
def get_file_unauth(long_name, service_name, file_path)
      # entry point
      url = "#{@client.app_info[:launcher_server]}#{API_VERSION}/dns/#{SafeNet.escape(service_name)}/#{SafeNet.escape(long_name)}/#{SafeNet.escape(file_path)}"

      # api call
      uri = URI(url)
      http = Net::HTTP.new(uri.host, uri.port)
      req = Net::HTTP::Get.new(uri.path)
      res = http.request(req)
      res_headers = {}
      res.response.each_header {|k,v| res_headers[k] = v}
      res.code == "200" ? {"headers" => res_headers, "body" => res.body} : JSON.parse(res.body)
    end
830579
public function trySubdomainUnauthenticatedGet()
    {
        $this->reset();
        $url = 'http://autodiscover.' . $this->tld . self::AUTODISCOVER_PATH;
        $ch = curl_init();
        $opts = array(
            CURLOPT_URL                 => $url,
            CURLOPT_HTTPGET             => true,
            CURLOPT_RETURNTRANSFER      => true,
            CURLOPT_TIMEOUT             => 4,
            CURLOPT_CONNECTTIMEOUT      => $this->connection_timeout,
            CURLOPT_FOLLOWLOCATION      => false,
            CURLOPT_HEADER              => false,
            CURLOPT_HEADERFUNCTION      => array($this, 'readHeaders'),
            CURLOPT_HTTP200ALIASES      => array(301, 302),
            CURLOPT_IPRESOLVE           => CURL_IPRESOLVE_V4
        );
        curl_setopt_array($ch, $opts);
        $this->last_response    = curl_exec($ch);
        $this->last_info        = curl_getinfo($ch);
        $this->last_curl_errno  = curl_errno($ch);
        $this->last_curl_error  = curl_error($ch);

        if ($this->last_info['http_code'] == 302
            || $this->last_info['http_code'] == 301) {
            if ($this->tryViaUrl($this->last_response_headers['location'])) {
                return self::AUTODISCOVERED_VIA_UNAUTHENTICATED_GET;
            }
        }

        return false;
    }
644384
def get_nonoauth_parameters(self):
        """"""
        return dict([(k, v) for k, v in self.items() 
                    if not k.startswith('oauth_')])
696526
def _get_dest_file_and_url(self, filepath, page_meta={}):
        

        filename = filepath.split("/")[-1]
        filepath_base = filepath.replace(filename, "").rstrip("/")
        slug = page_meta.get("slug")
        fname = slugify(slug) if slug else filename \
            .replace(".html", "") \
            .replace(".md", "") \
            .replace(".jade", "")

        if page_meta.get("pretty_url") is False:
            dest_file = os.path.join(filepath_base, "%s.html" % fname)
        else:
            dest_dir = filepath_base
            if filename not in ["index.html", "index.md", "index.jade"]:
                dest_dir = os.path.join(filepath_base, fname)
            dest_file = os.path.join(dest_dir, "index.html")

        url = "/" + dest_file.replace("index.html", "")
        return dest_file, url
1209333
function getBaseUrl (hostUrl, psaDoc, relType, desc) {
  assert(psaDoc && typeof psaDoc === 'object', 'Invalid PSA service description document')
  assert(psaDoc.links && Array.isArray(psaDoc.links), 'Invalid PSA service description document (no links array)')
  var link = psaDoc.links.find(link => {
    var rel = link.rel
    return rel && typeof rel === 'string' && rel.indexOf(relType) !== -1
  })
  if (!link) {
    throw new Error(`Service does not provide the pinning-service ${desc} API (rel ${relType})`)
  }
  var href = link.href
  assert(href && typeof href === 'string', 'Invalid PSA service description document (no href on API link)')
  if (href.startsWith('/')) {
    href = hostUrl + link.href
  }
  return href
}
755211
def _get_dummy_request(base_url, user):
    
    split_url = urlsplit(base_url)
    is_secure = split_url[0] == 'https'
    dummy_request = RequestFactory(HTTP_HOST=split_url[1]).get('/', secure=is_secure)
    dummy_request.is_secure = lambda: is_secure
    dummy_request.user = user or AnonymousUser()
    dummy_request.site = None  # Workaround for wagtail.contrib.settings.context_processors
    return dummy_request
1159610
def get_web_auth_url(self):
        

        token = self._get_web_auth_token()

        url = "{homepage}/api/auth/?api_key={api}&token={token}".format(
            homepage=self.network.homepage, api=self.network.api_key, token=token
        )

        self.web_auth_tokens[url] = token

        return url
650540
def urlsafe(self):
    
    # This is 3-4x faster than urlsafe_b64decode()
    urlsafe = base64.b64encode(self.reference().Encode())
    return urlsafe.rstrip('=').replace('+', '-').replace('/', '_')
606868
def ServiceWorker_unregister(self, scopeURL):
		
		assert isinstance(scopeURL, (str,)
		    ), "Argument 'scopeURL' must be of type '['str']'. Received type: '%s'" % type(
		    scopeURL)
		subdom_funcs = self.synchronous_command('ServiceWorker.unregister',
		    scopeURL=scopeURL)
		return subdom_funcs
413023
function dnsCompatibleBucketName(bucketName) {
    var b = bucketName;
    var domain = new RegExp(/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/);
    var ipAddress = new RegExp(/(\d+\.){3}\d+/);
    var dots = new RegExp(/\.\./);
    return (b.match(domain) && !b.match(ipAddress) && !b.match(dots)) ? true : false;
  }
1335211
function getCookieAuthUrl(nextUri) {
    nextUri = nextUri || config.OSF.redirectUri;
    const loginUri = `${config.OSF.url}login/?next=${encodeURIComponent(nextUri)}`;
    return `${config.OSF.cookieLoginUrl}?service=${encodeURIComponent(loginUri)}`;
}
1258398
def get_authservers(self, domainid, page=None):
        """"""
        opts = {}
        if page:
            opts['page'] = page
        return self.api_call(
            ENDPOINTS['authservers']['list'],
            dict(domainid=domainid), **opts)
163382
function getProxyUri(uri) {

	if (uri.protocol === 'https:' && env.httpsProxy || uri.protocol === 'http:' && env.httpProxy) {

		if (env.noProxy) {
			var canonicalHost = uri.host.replace(/^\.*/, '.');
			var port = uri.port || (uri.protocol === 'https:' ? '443' : '80');

			var patterns = env.noProxy.split(',');
			for (var i = patterns.length - 1; i >= 0; i--) {
				var pattern = patterns[i].trim().toLowerCase();

				// don't use a proxy at all
				if (pattern === '*') {
					return null;
				}

				// Remove leading * and make sure to have exact one leading dot (.)
				pattern = pattern.replace(/^[\*]+/, '').replace(/^\.*/, '.');

				// add port if no specified
				if (pattern.indexOf(':') === -1) {
					pattern += ':' + port;
				}

				// if host ends with pattern, no proxy should be used
				if (canonicalHost.indexOf(pattern) === canonicalHost.length - pattern.length) {
					return null;
				}
			}
		}

		if (uri.protocol === 'https:' && env.httpsProxy) {
			return env.httpsProxy;
		} else if (uri.protocol === 'http:' && env.httpProxy) {
			return env.httpProxy;
		}
	}

	return null;
}
276042
function getFingerprintForURL(url) {
	var domain = getDomain(url);
	var found = global.requestSSLFingerprints[domain];
	debug('getFingerprintForURL %s -> %s=%s',url,domain,found);
	if (!found) {
		// try a wildcard search
		var u = urlib.parse(domain),
			tokens = (u && u.host || domain).split('.');
		domain = '*.'+tokens.splice(tokens.length > 1 ? 0 : 1).join('.');
		found = global.requestSSLFingerprints[domain];
		debug('getFingerprintForURL (wildcard) %s -> %s=%s',url,domain,found);
	}
	return found;
}
275615
@GET
  @Path(WEBUI_DATA)
  @ReturnType("alluxio.wire.MasterWebUIData")
  public Response getWebUIData(@DefaultValue("0") @QueryParam("offset") String requestOffset,
      @DefaultValue("20") @QueryParam("limit") String requestLimit) {
    return RestUtils.call(() -> {
      MasterWebUIData response = new MasterWebUIData();

      if (!ServerConfiguration.getBoolean(PropertyKey.WEB_FILE_INFO_ENABLED)) {
        return response;
      }

      if (SecurityUtils.isSecurityEnabled(ServerConfiguration.global())
          && AuthenticatedClientUser.get(ServerConfiguration.global()) == null) {
        AuthenticatedClientUser.set(LoginUser.get(ServerConfiguration.global()).getName());
      }
      response.setMasterNodeAddress(mMasterProcess.getRpcAddress().toString()).setFatalError("")
          .setShowPermissions(ServerConfiguration
              .getBoolean(PropertyKey.SECURITY_AUTHORIZATION_PERMISSION_ENABLED));

      List<AlluxioURI> inAlluxioFiles = mFileSystemMaster.getInAlluxioFiles();
      Collections.sort(inAlluxioFiles);

      List<UIFileInfo> fileInfos = new ArrayList<>(inAlluxioFiles.size());
      for (AlluxioURI file : inAlluxioFiles) {
        try {
          long fileId = mFileSystemMaster.getFileId(file);
          FileInfo fileInfo = mFileSystemMaster.getFileInfo(fileId);
          if (fileInfo != null && fileInfo.getInAlluxioPercentage() == 100) {
            fileInfos.add(new UIFileInfo(fileInfo, ServerConfiguration.global(),
                new MasterStorageTierAssoc().getOrderedStorageAliases()));
          }
        } catch (FileDoesNotExistException e) {
          response.setFatalError("Error: File does not exist " + e.getLocalizedMessage());
          return response;
        } catch (AccessControlException e) {
          response
              .setPermissionError("Error: File " + file + " cannot be accessed " + e.getMessage());
          return response;
        }
      }
      response.setInAlluxioFileNum(fileInfos.size());

      try {
        int offset = Integer.parseInt(requestOffset);
        int limit = Integer.parseInt(requestLimit);
        limit = offset == 0 && limit > fileInfos.size() ? fileInfos.size() : limit;
        limit = offset + limit > fileInfos.size() ? fileInfos.size() - offset : limit;
        int sum = Math.addExact(offset, limit);
        fileInfos = fileInfos.subList(offset, sum);
        response.setFileInfos(fileInfos);
      } catch (NumberFormatException e) {
        response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
        return response;
      } catch (ArithmeticException e) {
        response.setFatalError(
            "Error: offset or offset + limit is out of bound, " + e.getLocalizedMessage());
        return response;
      } catch (IllegalArgumentException e) {
        response.setFatalError(e.getLocalizedMessage());
        return response;
      }

      return response;
    }, ServerConfiguration.global());
  }
1259194
def _get(self, url,
             param_dict={},
             securityHandler=None,
             additional_headers=[],
             handlers=[],
             proxy_url=None,
             proxy_port=None,
             compress=True,
             custom_handlers=[],
             out_folder=None,
             file_name=None):
        
        self._last_method = "GET"
        CHUNK = 4056
        param_dict, handler, cj = self._processHandler(securityHandler, param_dict)
        headers = [] + additional_headers
        if compress:
            headers.append(('Accept-encoding', 'gzip'))
        else:
            headers.append(('Accept-encoding', ''))
        headers.append(('User-Agent', self.useragent))
        if len(param_dict.keys()) == 0:
            param_dict = None
        if handlers is None:
            handlers = []
        if handler is not None:
            handlers.append(handler)
        handlers.append(RedirectHandler())
        if cj is not None:
            handlers.append(request.HTTPCookieProcessor(cj))
        if proxy_url is not None:
            if proxy_port is None:
                proxy_port = 80
            proxies = {"http":"http://%s:%s" % (proxy_url, proxy_port),
                       "https":"https://%s:%s" % (proxy_url, proxy_port)}
            proxy_support = request.ProxyHandler(proxies)
            handlers.append(proxy_support)
        opener = request.build_opener(*handlers)
        opener.addheaders = headers
        if param_dict is None:
            resp = opener.open(url, data=param_dict)
        elif len(str(urlencode(param_dict))) + len(url) >= 1999:
            resp = opener.open(url, data=urlencode(param_dict))
        else:
            format_url = url + "?%s" % urlencode(param_dict)
            resp = opener.open(fullurl=format_url)
        self._last_code = resp.getcode()
        self._last_url = resp.geturl()
        #  Get some headers from the response
        maintype = self._mainType(resp)
        contentDisposition = resp.headers.get('content-disposition')
        contentEncoding = resp.headers.get('content-encoding')
        contentType = resp.headers.get('content-Type').split(';')[0].lower()
        contentLength = resp.headers.get('content-length')
        if maintype.lower() in ('image',
                                'application/x-zip-compressed') or \
           contentType == 'application/x-zip-compressed' or \
           (contentDisposition is not None and \
           contentDisposition.lower().find('attachment;') > -1):

            fname = self._get_file_name(
                contentDisposition=contentDisposition,
                url=url)
            if out_folder is None:
                out_folder = tempfile.gettempdir()
            if contentLength is not None:
                max_length = int(contentLength)
                if max_length < CHUNK:
                    CHUNK = max_length
            file_name = os.path.join(out_folder, fname)
            with open(file_name, 'wb') as writer:
                for data in self._chunk(response=resp,
                                        size=CHUNK):
                    writer.write(data)
                    writer.flush()
                writer.flush()
                del writer
            return file_name
        else:
            read = ""
            for data in self._chunk(response=resp,
                                    size=CHUNK):
                if self.PY3 == True:
                    read += data.decode('utf-8')
                else:
                    read += data

                del data
            try:
                results = json.loads(read)
                if 'error' in results:
                    if 'message' in results['error']:
                        if results['error']['message'] == 'Request not made over ssl':
                            if url.startswith('http://'):
                                url = url.replace('http://', 'https://')
                                return self._get(url,
                                               param_dict,
                                               securityHandler,
                                               additional_headers,
                                               handlers,
                                               proxy_url,
                                               proxy_port,
                                               compress,
                                               custom_handlers,
                                               out_folder,
                                               file_name)
                return results
            except:
                return read
591941
def security(self, domain):
        '''
        '''
        uri = self._uris["security"].format(domain)
        return self.get_parse(uri)