treewide: fix 'ruff check' errors
This is mostly about unused imports. A couple errors remain, but are fine in my book (using `l` as a variable name, assigning a lambda to a variable).
This commit is contained in:
parent
8618c81b2f
commit
f9fc9fbd6b
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from fractions import Fraction
|
from fractions import Fraction
|
||||||
from typing import Dict, List, NamedTuple, Optional
|
from typing import List, NamedTuple, Optional
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
|
||||||
from copy import deepcopy
|
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import List, NamedTuple
|
from typing import List, NamedTuple
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Callable, List, NamedTuple
|
from typing import List, NamedTuple
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Callable, List, NamedTuple
|
from typing import List, NamedTuple
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Callable, List, NamedTuple
|
from typing import List, NamedTuple
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -4,7 +4,6 @@ import sys
|
||||||
from cmath import phase
|
from cmath import phase
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
from math import gcd, pi
|
from math import gcd, pi
|
||||||
from pprint import pprint
|
|
||||||
from typing import NamedTuple, Set, Tuple
|
from typing import NamedTuple, Set, Tuple
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Dict, Iterable, List, NamedTuple, Tuple, TypeVar
|
from typing import Iterable, List, NamedTuple, Tuple, TypeVar
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Dict, Iterable, List, NamedTuple, Tuple, TypeVar
|
from typing import Iterable, List, NamedTuple, Tuple, TypeVar
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from functools import reduce
|
from functools import reduce
|
||||||
from itertools import chain, cycle
|
|
||||||
from typing import Iterable, List
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|
|
@ -4,7 +4,7 @@ import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from enum import IntEnum
|
from enum import IntEnum
|
||||||
from typing import Iterator, List, NamedTuple, Tuple
|
from typing import List, NamedTuple
|
||||||
|
|
||||||
|
|
||||||
class ParameterMode(IntEnum):
|
class ParameterMode(IntEnum):
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
|
||||||
from copy import deepcopy
|
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Dict, List, Set, Tuple
|
from typing import Dict, List, Set, Tuple
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Callable, Dict, List
|
from typing import List
|
||||||
|
|
||||||
"""
|
"""
|
||||||
E : T [ * T ]*
|
E : T [ * T ]*
|
||||||
|
|
|
@ -5,7 +5,6 @@ import itertools
|
||||||
import math
|
import math
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from copy import deepcopy
|
|
||||||
from typing import Dict, Iterator, List, Set, Tuple
|
from typing import Dict, Iterator, List, Set, Tuple
|
||||||
|
|
||||||
Tile = List[List[str]]
|
Tile = List[List[str]]
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from typing import List, Tuple
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
def solve(circle: List[int]) -> int:
|
def solve(circle: List[int]) -> int:
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from typing import List, Tuple
|
from typing import List
|
||||||
|
|
||||||
|
|
||||||
def solve(circle: List[int]) -> int:
|
def solve(circle: List[int]) -> int:
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from copy import deepcopy
|
|
||||||
from typing import Dict, Iterator, List, Tuple
|
from typing import Dict, Iterator, List, Tuple
|
||||||
|
|
||||||
Offset = Tuple[int, int]
|
Offset = Tuple[int, int]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Iterator, List, TypeVar
|
from typing import Iterator, List, TypeVar
|
||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from dataclasses import dataclass
|
|
||||||
from typing import Iterator, List, TypeVar
|
from typing import Iterator, List, TypeVar
|
||||||
|
|
||||||
T = TypeVar("T")
|
T = TypeVar("T")
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from math import ceil, floor
|
from math import ceil, floor
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Dict, List, Set
|
from typing import Dict, List, Set
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, Tuple
|
from typing import Iterator, List, Tuple
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, Tuple
|
from typing import Iterator, List, Tuple
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import List, Optional, cast
|
from typing import List, Optional, cast
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, Optional
|
from typing import Iterator, List, Optional
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
|
||||||
from typing import Iterator, List, Set, Tuple
|
from typing import Iterator, List, Set, Tuple
|
||||||
|
|
||||||
Grid = List[List[int]]
|
Grid = List[List[int]]
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
|
||||||
from typing import Iterator, List, Set, Tuple
|
from typing import Iterator, List, Set, Tuple
|
||||||
|
|
||||||
Grid = List[List[int]]
|
Grid = List[List[int]]
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Dict, List, Set
|
from typing import Dict, List, Set
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from typing import Dict, List, Set
|
from typing import Dict, List, Set
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import heapq
|
import heapq
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Set, Tuple
|
from typing import Iterator, List, NamedTuple, Set
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import heapq
|
import heapq
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Set, Tuple
|
from typing import Iterator, List, NamedTuple, Set
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -5,7 +5,7 @@ import functools
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Iterable, Iterator, List, Tuple, TypeVar
|
from typing import Iterable, Iterator, List, Tuple
|
||||||
|
|
||||||
RawPacket = List[bool]
|
RawPacket = List[bool]
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import itertools
|
||||||
import math
|
import math
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from typing import Callable, Dict, Iterable, Iterator, List, Tuple, TypeVar
|
from typing import Callable, Dict, Iterable, Iterator, List, Tuple
|
||||||
|
|
||||||
RawPacket = List[bool]
|
RawPacket = List[bool]
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import math
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple
|
from typing import Iterator, List, NamedTuple
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import itertools
|
|
||||||
import math
|
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple
|
from typing import Iterator, List, NamedTuple
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import functools
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import functools
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import functools
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Optional, Set, Tuple, cast
|
from typing import List, NamedTuple, Optional, Set, Tuple
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import functools
|
import functools
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Optional, Set, Tuple, cast
|
from typing import List, NamedTuple, Optional, Set, Tuple
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import enum
|
import enum
|
||||||
import functools
|
import functools
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Optional, Tuple, cast
|
from typing import Iterator, List, NamedTuple, Optional, Tuple
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
import enum
|
import enum
|
||||||
import functools
|
import functools
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterator, List, NamedTuple, Optional, Tuple, cast
|
from typing import Iterator, List, NamedTuple, Optional, Tuple
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import enum
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from typing import Iterable, Iterator, List, NamedTuple, Set
|
from typing import List, NamedTuple, Set
|
||||||
|
|
||||||
|
|
||||||
class Point(NamedTuple):
|
class Point(NamedTuple):
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from collections import deque
|
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from typing import NamedTuple
|
from typing import NamedTuple
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ class Operator(str, enum.Enum):
|
||||||
|
|
||||||
class Monkey:
|
class Monkey:
|
||||||
def get_value(self, monkeys: dict[str, "Monkey"]) -> int:
|
def get_value(self, monkeys: dict[str, "Monkey"]) -> int:
|
||||||
raise NotImplemented
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
|
|
|
@ -93,7 +93,7 @@ class MathObserver:
|
||||||
|
|
||||||
class Monkey:
|
class Monkey:
|
||||||
def get_value(self, monkeys: dict[str, "Monkey"]) -> Num:
|
def get_value(self, monkeys: dict[str, "Monkey"]) -> Num:
|
||||||
raise NotImplemented
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
||||||
@dataclasses.dataclass
|
@dataclasses.dataclass
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import functools
|
|
||||||
import math
|
import math
|
||||||
import operator as op
|
|
||||||
import sys
|
import sys
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
import dataclasses
|
|
||||||
import itertools
|
import itertools
|
||||||
import sys
|
import sys
|
||||||
from enum import StrEnum
|
from enum import StrEnum
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
|
|
||||||
import functools
|
import functools
|
||||||
import heapq
|
import heapq
|
||||||
import itertools
|
|
||||||
import sys
|
import sys
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
Loading…
Reference in a new issue