from typing import Any
from typing import Callable


def obs_op(obs: Any, op: Callable[[Any], Any]) -> Any:
    """Apply an operation to every value in a dictionary."""
    if isinstance(obs, dict):
        return {k: op(obs[k]) for k in obs}
    return op(obs)