code: def find_string_in_logs(
      log_path,
      str,
      timeout=Def.TimeOuts.wait_for_files,
      wait_and_find=False,
  ):
      """
      Find string into the log file
      :param log_path: |string| log path
      :param str: |string| search text
      :param timeout: |int| timeout for searching on file
      :param wait_and_find: |bool| true if need to wait until reaching timeout
      :return: |bool| true if string found in the log file
      """
      start_time = time.time()
      while time.time() - start_time < timeout:
          # wait until logs created
          if os.path.exists(log_path):
              break
          time.sleep(1)
  
      if not os.path.exists(log_path):
          return False
  
      while time.time() - start_time < Def.TimeOuts.test_time_limit:
          with open(log_path, "r") as fr:
              if str in fr.read():
                  return True
              fr.close()
  
          if not wait_and_find:
              break
  
      return False
  
file_path: coach/rl_coach/tests/utils/test_utils.py
imports: import glob
  import sys
  import time
  import os
  from os import path
  from rl_coach.tests.utils.definitions import Definitions
label_desc: Use image node_id 4 for calling a global function with example usage: find_string_in_logs(log_path, str, timeout, wait_and_find) and returns: False, False, True