Formatting fixes

This commit is contained in:
marcus-daily
2026-01-22 13:34:52 +00:00
committed by Marcus
parent b6341ffaa5
commit 76b774072c
2 changed files with 5 additions and 6 deletions

View File

@@ -94,10 +94,10 @@ class LocalSmartTurnAnalyzerV3(BaseSmartTurn):
sample_rate: The sample rate of the audio data.
suffix: Optional suffix to append to the filename (e.g., "_raw", "_padded").
"""
import wave
from datetime import datetime
import os
import threading
import wave
from datetime import datetime
# Generate filename with current timestamp (millisecond precision)
timestamp = datetime.now().strftime("%Y-%m-%d__%H:%M:%S.%f")[:-3]
@@ -177,4 +177,4 @@ class LocalSmartTurnAnalyzerV3(BaseSmartTurn):
return {
"prediction": prediction,
"probability": probability,
}
}

View File

@@ -18,6 +18,7 @@ class InvalidEnvVarValueError(ValueError):
"""Raised when an environment variable value cannot be parsed."""
def __init__(self, name: str, value: str, expected: str):
"""Initialize an InvalidEnvVarValueError."""
super().__init__(f"Invalid value for env var {name!r}: {value!r}. Expected {expected}.")
self.name = name
self.value = value
@@ -35,7 +36,6 @@ def env_truthy(name: str, default: bool = False) -> bool:
- Truthy: "1", "true", "yes", "y", "on"
- Falsy: "0", "false", "no", "n", "off", ""
"""
raw = os.getenv(name)
if raw is None:
return default
@@ -49,6 +49,5 @@ def env_truthy(name: str, default: bool = False) -> bool:
raise InvalidEnvVarValueError(
name=name,
value=raw,
expected='true or false',
expected="true or false",
)