Used isort to sort imports. Also added to the git pre-commit hook.
authorScott <[email protected]>
Wed, 2 Feb 2022 20:13:27 +0000 (12:13 -0800)
committerScott <[email protected]>
Wed, 2 Feb 2022 20:13:27 +0000 (12:13 -0800)
31 files changed:
acl.py
ansi.py
argparse_utils.py
arper.py
base_presence.py
bootstrap.py
camera_utils.py
decorator_utils.py
exec_utils.py
executors.py
file_utils.py
function_utils.py
google_assistant.py
input_utils.py
lockfile.py
logging_utils.py
logical_search.py
math_utils.py
orb_utils.py
parallelize.py
persistent.py
profanity_filter.py
remote_worker.py
requirements.txt
site_config.py
smart_future.py
state_tracker.py
string_utils.py
text_utils.py
unittest_utils.py
waitable_presence.py

diff --git a/acl.py b/acl.py
index 0692a045308a4a3a30b3ff6af67047a1572dc4dc..a936339a0dcb715db02327125c9f5b54e9b100d3 100644 (file)
--- a/acl.py
+++ b/acl.py
@@ -1,11 +1,11 @@
 #!/usr/bin/env python3
 
-from abc import ABC, abstractmethod
 import enum
 import fnmatch
 import logging
 import re
-from typing import Any, Callable, List, Optional, Set, Sequence
+from abc import ABC, abstractmethod
+from typing import Any, Callable, List, Optional, Sequence, Set
 
 from overrides import overrides
 
diff --git a/ansi.py b/ansi.py
index 6897291ba252f91c866b967cd18e0aa13f0f151d..c13e3522fe187efad36ae73de6d174ee76c4b2aa 100755 (executable)
--- a/ansi.py
+++ b/ansi.py
@@ -1,11 +1,11 @@
 #!/usr/bin/env python3
 
-from abc import abstractmethod
 import difflib
 import io
 import logging
 import re
 import sys
+from abc import abstractmethod
 from typing import Any, Callable, Dict, Iterable, Optional, Tuple
 
 from overrides import overrides
index 43536e460b7b4cc238c09d263bd36ae2b3b8f88e..5a270f6ef22c1845be1bd6c59ab7fde1cb4cfe21 100644 (file)
@@ -8,7 +8,6 @@ from typing import Any
 
 from overrides import overrides
 
-
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
 
index ca5d1d5fa59c6ad75bb811f0664c90e798a4745d..ff1168ea4ef30b6f0ca16f5411e188b113548a0d 100644 (file)
--- a/arper.py
+++ b/arper.py
@@ -6,19 +6,19 @@
 import datetime
 import logging
 import os
-from typing import Any, Optional
 import warnings
+from typing import Any, Optional
 
 from overrides import overrides
 
 import argparse_utils
-from collect.bidict import BiDict
 import config
 import exec_utils
 import file_utils
 import persistent
-import string_utils
 import site_config
+import string_utils
+from collect.bidict import BiDict
 
 logger = logging.getLogger(__name__)
 
index 3ceddb32dff9ab1bf2a17d2b3aa5547125ded2d9..ad852f9f7ebce82d5a76c6d7f1436a78670489e7 100755 (executable)
@@ -1,20 +1,19 @@
 #!/usr/bin/env python3
 
 import datetime
-from collections import defaultdict
 import logging
 import re
-from typing import Dict, List, Optional, Set
 import warnings
+from collections import defaultdict
+from typing import Dict, List, Optional, Set
 
 # Note: this module is fairly early loaded.  Be aware of dependencies.
 import argparse_utils
 import bootstrap
 import config
+import site_config
 from type.locations import Location
 from type.people import Person
-import site_config
-
 
 logger = logging.getLogger(__name__)
 
index 98da78cf6c1755c5fc3f5e42379e8d900abb10b7..035a38eca691ca7255a4ee4bda0eee6da0813119 100644 (file)
@@ -1,19 +1,20 @@
 #!/usr/bin/env python3
 
 import functools
+import importlib
 import logging
 import os
-import importlib
+import sys
 from inspect import stack
 from typing import List
-import sys
+
+import config
+import logging_utils
+from argparse_utils import ActionNoYes
 
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
 
-from argparse_utils import ActionNoYes
-import config
-import logging_utils
 
 logger = logging.getLogger(__name__)
 
