11 lines
273 B
Python
11 lines
273 B
Python
from __future__ import annotations
|
|
|
|
from typing import Any, Mapping
|
|
|
|
|
|
def guard_matches(guard: Mapping[str, Any], context: Mapping[str, Any]) -> bool:
|
|
for key, expected in guard.items():
|
|
if context.get(key) != expected:
|
|
return False
|
|
return True
|