internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: bokeh/bokeh

Issue:
Themes not applied in `file_html`
Latest version (0.12.5 and master) only apply themes in `bokeh.embed.components`

I've added a trivial fix, see attached pull request




Discussion:

Resolving patch:
diff --git a/bokeh/embed.py b/bokeh/embed.py
--- a/bokeh/embed.py
+++ b/bokeh/embed.py
@@ -386,7 +386,8 @@ def file_html(models,
               resources,
               title=None,
               template=FILE,
-              template_variables={}):
+              template_variables={},
+              theme=FromCurdoc):
     ''' Return an HTML document that embeds Bokeh Model or Document objects.
 
     The data for the plot is stored directly in the returned HTML, with
@@ -405,6 +406,11 @@ def file_html(models,
         template_variables (dict, optional) : variables to be used in the Jinja2
             template. If used, the following variable names will be overwritten:
             title, bokeh_js, bokeh_css, plot_script, plot_div
+        theme (Theme, optional) :
+            Defaults to the ``Theme`` instance in the current document.
+            Setting this to ``None`` uses the default theme or the theme
+            already specified in the document. Any other value must be an
+            instance of the ``Theme`` class.
 
     Returns:
         UTF-8 encoded HTML
@@ -412,7 +418,7 @@ def file_html(models,
     '''
     models = _check_models(models)
 
-    with _ModelInDocument(models):
+    with _ModelInDocument(models, apply_theme=theme):
         (docs_json, render_items) = _standalone_docs_json_and_render_items(models)
         title = _title_from_models(models, title)
         bundle = _bundle_for_objs_and_resources(models, resources)


Test patch:
Repository: bokeh/bokeh

Issue:
Fix deprecated datetime64 use for NP_EPOCH
From https://github.com/numpy/numpy/pull/6453 this causes a deprecation warning.
/cc @shoyer


Discussion:

Resolving patch:
diff --git a/bokeh/core/json_encoder.py b/bokeh/core/json_encoder.py
--- a/bokeh/core/json_encoder.py
+++ b/bokeh/core/json_encoder.py
@@ -49,8 +49,8 @@
 pd = import_optional('pandas')
 rd = import_optional("dateutil.relativedelta")
 
-NP_EPOCH = np.datetime64('1970-01-01T00:00:00Z')
-NP_MS_DELTA = np.timedelta64(1, 'ms')
+_NP_EPOCH = np.datetime64(0, 'ms')
+_NP_MS_DELTA = np.timedelta64(1, 'ms')
 
 class BokehJSONEncoder(json.JSONEncoder):
     ''' A custom ``json.JSONEncoder`` subclass for encoding objects in
@@ -93,8 +93,8 @@ def transform_python_types(self, obj):
 
         # Numpy datetime64
         elif isinstance(obj, np.datetime64):
-            epoch_delta = obj - NP_EPOCH
-            return (epoch_delta / NP_MS_DELTA)
+            epoch_delta = obj - _NP_EPOCH
+            return (epoch_delta / _NP_MS_DELTA)
 
         # Time
         elif isinstance(obj, dt.time):


Test patch:
Repository: bokeh/bokeh

Issue:
[ENH] Help widget tuned for end user
Enhancement request:

The "help" widget seems useful, except it takes the user to a developer-oriented documentation page with code examples.  If it were possible to have an end-user-centric page that would be a preferable destination.  Something that concisely described how to interact with a Bokeh plot and how the widgets work.  If it were possible to have a "targeted" page that only described the widgets on a particular plot that would be great.


Discussion:
I don't really see how we could make a targeted page for only the tools of the plot easily but we could certainly make a less dev-centric page (or perhaps section) that covered all the tools. 

The help url is configurable if that helps?

Resolving patch:
diff --git a/bokeh/models/tools.py b/bokeh/models/tools.py
--- a/bokeh/models/tools.py
+++ b/bokeh/models/tools.py
@@ -829,7 +829,7 @@ class HoverTool(Inspection):
     """)
 
 DEFAULT_HELP_TIP = "Click the question mark to learn more about Bokeh plot tools."
-DEFAULT_HELP_URL = "http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html"
+DEFAULT_HELP_URL = "http://bokeh.pydata.org/en/latest/docs/user_guide/tools.html#built-in-tools"
 
 class HelpTool(Action):
     ''' A button tool to provide a "help" link to users.


