code: def open_image(fname_or_instance: Union[str, IO[bytes]]):
      
      if isinstance(fname_or_instance, Image.Image):
          return fname_or_instance
  
      return Image.open(fname_or_instance)
docs: Opens a Image and returns it.
  
      :param fname_or_instance: Can either be the location of the image as a
                                string or the Image.Image instance itself.