format by black and isort

This commit is contained in:
Pavel Patsey
2025-01-16 12:41:52 +03:00
parent 5f0353d574
commit 048d4941e4
+3 -2
View File
@@ -1,8 +1,8 @@
import cProfile
from typing import Optional
from collections.abc import Iterator
from typing import Optional
Node = tuple[int, int, int] # только аннотация
Node = tuple[int, int, int]
def get_data(input_file):
@@ -27,6 +27,7 @@ def sort_nodes(nodes: Iterator[Node]) -> list[Node]:
def data_to_nodes(data: Iterator[str]) -> Iterator[Node]:
return map(cidr4_to_node, data)
def get_mask(ip, mask_len) -> int:
mask = ((1 << mask_len) - 1) << (32 - mask_len)
netaddr = ip & mask