code: def span_id(s: Scheduler) -> str | None:
      ext = s.extensions["spans"]
      defaults = ext.spans_search_by_name["default",]
      # This is an arbitrary constraint enforced by the tests below
      assert len(defaults) == 1
      return defaults[0].id
  
file_path: distributed/distributed/tests/test_worker_metrics.py
imports: from __future__ import annotations
  import asyncio
  import time
  from collections.abc import Collection, Hashable
  from concurrent.futures import ProcessPoolExecutor
  from time import sleep
  import pytest
  import dask
  import distributed
  from distributed import Event, Reschedule, Scheduler, Worker, get_worker, wait
  from distributed.compatibility import WINDOWS
  from distributed.metrics import context_meter, meter
  from distributed.utils_test import BlockedGatherDep, BlockedGetData, async_poll_for, gen_cluster, inc, slowinc, wait_for_state
label_desc: Use image node_id 2 for calling a global function with example usage: span_id(s) and returns: defaults