Best Python code snippet using Kiwi_python
localsearchObjects.py
Source:localsearchObjects.py  
...10        self.regionOfInterestRadiusInMiles = None11        self.providerCommand = None # array12    13    def to_plist(self):14        self.add_property('userCurrentLocation')15        self.add_property('items')16        self.add_property('searchRegionCenter')17        self.add_property('regionOfInterestRadiusInMiles')18        self.add_property('providerCommand')19        return super(LocalSearchMapItemSnippet, self).to_plist()20class LocalSearchMapItem(DomainObject):21    TypeCURRENT_LOCATIONValue = "CURRENT_LOCATION"22    TypeBUSINESS_ITEMValue = "BUSINESS_ITEM"23    TypePERSON_ITEMValue = "PERSON_ITEM"24    TypeADDRESS_ITEMValue = "ADDRESS_ITEM"25    TypeHOME_ITEMValue = "HOME_ITEM"26    27    def __init__(self, label="", street="", city="", stateCode="", countryCode="", postalCode="", latitude=0, longitude=0, detailType="BUSINESS_ITEM", clazz="MapItem"):28        super(LocalSearchMapItem, self).__init__("com.apple.ace.localsearch", clazz="MapItem")29        self.label = label30        self.detailType = detailType31        self.location = Location(label,street,city,stateCode,countryCode,postalCode,latitude,longitude)32        self.placeId = None33        self.distanceInMiles = None34        self.detail = None #AceObject35    36    def to_plist(self):37        self.add_property('label')38        self.add_property('detailType')39        self.add_property('location')40        self.add_property('placeId')41        self.add_property('distanceInMiles')42        self.add_property('detail')43        return super(LocalSearchMapItem, self).to_plist()44class LocalSearchActionableMapItem(LocalSearchMapItem):45    def __init__(self, label="", street="", city="", stateCode="", countryCode="", postalCode="", latitude=0, longitude=0, detailType=LocalSearchMapItem.TypeCURRENT_LOCATIONValue, commands=None):46        super(LocalSearchActionableMapItem, self).__init__(self, label, street, city, stateCode, countryCode, postalCode, latitude, longitude, detailType, clazz="ActionableMapItem")47        self.commands = commands if commands != None else []48    49    def to_plist(self):50        self.add_property('commands')51        return super(LocalSearchActionableMapItem, self).to_plist()52class LocalSearchRating(AceObject):53    def __init__(self, value=0.0, providerId="", description="", count=0):54        super(LocalSearchRating, self).__init__("Rating", "com.apple.ace.localsearch")55        self.value = value56        self.providerId = providerId57        self.description = description58        self.count = count59    def to_plist(self):60        self.add_property('value')61        self.add_property('providerId')62        self.add_property('description')63        self.add_property('count')64        return super(LocalSearchRating, self).to_plist()65class LocalSearchBusiness(AceObject):66    def __init__(self, totalNumberOfReviews=0, rating=None, photo="", phoneNumbers=None, openingHours="", name="", extSessionGuid="", categories=None, businessUrl="", businessIds=None, businessId=0):67        super(LocalSearchBusiness, self).__init__("Business", "com.apple.ace.localsearch")68        self.totalNumberOfReviews = totalNumberOfReviews69        self.rating = rating if rating != None else LocalSearchRating()70        self.photo = photo71        self.phoneNumbers = phoneNumbers if phoneNumbers != None else []72        self.openingHours = openingHours73        self.name = name74        self.extSessionGuid = extSessionGuid75        self.categories = categories if categories != None else []76        self.businessUrl = businessUrl77        self.businessIds = businessIds if businessIds != None else dict()78        self.businessId = businessId79    def to_plist(self):80        self.add_property('totalNumberOfReviews')81        self.add_property('rating')82        self.add_property('photo')83        self.add_property('phoneNumbers')84        self.add_property('openingHours')85        self.add_property('name')86        self.add_property('extSessionGuid')87        self.add_property('categories')88        self.add_property('businessUrl')89        self.add_property('businessIds')90        self.add_property('businessId')91        return super(LocalSearchBusiness, self).to_plist()92class LocalSearchDisambiguationMap(Snippet):93    def __init__(self, items=None):94        super(LocalSearchDisambiguationMap, self).__init__("com.apple.ace.localsearch", clazz="DisambiguationMap")95        self.items = items if items != None else []96    def to_plist(self):97        self.add_property('items')98        return super(LocalSearchDisambiguationMap, self).to_plist()99class LocalSearchPhoneNumber(AceObject):100    TypePRIMARYValue = "PRIMARY"101    TypeSECONDARYValue =  "SECONDARY"102    TypeFAXValue = "FAX"103    TTYValue = "TTY"104    def __init__(self, value="", type="PRIMARY"):105        super(LocalSearchPhoneNumber, self).__init__("PhoneNumber", "com.apple.ace.localsearch")106        self.value = value107        self.type = type108    def to_plist(self):109        self.add_property('value')110        self.add_property('type')111        return super(LocalSearchPhoneNumber, self).to_plist()112class LocalSearchReview(AceObject):113    TypePROFESSIONALValue = "PROFESSIONAL"114    TypeCOMMUNITYValue = "COMMUNITY"115    TypePERSONALValue = "PERSONAL"116    def __init__(self, url="", type="PROFESSIONAL", reviewerUrl="", reviewerName="", rating=None, publication="", provider="", fullReview="", excerpt=""):117        super(LocalSearchReview, self).__init__("Review", "com.apple.ace.localsearch")118        self.url = url119        self.type = type120        self.reviewerUrl = reviewerUrl121        self.reviewerName = reviewerName122        self.rating = rating if rating != None else LocalSearchRating()123        self.publication = publication124        self.provider = provider125        self.fullReview = fullReview126        self.excerpt = excerpt127    def to_plist(self):128        self.add_property('url')129        self.add_property('type')130        self.add_property('reviewerUrl')131        self.add_property('reviewerName')132        self.add_property('rating')133        self.add_property('publication')134        self.add_property('provider')135        self.add_property('fullReview')136        self.add_property('excerpt')137        return super(LocalSearchReview, self).to_plist()138class LocalSearchShowMapPoints(ClientBoundCommand):139    DirectionsTypeByCarValue = "ByCar"140    DirectionsTypeByPublicTransitValue = "ByPublicTransit"141    DirectionsTypeWalkingValue = "Walking"142    DirectionsTypeBikingValue = "Biking"143    def __init__(self, refId, showTraffic=False, showDirections=False, regionOfInterestRadiusInMiles=0, itemSource=None, itemDestination=None, directionsType="ByCar", targetAppId=""):144        super(LocalSearchShowMapPoints, self).__init__("ShowMapPoints", "com.apple.ace.localsearch", None, refId)145        self.showTraffic = showTraffic146        self.showDirections = showDirections147        self.regionOfInterestRadiusInMiles = regionOfInterestRadiusInMiles148        self.itemSource = itemSource if itemSource != None else LocalSearchMapItem()149        self.itemDestination = itemDestination if itemDestination != None else LocalSearchMapItem()150        self.directionsType = directionsType151        self.targetAppId = targetAppId152    def to_plist(self):153        self.add_property('showTraffic')154        self.add_property('showDirections')155        self.add_property('regionOfInterestRadiusInMiles')156        self.add_property('itemSource')157        self.add_property('itemDestination')158        self.add_property('directionsType')159        self.add_property('targetAppId')160        return super(LocalSearchShowMapPoints, self).to_plist()161class LocalSearchShowMapPointsCompleted(ServerBoundCommand):162    classIdentifier = "ShowMapPointsCompleted"163    groupIdentifier = "com.apple.ace.localsearch"164    165    def __init__(self, plist):...forecastObjects.py
Source:forecastObjects.py  
...5      super(SiriForecastSnippet, self).__init__("ForecastSnippet", "com.apple.ace.weather")6      self.aceWeathers = aceWeathers7      8    def to_plist(self):9        self.add_property('aceWeathers')10        return super(SiriForecastSnippet, self).to_plist()11        12class SiriForecastAceWeathers(AceObject):13    def __init__(self, currentConditions=None, dailyForecasts=None, hourlyForecasts=None, view="HOURLY", weatherLocation=None, extendedForecastUrl="http://m.yahoo.com/search?p=Frankfurt,+HE&.tsrc=appleww", units=None):14        super(SiriForecastAceWeathers, self).__init__("Object", "com.apple.ace.weather")15        self.currentConditions = currentConditions16        self.hourlyForecasts = hourlyForecasts17        self.dailyForecasts = dailyForecasts18        self.view = view19        self.weatherLocation = weatherLocation20        self.extendedForecastUrl = extendedForecastUrl21        self.units = units22 23    def to_plist(self):24        self.add_property('currentConditions')25        self.add_property('hourlyForecasts')26        self.add_property('dailyForecasts')27        self.add_property('view')28        self.add_property('weatherLocation')29        self.add_property('extendedForecastUrl')30        self.add_property('units')31        return super(SiriForecastAceWeathers, self).to_plist()32        33class SiriForecastAceWeathersHourlyForecast(AceObject):34    def __init__(self, chanceOfPrecipitation=0, isUserRequested=True,condition=None, temperature=0, timeIndex=20):35        super(SiriForecastAceWeathersHourlyForecast, self).__init__("HourlyForecast", "com.apple.ace.weather")36        self.chanceOfPrecipitation = chanceOfPrecipitation37        self.isUserRequested = isUserRequested38        self.condition = condition39        self.temperature = temperature40        self.timeIndex = timeIndex41 42    def to_plist(self):43        self.add_property('chanceOfPrecipitation')44        self.add_property('isUserRequested')45        self.add_property('condition')46        self.add_property('temperature')47        self.add_property('timeIndex')48        return super(SiriForecastAceWeathersHourlyForecast, self).to_plist()49        50class SiriForecastAceWeathersDailyForecast(AceObject):51    def __init__(self, chanceOfPerception=0, isUserRequested=True,condition=None, lowTemperature=0, highTemperature=0, timeIndex=1):52        super(SiriForecastAceWeathersDailyForecast, self).__init__("DailyForecast", "com.apple.ace.weather")53        self.chanceOfPerception = chanceOfPerception54        self.isUserRequested = isUserRequested55        self.condition = condition56        self.highTemperature = highTemperature57        self.lowTemperature = lowTemperature58        self.timeIndex = timeIndex59 60    def to_plist(self):61        self.add_property('chanceOfPerception')62        self.add_property('isUserRequested')63        self.add_property('condition')64        self.add_property('highTemperature')65        self.add_property('lowTemperature')66        self.add_property('timeIndex')67        return super(SiriForecastAceWeathersDailyForecast, self).to_plist()68class SiriForecastAceWeathersWeatherLocation(AceObject):69    def __init__(self, locationId="20066682", countryCode="Germany", city="Frankfurt", stateCode = "Hesse"):70        super(SiriForecastAceWeathersWeatherLocation, self).__init__("Location", "com.apple.ace.weather")71        self.locationId = locationId72        self.countryCode = countryCode73        self.city = city74        self.stateCode = stateCode75 76    def to_plist(self):77        self.add_property('locationId')78        self.add_property('countryCode')79        self.add_property('city')80        self.add_property('stateCode')81        return super(SiriForecastAceWeathersWeatherLocation, self).to_plist()82        83        84class SiriForecastAceWeathersUnits(AceObject):85    def __init__(self, speedUnits="KPH", distanceUnits="Kilometers", temperatureUnits="Celsius", pressureUnits = "MB"):86        super(SiriForecastAceWeathersUnits, self).__init__("Units", "com.apple.ace.weather")87        self.speedUnits = speedUnits88        self.distanceUnits = distanceUnits89        self.temperatureUnits = temperatureUnits90        self.pressureUnits = pressureUnits91 92    def to_plist(self):93        self.add_property('speedUnits')94        self.add_property('distanceUnits')95        self.add_property('temperatureUnits')96        self.add_property('pressureUnits')97        return super(SiriForecastAceWeathersUnits, self).to_plist()98        99class SiriForecastAceWeathersCurrentConditions(AceObject):100    def __init__(self, feelsLike="0", dayOfWeek=6, timeOfObservation="18:00",barometricPressure=None, visibility="0", percentOfMoonFaceVisible=90, temperature = "0", sunrise="7:30", sunset="19:00", moonPhase="WAXING_GIBBOUS",percentHumidity="80", timeZone="Central European Time", dewPoint="0", condition=None, windChill="0", windSpeed=None,):101        super(SiriForecastAceWeathersCurrentConditions, self).__init__("CurrentConditions", "com.apple.ace.weather")102        self.feelsLike = feelsLike103        self.dayOfWeek = dayOfWeek104        self.timeOfObservation = timeOfObservation105        self.barometricPressure = barometricPressure106        self.visibility = visibility107        self.percentOfMoonFaceVisible = percentOfMoonFaceVisible108        self.temperature = temperature109        self.sunrise = sunrise110        self.sunset = sunset111        self.moonPhase = moonPhase112        self.percentHumidity = percentHumidity113        self.timeZone = timeZone114        self.dewPoint = dewPoint115        self.condition = condition116        self.windChill = windChill117        self.windSpeed = windSpeed118    def to_plist(self):119        self.add_property('feelsLike')120        self.add_property('dayOfWeek')121        self.add_property('timeOfObservation')122        self.add_property('barometricPressure')123        self.add_property('visibility')124        self.add_property('percentOfMoonFaceVisible')125        self.add_property('temperature')126        self.add_property('sunrise')127        self.add_property('sunset')128        self.add_property('moonPhase')129        self.add_property('percentHumidity')130        self.add_property('timeZone')131        self.add_property('dewPoint')132        self.add_property('condition')133        self.add_property('windChill')134        self.add_property('windSpeed')135        return super(SiriForecastAceWeathersCurrentConditions, self).to_plist()  136        137class SiriForecastAceWeathersConditions(AceObject):138    def __init__(self, conditionCode="Sunny", conditionCodeIndex=32):139        super(SiriForecastAceWeathersConditions, self).__init__("Condition", "com.apple.ace.weather")140        self.conditionCode = conditionCode141        self.conditionCodeIndex = conditionCodeIndex142 143    def to_plist(self):144        self.add_property('conditionCode')145        self.add_property('conditionCodeIndex')...uiObjects.py
Source:uiObjects.py  
...7        self.dialogPhase = dialogPhase8        self.views = views if views != None else []9    10    def to_plist(self):11        self.add_property('scrollToTop')12        self.add_property('temporary')13        self.add_property('dialogPhase')14        self.add_property('views')15        return super(AddViews, self).to_plist()16    17class AceView(AceObject):18    def __init__(self, clazz, group):19        super(AceView, self).__init__(clazz, group)20        self.viewId = None # string21        self.speakableText = None # string22        self.listenAfterSpeaking = None # number23    def to_plist(self):24        self.add_property('viewId')25        self.add_property('speakableText')26        self.add_property('listenAfterSpeaking')27        return super(AceView, self).to_plist()28# Assistant-related objects29class AssistantUtteranceView(AceObject):30    def __init__(self, text="", speakableText="", dialogIdentifier="Misc#ident", listenAfterSpeaking=False):31        super(AssistantUtteranceView, self).__init__("AssistantUtteranceView", "com.apple.ace.assistant")32        self.text = text or speakableText33        self.speakableText = speakableText34        self.dialogIdentifier = dialogIdentifier35        self.listenAfterSpeaking = listenAfterSpeaking36    def to_plist(self):37        self.add_property('text')38        self.add_property('speakableText')39        self.add_property('dialogIdentifier')40        self.add_property('listenAfterSpeaking')41        return super(AssistantUtteranceView, self).to_plist()42class DisambiguationList(AceView):43    def __init__(self, items=None, speakableSelectionResponse="OK!", listenAfterSpeaking=True, speakableText="", speakableFinalDemitter="", speakableDemitter="", selectionResponse="OK!"):44        super(DisambiguationList, self).__init__("DisambiguationList", "com.apple.ace.assistant")45        self.items = items if items != None else []46        self.speakableSelectionResponse = speakableSelectionResponse47        self.listenAfterSpeaking = listenAfterSpeaking48        self.speakableFinalDemitter = speakableFinalDemitter49        self.selectionResponse = selectionResponse50        self.speakableText = speakableText51    def to_plist(self):52        self.add_property('items')53        self.add_property('speakableSelectionResponse')54        self.add_property('speakableFinalDemitter')55        self.add_property('selectionResponse')56        return super(DisambiguationList, self).to_plist()57class Button(AceObject):58    def __init__(self, text="", commands=None):59        super(Button, self).__init__("Button", "com.apple.ace.assistant")60        self.text = text61        self.commands = commands if commands != None else []62    def to_plist(self):63        self.add_property('text')64        self.add_property('commands')65        return super(Button, self).to_plist()66class OpenLink(AceObject):67    def __init__(self, ref=""):68        super(OpenLink, self).__init__("OpenLink", "com.apple.ace.assistant")69        self.ref = ref70    71    def to_plist(self):72        self.add_property('ref')73        return super(OpenLink, self).to_plist()74class HtmlView(AceObject):75    def __init__(self, html=""):76        super(HtmlView, self).__init__("HtmlView", "com.apple.ace.assistant")77        self.html = html78    79    def to_plist(self):80        self.add_property('html')81        return super(HtmlView, self).to_plist()82class MenuItem(AceObject):83    def __init__(self, title="", subtitle="", ref="", icon="", commands=None):84        super(MenuItem, self).__init__("MenuItem", "com.apple.ace.assistant")85        self.title = title86        self.subtitle = subtitle87        self.ref = ref88        self.icon = icon89        self.commands = commands if commands != None else []90    91    def to_plist(self):92        self.add_property('title')93        self.add_property('subtitle')94        self.add_property('ref')95        self.add_property('icon')96        self.add_property('commands')97        return super(MenuItem, self).to_plist()98class ListItem(AceView):99    def __init__(self, title="", selectionText="", commands=None, speakableText="", obj=None):100        super(ListItem, self).__init__("ListItem", "com.apple.ace.assistant")101        self.title= title102        self.selectionText = selectionText103        self.commands = commands if commands != None else []104        self.speakableText = speakableText105        self.object = obj106    def to_plist(self):107        self.add_property('title')108        self.add_property('selectionText')109        self.add_property('commands')110        self.add_property('object')111        return super(ListItem, self).to_plist()112class ConfirmationOptions(AceObject):113    def __init__(self, denyCommands=None, submitCommands=None, confirmText="Confirm", denyText="Cancel", cancelCommands=None, cancelLabel="Cancel", submitLabel="Confirm", confirmCommands=None, cancelTrigger="Deny"):114        super(ConfirmationOptions, self).__init__("ConfirmationOptions", "com.apple.ace.assistant")115        self.denyCommands = denyCommands if denyCommands != None else []116        self.submitCommands = submitCommands if submitCommands != None else []117        self.confirmText = confirmText118        self.denyText = denyText119        self.cancelCommands = cancelCommands if cancelCommands != None else []120        self.cancelLabel = cancelLabel121        self.submitLabel = submitLabel122        self.confirmCommands = confirmCommands if confirmCommands != None else []123        self.cancelTrigger = cancelTrigger124    125    def to_plist(self):126        self.add_property('denyCommands')127        self.add_property('submitCommands')128        self.add_property('confirmText')129        self.add_property('denyText')130        self.add_property('cancelCommands')131        self.add_property('cancelLabel')132        self.add_property('submitLabel')133        self.add_property('confirmCommands')134        self.add_property('cancelTrigger')135        return super(ConfirmationOptions, self).to_plist()136class CancelSnippet(AceObject):137    def __init__(self):138        super(CancelSnippet, self).__init__("CancelSnippet", "com.apple.ace.assistant")139    140class ConfirmSnippet(AceObject):141    def __init__(self):142        super(ConfirmSnippet, self).__init__("ConfirmSnippet", "com.apple.ace.assistant")143class Snippet(AceView):144    def __init__(self, group, clazz="Snippet"):145        super(Snippet, self).__init__(clazz, group)146        self.otherOptions = None # array147        self.confirmationOptions = None # ConfirmationOptions obj148    149    def to_plist(self):150        self.add_property('otherOptions')151        self.add_property('confirmationOptions')152        return super(Snippet, self).to_plist()...Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!
