code: def test_check_dates_invalid_date():
      skip_if_no_module("dateutil")
  
      with swallow_outputs() as cmo:
          assert_raises(
              IncompleteResultsError,
              check_dates,
              [],
              reference_date="not a valid date",
              return_type="list",
          )
          out = cmo.out
      # The error makes it through the standard renderer.
      assert_in('"status": "error"', out)
  
file_path: datalad/datalad/local/tests/test_check_dates.py
imports: import json
  import logging
  import os
  from functools import partial
  from datalad.api import check_dates
  from datalad.support.annexrepo import AnnexRepo
  from datalad.support.exceptions import IncompleteResultsError
  from datalad.support.tests.test_repodates import set_date
  from datalad.tests.utils_pytest import assert_dict_equal, assert_false, assert_in, assert_raises, eq_, ok_, skip_if_no_module, with_tree
  from datalad.utils import chpwd, swallow_logs, swallow_outputs
label_desc: Use image node_id 2 for calling a global function with example usage: test_check_dates_invalid_date() without return types