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

Method _validate_data

IPython/core/displaypub.py:43–58  ·  view source on GitHub ↗

Validate the display data. Parameters ---------- data : dict The formata data dictionary. metadata : dict Any metadata for the data.

(self, data, metadata=None)

Source from the content-addressed store, hash-verified

41 super().__init__(*args, **kwargs)
42
43 def _validate_data(self, data, metadata=None):
44 """Validate the display data.
45
46 Parameters
47 ----------
48 data : dict
49 The formata data dictionary.
50 metadata : dict
51 Any metadata for the data.
52 """
53
54 if not isinstance(data, dict):
55 raise TypeError('data must be a dict, got: %r' % data)
56 if metadata is not None:
57 if not isinstance(metadata, dict):
58 raise TypeError('metadata must be a dict, got: %r' % data)
59
60 # use * to indicate transient, update are keyword-only
61 def publish(self, data, metadata=None, source=None, *, transient=None, update=False, **kwargs) -> None:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected