Best Python code snippet using robotframework-appiumlibrary_python
Foxes and Rabbits.py
Source:Foxes and Rabbits.py
1#Skeleton Program code for the AQA A Level Paper 1 2017 examination2#this code should be used in conjunction with the Preliminary Material3#written by the AQA Programmer Team4#developed in the Python 3.4.1 programming environment56import enum7import random8import math910class Location:11 def __init__(self):12 self.Fox = None13 self.Warren = None1415class Simulation:16 def __init__(self, LandscapeSize, InitialWarrenCount, InitialFoxCount, Variability, FixedInitialLocations):17 self.__ViewRabbits = ""18 self.__TimePeriod = 019 self.__WarrenCount = 020 self.__FoxCount = 021 self.__ShowDetail = False22 self.__LandscapeSize = LandscapeSize23 self.__Variability = Variability24 self.__FixedInitialLocations = FixedInitialLocations25 self.__Landscape = []26 for Count1 in range (self.__LandscapeSize):27 LandscapeRow = []28 for Count2 in range (self.__LandscapeSize):29 LandscapeLocation = None30 LandscapeRow.append(LandscapeLocation)31 self.__Landscape.append(LandscapeRow)32 self.__CreateLandscapeAndAnimals(InitialWarrenCount, InitialFoxCount, self.__FixedInitialLocations)33 self.__DrawLandscape()34 MenuOption = 035 while (self.__WarrenCount > 0 or self.__FoxCount > 0) and MenuOption != 5:36 print()37 print("1. Advance to next time period showing detail")38 print("2. Advance to next time period hiding detail")39 print("3. Inspect fox")40 print("4. Inspect warren")41 print("5. Exit")42 print()43 MenuOption = int(input("Select option: "))44 if MenuOption == 1:45 self.__TimePeriod += 146 self.__ShowDetail = True47 self.__AdvanceTimePeriod()48 if MenuOption == 2:49 self.__TimePeriod += 150 self.__ShowDetail = False51 self.__AdvanceTimePeriod()52 if MenuOption == 3:53 x = self.__InputCoordinate("x")54 y = self.__InputCoordinate("y")55 if not self.__Landscape[x][y].Fox is None:56 self.__Landscape[x][y].Fox.Inspect()57 if MenuOption == 4:58 x = self.__InputCoordinate("x")59 y = self.__InputCoordinate("y")60 if not self.__Landscape[x][y].Warren is None:61 self.__Landscape[x][y].Warren.Inspect()62 self.__ViewRabbits = input("View individual rabbits (y/n)? ")63 if self.__ViewRabbits == "y":64 self.__Landscape[x][y].Warren.ListRabbits()65 input()6667 def __InputCoordinate(self, CoordinateName):68 Coordinate = int(input(" Input " + CoordinateName + " coordinate:"))69 return Coordinate7071 def __CreateRiver(self):72 XCoordinate = self.__InputCoordinate("river x")73 YCoordinate = self.__InputCoordinate("river y")7475 for y in range(YCoordinate, self.__LandscapeSize-YCoordinate):76 self.__Landscape[XCoordinate][y] = "R"7778 def __AdvanceTimePeriod(self):79 NewFoxCount = 080 if self.__ShowDetail:81 print()82 for x in range (0, self.__LandscapeSize):83 for y in range (0, self.__LandscapeSize):84 if not self.__Landscape[x][y].Warren is None:85 if self.__ShowDetail:86 print("Warren at (", x, ",", y, "):", sep = "")87 print(" Period Start: ", end = "")88 self.__Landscape[x][y].Warren.Inspect()89 if self.__FoxCount > 0:90 self.__FoxesEatRabbitsInWarren(x, y)91 if self.__Landscape[x][y].Warren.NeedToCreateNewWarren():92 self.__CreateNewWarren()93 self.__Landscape[x][y].Warren.AdvanceGeneration(self.__ShowDetail)94 if self.__ShowDetail:95 print(" Period End: ", end = "")96 self.__Landscape[x][y].Warren.Inspect()97 input()98 if self.__Landscape[x][y].Warren.WarrenHasDiedOut():99 self.__Landscape[x][y].Warren = None100 self.__WarrenCount -= 1101 for x in range (0, self.__LandscapeSize):102 for y in range (0, self.__LandscapeSize):103 if not self.__Landscape[x][y].Fox is None:104 if self.__ShowDetail:105 print("Fox at (", x, ",", y, "): ", sep = "")106 self.__Landscape[x][y].Fox.AdvanceGeneration(self.__ShowDetail)107 if self.__Landscape[x][y].Fox.CheckIfDead():108 self.__Landscape[x][y].Fox = None109 self.__FoxCount -= 1110 else:111 if self.__Landscape[x][y].Fox.ReproduceThisPeriod():112 if self.__ShowDetail:113 print(" Fox has reproduced. ")114 NewFoxCount += 1115 if self.__ShowDetail:116 self.__Landscape[x][y].Fox.Inspect()117 self.__Landscape[x][y].Fox.ResetFoodConsumed()118 if NewFoxCount > 0:119 if self.__ShowDetail:120 print("New foxes born: ")121 for f in range (0, NewFoxCount):122 self.__CreateNewFox()123 if self.__ShowDetail:124 input()125 self.__DrawLandscape()126 print()127128 def __CreateLandscapeAndAnimals(self, InitialWarrenCount, InitialFoxCount, FixedInitialLocations):129 for x in range (0, self.__LandscapeSize):130 for y in range (0, self.__LandscapeSize):131 self.__Landscape[x][y] = Location()132 if FixedInitialLocations:133 self.__Landscape[1][1].Warren = Warren(self.__Variability, 38)134 self.__Landscape[2][8].Warren = Warren(self.__Variability, 80)135 self.__Landscape[9][7].Warren = Warren(self.__Variability, 20)136 self.__Landscape[10][3].Warren = Warren(self.__Variability, 52)137 self.__Landscape[13][4].Warren = Warren(self.__Variability, 67)138 self.__WarrenCount = 5139 self.__Landscape[2][10].Fox = Fox(self.__Variability)140 self.__Landscape[6][1].Fox = Fox(self.__Variability)141 self.__Landscape[8][6].Fox = Fox(self.__Variability)142 self.__Landscape[11][13].Fox = Fox(self.__Variability)143 self.__Landscape[12][4].Fox = Fox(self.__Variability)144 self.__FoxCount = 5145 else:146 for w in range (0, InitialWarrenCount):147 self.__CreateNewWarren()148 for f in range (0, InitialFoxCount):149 self.__CreateNewFox()150 self.__CreateRiver()151152 def __CreateNewWarren(self):153 x = random.randint(0, self.__LandscapeSize - 1)154 y = random.randint(0, self.__LandscapeSize - 1)155 while not self.__Landscape[x][y].Warren is None:156 x = random.randint(0, self.__LandscapeSize - 1)157 y = random.randint(0, self.__LandscapeSize - 1)158 if self.__ShowDetail:159 print("New Warren at (", x, ",", y, ")", sep = "")160 self.__Landscape[x][y].Warren = Warren(self.__Variability)161 self.__WarrenCount += 1162163 def __CreateNewFox(self):164 x = random.randint(0, self.__LandscapeSize - 1)165 y = random.randint(0, self.__LandscapeSize - 1)166 while not self.__Landscape[x][y].Fox is None:167 x = random.randint(0, self.__LandscapeSize - 1)168 y = random.randint(0, self.__LandscapeSize - 1)169 if self.__ShowDetail:170 print(" New Fox at (", x, ",", y, ")", sep = "")171 self.__Landscape[x][y].Fox = Fox(self.__Variability)172 self.__FoxCount += 1173174 def __FoxesEatRabbitsInWarren(self, WarrenX, WarrenY):175 RabbitCountAtStartOfPeriod = self.__Landscape[WarrenX][WarrenY].Warren.GetRabbitCount()176 for FoxX in range(0, self.__LandscapeSize):177 for FoxY in range (0, self.__LandscapeSize):178 if not self.__Landscape[FoxX][FoxY].Fox is None:179 Dist = self.__DistanceBetween(FoxX, FoxY, WarrenX, WarrenY)180 if Dist <= 3.5:181 PercentToEat = 20182 elif Dist <= 7:183 PercentToEat = 10184 else:185 PercentToEat = 0186 RabbitsToEat = int(round(float(PercentToEat * RabbitCountAtStartOfPeriod / 100)))187 FoodConsumed = self.__Landscape[WarrenX][WarrenY].Warren.EatRabbits(RabbitsToEat)188 self.__Landscape[FoxX][FoxY].Fox.GiveFood(FoodConsumed)189 if self.__ShowDetail:190 print(" ", FoodConsumed, " rabbits eaten by fox at (", FoxX, ",", FoxY, ").", sep = "")191192 def __DistanceBetween(self, x1, y1, x2, y2):193 return math.sqrt((pow(x1 - x2, 2) + pow(y1 - y2, 2)))194195 def __DrawLandscape(self):196 print()197 print("TIME PERIOD:", self.__TimePeriod)198 print()199 print(" ", end = "")200 for x in range (0, self.__LandscapeSize):201 if x < 10:202 print(" ", end = "")203 print(x, "|", end = "")204 print()205 for x in range (0, self.__LandscapeSize * 4 + 3):206 print("-", end = "")207 print()208 for y in range (0, self.__LandscapeSize):209 if y < 10:210 print(" ", end = "")211 print("", y, "|", sep = "", end = "")212 for x in range (0, self.__LandscapeSize):213 if not self.__Landscape[x][y].Warren is None or self.__Landscape[x][y] == "R":214 if self.__Landscape[x][y].Warren.GetRabbitCount() < 10:215 print(" ", end = "")216 print(self.__Landscape[x][y].Warren.GetRabbitCount(), end = "")217 else:218 print(" ", end = "")219 if not self.__Landscape[x][y].Fox is None:220 print("F", end = "")221 else:222 print(" ", end = "")223 print("|", end = "")224 print()225226class Warren:227 def __init__(self, Variability, RabbitCount = 0):228 self.__MAX_RABBITS_IN_WARREN = 99229 self.__RabbitCount = RabbitCount230 self.__PeriodsRun = 0231 self.__AlreadySpread = False232 self.__Variability = Variability233 self.__Rabbits = []234 for Count in range(0, self.__MAX_RABBITS_IN_WARREN):235 self.__Rabbits.append(None)236 if self.__RabbitCount == 0:237 self.__RabbitCount = int(self.__CalculateRandomValue(int(self.__MAX_RABBITS_IN_WARREN / 4), self.__Variability))238 for r in range (0, self.__RabbitCount):239 self.__Rabbits[r] = Rabbit(self.__Variability)240241 def __CalculateRandomValue(self, BaseValue, Variability):242 return BaseValue - (BaseValue * Variability / 100) + (BaseValue * random.randint(0, Variability * 2) / 100)243244 def GetRabbitCount(self):245 return self.__RabbitCount246247 def NeedToCreateNewWarren(self):248 if self.__RabbitCount == self.__MAX_RABBITS_IN_WARREN and not self.__AlreadySpread:249 self.__AlreadySpread = True250 return True251 else:252 return False253254 def WarrenHasDiedOut(self):255 if self.__RabbitCount == 0:256 return True257 else:258 return False259260 def AdvanceGeneration(self, ShowDetail):261 self.__PeriodsRun += 1262 if self.__RabbitCount > 0:263 self.__KillByOtherFactors(ShowDetail)264 if self.__RabbitCount > 0:265 self.__AgeRabbits(ShowDetail)266 if self.__RabbitCount > 0 and self.__RabbitCount <= self.__MAX_RABBITS_IN_WARREN:267 if self.__ContainsMales():268 self.__MateRabbits(ShowDetail)269 if self.__RabbitCount == 0 and ShowDetail:270 print(" All rabbits in warren are dead")271272 def EatRabbits(self, RabbitsToEat):273 DeathCount = 0274 if RabbitsToEat > self.__RabbitCount:275 RabbitsToEat = self.__RabbitCount276 while DeathCount < RabbitsToEat:277 RabbitNumber = random.randint(0, self.__RabbitCount - 1)278 if not self.__Rabbits[RabbitNumber] is None:279 self.__Rabbits[RabbitNumber] = None280 DeathCount += 1281 self.__CompressRabbitList(DeathCount)282 return RabbitsToEat283284 def __KillByOtherFactors(self, ShowDetail):285 DeathCount = 0286 for r in range (0, self.__RabbitCount):287 if self.__Rabbits[r].CheckIfKilledByOtherFactor():288 self.__Rabbits[r] = None289 DeathCount += 1290 self.__CompressRabbitList(DeathCount)291 if ShowDetail:292 print(" ", DeathCount, "rabbits killed by other factors.")293294 def __AgeRabbits(self, ShowDetail):295 DeathCount = 0296 for r in range (0, self.__RabbitCount):297 self.__Rabbits[r].CalculateNewAge()298 if self.__Rabbits[r].CheckIfDead():299 self.__Rabbits[r] = None300 DeathCount += 1301 self.__CompressRabbitList(DeathCount)302 if ShowDetail:303 print(" ", DeathCount, "rabbits die of old age.")304305 def __MateRabbits(self, ShowDetail):306 Mate = 0307 Babies = 0308 for r in range (0, self.__RabbitCount):309 if self.__Rabbits[r].IsFemale() and self.__RabbitCount + Babies < self.__MAX_RABBITS_IN_WARREN:310 Mate = random.randint(0, self.__RabbitCount - 1)311 while Mate == r or self.__Rabbits[Mate].IsFemale():312 Mate = random.randint(0, self.__RabbitCount - 1)313 CombinedReproductionRate = (self.__Rabbits[r].GetReproductionRate() + self.__Rabbits[Mate].GetReproductionRate()) / 2314 if CombinedReproductionRate >= 1:315 self.__Rabbits[self.__RabbitCount + Babies] = Rabbit(self.__Variability, CombinedReproductionRate)316 Babies += 1317 self.__RabbitCount = self.__RabbitCount + Babies318 if ShowDetail:319 print(" ", Babies, "baby rabbits born.")320321 def __CompressRabbitList(self, DeathCount):322 if DeathCount > 0:323 ShiftTo = 0324 ShiftFrom = 0325 while ShiftTo < self.__RabbitCount - DeathCount:326 while self.__Rabbits[ShiftFrom] is None:327 ShiftFrom += 1328 if ShiftTo != ShiftFrom:329 self.__Rabbits[ShiftTo] = self.__Rabbits[ShiftFrom]330 ShiftTo += 1331 ShiftFrom += 1332 self.__RabbitCount = self.__RabbitCount - DeathCount333334 def __ContainsMales(self):335 Males = False336 for r in range (0, self.__RabbitCount):337 if not self.__Rabbits[r].IsFemale():338 Males = True339 return Males340341 def Inspect(self):342 print("Periods Run", self.__PeriodsRun, "Size", self.__RabbitCount)343344 def ListRabbits(self):345 if self.__RabbitCount > 0:346 for r in range (0, self.__RabbitCount):347 self.__Rabbits[r].Inspect()348349class Animal:350 _ID = 1351352 def __init__(self, AvgLifespan, AvgProbabilityOfDeathOtherCauses, Variability):353 self._NaturalLifespan = int(AvgLifespan * self._CalculateRandomValue(100, Variability) / 100)354 self._ProbabilityOfDeathOtherCauses = AvgProbabilityOfDeathOtherCauses * self._CalculateRandomValue(100, Variability) / 100355 self._IsAlive = True356 self._ID = Animal._ID357 self._Age = 0358 Animal._ID += 1359360 def CalculateNewAge(self):361 self._Age += 1362 if self._Age >= self._NaturalLifespan:363 self._IsAlive = False364365 def CheckIfDead(self):366 return not self._IsAlive367368 def Inspect(self):369 print(" ID", self._ID, "", end = "")370 print("Age", self._Age, "", end = "")371 print("LS", self._NaturalLifespan, "", end = "")372 print("Pr dth", round(self._ProbabilityOfDeathOtherCauses, 2), "", end = "")373374 def CheckIfKilledByOtherFactor(self):375 if random.randint(0, 100) < self._ProbabilityOfDeathOtherCauses * 100:376 self._IsAlive = False377 return True378 else:379 return False380381 def _CalculateRandomValue(self, BaseValue, Variability):382 return BaseValue - (BaseValue * Variability / 100) + (BaseValue * random.randint(0, Variability * 2) / 100)383384class Fox(Animal):385 def __init__(self, Variability):386 self.__DEFAULT_LIFE_SPAN = 7387 self.__DEFAULT_PROBABILITY_DEATH_OTHER_CAUSES = 0.1388 super(Fox, self).__init__(self.__DEFAULT_LIFE_SPAN, self.__DEFAULT_PROBABILITY_DEATH_OTHER_CAUSES, Variability)389 self.__FoodUnitsNeeded = int(10 * self._CalculateRandomValue(100, Variability) / 100)390 self.__FoodUnitsConsumedThisPeriod = 0391392 def AdvanceGeneration(self, ShowDetail):393 if self.__FoodUnitsConsumedThisPeriod == 0:394 self._IsAlive = False395 if ShowDetail:396 print(" Fox dies as has eaten no food this period.")397 else:398 if self.CheckIfKilledByOtherFactor():399 self._IsAlive = False400 if ShowDetail:401 print(" Fox killed by other factor.")402 else:403 if self.__FoodUnitsConsumedThisPeriod < self.__FoodUnitsNeeded:404 self.CalculateNewAge()405 if ShowDetail:406 print(" Fox ages further due to lack of food.")407 self.CalculateNewAge()408 if not self._IsAlive:409 if ShowDetail:410 print(" Fox has died of old age.")411412 def ResetFoodConsumed(self):413 self.__FoodUnitsConsumedThisPeriod = 0414415 def ReproduceThisPeriod(self):416 REPRODUCTION_PROBABILITY = 0.25417 if random.randint(0, 100) < REPRODUCTION_PROBABILITY * 100:418 return True419 else:420 return False421422 def GiveFood(self, FoodUnits):423 self.__FoodUnitsConsumedThisPeriod = self.__FoodUnitsConsumedThisPeriod + FoodUnits424425 def Inspect(self):426 super(Fox, self).Inspect()427 print("Food needed", self.__FoodUnitsNeeded, "", end = "")428 print("Food eaten", self.__FoodUnitsConsumedThisPeriod, "", end = "")429 print()430431class Genders(enum.Enum):432 Male = 1433 Female = 2434435class Rabbit(Animal):436 def __init__(self, Variability, ParentsReproductionRate = 1.2):437 self.__DEFAULT_LIFE_SPAN = 4438 self.__DEFAULT_PROBABILITY_DEATH_OTHER_CAUSES = 0.05439 super(Rabbit, self).__init__(self.__DEFAULT_LIFE_SPAN, self.__DEFAULT_PROBABILITY_DEATH_OTHER_CAUSES, Variability)440 self.__ReproductionRate = ParentsReproductionRate * self._CalculateRandomValue(100, Variability) / 100441 if random.randint(0, 100) < 50:442 self.__Gender = Genders.Male443 else:444 self.__Gender = Genders.Female445446 def Inspect(self):447 super(Rabbit, self).Inspect()448 print("Rep rate", round(self.__ReproductionRate, 1), "", end = "")449 if self.__Gender == Genders.Female:450 print("Gender Female")451 else:452 print("Gender Male")453454 def IsFemale(self):455 if self.__Gender == Genders.Female:456 return True457 else:458 return False459460 def GetReproductionRate(self):461 return self.__ReproductionRate462463def Main():464 MenuOption = 0465 while MenuOption != 3:466 print("Predator Prey Simulation Main Menu")467 print()468 print("1. Run simulation with default settings")469 print("2. Run simulation with custom settings")470 print("3. Exit")471 print()472 MenuOption = int(input("Select option: "))473 if MenuOption == 1 or MenuOption == 2:474 if MenuOption == 1:475 LandscapeSize = 15476 InitialWarrenCount = 5477 InitialFoxCount = 5478 Variability = 0479 FixedInitialLocations = True480 else:481 LandscapeSize = int(input("Landscape Size: "))482 InitialWarrenCount = int(input("Initial number of warrens: "))483 InitialFoxCount = int(input("Initial number of foxes: "))484 Variability = int(input("Randomness variability (percent): "))485 FixedInitialLocations = False486 Sim = Simulation(LandscapeSize, InitialWarrenCount, InitialFoxCount, Variability, FixedInitialLocations)487 input()488489if __name__ == "__main__":490 Main()
...
LandscapeApi.py
Source:LandscapeApi.py
1from flask import Blueprint, request,jsonify,make_response,session2from App.common.ResData import ResData3from App.ext import db4from App.models import User, Landscape, UserBuyRecord5landscapeBlue =Blueprint("landscape",__name__)6def init_landscapeBlue(app):7 app.register_blueprint(blueprint=landscapeBlue)8@landscapeBlue.route("/landscape/queryAll", methods=["POST", "GET"])9def queryAll():10 landscapes = Landscape.query.all()11 landscapeList = []12 for one in landscapes:13 landscapeList.append(one.to_json())14 landscapesJson = {"landscapes": landscapeList}15 res = make_response(ResData.success(landscapesJson))16 return res17@landscapeBlue.route("/landscape/search",methods=["POST"])18def search():19 address = request.form.get('address')20 landscapes = Landscape.query.filter(21 Landscape.address == address).all()22 landscapeList=[]23 for one in landscapes:24 landscapeList.append(one.to_json())25 landscapesJson ={"landscapes":landscapeList}26 res= make_response(ResData.success(landscapesJson))27 return res28@landscapeBlue.route("/landscape/update",methods=["POST"])29def update():30 landscapeId=request.form.get("landscapeId")31 if(landscapeId is None):32 return ResData.paramEmpty(landscapeId)33 landscape=Landscape.query.filter(Landscape.landscapeId==landscapeId).first()34 address=request.form.get('address')35 landscapeName = request.form.get('landscapeName')36 price = request.form.get('price')37 score = request.form.get('score')38 Introduction = request.form.get('Introduction')39 pic = request.form.get('pic')40 landscape.address = address41 landscape.landscapeName = landscapeName42 landscape.price = price43 landscape.score = score44 landscape.Introduction = Introduction45 landscape.pic = pic46 db.session.add(landscape)47 db.session.commit()48 return ResData.success(None)49@landscapeBlue.route("/landscape/insert",methods=["POST"])50def insert():51 address=request.form.get('address')52 landscapeName = request.form.get('landscapeName')53 price = request.form.get('price')54 score = request.form.get('score')55 Introduction = request.form.get('Introduction')56 pic = request.form.get('pic')57 landscape=Landscape()58 landscape.address = address59 landscape.landscapeName = landscapeName60 landscape.price = price61 landscape.score = score62 landscape.Introduction = Introduction63 landscape.pic = pic64 db.session.add(landscape)65 db.session.commit()66 return ResData.success(None)67@landscapeBlue.route("/landscape/delete",methods=["POST"])68def delete():69 landscapeId=request.form.get('landscapeId')70 if(landscapeId is None):71 return ResData.paramEmpty(landscapeId)72 landscape=Landscape.query.filter(Landscape.landscapeId==landscapeId).first()73 db.session.delete(landscape)74 db.session.commit()75 return ResData.success(None)76@landscapeBlue.route("/landscape/buy",methods=["POST"])77def buy():78 userName = request.cookies.get('username')79 if(userName is None):80 return ResData.needLogin(userName)81 landscapeId=request.form.get('landscapeId')82 if(landscapeId is None):83 return ResData.paramEmpty(landscapeId)84 landscape=Landscape.query.filter(Landscape.landscapeId==landscapeId).first()85 # landscape.number=landscape.number - 1 æ¯ç¹ç¥¨æ²¡æéå¶86 userBuyRecord = UserBuyRecord()87 userBuyRecord.productId = landscapeId88 userBuyRecord.productType ="landscape"89 userBuyRecord.userName = userName90 db.session.add(landscape)91 db.session.add(userBuyRecord)92 db.session.commit()...
check_fast_snowy_landscape.py
Source:check_fast_snowy_landscape.py
1from __future__ import print_function, division2import imageio3import imgaug as ia4from imgaug import augmenters as iaa5def main():6 image = imageio.imread("https://upload.wikimedia.org/wikipedia/commons/8/89/Kukle%2CCzech_Republic..jpg",7 format="jpg")8 augs = [9 ("iaa.FastSnowyLandscape(64, 1.5)", iaa.FastSnowyLandscape(64, 1.5)),10 ("iaa.FastSnowyLandscape(128, 1.5)", iaa.FastSnowyLandscape(128, 1.5)),11 ("iaa.FastSnowyLandscape(200, 1.5)", iaa.FastSnowyLandscape(200, 1.5)),12 ("iaa.FastSnowyLandscape(64, 2.5)", iaa.FastSnowyLandscape(64, 2.5)),13 ("iaa.FastSnowyLandscape(128, 2.5)", iaa.FastSnowyLandscape(128, 2.5)),14 ("iaa.FastSnowyLandscape(200, 2.5)", iaa.FastSnowyLandscape(200, 2.5)),15 ("iaa.FastSnowyLandscape(64, 3.5)", iaa.FastSnowyLandscape(64, 3.5)),16 ("iaa.FastSnowyLandscape(128, 3.5)", iaa.FastSnowyLandscape(128, 3.5)),17 ("iaa.FastSnowyLandscape(200, 3.5)", iaa.FastSnowyLandscape(200, 3.5)),18 ("iaa.FastSnowyLandscape()", iaa.FastSnowyLandscape())19 ]20 for descr, aug in augs:21 print(descr)22 images_aug = aug.augment_images([image] * 64)23 ia.imshow(ia.draw_grid(images_aug))24if __name__ == "__main__":...
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!!