code: def if_datasource(ds, msg):
      try:
          ds.get_filename()
      except DataError:
          return skipIf(True, msg)
      return lambda f: f
  
file_path: nipy/nipy/testing/decorators.py
imports: import functools
  from unittest import skipIf
  from nibabel.optpkg import optional_package
  from nipy.utils import DataError, example_data, templates
label_desc: Use image node_id 3 for calling a global function with example usage: if_datasource(ds, msg) and returns: function, skipIf