code: def generate(self):
          
          key = self._propose_new_key()
          while self.key_exists(key):
              _logger.warning('Previous candidate was used.'
                              ' Regenerating another...')
              key = self._propose_new_key()
          return key
docs: Generate a new string and return it.