style: remove unused code
This commit is contained in:
@@ -2,7 +2,6 @@ import logging
|
|||||||
from itertools import chain
|
from itertools import chain
|
||||||
from re import compile as re_compile
|
from re import compile as re_compile
|
||||||
|
|
||||||
from orjson import loads as orjson_loads, JSONDecodeError
|
|
||||||
from lxml import html
|
from lxml import html
|
||||||
|
|
||||||
from scrapling.core._types import Any, Dict, Iterable, List
|
from scrapling.core._types import Any, Dict, Iterable, List
|
||||||
@@ -42,17 +41,6 @@ def setup_logger():
|
|||||||
log = setup_logger()
|
log = setup_logger()
|
||||||
|
|
||||||
|
|
||||||
def is_jsonable(content: bytes | str) -> bool:
|
|
||||||
if isinstance(content, bytes):
|
|
||||||
content = content.decode()
|
|
||||||
|
|
||||||
try:
|
|
||||||
_ = orjson_loads(content)
|
|
||||||
return True
|
|
||||||
except JSONDecodeError:
|
|
||||||
return False
|
|
||||||
|
|
||||||
|
|
||||||
def flatten(lst: Iterable[Any]) -> List[Any]:
|
def flatten(lst: Iterable[Any]) -> List[Any]:
|
||||||
return list(chain.from_iterable(lst))
|
return list(chain.from_iterable(lst))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user