* refactor: remove redundant comments and docstrings * fix(signal): annotate async context manager as a generator
16 lines
346 B
Python
16 lines
346 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any
|
|
|
|
|
|
def get_camel_snake(
|
|
data: dict[str, Any],
|
|
camel: str,
|
|
snake: str,
|
|
default: Any = None,
|
|
) -> Any:
|
|
"""Prefer camelCase store keys, fall back to snake_case (asdict / hand-edits)."""
|
|
if camel in data:
|
|
return data[camel]
|
|
return data.get(snake, default)
|