code: def watch_method(
      func: Callable[..., Awaitable[Tuple[int, RetType]]]
  ) -> Callable[..., AsyncGenerator[RetType, None]]:
      @functools.wraps(func)
      async def wrapped(*args, **kwargs):
          if "version" in kwargs:
              yield await func(*args, **kwargs)
              return
  
          kwargs["version"] = None
          while True:
              version, val = await func(*args, **kwargs)
              kwargs["version"] = version
              yield val
  
      return wrapped
  
imports: import asyncio
  import enum
  import functools
  import time
  from dataclasses import dataclass, field
  from typing import AsyncGenerator, Awaitable, Callable, Dict, Optional, Set, Tuple, TypeVar
  from ...serialization.serializables import Serializable, Float64Field, Int32Field, Int64Field, StringField
  from ...storage import StorageLevel
  from ..core import NodeRole
label_desc: Use image node_id 1 for calling a global function with example usage: watch_method(func) and returns: wrapped