code: def assert_no_user_info_in_logs(
      user_info: str, file_whitelist: List[str] = None
  ):
      """Assert that the user info is not in the logs, except for any file that
      glob pattern matches a file in the whitelist.
      """
      if file_whitelist is None:
          file_whitelist = []
  
      log_dir = os.path.join(
          ray.worker._global_node.get_session_dir_path(), "logs"
      )
  
      for root, dirs, files in os.walk(log_dir):
          for file in files:
              if any(
                  fnmatch.fnmatch(file, pattern)
                  for pattern in file_whitelist
              ):
                  continue
              # Some lines contain hex IDs, so ignore the UTF decoding errors.
              with open(
                  os.path.join(root, file), "r", errors="ignore"
              ) as f:
                  for line in f:
                      assert user_info not in line, (
                          file,
                          user_info,
                          line,
                      )
  
file_path: ray/python/ray/tests/test_runtime_env_2.py
imports: import pytest
  import time
  import sys
  import fnmatch
  import os
  from typing import List
  import ray
  from ray.dashboard.modules.job.common import JobStatus
  from ray.exceptions import RuntimeEnvSetupError
  from ray.runtime_env import RuntimeEnv, RuntimeEnvConfig
  from ray._private.test_utils import wait_for_condition
label_desc: Use image node_id 3 for calling a global function with example usage: assert_no_user_info_in_logs(user_info, file_whitelist) without return types