code: def test_context_meter_decorator():
      it = iter([123, 124, 130, 135, 150, 160])
      cbs = []
  
      @metrics.context_meter.meter("m1", func=lambda: next(it))
      def f():
          pass
  
      with metrics.context_meter.add_callback(
          lambda l, v, u: cbs.append((l, v, u))
      ):
          f()
          f()
  
      f()  # Not metered
  
      assert cbs == [("m1", 1, "seconds"), ("m1", 5, "seconds")]
  
imports: from __future__ import annotations
  import math
  import pickle
  import threading
  import time
  import pytest
  from distributed import metrics
  from distributed.compatibility import WINDOWS
  from distributed.utils import offload
  from distributed.utils_test import gen_test
label_desc: Use image node_id 9 for calling a global function with example usage: test_context_meter_decorator() without return types