code: def test_sjoin_named_index(self, how):
      # original index names should be unchanged
      pointdf2 = self.pointdf.copy()
      pointdf2.index.name = "pointid"
      polydf = self.polydf.copy()
      polydf.index.name = "polyid"
  
      res = sjoin(pointdf2, polydf, how=how)
      assert pointdf2.index.name == "pointid"
      assert polydf.index.name == "polyid"
  
      # original index name should pass through to result
      if how == "right":
          assert res.index.name == "polyid"
      else:  # how == "left", how == "inner"
          assert res.index.name == "pointid"
  
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 TestSpatialJoinNYBB obj's underlying member method code with example usage: obj.test_sjoin_named_index(how) without return types