code: def good_and_bad_cache(tmp_dir, dvc):
      tmp_dir.dvc_gen("foo", "foo")
      (stage,) = tmp_dir.dvc_gen(
          "data",
          {
              "sub": {
                  "data_sub": "data_sub",
                  "data": "data",
                  "тест": "проверка",
              }
          },
      )
      raw_dir_hash = stage.outs[0].hash_info.as_raw().value
      odb = dvc.cache.local
  
      bad_cache = {raw_dir_hash}
      for i in ["123", "234", "345"]:
          odb.add_bytes(i, i.encode("utf8"))
          bad_cache.add(i)
  
      good_cache = {md5 for md5 in odb.all() if md5 not in bad_cache}
      return good_cache, bad_cache
  
imports: import datetime
  import logging
  import os
  import shutil
  import textwrap
  import pytest
  from dvc.cli import main
  from dvc.exceptions import CollectCacheError, InvalidArgumentError, RevCollectionError
  from dvc.fs import LocalFileSystem
  from dvc.utils.fs import remove
  from dvc_data.hashfile.db.local import LocalHashFileDB
label_desc: Use image node_id 1 for calling a global function with example usage: good_and_bad_cache(tmp_dir, dvc) and returns: good_cache,  bad_cache