code: def log_scalar(
      key: str,
      value: float,
      weight: float = 1,
      priority: int = 10,
      round: Optional[int] = None,
  ):
      """Log a scalar value.
  
      Args:
          key (str): name of the field to log
          value (float): value to log
          weight (float): weight that this value contributes to the average.
              A weight of 0 will always log the latest value.
          priority (int): smaller values are logged earlier in the output
          round (Optional[int]): number of digits to round to when displaying
      """
      for agg in get_active_aggregators():
          if key not in agg:
              agg.add_meter(key, AverageMeter(round=round), priority)
          agg[key].update(value, weight)
  
imports: import contextlib
  import uuid
  from collections import defaultdict
  from typing import Callable, List, Optional
  from .meters import *
label_desc: Use image node_id 4 for calling a global function with example usage: log_scalar(key, value, weight, priority, round) without return types