code: def test_max_distance(self, how):
      left = geopandas.GeoDataFrame(
          {"geometry": [Point(0, 0), Point(1, 1)]}
      )
      right = geopandas.GeoDataFrame(
          {"geometry": [Point(1, 1), Point(2, 2)]}
      )
      joined = sjoin_nearest(
          left,
          right,
          how=how,
          max_distance=1,
          distance_col="distances",
      )
      expected = left.copy()
      expected["index_right"] = [np.nan, 0]
      expected["distances"] = [np.nan, 0]
      if how == "inner":
          expected = expected.dropna()
          expected["index_right"] = expected["index_right"].astype(
              "int64"
          )
      assert_geodataframe_equal(joined, expected)
  
imports: import math
  from typing import Sequence
  import numpy
  import pandas
  import shapely
  from shapely.geometry import Point, Polygon, GeometryCollection
  import geopandas
  import geopandas._compat
  from geopandas import GeoDataFrame, GeoSeries, read_file, sjoin, sjoin_nearest
  from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal
  from pandas.testing import assert_frame_equal, assert_series_equal
  import pytest
label_desc: Use image node_id 9 for calling the TestNearest obj's underlying member method code with example usage: obj.test_max_distance(how) without return types