code: def read_csv_paths(
      test_path,
      filename_pattern,
      read_csv_tries=120,
      extra_tries=0,
      num_expected_files=None,
  ):
      """
      Return file path once it found
      :param test_path: |string| test folder path
      :param filename_pattern: |string| csv file pattern
      :param read_csv_tries: |int| number of iterations until file found
      :param extra_tries: |int| add number of extra tries to check after getting
                          all the paths.
      :param num_expected_files: find all expected file in experiment folder.
      :return: |string| return csv file path
      """
      csv_paths = []
      tries_counter = 0
  
      if isinstance(extra_tries, int) and extra_tries >= 0:
          read_csv_tries += extra_tries
  
      while tries_counter < read_csv_tries:
          csv_paths = glob.glob(
              path.join(test_path, "*", filename_pattern)
          )
  
          if num_expected_files:
              if num_expected_files == len(csv_paths):
                  break
              else:
                  time.sleep(1)
                  tries_counter += 1
                  continue
          elif csv_paths:
              break
  
          time.sleep(1)
          tries_counter += 1
  
      return csv_paths
  
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 2 for calling a global function with example usage: read_csv_paths(test_path, filename_pattern, read_csv_tries, extra_tries, num_expected_files) and returns: csv_paths