Module Import alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias alias Import alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam NameParam defaults Num NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad TryExcept body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str Num handlers ExceptHandler type NameLoad body Assign NameStore Num TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr Str Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore ListComp TupleLoad NameLoad NameLoad comprehension NameStore AttributeLoad NameLoad attr CompareNotEq NameLoad Str comprehension NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad Assign NameStore Call NameLoad NameLoad Return BinOpMod Str TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str If UnaryOpNot NameLoad body Assign NameStore Call NameLoad NameLoad For NameStore Call NameLoad Num NameLoad NameLoad body Expr Yield SubscriptLoad NameLoad Slice NameLoad BinOpAdd NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str TryExcept body Return Call NameLoad Call NameLoad NameLoad handlers ExceptHandler type TupleLoad NameLoad NameLoad NameLoad body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str For NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If UnaryOpNot Call NameLoad NameLoad NameLoad body Continue TryExcept body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad handlers ExceptHandler type AttributeLoad NameLoad attr body Continue Assign NameStore Call NameLoad NameLoad NameLoad If BoolOpAnd Call NameLoad NameLoad AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str orelse If CompareIn Str AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str If BoolOpAnd UnaryOpNot AttributeLoad NameLoad attr UnaryOpNot Call NameLoad NameLoad AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr body Return NameLoad Return NameLoad decorator_list ClassDef bases NameLoad body Pass decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad Assign NameStore BinOpSub Call NameLoad NameLoad NameLoad If CompareLt NameLoad Num body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareLt Call NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad body Raise Call NameLoad Str Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Slice UnaryOpUSub NameLoad Return Call AttributeLoad NameLoad attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str FunctionDef arguments args NameParam defaults body If BoolOpAnd Call NameLoad NameLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str Return BinOpMod Str TupleLoad NameLoad NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Yield Expr Call AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args defaults body Expr Str ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Str keyword NameLoad Return AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam defaults Num body Expr Str Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Str decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str AugAssignAdd AttributeStore NameLoad attr NameLoad If BoolOpAnd AttributeLoad NameLoad attr CompareEq BinOpMod AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad AttributeLoad NameLoad attr Assign NameStore BinOpAdd AttributeLoad NameLoad attr BinOpDiv AttributeLoad NameLoad attr Num Assign NameStore BinOpDiv AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpSub AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call NameLoad BinOpDiv BinOpDiv NameLoad NameLoad Num Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Call AttributeLoad Str attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults ListLoad Str Lambda arguments args NameParam defaults NameLoad body Expr Str If BoolOpOr Call NameLoad NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Str body Assign AttributeStore NameLoad attr NameLoad orelse Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Call NameLoad NameLoad If AttributeLoad NameLoad attr body If BoolOpAnd Call NameLoad NameLoad Str Call AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad Str attr AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str SubscriptLoad AttributeLoad NameLoad attr Index Str Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr Str Str keyword NameLoad keyword NameLoad Return AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad AttributeLoad NameLoad attr If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Num orelse Assign NameStore NameLoad Return NameLoad decorator_list
N/A N/A json N/A re N/A sys contextlib contextmanager datetime datetime django.conf settings django.contrib.sites.models Site django.db models django.db.models.signals pre_delete django.utils translation django.utils.http urlencode is_safe_url N/A ratelimit.helpers kitsune.sumo paginator kitsune.journal.models Record paginate N/A N/A request queryset per_page count N/A 20 None N/A N/A Get a Paginator, abstracting some common paging actions. N/A p N/A N/A paginator Paginator queryset per_page count count N/A N/A N/A page N/A int N/A N/A N/A request GET get page 1 N/A N/A N/A ValueError N/A N/A page 1 N/A N/A N/A paginated N/A N/A p page page N/A N/A N/A N/A N/A paginator EmptyPage N/A paginator InvalidPage N/A N/A paginated N/A N/A p page 1 N/A N/A paginated url N/A build_paged_url request N/A paginated N/A simple_paginate N/A N/A request queryset per_page N/A 20 N/A N/A Get a SimplePaginator page. N/A p N/A N/A paginator SimplePaginator queryset per_page N/A page N/A N/A p page N/A N/A N/A request GET get page 1 N/A N/A page url N/A build_paged_url request N/A page N/A build_paged_url N/A N/A request N/A N/A N/A Build the url for the paginator. N/A base N/A N/A request build_absolute_uri N/A request path N/A items N/A N/A k v N/A k N/A request GET N/A k page N/A v N/A N/A N/A request GET getlist k v N/A qsa N/A urlencode items N/A N/A %s?%s N/A base qsa N/A chunked N/A N/A seq n length N/A None N/A N/A 
    Yield successive n-sized chunks from seq.

    If length isn't specifed, it is calculated from len(seq).

    >>> for group in chunked(range(8), 3):
    ...     print group
    [0, 1, 2]
    [3, 4, 5]
    [6, 7]
     N/A N/A length N/A N/A length N/A len seq N/A i N/A xrange 0 length n N/A N/A N/A N/A seq N/A i N/A i n N/A smart_int N/A N/A string fallback N/A 0 N/A N/A Convert a string to int, with fallback for invalid strings or types. N/A N/A N/A N/A int N/A float string N/A N/A N/A N/A ValueError TypeError OverflowError N/A N/A fallback N/A delete_files_for_obj N/A N/A sender N/A kwargs N/A N/A Signal receiver of a model class and instance. Deletes its files. N/A obj N/A N/A kwargs pop instance N/A field_name N/A N/A N/A sender _meta get_all_field_names N/A N/A N/A N/A hasattr obj field_name N/A N/A N/A N/A N/A field_class N/A N/A N/A sender _meta get_field field_name N/A N/A N/A N/A models FieldDoesNotExist N/A N/A N/A field_value N/A getattr obj field_name N/A N/A N/A isinstance field_class N/A models FileField field_value N/A N/A N/A N/A field_value delete N/A auto_delete_files N/A N/A cls N/A N/A N/A Deletes all FileFields when model instances are deleted.

    Meant to be used on model classes.
    Django disabled auto-deletion of files when deleting a model in
    ticket #6456, to prevent dataloss.

     N/A N/A N/A pre_delete connect delete_files_for_obj sender cls N/A cls N/A get_next_url N/A N/A request N/A N/A N/A Given a request object, looks for the best possible next URL.

    Useful for e.g. redirects back to original page after a POST request.

     N/A N/A next N/A request POST N/A N/A url N/A N/A N/A request POST get next N/A N/A N/A next N/A request GET N/A N/A url N/A N/A N/A request GET get next N/A N/A url N/A N/A N/A request META get HTTP_REFERER N/A N/A N/A N/A settings DEBUG N/A N/A is_safe_url url N/A N/A N/A N/A Site objects get_current domain N/A N/A None N/A url N/A TruncationException N/A Exception N/A N/A N/A truncated_json_dumps N/A N/A obj max_length key ensure_ascii N/A False N/A N/A Dump an object to JSON, and ensure the dump is less than ``max_length``.

    The truncation will happen by truncating ``obj[key]``. If ``key`` is not
    long enough to achieve the goal, an exception will be thrown.

    If ``ensure_ascii`` is ``True``, the value returned will be only ASCII,
    even if that means representing Unicode characters as escape sequences. If
    ``False``, a Unicode string will be returned without escape sequences. The
    default is ``False``. This is the same as the ``ensure_ascii`` paramater on
    ``json.dumps``.
     N/A orig N/A N/A json dumps obj ensure_ascii ensure_ascii N/A diff N/A N/A len orig max_length N/A N/A diff 0 N/A N/A orig N/A dupe N/A N/A json loads orig N/A N/A N/A len N/A dupe N/A key diff N/A N/A N/A TruncationException Can't truncate enough to satisfy `max_length`. N/A N/A dupe N/A key N/A N/A dupe N/A key N/A N/A diff N/A N/A N/A json dumps dupe ensure_ascii ensure_ascii N/A user_or_ip N/A N/A key_prefix N/A N/A N/A Used for generating rate limiting keys. Returns a function to pass on
    to rate limit. The function return returns a key with IP address for
    anonymous users, and pks for authenticated users.

    Examples
        Anonymous: 'uip:<key_prefix>:127.0.0.1'
        Authenticated: 'uip:<key_prefix>:17859'
     _user_or_ip N/A N/A request N/A N/A N/A N/A N/A hasattr request user N/A N/A N/A request user is_authenticated N/A N/A key N/A str N/A N/A request user pk N/A N/A key N/A N/A N/A request META get HTTP_X_CLUSTER_CLIENT_IP N/A N/A request META N/A REMOTE_ADDR N/A N/A uip:%s:%s N/A key_prefix key N/A N/A _user_or_ip N/A uselocale N/A N/A locale N/A N/A N/A 
    Context manager for setting locale and returning to previous locale.

    This is useful for when doing translations for things run by
    celery workers or out of the HTTP request handling path. Example:

        with uselocale('xx'):
            subj = _('Subject of my email')
            msg = render_email(email_template, email_kwargs)
            mail.send_mail(subj, msg, ...)

    In Kitsune, you can get the right locale from Profile.locale and
    also request.LANGUAGE_CODE.

    If Kitsune is handling an HTTP request already, you don't have to
    run uselocale---the locale will already be set correctly.

     N/A currlocale N/A N/A translation get_language N/A N/A N/A translation activate locale N/A N/A N/A N/A N/A translation activate currlocale N/A contextmanager rabbitmq_queue_size N/A N/A N/A N/A N/A Returns the rabbitmq queue size.

    Two things to know about the queue size:

    1. It's not 100% accurate, but the size is generally near that
       number

    2. I can't think of a second thing, but that first thing is
       pretty important.

     celery current_app N/A app N/A N/A current_app _get_current_object N/A conn N/A N/A app connection N/A chan N/A conn default_channel N/A queue N/A N/A chan queue_declare celery passive True N/A N/A queue message_count N/A Progress N/A object N/A N/A A widget to show progress during interactive CLI scripts.

    Example:

        prog = Progress(100)
        prog.draw()
        for i in range(100):
            time.sleep(0.1)
            prog.tick()

    This will draw a progress indicator that looks like

        55/100 (Est 0 min. remaining)

    TODO
    * Improve the time estimation, it's quite bad.
    * Display a progress bar.
    * Use Blessings instead of manually moving the cursor around.
    * Dynamically pick time units.
    * Pick an approriate stride instead of a hard coded one.
        * Or pick a better stats method that doesn't use a stride.
     __init__ N/A N/A self total milestone_stride N/A 10 N/A N/A 
        :param total: The number of items the progress bar will expect.
        :param milestone_stide: Number of items between stats calculations.
            Default: 10
         N/A N/A self current 0 N/A N/A self total total N/A N/A self milestone_stride milestone_stride N/A N/A self milestone_time N/A N/A datetime now N/A N/A self estimated ? N/A tick N/A N/A self incr N/A 1 N/A N/A Advance the current progress, and redraw the screen.

        :param incr: Raise the current progress by this amount. Default: 1
         N/A N/A self current incr N/A N/A N/A self current N/A N/A N/A self current N/A self milestone_stride 0 N/A N/A now N/A N/A datetime now N/A duration N/A now N/A self milestone_time N/A duration N/A N/A duration seconds N/A N/A duration microseconds 1000000.0 N/A rate N/A N/A self milestone_stride duration N/A remaining N/A N/A self total N/A self current N/A N/A self estimated N/A int N/A N/A remaining rate 60 N/A N/A self milestone_time now N/A N/A N/A self draw N/A draw N/A N/A self N/A N/A N/A Just redraw the screen. N/A N/A N/A self _wr N/A N/A {0.current}/{0.total} (Est. {0.estimated} min. remaining)
 format self N/A _wr N/A N/A self s N/A N/A N/A N/A N/A N/A sys stdout write s N/A N/A N/A N/A sys stdout flush N/A N/A is_ratelimited N/A N/A request name rate method skip_if N/A N/A POST N/A N/A N/A r N/A False N/A N/A 
    Reimplement ``ratelimit.helpers.is_ratelimited``, with sumo-specific details:

    * Always check for the bypass rate limit permission.
    * Log times when users are rate limited.
    * Always uses ``user_or_ip`` for the rate limit key.
     N/A N/A N/A skip_if request N/A N/A N/A request user has_perm sumo.bypass_ratelimit N/A N/A N/A request limited False N/A N/A N/A N/A N/A ratelimit helpers is_ratelimited request increment True ip False rate rate keys N/A user_or_ip name N/A N/A request limited N/A N/A N/A N/A hasattr request user N/A N/A N/A request user is_authenticated N/A N/A key N/A N/A user "{}" format N/A N/A request user username N/A N/A ip N/A N/A N/A request META get HTTP_X_CLUSTER_CLIENT_IP N/A N/A request META N/A REMOTE_ADDR N/A key N/A N/A anonymous user ({}) format ip N/A N/A N/A N/A Record objects info sumo.ratelimit {key} hit the rate limit for {name} key key name name N/A N/A request limited N/A get_browser N/A N/A user_agent N/A N/A N/A Get Browser Name from User Agent N/A match N/A N/A re search (?i)(firefox|msie|chrome|safari|trident) user_agent N/A re IGNORECASE N/A match N/A N/A browser N/A N/A match group 1 N/A N/A browser None N/A browser N/A