index d2c50ddf314d96402f885c10c6c79081569ca2c1..9e7efd6dfccbd7df2d1eb8bd13eb8075a6bfe4f1 100644 (file)
@@ -5,8 +5,8 @@
 import logging
 import platform
 import subprocess
-from typing import NamedTuple, Optional
 import warnings
+from typing import NamedTuple, Optional
 
 import cv2  # type: ignore
 import numpy as np
index cd69639448425ce3a47073c7e423ea98d6704b2b..a5c5afecb34c005d16a351cc703f44dc561b567d 100644 (file)
@@ -14,14 +14,13 @@ import sys
 import threading
 import time
 import traceback
-from typing import Any, Callable, Optional
 import warnings
+from typing import Any, Callable, Optional
 
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
 import exceptions
 
-
 logger = logging.getLogger(__name__)
 
 
index 061370ff012a543c29f75f32b4996eaee3dbf0f8..df273352bb793d59f19717c9cb6806134dd5a628 100644 (file)
@@ -9,7 +9,6 @@ import subprocess
 import sys
 from typing import List, Optional
 
-
 logger = logging.getLogger(__file__)
 
 
index 990df03f19af253773c72e23eac201a9163e2931..34528a33c2d10236cd7527fe53ffd027fa8020ca 100644 (file)
@@ -2,33 +2,32 @@
 
 from __future__ import annotations
 
-from abc import ABC, abstractmethod
 import concurrent.futures as fut
-from collections import defaultdict
-from dataclasses import dataclass
 import logging
-import numpy
 import os
 import platform
 import random
 import subprocess
 import threading
 import time
-from typing import Any, Callable, Dict, List, Optional, Set
 import warnings
+from abc import ABC, abstractmethod
+from collections import defaultdict
+from dataclasses import dataclass
+from typing import Any, Callable, Dict, List, Optional, Set
 
 import cloudpickle  # type: ignore
+import numpy
 from overrides import overrides
 
-from ansi import bg, fg, underline, reset
 import argparse_utils
 import config
-from decorator_utils import singleton
-from exec_utils import run_silently, cmd_in_background, cmd_with_timeout
 import histogram as hist
+from ansi import bg, fg, reset, underline
+from decorator_utils import singleton
+from exec_utils import cmd_in_background, cmd_with_timeout, run_silently
 from thread_utils import background_thread
 
