@_memorize<EOL><INDENT>def _get_entities(self, text, language='<STR_LIT>'):<DEDENT>
body = {<EOL>'<STR_LIT>': {<EOL>'<STR_LIT:type>': '<STR_LIT>',<EOL>'<STR_LIT:content>': text,<EOL>},<EOL>'<STR_LIT>': '<STR_LIT>',<EOL>}<EOL>if language:<EOL><INDENT>body['<STR_LIT>']['<STR_LIT>'] = language<EOL><DEDENT>request = self.service.documents().analyzeEntities(body=body)<EOL>response = request.execute()<EOL>result = []<EOL>for entity in response.get('<STR_LIT>', []):<EOL><INDENT>mentions = entity.get('<STR_LIT>', [])<EOL>if not mentions:<EOL><INDENT>continue<EOL><DEDENT>entity_text = mentions[<NUM_LIT:0>]['<STR_LIT:text>']<EOL>offset = entity_text['<STR_LIT>']<EOL>for word in entity_text['<STR_LIT:content>'].split():<EOL><INDENT>result.append({'<STR_LIT:content>': word, '<STR_LIT>': offset})<EOL>offset += len(word)<EOL><DEDENT><DEDENT>return result<EOL>
Returns the list of entities retrieved from the given text.

        Args:
          text (str): Input text.
          language (:obj:`str`, optional): Language code.

        Returns:
          List of entities.