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:
Bruno BELANYI 2024-11-23 19:24:55 +00:00
parent 8618c81b2f
commit acfc841539
54 changed files with 21 additions and 64 deletions

View file

@ -2,7 +2,7 @@
import sys
from fractions import Fraction
from typing import Dict, List, NamedTuple, Optional
from typing import List, NamedTuple, Optional
class Point(NamedTuple):

View file

@ -1,7 +1,5 @@
#!/usr/bin/env python
import sys
from copy import deepcopy
from enum import IntEnum
from typing import List, NamedTuple

View file

@ -5,7 +5,7 @@ import sys
from copy import deepcopy
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Callable, List, NamedTuple
from typing import List, NamedTuple
class ParameterMode(IntEnum):

View file

@ -1,11 +1,10 @@
#!/usr/bin/env python
import itertools
import sys
from copy import deepcopy
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Callable, List, NamedTuple
from typing import List, NamedTuple
class ParameterMode(IntEnum):

View file

@ -1,11 +1,10 @@
#!/usr/bin/env python
import itertools
import sys
from copy import deepcopy
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Callable, List, NamedTuple
from typing import List, NamedTuple
class ParameterMode(IntEnum):

View file

@ -4,7 +4,6 @@ import sys
from cmath import phase
from itertools import groupby
from math import gcd, pi
from pprint import pprint
from typing import NamedTuple, Set, Tuple

View file

@ -3,7 +3,7 @@
import sys
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Dict, Iterable, List, NamedTuple, Tuple, TypeVar
from typing import Iterable, List, NamedTuple, Tuple, TypeVar
class ParameterMode(IntEnum):

View file

@ -3,7 +3,7 @@
import sys
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Dict, Iterable, List, NamedTuple, Tuple, TypeVar
from typing import Iterable, List, NamedTuple, Tuple, TypeVar
class ParameterMode(IntEnum):

View file

@ -2,8 +2,6 @@
import sys
from functools import reduce
from itertools import chain, cycle
from typing import Iterable, List
def main() -> None:

View file

@ -4,7 +4,7 @@ import sys
from copy import deepcopy
from dataclasses import dataclass, field
from enum import IntEnum
from typing import Iterator, List, NamedTuple, Tuple
from typing import List, NamedTuple
class ParameterMode(IntEnum):

View file

@ -2,8 +2,6 @@
import re
import sys
from collections import defaultdict
from copy import deepcopy
from dataclasses import dataclass
from typing import Dict, List, Set, Tuple

View file

