code: def _prepare_new_scope(
      scope: Optional[Union[str, Geocoder, Geocodes, MapRegion]]
  ) -> List[MapRegion]:
      """
      Return list of MapRegions. Every MapRegion object contains only one name or id.
      """
      if scope is None:
          return []
  
      def assert_scope_length_(l):
          if l != 1:
              raise ValueError(
                  "'scope' has {} entries, but expected to have exactly 1".format(
                      l
                  )
              )
  
      if isinstance(scope, MapRegion):
          assert_scope_length_(len(scope.values))
          return [scope]
  
      if isinstance(scope, str):
          return [MapRegion.with_name(scope)]
  
      if isinstance(scope, Geocoder):
          scope = scope._geocode()
  
      if isinstance(scope, Geocodes):
          map_regions = scope.to_map_regions()
          assert_scope_length_(len(map_regions))
          return map_regions
  
      raise ValueError(
          "Unsupported 'scope' type. Expected 'str' or 'Geocoder' but was '{}'".format(
              type(scope).__name__
          )
      )
  
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 9 for calling a global function with example usage: _prepare_new_scope(scope) and returns: list, list, list, map_regions