Test patch:
Repository: bokeh/bokeh

Issue:
embed multiple sample data mismatch length
#### ALL software version info (bokeh, python, notebook, OS, browser, any other relevant packages)
bokeh 0.12.5
python 3.6
OS: windows 7
browser: firefox
using django

#### Description of expected behavior and the observed behavior
expected behavior: would expect the examples to not produce any warning logs.

#### Complete, minimal, self-contained example code that reproduces the issue
working through the issue at 
https://github.com/bokeh/bokeh/blob/master/examples/embed/embed_multiple.py

also present in the components documentation:
http://bokeh.pydata.org/en/latest/docs/user_guide/embed.html#components

see pull request
#### Stack traceback and/or browser JavaScript console output
(see below)

#### Screenshots or screencasts of the bug in action
![bokeh_example_issue_documentation](https://cloud.githubusercontent.com/assets/22264476/25818910/037d4622-33e1-11e7-9479-60e292dfdb73.jpg)



Discussion:

Resolving patch:
diff --git a/examples/embed/embed_multiple.py b/examples/embed/embed_multiple.py
--- a/examples/embed/embed_multiple.py
+++ b/examples/embed/embed_multiple.py
@@ -9,7 +9,7 @@
 from bokeh.util.browser import view
 
 # create some data
-x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+x1 = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12]
 y1 = [0, 8, 2, 4, 6, 9, 5, 6, 25, 28, 4, 7]
 x2 = [2, 5, 7, 15, 18, 19, 25, 28, 9, 10, 4]
 y2 = [2, 4, 6, 9, 15, 18, 0, 8, 2, 25, 28]


Test patch:
Repository: bokeh/bokeh

Issue:
Missing docstring description of ``state`` arg in bokeh.io.save
Missing docstring description of ``state`` arg in bokeh.io.save

Bokeh master


Discussion:

Resolving patch:
diff --git a/bokeh/io.py b/bokeh/io.py
--- a/bokeh/io.py
+++ b/bokeh/io.py
@@ -186,7 +186,7 @@ def curdoc():
     ''' Return the document for the current default state.
 
     Returns:
-        doc : the current default document object.
+        Document : the current default document object.
 
     '''
     return _state.document
@@ -195,7 +195,7 @@ def curstate():
     ''' Return the current State object
 
     Returns:
-      state : the current default State object
+      State : the current default State object
 
     '''
     return _state
@@ -365,8 +365,12 @@ def save(obj, filename=None, resources=None, title=None, state=None, **kwargs):
             If None, use the default state title value, if there is one.
             Otherwise, use "Bokeh Plot"
 
+         state (State, optional) :
+            A :class:`State` object. If None, then the current default
+            implicit state is used. (default: None).
+
     Returns:
-        filename (str) : the filename where the HTML file is saved.
+        str: the filename where the HTML file is saved.
 
     '''
 
@@ -457,10 +461,11 @@ def push_notebook(document=None, state=None, handle=None):
 
         document (Document, optional) :
             A :class:`~bokeh.document.Document` to push from. If None,
-            uses ``curdoc()``.
+            uses ``curdoc()``. (default: None)
 
         state (State, optional) :
-            A Bokeh State object
+            A :class:`State` object. If None, then the current default
+            state (set by ``output_file``, etc.) is used. (default: None)
 
     Returns:
         None
@@ -528,9 +533,9 @@ def _remove_roots(subplots):
             doc.remove_root(sub)
 
 def _server_cell(server, script):
-    '''
-    Wraps a script returned by autoload_server in a div that allows cell
+    ''' Wrap a script returned by ``autoload_server`` in a div that allows cell
     destruction/replacement to be detected.
+
     '''
     divid = uuid.uuid4().hex
     _state.uuid_to_server[divid] = server
