Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias ImportFrom alias ImportFrom alias alias TryExcept body Assign NameStore Str Expr Str Assign NameStore Call NameLoad Str handlers ExceptHandler type NameLoad body Assign NameStore Call NameLoad Str Assign NameStore Str Assign NameStore Call NameLoad Call NameLoad Assign NameStore NameStore Str ClassDef bases NameLoad body Expr Str Assign NameStore Str Assign NameStore BinOpAdd NameLoad Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpAdd AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return Call AttributeLoad Str attr GeneratorExp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore Call NameLoad Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad Str Str body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Dict Str Str NameLoad NameLoad NameLoad Num keyword NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword Str keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore ListLoad Str Str For NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call NameLoad NameLoad Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad Num Call AttributeLoad NameLoad attr Num Num body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num BinOpAdd AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num BinOpAdd AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad Str attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Str Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If AttributeLoad NameLoad attr body Expr Call AttributeLoad Call NameLoad attr Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult Str Num Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad keyword Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str decorator_list Call NameLoad Str NameLoad Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr Call NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMult Str Num For NameStore Call NameLoad Num BinOpAdd AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr keyword Str Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str Str decorator_list Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str If CompareGtE NameLoad Call NameLoad Str body Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index Str NameLoad decorator_list Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list Call NameLoad Str Str FunctionDef arguments args NameParam defaults body For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list Call NameLoad Str Num FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Assign NameStore Call NameLoad Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Num decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str decorator_list Call NameLoad Str NameLoad Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Num Num Assign NameStore Call AttributeLoad NameLoad attr Num Num For NameStore Call NameLoad Num NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str For NameStore Call NameLoad Num NameLoad body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Str Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Assign SubscriptStore AttributeLoad NameLoad attr Index Str Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str NameLoad Call NameLoad Str Str FunctionDef arguments args NameParam defaults body Expr Str ImportFrom alias Expr NameLoad decorator_list FunctionDef arguments args NameParam defaults body For NameStore Call NameLoad Num Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Num For NameStore Call NameLoad Num Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr BinOpAdd AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr Index Num decorator_list Call NameLoad Str NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list Call NameLoad Str NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Str Assign NameStore Str For NameStore Call NameLoad Num BinOpAdd AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad Str attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad For NameStore Call NameLoad Num AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Str Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ListLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad ListLoad decorator_list Call NameLoad Str NameLoad decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Num decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Assign NameStore Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list
N/A N/A random N/A string N/A time distutils.version StrictVersion mock patch django get_version django.contrib.auth.models User django.contrib.auth.models AnonymousUser django.contrib.sessions.backends.db SessionStore django.core.urlresolvers NoReverseMatch django.core.urlresolvers reverse django.http HttpRequest django.test.client RequestFactory N/A utils N/A config connection parse_redis_url get_redis_connection models AccessAttempt test DefenderTestCase DefenderTransactionTestCase N/A N/A N/A LOGIN_FORM_KEY <form action="/admin/login/" method="post" N/A  id="login-form"> N/A ADMIN_LOGIN_URL N/A reverse admin:login N/A N/A N/A NoReverseMatch N/A N/A ADMIN_LOGIN_URL N/A reverse admin:index N/A LOGIN_FORM_KEY this_is_the_login_form N/A DJANGO_VERSION N/A StrictVersion N/A get_version N/A VALID_USERNAME VALID_PASSWORD valid AccessAttemptTest N/A DefenderTestCase N/A N/A  Test case using custom settings for testing
     N/A LOCKED_MESSAGE Account locked: too many login attempts. N/A PERMANENT_LOCKED_MESSAGE N/A LOCKED_MESSAGE   Contact an admin to unlock your account. _get_random_str N/A N/A self N/A N/A N/A  Returns a random str  N/A chars N/A N/A string ascii_uppercase N/A string digits N/A N/A N/A join N/A N/A N/A random choice chars N/A x N/A range 20 N/A _login N/A N/A self username password user_agent remote_addr N/A None None test-browser 127.0.0.1 N/A N/A  Login a user. If the username or password is not provided
        it will use a random string instead. Use the VALID_USERNAME and
        VALID_PASSWORD to make a valid login.
         N/A N/A username None N/A N/A username N/A N/A self _get_random_str N/A N/A password None N/A N/A password N/A N/A self _get_random_str N/A response N/A N/A N/A self client post ADMIN_LOGIN_URL N/A username password LOGIN_FORM_KEY username password 1 HTTP_USER_AGENT user_agent REMOTE_ADDR remote_addr N/A response N/A setUp N/A N/A self N/A N/A N/A  Create a valid user for login
         N/A N/A self user N/A N/A N/A User objects create_superuser username VALID_USERNAME email test@example.com password VALID_PASSWORD N/A test_data_integrity_of_get_blocked_ips N/A N/A self N/A N/A N/A  Test whether data retrieved from redis via
        get_blocked_ips() is the same as the data saved
         N/A data_in N/A 127.0.0.1 4.2.2.1 N/A ip data_in N/A N/A N/A N/A utils block_ip ip N/A data_out N/A N/A utils get_blocked_ips N/A N/A N/A self assertEqual N/A sorted data_in N/A sorted data_out N/A N/A N/A utils block_ip None N/A data_out N/A N/A utils get_blocked_ips N/A N/A N/A self assertEqual N/A sorted data_in N/A sorted data_out N/A test_data_integrity_of_get_blocked_usernames N/A N/A self N/A N/A N/A  Test whether data retrieved from redis via
        get_blocked_usernames() is the same as the data saved
         N/A data_in N/A foo bar N/A username data_in N/A N/A N/A N/A utils block_username username N/A data_out N/A N/A utils get_blocked_usernames N/A N/A N/A self assertEqual N/A sorted data_in N/A sorted data_out N/A N/A N/A utils block_username None N/A data_out N/A N/A utils get_blocked_usernames N/A N/A N/A self assertEqual N/A sorted data_in N/A sorted data_out N/A test_login_get N/A N/A self N/A N/A N/A  visit the login page  N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertEqual N/A response status_code 200 N/A test_failure_limit_by_ip_once N/A N/A self N/A N/A N/A  Tests the login lock by ip when trying to login
        one more time than failure limit
         N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_failure_limit_by_ip_many N/A N/A self N/A N/A N/A  Tests the login lock by ip when trying to
        login a lot of times more than failure limit
         N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A i N/A range 0 N/A N/A random randrange 1 10 N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_failure_limit_by_username_once N/A N/A self N/A N/A N/A  Tests the login lock by username when trying to login
        one more time than failure limit
         N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A ip N/A N/A 74.125.239.{0}. format i N/A response N/A N/A self _login username VALID_USERNAME remote_addr ip N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_valid_login N/A N/A self N/A N/A N/A  Tests a valid login for a real username
         N/A response N/A N/A self _login username VALID_USERNAME password VALID_PASSWORD N/A N/A N/A self assertNotContains response LOGIN_FORM_KEY status_code 302 N/A test_reset_after_valid_login N/A N/A self N/A N/A N/A  Tests the counter gets reset after a valid login
         N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A N/A N/A self _login username VALID_USERNAME N/A N/A N/A self _login username VALID_USERNAME password VALID_PASSWORD N/A response N/A N/A self _login username VALID_USERNAME N/A N/A N/A self assertNotContains response N/A self LOCKED_MESSAGE N/A test_blocked_ip_cannot_login N/A N/A self N/A N/A N/A  Test an user with blocked ip cannot login with another username
         N/A i N/A range 0 N/A N/A config FAILURE_LIMIT 1 N/A N/A response N/A N/A self _login username VALID_USERNAME N/A response N/A N/A self _login username myuser N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_blocked_username_cannot_login N/A N/A self N/A N/A N/A  Test an user with blocked username cannot login using
        another ip
         N/A i N/A range 0 N/A N/A config FAILURE_LIMIT 1 N/A N/A ip N/A N/A 74.125.239.{0}. format i N/A response N/A N/A self _login username VALID_USERNAME remote_addr ip N/A response N/A N/A self _login username VALID_USERNAME remote_addr 8.8.8.8 N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_cooling_off N/A N/A self N/A N/A N/A  Tests if the cooling time allows a user to login
         N/A N/A N/A self test_failure_limit_by_ip_once N/A N/A N/A time sleep N/A config COOLOFF_TIME N/A N/A config MOCK_REDIS N/A N/A N/A N/A N/A get_redis_connection do_expire N/A N/A N/A self test_valid_login N/A test_cooling_off_for_trusted_user N/A N/A self N/A N/A N/A  Test the cooling time for a trusted user
         N/A N/A N/A self test_cooling_off N/A test_long_user_agent_valid N/A N/A self N/A N/A N/A  Tests if can handle a long user agent
         N/A long_user_agent N/A ie6 1024 N/A response N/A N/A self _login username VALID_USERNAME password VALID_PASSWORD user_agent long_user_agent N/A N/A N/A self assertNotContains response LOGIN_FORM_KEY status_code 302 N/A test_get_ip_reverse_proxy N/A N/A self N/A N/A N/A  Tests if can handle a long user agent
         N/A request_factory N/A RequestFactory N/A request N/A N/A request_factory get ADMIN_LOGIN_URL N/A N/A request user N/A AnonymousUser N/A N/A request session N/A SessionStore N/A N/A N/A request META N/A HTTP_X_FORWARDED_FOR 192.168.24.24 N/A N/A N/A self assertEqual N/A N/A utils get_ip request 192.168.24.24 N/A request_factory N/A RequestFactory N/A request N/A N/A request_factory get ADMIN_LOGIN_URL N/A N/A request user N/A AnonymousUser N/A N/A request session N/A SessionStore N/A N/A N/A request META N/A REMOTE_ADDR 24.24.24.24 N/A N/A N/A self assertEqual N/A N/A utils get_ip request 24.24.24.24 N/A N/A patch defender.config.BEHIND_REVERSE_PROXY True N/A patch defender.config.REVERSE_PROXY_HEADER HTTP_X_FORWARDED_FOR test_get_ip N/A N/A self N/A N/A N/A  Tests if can handle a long user agent
         N/A request_factory N/A RequestFactory N/A request N/A N/A request_factory get ADMIN_LOGIN_URL N/A N/A request user N/A AnonymousUser N/A N/A request session N/A SessionStore N/A N/A N/A self assertEqual N/A N/A utils get_ip request 127.0.0.1 N/A test_long_user_agent_not_valid N/A N/A self N/A N/A N/A  Tests if can handle a long user agent with failure
         N/A long_user_agent N/A ie6 1024 N/A i N/A range 0 N/A N/A config FAILURE_LIMIT 1 N/A N/A response N/A N/A self _login user_agent long_user_agent N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_reset_ip N/A N/A self N/A N/A N/A  Tests if can reset an ip address
         N/A N/A N/A self test_failure_limit_by_ip_once N/A N/A N/A utils reset_failed_attempts ip_address 127.0.0.1 N/A N/A N/A self test_valid_login N/A test_failed_login_redirect_to_URL N/A N/A self N/A N/A N/A  Test to make sure that after lockout we send to the correct
        redirect URL  N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertEqual N/A response status_code 302 N/A N/A N/A self assertEqual N/A response N/A Location http://localhost/othe/login/ N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertEqual N/A response status_code 302 N/A N/A N/A self assertEqual N/A response N/A Location http://localhost/othe/login/ N/A N/A patch defender.config.LOCKOUT_URL http://localhost/othe/login/ test_failed_login_redirect_to_URL_local N/A N/A self N/A N/A N/A  Test to make sure that after lockout we send to the correct
        redirect URL  N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A lockout_url http://testserver/o/login/ N/A N/A DJANGO_VERSION N/A StrictVersion 1.9 N/A N/A lockout_url /o/login/ N/A response N/A N/A self _login N/A N/A N/A self assertEqual N/A response status_code 302 N/A N/A N/A self assertEqual N/A response N/A Location lockout_url N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertEqual N/A response status_code 302 N/A N/A N/A self assertEqual N/A response N/A Location lockout_url N/A N/A patch defender.config.LOCKOUT_URL /o/login/ test_failed_login_redirect_to_template N/A N/A self N/A N/A N/A  Test to make sure that after lockout we send to the correct
        template  N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertEqual N/A response status_code 200 N/A N/A N/A self assertTemplateUsed response defender/lockout.html N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertEqual N/A response status_code 200 N/A N/A N/A self assertTemplateUsed response defender/lockout.html N/A N/A patch defender.config.LOCKOUT_TEMPLATE defender/lockout.html test_failed_login_no_cooloff N/A N/A self N/A N/A N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self PERMANENT_LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response N/A self PERMANENT_LOCKED_MESSAGE N/A N/A patch defender.config.COOLOFF_TIME 0 test_login_attempt_model N/A N/A self N/A N/A N/A  test the login model N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A N/A N/A self assertEqual N/A N/A N/A AccessAttempt objects count 1 N/A N/A N/A self assertIsNotNone N/A str N/A N/A N/A N/A AccessAttempt objects all N/A 0 N/A test_is_valid_ip N/A N/A self N/A N/A N/A  Test the is_valid_ip() method  N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 192.168.0.1 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 130.80.100.24 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 8.8.8.8 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 127.0.0.1 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip fish False N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip None False N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip False N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 0x41.0x41.0x41.0x41 False N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 192.168.100.34.y False N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 2001:0db8:85a3:0000:0000:8a2e:0370:7334 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 2001:db8:85a3:0:0:8a2e:370:7334 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip 2001:db8:85a3::8a2e:370:7334 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip ::ffff:192.0.2.128 True N/A N/A N/A self assertEqual N/A N/A utils is_valid_ip ::ffff:8.8.8.8 True N/A test_parse_redis_url N/A N/A self N/A N/A N/A  test the parse_redis_url method  N/A conf N/A parse_redis_url redis://user:password@localhost2:1234/2 N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost2 N/A N/A N/A self assertEqual N/A N/A conf get DB 2 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD password N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A conf N/A parse_redis_url redis://user:pass@www.localhost.com:1234/2 N/A N/A N/A self assertEqual N/A N/A conf get HOST www.localhost.com N/A N/A N/A self assertEqual N/A N/A conf get DB 2 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD pass N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A conf N/A parse_redis_url redis://password@localhost2:1234/2 N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost2 N/A N/A N/A self assertEqual N/A N/A conf get DB 2 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD None N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A conf N/A parse_redis_url redis://:password@localhost2:1234/2 N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost2 N/A N/A N/A self assertEqual N/A N/A conf get DB 2 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD password N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A conf N/A parse_redis_url None N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost N/A N/A N/A self assertEqual N/A N/A conf get DB 0 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD None N/A N/A N/A self assertEqual N/A N/A conf get PORT 6379 N/A conf N/A parse_redis_url redis://:password@localhost2:1234 N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost2 N/A N/A N/A self assertEqual N/A N/A conf get DB 0 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD password N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A conf N/A parse_redis_url redis://localhost2:1234/0 N/A N/A N/A self assertEqual N/A N/A conf get HOST localhost2 N/A N/A N/A self assertEqual N/A N/A conf get DB 0 N/A N/A N/A self assertEqual N/A N/A conf get PASSWORD None N/A N/A N/A self assertEqual N/A N/A conf get PORT 1234 N/A test_get_ip_address_from_request N/A N/A self N/A N/A N/A req N/A HttpRequest N/A N/A N/A req META N/A REMOTE_ADDR 1.2.3.4 N/A ip N/A N/A utils get_ip_address_from_request req N/A N/A N/A self assertEqual ip 1.2.3.4 N/A req N/A HttpRequest N/A N/A N/A req META N/A REMOTE_ADDR 1.2.3.4  N/A ip N/A N/A utils get_ip_address_from_request req N/A N/A N/A self assertEqual ip 1.2.3.4 N/A req N/A HttpRequest N/A N/A N/A req META N/A REMOTE_ADDR 192.168.100.34.y N/A ip N/A N/A utils get_ip_address_from_request req N/A N/A N/A self assertEqual ip 127.0.0.1 N/A req N/A HttpRequest N/A N/A N/A req META N/A REMOTE_ADDR cat N/A ip N/A N/A utils get_ip_address_from_request req N/A N/A N/A self assertEqual ip 127.0.0.1 N/A req N/A HttpRequest N/A ip N/A N/A utils get_ip_address_from_request req N/A N/A N/A self assertEqual ip 127.0.0.1 N/A test_get_ip_reverse_proxy_custom_header N/A N/A self N/A N/A N/A req N/A HttpRequest N/A N/A N/A req META N/A HTTP_X_PROXIED 1.2.3.4 N/A N/A N/A self assertEqual N/A N/A utils get_ip req 1.2.3.4 N/A req N/A HttpRequest N/A N/A N/A req META N/A HTTP_X_PROXIED 1.2.3.4, 5.6.7.8, 127.0.0.1 N/A N/A N/A self assertEqual N/A N/A utils get_ip req 1.2.3.4 N/A req N/A HttpRequest N/A N/A N/A req META N/A REMOTE_ADDR 1.2.3.4 N/A N/A N/A self assertEqual N/A N/A utils get_ip req 1.2.3.4 N/A N/A patch defender.config.BEHIND_REVERSE_PROXY True N/A patch defender.config.REVERSE_PROXY_HEADER HTTP_X_PROXIED test_get_user_attempts N/A N/A self N/A N/A N/A ip_attempts N/A N/A random randint 3 12 N/A username_attempts N/A N/A random randint 3 12 N/A i N/A range 0 ip_attempts N/A N/A N/A N/A utils increment_key N/A N/A utils get_ip_attempt_cache_key 1.2.3.4 N/A i N/A range 0 username_attempts N/A N/A N/A N/A utils increment_key N/A N/A utils get_username_attempt_cache_key foobar N/A req N/A HttpRequest N/A N/A N/A req POST N/A username foobar N/A N/A N/A req META N/A HTTP_X_REAL_IP 1.2.3.4 N/A N/A N/A self assertEqual N/A N/A utils get_user_attempts req N/A max ip_attempts username_attempts N/A req N/A HttpRequest N/A N/A N/A req POST N/A username foobar N/A N/A N/A req META N/A HTTP_X_REAL_IP 5.6.7.8 N/A N/A N/A self assertEqual N/A N/A utils get_user_attempts req username_attempts N/A req N/A HttpRequest N/A N/A N/A req POST N/A username barfoo N/A N/A N/A req META N/A HTTP_X_REAL_IP 1.2.3.4 N/A N/A N/A self assertEqual N/A N/A utils get_user_attempts req ip_attempts N/A N/A patch defender.config.BEHIND_REVERSE_PROXY True N/A patch defender.config.REVERSE_PROXY_HEADER HTTP_X_REAL_IP test_admin N/A N/A self N/A N/A N/A  test the admin pages for this app  admin AccessAttemptAdmin N/A AccessAttemptAdmin N/A test_decorator_middleware N/A N/A self N/A N/A N/A i N/A range 0 N/A int N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A test_get_view N/A N/A self N/A N/A N/A  Check that the decorator doesn't tamper with GET requests N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertNotContains response N/A self LOCKED_MESSAGE N/A test_use_celery N/A N/A self N/A N/A N/A  Check that use celery works N/A N/A N/A self assertEqual N/A N/A N/A AccessAttempt objects count 0 N/A i N/A range 0 N/A int N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A N/A N/A self assertEqual N/A N/A N/A AccessAttempt objects count N/A N/A config FAILURE_LIMIT 1 N/A N/A N/A self assertIsNotNone N/A str N/A N/A N/A N/A AccessAttempt objects all N/A 0 N/A N/A patch defender.config.USE_CELERY True test_lockout_by_ip_and_username N/A N/A self N/A N/A N/A Check that lockout still works when locking out by IP and Username combined N/A username testy N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login username username N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login username username N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A ip 74.125.239.60 N/A response N/A N/A self _login username VALID_USERNAME remote_addr ip N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A N/A patch defender.config.LOCKOUT_BY_IP_USERNAME True test_disable_ip_lockout N/A N/A self N/A N/A N/A Check that lockout still works when we disable IP Lock out N/A username testy N/A ip 74.125.239.60 N/A i N/A range 0 N/A N/A config FAILURE_LIMIT 10 N/A N/A login_username N/A N/A {0}{1} format username i N/A response N/A N/A self _login username login_username remote_addr ip N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A i N/A range 0 N/A config FAILURE_LIMIT N/A N/A response N/A N/A self _login username username N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login username username N/A N/A N/A self assertContains response N/A self LOCKED_MESSAGE N/A response N/A N/A N/A self client get ADMIN_LOGIN_URL N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A response N/A N/A self _login N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A second_ip 74.125.239.99 N/A response N/A N/A self _login username VALID_USERNAME remote_addr second_ip N/A N/A N/A self assertContains response LOGIN_FORM_KEY N/A data_out N/A N/A utils get_blocked_ips N/A N/A N/A self assertEqual data_out N/A N/A N/A N/A utils block_ip second_ip N/A data_out N/A N/A utils get_blocked_ips N/A N/A N/A self assertEqual data_out N/A N/A N/A patch defender.config.DISABLE_IP_LOCKOUT True N/A DefenderTestCaseTest N/A DefenderTestCase N/A N/A Make sure that we're cleaning the cache between tests N/A key test_key test_first_incr N/A N/A self N/A N/A N/A N/A N/A N/A utils REDIS_SERVER incr N/A self key N/A result N/A int N/A N/A N/A utils REDIS_SERVER get N/A self key N/A N/A N/A self assertEqual result 1 N/A test_second_incr N/A N/A self N/A N/A N/A N/A N/A N/A utils REDIS_SERVER incr N/A self key N/A result N/A int N/A N/A N/A utils REDIS_SERVER get N/A self key N/A N/A N/A self assertEqual result 1 N/A N/A DefenderTransactionTestCaseTest N/A DefenderTransactionTestCase N/A N/A Make sure that we're cleaning the cache between tests N/A key test_key test_first_incr N/A N/A self N/A N/A N/A N/A N/A N/A utils REDIS_SERVER incr N/A self key N/A result N/A int N/A N/A N/A utils REDIS_SERVER get N/A self key N/A N/A N/A self assertEqual result 1 N/A test_second_incr N/A N/A self N/A N/A N/A N/A N/A N/A utils REDIS_SERVER incr N/A self key N/A result N/A int N/A N/A N/A utils REDIS_SERVER get N/A self key N/A N/A N/A self assertEqual result 1 N/A N/A TestUtils N/A DefenderTestCase N/A test_username_blocking N/A N/A self N/A N/A N/A username foo N/A N/A N/A self assertFalse N/A N/A utils is_user_already_locked username N/A N/A N/A utils block_username username N/A N/A N/A self assertTrue N/A N/A utils is_user_already_locked username N/A N/A N/A utils unblock_username username N/A N/A N/A self assertFalse N/A N/A utils is_user_already_locked username N/A test_ip_address_blocking N/A N/A self N/A N/A N/A ip 1.2.3.4 N/A N/A N/A self assertFalse N/A N/A utils is_source_ip_already_locked ip N/A N/A N/A utils block_ip ip N/A N/A N/A self assertTrue N/A N/A utils is_source_ip_already_locked ip N/A N/A N/A utils unblock_ip ip N/A N/A N/A self assertFalse N/A N/A utils is_source_ip_already_locked ip N/A N/A