code: def wait_collection_on_all_peers(
      collection_name: str, peer_api_uris: [str], max_wait=30
  ):
      # Check that it exists on all peers
      while True:
          exists = True
          for url in peer_api_uris:
              r = requests.get(f"{url}/collections")
              assert_http_ok(r)
              collections = r.json()["result"]["collections"]
              exists &= any(
                  collection["name"] == collection_name
                  for collection in collections
              )
          if exists:
              break
          else:
              # Wait until collection is created on all peers
              # Consensus guarantees that collection will appear on majority of peers, but not on all of them
              # So we need to wait a bit extra time
              time.sleep(1)
              max_wait -= 1
          if max_wait <= 0:
              raise Exception(
                  "Collection was not created on all peers in time"
              )
  
imports: import json
  import os
  import shutil
  from subprocess import Popen
  import time
  from typing import Tuple, Callable, Dict, List, Optional
  import requests
  import socket
  from contextlib import closing
  from pathlib import Path
  import pytest
  from .assertions import assert_http_ok
label_desc: Use image node_id 49 for calling a global function with example usage: wait_collection_on_all_peers(collection_name, peer_api_uris, max_wait) without return types