@ -1,7 +1,7 @@
#!/usr/bin/env python
import sys
from typing import Callable, Dict, List
from typing import List
"""
E : T [ * T ]*

View file

@ -5,7 +5,6 @@ import itertools
import math
import sys
from collections import defaultdict
from copy import deepcopy
from typing import Dict, Iterator, List, Set, Tuple
Tile = List[List[str]]

View file

@ -2,7 +2,7 @@
import itertools
import sys
from typing import List, Tuple
from typing import List
def solve(circle: List[int]) -> int:

View file

@ -2,7 +2,7 @@
import itertools
import sys
from typing import List, Tuple
from typing import List
def solve(circle: List[int]) -> int:

View file

@ -3,7 +3,6 @@
import itertools
import sys
from collections import defaultdict
from copy import deepcopy
from typing import Dict, Iterator, List, Tuple
Offset = Tuple[int, int]

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from copy import deepcopy
from typing import List

View file

@ -3,7 +3,6 @@
import itertools
import sys
from collections import Counter
from dataclasses import dataclass
from typing import Iterator, List, TypeVar
T = TypeVar("T")

View file

@ -3,7 +3,6 @@
import itertools
import sys
from collections import Counter
from dataclasses import dataclass
from typing import Iterator, List, TypeVar
T = TypeVar("T")

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from math import ceil, floor
from typing import List

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from dataclasses import dataclass
from typing import Dict, List, Set

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import Iterator, List, Tuple

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import Iterator, List, Tuple

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import List, Optional, cast

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from typing import Iterator, List, Optional

View file

@ -2,7 +2,6 @@
import itertools
import sys
from copy import deepcopy
from typing import Iterator, List, Set, Tuple
Grid = List[List[int]]

View file

@ -2,7 +2,6 @@
import itertools
import sys
from copy import deepcopy
from typing import Iterator, List, Set, Tuple
Grid = List[List[int]]

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from collections import defaultdict
from typing import Dict, List, Set

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import itertools
import sys
from collections import defaultdict
from typing import Dict, List, Set

View file

@ -1,9 +1,8 @@
#!/usr/bin/env python
import heapq
import itertools
import sys
from typing import Iterator, List, NamedTuple, Set, Tuple
from typing import Iterator, List, NamedTuple, Set
class Point(NamedTuple):

View file

@ -1,9 +1,8 @@
#!/usr/bin/env python
import heapq
import itertools
import sys
from typing import Iterator, List, NamedTuple, Set, Tuple
from typing import Iterator, List, NamedTuple, Set
class Point(NamedTuple):

View file

@ -5,7 +5,7 @@ import functools
import itertools
import sys
from dataclasses import dataclass
from typing import Iterable, Iterator, List, Tuple, TypeVar
from typing import Iterable, Iterator, List, Tuple
RawPacket = List[bool]

View file

@ -6,7 +6,7 @@ import itertools
import math
import sys
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]

View file

@ -1,7 +1,6 @@
#!/usr/bin/env python
import itertools
import math
import sys
from typing import Iterator, List, NamedTuple

View file

@ -1,7 +1,5 @@
#!/usr/bin/env python
import itertools
import math
import sys
from typing import Iterator, List, NamedTuple

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import functools
import itertools
import sys
from copy import deepcopy

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import functools
import itertools
import sys
from dataclasses import dataclass

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import functools
import itertools
import sys
from dataclasses import dataclass

View file

@ -3,7 +3,7 @@
import functools
import itertools
import sys
from typing import Iterator, List, NamedTuple, Optional, Set, Tuple, cast
from typing import List, NamedTuple, Optional, Set, Tuple
class Point(NamedTuple):

View file

@ -3,7 +3,7 @@
import functools
import itertools
import sys
from typing import Iterator, List, NamedTuple, Optional, Set, Tuple, cast
from typing import List, NamedTuple, Optional, Set, Tuple
class Point(NamedTuple):

View file

@ -3,7 +3,7 @@
import enum
import functools
import sys
from typing import Iterator, List, NamedTuple, Optional, Tuple, cast
from typing import Iterator, List, NamedTuple, Optional, Tuple
class Point(NamedTuple):

View file

@ -3,7 +3,7 @@
import enum
import functools
import sys
from typing import Iterator, List, NamedTuple, Optional, Tuple, cast
from typing import Iterator, List, NamedTuple, Optional, Tuple
class Point(NamedTuple):

View file

@ -1,9 +1,8 @@
#!/usr/bin/env python
import enum
import itertools
import sys
from typing import Iterable, Iterator, List, NamedTuple, Set
from typing import List, NamedTuple, Set
class Point(NamedTuple):

View file

@ -2,7 +2,6 @@
import itertools
import sys
from collections import deque
from collections.abc import Iterator
from typing import NamedTuple

View file

@ -25,7 +25,7 @@ class Operator(str, enum.Enum):
class Monkey:
def get_value(self, monkeys: dict[str, "Monkey"]) -> int:
raise NotImplemented
raise NotImplementedError
@dataclasses.dataclass

View file

@ -93,7 +93,7 @@ class MathObserver:
class Monkey:
def get_value(self, monkeys: dict[str, "Monkey"]) -> Num:
raise NotImplemented
raise NotImplementedError
@dataclasses.dataclass

View file

@ -1,8 +1,6 @@
#!/usr/bin/env python
import functools
import math
import operator as op
import sys
from collections import Counter
from enum import StrEnum

View file

@ -1,6 +1,5 @@
#!/usr/bin/env python
import dataclasses
import itertools
import sys
from enum import StrEnum

View file

@ -2,7 +2,6 @@
import functools
import heapq
import itertools
import sys
from collections.abc import Iterator
from enum import Enum