def get_image_classes(self, with_operation=None, available=None):
        image_classes = self._registered_image_classes.copy()

        if with_operation:
            image_classes = set(filter(lambda image_class: image_class in self._registered_operations and with_operation in self._registered_operations[image_class], image_classes))

            if not image_classes:
                raise UnrecognisedOperationError("Could not find image class with the '{0}' operation".format(with_operation))

        if available:
            # Remove unavailable image classes
            available_image_classes = set(self._unavailable_image_classes.keys()) - image_classes

            # Raise error if all image classes failed the check
            if not available_image_classes:
                raise UnavailableOperationError('\n'.join([
                    "The operation '{0}' is available in the following image classes but they all raised errors:".format(with_operation)
                ] + [
                    "{image_class_name}: {error_message}".format(
                        image_class_name=image_class.__name__,
                        error_message=str(self._unavailable_image_classes.get(image_class, "Unknown error"))
                    )
                    for image_class in image_classes
                ]))

            return available_image_classes
        else:
            return image_classes

    # Routing

    # In some cases, it may not be possible to convert directly between two
    # image classes, so we need to use one or more intermediate classes in order
    # to get to where we want to be.

    # For example, the OpenCV plugin doesn't load JPEG images, so the image
    # needs to be loaded into either Pillow or Wand first and converted to
    # OpenCV.

    # Using a routing algorithm, we're able to work out the best path to take.
dataset/ETHPy150Open torchbox/Willow/willow/registry.py/WillowRegistry.get_image_classes/swapped operands of `-`