tessl install tessl/pypi-ipython@9.5.0IPython: Productive Interactive Computing - An advanced interactive computing environment and command shell for Python.
Agent Success
Agent success rate when using this tile
86%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.09x
Baseline
Agent success rate without this tile
79%
Build a Python module that creates a rich content viewer which can display different types of media content in an IPython/Jupyter environment. The viewer should support HTML snippets, images from various sources, and videos.
The viewer should be able to render HTML content.
"<h1>Hello World</h1><p>This is a test.</p>", the viewer displays it as formatted HTML @testThe viewer should be able to display images from remote URLs.
The viewer should be able to display images from the local filesystem.
The viewer should be able to embed video content.
@generates
"""
Rich content viewer for IPython/Jupyter environments.
"""
class RichContentViewer:
"""
A viewer class for displaying various types of rich media content in IPython/Jupyter.
"""
def display_html(self, html_string: str) -> None:
"""
Display HTML content.
Args:
html_string: HTML string to display
"""
pass
def display_image_from_url(self, url: str, width: int = None) -> None:
"""
Display an image from a URL.
Args:
url: URL to the image
width: Optional width in pixels for the displayed image
"""
pass
def display_image_from_file(self, filepath: str) -> None:
"""
Display an image from a local file.
Args:
filepath: Path to the local image file
Raises:
FileNotFoundError: If the file does not exist
"""
pass
def display_video(self, url: str, width: int = None, height: int = None) -> None:
"""
Display a video player for the given video URL.
Args:
url: URL to the video file
width: Optional width in pixels for the video player
height: Optional height in pixels for the video player
"""
passProvides rich display capabilities for rendering HTML, images, and videos in interactive environments.
@satisfied-by