code: def test_overlay(dfs_index, how):
      """
      Basic overlay test with small dummy example dataframes (from docs).
      Results obtained using QGIS 2.16 (Vector -> Geoprocessing Tools ->
      Intersection / Union / ...), saved to GeoJSON
      """
      df1, df2 = dfs_index
      result = overlay(df1, df2, how=how)
  
      # construction of result
  
      def _read(name):
          expected = read_file(
              os.path.join(
                  DATA, "polys", "df1_df2-{0}.geojson".format(name)
              )
          )
          expected.crs = None
          for col in expected.columns[expected.dtypes == "int32"]:
              expected[col] = expected[col].astype("int64")
          return expected
  
      if how == "identity":
          expected_intersection = _read("intersection")
          expected_difference = _read("difference")
          expected = pd.concat(
              [expected_intersection, expected_difference],
              ignore_index=True,
              sort=False,
          )
          expected["col1"] = expected["col1"].astype(float)
      else:
          expected = _read(how)
  
      # TODO needed adaptations to result
      if how == "union":
          result = result.sort_values(["col1", "col2"]).reset_index(
              drop=True
          )
      elif how == "difference":
          result = result.reset_index(drop=True)
  
      assert_geodataframe_equal(
          result, expected, check_column_type=False
      )
  
      # for difference also reversed
      if how == "difference":
          result = overlay(df2, df1, how=how)
          result = result.reset_index(drop=True)
          expected = _read("difference-inverse")
          assert_geodataframe_equal(
              result, expected, check_column_type=False
          )
  
imports: import os
  import numpy
  import pandas
  from shapely import make_valid
  from shapely.geometry import Point, Polygon, LineString, GeometryCollection, box
  import geopandas
  from geopandas import GeoDataFrame, GeoSeries, overlay, read_file
  from geopandas._compat import PANDAS_GE_20
  from geopandas.testing import assert_geodataframe_equal, assert_geoseries_equal
  import pytest
label_desc: Use image node_id 5 for calling a global function with example usage: test_overlay(dfs_index, how) and returns: expected