<s> from __future__ import unicode_literals , absolute_import <EOL> import hashlib <EOL> from django . conf import settings <EOL> from . import defaults <EOL> def get_setting ( name ) : <EOL> try : <EOL> return getattr ( settings , '<STR_LIT>' + name ) <EOL> except AttributeError : <EOL> return getattr ( defaults , name ) <EOL> def keyfmt ( k , v = None ) : <EOL> prefix = get_setting ( '<STR_LIT>' ) <EOL> if v is None : <EOL> key = prefix + k <EOL> else : <EOL> key = prefix + hashlib . md5 ( ( k % v ) . encode ( '<STR_LIT:utf-8>' ) ) . hexdigest ( ) <EOL> return key . encode ( '<STR_LIT:utf-8>' ) </s>
