code: def load_data(dataset=None, data_home=None):
      """Load a dataset.
  
      Run with no parameters to get a list of all available data sets.
  
      The directory to save can also be set with the environment variable ``BAMBI_HOME``.
      The checksum of the dataset is checked against a hardcoded value to watch for data corruption.
      Run ``bmb.clear_data_home()`` to clear the data directory.
  
      Parameters
      ----------
      dataset: str
          Name of dataset to load.
      data_home: str, optional
          Where to save remote datasets
  
      Returns
      -------
      pandas.DataFrame
      """
      home_dir = get_data_home(data_home=data_home)
  
      if dataset in DATASETS:
          datafile = DATASETS[dataset]
          file_path = os.path.join(home_dir, datafile.filename)
  
          if not os.path.exists(file_path):
              urlretrieve(datafile.url, file_path)
              checksum = _sha256(file_path)
              if datafile.checksum != checksum:
                  raise IOError(
                      f"{file_path} has an SHA256 checksum ({checksum}) differing from expected "
                      f"({datafile.checksum}), file may be corrupted. Run `bambi.clear_data_home()` "
                      "and try again, or please open an issue."
                  )
          return pd.read_csv(file_path)
      else:
          if dataset is None:
              return _list_datasets(home_dir)
          else:
              raise ValueError(
                  f"Dataset {dataset} not found! "
                  f"The following are available:\n{_list_datasets(home_dir)}"
              )
  
file_path: bambi/bambi/data/datasets.py
imports: import hashlib
  import itertools
  import os
  import shutil
  from collections import namedtuple
  from urllib.request import urlretrieve
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: load_data(dataset, data_home) and returns: pd, _list_datasets