code: def test_left(self, predicate, dfs):
      index, df1, df2, expected = dfs
  
      res = sjoin(df1, df2, how="left", predicate=predicate)
  
      if index in ["default-index", "string-index"]:
          exp = expected[predicate].dropna(subset=["index_left"]).copy()
      elif index == "named-index":
          exp = expected[predicate].dropna(subset=["df1_ix"]).copy()
      elif index == "multi-index":
          exp = expected[predicate].dropna(subset=["level_0_x"]).copy()
      elif index == "named-multi-index":
          exp = expected[predicate].dropna(subset=["df1_ix1"]).copy()
      exp = exp.drop("geometry_y", axis=1).rename(
          columns={"geometry_x": "geometry"}
      )
      exp["df1"] = exp["df1"].astype("int64")
      if index == "default-index":
          exp["index_left"] = exp["index_left"].astype("int64")
          # TODO: in result the dtype is object
          res["index_right"] = res["index_right"].astype(float)
      elif index == "named-index":
          exp[["df1_ix"]] = exp[["df1_ix"]].astype("int64")
          exp = exp.set_index("df1_ix").rename(
              columns={"df2_ix": "index_right"}
          )
      if index in ["default-index", "string-index"]:
          exp = exp.set_index("index_left")
          exp.index.name = None
      if index == "multi-index":
          exp = exp.set_index(["level_0_x", "level_1_x"]).rename(
              columns={
                  "level_0_y": "index_right0",
                  "level_1_y": "index_right1",
              }
          )
          exp.index.names = df1.index.names
      if index == "named-multi-index":
          exp = exp.set_index(["df1_ix1", "df1_ix2"]).rename(
              columns={
                  "df2_ix1": "index_right0",
                  "df2_ix2": "index_right1",
              }
          )
          exp.index.names = df1.index.names
  
      assert_frame_equal(res, exp)
  
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 7 for calling the TestSpatialJoin obj's underlying member method code with example usage: obj.test_left(predicate, dfs) without return types