()
| 702 | |
| 703 | def __init__(self, data=None, url=None, filename=None, metadata=None): |
| 704 | def warn(): |
| 705 | if not data: |
| 706 | return False |
| 707 | |
| 708 | # |
| 709 | # Avoid calling lower() on the entire data, because it could be a |
| 710 | # long string and we're only interested in its beginning and end. |
| 711 | # |
| 712 | prefix = data[:10].lower() |
| 713 | suffix = data[-10:].lower() |
| 714 | return prefix.startswith("<iframe ") and suffix.endswith("</iframe>") |
| 715 | |
| 716 | if warn(): |
| 717 | warnings.warn("Consider using IPython.display.IFrame instead") |
no outgoing calls
no test coverage detected