MCPcopy Index your code
hub / github.com/e2b-dev/code-interpreter / test_display_data

Function test_display_data

python/tests/test_display_data.py:4–23  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2
3
4def test_display_data():
5 with CodeInterpreter() as sandbox:
6 # plot random graph
7 result = sandbox.notebook.exec_cell(
8 """
9 import matplotlib.pyplot as plt
10 import numpy as np
11
12 x = np.linspace(0, 20, 100)
13 y = np.sin(x)
14
15 plt.plot(x, y)
16 plt.show()
17 """
18 )
19
20 # there's your image
21 image = result.display_data[0]
22 assert "image/png" in image
23 assert "text/plain" in image

Callers

nothing calls this directly

Calls 2

CodeInterpreterClass · 0.90
exec_cellMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…