<s> from __future__ import unicode_literals <EOL> __all__ = [ '<STR_LIT>' , ] <EOL> import logging <EOL> class InMemoryBackend ( object ) : <EOL> """<STR_LIT>""" <EOL> def __init__ ( self , ** kwargs ) : <EOL> self . kwargs = kwargs <EOL> self . messages = { } <EOL> def sendmail ( self , from_addr , to_addrs , msg , ** kwargs ) : <EOL> logging . debug ( '<STR_LIT>' , from_addr , to_addrs , msg , kwargs ) <EOL> if not to_addrs : <EOL> return None <EOL> if not isinstance ( to_addrs , ( list , tuple ) ) : <EOL> to_addrs = [ to_addrs , ] <EOL> for addr in to_addrs : <EOL> data = dict ( from_addr = from_addr , <EOL> message = msg . as_string ( ) , <EOL> source_message = msg , <EOL> ** kwargs ) <EOL> self . messages . setdefault ( addr . lower ( ) , [ ] ) . append ( data ) <EOL> return True </s>
