python: Sort imports with isort.

Fixes #2665.

Regenerated by tabbott with `lint --fix` after a rebase and change in
parameters.

Note from tabbott: In a few cases, this converts technical debt in the
form of unsorted imports into different technical debt in the form of
our largest files having very long, ugly import sequences at the
start.  I expect this change will increase pressure for us to split
those files, which isn't a bad thing.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-06-10 15:54:34 -07:00
committed by Tim Abbott
parent b666aef2d3
commit 365fe0b3d5
528 changed files with 4801 additions and 3806 deletions

View File

@@ -1,35 +1,36 @@
from typing import Any, List, Dict, Optional, Tuple
import calendar
import logging
import time
from typing import Any, Dict, List, Optional, Tuple
from django.conf import settings
from django.urls import reverse
from django.http import HttpResponseRedirect, HttpResponse, HttpRequest
from django.http import HttpRequest, HttpResponse, HttpResponseRedirect
from django.shortcuts import redirect, render
from django.urls import reverse
from django.utils import translation
from django.utils.cache import patch_cache_control
from two_factor.utils import default_device
from zerver.decorator import zulip_login_required
from zerver.forms import ToSForm
from zerver.models import Message, Stream, UserProfile, \
Realm, PreregistrationUser
from zerver.lib.actions import do_change_tos_version, realm_user_count
from zerver.lib.events import do_events_register
from zerver.lib.actions import do_change_tos_version, \
realm_user_count
from zerver.lib.i18n import get_language_list, get_language_name, \
get_language_list_for_templates, get_language_translation_data
from zerver.lib.i18n import (
get_language_list,
get_language_list_for_templates,
get_language_name,
get_language_translation_data,
)
from zerver.lib.push_notifications import num_push_devices_for_user
from zerver.lib.streams import access_stream_by_name
from zerver.lib.subdomains import get_subdomain
from zerver.lib.users import compute_show_invites_and_add_streams
from zerver.lib.utils import statsd, generate_random_token
from zerver.views.compatibility import is_outdated_desktop_app, \
is_unsupported_browser
from zerver.lib.utils import generate_random_token, statsd
from zerver.models import Message, PreregistrationUser, Realm, Stream, UserProfile
from zerver.views.compatibility import is_outdated_desktop_app, is_unsupported_browser
from zerver.views.messages import get_latest_update_message_flag_activity
from zerver.views.portico import hello_view
from two_factor.utils import default_device
import calendar
import logging
import time
def need_accept_tos(user_profile: Optional[UserProfile]) -> bool:
if user_profile is None: # nocoverage