code: def meter(
      func: Callable[[], float] = timemod.perf_counter,
      floor: float | Literal[False] = 0.0,
  ) -> Iterator[MeterOutput]:
      """Convenience context manager which calls func() before and after the wrapped
      code and calculates the delta.
  
      Parameters
      ----------
      label: str
          label to pass to the callback
      func: callable
          function to call before and after, which must return a number.
          Besides time, it could return e.g. cumulative network traffic or disk usage.
          Default: :func:`timemod.perf_counter`
      floor: float or False, optional
          Floor the delta to the given value (default: 0). This is useful for strictly
          cumulative functions that can occasionally glitch and go backwards.
          Set to False to disable.
  
      Yields
      ------
      :class:`MeterOutput` where the ``start`` attribute is populated straight away, while
      ``stop`` and ``delta`` are nan until context exit.
      """
      out = MeterOutput(func(), nan, nan)
      try:
          yield out
      finally:
          out.stop = func()
          out.delta = out.stop - out.start
          if floor is not False:
              out.delta = max(floor, out.delta)
  
imports: from __future__ import annotations
  import asyncio
  import collections
  import threading
  import time
  from collections.abc import Callable, Hashable, Iterator
  from contextlib import contextmanager
  from contextvars import ContextVar
  from dataclasses import dataclass
  from functools import wraps
  from math import nan
  from typing import Literal
  import psutil
  from distributed.compatibility import WINDOWS
label_desc: Use image node_id 2 for calling a global function with example usage: meter(func, floor) without return types