code: def _autodetect_resolution(level: LevelKind, count: int) -> int:
      if level == LevelKind.country:
          if count < 3:
              return Resolution.world_high.value
          else:
              return Resolution.world_low.value
  
      if level == LevelKind.state:
          if count < 3:
              return Resolution.state_low.value
          if count < 10:
              return Resolution.country_low.value
          else:
              return Resolution.world_medium.value
  
      if level == LevelKind.county:
          if count < 5:
              return Resolution.county_low.value
          elif count < 20:
              return Resolution.state_medium.value
          else:
              return Resolution.world_high.value
  
      if level == LevelKind.city:
          if count < 5:
              return Resolution.city_low.value
          elif count < 50:
              return Resolution.country_low.value
          else:
              return Resolution.world_high.value
  
imports: import enum
  from abc import abstractmethod
  from collections.abc import Iterable
  from typing import List, Optional, Union, Dict
  from pandas import DataFrame, Series
  from lets_plot.geo_data_internals.constants import DF_COLUMN_HIGHLIGHTS, DF_COLUMN_COUNTRY, DF_COLUMN_STATE, DF_COLUMN_COUNTY, DF_COLUMN_CITY, DF_COLUMN_ID, DF_COLUMN_FOUND_NAME, DF_COLUMN_POSITION, DF_COLUMN_LIMIT, DF_COLUMN_CENTROID
  from .gis.geocoding_service import GeocodingService
  from .gis.request import PayloadKind, RequestBuilder, RequestKind, MapRegion, RegionQuery
  from .gis.response import Answer, GeocodedFeature, Namesake, AmbiguousFeature, LevelKind
  from .gis.response import SuccessResponse, Response, AmbiguousResponse, ErrorResponse
  from .type_assertion import assert_type, assert_list_type
label_desc: Use image node_id 7 for calling a global function with example usage: _autodetect_resolution(level, count) and returns: Resolution, Resolution, Resolution, Resolution, Resolution, Resolution, Resolution, Resolution, Resolution, Resolution, Resolution