codecov[bot]: # [Codecov](https://codecov.io/gh/mir-dataset-loaders/mirdata/pull/170?src=pr&el=h1) Report
> Merging [#170](https://codecov.io/gh/mir-dataset-loaders/mirdata/pull/170?src=pr&el=desc) into [master](https://codecov.io/gh/mir-dataset-loaders/mirdata/commit/19f00606c820f4b7d83da97109584f8687f2665e&el=desc) will **decrease** coverage by `0.15%`.
> The diff coverage is `n/a`.


```diff
@@            Coverage Diff             @@
##           master     #170      +/-   ##
==========================================
- Coverage   98.37%   98.21%   -0.16%     
==========================================
  Files          17       17              
  Lines        1843     1850       +7     
==========================================
+ Hits         1813     1817       +4     
- Misses         30       33       +3     
```

lostanlen: Done. This passes tests and has 100% diff hit.
I think this is ready for CR.
diff --git a/mirdata/utils.py b/mirdata/utils.py
index 009c776..36053df 100644
--- a/mirdata/utils.py
+++ b/mirdata/utils.py
@@ -62,13 +62,12 @@ def log_message(message, silence=False):
         print(message)
 
 
-def check_index(dataset_index, data_home, silence=False):
+def check_index(dataset_index, data_home):
     """check index to find out missing files and files with invalid checksum
 
     Args:
         dataset_index (list): dataset indices
         data_home (str): Local home path that the dataset is being stored
-        silence (bool)
 
     Returns:
         missing_files (list): List of file paths that are in the dataset index
@@ -103,24 +102,48 @@ def check_index(dataset_index, data_home, silence=False):
 
 
 def validator(dataset_index, data_home, silence=False):
-    """validate.. (todo: what does it do?) """
-    missing_files, invalid_checksums = check_index(dataset_index, data_home, silence)
+    """Checks the existence and validity of files stored locally with
+    respect to the paths and file checksums stored in the reference index.
+    Logs invalid checksums and missing files.
+
+    Args:
+        dataset_index (list): dataset indices
+        data_home (str): Local home path that the dataset is being stored
+        silence (bool): if False (default), prints missing and invalid files
+        to stdout. Otherwise, this function is equivalent to check_index.
+
+    Returns:
+        missing_files (list): List of file paths that are in the dataset index
+            but missing locally.
+        invalid_checksums (list): List of file paths that file exists in the
+            dataset index but has a different checksum compare to the reference
+            checksum.
+    """
+    missing_files, invalid_checksums = check_index(dataset_index, data_home)
 
     # print path of any missing files
+    has_any_missing_file = False
     for track_id in missing_files.keys():
         if len(missing_files[track_id]) > 0:
             log_message('Files missing for {}:'.format(track_id), silence)
             for fpath in missing_files[track_id]:
                 log_message(fpath, silence)
             log_message('-' * 20, silence)
+            has_any_missing_file = True
 
     # print path of any invalid checksums
+    has_any_invalid_checksum = False
     for track_id in invalid_checksums.keys():
         if len(invalid_checksums[track_id]) > 0:
             log_message('Invalid checksums for {}:'.format(track_id), silence)
             for fpath in invalid_checksums[track_id]:
                 log_message(fpath, silence)
             log_message('-' * 20, silence)
+            has_any_invalid_checksum = True
+
+    if not (has_any_missing_file or has_any_invalid_checksum):
+        log_message('Success: the dataset is complete and all files are valid.', silence)
+        log_message('-' * 20, silence)
 
     return missing_files, invalid_checksums
 
diff --git a/setup.py b/setup.py
index da02dc4..0acd6a7 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
 if __name__ == '__main__':
     setup(
         name='mirdata',
-        version='0.1.1',
+        version='0.1.2',
         description='Common loaders for MIR datasets.',
         url='https://github.com/mir-dataset-loaders/mirdata',
         packages=find_packages(exclude=['test', '*.test', '*.test.*']),

utils.validator is undocumented
See: https://github.com/mir-dataset-loaders/mirdata/blob/master/mirdata/utils.py#L106

This is already a to-do in the code, but i figured it deserved its own issue number.
diff --git a/tests/test_utils.py b/tests/test_utils.py
index f1761d2..ebc82cb 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -67,8 +67,7 @@ def test_check_index(test_index, expected_missing, expected_inv_checksum):
         test_index = json.load(index_file)
 
     missing_files, invalid_checksums = utils.check_index(
-        test_index, 'tests/resources/', True
-    )
+        test_index, 'tests/resources/')
 
     assert expected_missing == missing_files
     assert expected_inv_checksum == invalid_checksums
@@ -79,6 +78,7 @@ def test_check_index(test_index, expected_missing, expected_inv_checksum):
     [
         ({'10161_chorus': ['tests/resources/10162_chorus.wav']}, {}),
         ({}, {'10161_chorus': ['tests/resources/10161_chorus.wav']}),
+        ({}, {}),
     ],
 )
 def test_validator(mocker, mock_check_index, missing_files, invalid_checksums):
@@ -87,12 +87,7 @@ def test_validator(mocker, mock_check_index, missing_files, invalid_checksums):
     m, c = utils.validator('foo', 'bar', True)
     assert m == missing_files
     assert c == invalid_checksums
-    mock_check_index.assert_called_once_with('foo', 'bar', True)
-
-    # if missing_files or invalid_checksums:
-    #     mock_create_invalid.assert_called_once_with(missing_files, invalid_checksums)
-    # else:
-    #     mock_create_validated.assert_called_once_with('baz')
+    mock_check_index.assert_called_once_with('foo', 'bar')
 
 
 def test_get_default_dataset_path():

pip install -e .[tests]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-pep8 pytest-mock pytest-localserver testcontainers
apt-get update apt-get install -y gcc
3.7
docs/requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
attrs==24.2.0
audioread==3.0.1
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
coverage==6.5.0
coveralls==3.3.1
DALI-dataset==1.1
decorator==5.1.1
deprecation==2.1.0
docker==6.1.3
docopt==0.6.2
exceptiongroup==1.2.2
execnet==2.0.2
future==0.17.1
idna==3.10
importlib-metadata==6.7.0
importlib-resources==5.12.0
iniconfig==2.0.0
jams==0.3.4
joblib==1.3.2
jsonschema==4.17.3
lazy_loader==0.4
librosa==0.10.2.post1
llvmlite==0.39.1
MarkupSafe==2.1.5
mir_eval==0.8.2
-e git+https://github.com/mir-dataset-loaders/mirdata.git@19f00606c820f4b7d83da97109584f8687f2665e#egg=mirdata
msgpack==1.0.5
numba==0.56.4
numpy==1.21.6
packaging==24.0
pandas==1.3.5
pep8==1.7.1
pkgutil_resolve_name==1.3.10
platformdirs==4.0.0
pluggy==1.2.0
pooch==1.8.2
pycparser==2.21
pyrsistent==0.19.3
pytest==7.4.4
pytest-cache==1.0
pytest-cov==4.1.0
pytest-localserver==0.9.0.post0
pytest-mock==3.11.1
pytest-pep8==1.0.6
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.31.0
resampy==0.4.3
scikit-learn==1.0.2
scipy==1.7.3
six==1.17.0
sortedcontainers==2.4.0
soundfile==0.13.1
soxr==0.3.7
testcontainers==3.7.1
threadpoolctl==3.1.0
tomli==2.0.1
tqdm==4.67.1
typing_extensions==4.7.1
urllib3==2.0.7
websocket-client==1.6.1
Werkzeug==2.2.3
wrapt==1.16.0
youtube-dl==2021.12.17
zipp==3.15.0

name: mirdata
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - attrs==24.2.0
      - audioread==3.0.1
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - coverage==6.5.0
      - coveralls==3.3.1
      - dali-dataset==1.1
      - decorator==5.1.1
      - deprecation==2.1.0
      - docker==6.1.3
      - docopt==0.6.2
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - future==0.17.1
      - idna==3.10
      - importlib-metadata==6.7.0
      - importlib-resources==5.12.0
      - iniconfig==2.0.0
      - jams==0.3.4
      - joblib==1.3.2
      - jsonschema==4.17.3
      - lazy-loader==0.4
      - librosa==0.10.2.post1
      - llvmlite==0.39.1
      - markupsafe==2.1.5
      - mir-eval==0.8.2
      - msgpack==1.0.5
      - numba==0.56.4
      - numpy==1.21.6
      - packaging==24.0
      - pandas==1.3.5
      - pep8==1.7.1
      - pkgutil-resolve-name==1.3.10
      - platformdirs==4.0.0
      - pluggy==1.2.0
      - pooch==1.8.2
      - pycparser==2.21
      - pyrsistent==0.19.3
      - pytest==7.4.4
      - pytest-cache==1.0
      - pytest-cov==4.1.0
      - pytest-localserver==0.9.0.post0
      - pytest-mock==3.11.1
      - pytest-pep8==1.0.6
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.31.0
      - resampy==0.4.3
      - scikit-learn==1.0.2
      - scipy==1.7.3
      - six==1.17.0
      - sortedcontainers==2.4.0
      - soundfile==0.13.1
      - soxr==0.3.7
      - testcontainers==3.7.1
      - threadpoolctl==3.1.0
      - tomli==2.0.1
      - tqdm==4.67.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - websocket-client==1.6.1
      - werkzeug==2.2.3
      - wrapt==1.16.0
      - youtube-dl==2021.12.17
      - zipp==3.15.0
prefix: /opt/conda/envs/mirdata

tests/test_utils.py::test_validator[missing_files0-invalid_checksums0] tests/test_utils.py::test_validator[missing_files1-invalid_checksums1] tests/test_utils.py::test_validator[missing_files2-invalid_checksums2]
tests/test_utils.py::test_get_default_dataset_path
tests/test_utils.py::test_md5 tests/test_utils.py::test_check_index[test_index_valid.json-expected_missing0-expected_inv_checksum0] tests/test_utils.py::test_check_index[test_index_missing_file.json-expected_missing1-expected_inv_checksum1] tests/test_utils.py::test_check_index[test_index_invalid_checksum.json-expected_missing2-expected_inv_checksum2]
setup.py mirdata/utils.py
setup.py mirdata/utils.py