<s> import os <EOL> from django . conf import settings <EOL> CAPTCHA_FONT_PATH = getattr ( settings , '<STR_LIT>' , os . path . normpath ( os . path . join ( os . path . dirname ( __file__ ) , '<STR_LIT:..>' , '<STR_LIT>' ) ) ) <EOL> CAPTCHA_FONT_SIZE = getattr ( settings , '<STR_LIT>' , <NUM_LIT> ) <EOL> CAPTCHA_LETTER_ROTATION = getattr ( settings , '<STR_LIT>' , ( - <NUM_LIT> , <NUM_LIT> ) ) <EOL> CAPTCHA_BACKGROUND_COLOR = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_FOREGROUND_COLOR = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_CHALLENGE_FUNCT = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_NOISE_FUNCTIONS = getattr ( settings , '<STR_LIT>' , ( '<STR_LIT>' , '<STR_LIT>' , ) ) <EOL> CAPTCHA_FILTER_FUNCTIONS = getattr ( settings , '<STR_LIT>' , ( '<STR_LIT>' , ) ) <EOL> CAPTCHA_WORDS_DICTIONARY = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_PUNCTUATION = getattr ( settings , '<STR_LIT>' , '''<STR_LIT>''' ) <EOL> CAPTCHA_FLITE_PATH = getattr ( settings , '<STR_LIT>' , None ) <EOL> CAPTCHA_TIMEOUT = getattr ( settings , '<STR_LIT>' , <NUM_LIT:5> ) <EOL> CAPTCHA_LENGTH = int ( getattr ( settings , '<STR_LIT>' , <NUM_LIT:4> ) ) <EOL> CAPTCHA_DICTIONARY_MIN_LENGTH = getattr ( settings , '<STR_LIT>' , <NUM_LIT:0> ) <EOL> CAPTCHA_DICTIONARY_MAX_LENGTH = getattr ( settings , '<STR_LIT>' , <NUM_LIT> ) <EOL> CAPTCHA_IMAGE_SIZE = getattr ( settings , '<STR_LIT>' , None ) <EOL> CAPTCHA_IMAGE_TEMPLATE = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_HIDDEN_FIELD_TEMPLATE = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_TEXT_FIELD_TEMPLATE = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_FIELD_TEMPLATE = getattr ( settings , '<STR_LIT>' , '<STR_LIT>' ) <EOL> CAPTCHA_OUTPUT_FORMAT = getattr ( settings , '<STR_LIT>' , None ) <EOL> CAPTCHA_MATH_CHALLENGE_OPERATOR = getattr ( settings , '<STR_LIT>' , '<STR_LIT:*>' ) <EOL> CAPTCHA_TEST_MODE = getattr ( settings , '<STR_LIT>' , getattr ( settings , '<STR_LIT>' , False ) ) <EOL> if CAPTCHA_DICTIONARY_MIN_LENGTH > CAPTCHA_DICTIONARY_MAX_LENGTH : <EOL> CAPTCHA_DICTIONARY_MIN_LENGTH , CAPTCHA_DICTIONARY_MAX_LENGTH = CAPTCHA_DICTIONARY_MAX_LENGTH , CAPTCHA_DICTIONARY_MIN_LENGTH <EOL> def _callable_from_string ( string_or_callable ) : <EOL> if callable ( string_or_callable ) : <EOL> return string_or_callable <EOL> else : <EOL> return getattr ( __import__ ( '<STR_LIT:.>' . join ( string_or_callable . split ( '<STR_LIT:.>' ) [ : - <NUM_LIT:1> ] ) , { } , { } , [ '<STR_LIT>' ] ) , string_or_callable . split ( '<STR_LIT:.>' ) [ - <NUM_LIT:1> ] ) <EOL> def get_challenge ( ) : <EOL> return _callable_from_string ( CAPTCHA_CHALLENGE_FUNCT ) <EOL> def noise_functions ( ) : <EOL> if CAPTCHA_NOISE_FUNCTIONS : <EOL> return map ( _callable_from_string , CAPTCHA_NOISE_FUNCTIONS ) <EOL> return [ ] <EOL> def filter_functions ( ) : <EOL> if CAPTCHA_FILTER_FUNCTIONS : <EOL> return map ( _callable_from_string , CAPTCHA_FILTER_FUNCTIONS ) <EOL> return [ ] </s>
