<commit_before># -*- coding: utf-8 -*-

#-----------------------------------------------------------------------------
#  Copyright (C) 2014  Bokeh Development Team
#
#  The license is in the LICENCE.txt, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

import IPython
from IPython.core.magic import (Magics, magics_class, line_magic)
from IPython.testing.skipdoctest import skip_doctest
from IPython.core.magic_arguments import (argument, magic_arguments,
    parse_argstring)
from IPython.core.error import UsageError
try:
    from bokeh.plotting import (output_notebook, show, hold, figure)
    old_bokeh = False
except ImportError:
    old_bokeh = True

#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------


@magics_class
class BokehMagics(Magics):
    """Magic to embed Bokeh into the IPython notebook."""

    if old_bokeh:
        raise RuntimeError("We are deprecating the Bokeh magic. "
                           "The Bokeh magic will not work with Bokeh versions "
                           "above 0.7.1.")

    if IPython.__version__.startswith("1"):
        is_ipytwo = False
    else:
        is_ipytwo = True

    has_run = False

    @skip_doctest
    @magic_arguments()
    @argument('-n', '--notebook', action="store_true",
              help='This option enable the execution of the Bokeh '
              'output_notebook() funtion.')
    @argument('-f', '--figure', action="store_true",
              help='This option enable the execution of the Bokeh figure() '
              'function at the start of each cell.')<commit_msg>Use the proper exception, DeprecationWarning. Also change the wording.<commit_after># -*- coding: utf-8 -*-

#-----------------------------------------------------------------------------
#  Copyright (C) 2014  Bokeh Development Team
#
#  The license is in the LICENCE.txt, distributed as part of this software.
#-----------------------------------------------------------------------------

#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------

import IPython
from IPython.core.magic import (Magics, magics_class, line_magic)
from IPython.testing.skipdoctest import skip_doctest
from IPython.core.magic_arguments import (argument, magic_arguments,
    parse_argstring)
from IPython.core.error import UsageError
try:
    from bokeh.plotting import (output_notebook, show, hold, figure)
    old_bokeh = False
except ImportError:
    old_bokeh = True

#-----------------------------------------------------------------------------
# Classes and functions
#-----------------------------------------------------------------------------


@magics_class
class BokehMagics(Magics):
    """Magic to embed Bokeh into the IPython notebook."""

    if old_bokeh:
        raise DeprecationWarning("%bokeh magic is deprecated, "
                                 "and will not work in versions > 0.7.1")

    if IPython.__version__.startswith("1"):
        is_ipytwo = False
    else:
        is_ipytwo = True

    has_run = False

    @skip_doctest
    @magic_arguments()
    @argument('-n', '--notebook', action="store_true",
              help='This option enable the execution of the Bokeh '
              'output_notebook() funtion.')
    @argument('-f', '--figure', action="store_true",
              help='This option enable the execution of the Bokeh figure() '
              'function at the start of each cell.')
{'fraction_non_alphanumeric': 0.3145833333333333, 'fraction_numerical': 0.0046875, 'mean_word_length': 1.2890345649582837, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5253973', 'n_tokens_mistral': 955, 'n_tokens_neox': 915, 'n_words': 271}