Skip to content

Commit 5a4b5e1

Browse files
committed
Fix: Remove unused imports with pycln
1 parent 71787c6 commit 5a4b5e1

File tree

4 files changed

+12
-14
lines changed

4 files changed

+12
-14
lines changed

agentic_security/core/app.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
from fastapi.responses import ORJSONResponse
66

77
from agentic_security.http_spec import LLMSpec
8-
from typing import Any, Dict
98

109
tools_inbox: Queue = Queue()
1110
stop_event: Event = Event()
1211
current_run: str = {"spec": "", "id": ""}
1312
_secrets: dict[str, str] = {}
1413

15-
current_run: Dict[str, int | LLMSpec] = {
16-
"spec": "",
17-
"id": ""
18-
}
14+
current_run: dict[str, int | LLMSpec] = {"spec": "", "id": ""}
15+
1916

2017
def create_app() -> FastAPI:
2118
"""Create and configure the FastAPI application."""
@@ -33,12 +30,12 @@ def get_stop_event() -> Event:
3330
return stop_event
3431

3532

36-
def get_current_run() -> Dict[str, int | LLMSpec]:
33+
def get_current_run() -> dict[str, int | LLMSpec]:
3734
"""Get the current run id."""
3835
return current_run
3936

4037

41-
def set_current_run(spec : LLMSpec) -> Dict[str, int | LLMSpec]:
38+
def set_current_run(spec: LLMSpec) -> dict[str, int | LLMSpec]:
4239
"""Set the current run id."""
4340
current_run["id"] = hash(id(spec))
4441
current_run["spec"] = spec
@@ -49,13 +46,13 @@ def get_secrets() -> dict[str, str]:
4946
return _secrets
5047

5148

52-
def set_secrets(secrets : dict[str, str]) -> dict[str, str]:
49+
def set_secrets(secrets: dict[str, str]) -> dict[str, str]:
5350
_secrets.update(secrets)
5451
expand_secrets(_secrets)
5552
return _secrets
5653

5754

58-
def expand_secrets(secrets : dict[str, str]) -> None:
55+
def expand_secrets(secrets: dict[str, str]) -> None:
5956
for key in secrets:
6057
val = secrets[key]
6158
if val.startswith("$"):

agentic_security/misc/banner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
12
from pyfiglet import Figlet, FontNotFound
23
from termcolor import colored
3-
from typing import Optional
44

55
try:
66
from importlib.metadata import version
@@ -15,7 +15,7 @@ def generate_banner(
1515
tagline: str = "Proactive Threat Detection & Automated Security Protocols",
1616
author: str = "Developed by: [Security Team]",
1717
website: str = "Website: https://github.com/msoedov/agentic_security",
18-
warning: Optional[str] = "", # Using Optional for warning since it might be None
18+
warning: str | None = "", # Using Optional for warning since it might be None
1919
) -> str:
2020
"""Generate a visually enhanced banner with dynamic width and borders."""
2121
# Define the text elements

agentic_security/report_chart.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import io
22
import string
3-
from typing import List
43

54
import matplotlib.pyplot as plt
65
import numpy as np
@@ -10,6 +9,7 @@
109

1110
from .primitives import Table
1211

12+
1313
def plot_security_report(table: Table) -> io.BytesIO:
1414
# Data preprocessing
1515
data = pd.DataFrame(table)
@@ -143,7 +143,7 @@ def plot_security_report(table: Table) -> io.BytesIO:
143143
return buf
144144

145145

146-
def generate_identifiers(data : pd.DataFrame) -> List[str]:
146+
def generate_identifiers(data: pd.DataFrame) -> list[str]:
147147
data_length = len(data)
148148
alphabet = string.ascii_uppercase
149149
num_letters = len(alphabet)

agentic_security/routes/scan.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
from collections.abc import Generator
12
from datetime import datetime
2-
from typing import Any, Generator
3+
from typing import Any
34

45
from fastapi import (
56
APIRouter,

0 commit comments

Comments
 (0)