diff --git a/src/CreeDictionary/API/schema.py b/src/CreeDictionary/API/schema.py index 05f03baaa..cbfeaaa35 100644 --- a/src/CreeDictionary/API/schema.py +++ b/src/CreeDictionary/API/schema.py @@ -1,6 +1,7 @@ """ this file contains `TypedDict` classes that effectively serves as json schema for serialized objects """ + from typing import List, Optional, Sequence, Tuple, Union from typing_extensions import Literal, TypedDict diff --git a/src/CreeDictionary/API/search/espt.py b/src/CreeDictionary/API/search/espt.py index 1c0b937f7..cb596cb31 100644 --- a/src/CreeDictionary/API/search/espt.py +++ b/src/CreeDictionary/API/search/espt.py @@ -1,6 +1,7 @@ """ ESPT: English simple phrase translation """ + import logging import re from dataclasses import dataclass diff --git a/src/CreeDictionary/API/search/espt_crk.py b/src/CreeDictionary/API/search/espt_crk.py index 874255557..41dcaec3b 100644 --- a/src/CreeDictionary/API/search/espt_crk.py +++ b/src/CreeDictionary/API/search/espt_crk.py @@ -1,6 +1,7 @@ """ Cree-specific data for English Inflected Phrase search """ + from morphodict.analysis.tag_map import TagMap # tags needed for FST generator diff --git a/src/CreeDictionary/API/search/presentation.py b/src/CreeDictionary/API/search/presentation.py index 50acf2aef..ead4d238b 100644 --- a/src/CreeDictionary/API/search/presentation.py +++ b/src/CreeDictionary/API/search/presentation.py @@ -523,9 +523,11 @@ def get_lexical_info( text=reduplication_string, definitions=[ { - "text": "Strong reduplication: intermittent, repeatedly, iteratively; again and again; here and there" - if tag == "RdplS+" - else "Weak Reduplication: ongoing, continuing" + "text": ( + "Strong reduplication: intermittent, repeatedly, iteratively; again and again; here and there" + if tag == "RdplS+" + else "Weak Reduplication: ongoing, continuing" + ) } ], ).serialize() diff --git a/src/CreeDictionary/API/search/types.py b/src/CreeDictionary/API/search/types.py index 81b6a37e7..616e28b52 100644 --- a/src/CreeDictionary/API/search/types.py +++ b/src/CreeDictionary/API/search/types.py @@ -25,14 +25,12 @@ class LinguisticTag(Protocol): """ @property - def value(self) -> FSTTag: - ... + def value(self) -> FSTTag: ... # TODO: linguistic feature @property - def in_plain_english(self) -> str: - ... + def in_plain_english(self) -> str: ... def serialize(self) -> SerializedLinguisticTag: return SerializedLinguisticTag( diff --git a/src/CreeDictionary/CreeDictionary/migrations/0001_insert_bibliographic_data.py b/src/CreeDictionary/CreeDictionary/migrations/0001_insert_bibliographic_data.py index 56f3a213c..c365d3b7f 100644 --- a/src/CreeDictionary/CreeDictionary/migrations/0001_insert_bibliographic_data.py +++ b/src/CreeDictionary/CreeDictionary/migrations/0001_insert_bibliographic_data.py @@ -1,6 +1,7 @@ """ Stub for data migration that used to add data to a table that no longer exists. """ + from django.db import migrations diff --git a/src/CreeDictionary/CreeDictionary/migrations/0003_add_wordform_paradigms.py b/src/CreeDictionary/CreeDictionary/migrations/0003_add_wordform_paradigms.py index 5427da01c..3f07209d8 100644 --- a/src/CreeDictionary/CreeDictionary/migrations/0003_add_wordform_paradigms.py +++ b/src/CreeDictionary/CreeDictionary/migrations/0003_add_wordform_paradigms.py @@ -1,6 +1,7 @@ """ Stub for data migration that used to add data to a table that no longer exists. """ + from django.db import migrations diff --git a/src/CreeDictionary/CreeDictionary/paradigm/manager.py b/src/CreeDictionary/CreeDictionary/paradigm/manager.py index ca65229c2..c385b89b2 100644 --- a/src/CreeDictionary/CreeDictionary/paradigm/manager.py +++ b/src/CreeDictionary/CreeDictionary/paradigm/manager.py @@ -285,5 +285,4 @@ class Transducer(Protocol): the paradigm manager actually uses. """ - def bulk_lookup(self, strings: Iterable[str]) -> dict[str, set[str]]: - ... + def bulk_lookup(self, strings: Iterable[str]) -> dict[str, set[str]]: ... diff --git a/src/CreeDictionary/CreeDictionary/paradigm/test_panes.py b/src/CreeDictionary/CreeDictionary/paradigm/test_panes.py index 4fb661535..1a2768755 100644 --- a/src/CreeDictionary/CreeDictionary/paradigm/test_panes.py +++ b/src/CreeDictionary/CreeDictionary/paradigm/test_panes.py @@ -1,6 +1,7 @@ """ Unit tests for the paradigm pane module. """ + import pytest from more_itertools import first, ilen, last, one diff --git a/src/CreeDictionary/CreeDictionary/templatetags/creedictionary_extras.py b/src/CreeDictionary/CreeDictionary/templatetags/creedictionary_extras.py index 53e402b53..2c1ed7592 100644 --- a/src/CreeDictionary/CreeDictionary/templatetags/creedictionary_extras.py +++ b/src/CreeDictionary/CreeDictionary/templatetags/creedictionary_extras.py @@ -1,6 +1,7 @@ """ Template tags related to the Cree Dictionary specifically. """ + from urllib.parse import quote from weakref import WeakKeyDictionary diff --git a/src/CreeDictionary/cvd/definition_keys.py b/src/CreeDictionary/cvd/definition_keys.py index 6b0d46ff9..a9c1c5f95 100644 --- a/src/CreeDictionary/cvd/definition_keys.py +++ b/src/CreeDictionary/cvd/definition_keys.py @@ -8,7 +8,6 @@ 2. Also refer unambiguously to a single wordform. """ - import json import logging from typing import TypedDict, cast, Optional diff --git a/src/CreeDictionary/morphodict/orthography.py b/src/CreeDictionary/morphodict/orthography.py index a002eb2fc..498eb4db2 100644 --- a/src/CreeDictionary/morphodict/orthography.py +++ b/src/CreeDictionary/morphodict/orthography.py @@ -1,6 +1,7 @@ """ Handling of the writing system of the language. """ + import logging from importlib import import_module from typing import Callable, Set diff --git a/src/CreeDictionary/tests/CreeDictionary_tests/test_context_processors.py b/src/CreeDictionary/tests/CreeDictionary_tests/test_context_processors.py index 8c0ee7f2c..fec6f914e 100644 --- a/src/CreeDictionary/tests/CreeDictionary_tests/test_context_processors.py +++ b/src/CreeDictionary/tests/CreeDictionary_tests/test_context_processors.py @@ -2,7 +2,6 @@ Test Django template context processors. """ - import pytest from django.http import HttpRequest from django.template import RequestContext, Template diff --git a/src/CreeDictionary/utils/profiling.py b/src/CreeDictionary/utils/profiling.py index 552cba801..d99c4eed3 100644 --- a/src/CreeDictionary/utils/profiling.py +++ b/src/CreeDictionary/utils/profiling.py @@ -1,4 +1,5 @@ """measure and report function execution time""" + import time from functools import wraps from typing import Any, Callable diff --git a/src/CreeDictionary/utils/shared_res_dir.py b/src/CreeDictionary/utils/shared_res_dir.py index 16c9c7061..d7dbd6c67 100644 --- a/src/CreeDictionary/utils/shared_res_dir.py +++ b/src/CreeDictionary/utils/shared_res_dir.py @@ -1,6 +1,7 @@ """ Gives the path to the shared resources ("res") folder. """ + from pathlib import Path shared_res_dir: Path = Path(__file__).parent.parent / "res" diff --git a/src/CreeDictionary/utils/types.py b/src/CreeDictionary/utils/types.py index 01bb913f0..18458b0a1 100644 --- a/src/CreeDictionary/utils/types.py +++ b/src/CreeDictionary/utils/types.py @@ -14,8 +14,7 @@ class HashableNamedTupleFieldValue(Protocol): - def __hash__(self): - ... + def __hash__(self): ... T = TypeVar("T") diff --git a/src/crkeng/app/integration_tests/test_render_paradigm.py b/src/crkeng/app/integration_tests/test_render_paradigm.py index dbd44c556..f7b58ba2c 100644 --- a/src/crkeng/app/integration_tests/test_render_paradigm.py +++ b/src/crkeng/app/integration_tests/test_render_paradigm.py @@ -1,6 +1,7 @@ """ Test paradigm generation for the itwêwina (crkeng) dictionary. """ + from more_itertools import first from CreeDictionary.CreeDictionary.paradigm.generation import default_paradigm_manager diff --git a/src/crkeng/app/preferences.py b/src/crkeng/app/preferences.py index 74e688f7d..715d586e7 100644 --- a/src/crkeng/app/preferences.py +++ b/src/crkeng/app/preferences.py @@ -1,6 +1,7 @@ """ Preferences used in itwêwina, the Cree Intelligent Dictionary. """ + from django.conf import settings from morphodict.preference import register_preference, Preference diff --git a/src/morphodict/preference/__init__.py b/src/morphodict/preference/__init__.py index ef53eeea3..9a1a52f7f 100644 --- a/src/morphodict/preference/__init__.py +++ b/src/morphodict/preference/__init__.py @@ -3,6 +3,7 @@ Allows for generic site-wide preferences stored in cookies. """ + from __future__ import annotations from dataclasses import dataclass diff --git a/src/morphodict/preference/urls.py b/src/morphodict/preference/urls.py index 619102c95..066f612bd 100644 --- a/src/morphodict/preference/urls.py +++ b/src/morphodict/preference/urls.py @@ -10,6 +10,7 @@ path("preferences", include("morphodict.preference.urls")), ] """ + from django.urls import path from . import views diff --git a/src/morphodict/runserver/mobile_run_handler.py b/src/morphodict/runserver/mobile_run_handler.py index 6dce275d7..0739bc677 100644 --- a/src/morphodict/runserver/mobile_run_handler.py +++ b/src/morphodict/runserver/mobile_run_handler.py @@ -31,7 +31,6 @@ foreground again. """ - import socketserver from threading import Condition, Lock from typing import Optional diff --git a/src/morphodict/site/base_dir_setup.py b/src/morphodict/site/base_dir_setup.py index bd9446d7b..f5bda06b5 100644 --- a/src/morphodict/site/base_dir_setup.py +++ b/src/morphodict/site/base_dir_setup.py @@ -4,6 +4,7 @@ from. The current workaround to pass that is to store the base dir here in a variable that can only be set once. """ + from pathlib import Path from typing import Optional