def METHOD_NAME(obj: dict[str, Any]) -> "DumboOptions":
    default = DumboOptions.default()
    if obj is None:
        return default
    def safe_get(key: str, t: Type, def_val: Any) -> Any:
        if (k := obj.get(key)) and isinstance(k, t):
            return k
        return def_val
    return DumboOptions(
        math_type=MathType.from_string(
            safe_get("math_type", str, default.math_type)
        ),
        math_preamble=safe_get("math_preamble", str, default.math_preamble),
        input_format=InputFormat.from_string(
            safe_get("input_format", str, default.input_format)
        ),
        smart_punct=safe_get("smart_punct", bool, default.smart_punct),
    )