code: def all_collection_shards_are_active(peer_url, collection_name):
      try:
          info = get_collection_cluster_info(peer_url, collection_name)
      except:
          return False
  
      remote_shards = info["remote_shards"]
      local_shards = info["local_shards"]
  
      if len(remote_shards) == 0:
          return False
  
      return all(
          map(
              lambda shard: shard["state"] == "Active",
              local_shards + remote_shards,
          )
      )
  
file_path: qdrant/tests/consensus_tests/test_collection_recovery.py
imports: import pathlib
  import shutil
  from .fixtures import create_collection, upsert_random_points, random_dense_vector, search
  from .utils import *
  from .assertions import assert_http_ok
label_desc: Use image node_id 5 for calling a global function with example usage: all_collection_shards_are_active(peer_url, collection_name) and returns: all, False, False