MCPcopy Create free account
hub / github.com/ipython/ipython / _repr_mimebundle_

Method _repr_mimebundle_

IPython/core/display.py:1276–1288  ·  view source on GitHub ↗

Return the image as a mimebundle Any new mimetype support should be implemented here.

(self, include=None, exclude=None)

Source from the content-addressed store, hash-verified

1274 )
1275
1276 def _repr_mimebundle_(self, include=None, exclude=None):
1277 """Return the image as a mimebundle
1278
1279 Any new mimetype support should be implemented here.
1280 """
1281 if self.embed:
1282 mimetype = self._mimetype
1283 data, metadata = self._data_and_metadata(always_both=True)
1284 if metadata:
1285 metadata = {mimetype: metadata}
1286 return {mimetype: data}, metadata
1287 else:
1288 return {'text/html': self._repr_html_()}
1289
1290 def _data_and_metadata(self, always_both=False):
1291 """shortcut for returning metadata with shape information, if defined"""

Callers

nothing calls this directly

Calls 2

_data_and_metadataMethod · 0.95
_repr_html_Method · 0.95

Tested by

no test coverage detected