def get_authenticity_token(self, url=_SIGNIN_URL):
res = self.client._get(url=url, expected_status_code=<NUM_LIT:200>)<EOL>soup = BeautifulSoup(res.text, _DEFAULT_BEAUTIFULSOUP_PARSER)<EOL>selection = soup.select(_AUTHENTICITY_TOKEN_SELECTOR)<EOL>try:<EOL><INDENT>authenticity_token = selection[<NUM_LIT:0>].get("<STR_LIT:content>")<EOL><DEDENT>except:<EOL><INDENT>raise ValueError(<EOL>"<STR_LIT>".format(<EOL>_SIGNIN_URL, _AUTHENTICITY_TOKEN_SELECTOR, res.text))<EOL><DEDENT>return authenticity_token<EOL>
Returns an authenticity_token, mandatory for signing in