@@ -544,9 +549,9 @@ def _server_cell(server, script):
 """
 
 def _destroy_server(div_id):
-    '''
-    Given a uuid id of a div removed or replaced in the Jupyter
+    ''' Given a UUID id of a div removed or replaced in the Jupyter
     notebook, destroy the corresponding server sessions and stop it.
+
     '''
     server = _state.uuid_to_server.get(div_id, None)
     if server is None:


Test patch:
Repository: bokeh/bokeh

Issue:
Add user guide documentation for bokeh.io.export
Add user guide documentation for bokeh.io.export including
* Example code
* Example output
* Dependency installation instructions


Discussion:

Resolving patch:
diff --git a/bokeh/io.py b/bokeh/io.py
--- a/bokeh/io.py
+++ b/bokeh/io.py
@@ -646,6 +646,9 @@ def export(obj, filename=None):
         Responsive sizing_modes may generate layouts with unexpected size and
         aspect ratios. It is recommended to use the default ``fixed`` sizing mode.
 
+    .. warning::
+        Glyphs that are rendered via webgl won't be included in the generated PNG.
+
     '''
     image = _get_screenshot_as_png(obj)
 


Test patch:
Repository: bokeh/bokeh

Issue:
Enabling/ Disabling re-ordering of columns in DataTable (freezing columns in place)
Just putting in a simple request to allow the user to specify whether the columns in a DataTable can  be re-ordered or not. Currently the user can always move the columns around, but sometimes you may want to freeze say the first column or all columns in their initial positions within the table.

As Bryan pointed out, the option is currently hard coded and could easily be exposed. (https://github.com/bokeh/bokeh/blob/master/bokehjs/src/coffee/models/widgets/data_table.coffee#L158)


Discussion:

Resolving patch:
diff --git a/bokeh/models/widgets/tables.py b/bokeh/models/widgets/tables.py
--- a/bokeh/models/widgets/tables.py
+++ b/bokeh/models/widgets/tables.py
@@ -354,6 +354,12 @@ class DataTable(TableWidget):
     Shift + click to sort multiple columns simultaneously.
     """)
 
