Returns the current host.

        :param request_data: The request as a dict
        :type: dict

        :return: The current host
        :rtype: string
960112
def get_self_host(request_data):
        
        if 'http_host' in request_data:
            current_host = request_data['http_host']
        elif 'server_name' in request_data:
            current_host = request_data['server_name']
        else:
            raise Exception('No hostname defined')

        if ':' in current_host:
            current_host_data = current_host.split(':')
            possible_port = current_host_data[-1]
            try:
                possible_port = float(possible_port)
                current_host = current_host_data[0]
            except ValueError:
                current_host = ':'.join(current_host_data)

        return current_host
1282278
def _get(self, *args, **kwargs):
        
        return self._request(requests.get, *args, **kwargs)
153815
def request_host(request):
    
    url = request.get_full_url()
    host = urlparse(url)[1]
    if host == "":
        host = request.get_header("Host", "")

    # remove port, if present
    host = cut_port_re.sub("", host, 1)
    return host.lower()
431650
def eff_request_host(request):
    
    erhn = req_host = request_host(request)
    if req_host.find(".") == -1 and not IPV4_RE.search(req_host):
        erhn = req_host + ".local"
    return req_host, erhn
762034
def get_base_url(self):
        
        return "http://{hostname}:{port}/{api}".format(
                hostname=self.hostname,
                port=self.port,
                api=self.api_version)
1001353
def get_ip_address(request):
    
    if 'HTTP_X_FORWARDED_FOR' in request.META:
        return request.META['HTTP_X_FORWARDED_FOR'].split(',')[0].strip()
    else:
        return request.META['REMOTE_ADDR']
937551
def __data_url(self):
        
        path = AGENT_DATA_PATH % self.from_.pid
        return "http://%s:%s/%s" % (self.host, self.port, path)
892211
def get_requests_request_id(self, request_id):
        
        route_values = {}
        if request_id is not None:
            route_values['requestId'] = self._serialize.url('request_id', request_id, 'str')
        response = self._send(http_method='GET',
                              location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52',
                              version='5.0-preview.1',
                              route_values=route_values)
        return self._deserialize('Request', response)
180724
def get_http_info_with_retriever(self, request, retriever):
        
        urlparts = urlparse.urlsplit(request.url)

        try:
            data = retriever(request)
        except Exception:
            data = {}

        return {
            'url': '{0}://{1}{2}'.format(
                urlparts.scheme, urlparts.netloc, urlparts.path),
            'query_string': urlparts.query,
            'method': request.method,
            'data': data,
            'cookies': request.cookies,
            'headers': request.headers,
            'env': {
                'REMOTE_ADDR': request.remote_addr,
            }
        }
464188
def get_request(self):
        
        if self.hostname_entry:
            self.entries.append(self.hostname_entry)
        request = {}
        for entry in self.entries:
            sans = sorted(list(set(entry['addresses'])))
            request[entry['cn']] = {'sans': sans}
        if self.json_encode:
            return {'cert_requests': json.dumps(request, sort_keys=True)}
        else:
            return {'cert_requests': request}
955252
def request_server_info(self):
        ''' 

        '''
        if self._server_info is None:
            self._server_info = self._send_request_server_info()
        return self._server_info
1066327
def get_request_headers(self):
        
        request_headers = self.get_proxy_request_headers(self.request)

        if (self.add_remote_user and hasattr(self.request, 'user')
                and self.request.user.is_active):
            request_headers['REMOTE_USER'] = self.request.user.get_username()
            self.log.info("REMOTE_USER set")

        return request_headers
1020390
def get_host_uuid(self):
        
        xml = self._request_host()
        root = etree.fromstring(xml)
        data = self._elementtree_to_dict(root)
        return data['HSI']['SPN']['text'], data['HSI']['cUUID']['text']
186382
def _request(self):
        
        caller_frame = inspect.getouterframes(inspect.currentframe())[1]
        args, _, _, values = inspect.getargvalues(caller_frame[0])
        caller_name = caller_frame[3]
        kwargs = {arg: values[arg] for arg in args if arg != 'self'}
        func = reduce(
            lambda resource, name: resource.__getattr__(name),
            self.mappings[caller_name].split('.'), self)
        return func(**kwargs)
231831
def get(self, url):
        
        return requests.get(url, params=self.data, headers=self.config.HEADERS)
62036
def get_host(self):
        
        import socket
        host_name = socket.gethostname()
        for h in hosts:
            if h['name'] == host_name:
                return h['type'], h['name']
        return dict(type='Unknown', name=host_name)
497173
def get_request_data():
    
    request = get_request()
    data = request.get("BODY", "{}")
    if not is_json_deserializable(data):
        from plone.jsonapi.routes.exceptions import APIError
        raise APIError(400, "Request Data is not JSON deserializable – Check JSON Syntax!")
    return _.convert(json.loads(data), _.to_list)