Receive a request.

        For testing purposes, `skip_author_verification` can be passed. Authorship will not be verified.
3494
def receive(
            self,
            request: RequestType,
            user: UserType = None,
            sender_key_fetcher: Callable[[str], str] = None,
            skip_author_verification: bool = False) -> Tuple[str, dict]:
        
        self.user = user
        self.get_contact_key = sender_key_fetcher
        self.payload = json.loads(decode_if_bytes(request.body))
        self.request = request
        self.extract_actor()
        # Verify the message is from who it claims to be
        if not skip_author_verification:
            self.verify_signature()
        return self.actor, self.payload
920857
@Override
    public Void visitAuthor(AuthorTree tree, Void ignore) {
        warnIfEmpty(tree, tree.getName());
        return super.visitAuthor(tree, ignore);
    }
1264756
def require_auth(request: Request, exceptions: bool=True) -> User:
    
    if not request.user or not request.user.is_authenticated:
        if exceptions:
            raise NotAuthenticated()
        return None
    return request.user
394991
def get(self, request, bot_id, hook_id, id, format=None):
        
        bot = self.get_bot(bot_id, request.user)
        hook = self.get_hook(hook_id, bot, request.user)
        recipient = self.get_recipient(id, hook, request.user)
        serializer = self.serializer(recipient)
        return Response(serializer.data)
938770
def get_extra_info(self, username):
        
        url = self._get_extra_info_url(username)
        return make_request(url, timeout=self.timeout)
744755
def author_info(url)
      authorinfo = handle_response(get("/authorinfo.json", :query => {:url => url}))
      Topsy::Author.new(authorinfo)
    end
1272854
def get_authenticated_person(self):
        """"""
        try:
            output = self._get_data()
            self._logger.debug(output)
            person = Person([
                self.email,
                output[9][1],
                None,
                None,
                None,
                None,
                [
                    None,
                    None,
                    self.email,
                    self.email
                ],
                None,
                None,
                None,
                None,
                None,
                None,
                None,
            ])
        except (IndexError, TypeError, InvalidData):
            self._logger.debug('Missing essential info, cannot instantiate authenticated person')
            return None
        return person
680455
def verifyAccount(self, subject, vendorSpecific=None):
        
        response = self.verifyAccountResponse(subject, vendorSpecific)
        return self._read_boolean_response(response)
1008706
def find_user
      raise CredentialsMissing if client.nil?
      resp = do_authenticated_request(:get, "/user/details")
      raise resp if resp.is_a? String
      resp
    end
564193
def extract_payload(self, request, verify=True, *args, **kwargs):
        
        payload = self._verify(
            request, return_payload=True, verify=verify, *args, **kwargs
        )
        return payload
65408
def request(self, url, method="GET", params=None, headers=None):
        
        params = params or {}
        headers = headers or {}

        logger.debug("URL: %s", url)
        logger.debug("Method: %s", method)
        logger.debug("Headers: %s", headers)
        logger.debug("Params: %s", params)
        
        response, content = self.client().request(url, method, headers=headers,
            body=urllib.urlencode(params))
        
        content = smart_unicode(content)

        logger.debug("Status: %s", response['status'])
        logger.debug("Content: %s", content)
        
        if response['status'] != '200':
            raise OAuthError(_(
                u"Invalid status code %s while requesting %s: %s") % (
                    response['status'], url, content))
        
        return content
154644
def follow_request_reject(self, id):
        
        id = self.__unpack_id(id)
        url = '/api/v1/follow_requests/{0}/reject'.format(str(id))
        self.__api_request('POST', url)
492283
def requester(self):
        
        if self.api and self.requester_id:
            return self.api._get_user(self.requester_id)
26417
def serializeAuthorInstances(self):
        
        author_instance_details = []
        au_instanceid = tethnedao.getMaxAuthorInstanceID()

        for paper in self.corpus:
            paper_key = getattr(paper, Serialize.paper_source_map[self.source])
            for author in paper.authors:
                au_instanceid = au_instanceid + 1
                author_key = author[0][1] + author[0][0]
                author_instance_key = paper_key + author_key
                self.authorInstanceIdMap[author_instance_key] = au_instanceid
                instance_data = {
                        "model": "django-tethne.author_instance",
                        "pk": au_instanceid,
                        "fields": {
                            "paper": self.paperIdMap[paper_key],
                            "author": self.authorIdMap[author_key],
                            "first_name": author[0][1],
                            "last_name":author[0][0],
                        }
                    }
                author_instance_details.append(instance_data)

                # Commented the following, as we do not have author identity detail now.
                """
                    identity_data = {
                        "model": "django-tethne.author_identity",
                        "fields" :{
                            "author": self.authorIdMap[author[0][1]+author[0][0]],
                            "author_instance": self.authorInstanceIdMap[paper.wosid+author[0][1]+author[0][0]],
                            "confidence": 0.0,
                        }
                    }
                    author_identity.append(identity_data)
                """
        return author_instance_details
157584
def receive_response(self, message, insecure=False):
		
		response = self.receive_message()
		if not response.is_response(message):
			raise OmapiError("received message is not the desired response")
		# signature already verified
		if response.authid != self.protocol.defauth and not insecure:
			raise OmapiError("received message is signed with wrong authenticator")
		return response
972001
def from_name(cls, name):
        """"""
        return Author(name=name, sha512=cls.hash_name(name))
460650
def request(self, host, handler, request_body, verbose):
        
        headers = {'User-Agent': self.user_agent,
                   'Content-Type': 'text/xml',
                   }
        url = self._build_url(host, handler)
        kwargs = {}
        if StrictVersion(requests.__version__) >= StrictVersion('0.8.8'):
            kwargs['verify']=True
        else:
            if self.use_https:
                warnings.warn('using https transport but no certificate '
                              'verification. (Hint: upgrade requests package.)')
        try:
            resp = requests.post(url, data=request_body, headers=headers,
                                 **kwargs)
        except ValueError:
            raise
        except Exception:
            raise # something went wrong
        else:
            try:
                resp.raise_for_status()
            except requests.RequestException as e:
                raise xmlrpc.ProtocolError(url, resp.status_code, 
                                                        str(e), resp.headers)
            else:
                return self.parse_response(resp)