# Path: cassiopeia/datastores/kernel/common.py
# def _get_latest_version(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
# def _get_default_locale(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
#     def __init__(self, server_url: str, port: int, http_client: HTTPClient = None):
#     def _get(
#         self,
#         endpoint: str,
#         parameters: MutableMapping[str, Any] = None,
#         connection: Curl = None,
#     ) -> Union[dict, list, Any]:
#     def get(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> T:
#     def get_many(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> Iterable[T]:
# T = TypeVar("T")
# class KernelSource(DataSource):
# 
# Path: cassiopeia/data.py
# class Platform(Enum):
#     brazil = "BR1"
#     europe_north_east = "EUN1"
#     europe_west = "EUW1"
#     japan = "JP1"
#     korea = "KR"
#     latin_america_north = "LA1"
#     latin_america_south = "LA2"
#     north_america = "NA1"
#     oceania = "OC1"
#     turkey = "TR1"
#     russia = "RU"
# 
#     @property
#     def region(self) -> "Region":
#         return getattr(Region, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_region(region):
#         try:
#             return region.platform
#         except AttributeError:
#             return Region(region).platform
# 
#     @property
#     def continent(self):
#         return self.region.continent
# 
# class Region(Enum):
#     brazil = "BR"
#     europe_north_east = "EUNE"
#     europe_west = "EUW"
#     japan = "JP"
#     korea = "KR"
#     latin_america_north = "LAN"
#     latin_america_south = "LAS"
#     north_america = "NA"
#     oceania = "OCE"
#     turkey = "TR"
#     russia = "RU"
# 
#     @property
#     def platform(self) -> "Platform":
#         return getattr(Platform, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_platform(platform):
#         try:
#             return platform.region
#         except AttributeError:
#             return Platform(platform).region
# 
#     @property
#     def timezone(self) -> str:
#         tzs = {
#             "NA": "GMT-8",
#             "LAN": "GMT-7",
#             "LAS": "GMT-5",
#             "BR": "GMT-4",
#             "EUW": "GMT-2",
#             "TR": "GMT-0",
#             "EUNE": "GMT+1",
#             "RU": "GMT+3",
#             "KR": "GMT+6",
#             "JP": "GMT+7",
#             "OCE": "GMT+8",
#         }
#         return tzs[self.value]
# 
#     @property
#     def continent(self) -> "Continent":
#         if self is Region.brazil:
#             return Continent.americas
#         if self is Region.europe_north_east:
#             return Continent.europe
#         if self is Region.europe_west:
#             return Continent.europe
#         if self is Region.japan:
#             return Continent.asia
#         if self is Region.korea:
#             return Continent.asia
#         if self is Region.latin_america_north:
#             return Continent.americas
#         if self is Region.latin_america_south:
#             return Continent.americas
#         if self is Region.north_america:
#             return Continent.americas
#         if self is Region.oceania:
#             return (
#                 Continent.americas
#             )  # OCE content is managed by Americas server (as per https://i.imgur.com/FUyf5kv.png), this breaks OCE queries if set to Asia
#         if self is Region.turkey:
#             return Continent.europe
#         if self is Region.russia:
#             return Continent.europe
# 
# Path: cassiopeia/datastores/uniquekeys.py
# def convert_region_to_platform(query: MutableMapping[str, Any]) -> None:
#     if "region" in query and "platform" not in query:
#         try:
#             query["platform"] = Region(query["region"]).platform
#         except ValueError as e:
#             raise QueryValidationError from e
# 
#     if "regions" in query and "platforms" not in query:
#         query["platforms"] = _region_to_platform_generator(query["regions"])
# 
#     if "region" in query and not isinstance(query["region"], Region):
#         query["region"] = Region(query["region"])


