code: def assert_good(pkg_name, min_version=None):
      pkg, have_pkg, setup = optional_package(
          pkg_name, min_version=min_version
      )
      assert have_pkg
      assert sys.modules[pkg_name] == pkg
      assert setup() is None
  
file_path: nibabel/nibabel/tests/test_optpkg.py
imports: import builtins
  import sys
  import types
  from unittest import SkipTest, mock
  import pytest
  from packaging.version import Version
  from nibabel.optpkg import optional_package
  from nibabel.tripwire import TripWire, TripWireError
label_desc: Use image node_id 1 for calling a global function with example usage: assert_good(pkg_name, min_version) without return types