def METHOD_NAME():
  try:
    # `get_ipython` is automatically present in the environment when
    # running in a notebook.
    get_ipython()  # pytype: disable=name-error
    return True
  except NameError:
    return False