docstr: Check that results from `query` don't depend on the
  order of geometries.
code: def test_query_sorting(self, sort, expected):
      """Check that results from `query` don't depend on the
      order of geometries.
      """
      # these geometries come from a reported issue:
      # https://github.com/geopandas/geopandas/issues/1337
      # there is no theoretical reason they were chosen
      test_polys = GeoSeries(
          [Polygon([(1, 1), (3, 1), (3, 3), (1, 3)])]
      )
      tree_polys = GeoSeries(
          [
              Polygon([(1, 1), (3, 1), (3, 3), (1, 3)]),
              Polygon([(-1, 1), (1, 1), (1, 3), (-1, 3)]),
              Polygon([(3, 3), (5, 3), (5, 5), (3, 5)]),
          ]
      )
      expected = [0, 1, 2]
  
      test_geo = test_polys.values[0]
      res = tree_polys.sindex.query(test_geo, sort=sort)
  
      # asserting the same elements
      assert sorted(res) == sorted(expected)
      # asserting the exact array can fail if sort=False
      try:
          assert_array_equal(res, expected)
      except AssertionError as e:
          if sort is False:
              pytest.xfail(
                  "rtree results are known to be unordered, see "
                  "https://github.com/geopandas/geopandas/issues/1337\n"
                  "Expected:\n {}\n".format(expected)
                  + "Got:\n {}\n".format(res.tolist())
              )
          raise e
  
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 12 for calling the TestShapelyInterface obj's underlying member method code with example usage: obj.test_query_sorting(sort, expected) without return types