code: def check_images(data_dir: str) -> Tuple[List[str], List[str]]:
      """Iterate through a directory of images and find corrupt images
  
      Args:
          data_dir: Path to the directory containing the images
  
      Returns:
          (healthy_images, corrupt_images)
      """
      dataset = LightlyDataset(input_dir=data_dir)
      filenames = dataset.get_filenames()
  
      def _is_corrupt(filename):
          try:
              image = Image.open(os.path.join(data_dir, filename))
              image.load()
          except (IOError, UnidentifiedImageError):
              return True
          else:
              return False
  
      mapped = concurrent.thread_map(
          _is_corrupt, filenames, chunksize=min(32, len(filenames))
      )
      healthy_images = [
          f
          for f, is_corrupt in zip(filenames, mapped)
          if not is_corrupt
      ]
      corrupt_images = [
          f for f, is_corrupt in zip(filenames, mapped) if is_corrupt
      ]
      return healthy_images, corrupt_images
  
imports: import os
  from typing import *
  import tqdm.contrib.concurrent
  from PIL import Image, UnidentifiedImageError
  from lightly.data import LightlyDataset
label_desc: Use image node_id 1 for calling a global function with example usage: check_images(data_dir) and returns: healthy_images,  corrupt_images, False, True