code: def check_files(files, file_check, exclusions=set(), pattern=None):
      """
      Checks all files with the file_check function provided, skipping files
      that contain any of the strings in the set provided by exclusions.
      """
      if not files:
          return
      for fname in files:
          if not exists(fname) or not isfile(fname):
              continue
          if any(ex in fname for ex in exclusions):
              continue
          if pattern is None or re.match(pattern, fname):
              file_check(fname)
  
imports: from os import walk, sep, pardir
  from os.path import split, join, abspath, exists, isfile
  from glob import glob
  import re
  import random
  import ast
  from sympy.testing.pytest import raises
  from sympy.testing.quality_unicode import _test_this_file_encoding
label_desc: Use image node_id 4 for calling a global function with example usage: check_files(files, file_check, exclusions, pattern) without return types