diff --git a/src/viam/utils.py b/src/viam/utils.py index 5bc0535dc..fd96c70cd 100644 --- a/src/viam/utils.py +++ b/src/viam/utils.py @@ -255,3 +255,12 @@ async def to_thread(func: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) ctx = contextvars.copy_context() func_call = functools.partial(ctx.run, func, *args, **kwargs) return await loop.run_in_executor(None, func_call) # type: ignore + + +def from_dm_from_extra(extra: Optional[Dict[str, Any]]) -> bool: + """Used in modular filter components to get the 'fromDataManagement' value from an extra map. + """ + if extra is None: + return False + + return bool(extra["fromDataManagement"])