code: def test_metadata_directory(self):
      # Test that metadata directory is set correctly (if user specifies,
      # Auto-sklearn should check that the directory exists. If not, it
      # should use the default directory.
      dask_client = unittest.mock.Mock()
      automl1 = AutoSklearnClassifier(
          time_left_for_this_task=30,
          per_run_time_limit=5,
          metadata_directory="pyMetaLearn/metadata_dir",  # user metadata_dir
          dask_client=dask_client,
      )
      self.assertEqual(
          automl1.metadata_directory, "pyMetaLearn/metadata_dir"
      )
  
      automl2 = AutoSklearnClassifier(  # default metadata_dir
          time_left_for_this_task=30,
          per_run_time_limit=5,
          dask_client=dask_client,
      )
      self.assertIsNone(automl2.metadata_directory)
  
      nonexistent_dir = "nonexistent_dir"
      automl3 = AutoSklearnClassifier(
          time_left_for_this_task=30,
          per_run_time_limit=5,
          metadata_directory=nonexistent_dir,  # user specified metadata_dir
          dask_client=dask_client,
          ensemble_class=None,
      )
      X, y = load_breast_cancer(return_X_y=True)
      self.assertRaisesRegex(
          ValueError,
          "The specified metadata directory "
          "'%s' does not exist!" % nonexistent_dir,
          automl3.fit,
          X=X,
          y=y,
      )
  
file_path: auto-sklearn/test/test_metalearning/test_metalearning.py
imports: from sklearn.datasets import load_breast_cancer
  from autosklearn.classification import AutoSklearnClassifier
  from autosklearn.constants import MULTICLASS_CLASSIFICATION, REGRESSION
  from autosklearn.metalearning.mismbo import suggest_via_metalearning
  from autosklearn.pipeline.util import get_dataset
  from autosklearn.smbo import _calculate_metafeatures, _calculate_metafeatures_encoded
  from autosklearn.util.pipeline import get_configuration_space
  import unittest
label_desc: Use image node_id 3 for calling the Test obj's underlying member method code with example usage: obj.test_metadata_directory() without return types