def get_token(self):
token = None<EOL>try:<EOL><INDENT>doc = self.doc_ref.get()<EOL><DEDENT>except Exception as e:<EOL><INDENT>log.error('<STR_LIT>'<EOL>'<STR_LIT>'<EOL>.format(self.collection, self.doc_id, str(e)))<EOL>doc = None<EOL><DEDENT>if doc and doc.exists:<EOL><INDENT>token_str = doc.get(self.field_name)<EOL>if token_str:<EOL><INDENT>token = self.token_constructor(self.serializer.loads(token_str))<EOL><DEDENT><DEDENT>self.token = token<EOL>return token<EOL>
Retrieves the token from the store
:return dict or None: The token if exists, None otherwise