code: def test_1d_borders(self):
      # Test for nearest neighbor case with xi outside
      # the range of the values.
      x = np.array([1, 2.5, 3, 4.5, 5, 6])
      y = np.array([1, 2, 0, 3.9, 2, 1])
      xi = np.array([0.9, 6.5])
      yi_should = np.array([1.0, 1.0])
  
      method = "nearest"
      assert_allclose(
          griddata(x, y, xi, method=method),
          yi_should,
          err_msg=method,
          atol=1e-14,
      )
      assert_allclose(
          griddata(x.reshape(6, 1), y, xi, method=method),
          yi_should,
          err_msg=method,
          atol=1e-14,
      )
      assert_allclose(
          griddata((x,), y, (xi,), method=method),
          yi_should,
          err_msg=method,
          atol=1e-14,
      )
  
imports: import numpy
  from numpy.testing import assert_equal, assert_array_equal, assert_allclose
  import pytest
  from pytest import raises
  from scipy.interpolate import griddata, NearestNDInterpolator, LinearNDInterpolator, CloughTocher2DInterpolator
label_desc: Use image node_id 7 for calling the TestGriddata obj's underlying member method code with example usage: obj.test_1d_borders() without return types