+    reorderable = Bool(True, help="""
+    Allows the reordering of a tables's columns. To reorder a column,
+    click and drag a table's header to the desired location in the table.
+    The columns on either side will remain in their previous order.
+    """)
+
     editable = Bool(False, help="""
     Allows to edit table's contents. Needs cell editors to be configured on
     columns that are required to be editable.


Test patch:
Repository: bokeh/bokeh

Issue:
Report tornado version on Bokeh server startup
Useful for debugging in some cases. 


Discussion:
Propose to change first log statement here:

https://github.com/bokeh/bokeh/blob/master/bokeh/server/server.py#L85

to read, e.g
```
Starting Bokeh server version 0.12.5 (running on Tornado 4.5)
```


Resolving patch:
diff --git a/bokeh/server/server.py b/bokeh/server/server.py
--- a/bokeh/server/server.py
+++ b/bokeh/server/server.py
@@ -8,6 +8,7 @@
 log = logging.getLogger(__name__)
 import signal
 
+import tornado
 from tornado.httpserver import HTTPServer
 from tornado.ioloop import IOLoop
 from tornado import netutil
@@ -82,7 +83,7 @@ class Server(object):
     '''
 
     def __init__(self, applications, io_loop=None, **kwargs):
-        log.info("Starting Bokeh server version %s" % __version__)
+        log.info("Starting Bokeh server version %s (running on Tornado %s)" % (__version__, tornado.version))
 
         if isinstance(applications, Application):
             self._applications = { '/' : applications }


Test patch:
Repository: bokeh/bokeh

Issue:
Bokeh server does not close HTTP sockets
It will print out ResourceWarnings if such warnings are enabled.
It seems adding `self._http.stop()` at the end of `Server.stop` is enough to fix the issue.
Bokeh server does not close HTTP sockets
It will print out ResourceWarnings if such warnings are enabled.
It seems adding `self._http.stop()` at the end of `Server.stop` is enough to fix the issue.


Discussion:
A small PR would be appreciated
A small PR would be appreciated

Resolving patch:
diff --git a/bokeh/server/server.py b/bokeh/server/server.py
--- a/bokeh/server/server.py
+++ b/bokeh/server/server.py
@@ -189,6 +189,7 @@ def stop(self, wait=True):
         assert not self._stopped, "Already stopped"
         self._stopped = True
         self._tornado.stop(wait)
+        self._http.stop()
 
     def run_until_shutdown(self):
         ''' Run the Bokeh Server until shutdown is requested by the user,


Test patch:
Repository: bokeh/bokeh

Issue:
Scale/Range incompatibility in examples/models/server/population.py
in master:

Scale/Range incompatibility in examples/models/server/population.py


Discussion:

Resolving patch:
diff --git a/examples/models/server/population.py b/examples/models/server/population.py
--- a/examples/models/server/population.py
+++ b/examples/models/server/population.py
@@ -56,9 +56,9 @@ def pyramid():
 def population():
     xdr = FactorRange(factors=years)
     ydr = DataRange1d()
-    y_scale = CategoricalScale()
+    x_scale = CategoricalScale()
 
-    plot = Plot(x_range=xdr, y_range=ydr, y_scale=y_scale, plot_width=600, plot_height=150, toolbar_location=None)
+    plot = Plot(x_range=xdr, y_range=ydr, x_scale=x_scale, plot_width=600, plot_height=150, toolbar_location=None)
 
     plot.add_layout(CategoricalAxis(major_label_orientation=pi / 4), 'below')
 


Test patch:
Repository: bokeh/bokeh

Issue:
Re-building docs - KeyError gallery exception
Bokeh - all versions.
Env: anaconda on win 64 python 3
When building first time  - all is good.
Next round gives following error:
Output:
`Running Sphinx v1.4.8
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 0 source files that are out of date
updating environment: 30 added, 6 changed, 29 removed
bk_script_f0df36cdd9f143e087b632c47702ab71:41: RuntimeWarning: divide by zero encountered in divide
bk_script_f0df36cdd9f143e087b632c47702ab71:41: RuntimeWarning: divide by zero encountered in log
bk_script_f0df36cdd9f143e087b632c47702ab71:41: RuntimeWarning: invalid value encountered in multiply
bk_script_f0df36cdd9f143e087b632c47702ab71:42: RuntimeWarning: divide by zero encountered in log
reading sources... [100%] index
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
adding links to sitemap... [100%] http://bokeh.pydata.org/en/0.12.6dev6/docs/reference/models/markers.html
copying bokeh-plot files... [100%] bokeh-plot-ff7d4e4a58f23d8a18428273c04d26ea.js.jsternal-0.jssss0.js-0.js

Exception occurred:
  File "C:\Users\Maxim\Anaconda3\envs\docs-unified\lib\site-packages\Sphinx-1.4.8-py2.7.egg\sphinx\environment.py", line 1210, in get_toc_for
    tocdepth = self.metadata[docname].get('tocdepth', 0)
KeyError: u'docs\\gallery\\anscombe'
The full traceback has been saved in c:\users\maxim\appdata\local\temp\sphinx-err-7ognmc.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!`

After that "pickled environment" file is removed and next make html passes ok but it builds everything again.





Discussion:

Resolving patch:
diff --git a/bokeh/sphinxext/bokeh_gallery.py b/bokeh/sphinxext/bokeh_gallery.py
--- a/bokeh/sphinxext/bokeh_gallery.py
+++ b/bokeh/sphinxext/bokeh_gallery.py
@@ -41,7 +41,9 @@ def run(self):
         for detail in details_iter:
             src_path = abspath(join("..", detail['path']))
             dest_path = join(dest_dir, detail['name'] + ".py")
-            docname = join("docs", "gallery", detail['name'])
+
+            # sphinx pickled env works only with forward slash
+            docname = join(env.app.config.bokeh_gallery_dir, detail['name']).replace("\\","/")
 
             try:
                 copyfile(src_path, dest_path)
@@ -66,5 +68,6 @@ def env_updated_handler(app, env):
     return getattr(env, 'gallery_updated', [])
 
 def setup(app):
+    app.add_config_value('bokeh_gallery_dir', join("docs", "gallery"), 'html')
     app.connect('env-updated', env_updated_handler)
     app.add_directive('bokeh-gallery', BokehGalleryDirective)


Test patch:
Repository: bokeh/bokeh

Issue:
Feature request: configurable maximum upload size for Tornado server
I'd like to lift the default maximum Tornado upload size of 100MB. This requires adding a limit to [server.Server](https://github.com/bokeh/bokeh/blob/master/bokeh/server/server.py#L85), which then passes it to [tornado.httpserver.HTTPServer](https://github.com/bokeh/bokeh/blob/master/bokeh/server/server.py#L131) as `max_buffer_size=`.


Discussion:
@bkueng I'd be happy to accept a PR that makes this parameter configurable. 
Ok, I'll do that

Resolving patch:
diff --git a/bokeh/server/server.py b/bokeh/server/server.py
--- a/bokeh/server/server.py
+++ b/bokeh/server/server.py
@@ -80,9 +80,14 @@ class Server(object):
     Kwargs:
         num_procs (str):
             Number of worker processes for an app. Default to one. Using 0 will autodetect number of cores
+        tornado_server_kwargs (dict):
+            Additional arguments passed to tornado.httpserver.HTTPServer. E.g. max_buffer_size to
+            specify the maximum upload size. More details can be found at:
+
+            http://www.tornadoweb.org/en/stable/httpserver.html#http-server
     '''
 
-    def __init__(self, applications, io_loop=None, **kwargs):
+    def __init__(self, applications, io_loop=None, tornado_server_kwargs=None, **kwargs):
         log.info("Starting Bokeh server version %s (running on Tornado %s)" % (__version__, tornado.version))
 
         if isinstance(applications, Application):
@@ -115,6 +120,10 @@ def __init__(self, applications, io_loop=None, **kwargs):
         port = kwargs.get('port', DEFAULT_SERVER_PORT)
         self._address = kwargs.get('address') or None
 
+        if tornado_server_kwargs is None:
+            tornado_server_kwargs = {}
+        tornado_server_kwargs.setdefault('xheaders', kwargs.get('use_xheaders', False))
+
         self._num_procs = kwargs.get('num_procs', 1)
         if self._num_procs != 1:
             assert all(app.safe_to_fork for app in self._applications.values()), (
@@ -128,7 +137,7 @@ def __init__(self, applications, io_loop=None, **kwargs):
             tornado_kwargs['redirect_root'] = kwargs.get('redirect_root', True)
 
             self._tornado = BokehTornado(self._applications, self.prefix, **tornado_kwargs)
-            self._http = HTTPServer(self._tornado, xheaders=kwargs.get('use_xheaders', False))
+            self._http = HTTPServer(self._tornado, **tornado_server_kwargs)
             self._http.start(self._num_procs)
             self._http.add_sockets(sockets)
 


Test patch:
Repository: bokeh/bokeh

Issue:
webgl isn't correctly deprecated bokeh 0.12.6dev7
Bokeh 0.12.6dev7

``figure(webgl=True)`` raises a property error instead of coercing the kwarg to output_backend and loggings a warn.


Discussion:

Resolving patch:
diff --git a/bokeh/models/plots.py b/bokeh/models/plots.py
--- a/bokeh/models/plots.py
+++ b/bokeh/models/plots.py
@@ -33,6 +33,8 @@ class Plot(LayoutDOM):
 
     '''
 
+    __deprecated_attributes__ = ["webgl", "x_mapper_type", "y_mapper_type"]
+
     def __init__(self, **kwargs):
         if "tool_events" not in kwargs:
             kwargs["tool_events"] = ToolEvents()
@@ -52,15 +54,9 @@ def __init__(self, **kwargs):
         if "x_mapper_type" in kwargs and "x_scale" in kwargs:
             raise ValueError("Conflicting properties set on plot: x_mapper_type, x_scale.")
 
-        elif "x_mapper_type" in kwargs:
-            kwargs["x_scale"] = self._scale(kwargs.pop("x_mapper_type"))
-
         if "y_mapper_type" in kwargs and "y_scale" in kwargs:
             raise ValueError("Conflicting properties set on plot: y_mapper_type, y_scale")
 
-        elif "y_mapper_type" in kwargs:
-            kwargs["y_scale"] = self._scale(kwargs.pop("y_mapper_type"))
-
         super(LayoutDOM, self).__init__(**kwargs)
 
     def select(self, *args, **kwargs):


Test patch:
Repository: bokeh/bokeh

Issue:
remove the hover menu item, and keep the hover function working

Feature request.

I would like to remove the hover menu item, and keep the hover function working




Discussion:
@mattpap could this be implemented quickly for `0.12.5` ? This would open a viable workaround for users that have many hovertools until we can implement the "combined" menu item
Tentatively adding to `0.12.5` in case it is feasible

Resolving patch:
diff --git a/bokeh/models/tools.py b/bokeh/models/tools.py
--- a/bokeh/models/tools.py
+++ b/bokeh/models/tools.py
@@ -90,7 +90,11 @@ class Inspection(Tool):
     ''' A base class for tools that perform "inspections", e.g. ``HoverTool``.
 
     '''
-    pass
+    toggleable = Bool(True, help="""
+    Whether an on/off toggle button should appear in the toolbar for this
+    inpection tool. If ``False``, the viewers of a plot will not be able to
+    toggle the inspector on or off using the toolbar.
+    """)
 
 @abstract
 class ToolbarBase(LayoutDOM):


Test patch:
Repository: bokeh/bokeh

Issue:
matches() is broken when pandas is not installed
For example `models/server/buttons` fail with:
```
Traceback (most recent call last):
  File "examples/models/server/buttons.py", line 5, in <module>
    from bokeh.models.layouts import WidgetBox
  File "/home/mateusz/repos/bokeh/bokeh/models/__init__.py", line 5, in <module>
    from .annotations import *
  File "/home/mateusz/repos/bokeh/bokeh/models/annotations.py", line 488, in <module>
    class Band(Annotation):
  File "/home/mateusz/repos/bokeh/bokeh/models/annotations.py", line 511, in Band
    """)
  File "/home/mateusz/repos/bokeh/bokeh/core/properties.py", line 417, in __init__
    super(Instance, self).__init__(default=default, help=help)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/bases.py", line 66, in __init__
    self.validate(self._raw_default())
  File "/home/mateusz/repos/bokeh/bokeh/core/property/bases.py", line 134, in _raw_default
    return self._copy_default(self._default)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/bases.py", line 124, in _copy_default
    return default()
  File "/home/mateusz/repos/bokeh/bokeh/models/annotations.py", line 509, in <lambda>
    source = Instance(DataSource, default=lambda: ColumnDataSource(), help="""
  File "/home/mateusz/repos/bokeh/bokeh/models/sources.py", line 110, in __init__
    self.column_names[:] = list(raw_data.keys())
  File "/home/mateusz/repos/bokeh/bokeh/core/property/containers.py", line 77, in wrapper
    self._notify_owners(old)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/containers.py", line 104, in _notify_owners
    prop._notify_mutated(owner, old, hint)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/descriptors.py", line 815, in _notify_mutated
    self._real_set(obj, old, value, hint)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/descriptors.py", line 749, in _real_set
    unchanged = self.property.matches(value, old) and (hint is None)
  File "/home/mateusz/repos/bokeh/bokeh/core/property/bases.py", line 184, in matches
    if pd and isinstance(new, pd.Series) or isinstance(old, pd.Series):
AttributeError: 'NoneType' object has no attribute 'Series'
```
The condition should read `pd and (...)`.



Discussion:

Resolving patch:
diff --git a/bokeh/core/property/bases.py b/bokeh/core/property/bases.py
--- a/bokeh/core/property/bases.py
+++ b/bokeh/core/property/bases.py
@@ -181,11 +181,12 @@ def matches(self, new, old):
         if isinstance(new, np.ndarray) or isinstance(old, np.ndarray):
             return np.array_equal(new, old)
 
-        if pd and isinstance(new, pd.Series) or isinstance(old, pd.Series):
-            return np.array_equal(new, old)
+        if pd:
+            if isinstance(new, pd.Series) or isinstance(old, pd.Series):
+                return np.array_equal(new, old)
 
-        if pd and isinstance(new, pd.Index) or isinstance(old, pd.Index):
-            return np.array_equal(new, old)
+            if isinstance(new, pd.Index) or isinstance(old, pd.Index):
+                return np.array_equal(new, old)
 
         try:
 


Test patch: