code: def uid(namespace: str = "default") -> int:
      """Global counter for unique id. Not thread-safe."""
      _last_uid[namespace] += 1
      return _last_uid[namespace]
  
imports: from __future__ import annotations
  import logging
  from collections import defaultdict
  from typing import Any, List, cast
label_desc: Use image node_id 1 for calling a global function with example usage: uid(namespace) and returns: _last_uid