-
 logger = logging.getLogger(__name__)
 
 parser = config.add_commandline_args(
index f273ea4f9a5fe08da8c1f15e3108c65b7c33d0ea..905e23b16df017d3cab6c6ef27ce61ee8596c112 100644 (file)
@@ -4,20 +4,18 @@
 
 import datetime
 import errno
+import glob
 import hashlib
+import io
 import logging
 import os
-import io
 import pathlib
 import re
 import time
-from typing import Optional
-import glob
-from os.path import isfile, join, exists
-from typing import List, TextIO
+from os.path import exists, isfile, join
+from typing import List, Optional, TextIO
 from uuid import uuid4
 
-
 logger = logging.getLogger(__name__)
 
 
index f027f8ce9d07fd22c7d18af2cccc0f92413115d9..3c8e4ae10f4f493edb22c35ad3758442b4f224dd 100644 (file)
@@ -18,6 +18,7 @@ def function_identifier(f: Callable) -> str:
     """
     if f.__module__ == '__main__':
         from pathlib import Path
+
         import __main__
 
         module = __main__.__file__
index 0af4fa9271df3bf2e6de6f3571cfa6c2eb6d1f23..ec5f6a4c85e17ed0fb2eaaf4f2f22d8ee2ebf300 100644 (file)
@@ -2,8 +2,8 @@
 
 import logging
 import sys
-from typing import NamedTuple, Optional
 import warnings
+from typing import NamedTuple, Optional
 
 import requests
 import speech_recognition as sr  # type: ignore
index e0b457d5a0e73ffc43d3d83ff09228328e6a641e..a166d7a4169e56937e8bb63c4398aff1abc52564 100644 (file)
@@ -11,7 +11,6 @@ import readchar  # type: ignore
 
 import exceptions
 
-
 logger = logging.getLogger(__file__)
 
 
@@ -52,9 +51,7 @@ def single_keystroke_response(
         print(prompt, end="")
         sys.stdout.flush()
     try:
-        response = _single_keystroke_response_internal(
-            valid_responses, timeout_seconds
-        )
+        response = _single_keystroke_response_internal(valid_responses, timeout_seconds)
         if ord(response) == 3:
             raise KeyboardInterrupt('User pressed ^C in input_utils.')
 
index 03fbb9ef73a1449ffd8779a85ffe4ba885d193f6..38134b20d02f00f8d419b5ddfef669c5002a4abf 100644 (file)
@@ -1,20 +1,19 @@
 #!/usr/bin/env python3
 
-from dataclasses import dataclass
 import datetime
 import json
 import logging
 import os
 import signal
 import sys
-from typing import Optional
 import warnings
+from dataclasses import dataclass
+from typing import Optional
 
 import config
 import datetime_utils
 import decorator_utils
 
-
 cfg = config.add_commandline_args(f'Lockfile ({__file__})', 'Args related to lockfiles')
 cfg.add_argument(
     '--lockfile_held_duration_warning_threshold_sec',
index a16a31b43c6e88fd84c850cab851ce90d58049e2..fdbb7a3d48daecb4e3b81ed4aad4bf0e11a79241 100644 (file)
@@ -8,15 +8,15 @@ import datetime
 import enum
 import io
 import logging
-from logging.config import fileConfig
-from logging.handlers import RotatingFileHandler, SysLogHandler
 import os
 import random
 import sys
+from logging.config import fileConfig
+from logging.handlers import RotatingFileHandler, SysLogHandler
 from typing import Any, Callable, Dict, Iterable, List, Mapping, Optional
 
-from overrides import overrides
 import pytz
+from overrides import overrides
 
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
index c324ff850895bb94ee29d84448c4449ad5fe1727..4295aa0892fd0a67e8af778aa92f92a30d58e436 100644 (file)
@@ -2,20 +2,10 @@
 
 from __future__ import annotations
 
-from collections import defaultdict
 import enum
 import sys
-from typing import (
-    Any,
-    Dict,
-    List,
-    NamedTuple,
-    Optional,
-    Set,
-    Sequence,
-    Tuple,
-    Union,
-)
+from collections import defaultdict
+from typing import Any, Dict, List, NamedTuple, Optional, Sequence, Set, Tuple, Union
 
 
 class ParseError(Exception):
index 3216d4a9222f3e9760d2f5276b40503e08cfee8f..3953ae585d249123c17e82f4a829ad68cf442c0b 100644 (file)
@@ -2,8 +2,8 @@
 
 import functools
 import math
+from heapq import heappop, heappush
 from typing import List
-from heapq import heappush, heappop
 
 
 class RunningMedian(object):
index fe82e2ebfc97c0cf8ec8f965b5fc51746d6e0879..6a12b6f7b1970e92d0697b3633ac35db72895555 100644 (file)
@@ -6,7 +6,6 @@ import os
 
 import config
 
-
 parser = config.add_commandline_args(
     f"Orb Utils ({__file__})",
     "Args having to do with controlling Scott's Orb.",
index cd3eff4e9c539c25d7d5cf3deb52a494bd2bd0f0..f2cfcbb144fbbff5620b4fea081b1493c8cabdcd 100644 (file)
@@ -4,9 +4,9 @@
 
 
 import atexit
-from enum import Enum
 import functools
 import typing
+from enum import Enum
 
 
 class Method(Enum):
index 1e520bedd9ba0816692c5687114a1b106f3440d2..8832572e7b032ae71a7898ca6b21743cf7ce45bf 100644 (file)
@@ -1,11 +1,11 @@
 #!/usr/bin/env python3
 
-from abc import ABC, abstractmethod
 import atexit
 import datetime
 import enum
 import functools
 import logging
+from abc import ABC, abstractmethod
 from typing import Any
 
 import file_utils
index 22de26395bcf188a3300ecfdeec193246d233ded..e227165ba19a2b258847a9e8b86f9adc87de8fb5 100755 (executable)
@@ -12,7 +12,6 @@ from nltk.stem import PorterStemmer
 import decorator_utils
 import string_utils
 
-
 logger = logging.getLogger(__name__)
 
 
index 12a5028c30e2bf95093542296bb1cf5a9866f879..82b80ea3d722090ab7254eb24eac5884a9520172 100755 (executable)
@@ -7,8 +7,8 @@ results.
 import logging
 import os
 import signal
-import threading
 import sys
+import threading
 import time
 from typing import Optional
 
@@ -21,7 +21,6 @@ import config
 from stopwatch import Timer
 from thread_utils import background_thread
 
-
 logger = logging.getLogger(__file__)
 
 cfg = config.add_commandline_args(
index 04d3ee71a261d2c90b45249da5713a8f3d745da5..2302354023aeb3f2fff7349ff16e5c186e5fedce 100644 (file)
@@ -1,9 +1,12 @@
 aiohttp
 antlr4 - python3 - runtime
 bitstring
+black
 cloudpickle
 coverage
+flake8
 holidays
+mypy
 nltk
 numpy
 opencv - python
index b09e735c79c8f92665438b2c064f9ccf652d33bd..233589970ea2058b2768de16ec649602eda2be2f 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
 
-from dataclasses import dataclass
 import logging
 import platform
+from dataclasses import dataclass
 from typing import Callable
 
 # Note: this module is fairly early loaded.  Be aware of dependencies.
index 1f6e6f0aedcf05966e536ec8f10f570c2175a3e4..460dcb95862a9a88ecafde45fa8886dbcbb9eaa1 100644 (file)
@@ -1,6 +1,7 @@
 #!/usr/bin/env python3
 
 from __future__ import annotations
+
 import concurrent
 import concurrent.futures as fut
 import logging
@@ -9,10 +10,11 @@ from typing import Callable, List, Set, TypeVar
 
 from overrides import overrides
 
+import id_generator
+
 # This module is commonly used by others in here and should avoid
 # taking any unnecessary dependencies back on them.
 from deferred_operand import DeferredOperand
-import id_generator
 
 logger = logging.getLogger(__name__)
 
index 453faf7b1972d8f4f1b3250bfdd353150e682503..12b94aec39c37b084495d92bbc07b386d0574610 100644 (file)
@@ -1,10 +1,10 @@
 #!/usr/bin/env python3
 
-from abc import ABC, abstractmethod
 import datetime
 import logging
-import time
 import threading
+import time
+from abc import ABC, abstractmethod
 from typing import Dict, Optional
 
 import pytz
index 9a204660432693032c6dfef79722714d1e133a65..55e67313253d650116a4fab3c9902420fb277a3c 100644 (file)
@@ -30,26 +30,17 @@ import base64
 import contextlib  # type: ignore
 import datetime
 import io
-from itertools import zip_longest
 import json
 import logging
 import numbers
 import random
 import re
 import string
-from typing import (
-    Any,
-    Callable,
-    Dict,
-    Iterable,
-    List,
-    Optional,
-    Sequence,
-    Tuple,
-)
 import unicodedata
-from uuid import uuid4
 import warnings
+from itertools import zip_longest
+from typing import Any, Callable, Dict, Iterable, List, Optional, Sequence, Tuple
+from uuid import uuid4
 
 import list_utils
 
index 0d07905be78daeb273995a0b5e131722e6e344d5..534813c2ef28e186b0adb71ed22b3b1d7cbe4c98 100644 (file)
@@ -2,15 +2,14 @@
 
 """Utilities for dealing with "text"."""
 
-from collections import defaultdict
 import logging
 import math
 import sys
+from collections import defaultdict
 from typing import Dict, Generator, List, NamedTuple, Optional
 
 from ansi import fg, reset
 
-
 logger = logging.getLogger(__file__)
 
 
index 81b339ae3485d05e6f76248aa8fbeb70f52ef2a3..ba9ca28f091bc70bd232cb6f059116cfc70d7fb9 100644 (file)
@@ -7,7 +7,6 @@
    caveat emptor.
 """
 
-from abc import ABC, abstractmethod
 import contextlib
 import functools
 import inspect
@@ -16,20 +15,20 @@ import os
 import pickle
 import random
 import statistics
-import time
 import tempfile
-from typing import Any, Callable, Dict, List, Optional
+import time
 import unittest
 import warnings
+from abc import ABC, abstractmethod
+from typing import Any, Callable, Dict, List, Optional
+
+import sqlalchemy as sa
 
 import bootstrap
 import config
 import function_utils
 import scott_secrets
 
-import sqlalchemy as sa
-
-
 logger = logging.getLogger(__name__)
 cfg = config.add_commandline_args(
     f'Logging ({__file__})', 'Args related to function decorators'
index 77b6e817198f47e23f87b2af71f353c1eec0488a..8046bdc31f988472900905665a2ef1dcd6dc5102 100644 (file)
@@ -13,9 +13,9 @@ from typing import Optional, Tuple
 from overrides import overrides
 
 import base_presence
-from type.locations import Location
 import site_config
 import state_tracker
+from type.locations import Location
 
 logger = logging.getLogger(__name__)