code: def test_reorder_for_centroids_should_happen(mock_request):
      new_york = (
          FeatureBuilder()
          .set_id("2")
          .set_query("New York")
          .set_name("New York")
          .set_centroid(GeoPoint(0, 0))
          .build_geocoded()
      )
      las_vegas = (
          FeatureBuilder()
          .set_id("3")
          .set_query("Las Vegas")
          .set_name("Las Vegas")
          .set_centroid(GeoPoint(0, 0))
          .build_geocoded()
      )
  
      los_angeles = (
          FeatureBuilder()
          .set_id("1")
          .set_query("Los Angeles")
          .set_name("Los Angeles")
          .set_centroid(GeoPoint(0, 0))
          .build_geocoded()
      )
      mock_request.return_value = (
          make_success_response()
          .set_geocoded_features([new_york, las_vegas, los_angeles])
          .build()
      )
  
      df = Geocodes(
          level_kind=LevelKind.city,
          queries=features_to_queries(
              [los_angeles, new_york, las_vegas, los_angeles]
          ),
          answers=features_to_answers(
              [los_angeles, new_york, las_vegas, los_angeles]
          ),
      ).centroids()
  
      assert [
          "Los Angeles",
          "New York",
          "Las Vegas",
          "Los Angeles",
      ] == df[DF_COLUMN_FOUND_NAME].tolist()
  
imports: from unittest import mock
  import pytest
  from pandas import DataFrame
  from lets_plot.geo_data import geocode
  from lets_plot.geo_data.geocoder import _to_scope
  from lets_plot.geo_data.geocodes import _ensure_is_list, Geocodes, DF_COLUMN_ID, DF_COLUMN_FOUND_NAME, DF_COLUMN_CENTROID, DF_COLUMN_POSITION, DF_COLUMN_LIMIT
  from lets_plot.geo_data.gis.geocoding_service import GeocodingService
  from lets_plot.geo_data.gis.request import MapRegion, RegionQuery, GeocodingRequest, PayloadKind, ExplicitRequest, AmbiguityResolver
  from lets_plot.geo_data.gis.response import LevelKind, FeatureBuilder, GeoPoint, Answer
  from lets_plot.geo_data.livemap_helper import _prepare_location, RegionKind, _prepare_parent, LOCATION_LIST_ERROR_MESSAGE, LOCATION_DATAFRAME_ERROR_MESSAGE
  from geo_data_test_util import make_geocode_region, make_success_response, features_to_answers, features_to_queries, COLUMN_NAME_CITY
label_desc: Use image node_id 11 for calling a global function with example usage: test_reorder_for_centroids_should_happen(mock_request) without return types