code: def test_dataset_exists(tmpdir):
      """
      Test the dataset_exists helper function
      """
      data_home = tmpdir.mkdir("fixtures")
      assert not os.path.exists(str(data_home.join("foo")))
  
      # Test when directory doesn't exist
      assert not dataset_exists("foo", str(data_home))
  
      # Test when path exists but is file
      fpath = data_home.join("foo.txt")
      fpath.write("foo")
  
      assert not dataset_exists("foo.txt", str(data_home))
  
      # Test correct case
      data_home.mkdir("foo")
      assert dataset_exists("foo", str(data_home))
  
file_path: yellowbrick/tests/test_datasets/test_path.py
imports: import os
  import pytest
  import contextlib
  from yellowbrick.datasets.path import *
  from yellowbrick.exceptions import DatasetsError
label_desc: Use image node_id 8 for calling a global function with example usage: test_dataset_exists(tmpdir) without return types