from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import (
    DataSource,
    PipelineContext,
    Query,
    NotFoundError,
    validate_query,
)
from .common import KernelSource, APINotFoundError
from ...data import Platform, Region
from ...dto.staticdata.version import VersionListDto
from ...dto.status import ShardStatusDto
from ..uniquekeys import convert_region_to_platform
        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> T:
        pass

    @DataSource.dispatch
    def get_many(
        self,
        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> Iterable[T]:
        pass

    ##########
    # Status #
    ##########

    _validate_get_status_query = Query.has("platform").as_(Platform)

    @get.register(ShardStatusDto)
    @validate_query(_validate_get_status_query, convert_region_to_platform)
    def get_status(
        self, query: MutableMapping[str, Any], context: PipelineContext = None
    ) -> ShardStatusDto:
        parameters = {"platform": query["platform"].value}
        endpoint = "lol/status/v3/shard-data".format()
        try:
            data = self._get(endpoint=endpoint, parameters=parameters)

# Path: cassiopeia/datastores/kernel/common.py
# def _get_latest_version(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
# def _get_default_locale(
#     query: MutableMapping[str, Any], context: PipelineContext
# ) -> str:
#     def __init__(self, server_url: str, port: int, http_client: HTTPClient = None):
#     def _get(
#         self,
#         endpoint: str,
#         parameters: MutableMapping[str, Any] = None,
#         connection: Curl = None,
#     ) -> Union[dict, list, Any]:
#     def get(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> T:
#     def get_many(
#         self,
#         type: Type[T],
#         query: MutableMapping[str, Any],
#         context: PipelineContext = None,
#     ) -> Iterable[T]:
# T = TypeVar("T")
# class KernelSource(DataSource):
# 
# Path: cassiopeia/data.py
# class Platform(Enum):
#     brazil = "BR1"
#     europe_north_east = "EUN1"
#     europe_west = "EUW1"
#     japan = "JP1"
#     korea = "KR"
#     latin_america_north = "LA1"
#     latin_america_south = "LA2"
#     north_america = "NA1"
#     oceania = "OC1"
#     turkey = "TR1"
#     russia = "RU"
# 
#     @property
#     def region(self) -> "Region":
#         return getattr(Region, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_region(region):
#         try:
#             return region.platform
#         except AttributeError:
#             return Region(region).platform
# 
#     @property
#     def continent(self):
#         return self.region.continent
# 
# class Region(Enum):
#     brazil = "BR"
#     europe_north_east = "EUNE"
#     europe_west = "EUW"
#     japan = "JP"
#     korea = "KR"
#     latin_america_north = "LAN"
#     latin_america_south = "LAS"
#     north_america = "NA"
#     oceania = "OCE"
#     turkey = "TR"
#     russia = "RU"
# 
#     @property
#     def platform(self) -> "Platform":
#         return getattr(Platform, self.name)
# 
#     @property
#     def default_locale(self) -> str:
#         return DEFAULT_LOCALE[self]
# 
#     @staticmethod
#     def from_platform(platform):
#         try:
#             return platform.region
#         except AttributeError:
#             return Platform(platform).region
# 
#     @property
#     def timezone(self) -> str:
#         tzs = {
#             "NA": "GMT-8",
#             "LAN": "GMT-7",
#             "LAS": "GMT-5",
#             "BR": "GMT-4",
#             "EUW": "GMT-2",
#             "TR": "GMT-0",
#             "EUNE": "GMT+1",
#             "RU": "GMT+3",
#             "KR": "GMT+6",
#             "JP": "GMT+7",
#             "OCE": "GMT+8",
#         }
#         return tzs[self.value]
# 
#     @property
#     def continent(self) -> "Continent":
#         if self is Region.brazil:
#             return Continent.americas
#         if self is Region.europe_north_east:
#             return Continent.europe
#         if self is Region.europe_west:
#             return Continent.europe
#         if self is Region.japan:
#             return Continent.asia
#         if self is Region.korea:
#             return Continent.asia
#         if self is Region.latin_america_north:
#             return Continent.americas
#         if self is Region.latin_america_south:
#             return Continent.americas
#         if self is Region.north_america:
#             return Continent.americas
#         if self is Region.oceania:
#             return (
#                 Continent.americas
#             )  # OCE content is managed by Americas server (as per https://i.imgur.com/FUyf5kv.png), this breaks OCE queries if set to Asia
#         if self is Region.turkey:
#             return Continent.europe
#         if self is Region.russia:
#             return Continent.europe
# 
# Path: cassiopeia/datastores/uniquekeys.py
# def convert_region_to_platform(query: MutableMapping[str, Any]) -> None:
#     if "region" in query and "platform" not in query:
#         try:
#             query["platform"] = Region(query["region"]).platform
#         except ValueError as e:
#             raise QueryValidationError from e
# 
#     if "regions" in query and "platforms" not in query:
#         query["platforms"] = _region_to_platform_generator(query["regions"])
# 
#     if "region" in query and not isinstance(query["region"], Region):
#         query["region"] = Region(query["region"])


# Path: cassiopeia/datastores/kernel/status.py
from typing import Type, TypeVar, MutableMapping, Any, Iterable, Generator
from datapipelines import (
    DataSource,
    PipelineContext,
    Query,
    NotFoundError,
    validate_query,
)
from .common import KernelSource, APINotFoundError
from ...data import Platform, Region
from ...dto.staticdata.version import VersionListDto
from ...dto.status import ShardStatusDto
from ..uniquekeys import convert_region_to_platform

        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> T:
        pass

    @DataSource.dispatch
    def get_many(
        self,
        type: Type[T],
        query: MutableMapping[str, Any],
        context: PipelineContext = None,
    ) -> Iterable[T]:
        pass

    ##########
    # Status #
    ##########

    _validate_get_status_query = Query.has("platform").as_(Platform)

    @get.register(ShardStatusDto)
    @validate_query(_validate_get_status_query, convert_region_to_platform)
    def get_status(
        self, query: MutableMapping[str, Any], context: PipelineContext = None
    ) -> ShardStatusDto:
        parameters = {"platform": query["platform"].value}
        endpoint = "lol/status/v3/shard-data".format()
        try:
            data = self._get(endpoint=endpoint, parameters=parameters)

        except APINotFoundError as error: