class_docstr: Check if the GIL is properly released by scipy.interpolate functions.
class_docstr_tok: ["Check","if","the","GIL","is","properly","released","by","scipy.interpolate","functions","."]
code: def test_rectbivariatespline(self):
      def generate_params(n_points):
          x = y = np.linspace(0, 1000, n_points)
          x_grid, y_grid = np.meshgrid(x, y)
          z = x_grid * y_grid
          return x, y, z
  
      def calibrate_delay(requested_time):
          for n_points in itertools.count(5000, 1000):
              args = generate_params(n_points)
              time_started = time.time()
              interpolate(*args)
              if time.time() - time_started > requested_time:
                  return args
  
      def interpolate(x, y, z):
          scipy.interpolate.RectBivariateSpline(x, y, z)
  
      args = calibrate_delay(requested_time=3)
      worker_thread = self.make_worker_thread(interpolate, args)
      worker_thread.start()
      for i in range(3):
          time.sleep(0.5)
          self.log("working")
      worker_thread.join()
      assert_equal(
          self.messages,
          [
              "interpolation started",
              "working",
              "working",
              "working",
              "interpolation complete",
          ],
      )
  
file_path: catboost/contrib/python/scipy/py2/scipy/interpolate/tests/test_gil.py
imports: from __future__ import division, print_function, absolute_import
  import itertools
  import threading
  import time
  import numpy
  from numpy.testing import assert_equal
  import pytest
  import scipy.interpolate
label_desc: Use image node_id 4 for calling the TestGIL obj's underlying member method code with example usage: obj.test_rectbivariatespline() and returns: x,  y,  z, args