def finger(self, resource, host=None, rel=None, raw=False):

        import requests

        if not host:
            host = self._parse_host(resource)

        url = "https://%s/.well-known/webfinger" % host

        headers = {
            'User-Agent': 'python-webfinger/%s' % __version__,
            'Accept': WEBFINGER_TYPE,
        }

        params = {'resource': resource}
        if rel:
            params['rel'] = rel

        resp = requests.get(url, params=params, headers=headers, timeout=self.timeout, verify=True)
        logging.debug('fetching JRD from %s' % resp.url)

        content_type = resp.headers.get('Content-Type', '').split(';', 1)[0].strip()
        logging.debug('response content type: %s' % content_type)

        if content_type != WEBFINGER_TYPE and content_type not in LEGACY_WEBFINGER_TYPES:
            raise WebFingerException('Invalid response type from server')

        if raw:
            return resp.json()

        return WebFingerResponse(resp.json())
dataset/ETHPy150Open jcarbaugh/python-webfinger/webfinger.py/WebFingerClient.finger/original