code: def _make_ambiguity_resolver(
      ignoring_strategy: Optional[IgnoringStrategyKind] = None,
      scope: Optional[ShapelyPolygonType] = None,
      closest_object: Optional[
          Union[Geocodes, ShapelyPointType]
      ] = None,
  ):
      if LazyShapely.is_polygon(scope):
          rect = GeoRect(
              start_lon=scope.bounds[0],
              min_lat=scope.bounds[1],
              end_lon=scope.bounds[2],
              max_lat=scope.bounds[3],
          )
      elif scope is None:
          rect = None
      else:
          assert (
              scope is not None
          )  # else for empty scope - existing scope should be already handled
          raise ValueError(
              "Wrong type of parameter `scope` - expected `shapely.geometry.Polygon`, but was `{}`".format(
                  type(scope).__name__
              )
          )
  
      return AmbiguityResolver(
          ignoring_strategy=ignoring_strategy,
          closest_coord=_to_geo_point(closest_object),
          box=rect,
      )
  
imports: from collections import namedtuple
  from collections.abc import Iterable
  from typing import Union, List, Optional, Dict
  from pandas import Series
  from .geocodes import _to_level_kind, request_types, Geocodes, _raise_exception, _ensure_is_list
  from .gis.geocoding_service import GeocodingService
  from .gis.geometry import GeoRect, GeoPoint
  from .gis.request import RequestBuilder, GeocodingRequest, RequestKind, MapRegion, AmbiguityResolver, RegionQuery, LevelKind, IgnoringStrategyKind, PayloadKind, ReverseGeocodingRequest
  from .gis.response import Response, SuccessResponse
  from .type_assertion import assert_list_type
label_desc: Use image node_id 2 for calling a global function with example usage: _make_ambiguity_resolver(ignoring_strategy, scope, closest_object) and returns: AmbiguityResolver