code: def expires(version):
      """Decorator to mark a test as xfail with ExpiredDeprecationError after version"""
      from packaging.version import Version
  
      from nibabel import __version__ as nbver
      from nibabel.deprecator import ExpiredDeprecationError
  
      if Version(nbver) < Version(version):
          return lambda x: x
  
      return pytest.mark.xfail(raises=ExpiredDeprecationError)
  
imports: from __future__ import annotations
  import os
  import re
  import sys
  import typing
  import unittest
  import warnings
  from contextlib import nullcontext
  from itertools import zip_longest
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from .helpers import assert_data_similar, bytesio_filemap, bytesio_round_trip
  from .np_features import memmap_after_ufunc
label_desc: Use image node_id 9 for calling a global function with example usage: expires(version) and returns: pytest, function