code: def has_dataset(name):
      """Check for presence of a dataset.
  
      Parameters
      ----------
      name : str | dict
          The dataset to check. Strings refer to one of the supported datasets
          listed :ref:`here <datasets>`. A :class:`dict` can be used to check for
          user-defined datasets (see the Notes section of :func:`fetch_dataset`),
          and must contain keys ``dataset_name``, ``archive_name``, ``url``,
          ``folder_name``, ``hash``.
  
      Returns
      -------
      has : bool
          True if the dataset is present.
      """
      from mne.datasets._fetch import fetch_dataset
  
      if isinstance(name, dict):
          dataset_name = name["dataset_name"]
          dataset_params = name
      else:
          dataset_name = "spm" if name == "spm_face" else name
          dataset_params = MNE_DATASETS[dataset_name]
          dataset_params["dataset_name"] = dataset_name
  
      config_key = dataset_params["config_key"]
  
      # get download path for specific dataset
      path = _get_path(path=None, key=config_key, name=dataset_name)
  
      dp = fetch_dataset(
          dataset_params, path=path, download=False, check_version=False
      )
      if dataset_name.startswith("bst_"):
          check = dataset_name
      else:
          check = MNE_DATASETS[dataset_name]["folder_name"]
      return str(dp).endswith(check)
  
imports: import importlib
  import inspect
  import logging
  import os
  import os.path
  import sys
  import tempfile
  import time
  import zipfile
  from collections import OrderedDict
  from pathlib import Path
  import numpy
  from ..label import Label, read_labels_from_annot, write_labels_to_annot
  from ..utils import _pl, _safe_input, _validate_type, get_config, get_subjects_dir, logger, set_config, verbose
  from ..utils.docs import _docformat, docdict
  from .config import MNE_DATASETS, _hcp_mmp_license_text
label_desc: Use image node_id 7 for calling a global function with example usage: has_dataset(name) and returns: str