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,28 +1,38 @@
# See https://zulip.readthedocs.io/en/latest/subsystems/caching.html for docs
from typing import Any, Callable, Dict, List, Tuple
import datetime
import logging
from importlib import import_module
from typing import Any, Callable, Dict, List, Tuple
from django.conf import settings
from django.contrib.sessions.models import Session
from django.db.models import Q
from django.utils.timezone import now as timezone_now
# This file needs to be different from cache.py because cache.py
# cannot import anything from zerver.models or we'd have an import
# loop
from analytics.models import RealmCount
from django.conf import settings
from zerver.models import Message, UserProfile, Stream, get_stream_cache_key, \
Client, get_client_cache_key, \
Huddle, huddle_hash_cache_key
from zerver.lib.cache import \
user_profile_by_api_key_cache_key, \
user_profile_cache_key, get_remote_cache_time, get_remote_cache_requests, \
cache_set_many, to_dict_cache_key_id
from zerver.lib.cache import (
cache_set_many,
get_remote_cache_requests,
get_remote_cache_time,
to_dict_cache_key_id,
user_profile_by_api_key_cache_key,
user_profile_cache_key,
)
from zerver.lib.message import MessageDict
from zerver.lib.users import get_all_api_keys
from importlib import import_module
from django.contrib.sessions.models import Session
from django.db.models import Q
from django.utils.timezone import now as timezone_now
from zerver.models import (
Client,
Huddle,
Message,
Stream,
UserProfile,
get_client_cache_key,
get_stream_cache_key,
huddle_hash_cache_key,
)
MESSAGE_CACHE_SIZE = 75000