code: def validate_metrics_log(log_filename, metric_names, present):
      assert len(glob.glob("logs/" + log_filename)) == 1
      metrics_path = glob.glob("logs/" + log_filename)[0]
      if present:
          assert os.path.getsize(metrics_path) > 0
  
      metrics_regex = re.compile(
          "|".join(metric_names), flags=re.IGNORECASE
      )
      with open(metrics_path, "rt") as metrics_file:
          metrics_data = metrics_file.read()
          matched_metrics = re.findall(metrics_regex, metrics_data)
  
      if present:
          assert len(matched_metrics) > 0
      else:
          assert len(matched_metrics) == 0
  
imports: import glob
  import os
  import platform
  import re
  import shutil
  import subprocess
  import time
  from os import path
  import requests
  import test_utils
label_desc: Use image node_id 7 for calling a global function with example usage: validate_metrics_log(log_filename, metric_names, present) without return types