def METHOD_NAME(self, addon, platform):
    platforms = self.get("addons", {}).get(addon, {}).get("platforms", {})
    if platform in platforms:
        return self.get("addons", {}).get(addon, {}).get("platforms", {}).get(platform, {}).get("alias", platform)
    if "default" in platforms:
        return "default"
    raise BadDataError("No platform '%s' or default in addon '%s'", platform, addon)