Return the image as a mimebundle Any new mimetype support should be implemented here.
(self, include=None, exclude=None)
| 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""" |
nothing calls this directly
no test coverage detected