code: def test_external_file_failure_cases():
      # external file cannot be found
      with InTemporaryDirectory() as tmpdir:
          shutil.copy(DATA_FILE7, ".")
          filename = pjoin(tmpdir, basename(DATA_FILE7))
          with pytest.raises(GiftiParseError):
              img = load(filename)
      # load from in-memory xml string (parser requires it as bytes)
      with open(DATA_FILE7, "rb") as f:
          xmldata = f.read()
      parser = GiftiImageParser()
      with pytest.raises(GiftiParseError):
          img = parser.parse(xmldata)
  
imports: import shutil
  import sys
  import warnings
  from os.path import basename, dirname
  from os.path import join
  from unittest import mock
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from ...loadsave import load, save
  from ...nifti1 import xform_codes
  from ...testing import clear_and_catch_warnings, suppress_warnings
  from ...tmpdirs import InTemporaryDirectory
  from ..None import gifti
  from ..parse_gifti_fast import GiftiImageParser, GiftiParseError
  from ..util import gifti_endian_codes
label_desc: Use image node_id 21 for calling a global function with example usage: test_external_file_failure_cases() without return types