code: def test_adaptive_local_cluster(loop):
      with LocalCluster(
          n_workers=0,
          silence_logs=False,
          dashboard_address=":0",
          loop=loop,
      ) as cluster:
          alc = cluster.adapt(interval="100 ms")
          with Client(cluster, loop=loop) as c:
              assert not cluster.scheduler.workers
              future = c.submit(lambda x: x + 1, 1)
              assert future.result() == 2
              assert cluster.scheduler.workers
  
              sleep(0.1)
              assert cluster.scheduler.workers
  
              del future
  
              start = time()
              while cluster.scheduler.workers:
                  sleep(0.01)
                  assert time() < start + 30
  
              assert not cluster.scheduler.workers
  
file_path: distributed/distributed/deploy/tests/test_adaptive.py
imports: from __future__ import annotations
  import asyncio
  import math
  from time import sleep
  import pytest
  import dask
  from distributed import Adaptive, Client, LocalCluster, Scheduler, SpecCluster, Worker, wait
  from distributed.metrics import time
  from distributed.utils_test import async_poll_for, gen_cluster, gen_test, slowinc
label_desc: Use image node_id 1 for calling a global function with example usage: test_adaptive_local_cluster(loop) without return types