code: def test_nearest_exclusive(
      self,
      expected,
      max_distance,
      return_all,
      return_distance,
      exclusive,
  ):
      geoms = shapely.points(np.arange(5), np.arange(5))
      if max_distance:
          # add a non grid point
          geoms = np.append(geoms, [Point(1, 2)])
  
      df = geopandas.GeoDataFrame({"geometry": geoms})
  
      ps = geoms
      res = df.sindex.nearest(
          ps,
          return_all=return_all,
          max_distance=max_distance,
          return_distance=return_distance,
          exclusive=exclusive,
      )
      if return_distance:
          assert_array_equal(res[0], expected[0])
          assert_array_equal(res[1], expected[1])
      else:
          assert_array_equal(res, expected[0])
  
imports: from math import sqrt
  import numpy
  import pandas
  import pytest
  import shapely
  from numpy.testing import assert_array_equal
  from shapely.geometry import GeometryCollection, LineString, MultiPolygon, Point, Polygon, box
  import geopandas
  from geopandas import GeoDataFrame, GeoSeries, read_file
  from geopandas import _compat
label_desc: Use image node_id 24 for calling the TestShapelyInterface obj's underlying member method code with example usage: obj.test_nearest_exclusive(expected, max_distance, return_all, return_distance, exclusive) without return types