code: def from_settings(cls, settings, prefix='mail.'):
          
          settings = settings or {}
          top_level_directory = settings.get(prefix+'top_level_directory')
          if top_level_directory is None:
              raise ValueError("DebugMailer:  must specify "
                               "'%stop_level_directory'" % prefix)
          return cls(top_level_directory)
docs: Create a new instance of 'DebugMailer' from settings dict.
  
          :param settings: a settings dict-like
          :param prefix: prefix separating 'tgext.mailer' settings