code: def wait_for_cores(c, nthreads=1):
      start = time()
      while len(c.nthreads()) < 1:
          sleep(0.1)
          assert time() < start + 10
  
file_path: distributed/distributed/cli/tests/test_tls_cli.py
imports: from __future__ import annotations
  from time import sleep
  from distributed import Client
  from distributed.metrics import time
  from distributed.utils import open_port
  from distributed.utils_test import get_cert, new_config_file, popen, tls_only_config, tls_security
label_desc: Use image node_id 1 for calling a global function with example usage: wait_for_cores(c, nthreads) without return types