<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def load_images(image_paths: Iterable[Union[str, Path]] ) -> Iterable[SpatialImage]: """Load images from paths. For efficiency, returns an iterator, not a sequence, so the results cannot be accessed by indexing. For every new iteration through the images, load_images must be called again. Parameters image_paths: Paths to images. Yields ------ SpatialImage Image. """

    for image_path in image_paths:
        if isinstance(image_path, Path):
            string_path = str(image_path)
        else:
            string_path = image_path
        logger.debug(
            'Starting to read file %s', string_path
        )
        yield nib.load(string_path)