def in_ipython() -> bool:
    """
    Check whether we're in an ipython environment, including jupyter notebooks.
    """
    try:
        eval('__IPYTHON__')
    except NameError:
        return False
    else:  # pragma: no cover
        return True

    Check whether we're in an ipython environment, including jupyter notebooks.
    
pydantic/v1/utils.py