code: def validate_file(file):
      file = os.path.abspath(file)
  
      if not os.path.isfile(file):
          LOG.info("ERROR: " + file + " isn't a file")
          sys.exit(EXIT_FAILURE)
  
      if not file.endswith(".py"):
          return True
  
      code_validation = True
      line_number = 1
      commented_code = False
  
      with open(file, "r") as opened_file:
          for line in opened_file:
              # Check if the line has commented code
              if line.lstrip().startswith("#"):
                  commented_code = contains_commented_out_code(line)
  
                  if commented_code:
                      LOG.info(
                          "Commented code "
                          + "in file "
                          + file
                          + " Line {}: {}".format(
                              line_number, line.strip()
                          )
                      )
  
              # Search for a pattern, and report hits
              for validator_pattern in VALIDATOR_PATTERNS:
                  if validator_pattern.search(line):
                      code_validation = False
                      LOG.info(
                          "Unacceptable pattern:"
                          + validator_pattern.pattern.strip()
                          + " in file "
                          + file
                          + " Line {}: {}".format(
                              line_number, line.strip()
                          )
                      )
  
              line_number += 1
  
      return code_validation
  
file_path: evadb/script/formatting/validator.py
imports: import argparse
  import os
  import re
  import functools
  import sys
  from formatter import LOG
label_desc: Use image node_id 2 for calling a global function with example usage: validate_file(file) and returns: code_validation, True