MCPcopy Index your code
hub / github.com/ipython/ipython / warn

Method warn

IPython/core/display.py:433–443  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

431
432 def __init__(self, data=None, url=None, filename=None, metadata=None):
433 def warn():
434 if not data:
435 return False
436
437 #
438 # Avoid calling lower() on the entire data, because it could be a
439 # long string and we're only interested in its beginning and end.
440 #
441 prefix = data[:10].lower()
442 suffix = data[-10:].lower()
443 return prefix.startswith("<iframe ") and suffix.endswith("</iframe>")
444
445 if warn():
446 warnings.warn("Consider using IPython.display.IFrame instead")

Callers 15

embed_kernelFunction · 0.80
getdefaultencodingFunction · 0.80
__init__Method · 0.80
__getattr__Function · 0.80
uniq_stableFunction · 0.80
_pylab_changedMethod · 0.80
mainloopMethod · 0.80
inputhookFunction · 0.80
_trigger_llmMethod · 0.80
set_colorsMethod · 0.80

Calls

no outgoing calls

Tested by 1

_mock_aware_unwrapFunction · 0.64