code: def waitReadiness(container, match_msg, match_number=2, timeout=30):
      """Wait the container readiness.
      Args:
          match_msg: str - substring in log indicates container readiness
          match_number: int - how many times 'match_msg' needs to be found in container logs
          timeout: - timeout
      Raises:
          timeout exceeded error if the container wasn't ready in timeout.
      """
      threshold = time.time() + timeout
      ready_msg = match_msg
      while True:
          lines = container.logs().decode()
          # container fully ready
          # because it reloads the db server during initialization
          # need to check that the 'ready for connections' has found second time
          if lines.count(ready_msg) >= 2:
              break
          if time.time() > threshold:
              raise Exception(
                  "timeout exceeded, container is still not ready"
              )
  
imports: import os
  import sys
  import time
  import json
  import subprocess
  from pathlib import Path
  import docker
  import pytest
  import psutil
  import requests
  import netifaces
  import pandas
  from walrus import Database
  from mindsdb.utilities.ps import get_child_pids
label_desc: Use image node_id 8 for calling a global function with example usage: waitReadiness(container, match_msg, match_number, timeout) without return types