code: def test_mlab_tempfile():
      for dir in [None, tempfile.tempdir, tempfile.mkdtemp()]:
          assert mlab_tempfile(dir)
      pytest.raises(OSError, mlab_tempfile, "non-existent-dir")
  
imports: import os
  import tempfile
  import pytest
  from nipy.interfaces.matlab import mlab_tempfile
label_desc: Use image node_id 1 for calling a global function with example usage: test_mlab_tempfile() without return types