code: def _make_parent_region(place: parent_types) -> Optional[MapRegion]:
      if place is None:
          return None
  
      if isinstance(place, Geocoder):
          place = place._geocode()
  
      if isinstance(place, str):
          return MapRegion.with_name(place)
  
      if isinstance(place, Geocodes):
          assert (
              len(place.to_map_regions()) == 1
          ), "Region object used as parent should contain only single record"
          return place.to_map_regions()[0]
  
      raise ValueError("Unsupported parent type: " + str(type(place)))
  
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 7 for calling a global function with example usage: _make_parent_region(place) and returns: None, MapRegion, place