code: def test_context_meter_nested():
      it1 = iter([123, 126])
      it2 = iter([12, 13])
      cbs1 = []
      cbs2 = []
  
      with metrics.context_meter.add_callback(
          lambda l, v, u: cbs1.append((l, v, u))
      ):
          with metrics.context_meter.add_callback(
              lambda l, v, u: cbs2.append((l, v, u))
          ):
              with metrics.context_meter.meter(
                  "m1", func=lambda: next(it1)
              ) as m1:
                  with metrics.context_meter.meter(
                      "m2", func=lambda: next(it2)
                  ) as m2:
                      pass
  
      assert m1.start == 123
      assert m1.stop == 126
      assert m1.delta == 2  # (126 - 123) - (124 - 123)
      assert m2.start == 12
      assert m2.stop == 13
      assert m2.delta == 1
      assert (
          cbs1 == cbs2 == [("m2", 1, "seconds"), ("m1", 2, "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 8 for calling a global function with example usage: test_context_meter_nested() without return types