code: def _apply_failure(
      self,
      fn,
      filename,
      expected_exception=FileNotFoundError,
      check_filename=True,
  ):
      with self.assertRaises(expected_exception) as c:
          fn(filename)
      exc_filename = c.exception.filename
      if check_filename:
          self.assertEqual(
              exc_filename,
              filename,
              "Function '%s(%a) failed "
              "with bad filename in the exception: %a"
              % (fn.__name__, filename, exc_filename),
          )
  
imports: import os
  import sys
  import unittest
  import warnings
  from unicodedata import normalize
  from test.support import os_helper
  from test import support
label_desc: Use image node_id 3 for calling the UnicodeFileTests obj's underlying member method code with example usage: obj._apply_failure(fn, filename, expected_exception, check_filename) without return types