<s> import json <EOL> from django . utils . module_loading import import_string <EOL> from . app_settings import app_settings <EOL> class Backend ( object ) : <EOL> def send ( self , url , data ) : <EOL> raise NotImplementedError ( ) <EOL> def validate ( self , content_type , content ) : <EOL> if content_type . startswith ( '<STR_LIT:application/json>' ) : <EOL> result = json . loads ( content ) <EOL> if not result [ '<STR_LIT>' ] : <EOL> raise ValueError ( result [ '<STR_LIT:error>' ] ) <EOL> elif content != '<STR_LIT>' : <EOL> raise ValueError ( content ) <EOL> def get_backend ( ) : <EOL> """<STR_LIT>""" <EOL> if get_backend . backend is None : <EOL> get_backend . backend = import_string ( app_settings . BACKEND ) ( ) <EOL> return get_backend . backend <EOL> get_backend . backend = None </s>
