content
stringlengths
7
1.05M
fixed_cases
stringlengths
1
1.28M
""" This is the rank system based on the regression model we built """ def survival_score(timeSurvived, duration, winPlace): """ survival_score = 80% * survival time score + 20% * win place score : type timeSurvived: int -- participant time survived : type duration: int -- match duration time : type winPlace: int : rtype survival_score: int """ survival = (timeSurvived / duration) * 100 if winPlace == 1: win_place = 100 else: win_place = 100 - winPlace survival_score = int(survival * 0.8 + win_place * 0.2) if survival_score < 50: survival_score = 50 return survival_score def supply_score(pickups, pickupsfromcarepackages): """ supply_score = 80% * supply score + 20% * care packages score : type pickups: dict : type pickupsfromcarepackages: int : rtype supply_score: int """ # get the total number for each supply category Attachment = pickups["Attachment"] if "Attachment" in pickups else 0 Use = pickups["Use"] if "Use" in pickups else 0 Ammunition = pickups["Ammunition"] if "Ammunition" in pickups else 0 Equipment = pickups["Equipment"] if "Equipment" in pickups else 0 Weapon = pickups["Weapon"] if "Weapon" in pickups else 0 # calculate care package score if pickupsfromcarepackages > 0: care_package_score = 100 else: care_package_score = 0 # calculate attachment score if Attachment <= 5: attachment_score = 50 elif Attachment <= 9: attachment_score = 75 else: attachment_score = 100 # calculate use score if Use <= 5: use_score = 70 elif Use <= 10: use_score = 85 else: use_score = 100 # calculate equipment score if Equipment <= 5: equipment_score = 75 elif Equipment <= 10: equipment_score = 90 else: equipment_score = 100 # calculate weapon score if Weapon <= 1: weapon_score = 75 elif Weapon == 2: weapon_score = 90 else: weapon_score = 100 # calculate ammunition score if Ammunition <= 5: ammunition_score = 50 elif Ammunition <= 10: ammunition_score = 75 elif Ammunition <= 14: ammunition_score = 90 else: ammunition_score = 100 supplies_score = (equipment_score + use_score + weapon_score + ammunition_score) * 0.225 + attachment_score * 0.1 supply_score = int(supplies_score * 0.8 + care_package_score * 0.2) return supply_score def damage_score(damageDealt): """ damage_score : type damageDealt: float : rtype damage_score: int """ if damageDealt >= 349.45: damage_score = 100 elif damageDealt >= 300.54: damage_score = 95 elif damageDealt >= 251.62: damage_score = 90 elif damageDealt >= 216.7: damage_score = 85 elif damageDealt >= 181.8: damage_score = 80 elif damageDealt >= 146.89: damage_score = 75 elif damageDealt >= 130.67: damage_score = 70 elif damageDealt >= 114.47: damage_score = 65 elif damageDealt >= 98.26: damage_score = 60 elif damageDealt >= 86.19: damage_score = 55 elif damageDealt >= 74.14: damage_score = 50 else: damage_score = 45 return damage_score def kill_score(kills): """ kill_score : type kills: float : rtype kill_score: int """ if kills >= 2.95: kill_score = 100 elif kills >= 2.51: kill_score = 95 elif kills >= 2.04: kill_score = 90 elif kills >= 1.71: kill_score = 85 elif kills >= 1.38: kill_score = 80 elif kills >= 1.06: kill_score = 75 elif kills >= 0.91: kill_score = 70 elif kills >= 0.77: kill_score = 65 elif kills >= 0.65: kill_score = 60 elif kills >= 0.54: kill_score = 55 elif kills >= 0.43: kill_score = 50 else: kill_score = 45 return kill_score def distance_score(walkDistance): """ distance_score : type walkDistance: float : rtype distance_score: int """ if walkDistance >= 5349.83: distance_score = 100 elif walkDistance >= 4578.49: distance_score = 95 elif walkDistance >= 3807.16: distance_score = 90 elif walkDistance >= 3453.92: distance_score = 85 elif walkDistance >= 3100.68: distance_score = 80 elif walkDistance >= 2747.45: distance_score = 75 elif walkDistance >= 2260.84: distance_score = 70 elif walkDistance >= 1774.25: distance_score = 65 elif walkDistance >= 1287.65: distance_score = 60 elif walkDistance >= 879.20: distance_score = 55 elif walkDistance >= 470.77: distance_score = 50 else: distance_score = 45 return distance_score
""" This is the rank system based on the regression model we built """ def survival_score(timeSurvived, duration, winPlace): """ survival_score = 80% * survival time score + 20% * win place score : type timeSurvived: int -- participant time survived : type duration: int -- match duration time : type winPlace: int : rtype survival_score: int """ survival = timeSurvived / duration * 100 if winPlace == 1: win_place = 100 else: win_place = 100 - winPlace survival_score = int(survival * 0.8 + win_place * 0.2) if survival_score < 50: survival_score = 50 return survival_score def supply_score(pickups, pickupsfromcarepackages): """ supply_score = 80% * supply score + 20% * care packages score : type pickups: dict : type pickupsfromcarepackages: int : rtype supply_score: int """ attachment = pickups['Attachment'] if 'Attachment' in pickups else 0 use = pickups['Use'] if 'Use' in pickups else 0 ammunition = pickups['Ammunition'] if 'Ammunition' in pickups else 0 equipment = pickups['Equipment'] if 'Equipment' in pickups else 0 weapon = pickups['Weapon'] if 'Weapon' in pickups else 0 if pickupsfromcarepackages > 0: care_package_score = 100 else: care_package_score = 0 if Attachment <= 5: attachment_score = 50 elif Attachment <= 9: attachment_score = 75 else: attachment_score = 100 if Use <= 5: use_score = 70 elif Use <= 10: use_score = 85 else: use_score = 100 if Equipment <= 5: equipment_score = 75 elif Equipment <= 10: equipment_score = 90 else: equipment_score = 100 if Weapon <= 1: weapon_score = 75 elif Weapon == 2: weapon_score = 90 else: weapon_score = 100 if Ammunition <= 5: ammunition_score = 50 elif Ammunition <= 10: ammunition_score = 75 elif Ammunition <= 14: ammunition_score = 90 else: ammunition_score = 100 supplies_score = (equipment_score + use_score + weapon_score + ammunition_score) * 0.225 + attachment_score * 0.1 supply_score = int(supplies_score * 0.8 + care_package_score * 0.2) return supply_score def damage_score(damageDealt): """ damage_score : type damageDealt: float : rtype damage_score: int """ if damageDealt >= 349.45: damage_score = 100 elif damageDealt >= 300.54: damage_score = 95 elif damageDealt >= 251.62: damage_score = 90 elif damageDealt >= 216.7: damage_score = 85 elif damageDealt >= 181.8: damage_score = 80 elif damageDealt >= 146.89: damage_score = 75 elif damageDealt >= 130.67: damage_score = 70 elif damageDealt >= 114.47: damage_score = 65 elif damageDealt >= 98.26: damage_score = 60 elif damageDealt >= 86.19: damage_score = 55 elif damageDealt >= 74.14: damage_score = 50 else: damage_score = 45 return damage_score def kill_score(kills): """ kill_score : type kills: float : rtype kill_score: int """ if kills >= 2.95: kill_score = 100 elif kills >= 2.51: kill_score = 95 elif kills >= 2.04: kill_score = 90 elif kills >= 1.71: kill_score = 85 elif kills >= 1.38: kill_score = 80 elif kills >= 1.06: kill_score = 75 elif kills >= 0.91: kill_score = 70 elif kills >= 0.77: kill_score = 65 elif kills >= 0.65: kill_score = 60 elif kills >= 0.54: kill_score = 55 elif kills >= 0.43: kill_score = 50 else: kill_score = 45 return kill_score def distance_score(walkDistance): """ distance_score : type walkDistance: float : rtype distance_score: int """ if walkDistance >= 5349.83: distance_score = 100 elif walkDistance >= 4578.49: distance_score = 95 elif walkDistance >= 3807.16: distance_score = 90 elif walkDistance >= 3453.92: distance_score = 85 elif walkDistance >= 3100.68: distance_score = 80 elif walkDistance >= 2747.45: distance_score = 75 elif walkDistance >= 2260.84: distance_score = 70 elif walkDistance >= 1774.25: distance_score = 65 elif walkDistance >= 1287.65: distance_score = 60 elif walkDistance >= 879.2: distance_score = 55 elif walkDistance >= 470.77: distance_score = 50 else: distance_score = 45 return distance_score
a=input().split(" ") b=input().split(" ") A=0 B=0 for i in range(len(a)): num1=int(a[i]) num2=int(b[i]) if(num1>num2): A+=1 elif(num1<num2): B+=1 print(A, B)
a = input().split(' ') b = input().split(' ') a = 0 b = 0 for i in range(len(a)): num1 = int(a[i]) num2 = int(b[i]) if num1 > num2: a += 1 elif num1 < num2: b += 1 print(A, B)
# app config APP_CONFIG=dict( SECRET_KEY="SECRET", WTF_CSRF_SECRET_KEY="SECRET", # Webservice config WS_URL="http://localhost:5058", # ws del modello in locale DATASET_REQ = "/dataset", OPERATIVE_CENTERS_REQ = "/operative-centers", OC_DATE_REQ = "/oc-date", OC_DATA_REQ = "/oc-data", PREDICT_REQ = "/predict", OPERATORS_RANK_REQ = "/ops-rank/", SEND_REAL_Y_REQ = "/store-real-y/", SEND_LOGIN_REQ= "/login", MODELS_REQ = "/models", EVAL_MODELS_REQ = '/eval-models', USE_MODEL_REQ='/use-models', ALGORITHMS_REQ='/algorithms', SETTINGS_REQ = '/settings', DATA_CHARSET ='ISO-8859-1' ) # Application domain config
app_config = dict(SECRET_KEY='SECRET', WTF_CSRF_SECRET_KEY='SECRET', WS_URL='http://localhost:5058', DATASET_REQ='/dataset', OPERATIVE_CENTERS_REQ='/operative-centers', OC_DATE_REQ='/oc-date', OC_DATA_REQ='/oc-data', PREDICT_REQ='/predict', OPERATORS_RANK_REQ='/ops-rank/', SEND_REAL_Y_REQ='/store-real-y/', SEND_LOGIN_REQ='/login', MODELS_REQ='/models', EVAL_MODELS_REQ='/eval-models', USE_MODEL_REQ='/use-models', ALGORITHMS_REQ='/algorithms', SETTINGS_REQ='/settings', DATA_CHARSET='ISO-8859-1')
#encoding:utf-8 subreddit = 'mildlyvagina' t_channel = '@r_mildlyvagina' def send_post(submission, r2t): return r2t.send_simple(submission)
subreddit = 'mildlyvagina' t_channel = '@r_mildlyvagina' def send_post(submission, r2t): return r2t.send_simple(submission)
num1, num2 = list(map(int, input().split())) if num1 < num2: print(num1, num2) else: print(num2, num1)
(num1, num2) = list(map(int, input().split())) if num1 < num2: print(num1, num2) else: print(num2, num1)
#!/usr/bin/env python3.4 # coding: utf-8 class MixinMeta(type): """ Abstract mixin metaclass. """
class Mixinmeta(type): """ Abstract mixin metaclass. """
def main(): print('Hola, mundo') if __name__ =='__main__': main()
def main(): print('Hola, mundo') if __name__ == '__main__': main()
env = None pg = None surface = None width = None height = None # __pragma__ ('opov') def init(environ): global env, pg, surface, width, height env = environ pg = env['pg'] surface = env['surface'] width = env['width'] height = env['height'] tests = [test_transform_rotate, test_transform_rotozoom, test_transform_scale, test_transform_flip] return tests def test_transform_rotate(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.rotate(surface, 180) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255 def test_transform_rotozoom(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.rotozoom(surface, 180, 2.0) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 0 and surf.get_at((width*2-5,5)).r == 255 def test_transform_scale(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) size = (width*2, height*2) surf = pg.transform.scale(surface, size) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 surf = pg.transform.smoothscale(surface, size) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 surf = pg.transform.scale2x(surface) assert int(surf.get_width()/width) == 2 and int(surf.get_height()/height) == 2 assert surf.get_at((5,5)).r == 255 and surf.get_at((width*2-5,5)).r == 0 def test_transform_flip(): surface.fill((0,0,0)) surface.fill((255,0,0), (0,0,width//2,height)) surf = pg.transform.flip(surface, True, False) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255 surf = pg.transform.flip(surface, False, True) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 255 and surf.get_at((width-5,5)).r == 0 surf = pg.transform.flip(surface, True, True) assert surf.get_size() == (width, height) assert surf.get_at((5,5)).r == 0 and surf.get_at((width-5,5)).r == 255
env = None pg = None surface = None width = None height = None def init(environ): global env, pg, surface, width, height env = environ pg = env['pg'] surface = env['surface'] width = env['width'] height = env['height'] tests = [test_transform_rotate, test_transform_rotozoom, test_transform_scale, test_transform_flip] return tests def test_transform_rotate(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.rotate(surface, 180) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255 def test_transform_rotozoom(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.rotozoom(surface, 180, 2.0) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 0 and surf.get_at((width * 2 - 5, 5)).r == 255 def test_transform_scale(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) size = (width * 2, height * 2) surf = pg.transform.scale(surface, size) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 surf = pg.transform.smoothscale(surface, size) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 surf = pg.transform.scale2x(surface) assert int(surf.get_width() / width) == 2 and int(surf.get_height() / height) == 2 assert surf.get_at((5, 5)).r == 255 and surf.get_at((width * 2 - 5, 5)).r == 0 def test_transform_flip(): surface.fill((0, 0, 0)) surface.fill((255, 0, 0), (0, 0, width // 2, height)) surf = pg.transform.flip(surface, True, False) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255 surf = pg.transform.flip(surface, False, True) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 255 and surf.get_at((width - 5, 5)).r == 0 surf = pg.transform.flip(surface, True, True) assert surf.get_size() == (width, height) assert surf.get_at((5, 5)).r == 0 and surf.get_at((width - 5, 5)).r == 255
__author__ = 'vcaen' class Item(object): def __init__(self, title, short_desc, desc, picture): self.title = title self.short_desc = short_desc self.desc = desc self.picture = picture class Work(Item): def __init__(self, title, short_desc, desc, date_begin, date_end, company, picture): super(Work, self).__init__(title, short_desc, desc, picture) self.date_begin = date_begin self.date_end = date_end self.company = company class Project(Item): def __init__(self, title, short_desc, desc, picture, url): super(Project, self).__init__(title, short_desc, desc, picture) self.url = url class Education(Item): def __init__(self, school, degree, picture, date_begin, date_end, title="", short_desc="", desc=""): super(Education, self).__init__(title, short_desc, desc, picture) self.school = school self.degree = degree self.date_begin = date_begin self.date_end = date_end
__author__ = 'vcaen' class Item(object): def __init__(self, title, short_desc, desc, picture): self.title = title self.short_desc = short_desc self.desc = desc self.picture = picture class Work(Item): def __init__(self, title, short_desc, desc, date_begin, date_end, company, picture): super(Work, self).__init__(title, short_desc, desc, picture) self.date_begin = date_begin self.date_end = date_end self.company = company class Project(Item): def __init__(self, title, short_desc, desc, picture, url): super(Project, self).__init__(title, short_desc, desc, picture) self.url = url class Education(Item): def __init__(self, school, degree, picture, date_begin, date_end, title='', short_desc='', desc=''): super(Education, self).__init__(title, short_desc, desc, picture) self.school = school self.degree = degree self.date_begin = date_begin self.date_end = date_end
# https://leetcode.com/problems/counting-words-with-a-given-prefix/ class Solution: def prefixCount(self, words: List[str], pref: str) -> int: res = 0 for each in words: if len(each) >= len(pref): if each[:len(pref)] == pref: res += 1 return res
class Solution: def prefix_count(self, words: List[str], pref: str) -> int: res = 0 for each in words: if len(each) >= len(pref): if each[:len(pref)] == pref: res += 1 return res
class RollingHash: def __init__(self, text, pattern_size): self.text = text self.pattern_size = pattern_size self.hash = RollingHash.hash_text(text, pattern_size) self.start = 0 self.end = pattern_size self.alphabet = 26 def move_window(self): if self.end <= len(self.text) - 1: self.hash -= (ord(self.text[self.start]) - ord("a") + 1) * self.alphabet ** (self.pattern_size - 1) self.hash *= self.alphabet self.hash += ord(self.text[self.end]) - ord("a") + 1 self.start += 1 self.end += 1 def get_text_window(self): return self.text[self.start:self.end] @staticmethod def hash_text(text, limit, hash=0, alphabet=26): h = hash for i in range(0, limit): h += (ord(text[i]) - ord("a") + 1) * \ (alphabet ** (limit - i - 1)) return h def rabin_karp(pattern, text): res = [] if pattern == "" or text == "" or len(pattern) > len(text): return res pattern_hash = RollingHash.hash_text(pattern, len(pattern)) text_hash = RollingHash(text, len(pattern)) for i in range(0, len(text) - len(pattern) + 1): if text_hash.hash == pattern_hash and text_hash.get_text_window() == pattern: res.append(i) text_hash.move_window() return res
class Rollinghash: def __init__(self, text, pattern_size): self.text = text self.pattern_size = pattern_size self.hash = RollingHash.hash_text(text, pattern_size) self.start = 0 self.end = pattern_size self.alphabet = 26 def move_window(self): if self.end <= len(self.text) - 1: self.hash -= (ord(self.text[self.start]) - ord('a') + 1) * self.alphabet ** (self.pattern_size - 1) self.hash *= self.alphabet self.hash += ord(self.text[self.end]) - ord('a') + 1 self.start += 1 self.end += 1 def get_text_window(self): return self.text[self.start:self.end] @staticmethod def hash_text(text, limit, hash=0, alphabet=26): h = hash for i in range(0, limit): h += (ord(text[i]) - ord('a') + 1) * alphabet ** (limit - i - 1) return h def rabin_karp(pattern, text): res = [] if pattern == '' or text == '' or len(pattern) > len(text): return res pattern_hash = RollingHash.hash_text(pattern, len(pattern)) text_hash = rolling_hash(text, len(pattern)) for i in range(0, len(text) - len(pattern) + 1): if text_hash.hash == pattern_hash and text_hash.get_text_window() == pattern: res.append(i) text_hash.move_window() return res
class ImageAdapter: @staticmethod def to_network_input(dataset): return (dataset - 127.5) / 127.5 @staticmethod def to_image(normalized_images): images = normalized_images * 127.5 + 127.5 return images.astype(int)
class Imageadapter: @staticmethod def to_network_input(dataset): return (dataset - 127.5) / 127.5 @staticmethod def to_image(normalized_images): images = normalized_images * 127.5 + 127.5 return images.astype(int)
BULBASAUR = 0x01 IVYSAUR = 0x02 VENUSAUR = 0x03 CHARMANDER = 0x04 CHARMELEON = 0x05 CHARIZARD = 0x06 SQUIRTLE = 0x07 WARTORTLE = 0x08 BLASTOISE = 0x09 CATERPIE = 0x0a METAPOD = 0x0b BUTTERFREE = 0x0c WEEDLE = 0x0d KAKUNA = 0x0e BEEDRILL = 0x0f PIDGEY = 0x10 PIDGEOTTO = 0x11 PIDGEOT = 0x12 RATTATA = 0x13 RATICATE = 0x14 SPEAROW = 0x15 FEAROW = 0x16 EKANS = 0x17 ARBOK = 0x18 PIKACHU = 0x19 RAICHU = 0x1a SANDSHREW = 0x1b SANDSLASH = 0x1c NIDORAN_F = 0x1d NIDORINA = 0x1e NIDOQUEEN = 0x1f NIDORAN_M = 0x20 NIDORINO = 0x21 NIDOKING = 0x22 CLEFAIRY = 0x23 CLEFABLE = 0x24 VULPIX = 0x25 NINETALES = 0x26 JIGGLYPUFF = 0x27 WIGGLYTUFF = 0x28 ZUBAT = 0x29 GOLBAT = 0x2a ODDISH = 0x2b GLOOM = 0x2c VILEPLUME = 0x2d PARAS = 0x2e PARASECT = 0x2f VENONAT = 0x30 VENOMOTH = 0x31 DIGLETT = 0x32 DUGTRIO = 0x33 MEOWTH = 0x34 PERSIAN = 0x35 PSYDUCK = 0x36 GOLDUCK = 0x37 MANKEY = 0x38 PRIMEAPE = 0x39 GROWLITHE = 0x3a ARCANINE = 0x3b POLIWAG = 0x3c POLIWHIRL = 0x3d POLIWRATH = 0x3e ABRA = 0x3f KADABRA = 0x40 ALAKAZAM = 0x41 MACHOP = 0x42 MACHOKE = 0x43 MACHAMP = 0x44 BELLSPROUT = 0x45 WEEPINBELL = 0x46 VICTREEBEL = 0x47 TENTACOOL = 0x48 TENTACRUEL = 0x49 GEODUDE = 0x4a GRAVELER = 0x4b GOLEM = 0x4c PONYTA = 0x4d RAPIDASH = 0x4e SLOWPOKE = 0x4f SLOWBRO = 0x50 MAGNEMITE = 0x51 MAGNETON = 0x52 FARFETCH_D = 0x53 DODUO = 0x54 DODRIO = 0x55 SEEL = 0x56 DEWGONG = 0x57 GRIMER = 0x58 MUK = 0x59 SHELLDER = 0x5a CLOYSTER = 0x5b GASTLY = 0x5c HAUNTER = 0x5d GENGAR = 0x5e ONIX = 0x5f DROWZEE = 0x60 HYPNO = 0x61 KRABBY = 0x62 KINGLER = 0x63 VOLTORB = 0x64 ELECTRODE = 0x65 EXEGGCUTE = 0x66 EXEGGUTOR = 0x67 CUBONE = 0x68 MAROWAK = 0x69 HITMONLEE = 0x6a HITMONCHAN = 0x6b LICKITUNG = 0x6c KOFFING = 0x6d WEEZING = 0x6e RHYHORN = 0x6f RHYDON = 0x70 CHANSEY = 0x71 TANGELA = 0x72 KANGASKHAN = 0x73 HORSEA = 0x74 SEADRA = 0x75 GOLDEEN = 0x76 SEAKING = 0x77 STARYU = 0x78 STARMIE = 0x79 MR__MIME = 0x7a SCYTHER = 0x7b JYNX = 0x7c ELECTABUZZ = 0x7d MAGMAR = 0x7e PINSIR = 0x7f TAUROS = 0x80 MAGIKARP = 0x81 GYARADOS = 0x82 LAPRAS = 0x83 DITTO = 0x84 EEVEE = 0x85 VAPOREON = 0x86 JOLTEON = 0x87 FLAREON = 0x88 PORYGON = 0x89 OMANYTE = 0x8a OMASTAR = 0x8b KABUTO = 0x8c KABUTOPS = 0x8d AERODACTYL = 0x8e SNORLAX = 0x8f ARTICUNO = 0x90 ZAPDOS = 0x91 MOLTRES = 0x92 DRATINI = 0x93 DRAGONAIR = 0x94 DRAGONITE = 0x95 MEWTWO = 0x96 MEW = 0x97 CHIKORITA = 0x98 BAYLEEF = 0x99 MEGANIUM = 0x9a CYNDAQUIL = 0x9b QUILAVA = 0x9c TYPHLOSION = 0x9d TOTODILE = 0x9e CROCONAW = 0x9f FERALIGATR = 0xa0 SENTRET = 0xa1 FURRET = 0xa2 HOOTHOOT = 0xa3 NOCTOWL = 0xa4 LEDYBA = 0xa5 LEDIAN = 0xa6 SPINARAK = 0xa7 ARIADOS = 0xa8 CROBAT = 0xa9 CHINCHOU = 0xaa LANTURN = 0xab PICHU = 0xac CLEFFA = 0xad IGGLYBUFF = 0xae TOGEPI = 0xaf TOGETIC = 0xb0 NATU = 0xb1 XATU = 0xb2 MAREEP = 0xb3 FLAAFFY = 0xb4 AMPHAROS = 0xb5 BELLOSSOM = 0xb6 MARILL = 0xb7 AZUMARILL = 0xb8 SUDOWOODO = 0xb9 POLITOED = 0xba HOPPIP = 0xbb SKIPLOOM = 0xbc JUMPLUFF = 0xbd AIPOM = 0xbe SUNKERN = 0xbf SUNFLORA = 0xc0 YANMA = 0xc1 WOOPER = 0xc2 QUAGSIRE = 0xc3 ESPEON = 0xc4 UMBREON = 0xc5 MURKROW = 0xc6 SLOWKING = 0xc7 MISDREAVUS = 0xc8 UNOWN = 0xc9 WOBBUFFET = 0xca GIRAFARIG = 0xcb PINECO = 0xcc FORRETRESS = 0xcd DUNSPARCE = 0xce GLIGAR = 0xcf STEELIX = 0xd0 SNUBBULL = 0xd1 GRANBULL = 0xd2 QWILFISH = 0xd3 SCIZOR = 0xd4 SHUCKLE = 0xd5 HERACROSS = 0xd6 SNEASEL = 0xd7 TEDDIURSA = 0xd8 URSARING = 0xd9 SLUGMA = 0xda MAGCARGO = 0xdb SWINUB = 0xdc PILOSWINE = 0xdd CORSOLA = 0xde REMORAID = 0xdf OCTILLERY = 0xe0 DELIBIRD = 0xe1 MANTINE = 0xe2 SKARMORY = 0xe3 HOUNDOUR = 0xe4 HOUNDOOM = 0xe5 KINGDRA = 0xe6 PHANPY = 0xe7 DONPHAN = 0xe8 PORYGON2 = 0xe9 STANTLER = 0xea SMEARGLE = 0xeb TYROGUE = 0xec HITMONTOP = 0xed SMOOCHUM = 0xee ELEKID = 0xef MAGBY = 0xf0 MILTANK = 0xf1 BLISSEY = 0xf2 RAIKOU = 0xf3 ENTEI = 0xf4 SUICUNE = 0xf5 LARVITAR = 0xf6 PUPITAR = 0xf7 TYRANITAR = 0xf8 LUGIA = 0xf9 HO_OH = 0xfa CELEBI = 0xfb MON_FC = 0xfc EGG = 0xfd MON_FE = 0xfe MON_CONSTS = {"BULBASAUR": 0x01,"IVYSAUR": 0x02,"VENUSAUR": 0x03,"CHARMANDER": 0x04,"CHARMELEON": 0x05,"CHARIZARD": 0x06,"SQUIRTLE": 0x07,"WARTORTLE": 0x08,"BLASTOISE": 0x09,"CATERPIE": 0x0a,"METAPOD": 0x0b,"BUTTERFREE": 0x0c,"WEEDLE": 0x0d,"KAKUNA": 0x0e,"BEEDRILL": 0x0f,"PIDGEY": 0x10,"PIDGEOTTO": 0x11,"PIDGEOT": 0x12,"RATTATA": 0x13,"RATICATE": 0x14,"SPEAROW": 0x15,"FEAROW": 0x16,"EKANS": 0x17,"ARBOK": 0x18,"PIKACHU": 0x19,"RAICHU": 0x1a,"SANDSHREW": 0x1b,"SANDSLASH": 0x1c,"NIDORAN_F": 0x1d,"NIDORINA": 0x1e,"NIDOQUEEN": 0x1f,"NIDORAN_M": 0x20,"NIDORINO": 0x21,"NIDOKING": 0x22,"CLEFAIRY": 0x23,"CLEFABLE": 0x24,"VULPIX": 0x25,"NINETALES": 0x26,"JIGGLYPUFF": 0x27,"WIGGLYTUFF": 0x28,"ZUBAT": 0x29,"GOLBAT": 0x2a,"ODDISH": 0x2b,"GLOOM": 0x2c,"VILEPLUME": 0x2d,"PARAS": 0x2e,"PARASECT": 0x2f,"VENONAT": 0x30,"VENOMOTH": 0x31,"DIGLETT": 0x32,"DUGTRIO": 0x33,"MEOWTH": 0x34,"PERSIAN": 0x35,"PSYDUCK": 0x36,"GOLDUCK": 0x37,"MANKEY": 0x38,"PRIMEAPE": 0x39,"GROWLITHE": 0x3a,"ARCANINE": 0x3b,"POLIWAG": 0x3c,"POLIWHIRL": 0x3d,"POLIWRATH": 0x3e,"ABRA": 0x3f,"KADABRA": 0x40,"ALAKAZAM": 0x41,"MACHOP": 0x42,"MACHOKE": 0x43,"MACHAMP": 0x44,"BELLSPROUT": 0x45,"WEEPINBELL": 0x46,"VICTREEBEL": 0x47,"TENTACOOL": 0x48,"TENTACRUEL": 0x49,"GEODUDE": 0x4a,"GRAVELER": 0x4b,"GOLEM": 0x4c,"PONYTA": 0x4d,"RAPIDASH": 0x4e,"SLOWPOKE": 0x4f,"SLOWBRO": 0x50,"MAGNEMITE": 0x51,"MAGNETON": 0x52,"FARFETCH_D": 0x53,"DODUO": 0x54,"DODRIO": 0x55,"SEEL": 0x56,"DEWGONG": 0x57,"GRIMER": 0x58,"MUK": 0x59,"SHELLDER": 0x5a,"CLOYSTER": 0x5b,"GASTLY": 0x5c,"HAUNTER": 0x5d,"GENGAR": 0x5e,"ONIX": 0x5f,"DROWZEE": 0x60,"HYPNO": 0x61,"KRABBY": 0x62,"KINGLER": 0x63,"VOLTORB": 0x64,"ELECTRODE": 0x65,"EXEGGCUTE": 0x66,"EXEGGUTOR": 0x67,"CUBONE": 0x68,"MAROWAK": 0x69,"HITMONLEE": 0x6a,"HITMONCHAN": 0x6b,"LICKITUNG": 0x6c,"KOFFING": 0x6d,"WEEZING": 0x6e,"RHYHORN": 0x6f,"RHYDON": 0x70,"CHANSEY": 0x71,"TANGELA": 0x72,"KANGASKHAN": 0x73,"HORSEA": 0x74,"SEADRA": 0x75,"GOLDEEN": 0x76,"SEAKING": 0x77,"STARYU": 0x78,"STARMIE": 0x79,"MR__MIME": 0x7a,"SCYTHER": 0x7b,"JYNX": 0x7c,"ELECTABUZZ": 0x7d,"MAGMAR": 0x7e,"PINSIR": 0x7f,"TAUROS": 0x80,"MAGIKARP": 0x81,"GYARADOS": 0x82,"LAPRAS": 0x83,"DITTO": 0x84,"EEVEE": 0x85,"VAPOREON": 0x86,"JOLTEON": 0x87,"FLAREON": 0x88,"PORYGON": 0x89,"OMANYTE": 0x8a,"OMASTAR": 0x8b,"KABUTO": 0x8c,"KABUTOPS": 0x8d,"AERODACTYL": 0x8e,"SNORLAX": 0x8f,"ARTICUNO": 0x90,"ZAPDOS": 0x91,"MOLTRES": 0x92,"DRATINI": 0x93,"DRAGONAIR": 0x94,"DRAGONITE": 0x95,"MEWTWO": 0x96,"MEW": 0x97,"CHIKORITA": 0x98,"BAYLEEF": 0x99,"MEGANIUM": 0x9a,"CYNDAQUIL": 0x9b,"QUILAVA": 0x9c,"TYPHLOSION": 0x9d,"TOTODILE": 0x9e,"CROCONAW": 0x9f,"FERALIGATR": 0xa0,"SENTRET": 0xa1,"FURRET": 0xa2,"HOOTHOOT": 0xa3,"NOCTOWL": 0xa4,"LEDYBA": 0xa5,"LEDIAN": 0xa6,"SPINARAK": 0xa7,"ARIADOS": 0xa8,"CROBAT": 0xa9,"CHINCHOU": 0xaa,"LANTURN": 0xab,"PICHU": 0xac,"CLEFFA": 0xad,"IGGLYBUFF": 0xae,"TOGEPI": 0xaf,"TOGETIC": 0xb0,"NATU": 0xb1,"XATU": 0xb2,"MAREEP": 0xb3,"FLAAFFY": 0xb4,"AMPHAROS": 0xb5,"BELLOSSOM": 0xb6,"MARILL": 0xb7,"AZUMARILL": 0xb8,"SUDOWOODO": 0xb9,"POLITOED": 0xba,"HOPPIP": 0xbb,"SKIPLOOM": 0xbc,"JUMPLUFF": 0xbd,"AIPOM": 0xbe,"SUNKERN": 0xbf,"SUNFLORA": 0xc0,"YANMA": 0xc1,"WOOPER": 0xc2,"QUAGSIRE": 0xc3,"ESPEON": 0xc4,"UMBREON": 0xc5,"MURKROW": 0xc6,"SLOWKING": 0xc7,"MISDREAVUS": 0xc8,"UNOWN": 0xc9,"WOBBUFFET": 0xca,"GIRAFARIG": 0xcb,"PINECO": 0xcc,"FORRETRESS": 0xcd,"DUNSPARCE": 0xce,"GLIGAR": 0xcf,"STEELIX": 0xd0,"SNUBBULL": 0xd1,"GRANBULL": 0xd2,"QWILFISH": 0xd3,"SCIZOR": 0xd4,"SHUCKLE": 0xd5,"HERACROSS": 0xd6,"SNEASEL": 0xd7,"TEDDIURSA": 0xd8,"URSARING": 0xd9,"SLUGMA": 0xda,"MAGCARGO": 0xdb,"SWINUB": 0xdc,"PILOSWINE": 0xdd,"CORSOLA": 0xde,"REMORAID": 0xdf,"OCTILLERY": 0xe0,"DELIBIRD": 0xe1,"MANTINE": 0xe2,"SKARMORY": 0xe3,"HOUNDOUR": 0xe4,"HOUNDOOM": 0xe5,"KINGDRA": 0xe6,"PHANPY": 0xe7,"DONPHAN": 0xe8,"PORYGON2": 0xe9,"STANTLER": 0xea,"SMEARGLE": 0xeb,"TYROGUE": 0xec,"HITMONTOP": 0xed,"SMOOCHUM": 0xee,"ELEKID": 0xef,"MAGBY": 0xf0,"MILTANK": 0xf1,"BLISSEY": 0xf2,"RAIKOU": 0xf3,"ENTEI": 0xf4,"SUICUNE": 0xf5,"LARVITAR": 0xf6,"PUPITAR": 0xf7,"TYRANITAR": 0xf8,"LUGIA": 0xf9,"HO_OH": 0xfa,"CELEBI": 0xfb,"MON_FC": 0xfc,"EGG": 0xfd,"MON_FE": 0xfe} MON_CONSTS_REV = {x: y for y, x in MON_CONSTS.items()} EVOLUTION_LINES = {'BULBASAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'IVYSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'VENUSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'CHARMANDER': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARMELEON': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARIZARD': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'SQUIRTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'WARTORTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'BLASTOISE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'CATERPIE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'METAPOD': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'BUTTERFREE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'WEEDLE': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'KAKUNA': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'BEEDRILL': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'PIDGEY': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOTTO': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOT': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'RATTATA': ['RATTATA', 'RATICATE'], 'RATICATE': ['RATTATA', 'RATICATE'], 'SPEAROW': ['SPEAROW', 'FEAROW'], 'FEAROW': ['SPEAROW', 'FEAROW'], 'EKANS': ['EKANS', 'ARBOK'], 'ARBOK': ['EKANS', 'ARBOK'], 'PIKACHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'RAICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'SANDSHREW': ['SANDSHREW', 'SANDSLASH'], 'SANDSLASH': ['SANDSHREW', 'SANDSLASH'], 'NIDORAN_F': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORINA': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDOQUEEN': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORAN_M': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDORINO': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDOKING': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'CLEFAIRY': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'CLEFABLE': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'VULPIX': ['VULPIX', 'NINETALES'], 'NINETALES': ['VULPIX', 'NINETALES'], 'JIGGLYPUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'WIGGLYTUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'ZUBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'GOLBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'CROBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'ODDISH': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'GLOOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'VILEPLUME': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'BELLOSSOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'PARAS': ['PARAS', 'PARASECT'], 'PARASECT': ['PARAS', 'PARASECT'], 'VENONAT': ['VENONAT', 'VENOMOTH'], 'VENOMOTH': ['VENONAT', 'VENOMOTH'], 'DIGLETT': ['DIGLETT', 'DUGTRIO'], 'DUGTRIO': ['DIGLETT', 'DUGTRIO'], 'MEOWTH': ['MEOWTH', 'PERSIAN'], 'PERSIAN': ['MEOWTH', 'PERSIAN'], 'PSYDUCK': ['PSYDUCK', 'GOLDUCK'], 'GOLDUCK': ['PSYDUCK', 'GOLDUCK'], 'MANKEY': ['MANKEY', 'PRIMEAPE'], 'PRIMEAPE': ['MANKEY', 'PRIMEAPE'], 'GROWLITHE': ['GROWLITHE', 'ARCANINE'], 'ARCANINE': ['GROWLITHE', 'ARCANINE'], 'POLIWAG': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWHIRL': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWRATH': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLITOED': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'ABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'KADABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'ALAKAZAM': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'MACHOP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHOKE': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHAMP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'BELLSPROUT': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'WEEPINBELL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'VICTREEBEL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'TENTACOOL': ['TENTACOOL', 'TENTACRUEL'], 'TENTACRUEL': ['TENTACOOL', 'TENTACRUEL'], 'GEODUDE': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GRAVELER': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GOLEM': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'PONYTA': ['PONYTA', 'RAPIDASH'], 'RAPIDASH': ['PONYTA', 'RAPIDASH'], 'SLOWPOKE': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWBRO': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWKING': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'MAGNEMITE': ['MAGNEMITE', 'MAGNETON'], 'MAGNETON': ['MAGNEMITE', 'MAGNETON'], 'FARFETCH_D': ['FARFETCH_D'], 'DODUO': ['DODUO', 'DODRIO'], 'DODRIO': ['DODUO', 'DODRIO'], 'SEEL': ['SEEL', 'DEWGONG'], 'DEWGONG': ['SEEL', 'DEWGONG'], 'GRIMER': ['GRIMER', 'MUK'], 'MUK': ['GRIMER', 'MUK'], 'SHELLDER': ['SHELLDER', 'CLOYSTER'], 'CLOYSTER': ['SHELLDER', 'CLOYSTER'], 'GASTLY': ['GASTLY', 'HAUNTER', 'GENGAR'], 'HAUNTER': ['GASTLY', 'HAUNTER', 'GENGAR'], 'GENGAR': ['GASTLY', 'HAUNTER', 'GENGAR'], 'ONIX': ['ONIX', 'STEELIX'], 'STEELIX': ['ONIX', 'STEELIX'], 'DROWZEE': ['DROWZEE', 'HYPNO'], 'HYPNO': ['DROWZEE', 'HYPNO'], 'KRABBY': ['KRABBY', 'KINGLER'], 'KINGLER': ['KRABBY', 'KINGLER'], 'VOLTORB': ['VOLTORB', 'ELECTRODE'], 'ELECTRODE': ['VOLTORB', 'ELECTRODE'], 'EXEGGCUTE': ['EXEGGCUTE', 'EXEGGUTOR'], 'EXEGGUTOR': ['EXEGGCUTE', 'EXEGGUTOR'], 'CUBONE': ['CUBONE', 'MAROWAK'], 'MAROWAK': ['CUBONE', 'MAROWAK'], 'HITMONLEE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONCHAN': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'LICKITUNG': ['LICKITUNG'], 'KOFFING': ['KOFFING', 'WEEZING'], 'WEEZING': ['KOFFING', 'WEEZING'], 'RHYHORN': ['RHYHORN', 'RHYDON'], 'RHYDON': ['RHYHORN', 'RHYDON'], 'CHANSEY': ['CHANSEY', 'BLISSEY'], 'BLISSEY': ['CHANSEY', 'BLISSEY'], 'TANGELA': ['TANGELA'], 'KANGASKHAN': ['KANGASKHAN'], 'HORSEA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'SEADRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'KINGDRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'GOLDEEN': ['GOLDEEN', 'SEAKING'], 'SEAKING': ['GOLDEEN', 'SEAKING'], 'STARYU': ['STARYU', 'STARMIE'], 'STARMIE': ['STARYU', 'STARMIE'], 'MR__MIME': ['MR__MIME'], 'SCYTHER': ['SCYTHER', 'SCIZOR'], 'SCIZOR': ['SCYTHER', 'SCIZOR'], 'JYNX': ['SMOOCHUM', 'JYNX'], 'ELECTABUZZ': ['ELEKID', 'ELECTABUZZ'], 'MAGMAR': ['MAGBY', 'MAGMAR'], 'PINSIR': ['PINSIR'], 'TAUROS': ['TAUROS'], 'MAGIKARP': ['MAGIKARP', 'GYARADOS'], 'GYARADOS': ['MAGIKARP', 'GYARADOS'], 'LAPRAS': ['LAPRAS'], 'DITTO': ['DITTO'], 'EEVEE': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'JOLTEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'VAPOREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'FLAREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'ESPEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'UMBREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'PORYGON': ['PORYGON', 'PORYGON2'], 'PORYGON2': ['PORYGON', 'PORYGON2'], 'OMANYTE': ['OMANYTE', 'OMASTAR'], 'OMASTAR': ['OMANYTE', 'OMASTAR'], 'KABUTO': ['KABUTO', 'KABUTOPS'], 'KABUTOPS': ['KABUTO', 'KABUTOPS'], 'AERODACTYL': ['AERODACTYL'], 'SNORLAX': ['SNORLAX'], 'ARTICUNO': ['ARTICUNO'], 'ZAPDOS': ['ZAPDOS'], 'MOLTRES': ['MOLTRES'], 'DRATINI': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONAIR': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONITE': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'MEWTWO': ['MEWTWO'], 'MEW': ['MEW'], 'CHIKORITA': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'BAYLEEF': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'MEGANIUM': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'CYNDAQUIL': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'QUILAVA': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TYPHLOSION': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TOTODILE': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'CROCONAW': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'FERALIGATR': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'SENTRET': ['SENTRET', 'FURRET'], 'FURRET': ['SENTRET', 'FURRET'], 'HOOTHOOT': ['HOOTHOOT', 'NOCTOWL'], 'NOCTOWL': ['HOOTHOOT', 'NOCTOWL'], 'LEDYBA': ['LEDYBA', 'LEDIAN'], 'LEDIAN': ['LEDYBA', 'LEDIAN'], 'SPINARAK': ['SPINARAK', 'ARIADOS'], 'ARIADOS': ['SPINARAK', 'ARIADOS'], 'CHINCHOU': ['CHINCHOU', 'LANTURN'], 'LANTURN': ['CHINCHOU', 'LANTURN'], 'PICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'CLEFFA': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'IGGLYBUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'TOGEPI': ['TOGEPI', 'TOGETIC'], 'TOGETIC': ['TOGEPI', 'TOGETIC'], 'NATU': ['NATU', 'XATU'], 'XATU': ['NATU', 'XATU'], 'MAREEP': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'FLAAFFY': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'AMPHAROS': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'MARILL': ['MARILL', 'AZUMARILL'], 'AZUMARILL': ['MARILL', 'AZUMARILL'], 'SUDOWOODO': ['SUDOWOODO'], 'HOPPIP': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'SKIPLOOM': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'JUMPLUFF': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'AIPOM': ['AIPOM'], 'SUNKERN': ['SUNKERN', 'SUNFLORA'], 'SUNFLORA': ['SUNKERN', 'SUNFLORA'], 'YANMA': ['YANMA'], 'WOOPER': ['WOOPER', 'QUAGSIRE'], 'QUAGSIRE': ['WOOPER', 'QUAGSIRE'], 'MURKROW': ['MURKROW'], 'MISDREAVUS': ['MISDREAVUS'], 'UNOWN': ['UNOWN'], 'WOBBUFFET': ['WOBBUFFET'], 'GIRAFARIG': ['GIRAFARIG'], 'PINECO': ['PINECO', 'FORRETRESS'], 'FORRETRESS': ['PINECO', 'FORRETRESS'], 'DUNSPARCE': ['DUNSPARCE'], 'GLIGAR': ['GLIGAR'], 'SNUBBULL': ['SNUBBULL', 'GRANBULL'], 'GRANBULL': ['SNUBBULL', 'GRANBULL'], 'QWILFISH': ['QWILFISH'], 'SHUCKLE': ['SHUCKLE'], 'HERACROSS': ['HERACROSS'], 'SNEASEL': ['SNEASEL'], 'TEDDIURSA': ['TEDDIURSA', 'URSARING'], 'URSARING': ['TEDDIURSA', 'URSARING'], 'SLUGMA': ['SLUGMA', 'MAGCARGO'], 'MAGCARGO': ['SLUGMA', 'MAGCARGO'], 'SWINUB': ['SWINUB', 'PILOSWINE'], 'PILOSWINE': ['SWINUB', 'PILOSWINE'], 'CORSOLA': ['CORSOLA'], 'REMORAID': ['REMORAID', 'OCTILLERY'], 'OCTILLERY': ['REMORAID', 'OCTILLERY'], 'DELIBIRD': ['DELIBIRD'], 'MANTINE': ['MANTINE'], 'SKARMORY': ['SKARMORY'], 'HOUNDOUR': ['HOUNDOUR', 'HOUNDOOM'], 'HOUNDOOM': ['HOUNDOUR', 'HOUNDOOM'], 'PHANPY': ['PHANPY', 'DONPHAN'], 'DONPHAN': ['PHANPY', 'DONPHAN'], 'STANTLER': ['STANTLER'], 'SMEARGLE': ['SMEARGLE'], 'TYROGUE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONTOP': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'SMOOCHUM': ['SMOOCHUM', 'JYNX'], 'ELEKID': ['ELEKID', 'ELECTABUZZ'], 'MAGBY': ['MAGBY', 'MAGMAR'], 'MILTANK': ['MILTANK'], 'RAIKOU': ['RAIKOU'], 'ENTEI': ['ENTEI'], 'SUICUNE': ['SUICUNE'], 'LARVITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'PUPITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'TYRANITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'LUGIA': ['LUGIA'], 'HO_OH': ['HO_OH'], 'CELEBI': ['CELEBI']}
bulbasaur = 1 ivysaur = 2 venusaur = 3 charmander = 4 charmeleon = 5 charizard = 6 squirtle = 7 wartortle = 8 blastoise = 9 caterpie = 10 metapod = 11 butterfree = 12 weedle = 13 kakuna = 14 beedrill = 15 pidgey = 16 pidgeotto = 17 pidgeot = 18 rattata = 19 raticate = 20 spearow = 21 fearow = 22 ekans = 23 arbok = 24 pikachu = 25 raichu = 26 sandshrew = 27 sandslash = 28 nidoran_f = 29 nidorina = 30 nidoqueen = 31 nidoran_m = 32 nidorino = 33 nidoking = 34 clefairy = 35 clefable = 36 vulpix = 37 ninetales = 38 jigglypuff = 39 wigglytuff = 40 zubat = 41 golbat = 42 oddish = 43 gloom = 44 vileplume = 45 paras = 46 parasect = 47 venonat = 48 venomoth = 49 diglett = 50 dugtrio = 51 meowth = 52 persian = 53 psyduck = 54 golduck = 55 mankey = 56 primeape = 57 growlithe = 58 arcanine = 59 poliwag = 60 poliwhirl = 61 poliwrath = 62 abra = 63 kadabra = 64 alakazam = 65 machop = 66 machoke = 67 machamp = 68 bellsprout = 69 weepinbell = 70 victreebel = 71 tentacool = 72 tentacruel = 73 geodude = 74 graveler = 75 golem = 76 ponyta = 77 rapidash = 78 slowpoke = 79 slowbro = 80 magnemite = 81 magneton = 82 farfetch_d = 83 doduo = 84 dodrio = 85 seel = 86 dewgong = 87 grimer = 88 muk = 89 shellder = 90 cloyster = 91 gastly = 92 haunter = 93 gengar = 94 onix = 95 drowzee = 96 hypno = 97 krabby = 98 kingler = 99 voltorb = 100 electrode = 101 exeggcute = 102 exeggutor = 103 cubone = 104 marowak = 105 hitmonlee = 106 hitmonchan = 107 lickitung = 108 koffing = 109 weezing = 110 rhyhorn = 111 rhydon = 112 chansey = 113 tangela = 114 kangaskhan = 115 horsea = 116 seadra = 117 goldeen = 118 seaking = 119 staryu = 120 starmie = 121 mr__mime = 122 scyther = 123 jynx = 124 electabuzz = 125 magmar = 126 pinsir = 127 tauros = 128 magikarp = 129 gyarados = 130 lapras = 131 ditto = 132 eevee = 133 vaporeon = 134 jolteon = 135 flareon = 136 porygon = 137 omanyte = 138 omastar = 139 kabuto = 140 kabutops = 141 aerodactyl = 142 snorlax = 143 articuno = 144 zapdos = 145 moltres = 146 dratini = 147 dragonair = 148 dragonite = 149 mewtwo = 150 mew = 151 chikorita = 152 bayleef = 153 meganium = 154 cyndaquil = 155 quilava = 156 typhlosion = 157 totodile = 158 croconaw = 159 feraligatr = 160 sentret = 161 furret = 162 hoothoot = 163 noctowl = 164 ledyba = 165 ledian = 166 spinarak = 167 ariados = 168 crobat = 169 chinchou = 170 lanturn = 171 pichu = 172 cleffa = 173 igglybuff = 174 togepi = 175 togetic = 176 natu = 177 xatu = 178 mareep = 179 flaaffy = 180 ampharos = 181 bellossom = 182 marill = 183 azumarill = 184 sudowoodo = 185 politoed = 186 hoppip = 187 skiploom = 188 jumpluff = 189 aipom = 190 sunkern = 191 sunflora = 192 yanma = 193 wooper = 194 quagsire = 195 espeon = 196 umbreon = 197 murkrow = 198 slowking = 199 misdreavus = 200 unown = 201 wobbuffet = 202 girafarig = 203 pineco = 204 forretress = 205 dunsparce = 206 gligar = 207 steelix = 208 snubbull = 209 granbull = 210 qwilfish = 211 scizor = 212 shuckle = 213 heracross = 214 sneasel = 215 teddiursa = 216 ursaring = 217 slugma = 218 magcargo = 219 swinub = 220 piloswine = 221 corsola = 222 remoraid = 223 octillery = 224 delibird = 225 mantine = 226 skarmory = 227 houndour = 228 houndoom = 229 kingdra = 230 phanpy = 231 donphan = 232 porygon2 = 233 stantler = 234 smeargle = 235 tyrogue = 236 hitmontop = 237 smoochum = 238 elekid = 239 magby = 240 miltank = 241 blissey = 242 raikou = 243 entei = 244 suicune = 245 larvitar = 246 pupitar = 247 tyranitar = 248 lugia = 249 ho_oh = 250 celebi = 251 mon_fc = 252 egg = 253 mon_fe = 254 mon_consts = {'BULBASAUR': 1, 'IVYSAUR': 2, 'VENUSAUR': 3, 'CHARMANDER': 4, 'CHARMELEON': 5, 'CHARIZARD': 6, 'SQUIRTLE': 7, 'WARTORTLE': 8, 'BLASTOISE': 9, 'CATERPIE': 10, 'METAPOD': 11, 'BUTTERFREE': 12, 'WEEDLE': 13, 'KAKUNA': 14, 'BEEDRILL': 15, 'PIDGEY': 16, 'PIDGEOTTO': 17, 'PIDGEOT': 18, 'RATTATA': 19, 'RATICATE': 20, 'SPEAROW': 21, 'FEAROW': 22, 'EKANS': 23, 'ARBOK': 24, 'PIKACHU': 25, 'RAICHU': 26, 'SANDSHREW': 27, 'SANDSLASH': 28, 'NIDORAN_F': 29, 'NIDORINA': 30, 'NIDOQUEEN': 31, 'NIDORAN_M': 32, 'NIDORINO': 33, 'NIDOKING': 34, 'CLEFAIRY': 35, 'CLEFABLE': 36, 'VULPIX': 37, 'NINETALES': 38, 'JIGGLYPUFF': 39, 'WIGGLYTUFF': 40, 'ZUBAT': 41, 'GOLBAT': 42, 'ODDISH': 43, 'GLOOM': 44, 'VILEPLUME': 45, 'PARAS': 46, 'PARASECT': 47, 'VENONAT': 48, 'VENOMOTH': 49, 'DIGLETT': 50, 'DUGTRIO': 51, 'MEOWTH': 52, 'PERSIAN': 53, 'PSYDUCK': 54, 'GOLDUCK': 55, 'MANKEY': 56, 'PRIMEAPE': 57, 'GROWLITHE': 58, 'ARCANINE': 59, 'POLIWAG': 60, 'POLIWHIRL': 61, 'POLIWRATH': 62, 'ABRA': 63, 'KADABRA': 64, 'ALAKAZAM': 65, 'MACHOP': 66, 'MACHOKE': 67, 'MACHAMP': 68, 'BELLSPROUT': 69, 'WEEPINBELL': 70, 'VICTREEBEL': 71, 'TENTACOOL': 72, 'TENTACRUEL': 73, 'GEODUDE': 74, 'GRAVELER': 75, 'GOLEM': 76, 'PONYTA': 77, 'RAPIDASH': 78, 'SLOWPOKE': 79, 'SLOWBRO': 80, 'MAGNEMITE': 81, 'MAGNETON': 82, 'FARFETCH_D': 83, 'DODUO': 84, 'DODRIO': 85, 'SEEL': 86, 'DEWGONG': 87, 'GRIMER': 88, 'MUK': 89, 'SHELLDER': 90, 'CLOYSTER': 91, 'GASTLY': 92, 'HAUNTER': 93, 'GENGAR': 94, 'ONIX': 95, 'DROWZEE': 96, 'HYPNO': 97, 'KRABBY': 98, 'KINGLER': 99, 'VOLTORB': 100, 'ELECTRODE': 101, 'EXEGGCUTE': 102, 'EXEGGUTOR': 103, 'CUBONE': 104, 'MAROWAK': 105, 'HITMONLEE': 106, 'HITMONCHAN': 107, 'LICKITUNG': 108, 'KOFFING': 109, 'WEEZING': 110, 'RHYHORN': 111, 'RHYDON': 112, 'CHANSEY': 113, 'TANGELA': 114, 'KANGASKHAN': 115, 'HORSEA': 116, 'SEADRA': 117, 'GOLDEEN': 118, 'SEAKING': 119, 'STARYU': 120, 'STARMIE': 121, 'MR__MIME': 122, 'SCYTHER': 123, 'JYNX': 124, 'ELECTABUZZ': 125, 'MAGMAR': 126, 'PINSIR': 127, 'TAUROS': 128, 'MAGIKARP': 129, 'GYARADOS': 130, 'LAPRAS': 131, 'DITTO': 132, 'EEVEE': 133, 'VAPOREON': 134, 'JOLTEON': 135, 'FLAREON': 136, 'PORYGON': 137, 'OMANYTE': 138, 'OMASTAR': 139, 'KABUTO': 140, 'KABUTOPS': 141, 'AERODACTYL': 142, 'SNORLAX': 143, 'ARTICUNO': 144, 'ZAPDOS': 145, 'MOLTRES': 146, 'DRATINI': 147, 'DRAGONAIR': 148, 'DRAGONITE': 149, 'MEWTWO': 150, 'MEW': 151, 'CHIKORITA': 152, 'BAYLEEF': 153, 'MEGANIUM': 154, 'CYNDAQUIL': 155, 'QUILAVA': 156, 'TYPHLOSION': 157, 'TOTODILE': 158, 'CROCONAW': 159, 'FERALIGATR': 160, 'SENTRET': 161, 'FURRET': 162, 'HOOTHOOT': 163, 'NOCTOWL': 164, 'LEDYBA': 165, 'LEDIAN': 166, 'SPINARAK': 167, 'ARIADOS': 168, 'CROBAT': 169, 'CHINCHOU': 170, 'LANTURN': 171, 'PICHU': 172, 'CLEFFA': 173, 'IGGLYBUFF': 174, 'TOGEPI': 175, 'TOGETIC': 176, 'NATU': 177, 'XATU': 178, 'MAREEP': 179, 'FLAAFFY': 180, 'AMPHAROS': 181, 'BELLOSSOM': 182, 'MARILL': 183, 'AZUMARILL': 184, 'SUDOWOODO': 185, 'POLITOED': 186, 'HOPPIP': 187, 'SKIPLOOM': 188, 'JUMPLUFF': 189, 'AIPOM': 190, 'SUNKERN': 191, 'SUNFLORA': 192, 'YANMA': 193, 'WOOPER': 194, 'QUAGSIRE': 195, 'ESPEON': 196, 'UMBREON': 197, 'MURKROW': 198, 'SLOWKING': 199, 'MISDREAVUS': 200, 'UNOWN': 201, 'WOBBUFFET': 202, 'GIRAFARIG': 203, 'PINECO': 204, 'FORRETRESS': 205, 'DUNSPARCE': 206, 'GLIGAR': 207, 'STEELIX': 208, 'SNUBBULL': 209, 'GRANBULL': 210, 'QWILFISH': 211, 'SCIZOR': 212, 'SHUCKLE': 213, 'HERACROSS': 214, 'SNEASEL': 215, 'TEDDIURSA': 216, 'URSARING': 217, 'SLUGMA': 218, 'MAGCARGO': 219, 'SWINUB': 220, 'PILOSWINE': 221, 'CORSOLA': 222, 'REMORAID': 223, 'OCTILLERY': 224, 'DELIBIRD': 225, 'MANTINE': 226, 'SKARMORY': 227, 'HOUNDOUR': 228, 'HOUNDOOM': 229, 'KINGDRA': 230, 'PHANPY': 231, 'DONPHAN': 232, 'PORYGON2': 233, 'STANTLER': 234, 'SMEARGLE': 235, 'TYROGUE': 236, 'HITMONTOP': 237, 'SMOOCHUM': 238, 'ELEKID': 239, 'MAGBY': 240, 'MILTANK': 241, 'BLISSEY': 242, 'RAIKOU': 243, 'ENTEI': 244, 'SUICUNE': 245, 'LARVITAR': 246, 'PUPITAR': 247, 'TYRANITAR': 248, 'LUGIA': 249, 'HO_OH': 250, 'CELEBI': 251, 'MON_FC': 252, 'EGG': 253, 'MON_FE': 254} mon_consts_rev = {x: y for (y, x) in MON_CONSTS.items()} evolution_lines = {'BULBASAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'IVYSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'VENUSAUR': ['BULBASAUR', 'IVYSAUR', 'VENUSAUR'], 'CHARMANDER': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARMELEON': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'CHARIZARD': ['CHARMANDER', 'CHARMELEON', 'CHARIZARD'], 'SQUIRTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'WARTORTLE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'BLASTOISE': ['SQUIRTLE', 'WARTORTLE', 'BLASTOISE'], 'CATERPIE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'METAPOD': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'BUTTERFREE': ['CATERPIE', 'METAPOD', 'BUTTERFREE'], 'WEEDLE': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'KAKUNA': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'BEEDRILL': ['WEEDLE', 'KAKUNA', 'BEEDRILL'], 'PIDGEY': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOTTO': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'PIDGEOT': ['PIDGEY', 'PIDGEOTTO', 'PIDGEOT'], 'RATTATA': ['RATTATA', 'RATICATE'], 'RATICATE': ['RATTATA', 'RATICATE'], 'SPEAROW': ['SPEAROW', 'FEAROW'], 'FEAROW': ['SPEAROW', 'FEAROW'], 'EKANS': ['EKANS', 'ARBOK'], 'ARBOK': ['EKANS', 'ARBOK'], 'PIKACHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'RAICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'SANDSHREW': ['SANDSHREW', 'SANDSLASH'], 'SANDSLASH': ['SANDSHREW', 'SANDSLASH'], 'NIDORAN_F': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORINA': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDOQUEEN': ['NIDORAN_F', 'NIDORINA', 'NIDOQUEEN'], 'NIDORAN_M': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDORINO': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'NIDOKING': ['NIDORAN_M', 'NIDORINO', 'NIDOKING'], 'CLEFAIRY': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'CLEFABLE': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'VULPIX': ['VULPIX', 'NINETALES'], 'NINETALES': ['VULPIX', 'NINETALES'], 'JIGGLYPUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'WIGGLYTUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'ZUBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'GOLBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'CROBAT': ['ZUBAT', 'GOLBAT', 'CROBAT'], 'ODDISH': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'GLOOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'VILEPLUME': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'BELLOSSOM': ['ODDISH', 'GLOOM', 'VILEPLUME', 'BELLOSSOM'], 'PARAS': ['PARAS', 'PARASECT'], 'PARASECT': ['PARAS', 'PARASECT'], 'VENONAT': ['VENONAT', 'VENOMOTH'], 'VENOMOTH': ['VENONAT', 'VENOMOTH'], 'DIGLETT': ['DIGLETT', 'DUGTRIO'], 'DUGTRIO': ['DIGLETT', 'DUGTRIO'], 'MEOWTH': ['MEOWTH', 'PERSIAN'], 'PERSIAN': ['MEOWTH', 'PERSIAN'], 'PSYDUCK': ['PSYDUCK', 'GOLDUCK'], 'GOLDUCK': ['PSYDUCK', 'GOLDUCK'], 'MANKEY': ['MANKEY', 'PRIMEAPE'], 'PRIMEAPE': ['MANKEY', 'PRIMEAPE'], 'GROWLITHE': ['GROWLITHE', 'ARCANINE'], 'ARCANINE': ['GROWLITHE', 'ARCANINE'], 'POLIWAG': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWHIRL': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLIWRATH': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'POLITOED': ['POLIWAG', 'POLIWHIRL', 'POLIWRATH', 'POLITOED'], 'ABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'KADABRA': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'ALAKAZAM': ['ABRA', 'KADABRA', 'ALAKAZAM'], 'MACHOP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHOKE': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'MACHAMP': ['MACHOP', 'MACHOKE', 'MACHAMP'], 'BELLSPROUT': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'WEEPINBELL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'VICTREEBEL': ['BELLSPROUT', 'WEEPINBELL', 'VICTREEBEL'], 'TENTACOOL': ['TENTACOOL', 'TENTACRUEL'], 'TENTACRUEL': ['TENTACOOL', 'TENTACRUEL'], 'GEODUDE': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GRAVELER': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'GOLEM': ['GEODUDE', 'GRAVELER', 'GOLEM'], 'PONYTA': ['PONYTA', 'RAPIDASH'], 'RAPIDASH': ['PONYTA', 'RAPIDASH'], 'SLOWPOKE': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWBRO': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'SLOWKING': ['SLOWPOKE', 'SLOWBRO', 'SLOWKING'], 'MAGNEMITE': ['MAGNEMITE', 'MAGNETON'], 'MAGNETON': ['MAGNEMITE', 'MAGNETON'], 'FARFETCH_D': ['FARFETCH_D'], 'DODUO': ['DODUO', 'DODRIO'], 'DODRIO': ['DODUO', 'DODRIO'], 'SEEL': ['SEEL', 'DEWGONG'], 'DEWGONG': ['SEEL', 'DEWGONG'], 'GRIMER': ['GRIMER', 'MUK'], 'MUK': ['GRIMER', 'MUK'], 'SHELLDER': ['SHELLDER', 'CLOYSTER'], 'CLOYSTER': ['SHELLDER', 'CLOYSTER'], 'GASTLY': ['GASTLY', 'HAUNTER', 'GENGAR'], 'HAUNTER': ['GASTLY', 'HAUNTER', 'GENGAR'], 'GENGAR': ['GASTLY', 'HAUNTER', 'GENGAR'], 'ONIX': ['ONIX', 'STEELIX'], 'STEELIX': ['ONIX', 'STEELIX'], 'DROWZEE': ['DROWZEE', 'HYPNO'], 'HYPNO': ['DROWZEE', 'HYPNO'], 'KRABBY': ['KRABBY', 'KINGLER'], 'KINGLER': ['KRABBY', 'KINGLER'], 'VOLTORB': ['VOLTORB', 'ELECTRODE'], 'ELECTRODE': ['VOLTORB', 'ELECTRODE'], 'EXEGGCUTE': ['EXEGGCUTE', 'EXEGGUTOR'], 'EXEGGUTOR': ['EXEGGCUTE', 'EXEGGUTOR'], 'CUBONE': ['CUBONE', 'MAROWAK'], 'MAROWAK': ['CUBONE', 'MAROWAK'], 'HITMONLEE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONCHAN': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'LICKITUNG': ['LICKITUNG'], 'KOFFING': ['KOFFING', 'WEEZING'], 'WEEZING': ['KOFFING', 'WEEZING'], 'RHYHORN': ['RHYHORN', 'RHYDON'], 'RHYDON': ['RHYHORN', 'RHYDON'], 'CHANSEY': ['CHANSEY', 'BLISSEY'], 'BLISSEY': ['CHANSEY', 'BLISSEY'], 'TANGELA': ['TANGELA'], 'KANGASKHAN': ['KANGASKHAN'], 'HORSEA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'SEADRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'KINGDRA': ['HORSEA', 'SEADRA', 'KINGDRA'], 'GOLDEEN': ['GOLDEEN', 'SEAKING'], 'SEAKING': ['GOLDEEN', 'SEAKING'], 'STARYU': ['STARYU', 'STARMIE'], 'STARMIE': ['STARYU', 'STARMIE'], 'MR__MIME': ['MR__MIME'], 'SCYTHER': ['SCYTHER', 'SCIZOR'], 'SCIZOR': ['SCYTHER', 'SCIZOR'], 'JYNX': ['SMOOCHUM', 'JYNX'], 'ELECTABUZZ': ['ELEKID', 'ELECTABUZZ'], 'MAGMAR': ['MAGBY', 'MAGMAR'], 'PINSIR': ['PINSIR'], 'TAUROS': ['TAUROS'], 'MAGIKARP': ['MAGIKARP', 'GYARADOS'], 'GYARADOS': ['MAGIKARP', 'GYARADOS'], 'LAPRAS': ['LAPRAS'], 'DITTO': ['DITTO'], 'EEVEE': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'JOLTEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'VAPOREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'FLAREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'ESPEON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'UMBREON': ['EEVEE', 'JOLTEON', 'VAPOREON', 'FLAREON', 'ESPEON', 'UMBREON'], 'PORYGON': ['PORYGON', 'PORYGON2'], 'PORYGON2': ['PORYGON', 'PORYGON2'], 'OMANYTE': ['OMANYTE', 'OMASTAR'], 'OMASTAR': ['OMANYTE', 'OMASTAR'], 'KABUTO': ['KABUTO', 'KABUTOPS'], 'KABUTOPS': ['KABUTO', 'KABUTOPS'], 'AERODACTYL': ['AERODACTYL'], 'SNORLAX': ['SNORLAX'], 'ARTICUNO': ['ARTICUNO'], 'ZAPDOS': ['ZAPDOS'], 'MOLTRES': ['MOLTRES'], 'DRATINI': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONAIR': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'DRAGONITE': ['DRATINI', 'DRAGONAIR', 'DRAGONITE'], 'MEWTWO': ['MEWTWO'], 'MEW': ['MEW'], 'CHIKORITA': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'BAYLEEF': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'MEGANIUM': ['CHIKORITA', 'BAYLEEF', 'MEGANIUM'], 'CYNDAQUIL': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'QUILAVA': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TYPHLOSION': ['CYNDAQUIL', 'QUILAVA', 'TYPHLOSION'], 'TOTODILE': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'CROCONAW': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'FERALIGATR': ['TOTODILE', 'CROCONAW', 'FERALIGATR'], 'SENTRET': ['SENTRET', 'FURRET'], 'FURRET': ['SENTRET', 'FURRET'], 'HOOTHOOT': ['HOOTHOOT', 'NOCTOWL'], 'NOCTOWL': ['HOOTHOOT', 'NOCTOWL'], 'LEDYBA': ['LEDYBA', 'LEDIAN'], 'LEDIAN': ['LEDYBA', 'LEDIAN'], 'SPINARAK': ['SPINARAK', 'ARIADOS'], 'ARIADOS': ['SPINARAK', 'ARIADOS'], 'CHINCHOU': ['CHINCHOU', 'LANTURN'], 'LANTURN': ['CHINCHOU', 'LANTURN'], 'PICHU': ['PICHU', 'PIKACHU', 'RAICHU'], 'CLEFFA': ['CLEFFA', 'CLEFAIRY', 'CLEFABLE'], 'IGGLYBUFF': ['IGGLYBUFF', 'JIGGLYPUFF', 'WIGGLYTUFF'], 'TOGEPI': ['TOGEPI', 'TOGETIC'], 'TOGETIC': ['TOGEPI', 'TOGETIC'], 'NATU': ['NATU', 'XATU'], 'XATU': ['NATU', 'XATU'], 'MAREEP': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'FLAAFFY': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'AMPHAROS': ['MAREEP', 'FLAAFFY', 'AMPHAROS'], 'MARILL': ['MARILL', 'AZUMARILL'], 'AZUMARILL': ['MARILL', 'AZUMARILL'], 'SUDOWOODO': ['SUDOWOODO'], 'HOPPIP': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'SKIPLOOM': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'JUMPLUFF': ['HOPPIP', 'SKIPLOOM', 'JUMPLUFF'], 'AIPOM': ['AIPOM'], 'SUNKERN': ['SUNKERN', 'SUNFLORA'], 'SUNFLORA': ['SUNKERN', 'SUNFLORA'], 'YANMA': ['YANMA'], 'WOOPER': ['WOOPER', 'QUAGSIRE'], 'QUAGSIRE': ['WOOPER', 'QUAGSIRE'], 'MURKROW': ['MURKROW'], 'MISDREAVUS': ['MISDREAVUS'], 'UNOWN': ['UNOWN'], 'WOBBUFFET': ['WOBBUFFET'], 'GIRAFARIG': ['GIRAFARIG'], 'PINECO': ['PINECO', 'FORRETRESS'], 'FORRETRESS': ['PINECO', 'FORRETRESS'], 'DUNSPARCE': ['DUNSPARCE'], 'GLIGAR': ['GLIGAR'], 'SNUBBULL': ['SNUBBULL', 'GRANBULL'], 'GRANBULL': ['SNUBBULL', 'GRANBULL'], 'QWILFISH': ['QWILFISH'], 'SHUCKLE': ['SHUCKLE'], 'HERACROSS': ['HERACROSS'], 'SNEASEL': ['SNEASEL'], 'TEDDIURSA': ['TEDDIURSA', 'URSARING'], 'URSARING': ['TEDDIURSA', 'URSARING'], 'SLUGMA': ['SLUGMA', 'MAGCARGO'], 'MAGCARGO': ['SLUGMA', 'MAGCARGO'], 'SWINUB': ['SWINUB', 'PILOSWINE'], 'PILOSWINE': ['SWINUB', 'PILOSWINE'], 'CORSOLA': ['CORSOLA'], 'REMORAID': ['REMORAID', 'OCTILLERY'], 'OCTILLERY': ['REMORAID', 'OCTILLERY'], 'DELIBIRD': ['DELIBIRD'], 'MANTINE': ['MANTINE'], 'SKARMORY': ['SKARMORY'], 'HOUNDOUR': ['HOUNDOUR', 'HOUNDOOM'], 'HOUNDOOM': ['HOUNDOUR', 'HOUNDOOM'], 'PHANPY': ['PHANPY', 'DONPHAN'], 'DONPHAN': ['PHANPY', 'DONPHAN'], 'STANTLER': ['STANTLER'], 'SMEARGLE': ['SMEARGLE'], 'TYROGUE': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'HITMONTOP': ['TYROGUE', 'HITMONCHAN', 'HITMONLEE', 'HITMONTOP'], 'SMOOCHUM': ['SMOOCHUM', 'JYNX'], 'ELEKID': ['ELEKID', 'ELECTABUZZ'], 'MAGBY': ['MAGBY', 'MAGMAR'], 'MILTANK': ['MILTANK'], 'RAIKOU': ['RAIKOU'], 'ENTEI': ['ENTEI'], 'SUICUNE': ['SUICUNE'], 'LARVITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'PUPITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'TYRANITAR': ['LARVITAR', 'PUPITAR', 'TYRANITAR'], 'LUGIA': ['LUGIA'], 'HO_OH': ['HO_OH'], 'CELEBI': ['CELEBI']}
class Solution: """ @param num: an integer @return: the complement number """ def findComplement(self, num): ans = 0 digit = 1 while num > 0: ans += abs(num % 2 - 1) * digit num //= 2 digit *= 2 return ans
class Solution: """ @param num: an integer @return: the complement number """ def find_complement(self, num): ans = 0 digit = 1 while num > 0: ans += abs(num % 2 - 1) * digit num //= 2 digit *= 2 return ans
# -*- coding: utf-8 -*- class Exchange(object): """docstring for Exchange""" def __init__(self): self.trades = False def getTrades(self): return self.trades # @abstractmethod def calcTotal(self, controller): pass
class Exchange(object): """docstring for Exchange""" def __init__(self): self.trades = False def get_trades(self): return self.trades def calc_total(self, controller): pass
# -*- coding: utf-8 -*- # author: Minch Wu """RECUR.PY. define some functions in recursive process """ def hanoi(n: int, L=None): """hanoi. storage the move process """ if L is None: L = [] def move(n, a='A', b='B', c='C'): """move. move the pagoda """ if n == 1: # print(a + '->' + c) L.append(a + '->' + c) # return (L) else: move(n - 1, a, c, b) # print(a + '->' + c) move(1, a, b, c) move(n - 1, b, a, c) move(n) return (L)
"""RECUR.PY. define some functions in recursive process """ def hanoi(n: int, L=None): """hanoi. storage the move process """ if L is None: l = [] def move(n, a='A', b='B', c='C'): """move. move the pagoda """ if n == 1: L.append(a + '->' + c) else: move(n - 1, a, c, b) move(1, a, b, c) move(n - 1, b, a, c) move(n) return L
input() A = {int(param) for param in input().split()} B = {int(param) for param in input().split()} print(len(A-B)) for i in sorted(A-B): print(i, end = ' ')
input() a = {int(param) for param in input().split()} b = {int(param) for param in input().split()} print(len(A - B)) for i in sorted(A - B): print(i, end=' ')
languages = ['Chamorro', 'Tagalog', 'English', 'russian'] print(languages) languages.append('Spanish') print(languages) languages.insert(0, 'Finish') print(languages) del languages[0] print(languages) popped_language = languages.pop(0) print(languages) print(popped_language) popped_language = languages.pop(0) print(languages) print(popped_language) languages.remove('English') print(languages) fluent_language = 'russian' languages.remove(fluent_language) print(languages) print(fluent_language.title() + " is my fluent language.")
languages = ['Chamorro', 'Tagalog', 'English', 'russian'] print(languages) languages.append('Spanish') print(languages) languages.insert(0, 'Finish') print(languages) del languages[0] print(languages) popped_language = languages.pop(0) print(languages) print(popped_language) popped_language = languages.pop(0) print(languages) print(popped_language) languages.remove('English') print(languages) fluent_language = 'russian' languages.remove(fluent_language) print(languages) print(fluent_language.title() + ' is my fluent language.')
''' Created on Oct 5, 2011 @author: IslamM '''
""" Created on Oct 5, 2011 @author: IslamM """
""" Given a string and a set of characters, return the shortest substring containing all the characters in the set. For example, given the string "figehaeci" and the set of characters {a, e, i}, you should return "aeci". If there is no substring containing all the characters in the set, return null. """ no_of_chars = 256 # Function to find smallest window containing all character of pattern def findString(string, pat): str_len = len(string) pat_len = len(pat) # check if string's length is less than pattern's length. If yes then no such window can exist if str_len < pat_len: print("No such window exists") return "" hash_pat = [0] * no_of_chars hash_str = [0] * no_of_chars # store occurence of characters of pattern for i in range(0, pat_len): hash_pat[ord(pat[i])] += 1 print(hash_pat) start, start_index, min_len = 0, -1, float("inf") # start traversing the string count = 0 # count of character for j in range(0, str_len): # count occurence of characters of string hash_str[ord(string[j])] += 1 # If string's char matches with pattern's char then increment count if (hash_pat[ord(string[j])] != 0 and hash_str[ord(string[j])] <= hash_pat[ord(string[j])]): count += 1 # if all the character are matched if count == pat_len: # Try to minimize the window i.e., check if any character is occurring more no. of times than its occurrence in pattern then remove it from starting and also remove the useless characters. while (hash_str[ord(string[start])] > hash_pat[ord(string[start])] or hash_pat[ord(string[start])] == 0): if (hash_str[ord(string[start])] > hash_pat[ord(string[start])]): hash_str[ord(string[start])] -= 1 start += 1 print("start ", start) # update window size len_window = j - (start + 1) print("len_window ", len_window) if min_len > len_window: min_len = len_window start_index = start print('start_index ', start_index) # If no window found if start_index == -1: print("No such window exists") return "" # Return substring starting from start_index and length min_len return string[start_index: start_index + len_window] if __name__ == "__main__": string = "this is a test string" pat = "tist" print("Smallest window is : ") print(findString(string, pat))
""" Given a string and a set of characters, return the shortest substring containing all the characters in the set. For example, given the string "figehaeci" and the set of characters {a, e, i}, you should return "aeci". If there is no substring containing all the characters in the set, return null. """ no_of_chars = 256 def find_string(string, pat): str_len = len(string) pat_len = len(pat) if str_len < pat_len: print('No such window exists') return '' hash_pat = [0] * no_of_chars hash_str = [0] * no_of_chars for i in range(0, pat_len): hash_pat[ord(pat[i])] += 1 print(hash_pat) (start, start_index, min_len) = (0, -1, float('inf')) count = 0 for j in range(0, str_len): hash_str[ord(string[j])] += 1 if hash_pat[ord(string[j])] != 0 and hash_str[ord(string[j])] <= hash_pat[ord(string[j])]: count += 1 if count == pat_len: while hash_str[ord(string[start])] > hash_pat[ord(string[start])] or hash_pat[ord(string[start])] == 0: if hash_str[ord(string[start])] > hash_pat[ord(string[start])]: hash_str[ord(string[start])] -= 1 start += 1 print('start ', start) len_window = j - (start + 1) print('len_window ', len_window) if min_len > len_window: min_len = len_window start_index = start print('start_index ', start_index) if start_index == -1: print('No such window exists') return '' return string[start_index:start_index + len_window] if __name__ == '__main__': string = 'this is a test string' pat = 'tist' print('Smallest window is : ') print(find_string(string, pat))
SOURCES = { "activity.task.error.generic": "CommCareAndroid", "app.handled.error.explanation": "CommCareAndroid", "app.handled.error.title": "CommCareAndroid", "app.key.request.deny": "CommCareAndroid", "app.key.request.grant": "CommCareAndroid", "app.key.request.message": "CommCareAndroid", "app.menu.display.cond.bad.xpath": "CommCareAndroid", "app.menu.display.cond.xpath.err": "CommCareAndroid", "app.storage.missing.button": "CommCareAndroid", "app.storage.missing.message": "CommCareAndroid", "app.storage.missing.title": "CommCareAndroid", "app.workflow.forms.delete": "CommCareAndroid", "app.workflow.forms.fetch": "CommCareAndroid", "app.workflow.forms.open": "CommCareAndroid", "app.workflow.forms.quarantine.report": "CommCareAndroid", "app.workflow.forms.restore": "CommCareAndroid", "app.workflow.forms.scan": "CommCareAndroid", "app.workflow.forms.scan.title.invalid": "CommCareAndroid", "app.workflow.forms.scan.title.valid": "CommCareAndroid", "app.workflow.incomplete.continue": "CommCareAndroid", "app.workflow.incomplete.continue.option.delete": "CommCareAndroid", "app.workflow.incomplete.continue.title": "CommCareAndroid", "app.workflow.incomplete.heading": "CommCareAndroid", "app.workflow.login.lost": "CommCareAndroid", "app.workflow.saved.heading": "CommCareAndroid", "archive.install.bad": "CommCareAndroid", "archive.install.button": "CommCareAndroid", "archive.install.cancelled": "CommCareAndroid", "archive.install.progress": "CommCareAndroid", "archive.install.prompt": "CommCareAndroid", "archive.install.state.done": "CommCareAndroid", "archive.install.state.empty": "CommCareAndroid", "archive.install.state.invalid.path": "CommCareAndroid", "archive.install.state.ready": "CommCareAndroid", "archive.install.title": "CommCareAndroid", "archive.install.unzip": "CommCareAndroid", "bulk.dump.dialog.progress": "CommCareAndroid", "bulk.dump.dialog.title": "CommCareAndroid", "bulk.form.alert.title": "CommCareAndroid", "bulk.form.cancel": "CommCareAndroid", "bulk.form.dump": "CommCareAndroid", "bulk.form.dump.2": "CommCareAndroid", "bulk.form.dump.success": "CommCareAndroid", "bulk.form.end": "CommCareAndroid", "bulk.form.error": "CommCareAndroid", "bulk.form.foldername": "CommCareAndroid", "bulk.form.messages": "CommCareAndroid", "bulk.form.no.unsynced": "CommCareAndroid", "bulk.form.no.unsynced.dump": "CommCareAndroid", "bulk.form.no.unsynced.submit": "CommCareAndroid", "bulk.form.progress": "CommCareAndroid", "bulk.form.prompt": "CommCareAndroid", "bulk.form.sd.emulated": "CommCareAndroid", "bulk.form.sd.unavailable": "CommCareAndroid", "bulk.form.sd.unwritable": "CommCareAndroid", "bulk.form.send.start": "CommCareAndroid", "bulk.form.send.success": "CommCareAndroid", "bulk.form.start": "CommCareAndroid", "bulk.form.submit": "CommCareAndroid", "bulk.form.submit.2": "CommCareAndroid", "bulk.form.warning": "CommCareAndroid", "bulk.send.dialog.progress": "CommCareAndroid", "bulk.send.dialog.title": "CommCareAndroid", "bulk.send.file.error": "CommCareAndroid", "bulk.send.malformed.file": "CommCareAndroid", "bulk.send.transport.error": "CommCareAndroid", "cchq.case": "CommCareAndroid", "connection.task.commcare.html.fail": "CommCareAndroid", "connection.task.internet.fail": "CommCareAndroid", "connection.task.internet.success": "CommCareAndroid", "connection.task.remote.ping.fail": "CommCareAndroid", "connection.task.report.commcare.popup": "CommCareAndroid", "connection.task.success": "CommCareAndroid", "connection.task.unset.posturl": "CommCareAndroid", "connection.test.access.settings": "CommCareAndroid", "connection.test.error.message": "CommCareAndroid", "connection.test.messages": "CommCareAndroid", "connection.test.now.running": "CommCareAndroid", "connection.test.prompt": "CommCareAndroid", "connection.test.report.button.message": "CommCareAndroid", "connection.test.run": "CommCareAndroid", "connection.test.run.title": "CommCareAndroid", "connection.test.update.message": "CommCareAndroid", "demo.mode.warning": "CommCareAndroid", "demo.mode.warning.dismiss": "CommCareAndroid", "demo.mode.warning.title": "CommCareAndroid", "dialog.ok": "CommCareAndroid", "form.entry.processing": "CommCareAndroid", "form.entry.processing.title": "CommCareAndroid", "form.entry.segfault": "CommCareAndroid", "form.record.filter.incomplete": "CommCareAndroid", "form.record.filter.limbo": "CommCareAndroid", "form.record.filter.pending": "CommCareAndroid", "form.record.filter.subandpending": "CommCareAndroid", "form.record.filter.submitted": "CommCareAndroid", "form.record.gone": "CommCareAndroid", "form.record.gone.message": "CommCareAndroid", "form.record.unsent": "CommCareAndroid", "home.forms": "CommCareAndroid", "home.forms.incomplete": "CommCareAndroid", "home.forms.incomplete.indicator": "CommCareAndroid", "home.forms.saved": "CommCareAndroid", "home.logged.in.message": "CommCareAndroid", "home.logged.out": "CommCareAndroid", "home.logout": "CommCareAndroid", "home.logout.demo": "CommCareAndroid", "home.menu.call.log": "CommCareAndroid", "home.menu.change.locale": "CommCareAndroid", "home.menu.connection.diagnostic": "CommCareAndroid", "home.menu.formdump": "CommCareAndroid", "home.menu.settings": "CommCareAndroid", "home.menu.update": "CommCareAndroid", "home.menu.validate": "CommCareAndroid", "home.menu.wifi.direct": "CommCareAndroid", "home.start": "CommCareAndroid", "home.start.demo": "CommCareAndroid", "home.sync": "CommCareAndroid", "home.sync.demo": "CommCareAndroid", "home.sync.indicator": "CommCareAndroid", "home.sync.message.last": "CommCareAndroid", "home.sync.message.last.demo": "CommCareAndroid", "home.sync.message.last.never": "CommCareAndroid", "home.sync.message.unsent.plural": "CommCareAndroid", "home.sync.message.unsent.singular": "CommCareAndroid", "install.bad.ref": "CommCareAndroid", "install.barcode": "CommCareAndroid", "install.button.enter": "CommCareAndroid", "install.button.retry": "CommCareAndroid", "install.button.start": "CommCareAndroid", "install.button.startover": "CommCareAndroid", "install.major.mismatch": "CommCareAndroid", "install.manual": "CommCareAndroid", "install.minor.mismatch": "CommCareAndroid", "install.problem.unexpected": "CommCareAndroid", "install.ready": "CommCareAndroid", "install.version.mismatch": "CommCareAndroid", "key.manage.callout": "CommCareAndroid", "key.manage.legacy.begin": "CommCareAndroid", "key.manage.migrate": "CommCareAndroid", "key.manage.purge": "CommCareAndroid", "key.manage.start": "CommCareAndroid", "key.manage.title": "CommCareAndroid", "login.attempt.badcred": "CommCareAndroid", "login.attempt.fail.auth.detail": "CommCareAndroid", "login.attempt.fail.auth.title": "CommCareAndroid", "login.attempt.fail.changed.action": "CommCareAndroid", "login.attempt.fail.changed.detail": "CommCareAndroid", "login.attempt.fail.changed.title": "CommCareAndroid", "login.button": "CommCareAndroid", "login.menu.demo": "CommCareAndroid", "login.password": "CommCareAndroid", "login.sync": "CommCareAndroid", "login.username": "CommCareAndroid", "main.sync.demo": "CommCareAndroid", "main.sync.demo.has.forms": "CommCareAndroid", "main.sync.demo.no.forms": "CommCareAndroid", "menu.advanced": "CommCareAndroid", "menu.archive": "CommCareAndroid", "menu.basic": "CommCareAndroid", "modules.m0": "CommCareAndroid", "mult.install.bad": "CommCareAndroid", "mult.install.button": "CommCareAndroid", "mult.install.cancelled": "CommCareAndroid", "mult.install.error": "CommCareAndroid", "mult.install.no.browser": "CommCareAndroid", "mult.install.progress": "CommCareAndroid", "mult.install.progress.baddest": "CommCareAndroid", "mult.install.progress.badentry": "CommCareAndroid", "mult.install.progress.errormoving": "CommCareAndroid", "mult.install.prompt": "CommCareAndroid", "mult.install.state.done": "CommCareAndroid", "mult.install.state.empty": "CommCareAndroid", "mult.install.state.invalid.path": "CommCareAndroid", "mult.install.state.ready": "CommCareAndroid", "mult.install.title": "CommCareAndroid", "notification.bad.certificate.action": "CommCareAndroid", "notification.bad.certificate.detail": "CommCareAndroid", "notification.bad.certificate.title": "CommCareAndroid", "notification.case.filter.action": "CommCareAndroid", "notification.case.filter.detail": "CommCareAndroid", "notification.case.filter.title": "CommCareAndroid", "notification.case.predicate.action": "CommCareAndroid", "notification.case.predicate.title": "CommCareAndroid", "notification.credential.mismatch.action": "CommCareAndroid", "notification.credential.mismatch.detail": "CommCareAndroid", "notification.credential.mismatch.title": "CommCareAndroid", "notification.for.details.wrapper": "CommCareAndroid", "notification.formentry.unretrievable.action": "CommCareAndroid", "notification.formentry.unretrievable.detail": "CommCareAndroid", "notification.formentry.unretrievable.title": "CommCareAndroid", "notification.install.badarchive.action": "CommCareAndroid", "notification.install.badarchive.detail": "CommCareAndroid", "notification.install.badarchive.title": "CommCareAndroid", "notification.install.badcert.action": "CommCareAndroid", "notification.install.badcert.detail": "CommCareAndroid", "notification.install.badcert.title": "CommCareAndroid", "notification.install.badreqs.action": "CommCareAndroid", "notification.install.badreqs.detail": "CommCareAndroid", "notification.install.badreqs.title": "CommCareAndroid", "notification.install.badstate.action": "CommCareAndroid", "notification.install.badstate.detail": "CommCareAndroid", "notification.install.badstate.title": "CommCareAndroid", "notification.install.installed.detail": "CommCareAndroid", "notification.install.installed.title": "CommCareAndroid", "notification.install.missing.action": "CommCareAndroid", "notification.install.missing.detail": "CommCareAndroid", "notification.install.missing.title": "CommCareAndroid", "notification.install.missing.withmessage.action": "CommCareAndroid", "notification.install.missing.withmessage.detail": "CommCareAndroid", "notification.install.missing.withmessage.title": "CommCareAndroid", "notification.install.nolocal.action": "CommCareAndroid", "notification.install.nolocal.detail": "CommCareAndroid", "notification.install.nolocal.title": "CommCareAndroid", "notification.install.unknown.detail": "CommCareAndroid", "notification.install.unknown.title": "CommCareAndroid", "notification.install.uptodate.detail": "CommCareAndroid", "notification.install.uptodate.title": "CommCareAndroid", "notification.logger.error.detail": "CommCareAndroid", "notification.logger.error.title": "CommCareAndroid", "notification.logger.serialized.detail": "CommCareAndroid", "notification.logger.serialized.title": "CommCareAndroid", "notification.logger.submitted.detail": "CommCareAndroid", "notification.logger.submitted.title": "CommCareAndroid", "notification.network.timeout.action": "CommCareAndroid", "notification.network.timeout.detail": "CommCareAndroid", "notification.network.timeout.title": "CommCareAndroid", "notification.processing.badstructure.action": "CommCareAndroid", "notification.processing.badstructure.detail": "CommCareAndroid", "notification.processing.badstructure.title": "CommCareAndroid", "notification.processing.nosdcard.action": "CommCareAndroid", "notification.processing.nosdcard.detail": "CommCareAndroid", "notification.processing.nosdcard.title": "CommCareAndroid", "notification.restore.baddata.detail": "CommCareAndroid", "notification.restore.baddata.title": "CommCareAndroid", "notification.restore.nonetwork.detail": "CommCareAndroid", "notification.restore.nonetwork.title": "CommCareAndroid", "notification.restore.remote.error.action": "CommCareAndroid", "notification.restore.remote.error.detail": "CommCareAndroid", "notification.restore.remote.error.title": "CommCareAndroid", "notification.restore.unknown.action": "CommCareAndroid", "notification.restore.unknown.detail": "CommCareAndroid", "notification.restore.unknown.title": "CommCareAndroid", "notification.send.malformed.detail": "CommCareAndroid", "notification.send.malformed.title": "CommCareAndroid", "notification.sending.loggedout.detail": "CommCareAndroid", "notification.sending.loggedout.title": "CommCareAndroid", "notification.sending.quarantine.action": "CommCareAndroid", "notification.sending.quarantine.detail": "CommCareAndroid", "notification.sending.quarantine.title": "CommCareAndroid", "notification.sync.airplane.action": "CommCareAndroid", "notification.sync.airplane.detail": "CommCareAndroid", "notification.sync.airplane.title": "CommCareAndroid", "notifications.prompt.details": "CommCareAndroid", "notifications.prompt.more": "CommCareAndroid", "odk_accept_location": "ODK", "odk_access_error": "ODK", "odk_accuracy": "ODK", "odk_activity_not_found": "ODK", "odk_add_another": "ODK", "odk_add_another_repeat": "ODK", "odk_add_repeat": "ODK", "odk_add_repeat_no": "ODK", "odk_advance": "ODK", "odk_altitude": "ODK", "odk_app_name": "ODK", "odk_app_url": "ODK", "odk_attachment_oversized": "ODK", "odk_audio_file_error": "ODK", "odk_audio_file_invalid": "ODK", "odk_backup": "ODK", "odk_barcode_scanner_error": "ODK", "odk_cancel": "ODK", "odk_cancel_loading_form": "ODK", "odk_cancel_location": "ODK", "odk_cancel_saving_form": "ODK", "odk_cannot_edit_completed_form": "ODK", "odk_capture_audio": "ODK", "odk_capture_image": "ODK", "odk_capture_video": "ODK", "odk_change_font_size": "ODK", "odk_change_formlist_url": "ODK", "odk_change_language": "ODK", "odk_change_password": "ODK", "odk_change_protocol": "ODK", "odk_change_server_url": "ODK", "odk_change_settings": "ODK", "odk_change_splash_path": "ODK", "odk_change_submission_url": "ODK", "odk_change_username": "ODK", "odk_choose_image": "ODK", "odk_choose_sound": "ODK", "odk_choose_video": "ODK", "odk_clear_answer": "ODK", "odk_clear_answer_ask": "ODK", "odk_clear_answer_no": "ODK", "odk_clearanswer_confirm": "ODK", "odk_click_to_web": "ODK", "odk_client": "ODK", "odk_completed_data": "ODK", "odk_data": "ODK", "odk_data_saved_error": "ODK", "odk_data_saved_ok": "ODK", "odk_default_completed": "ODK", "odk_default_completed_summary": "ODK", "odk_default_odk_formlist": "ODK", "odk_default_odk_submission": "ODK", "odk_default_server_url": "ODK", "odk_default_splash_path": "ODK", "odk_delete_confirm": "ODK", "odk_delete_file": "ODK", "odk_delete_no": "ODK", "odk_delete_repeat": "ODK", "odk_delete_repeat_ask": "ODK", "odk_delete_repeat_confirm": "ODK", "odk_delete_repeat_no": "ODK", "odk_delete_yes": "ODK", "odk_discard_answer": "ODK", "odk_discard_group": "ODK", "odk_do_not_change": "ODK", "odk_do_not_exit": "ODK", "odk_do_not_save": "ODK", "odk_download": "ODK", "odk_download_all_successful": "ODK", "odk_download_complete": "ODK", "odk_download_failed_with_error": "ODK", "odk_download_forms_result": "ODK", "odk_downloading_data": "ODK", "odk_edit_prompt": "ODK", "odk_enter": "ODK", "odk_enter_data": "ODK", "odk_enter_data_button": "ODK", "odk_enter_data_description": "ODK", "odk_enter_data_message": "ODK", "odk_entering_repeat": "ODK", "odk_entering_repeat_ask": "ODK", "odk_error_downloading": "ODK", "odk_error_occured": "ODK", "odk_exit": "ODK", "odk_fetching_file": "ODK", "odk_fetching_manifest": "ODK", "odk_file_deleted_error": "ODK", "odk_file_deleted_ok": "ODK", "odk_file_fetch_failed": "ODK", "odk_file_invalid": "ODK", "odk_file_missing": "ODK", "odk_finding_location": "ODK", "odk_finished_disk_scan": "ODK", "odk_first_run": "ODK", "odk_font_size": "ODK", "odk_form": "ODK", "odk_form_download_progress": "ODK", "odk_form_entry_start_hide": "ODK", "odk_form_name": "ODK", "odk_form_renamed": "ODK", "odk_form_scan_finished": "ODK", "odk_form_scan_starting": "ODK", "odk_formlist_url": "ODK", "odk_forms": "ODK", "odk_found_location": "ODK", "odk_general_preferences": "ODK", "odk_get_barcode": "ODK", "odk_get_forms": "ODK", "odk_get_location": "ODK", "odk_getting_location": "ODK", "odk_go_to_location": "ODK", "odk_google_account": "ODK", "odk_google_submission_id_text": "ODK", "odk_intent_callout_button": "ODK", "odk_intent_callout_button_update": "ODK", "odk_invalid_answer_error": "ODK", "odk_jump_to_beginning": "ODK", "odk_jump_to_end": "ODK", "odk_jump_to_previous": "ODK", "odk_keep_changes": "ODK", "odk_latitude": "ODK", "odk_leave_repeat_yes": "ODK", "odk_leaving_repeat": "ODK", "odk_leaving_repeat_ask": "ODK", "odk_list_failed_with_error": "ODK", "odk_load_remote_form_error": "ODK", "odk_loading_form": "ODK", "odk_location_accuracy": "ODK", "odk_location_provider": "ODK", "odk_location_provider_accuracy": "ODK", "odk_longitude": "ODK", "odk_main_menu": "ODK", "odk_main_menu_details": "ODK", "odk_main_menu_message": "ODK", "odk_manage_files": "ODK", "odk_manifest_server_error": "ODK", "odk_manifest_tag_error": "ODK", "odk_mark_finished": "ODK", "odk_no": "ODK", "odk_no_capture": "ODK", "odk_no_connection": "ODK", "odk_no_forms_uploaded": "ODK", "odk_no_gps_message": "ODK", "odk_no_gps_title": "ODK", "odk_no_items_display": "ODK", "odk_no_items_display_forms": "ODK", "odk_no_items_display_instances": "ODK", "odk_no_items_error": "ODK", "odk_no_sd_error": "ODK", "odk_noselect_error": "ODK", "odk_ok": "ODK", "odk_one_capture": "ODK", "odk_open_data_kit": "ODK", "odk_parse_error": "ODK", "odk_parse_legacy_formlist_failed": "ODK", "odk_parse_openrosa_formlist_failed": "ODK", "odk_password": "ODK", "odk_play_audio": "ODK", "odk_play_video": "ODK", "odk_please_wait": "ODK", "odk_please_wait_long": "ODK", "odk_powered_by_odk": "ODK", "odk_preference_form_entry_start_hide": "ODK", "odk_preference_form_entry_start_summary": "ODK", "odk_protocol": "ODK", "odk_provider_disabled_error": "ODK", "odk_quit_application": "ODK", "odk_quit_entry": "ODK", "odk_refresh": "ODK", "odk_replace_audio": "ODK", "odk_replace_barcode": "ODK", "odk_replace_image": "ODK", "odk_replace_location": "ODK", "odk_replace_video": "ODK", "odk_required_answer_error": "ODK", "odk_review": "ODK", "odk_review_data": "ODK", "odk_review_data_button": "ODK", "odk_root_element_error": "ODK", "odk_root_namespace_error": "ODK", "odk_save_all_answers": "ODK", "odk_save_as_error": "ODK", "odk_save_data_message": "ODK", "odk_save_enter_data_description": "ODK", "odk_save_form_as": "ODK", "odk_saved_data": "ODK", "odk_saving_form": "ODK", "odk_select_another_image": "ODK", "odk_select_answer": "ODK", "odk_selected": "ODK", "odk_selected_google_account_text": "ODK", "odk_send": "ODK", "odk_send_data": "ODK", "odk_send_data_button": "ODK", "odk_send_selected_data": "ODK", "odk_sending_items": "ODK", "odk_server_auth_credentials": "ODK", "odk_server_preferences": "ODK", "odk_server_requires_auth": "ODK", "odk_server_url": "ODK", "odk_show_location": "ODK", "odk_show_splash": "ODK", "odk_show_splash_summary": "ODK", "odk_splash_path": "ODK", "odk_submission_url": "ODK", "odk_success": "ODK", "odk_toggle_selected": "ODK", "odk_trigger": "ODK", "odk_upload_all_successful": "ODK", "odk_upload_results": "ODK", "odk_upload_some_failed": "ODK", "odk_uploading_data": "ODK", "odk_url_error": "ODK", "odk_use_odk_default": "ODK", "odk_username": "ODK", "odk_view_hierarchy": "ODK", "odk_xform_parse_error": "ODK", "option.cancel": "CommCareAndroid", "option.no": "CommCareAndroid", "option.yes": "CommCareAndroid", "problem.report.button": "CommCareAndroid", "problem.report.menuitem": "CommCareAndroid", "problem.report.prompt": "CommCareAndroid", "profile.found": "CommCareAndroid", "select.detail.confirm": "CommCareAndroid", "select.detail.title": "CommCareAndroid", "select.list.title": "CommCareAndroid", "select.menu.map": "CommCareAndroid", "select.menu.sort": "CommCareAndroid", "select.placeholder.message": "CommCareAndroid", "select.search.label": "CommCareAndroid", "sync.fail.auth.loggedin": "CommCareAndroid", "sync.fail.bad.data": "CommCareAndroid", "sync.fail.bad.local": "CommCareAndroid", "sync.fail.bad.network": "CommCareAndroid", "sync.fail.timeout": "CommCareAndroid", "sync.fail.unknown": "CommCareAndroid", "sync.fail.unsent": "CommCareAndroid", "sync.process.downloading.progress": "CommCareAndroid", "sync.process.processing": "CommCareAndroid", "sync.progress.authing": "CommCareAndroid", "sync.progress.downloading": "CommCareAndroid", "sync.progress.purge": "CommCareAndroid", "sync.progress.starting": "CommCareAndroid", "sync.progress.submitting": "CommCareAndroid", "sync.progress.submitting.title": "CommCareAndroid", "sync.progress.title": "CommCareAndroid", "sync.recover.needed": "CommCareAndroid", "sync.recover.started": "CommCareAndroid", "sync.success.sent": "CommCareAndroid", "sync.success.sent.singular": "CommCareAndroid", "sync.success.synced": "CommCareAndroid", "title.datum.wrapper": "CommCareAndroid", "update.success.refresh": "CommCareAndroid", "updates.check": "CommCareAndroid", "updates.checking": "CommCareAndroid", "updates.downloaded": "CommCareAndroid", "updates.found": "CommCareAndroid", "updates.resources.initialization": "CommCareAndroid", "updates.resources.profile": "CommCareAndroid", "updates.success": "CommCareAndroid", "updates.title": "CommCareAndroid", "upgrade.button.retry": "CommCareAndroid", "upgrade.button.startover": "CommCareAndroid", "verification.checking": "CommCareAndroid", "verification.fail.message": "CommCareAndroid", "verification.progress": "CommCareAndroid", "verification.title": "CommCareAndroid", "verify.checking": "CommCareAndroid", "verify.progress": "CommCareAndroid", "verify.title": "CommCareAndroid", "version.id.long": "CommCareAndroid", "version.id.short": "CommCareAndroid", "wifi.direct.base.folder": "CommCareAndroid", "wifi.direct.receive.forms": "CommCareAndroid", "wifi.direct.submit.forms": "CommCareAndroid", "wifi.direct.submit.missing": "CommCareAndroid", "wifi.direct.transfer.forms": "CommCareAndroid", "activity.adduser.adduser": "JavaRosa", "activity.adduser.problem": "JavaRosa", "activity.adduser.problem.emptyuser": "JavaRosa", "activity.adduser.problem.mismatchingpasswords": "JavaRosa", "activity.adduser.problem.nametaken": "JavaRosa", "activity.locationcapture.Accuracy": "JavaRosa", "activity.locationcapture.Altitude": "JavaRosa", "activity.locationcapture.capturelocation": "JavaRosa", "activity.locationcapture.capturelocationhint": "JavaRosa", "activity.locationcapture.capturelocationhint": "JavaRosa", "activity.locationcapture.fixfailed": "JavaRosa", "activity.locationcapture.fixobtained": "JavaRosa", "activity.locationcapture.GPSNotAvailable": "JavaRosa", "activity.locationcapture.Latitude": "JavaRosa", "activity.locationcapture.LocationError": "JavaRosa", "activity.locationcapture.Longitude": "JavaRosa", "activity.locationcapture.readyforcapture": "JavaRosa", "activity.locationcapture.waitingforfix": "JavaRosa", "activity.login.demomode.intro": "CommCareJava", "activity.login.demomode.intro": "JavaRosa", "activity.login.loginincorrect": "JavaRosa", "activity.login.tryagain": "JavaRosa", "af": "JavaRosa", "button.Next": "JavaRosa", "button.No": "JavaRosa", "button.Yes": "JavaRosa", "case.date.opened": "JavaRosa", "case.id": "JavaRosa", "case.name": "JavaRosa", "case.status": "JavaRosa", "command.back": "JavaRosa", "command.call": "JavaRosa", "command.cancel": "JavaRosa", "command.exit": "JavaRosa", "command.language": "JavaRosa", "command.next": "JavaRosa", "command.ok": "JavaRosa", "command.retry": "JavaRosa", "command.save": "JavaRosa", "command.saveexit": "JavaRosa", "command.select": "JavaRosa", "commcare.badversion": "CommCareJava", "commcare.fail": "CommCareJava", "commcare.fail.sendlogs": "CommCareJava", "commcare.firstload": "CommCareJava", "commcare.install.oom": "CommCareJava", "commcare.menu.count.wrapper": "CommCareJava", "commcare.noupgrade.version": "CommCareJava", "commcare.numwrapper": "CommCareJava", "commcare.review": "CommCareJava", "commcare.review.icon": "CommCareJava", "commcare.startup.oom": "CommCareJava", "commcare.tools.network": "CommCareJava", "commcare.tools.permissions": "CommCareJava", "commcare.tools.title": "CommCareJava", "commcare.tools.validate": "CommCareJava", "date.nago": "JavaRosa", "date.nfromnow": "JavaRosa", "date.today": "JavaRosa", "date.tomorrow": "JavaRosa", "date.twoago": "JavaRosa", "date.unknown": "JavaRosa", "date.yesterday": "JavaRosa", "debug.log": "JavaRosa", "en": "JavaRosa", "entity.command.sort": "JavaRosa", "entity.detail.title": "JavaRosa", "entity.find": "JavaRosa", "entity.nodata": "JavaRosa", "entity.nomatch": "JavaRosa", "entity.sort.title": "JavaRosa", "entity.title.layout": "JavaRosa", "es": "JavaRosa", "form.entry.badnum": "JavaRosa", "form.entry.badnum.dec": "JavaRosa", "form.entry.badnum.int": "JavaRosa", "form.entry.badnum.long": "JavaRosa", "form.entry.constraint.msg": "JavaRosa", "form.login.login": "JavaRosa", "form.login.password": "JavaRosa", "form.login.username": "JavaRosa", "form.user.confirmpassword": "JavaRosa", "form.user.fillinboth": "JavaRosa", "form.user.giveadmin": "JavaRosa", "form.user.name": "JavaRosa", "form.user.password": "JavaRosa", "form.user.userid": "JavaRosa", "formentry.invalid.input": "JavaRosa", "formview.repeat.addNew": "JavaRosa", "fra": "JavaRosa", "home.change.user": "CommCareJava", "home.data.restore": "CommCareJava", "home.demo.reset": "CommCareJava", "home.setttings": "CommCareJava", "home.updates": "CommCareJava", "home.user.edit": "CommCareJava", "home.user.new": "CommCareJava", "homescreen.title": "CommCareJava", "icon.demo.path": "JavaRosa", "icon.login.path": "JavaRosa", "id": "CommCareJava", "install.bad": "CommCareJava", "install.verify": "CommCareJava", "intro.restore": "CommCareJava", "intro.start": "CommCareJava", "intro.text": "CommCareJava", "intro.title": "CommCareJava", "loading.screen.message": "JavaRosa", "loading.screen.title": "JavaRosa", "locale.name.en": "CommCareJava", "locale.name.sw": "CommCareJava", "log.submit.full": "JavaRosa", "log.submit.never": "JavaRosa", "log.submit.next.daily": "JavaRosa", "log.submit.next.weekly": "JavaRosa", "log.submit.nigthly": "JavaRosa", "log.submit.short": "JavaRosa", "log.submit.url": "JavaRosa", "log.submit.weekly": "JavaRosa", "login.title": "CommCareJava", "menu.Back": "JavaRosa", "menu.Capture": "JavaRosa", "menu.Demo": "JavaRosa", "menu.Exit": "JavaRosa", "menu.Login": "JavaRosa", "menu.Next": "JavaRosa", "menu.ok": "JavaRosa", "menu.retry": "JavaRosa", "menu.Save": "JavaRosa", "menu.SaveAndExit": "JavaRosa", "menu.send.all": "CommCareJava", "menu.send.all.val": "CommCareJava", "menu.send.later": "JavaRosa", "menu.SendLater": "JavaRosa", "menu.SendNow": "JavaRosa", "menu.SendToNewServer": "JavaRosa", "menu.Settings": "JavaRosa", "menu.sync": "CommCareJava", "menu.sync.last": "CommCareJava", "menu.sync.prompt": "CommCareJava", "menu.sync.unsent.mult": "CommCareJava", "menu.sync.unsent.one": "CommCareJava", "menu.Tools": "JavaRosa", "menu.ViewAnswers": "JavaRosa", "message.delete": "JavaRosa", "message.details": "JavaRosa", "message.log": "JavaRosa", "message.permissions": "CommCareJava", "message.send.unsent": "JavaRosa", "message.timesync": "CommCareJava", "network.test.begin.image": "CommCareJava", "network.test.begin.message": "CommCareJava", "network.test.connected.image": "CommCareJava", "network.test.connected.message": "CommCareJava", "network.test.connecting.image": "CommCareJava", "network.test.connecting.message": "CommCareJava", "network.test.content.image": "CommCareJava", "network.test.content.message": "CommCareJava", "network.test.details": "CommCareJava", "network.test.details.title": "CommCareJava", "network.test.failed.image": "CommCareJava", "network.test.failed.message": "CommCareJava", "network.test.response.message": "CommCareJava", "network.test.title": "CommCareJava", "no": "JavaRosa", "node.select.filtering": "CommCareJava", "plussign": "JavaRosa", "polish.command.back": "JavaRosa", "polish.command.cancel": "JavaRosa", "polish.command.clear": "JavaRosa", "polish.command.delete": "JavaRosa", "polish.command.entersymbol": "JavaRosa", "polish.command.exit": "JavaRosa", "polish.command.followlink": "JavaRosa", "polish.command.hide": "JavaRosa", "polish.command.mark": "JavaRosa", "polish.command.ok": "JavaRosa", "polish.command.options": "JavaRosa", "polish.command.select": "JavaRosa", "polish.command.submit": "JavaRosa", "polish.command.unmark": "JavaRosa", "polish.date.select": "CommCareJava", "polish.date.select": "JavaRosa", "polish.rss.command.followlink": "JavaRosa", "polish.rss.command.select": "JavaRosa", "polish.TextField.charactersKey0": "JavaRosa", "polish.TextField.charactersKey1": "JavaRosa", "polish.TextField.charactersKey2": "JavaRosa", "polish.TextField.charactersKey3": "JavaRosa", "polish.TextField.charactersKey4": "JavaRosa", "polish.TextField.charactersKey5": "JavaRosa", "polish.TextField.charactersKey6": "JavaRosa", "polish.TextField.charactersKey7": "JavaRosa", "polish.TextField.charactersKey8": "JavaRosa", "polish.TextField.charactersKey9": "JavaRosa", "polish.title.input": "JavaRosa", "pt": "JavaRosa", "question.SendNow": "JavaRosa", "repeat.message.multiple": "JavaRosa", "repeat.message.single": "JavaRosa", "repeat.repitition": "JavaRosa", "restore.bad.db": "CommCareJava", "restore.badcredentials": "CommCareJava", "restore.baddownload": "CommCareJava", "restore.badserver": "CommCareJava", "restore.bypass.clean": "CommCareJava", "restore.bypass.clean.success": "CommCareJava", "restore.bypass.cleanfail": "CommCareJava", "restore.bypass.fail": "CommCareJava", "restore.bypass.instructions": "CommCareJava", "restore.bypass.start": "CommCareJava", "restore.db.busy": "CommCareJava", "restore.downloaded": "CommCareJava", "restore.fail": "CommCareJava", "restore.fail.credentials": "CommCareJava", "restore.fail.download": "CommCareJava", "restore.fail.message": "CommCareJava", "restore.fail.nointernet": "CommCareJava", "restore.fail.other": "CommCareJava", "restore.fail.retry": "CommCareJava", "restore.fail.technical": "CommCareJava", "restore.fail.transport": "CommCareJava", "restore.fail.view": "CommCareJava", "restore.fetch": "CommCareJava", "restore.finished": "CommCareJava", "restore.key.continue": "CommCareJava", "restore.login.instructions": "CommCareJava", "restore.message.connection.failed": "CommCareJava", "restore.message.connectionmade": "CommCareJava", "restore.message.startdownload": "CommCareJava", "restore.nocache": "CommCareJava", "restore.noserveruri": "CommCareJava", "restore.recover.fail": "CommCareJava", "restore.recover.needcache": "CommCareJava", "restore.recover.send": "CommCareJava", "restore.recovery.wipe": "CommCareJava", "restore.retry": "CommCareJava", "restore.starting": "CommCareJava", "restore.success": "CommCareJava", "restore.success.partial": "CommCareJava", "restore.ui.bounded": "CommCareJava", "restore.ui.unbounded": "CommCareJava", "restore.user.exists": "CommCareJava", "review.date": "CommCareJava", "review.title": "CommCareJava", "review.type": "CommCareJava", "review.type.unknown": "CommCareJava", "send.unsent.icon": "CommCareJava", "sending.message.send": "JavaRosa", "sending.status.didnotunderstand": "CommCareJava", "sending.status.error": "JavaRosa", "sending.status.failed": "JavaRosa", "sending.status.failures": "JavaRosa", "sending.status.going": "JavaRosa", "sending.status.long": "JavaRosa", "sending.status.multi": "JavaRosa", "sending.status.none": "JavaRosa", "sending.status.problem.datasafe": "CommCareJava", "sending.status.success": "JavaRosa", "sending.status.success": "JavaRosa", "sending.status.title": "JavaRosa", "sending.view.done": "JavaRosa", "sending.view.done.title": "JavaRosa", "sending.view.later": "JavaRosa", "sending.view.now": "JavaRosa", "sending.view.submit": "JavaRosa", "sending.view.when": "JavaRosa", "server.sync.icon.normal": "CommCareJava", "server.sync.icon.warn": "CommCareJava", "settings.language": "JavaRosa", "splashscreen": "JavaRosa", "sw": "JavaRosa", "sync.cancelled": "CommCareJava", "sync.cancelled.sending": "CommCareJava", "sync.done.closed": "CommCareJava", "sync.done.new": "CommCareJava", "sync.done.noupdate": "CommCareJava", "sync.done.updated": "CommCareJava", "sync.done.updates": "CommCareJava", "sync.pull.admin": "CommCareJava", "sync.pull.demo": "CommCareJava", "sync.pull.fail": "CommCareJava", "sync.send.fail": "CommCareJava", "sync.unsent.cancel": "CommCareJava", "update.fail.generic": "CommCareJava", "update.fail.network": "CommCareJava", "update.fail.network.retry": "CommCareJava", "update.header": "CommCareJava", "update.retrying": "CommCareJava", "user.create.header": "JavaRosa", "user.entity.admin": "JavaRosa", "user.entity.demo": "JavaRosa", "user.entity.name": "JavaRosa", "user.entity.normal": "JavaRosa", "user.entity.type": "JavaRosa", "user.entity.unknown": "JavaRosa", "user.entity.username": "JavaRosa", "user.registration.attempt": "JavaRosa", "user.registration.badresponse": "JavaRosa", "user.registration.failmessage": "JavaRosa", "user.registration.success": "JavaRosa", "user.registration.title": "JavaRosa", "validation.start": "CommCareJava", "validation.success": "CommCareJava", "video.playback.bottom": "JavaRosa", "video.playback.hashkey.path": "JavaRosa", "video.playback.top": "JavaRosa", "view.sending.RequiredQuestion": "JavaRosa", "xpath.fail.runtime": "CommCareJava", "yes": "JavaRosa", "zh": "JavaRosa" }
sources = {'activity.task.error.generic': 'CommCareAndroid', 'app.handled.error.explanation': 'CommCareAndroid', 'app.handled.error.title': 'CommCareAndroid', 'app.key.request.deny': 'CommCareAndroid', 'app.key.request.grant': 'CommCareAndroid', 'app.key.request.message': 'CommCareAndroid', 'app.menu.display.cond.bad.xpath': 'CommCareAndroid', 'app.menu.display.cond.xpath.err': 'CommCareAndroid', 'app.storage.missing.button': 'CommCareAndroid', 'app.storage.missing.message': 'CommCareAndroid', 'app.storage.missing.title': 'CommCareAndroid', 'app.workflow.forms.delete': 'CommCareAndroid', 'app.workflow.forms.fetch': 'CommCareAndroid', 'app.workflow.forms.open': 'CommCareAndroid', 'app.workflow.forms.quarantine.report': 'CommCareAndroid', 'app.workflow.forms.restore': 'CommCareAndroid', 'app.workflow.forms.scan': 'CommCareAndroid', 'app.workflow.forms.scan.title.invalid': 'CommCareAndroid', 'app.workflow.forms.scan.title.valid': 'CommCareAndroid', 'app.workflow.incomplete.continue': 'CommCareAndroid', 'app.workflow.incomplete.continue.option.delete': 'CommCareAndroid', 'app.workflow.incomplete.continue.title': 'CommCareAndroid', 'app.workflow.incomplete.heading': 'CommCareAndroid', 'app.workflow.login.lost': 'CommCareAndroid', 'app.workflow.saved.heading': 'CommCareAndroid', 'archive.install.bad': 'CommCareAndroid', 'archive.install.button': 'CommCareAndroid', 'archive.install.cancelled': 'CommCareAndroid', 'archive.install.progress': 'CommCareAndroid', 'archive.install.prompt': 'CommCareAndroid', 'archive.install.state.done': 'CommCareAndroid', 'archive.install.state.empty': 'CommCareAndroid', 'archive.install.state.invalid.path': 'CommCareAndroid', 'archive.install.state.ready': 'CommCareAndroid', 'archive.install.title': 'CommCareAndroid', 'archive.install.unzip': 'CommCareAndroid', 'bulk.dump.dialog.progress': 'CommCareAndroid', 'bulk.dump.dialog.title': 'CommCareAndroid', 'bulk.form.alert.title': 'CommCareAndroid', 'bulk.form.cancel': 'CommCareAndroid', 'bulk.form.dump': 'CommCareAndroid', 'bulk.form.dump.2': 'CommCareAndroid', 'bulk.form.dump.success': 'CommCareAndroid', 'bulk.form.end': 'CommCareAndroid', 'bulk.form.error': 'CommCareAndroid', 'bulk.form.foldername': 'CommCareAndroid', 'bulk.form.messages': 'CommCareAndroid', 'bulk.form.no.unsynced': 'CommCareAndroid', 'bulk.form.no.unsynced.dump': 'CommCareAndroid', 'bulk.form.no.unsynced.submit': 'CommCareAndroid', 'bulk.form.progress': 'CommCareAndroid', 'bulk.form.prompt': 'CommCareAndroid', 'bulk.form.sd.emulated': 'CommCareAndroid', 'bulk.form.sd.unavailable': 'CommCareAndroid', 'bulk.form.sd.unwritable': 'CommCareAndroid', 'bulk.form.send.start': 'CommCareAndroid', 'bulk.form.send.success': 'CommCareAndroid', 'bulk.form.start': 'CommCareAndroid', 'bulk.form.submit': 'CommCareAndroid', 'bulk.form.submit.2': 'CommCareAndroid', 'bulk.form.warning': 'CommCareAndroid', 'bulk.send.dialog.progress': 'CommCareAndroid', 'bulk.send.dialog.title': 'CommCareAndroid', 'bulk.send.file.error': 'CommCareAndroid', 'bulk.send.malformed.file': 'CommCareAndroid', 'bulk.send.transport.error': 'CommCareAndroid', 'cchq.case': 'CommCareAndroid', 'connection.task.commcare.html.fail': 'CommCareAndroid', 'connection.task.internet.fail': 'CommCareAndroid', 'connection.task.internet.success': 'CommCareAndroid', 'connection.task.remote.ping.fail': 'CommCareAndroid', 'connection.task.report.commcare.popup': 'CommCareAndroid', 'connection.task.success': 'CommCareAndroid', 'connection.task.unset.posturl': 'CommCareAndroid', 'connection.test.access.settings': 'CommCareAndroid', 'connection.test.error.message': 'CommCareAndroid', 'connection.test.messages': 'CommCareAndroid', 'connection.test.now.running': 'CommCareAndroid', 'connection.test.prompt': 'CommCareAndroid', 'connection.test.report.button.message': 'CommCareAndroid', 'connection.test.run': 'CommCareAndroid', 'connection.test.run.title': 'CommCareAndroid', 'connection.test.update.message': 'CommCareAndroid', 'demo.mode.warning': 'CommCareAndroid', 'demo.mode.warning.dismiss': 'CommCareAndroid', 'demo.mode.warning.title': 'CommCareAndroid', 'dialog.ok': 'CommCareAndroid', 'form.entry.processing': 'CommCareAndroid', 'form.entry.processing.title': 'CommCareAndroid', 'form.entry.segfault': 'CommCareAndroid', 'form.record.filter.incomplete': 'CommCareAndroid', 'form.record.filter.limbo': 'CommCareAndroid', 'form.record.filter.pending': 'CommCareAndroid', 'form.record.filter.subandpending': 'CommCareAndroid', 'form.record.filter.submitted': 'CommCareAndroid', 'form.record.gone': 'CommCareAndroid', 'form.record.gone.message': 'CommCareAndroid', 'form.record.unsent': 'CommCareAndroid', 'home.forms': 'CommCareAndroid', 'home.forms.incomplete': 'CommCareAndroid', 'home.forms.incomplete.indicator': 'CommCareAndroid', 'home.forms.saved': 'CommCareAndroid', 'home.logged.in.message': 'CommCareAndroid', 'home.logged.out': 'CommCareAndroid', 'home.logout': 'CommCareAndroid', 'home.logout.demo': 'CommCareAndroid', 'home.menu.call.log': 'CommCareAndroid', 'home.menu.change.locale': 'CommCareAndroid', 'home.menu.connection.diagnostic': 'CommCareAndroid', 'home.menu.formdump': 'CommCareAndroid', 'home.menu.settings': 'CommCareAndroid', 'home.menu.update': 'CommCareAndroid', 'home.menu.validate': 'CommCareAndroid', 'home.menu.wifi.direct': 'CommCareAndroid', 'home.start': 'CommCareAndroid', 'home.start.demo': 'CommCareAndroid', 'home.sync': 'CommCareAndroid', 'home.sync.demo': 'CommCareAndroid', 'home.sync.indicator': 'CommCareAndroid', 'home.sync.message.last': 'CommCareAndroid', 'home.sync.message.last.demo': 'CommCareAndroid', 'home.sync.message.last.never': 'CommCareAndroid', 'home.sync.message.unsent.plural': 'CommCareAndroid', 'home.sync.message.unsent.singular': 'CommCareAndroid', 'install.bad.ref': 'CommCareAndroid', 'install.barcode': 'CommCareAndroid', 'install.button.enter': 'CommCareAndroid', 'install.button.retry': 'CommCareAndroid', 'install.button.start': 'CommCareAndroid', 'install.button.startover': 'CommCareAndroid', 'install.major.mismatch': 'CommCareAndroid', 'install.manual': 'CommCareAndroid', 'install.minor.mismatch': 'CommCareAndroid', 'install.problem.unexpected': 'CommCareAndroid', 'install.ready': 'CommCareAndroid', 'install.version.mismatch': 'CommCareAndroid', 'key.manage.callout': 'CommCareAndroid', 'key.manage.legacy.begin': 'CommCareAndroid', 'key.manage.migrate': 'CommCareAndroid', 'key.manage.purge': 'CommCareAndroid', 'key.manage.start': 'CommCareAndroid', 'key.manage.title': 'CommCareAndroid', 'login.attempt.badcred': 'CommCareAndroid', 'login.attempt.fail.auth.detail': 'CommCareAndroid', 'login.attempt.fail.auth.title': 'CommCareAndroid', 'login.attempt.fail.changed.action': 'CommCareAndroid', 'login.attempt.fail.changed.detail': 'CommCareAndroid', 'login.attempt.fail.changed.title': 'CommCareAndroid', 'login.button': 'CommCareAndroid', 'login.menu.demo': 'CommCareAndroid', 'login.password': 'CommCareAndroid', 'login.sync': 'CommCareAndroid', 'login.username': 'CommCareAndroid', 'main.sync.demo': 'CommCareAndroid', 'main.sync.demo.has.forms': 'CommCareAndroid', 'main.sync.demo.no.forms': 'CommCareAndroid', 'menu.advanced': 'CommCareAndroid', 'menu.archive': 'CommCareAndroid', 'menu.basic': 'CommCareAndroid', 'modules.m0': 'CommCareAndroid', 'mult.install.bad': 'CommCareAndroid', 'mult.install.button': 'CommCareAndroid', 'mult.install.cancelled': 'CommCareAndroid', 'mult.install.error': 'CommCareAndroid', 'mult.install.no.browser': 'CommCareAndroid', 'mult.install.progress': 'CommCareAndroid', 'mult.install.progress.baddest': 'CommCareAndroid', 'mult.install.progress.badentry': 'CommCareAndroid', 'mult.install.progress.errormoving': 'CommCareAndroid', 'mult.install.prompt': 'CommCareAndroid', 'mult.install.state.done': 'CommCareAndroid', 'mult.install.state.empty': 'CommCareAndroid', 'mult.install.state.invalid.path': 'CommCareAndroid', 'mult.install.state.ready': 'CommCareAndroid', 'mult.install.title': 'CommCareAndroid', 'notification.bad.certificate.action': 'CommCareAndroid', 'notification.bad.certificate.detail': 'CommCareAndroid', 'notification.bad.certificate.title': 'CommCareAndroid', 'notification.case.filter.action': 'CommCareAndroid', 'notification.case.filter.detail': 'CommCareAndroid', 'notification.case.filter.title': 'CommCareAndroid', 'notification.case.predicate.action': 'CommCareAndroid', 'notification.case.predicate.title': 'CommCareAndroid', 'notification.credential.mismatch.action': 'CommCareAndroid', 'notification.credential.mismatch.detail': 'CommCareAndroid', 'notification.credential.mismatch.title': 'CommCareAndroid', 'notification.for.details.wrapper': 'CommCareAndroid', 'notification.formentry.unretrievable.action': 'CommCareAndroid', 'notification.formentry.unretrievable.detail': 'CommCareAndroid', 'notification.formentry.unretrievable.title': 'CommCareAndroid', 'notification.install.badarchive.action': 'CommCareAndroid', 'notification.install.badarchive.detail': 'CommCareAndroid', 'notification.install.badarchive.title': 'CommCareAndroid', 'notification.install.badcert.action': 'CommCareAndroid', 'notification.install.badcert.detail': 'CommCareAndroid', 'notification.install.badcert.title': 'CommCareAndroid', 'notification.install.badreqs.action': 'CommCareAndroid', 'notification.install.badreqs.detail': 'CommCareAndroid', 'notification.install.badreqs.title': 'CommCareAndroid', 'notification.install.badstate.action': 'CommCareAndroid', 'notification.install.badstate.detail': 'CommCareAndroid', 'notification.install.badstate.title': 'CommCareAndroid', 'notification.install.installed.detail': 'CommCareAndroid', 'notification.install.installed.title': 'CommCareAndroid', 'notification.install.missing.action': 'CommCareAndroid', 'notification.install.missing.detail': 'CommCareAndroid', 'notification.install.missing.title': 'CommCareAndroid', 'notification.install.missing.withmessage.action': 'CommCareAndroid', 'notification.install.missing.withmessage.detail': 'CommCareAndroid', 'notification.install.missing.withmessage.title': 'CommCareAndroid', 'notification.install.nolocal.action': 'CommCareAndroid', 'notification.install.nolocal.detail': 'CommCareAndroid', 'notification.install.nolocal.title': 'CommCareAndroid', 'notification.install.unknown.detail': 'CommCareAndroid', 'notification.install.unknown.title': 'CommCareAndroid', 'notification.install.uptodate.detail': 'CommCareAndroid', 'notification.install.uptodate.title': 'CommCareAndroid', 'notification.logger.error.detail': 'CommCareAndroid', 'notification.logger.error.title': 'CommCareAndroid', 'notification.logger.serialized.detail': 'CommCareAndroid', 'notification.logger.serialized.title': 'CommCareAndroid', 'notification.logger.submitted.detail': 'CommCareAndroid', 'notification.logger.submitted.title': 'CommCareAndroid', 'notification.network.timeout.action': 'CommCareAndroid', 'notification.network.timeout.detail': 'CommCareAndroid', 'notification.network.timeout.title': 'CommCareAndroid', 'notification.processing.badstructure.action': 'CommCareAndroid', 'notification.processing.badstructure.detail': 'CommCareAndroid', 'notification.processing.badstructure.title': 'CommCareAndroid', 'notification.processing.nosdcard.action': 'CommCareAndroid', 'notification.processing.nosdcard.detail': 'CommCareAndroid', 'notification.processing.nosdcard.title': 'CommCareAndroid', 'notification.restore.baddata.detail': 'CommCareAndroid', 'notification.restore.baddata.title': 'CommCareAndroid', 'notification.restore.nonetwork.detail': 'CommCareAndroid', 'notification.restore.nonetwork.title': 'CommCareAndroid', 'notification.restore.remote.error.action': 'CommCareAndroid', 'notification.restore.remote.error.detail': 'CommCareAndroid', 'notification.restore.remote.error.title': 'CommCareAndroid', 'notification.restore.unknown.action': 'CommCareAndroid', 'notification.restore.unknown.detail': 'CommCareAndroid', 'notification.restore.unknown.title': 'CommCareAndroid', 'notification.send.malformed.detail': 'CommCareAndroid', 'notification.send.malformed.title': 'CommCareAndroid', 'notification.sending.loggedout.detail': 'CommCareAndroid', 'notification.sending.loggedout.title': 'CommCareAndroid', 'notification.sending.quarantine.action': 'CommCareAndroid', 'notification.sending.quarantine.detail': 'CommCareAndroid', 'notification.sending.quarantine.title': 'CommCareAndroid', 'notification.sync.airplane.action': 'CommCareAndroid', 'notification.sync.airplane.detail': 'CommCareAndroid', 'notification.sync.airplane.title': 'CommCareAndroid', 'notifications.prompt.details': 'CommCareAndroid', 'notifications.prompt.more': 'CommCareAndroid', 'odk_accept_location': 'ODK', 'odk_access_error': 'ODK', 'odk_accuracy': 'ODK', 'odk_activity_not_found': 'ODK', 'odk_add_another': 'ODK', 'odk_add_another_repeat': 'ODK', 'odk_add_repeat': 'ODK', 'odk_add_repeat_no': 'ODK', 'odk_advance': 'ODK', 'odk_altitude': 'ODK', 'odk_app_name': 'ODK', 'odk_app_url': 'ODK', 'odk_attachment_oversized': 'ODK', 'odk_audio_file_error': 'ODK', 'odk_audio_file_invalid': 'ODK', 'odk_backup': 'ODK', 'odk_barcode_scanner_error': 'ODK', 'odk_cancel': 'ODK', 'odk_cancel_loading_form': 'ODK', 'odk_cancel_location': 'ODK', 'odk_cancel_saving_form': 'ODK', 'odk_cannot_edit_completed_form': 'ODK', 'odk_capture_audio': 'ODK', 'odk_capture_image': 'ODK', 'odk_capture_video': 'ODK', 'odk_change_font_size': 'ODK', 'odk_change_formlist_url': 'ODK', 'odk_change_language': 'ODK', 'odk_change_password': 'ODK', 'odk_change_protocol': 'ODK', 'odk_change_server_url': 'ODK', 'odk_change_settings': 'ODK', 'odk_change_splash_path': 'ODK', 'odk_change_submission_url': 'ODK', 'odk_change_username': 'ODK', 'odk_choose_image': 'ODK', 'odk_choose_sound': 'ODK', 'odk_choose_video': 'ODK', 'odk_clear_answer': 'ODK', 'odk_clear_answer_ask': 'ODK', 'odk_clear_answer_no': 'ODK', 'odk_clearanswer_confirm': 'ODK', 'odk_click_to_web': 'ODK', 'odk_client': 'ODK', 'odk_completed_data': 'ODK', 'odk_data': 'ODK', 'odk_data_saved_error': 'ODK', 'odk_data_saved_ok': 'ODK', 'odk_default_completed': 'ODK', 'odk_default_completed_summary': 'ODK', 'odk_default_odk_formlist': 'ODK', 'odk_default_odk_submission': 'ODK', 'odk_default_server_url': 'ODK', 'odk_default_splash_path': 'ODK', 'odk_delete_confirm': 'ODK', 'odk_delete_file': 'ODK', 'odk_delete_no': 'ODK', 'odk_delete_repeat': 'ODK', 'odk_delete_repeat_ask': 'ODK', 'odk_delete_repeat_confirm': 'ODK', 'odk_delete_repeat_no': 'ODK', 'odk_delete_yes': 'ODK', 'odk_discard_answer': 'ODK', 'odk_discard_group': 'ODK', 'odk_do_not_change': 'ODK', 'odk_do_not_exit': 'ODK', 'odk_do_not_save': 'ODK', 'odk_download': 'ODK', 'odk_download_all_successful': 'ODK', 'odk_download_complete': 'ODK', 'odk_download_failed_with_error': 'ODK', 'odk_download_forms_result': 'ODK', 'odk_downloading_data': 'ODK', 'odk_edit_prompt': 'ODK', 'odk_enter': 'ODK', 'odk_enter_data': 'ODK', 'odk_enter_data_button': 'ODK', 'odk_enter_data_description': 'ODK', 'odk_enter_data_message': 'ODK', 'odk_entering_repeat': 'ODK', 'odk_entering_repeat_ask': 'ODK', 'odk_error_downloading': 'ODK', 'odk_error_occured': 'ODK', 'odk_exit': 'ODK', 'odk_fetching_file': 'ODK', 'odk_fetching_manifest': 'ODK', 'odk_file_deleted_error': 'ODK', 'odk_file_deleted_ok': 'ODK', 'odk_file_fetch_failed': 'ODK', 'odk_file_invalid': 'ODK', 'odk_file_missing': 'ODK', 'odk_finding_location': 'ODK', 'odk_finished_disk_scan': 'ODK', 'odk_first_run': 'ODK', 'odk_font_size': 'ODK', 'odk_form': 'ODK', 'odk_form_download_progress': 'ODK', 'odk_form_entry_start_hide': 'ODK', 'odk_form_name': 'ODK', 'odk_form_renamed': 'ODK', 'odk_form_scan_finished': 'ODK', 'odk_form_scan_starting': 'ODK', 'odk_formlist_url': 'ODK', 'odk_forms': 'ODK', 'odk_found_location': 'ODK', 'odk_general_preferences': 'ODK', 'odk_get_barcode': 'ODK', 'odk_get_forms': 'ODK', 'odk_get_location': 'ODK', 'odk_getting_location': 'ODK', 'odk_go_to_location': 'ODK', 'odk_google_account': 'ODK', 'odk_google_submission_id_text': 'ODK', 'odk_intent_callout_button': 'ODK', 'odk_intent_callout_button_update': 'ODK', 'odk_invalid_answer_error': 'ODK', 'odk_jump_to_beginning': 'ODK', 'odk_jump_to_end': 'ODK', 'odk_jump_to_previous': 'ODK', 'odk_keep_changes': 'ODK', 'odk_latitude': 'ODK', 'odk_leave_repeat_yes': 'ODK', 'odk_leaving_repeat': 'ODK', 'odk_leaving_repeat_ask': 'ODK', 'odk_list_failed_with_error': 'ODK', 'odk_load_remote_form_error': 'ODK', 'odk_loading_form': 'ODK', 'odk_location_accuracy': 'ODK', 'odk_location_provider': 'ODK', 'odk_location_provider_accuracy': 'ODK', 'odk_longitude': 'ODK', 'odk_main_menu': 'ODK', 'odk_main_menu_details': 'ODK', 'odk_main_menu_message': 'ODK', 'odk_manage_files': 'ODK', 'odk_manifest_server_error': 'ODK', 'odk_manifest_tag_error': 'ODK', 'odk_mark_finished': 'ODK', 'odk_no': 'ODK', 'odk_no_capture': 'ODK', 'odk_no_connection': 'ODK', 'odk_no_forms_uploaded': 'ODK', 'odk_no_gps_message': 'ODK', 'odk_no_gps_title': 'ODK', 'odk_no_items_display': 'ODK', 'odk_no_items_display_forms': 'ODK', 'odk_no_items_display_instances': 'ODK', 'odk_no_items_error': 'ODK', 'odk_no_sd_error': 'ODK', 'odk_noselect_error': 'ODK', 'odk_ok': 'ODK', 'odk_one_capture': 'ODK', 'odk_open_data_kit': 'ODK', 'odk_parse_error': 'ODK', 'odk_parse_legacy_formlist_failed': 'ODK', 'odk_parse_openrosa_formlist_failed': 'ODK', 'odk_password': 'ODK', 'odk_play_audio': 'ODK', 'odk_play_video': 'ODK', 'odk_please_wait': 'ODK', 'odk_please_wait_long': 'ODK', 'odk_powered_by_odk': 'ODK', 'odk_preference_form_entry_start_hide': 'ODK', 'odk_preference_form_entry_start_summary': 'ODK', 'odk_protocol': 'ODK', 'odk_provider_disabled_error': 'ODK', 'odk_quit_application': 'ODK', 'odk_quit_entry': 'ODK', 'odk_refresh': 'ODK', 'odk_replace_audio': 'ODK', 'odk_replace_barcode': 'ODK', 'odk_replace_image': 'ODK', 'odk_replace_location': 'ODK', 'odk_replace_video': 'ODK', 'odk_required_answer_error': 'ODK', 'odk_review': 'ODK', 'odk_review_data': 'ODK', 'odk_review_data_button': 'ODK', 'odk_root_element_error': 'ODK', 'odk_root_namespace_error': 'ODK', 'odk_save_all_answers': 'ODK', 'odk_save_as_error': 'ODK', 'odk_save_data_message': 'ODK', 'odk_save_enter_data_description': 'ODK', 'odk_save_form_as': 'ODK', 'odk_saved_data': 'ODK', 'odk_saving_form': 'ODK', 'odk_select_another_image': 'ODK', 'odk_select_answer': 'ODK', 'odk_selected': 'ODK', 'odk_selected_google_account_text': 'ODK', 'odk_send': 'ODK', 'odk_send_data': 'ODK', 'odk_send_data_button': 'ODK', 'odk_send_selected_data': 'ODK', 'odk_sending_items': 'ODK', 'odk_server_auth_credentials': 'ODK', 'odk_server_preferences': 'ODK', 'odk_server_requires_auth': 'ODK', 'odk_server_url': 'ODK', 'odk_show_location': 'ODK', 'odk_show_splash': 'ODK', 'odk_show_splash_summary': 'ODK', 'odk_splash_path': 'ODK', 'odk_submission_url': 'ODK', 'odk_success': 'ODK', 'odk_toggle_selected': 'ODK', 'odk_trigger': 'ODK', 'odk_upload_all_successful': 'ODK', 'odk_upload_results': 'ODK', 'odk_upload_some_failed': 'ODK', 'odk_uploading_data': 'ODK', 'odk_url_error': 'ODK', 'odk_use_odk_default': 'ODK', 'odk_username': 'ODK', 'odk_view_hierarchy': 'ODK', 'odk_xform_parse_error': 'ODK', 'option.cancel': 'CommCareAndroid', 'option.no': 'CommCareAndroid', 'option.yes': 'CommCareAndroid', 'problem.report.button': 'CommCareAndroid', 'problem.report.menuitem': 'CommCareAndroid', 'problem.report.prompt': 'CommCareAndroid', 'profile.found': 'CommCareAndroid', 'select.detail.confirm': 'CommCareAndroid', 'select.detail.title': 'CommCareAndroid', 'select.list.title': 'CommCareAndroid', 'select.menu.map': 'CommCareAndroid', 'select.menu.sort': 'CommCareAndroid', 'select.placeholder.message': 'CommCareAndroid', 'select.search.label': 'CommCareAndroid', 'sync.fail.auth.loggedin': 'CommCareAndroid', 'sync.fail.bad.data': 'CommCareAndroid', 'sync.fail.bad.local': 'CommCareAndroid', 'sync.fail.bad.network': 'CommCareAndroid', 'sync.fail.timeout': 'CommCareAndroid', 'sync.fail.unknown': 'CommCareAndroid', 'sync.fail.unsent': 'CommCareAndroid', 'sync.process.downloading.progress': 'CommCareAndroid', 'sync.process.processing': 'CommCareAndroid', 'sync.progress.authing': 'CommCareAndroid', 'sync.progress.downloading': 'CommCareAndroid', 'sync.progress.purge': 'CommCareAndroid', 'sync.progress.starting': 'CommCareAndroid', 'sync.progress.submitting': 'CommCareAndroid', 'sync.progress.submitting.title': 'CommCareAndroid', 'sync.progress.title': 'CommCareAndroid', 'sync.recover.needed': 'CommCareAndroid', 'sync.recover.started': 'CommCareAndroid', 'sync.success.sent': 'CommCareAndroid', 'sync.success.sent.singular': 'CommCareAndroid', 'sync.success.synced': 'CommCareAndroid', 'title.datum.wrapper': 'CommCareAndroid', 'update.success.refresh': 'CommCareAndroid', 'updates.check': 'CommCareAndroid', 'updates.checking': 'CommCareAndroid', 'updates.downloaded': 'CommCareAndroid', 'updates.found': 'CommCareAndroid', 'updates.resources.initialization': 'CommCareAndroid', 'updates.resources.profile': 'CommCareAndroid', 'updates.success': 'CommCareAndroid', 'updates.title': 'CommCareAndroid', 'upgrade.button.retry': 'CommCareAndroid', 'upgrade.button.startover': 'CommCareAndroid', 'verification.checking': 'CommCareAndroid', 'verification.fail.message': 'CommCareAndroid', 'verification.progress': 'CommCareAndroid', 'verification.title': 'CommCareAndroid', 'verify.checking': 'CommCareAndroid', 'verify.progress': 'CommCareAndroid', 'verify.title': 'CommCareAndroid', 'version.id.long': 'CommCareAndroid', 'version.id.short': 'CommCareAndroid', 'wifi.direct.base.folder': 'CommCareAndroid', 'wifi.direct.receive.forms': 'CommCareAndroid', 'wifi.direct.submit.forms': 'CommCareAndroid', 'wifi.direct.submit.missing': 'CommCareAndroid', 'wifi.direct.transfer.forms': 'CommCareAndroid', 'activity.adduser.adduser': 'JavaRosa', 'activity.adduser.problem': 'JavaRosa', 'activity.adduser.problem.emptyuser': 'JavaRosa', 'activity.adduser.problem.mismatchingpasswords': 'JavaRosa', 'activity.adduser.problem.nametaken': 'JavaRosa', 'activity.locationcapture.Accuracy': 'JavaRosa', 'activity.locationcapture.Altitude': 'JavaRosa', 'activity.locationcapture.capturelocation': 'JavaRosa', 'activity.locationcapture.capturelocationhint': 'JavaRosa', 'activity.locationcapture.capturelocationhint': 'JavaRosa', 'activity.locationcapture.fixfailed': 'JavaRosa', 'activity.locationcapture.fixobtained': 'JavaRosa', 'activity.locationcapture.GPSNotAvailable': 'JavaRosa', 'activity.locationcapture.Latitude': 'JavaRosa', 'activity.locationcapture.LocationError': 'JavaRosa', 'activity.locationcapture.Longitude': 'JavaRosa', 'activity.locationcapture.readyforcapture': 'JavaRosa', 'activity.locationcapture.waitingforfix': 'JavaRosa', 'activity.login.demomode.intro': 'CommCareJava', 'activity.login.demomode.intro': 'JavaRosa', 'activity.login.loginincorrect': 'JavaRosa', 'activity.login.tryagain': 'JavaRosa', 'af': 'JavaRosa', 'button.Next': 'JavaRosa', 'button.No': 'JavaRosa', 'button.Yes': 'JavaRosa', 'case.date.opened': 'JavaRosa', 'case.id': 'JavaRosa', 'case.name': 'JavaRosa', 'case.status': 'JavaRosa', 'command.back': 'JavaRosa', 'command.call': 'JavaRosa', 'command.cancel': 'JavaRosa', 'command.exit': 'JavaRosa', 'command.language': 'JavaRosa', 'command.next': 'JavaRosa', 'command.ok': 'JavaRosa', 'command.retry': 'JavaRosa', 'command.save': 'JavaRosa', 'command.saveexit': 'JavaRosa', 'command.select': 'JavaRosa', 'commcare.badversion': 'CommCareJava', 'commcare.fail': 'CommCareJava', 'commcare.fail.sendlogs': 'CommCareJava', 'commcare.firstload': 'CommCareJava', 'commcare.install.oom': 'CommCareJava', 'commcare.menu.count.wrapper': 'CommCareJava', 'commcare.noupgrade.version': 'CommCareJava', 'commcare.numwrapper': 'CommCareJava', 'commcare.review': 'CommCareJava', 'commcare.review.icon': 'CommCareJava', 'commcare.startup.oom': 'CommCareJava', 'commcare.tools.network': 'CommCareJava', 'commcare.tools.permissions': 'CommCareJava', 'commcare.tools.title': 'CommCareJava', 'commcare.tools.validate': 'CommCareJava', 'date.nago': 'JavaRosa', 'date.nfromnow': 'JavaRosa', 'date.today': 'JavaRosa', 'date.tomorrow': 'JavaRosa', 'date.twoago': 'JavaRosa', 'date.unknown': 'JavaRosa', 'date.yesterday': 'JavaRosa', 'debug.log': 'JavaRosa', 'en': 'JavaRosa', 'entity.command.sort': 'JavaRosa', 'entity.detail.title': 'JavaRosa', 'entity.find': 'JavaRosa', 'entity.nodata': 'JavaRosa', 'entity.nomatch': 'JavaRosa', 'entity.sort.title': 'JavaRosa', 'entity.title.layout': 'JavaRosa', 'es': 'JavaRosa', 'form.entry.badnum': 'JavaRosa', 'form.entry.badnum.dec': 'JavaRosa', 'form.entry.badnum.int': 'JavaRosa', 'form.entry.badnum.long': 'JavaRosa', 'form.entry.constraint.msg': 'JavaRosa', 'form.login.login': 'JavaRosa', 'form.login.password': 'JavaRosa', 'form.login.username': 'JavaRosa', 'form.user.confirmpassword': 'JavaRosa', 'form.user.fillinboth': 'JavaRosa', 'form.user.giveadmin': 'JavaRosa', 'form.user.name': 'JavaRosa', 'form.user.password': 'JavaRosa', 'form.user.userid': 'JavaRosa', 'formentry.invalid.input': 'JavaRosa', 'formview.repeat.addNew': 'JavaRosa', 'fra': 'JavaRosa', 'home.change.user': 'CommCareJava', 'home.data.restore': 'CommCareJava', 'home.demo.reset': 'CommCareJava', 'home.setttings': 'CommCareJava', 'home.updates': 'CommCareJava', 'home.user.edit': 'CommCareJava', 'home.user.new': 'CommCareJava', 'homescreen.title': 'CommCareJava', 'icon.demo.path': 'JavaRosa', 'icon.login.path': 'JavaRosa', 'id': 'CommCareJava', 'install.bad': 'CommCareJava', 'install.verify': 'CommCareJava', 'intro.restore': 'CommCareJava', 'intro.start': 'CommCareJava', 'intro.text': 'CommCareJava', 'intro.title': 'CommCareJava', 'loading.screen.message': 'JavaRosa', 'loading.screen.title': 'JavaRosa', 'locale.name.en': 'CommCareJava', 'locale.name.sw': 'CommCareJava', 'log.submit.full': 'JavaRosa', 'log.submit.never': 'JavaRosa', 'log.submit.next.daily': 'JavaRosa', 'log.submit.next.weekly': 'JavaRosa', 'log.submit.nigthly': 'JavaRosa', 'log.submit.short': 'JavaRosa', 'log.submit.url': 'JavaRosa', 'log.submit.weekly': 'JavaRosa', 'login.title': 'CommCareJava', 'menu.Back': 'JavaRosa', 'menu.Capture': 'JavaRosa', 'menu.Demo': 'JavaRosa', 'menu.Exit': 'JavaRosa', 'menu.Login': 'JavaRosa', 'menu.Next': 'JavaRosa', 'menu.ok': 'JavaRosa', 'menu.retry': 'JavaRosa', 'menu.Save': 'JavaRosa', 'menu.SaveAndExit': 'JavaRosa', 'menu.send.all': 'CommCareJava', 'menu.send.all.val': 'CommCareJava', 'menu.send.later': 'JavaRosa', 'menu.SendLater': 'JavaRosa', 'menu.SendNow': 'JavaRosa', 'menu.SendToNewServer': 'JavaRosa', 'menu.Settings': 'JavaRosa', 'menu.sync': 'CommCareJava', 'menu.sync.last': 'CommCareJava', 'menu.sync.prompt': 'CommCareJava', 'menu.sync.unsent.mult': 'CommCareJava', 'menu.sync.unsent.one': 'CommCareJava', 'menu.Tools': 'JavaRosa', 'menu.ViewAnswers': 'JavaRosa', 'message.delete': 'JavaRosa', 'message.details': 'JavaRosa', 'message.log': 'JavaRosa', 'message.permissions': 'CommCareJava', 'message.send.unsent': 'JavaRosa', 'message.timesync': 'CommCareJava', 'network.test.begin.image': 'CommCareJava', 'network.test.begin.message': 'CommCareJava', 'network.test.connected.image': 'CommCareJava', 'network.test.connected.message': 'CommCareJava', 'network.test.connecting.image': 'CommCareJava', 'network.test.connecting.message': 'CommCareJava', 'network.test.content.image': 'CommCareJava', 'network.test.content.message': 'CommCareJava', 'network.test.details': 'CommCareJava', 'network.test.details.title': 'CommCareJava', 'network.test.failed.image': 'CommCareJava', 'network.test.failed.message': 'CommCareJava', 'network.test.response.message': 'CommCareJava', 'network.test.title': 'CommCareJava', 'no': 'JavaRosa', 'node.select.filtering': 'CommCareJava', 'plussign': 'JavaRosa', 'polish.command.back': 'JavaRosa', 'polish.command.cancel': 'JavaRosa', 'polish.command.clear': 'JavaRosa', 'polish.command.delete': 'JavaRosa', 'polish.command.entersymbol': 'JavaRosa', 'polish.command.exit': 'JavaRosa', 'polish.command.followlink': 'JavaRosa', 'polish.command.hide': 'JavaRosa', 'polish.command.mark': 'JavaRosa', 'polish.command.ok': 'JavaRosa', 'polish.command.options': 'JavaRosa', 'polish.command.select': 'JavaRosa', 'polish.command.submit': 'JavaRosa', 'polish.command.unmark': 'JavaRosa', 'polish.date.select': 'CommCareJava', 'polish.date.select': 'JavaRosa', 'polish.rss.command.followlink': 'JavaRosa', 'polish.rss.command.select': 'JavaRosa', 'polish.TextField.charactersKey0': 'JavaRosa', 'polish.TextField.charactersKey1': 'JavaRosa', 'polish.TextField.charactersKey2': 'JavaRosa', 'polish.TextField.charactersKey3': 'JavaRosa', 'polish.TextField.charactersKey4': 'JavaRosa', 'polish.TextField.charactersKey5': 'JavaRosa', 'polish.TextField.charactersKey6': 'JavaRosa', 'polish.TextField.charactersKey7': 'JavaRosa', 'polish.TextField.charactersKey8': 'JavaRosa', 'polish.TextField.charactersKey9': 'JavaRosa', 'polish.title.input': 'JavaRosa', 'pt': 'JavaRosa', 'question.SendNow': 'JavaRosa', 'repeat.message.multiple': 'JavaRosa', 'repeat.message.single': 'JavaRosa', 'repeat.repitition': 'JavaRosa', 'restore.bad.db': 'CommCareJava', 'restore.badcredentials': 'CommCareJava', 'restore.baddownload': 'CommCareJava', 'restore.badserver': 'CommCareJava', 'restore.bypass.clean': 'CommCareJava', 'restore.bypass.clean.success': 'CommCareJava', 'restore.bypass.cleanfail': 'CommCareJava', 'restore.bypass.fail': 'CommCareJava', 'restore.bypass.instructions': 'CommCareJava', 'restore.bypass.start': 'CommCareJava', 'restore.db.busy': 'CommCareJava', 'restore.downloaded': 'CommCareJava', 'restore.fail': 'CommCareJava', 'restore.fail.credentials': 'CommCareJava', 'restore.fail.download': 'CommCareJava', 'restore.fail.message': 'CommCareJava', 'restore.fail.nointernet': 'CommCareJava', 'restore.fail.other': 'CommCareJava', 'restore.fail.retry': 'CommCareJava', 'restore.fail.technical': 'CommCareJava', 'restore.fail.transport': 'CommCareJava', 'restore.fail.view': 'CommCareJava', 'restore.fetch': 'CommCareJava', 'restore.finished': 'CommCareJava', 'restore.key.continue': 'CommCareJava', 'restore.login.instructions': 'CommCareJava', 'restore.message.connection.failed': 'CommCareJava', 'restore.message.connectionmade': 'CommCareJava', 'restore.message.startdownload': 'CommCareJava', 'restore.nocache': 'CommCareJava', 'restore.noserveruri': 'CommCareJava', 'restore.recover.fail': 'CommCareJava', 'restore.recover.needcache': 'CommCareJava', 'restore.recover.send': 'CommCareJava', 'restore.recovery.wipe': 'CommCareJava', 'restore.retry': 'CommCareJava', 'restore.starting': 'CommCareJava', 'restore.success': 'CommCareJava', 'restore.success.partial': 'CommCareJava', 'restore.ui.bounded': 'CommCareJava', 'restore.ui.unbounded': 'CommCareJava', 'restore.user.exists': 'CommCareJava', 'review.date': 'CommCareJava', 'review.title': 'CommCareJava', 'review.type': 'CommCareJava', 'review.type.unknown': 'CommCareJava', 'send.unsent.icon': 'CommCareJava', 'sending.message.send': 'JavaRosa', 'sending.status.didnotunderstand': 'CommCareJava', 'sending.status.error': 'JavaRosa', 'sending.status.failed': 'JavaRosa', 'sending.status.failures': 'JavaRosa', 'sending.status.going': 'JavaRosa', 'sending.status.long': 'JavaRosa', 'sending.status.multi': 'JavaRosa', 'sending.status.none': 'JavaRosa', 'sending.status.problem.datasafe': 'CommCareJava', 'sending.status.success': 'JavaRosa', 'sending.status.success': 'JavaRosa', 'sending.status.title': 'JavaRosa', 'sending.view.done': 'JavaRosa', 'sending.view.done.title': 'JavaRosa', 'sending.view.later': 'JavaRosa', 'sending.view.now': 'JavaRosa', 'sending.view.submit': 'JavaRosa', 'sending.view.when': 'JavaRosa', 'server.sync.icon.normal': 'CommCareJava', 'server.sync.icon.warn': 'CommCareJava', 'settings.language': 'JavaRosa', 'splashscreen': 'JavaRosa', 'sw': 'JavaRosa', 'sync.cancelled': 'CommCareJava', 'sync.cancelled.sending': 'CommCareJava', 'sync.done.closed': 'CommCareJava', 'sync.done.new': 'CommCareJava', 'sync.done.noupdate': 'CommCareJava', 'sync.done.updated': 'CommCareJava', 'sync.done.updates': 'CommCareJava', 'sync.pull.admin': 'CommCareJava', 'sync.pull.demo': 'CommCareJava', 'sync.pull.fail': 'CommCareJava', 'sync.send.fail': 'CommCareJava', 'sync.unsent.cancel': 'CommCareJava', 'update.fail.generic': 'CommCareJava', 'update.fail.network': 'CommCareJava', 'update.fail.network.retry': 'CommCareJava', 'update.header': 'CommCareJava', 'update.retrying': 'CommCareJava', 'user.create.header': 'JavaRosa', 'user.entity.admin': 'JavaRosa', 'user.entity.demo': 'JavaRosa', 'user.entity.name': 'JavaRosa', 'user.entity.normal': 'JavaRosa', 'user.entity.type': 'JavaRosa', 'user.entity.unknown': 'JavaRosa', 'user.entity.username': 'JavaRosa', 'user.registration.attempt': 'JavaRosa', 'user.registration.badresponse': 'JavaRosa', 'user.registration.failmessage': 'JavaRosa', 'user.registration.success': 'JavaRosa', 'user.registration.title': 'JavaRosa', 'validation.start': 'CommCareJava', 'validation.success': 'CommCareJava', 'video.playback.bottom': 'JavaRosa', 'video.playback.hashkey.path': 'JavaRosa', 'video.playback.top': 'JavaRosa', 'view.sending.RequiredQuestion': 'JavaRosa', 'xpath.fail.runtime': 'CommCareJava', 'yes': 'JavaRosa', 'zh': 'JavaRosa'}
class Solution: def hasPathSum(self, root: Optional[TreeNode], targetSum: int) -> bool: if root is None: return False targetSum -= root.val if targetSum == 0: if (root.left is None) and (root.right is None): return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum(root.right, targetSum)
class Solution: def has_path_sum(self, root: Optional[TreeNode], targetSum: int) -> bool: if root is None: return False target_sum -= root.val if targetSum == 0: if root.left is None and root.right is None: return True return self.hasPathSum(root.left, targetSum) or self.hasPathSum(root.right, targetSum)
# -*- coding: utf-8 -*- # @Author: jpch89 # @Email: jpch89@outlook.com # @Date: 2018-06-27 23:59:30 # @Last Modified by: jpch89 # @Last Modified time: 2018-06-28 00:02:38 formatter = '{} {} {} {}' print(formatter.format(1, 2, 3, 4)) print(formatter.format("one", "two", "three", "four")) print(formatter.format(True, False, False, True)) print(formatter.format(formatter, formatter, formatter, formatter)) print(formatter.format( "Try your", "Own text here", "Maybe a peom", "Or a song about fear" ))
formatter = '{} {} {} {}' print(formatter.format(1, 2, 3, 4)) print(formatter.format('one', 'two', 'three', 'four')) print(formatter.format(True, False, False, True)) print(formatter.format(formatter, formatter, formatter, formatter)) print(formatter.format('Try your', 'Own text here', 'Maybe a peom', 'Or a song about fear'))
'''2. Write a Python program to compute the similarity between two lists. Sample data: ["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"] Expected Output: Color1-Color2: ['white', 'orange', 'red'] Color2-Color1: ['black', 'yellow'] ''' def find_similiarity(list1, list2): list3 = list(set(list1) - set(list2)) list4 = list(set(list2) - set(list1)) return list3, list4 print(find_similiarity(["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"]))
"""2. Write a Python program to compute the similarity between two lists. Sample data: ["red", "orange", "green", "blue", "white"], ["black", "yellow", "green", "blue"] Expected Output: Color1-Color2: ['white', 'orange', 'red'] Color2-Color1: ['black', 'yellow'] """ def find_similiarity(list1, list2): list3 = list(set(list1) - set(list2)) list4 = list(set(list2) - set(list1)) return (list3, list4) print(find_similiarity(['red', 'orange', 'green', 'blue', 'white'], ['black', 'yellow', 'green', 'blue']))
def get_client_ip(request): client_ip = request.META.get('REMOTE_ADDR', '') return client_ip
def get_client_ip(request): client_ip = request.META.get('REMOTE_ADDR', '') return client_ip
url = "https://customerportal.supermicro.com/Customer/ContentPages/CustOrders.aspx" orderType = "//select[@id='ContentPlaceHolder1_ddlSearchType']" fromDate = "//input[@id='ContentPlaceHolder1_txtFrom']" customerId = "//select[@id='ContentPlaceHolder1_ddlCustomerID']" searchIcon = "//a[@id='linkSearch']" orderTable = "//table[contains(@id,'ContentPlaceHolder1')]" pageCount = "(//tr[@class='gridPager']/td/table/tbody/tr/td)" selectPage = "(//tr[@class='gridPager']/td/table/tbody/tr/td)[{}]" soldToAddress = "//td[@class='InfoCell AddressCell ']/div/div/div[{}]" shipToAddress = "//td[@class='InfoCell AddressCell']/div/div/div[{}]" esd = "//td[@class='InfoCell ETACell']" message = "//td[@class='InfoCell CommentsCell']" orderItem = "//div[contains(@id,'panelOrdItemList')]/div/a" orderItemHeaders = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th" orderItemRows = "//table[contains(@id,'gvOrdDetails')]/tbody/tr" orderItemRowsValue = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[{}]/td[{}]" orderItemHeadersValue = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th[{}]" closeOrderTableRowCount = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr" closeOrderSalesOrder = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[1]" closeOrderOrderData = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[2]" closeOrderCustomerPO = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[3]" closeOrderAssemblyType = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[4]" closeOrderOrderDetailsButton = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[6]/a" closeOrderOrderStatus = "//table[@id='ContentPlaceHolder1_ClosedOrdInfo_gvOrdHeader']//tr[2]/td[6]" openOrderTableRowCount = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr" openOrderSoldToId = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[1]" openOrderSalesOrder = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[2]" openOrderCustomerPO = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[3]" openOrderShipToParty = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[4]" openOrderShipToCountry = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[5]/div" openOrderCreatedTime = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[6]" openOrderOrderDetailsButton = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[7]/a" openOrderAssemblyType = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[2]" openOrderOrderStatus = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[6]"
url = 'https://customerportal.supermicro.com/Customer/ContentPages/CustOrders.aspx' order_type = "//select[@id='ContentPlaceHolder1_ddlSearchType']" from_date = "//input[@id='ContentPlaceHolder1_txtFrom']" customer_id = "//select[@id='ContentPlaceHolder1_ddlCustomerID']" search_icon = "//a[@id='linkSearch']" order_table = "//table[contains(@id,'ContentPlaceHolder1')]" page_count = "(//tr[@class='gridPager']/td/table/tbody/tr/td)" select_page = "(//tr[@class='gridPager']/td/table/tbody/tr/td)[{}]" sold_to_address = "//td[@class='InfoCell AddressCell ']/div/div/div[{}]" ship_to_address = "//td[@class='InfoCell AddressCell']/div/div/div[{}]" esd = "//td[@class='InfoCell ETACell']" message = "//td[@class='InfoCell CommentsCell']" order_item = "//div[contains(@id,'panelOrdItemList')]/div/a" order_item_headers = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th" order_item_rows = "//table[contains(@id,'gvOrdDetails')]/tbody/tr" order_item_rows_value = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[{}]/td[{}]" order_item_headers_value = "//table[contains(@id,'gvOrdDetails')]/tbody/tr[1]/th[{}]" close_order_table_row_count = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr" close_order_sales_order = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[1]" close_order_order_data = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[2]" close_order_customer_po = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[3]" close_order_assembly_type = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[4]" close_order_order_details_button = "//table[@id='ContentPlaceHolder1_gvCloseOrd']/tbody//tr[{}]/td[6]/a" close_order_order_status = "//table[@id='ContentPlaceHolder1_ClosedOrdInfo_gvOrdHeader']//tr[2]/td[6]" open_order_table_row_count = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr" open_order_sold_to_id = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[1]" open_order_sales_order = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[2]" open_order_customer_po = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[3]" open_order_ship_to_party = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[4]" open_order_ship_to_country = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[5]/div" open_order_created_time = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[6]" open_order_order_details_button = "//table[@id='ContentPlaceHolder1_gvOpenOrd']/tbody//tr[{}]/td[7]/a" open_order_assembly_type = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[2]" open_order_order_status = "//table[@id='ContentPlaceHolder1_gvOrdHeader']/tbody//tr[2]/td[6]"
class Solution: def corpFlightBookings(self, bookings: List[List[int]], n: int) -> List[int]: dp = [0]*n for i,j,k in bookings: dp[i-1]+=k if j!=n: dp[j]-=k for i in range(1,n): dp[i]+=dp[i-1] return dp
class Solution: def corp_flight_bookings(self, bookings: List[List[int]], n: int) -> List[int]: dp = [0] * n for (i, j, k) in bookings: dp[i - 1] += k if j != n: dp[j] -= k for i in range(1, n): dp[i] += dp[i - 1] return dp
def buildFibonacciSequence(items): actual = 0 next = 1 sequence = [] for index in range(items): sequence.append(actual) actual, next = next, actual+next return sequence
def build_fibonacci_sequence(items): actual = 0 next = 1 sequence = [] for index in range(items): sequence.append(actual) (actual, next) = (next, actual + next) return sequence
""" Given two strings str1 and str2 of the same length, determine whether you can transform str1 into str2 by doing zero or more conversions. In one conversion you can convert all occurrences of one character in str1 to any other lowercase English character. Return true if and only if you can transform str1 into str2. Example 1: Input: str1 = "aabcc", str2 = "ccdee" Output: true Explanation: Convert 'c' to 'e' then 'b' to 'd' then 'a' to 'c'. Note that the order of conversions matter. Example 2: Input: str1 = "leetcode", str2 = "codeleet" Output: false Explanation: There is no way to transform str1 to str2. Constraints: 1 <= str1.length == str2.length <= 104 str1 and str2 contain only lowercase English letters. """ class Solution: """ Runtime: 32 ms, faster than 50.63% of Python3 Memory Usage: 14.4 MB, less than 58.68% of Python3 Time/Space complexity: O(n) """ def canConvert(self, str1: str, str2: str) -> bool: if str1 == str2: return True conv_tbl = dict() # conversion table for i in range(len(str1)): if str1[i] not in conv_tbl: conv_tbl[str1[i]] = str2[i] else: if str2[i] != conv_tbl[str1[i]]: return False return len(set(str2)) < 26 # if all 26 characters are represented, there are no characters available to use # for temporary conversions, and the transformation is impossible. The only exception to this is if str1 is # equal to str2, so we handle this case at the start of the function. if __name__ == '__main__': solutions = [Solution()] tc = ( ("aabcc", "ccdee", True), ("leetcode", "codeleet", False), ("abcdefghijklmnopqrstuvwxyz", "bcadefghijklmnopqrstuvwxzz", True), ("abcdefghijklmnopqrstuvwxyz", "bcdefghijklmnopqrstuvwxyza", False), ) for sol in solutions: for inp_s1, inp_s2, expected_res in tc: assert sol.canConvert(inp_s1, inp_s2) is expected_res, f"{sol.__class__.__name__}"
""" Given two strings str1 and str2 of the same length, determine whether you can transform str1 into str2 by doing zero or more conversions. In one conversion you can convert all occurrences of one character in str1 to any other lowercase English character. Return true if and only if you can transform str1 into str2. Example 1: Input: str1 = "aabcc", str2 = "ccdee" Output: true Explanation: Convert 'c' to 'e' then 'b' to 'd' then 'a' to 'c'. Note that the order of conversions matter. Example 2: Input: str1 = "leetcode", str2 = "codeleet" Output: false Explanation: There is no way to transform str1 to str2. Constraints: 1 <= str1.length == str2.length <= 104 str1 and str2 contain only lowercase English letters. """ class Solution: """ Runtime: 32 ms, faster than 50.63% of Python3 Memory Usage: 14.4 MB, less than 58.68% of Python3 Time/Space complexity: O(n) """ def can_convert(self, str1: str, str2: str) -> bool: if str1 == str2: return True conv_tbl = dict() for i in range(len(str1)): if str1[i] not in conv_tbl: conv_tbl[str1[i]] = str2[i] elif str2[i] != conv_tbl[str1[i]]: return False return len(set(str2)) < 26 if __name__ == '__main__': solutions = [solution()] tc = (('aabcc', 'ccdee', True), ('leetcode', 'codeleet', False), ('abcdefghijklmnopqrstuvwxyz', 'bcadefghijklmnopqrstuvwxzz', True), ('abcdefghijklmnopqrstuvwxyz', 'bcdefghijklmnopqrstuvwxyza', False)) for sol in solutions: for (inp_s1, inp_s2, expected_res) in tc: assert sol.canConvert(inp_s1, inp_s2) is expected_res, f'{sol.__class__.__name__}'
class Animation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index = (self.index + 1) % len(self.sprites) return self.sprites[self.index] class OneTimeAnimation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 self.dead = False def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): if self.dead: return None self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index += 1 if self.index >= len(self.sprites) - 1: self.dead = True return self.sprites[self.index] class ConditionalAnimation: def __init__(self, sprites, condition): self.sprites = sprites self.condition = condition def update(self, argument): return self.sprites[self.condition(argument)]
class Animation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index = (self.index + 1) % len(self.sprites) return self.sprites[self.index] class Onetimeanimation: def __init__(self, sprites, time_interval): self.sprites = tuple(sprites) self.time_interval = time_interval self.index = 0 self.time = 0 self.dead = False def restart_at(self, index): self.time = 0 self.index = index % len(self.sprites) def update(self, dt): if self.dead: return None self.time += dt if self.time >= self.time_interval: self.time = self.time - self.time_interval self.index += 1 if self.index >= len(self.sprites) - 1: self.dead = True return self.sprites[self.index] class Conditionalanimation: def __init__(self, sprites, condition): self.sprites = sprites self.condition = condition def update(self, argument): return self.sprites[self.condition(argument)]
NoOfLines=int(input()) for Row in range(0,NoOfLines): for Column in range(0,NoOfLines): if(Row%2==0 and Column+1==NoOfLines)or(Row%2==1 and Column==0): print("%2d"%(Row+2),end=" ") else: print("%2d"%(Row+1),end=" ") else: print(end="\n") #second code NoOfLines=int(input()) for Row in range(1,NoOfLines+1): for Column in range(1,NoOfLines+1): if(Row%2==1 and Column==NoOfLines)or(Row%2==0 and Column==1): print("%2d"%(Row+1),end=" ") else: print("%2d"%(Row),end=" ") else: print(end="\n")
no_of_lines = int(input()) for row in range(0, NoOfLines): for column in range(0, NoOfLines): if Row % 2 == 0 and Column + 1 == NoOfLines or (Row % 2 == 1 and Column == 0): print('%2d' % (Row + 2), end=' ') else: print('%2d' % (Row + 1), end=' ') else: print(end='\n') no_of_lines = int(input()) for row in range(1, NoOfLines + 1): for column in range(1, NoOfLines + 1): if Row % 2 == 1 and Column == NoOfLines or (Row % 2 == 0 and Column == 1): print('%2d' % (Row + 1), end=' ') else: print('%2d' % Row, end=' ') else: print(end='\n')
# Module: FeatureEngineering # Author: Adrian Antico <adrianantico@gmail.com> # License: MIT # Release: retrofit 0.1.7 # Last modified : 2021-09-21 class FeatureEngineering: """ Base class that the library specific classes inherit from. """ def __init__(self) -> None: self.lag_args = {} self.roll_args = {} self.diff_args = {} self.calendar_args = {} self.dummy_args = {} self.model_data_prep_args = {} self.partition_args = {} self._last_lag_args = {} self._last_roll_args = {} self._last_diff_args = {} self._last_calendar_args = {} self._last_dummy_args = {} self._last_partition_args = {} self._last_model_data_prep_args = {} def save_args(self) -> None: self.lag_args = self._last_lag_args self.roll_args = self._last_roll_args self.diff_args = self._last_diff_args self.calendar_args = self._last_calendar_args self.dummy_args = self._last_dummy_args self.model_data_prep_args = self._last_model_data_prep_args self.partition_args = self._last_partition_args def FE0_AutoLags( self, data=None, LagColumnNames=None, DateColumnName=None, ByVariables=None, LagPeriods=1, ImputeValue=-1, Sort=True, use_saved_args=False, ): raise NotImplementedError def FE0_AutoRollStats( data=None, ArgsList=None, RollColumnNames=None, DateColumnName=None, ByVariables=None, MovingAvg_Periods=None, MovingSD_Periods=None, MovingMin_Periods=None, MovingMax_Periods=None, ImputeValue=-1, Sort=True, use_saved_args=False, ): raise NotImplementedError def FE0_AutoDiff( data=None, ArgsList=None, DateColumnName=None, ByVariables=None, DiffNumericVariables=None, DiffDateVariables=None, DiffGroupVariables=None, NLag1=0, NLag2=1, Sort=True, use_saved_args=False, ): raise NotImplementedError def FE1_AutoCalendarVariables( data=None, ArgsList=None, DateColumnNames=None, CalendarVariables=None, use_saved_args=False ): raise NotImplementedError def FE1_DummyVariables( data=None, ArgsList=None, CategoricalColumnNames=None, use_saved_args=False ): raise NotImplementedError def FE2_ColTypeConversions( self, data=None, Int2Float=False, Bool2Float=False, RemoveDateCols=False, RemoveStrCols=False, SkipCols=None, use_saved_args=False ): raise NotImplementedError def FE2_AutoDataPartition( data = None, ArgsList = None, DateColumnName = None, PartitionType = 'random', Ratios = None, ByVariables = None, Sort = False, use_saved_args = False ): raise NotImplementedError
class Featureengineering: """ Base class that the library specific classes inherit from. """ def __init__(self) -> None: self.lag_args = {} self.roll_args = {} self.diff_args = {} self.calendar_args = {} self.dummy_args = {} self.model_data_prep_args = {} self.partition_args = {} self._last_lag_args = {} self._last_roll_args = {} self._last_diff_args = {} self._last_calendar_args = {} self._last_dummy_args = {} self._last_partition_args = {} self._last_model_data_prep_args = {} def save_args(self) -> None: self.lag_args = self._last_lag_args self.roll_args = self._last_roll_args self.diff_args = self._last_diff_args self.calendar_args = self._last_calendar_args self.dummy_args = self._last_dummy_args self.model_data_prep_args = self._last_model_data_prep_args self.partition_args = self._last_partition_args def fe0__auto_lags(self, data=None, LagColumnNames=None, DateColumnName=None, ByVariables=None, LagPeriods=1, ImputeValue=-1, Sort=True, use_saved_args=False): raise NotImplementedError def fe0__auto_roll_stats(data=None, ArgsList=None, RollColumnNames=None, DateColumnName=None, ByVariables=None, MovingAvg_Periods=None, MovingSD_Periods=None, MovingMin_Periods=None, MovingMax_Periods=None, ImputeValue=-1, Sort=True, use_saved_args=False): raise NotImplementedError def fe0__auto_diff(data=None, ArgsList=None, DateColumnName=None, ByVariables=None, DiffNumericVariables=None, DiffDateVariables=None, DiffGroupVariables=None, NLag1=0, NLag2=1, Sort=True, use_saved_args=False): raise NotImplementedError def fe1__auto_calendar_variables(data=None, ArgsList=None, DateColumnNames=None, CalendarVariables=None, use_saved_args=False): raise NotImplementedError def fe1__dummy_variables(data=None, ArgsList=None, CategoricalColumnNames=None, use_saved_args=False): raise NotImplementedError def fe2__col_type_conversions(self, data=None, Int2Float=False, Bool2Float=False, RemoveDateCols=False, RemoveStrCols=False, SkipCols=None, use_saved_args=False): raise NotImplementedError def fe2__auto_data_partition(data=None, ArgsList=None, DateColumnName=None, PartitionType='random', Ratios=None, ByVariables=None, Sort=False, use_saved_args=False): raise NotImplementedError
# --------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # --------------------------------------------------------- def get_workspace_dependent_resource_location(location): if location == "centraluseuap": return "eastus" return location
def get_workspace_dependent_resource_location(location): if location == 'centraluseuap': return 'eastus' return location
# 1.5 One Away # There are three types of edits that can be performed on strings: # insert a character, remove a character, or replace a character. # Given two strings, write a function to check if they are one edit (or zero edits) away. def one_away(string_1, string_2): if string_1 == string_2: return True # Check if inserting a character creates equality if one_insert_away(string_1, string_2): return True # Check if removing a character creates equality if one_removal_away(string_1, string_2): return True # Check if replaceing a character creates equality if one_replacement_away(string_1, string_2): return True return False def one_insert_away(string_1, string_2): if (len(string_1) + 1) != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_1)): if string_1[index_1] != string_2[index_2]: index_2 += 1 if index_2 - index_1 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_removal_away(string_1, string_2): if (len(string_1) - 1) != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_2)): if string_1[index_1] != string_2[index_2]: index_1 += 1 if index_1 - index_2 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_replacement_away(string_1, string_2): if len(string_1) != len(string_2): return False replaced = False for i in range(len(string_2)): if string_1[i] != string_2[i]: if replaced: return False replaced = True return True print(one_away('hello', 'hello')) # True print(one_away('hell', 'hello')) # True print(one_away('hello', 'hell')) # True print(one_away('hello', 'heldo')) # True print(one_away('h', 'hello')) # False
def one_away(string_1, string_2): if string_1 == string_2: return True if one_insert_away(string_1, string_2): return True if one_removal_away(string_1, string_2): return True if one_replacement_away(string_1, string_2): return True return False def one_insert_away(string_1, string_2): if len(string_1) + 1 != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_1)): if string_1[index_1] != string_2[index_2]: index_2 += 1 if index_2 - index_1 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_removal_away(string_1, string_2): if len(string_1) - 1 != len(string_2): return False index_1 = 0 index_2 = 0 for i in range(len(string_2)): if string_1[index_1] != string_2[index_2]: index_1 += 1 if index_1 - index_2 > 1: return False else: index_1 += 1 index_2 += 1 return True def one_replacement_away(string_1, string_2): if len(string_1) != len(string_2): return False replaced = False for i in range(len(string_2)): if string_1[i] != string_2[i]: if replaced: return False replaced = True return True print(one_away('hello', 'hello')) print(one_away('hell', 'hello')) print(one_away('hello', 'hell')) print(one_away('hello', 'heldo')) print(one_away('h', 'hello'))
def permune(orignal, chosen): if not orignal: print(chosen) else: for i in range(len(orignal)): c=orignal[i] chosen+=c lt=list(orignal) lt.pop(i) orignal=''.join(lt) permune(orignal,chosen) orignal=orignal[:i]+c+orignal[i:] chosen=chosen[:len(chosen)-1] permune('lit','')
def permune(orignal, chosen): if not orignal: print(chosen) else: for i in range(len(orignal)): c = orignal[i] chosen += c lt = list(orignal) lt.pop(i) orignal = ''.join(lt) permune(orignal, chosen) orignal = orignal[:i] + c + orignal[i:] chosen = chosen[:len(chosen) - 1] permune('lit', '')
entity_id = 'sensor.next_train_to_wim' attributes = hass.states.get(entity_id).attributes my_early_train_current_status = hass.states.get('sensor.my_early_train').state scheduled = False # Check if train scheduled for train in attributes['next_trains']: if train['scheduled'] == '07:15': scheduled = True if train['status'] != my_early_train_current_status: hass.states.set('sensor.my_early_train', train['status']) if not scheduled: hass.states.set('sensor.my_early_train', 'No data') # check no data
entity_id = 'sensor.next_train_to_wim' attributes = hass.states.get(entity_id).attributes my_early_train_current_status = hass.states.get('sensor.my_early_train').state scheduled = False for train in attributes['next_trains']: if train['scheduled'] == '07:15': scheduled = True if train['status'] != my_early_train_current_status: hass.states.set('sensor.my_early_train', train['status']) if not scheduled: hass.states.set('sensor.my_early_train', 'No data')
# ------------------------------ # 300. Longest Increasing Subsequence # # Description: # Given an unsorted array of integers, find the length of longest increasing subsequence. # # Example: # Input: [10,9,2,5,3,7,101,18] # Output: 4 # Explanation: The longest increasing subsequence is [2,3,7,101], therefore the length is 4. # # Note: # There may be more than one LIS combination, it is only necessary for you to return the length. # Your algorithm should run in O(n2) complexity. # Follow up: Could you improve it to O(n log n) time complexity? # # Version: 1.0 # 12/15/18 by Jianfa # ------------------------------ class Solution: def lengthOfLIS(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 dp = [1] maxLen = 1 for i in range(1, len(nums)): maxval = 0 # max length between dp[0:i] (i excluded) for j in range(0, i): if nums[i] > nums[j]: maxval = max(maxval, dp[j]) dp.append(maxval+1) maxLen = max(maxLen, dp[i]) return maxLen # Used for testing if __name__ == "__main__": test = Solution() # ------------------------------ # Summary: # Dynamic Programming solution from Solution section.
class Solution: def length_of_lis(self, nums): """ :type nums: List[int] :rtype: int """ if not nums: return 0 dp = [1] max_len = 1 for i in range(1, len(nums)): maxval = 0 for j in range(0, i): if nums[i] > nums[j]: maxval = max(maxval, dp[j]) dp.append(maxval + 1) max_len = max(maxLen, dp[i]) return maxLen if __name__ == '__main__': test = solution()
class Node: def __init__(self,key=None,val=None,nxt=None,prev=None): self.key = key self.val = val self.nxt = nxt self.prev = prev class DLL: def __init__(self): self.head = Node() self.tail = Node() self.head.nxt = self.tail self.tail.prev = self.head def pop(self): return self.delete(self.tail.prev) def delete(self,node): node.prev.nxt = node.nxt node.nxt.prev = node.prev return node def appendleft(self,node): node.nxt = self.head.nxt node.prev = self.head self.head.nxt.prev = node self.head.nxt = node return node class LRUCache: def __init__(self, capacity): self.maps = dict() self.dll = DLL() self.capacity = capacity def get(self, key): if key not in self.maps: return -1 self.dll.appendleft(self.dll.delete(self.maps[key])) return self.maps[key].val def set(self, key, val): if key not in self.maps: if len(self.maps) == self.capacity: self.maps.pop(self.dll.pop().key) self.maps[key] = self.dll.appendleft(Node(key,val)) else: self.get(key) self.maps[key].val = val
class Node: def __init__(self, key=None, val=None, nxt=None, prev=None): self.key = key self.val = val self.nxt = nxt self.prev = prev class Dll: def __init__(self): self.head = node() self.tail = node() self.head.nxt = self.tail self.tail.prev = self.head def pop(self): return self.delete(self.tail.prev) def delete(self, node): node.prev.nxt = node.nxt node.nxt.prev = node.prev return node def appendleft(self, node): node.nxt = self.head.nxt node.prev = self.head self.head.nxt.prev = node self.head.nxt = node return node class Lrucache: def __init__(self, capacity): self.maps = dict() self.dll = dll() self.capacity = capacity def get(self, key): if key not in self.maps: return -1 self.dll.appendleft(self.dll.delete(self.maps[key])) return self.maps[key].val def set(self, key, val): if key not in self.maps: if len(self.maps) == self.capacity: self.maps.pop(self.dll.pop().key) self.maps[key] = self.dll.appendleft(node(key, val)) else: self.get(key) self.maps[key].val = val
class Command(object): def get_option(self, name): pass def run(self, ): raise NotImplementedError
class Command(object): def get_option(self, name): pass def run(self): raise NotImplementedError
a, b, c, d = map(int, input().split()) if a+b > c+d: print("Left") elif a+b < c+d: print("Right") else: print("Balanced")
(a, b, c, d) = map(int, input().split()) if a + b > c + d: print('Left') elif a + b < c + d: print('Right') else: print('Balanced')
# pyre-ignore-all-errors # TODO: Change `pyre-ignore-all-errors` to `pyre-strict` on line 1, so we get # to see all type errors in this file. # A (hypothetical) Python developer is having trouble with a typing-related # issue. Here is what the code looks like: class ConfigA: pass class ConfigB: some_attribute: int = 1 class HelperBase: def __init__(self, config: ConfigA | ConfigB) -> None: self.config = config def common_fn(self) -> None: pass class HelperA(HelperBase): def __init__(self, config: ConfigA) -> None: super().__init__(config) class HelperB(HelperBase): def __init__(self, config: ConfigB) -> None: super().__init__(config) def some_fn(self) -> int: return self.config.some_attribute # The developer is confused about why Pyre reports a type error on `HelperB.some_fn`. # Question: Is the reported type error a false positive or not? # Question: How would you suggest changing the code to avoid the type error? # Question: Is it a good idea to have `HelperA` and `HelperB` share the same base class?
class Configa: pass class Configb: some_attribute: int = 1 class Helperbase: def __init__(self, config: ConfigA | ConfigB) -> None: self.config = config def common_fn(self) -> None: pass class Helpera(HelperBase): def __init__(self, config: ConfigA) -> None: super().__init__(config) class Helperb(HelperBase): def __init__(self, config: ConfigB) -> None: super().__init__(config) def some_fn(self) -> int: return self.config.some_attribute
""" Euclid's algorithm """ def modinv(a0, n0): """ Modular inverse algorithm """ (a, b) = (a0, n0) (aa, ba) = (1, 0) while True: q = a // b if a == (b * q): if b != 1: print("modinv({}, {}) = fail".format(a0, n0)) return -1 else: if(ba < 0): ba += n0 print("modinv({}, {}) = {}".format(a0, n0, ba)) return ba (a, b) = (b, a - (b * q)) (aa, ba) = (ba, aa - (q * ba)) def main(): """ The main method """ modinv(806515533049393, 1304969544928657) modinv(4505490,7290036) modinv(892302390667940581330701, 1208925819614629174706111) if __name__ == "__main__": main()
""" Euclid's algorithm """ def modinv(a0, n0): """ Modular inverse algorithm """ (a, b) = (a0, n0) (aa, ba) = (1, 0) while True: q = a // b if a == b * q: if b != 1: print('modinv({}, {}) = fail'.format(a0, n0)) return -1 else: if ba < 0: ba += n0 print('modinv({}, {}) = {}'.format(a0, n0, ba)) return ba (a, b) = (b, a - b * q) (aa, ba) = (ba, aa - q * ba) def main(): """ The main method """ modinv(806515533049393, 1304969544928657) modinv(4505490, 7290036) modinv(892302390667940581330701, 1208925819614629174706111) if __name__ == '__main__': main()
# # PySNMP MIB module CISCO-LWAPP-LOCAL-AUTH-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-LWAPP-LOCAL-AUTH-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:48:42 2019 # On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4 # Using Python version 3.7.3 (default, Mar 27 2019, 09:23:15) # ObjectIdentifier, Integer, OctetString = mibBuilder.importSymbols("ASN1", "ObjectIdentifier", "Integer", "OctetString") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueSizeConstraint, ValueRangeConstraint, ConstraintsUnion, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueSizeConstraint", "ValueRangeConstraint", "ConstraintsUnion", "ConstraintsIntersection", "SingleValueConstraint") cLWlanIndex, = mibBuilder.importSymbols("CISCO-LWAPP-WLAN-MIB", "cLWlanIndex") ciscoMgmt, = mibBuilder.importSymbols("CISCO-SMI", "ciscoMgmt") ObjectGroup, ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "ModuleCompliance", "NotificationGroup") TimeTicks, IpAddress, Gauge32, iso, MibIdentifier, ObjectIdentity, Integer32, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, Bits, Unsigned32, Counter32, NotificationType, Counter64 = mibBuilder.importSymbols("SNMPv2-SMI", "TimeTicks", "IpAddress", "Gauge32", "iso", "MibIdentifier", "ObjectIdentity", "Integer32", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "Bits", "Unsigned32", "Counter32", "NotificationType", "Counter64") TextualConvention, DisplayString, RowStatus, TruthValue = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString", "RowStatus", "TruthValue") ciscoLwappLocalAuthMIB = ModuleIdentity((1, 3, 6, 1, 4, 1, 9, 9, 619)) ciscoLwappLocalAuthMIB.setRevisions(('2010-02-09 00:00', '2009-11-24 00:00', '2007-03-15 00:00',)) if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setLastUpdated('201002090000Z') if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setOrganization('Cisco Systems Inc.') ciscoLwappLocalAuthMIBNotifs = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 0)) ciscoLwappLocalAuthMIBObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1)) ciscoLwappLocalAuthMIBConform = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2)) cllaConfig = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1)) cllaLocalAuth = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1)) cllaActiveTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 1), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaActiveTimeout.setStatus('current') cllaEapIdentityReqTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 2), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapIdentityReqTimeout.setStatus('current') cllaEapIdentityReqMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 3), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapIdentityReqMaxRetries.setStatus('current') cllaEapDynamicWepKeyIndex = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 4), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 3))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapDynamicWepKeyIndex.setStatus('current') cllaEapReqTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 5), Unsigned32()).setUnits('seconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapReqTimeout.setStatus('current') cllaEapReqMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 6), Unsigned32()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapReqMaxRetries.setStatus('current') cllaEapMaxLoginIgnIdResp = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 7), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapMaxLoginIgnIdResp.setStatus('current') cllaEapKeyTimeout = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 8), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(200, 5000)).clone(1000)).setUnits('milliseconds').setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapKeyTimeout.setStatus('current') cllaEapKeyMaxRetries = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 9), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 4)).clone(2)).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapKeyMaxRetries.setStatus('current') cllaEapProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2), ) if mibBuilder.loadTexts: cllaEapProfileTable.setStatus('current') cllaEapProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1), ).setIndexNames((0, "CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileName")) if mibBuilder.loadTexts: cllaEapProfileEntry.setStatus('current') cllaEapProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))) if mibBuilder.loadTexts: cllaEapProfileName.setStatus('current') cllaEapProfileMethods = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 2), Bits().clone(namedValues=NamedValues(("none", 0), ("leap", 1), ("eapFast", 2), ("tls", 3), ("peap", 4)))).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileMethods.setStatus('current') cllaEapProfileCertIssuer = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 3), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("cisco", 1), ("vendor", 2))).clone('cisco')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileCertIssuer.setStatus('current') cllaEapProfileCaCertificationCheck = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 4), TruthValue().clone('true')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileCaCertificationCheck.setStatus('current') cllaEapProfileCnCertificationIdVerify = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 5), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileCnCertificationIdVerify.setStatus('current') cllaEapProfileDateValidityEnabled = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 6), TruthValue().clone('true')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileDateValidityEnabled.setStatus('current') cllaEapProfileLocalCertificateRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 7), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileLocalCertificateRequired.setStatus('current') cllaEapProfileClientCertificateRequired = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 8), TruthValue().clone('false')).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileClientCertificateRequired.setStatus('current') cllaEapProfileRowStatus = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 9), RowStatus()).setMaxAccess("readcreate") if mibBuilder.loadTexts: cllaEapProfileRowStatus.setStatus('current') cllaWlanProfileTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3), ) if mibBuilder.loadTexts: cllaWlanProfileTable.setStatus('current') cllaWlanProfileEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1), ).setIndexNames((0, "CISCO-LWAPP-WLAN-MIB", "cLWlanIndex")) if mibBuilder.loadTexts: cllaWlanProfileEntry.setStatus('current') cllaWlanProfileName = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 1), DisplayString().subtype(subtypeSpec=ValueSizeConstraint(0, 63))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaWlanProfileName.setStatus('current') cllaWlanProfileState = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 2), TruthValue()).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaWlanProfileState.setStatus('current') cllaUserPriorityTable = MibTable((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4), ) if mibBuilder.loadTexts: cllaUserPriorityTable.setStatus('current') cllaUserPriorityEntry = MibTableRow((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1), ).setIndexNames((0, "CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserCredential")) if mibBuilder.loadTexts: cllaUserPriorityEntry.setStatus('current') cllaUserCredential = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 1), Integer32().subtype(subtypeSpec=ConstraintsUnion(SingleValueConstraint(1, 2))).clone(namedValues=NamedValues(("local", 1), ("ldap", 2)))) if mibBuilder.loadTexts: cllaUserCredential.setStatus('current') cllaUserPriorityNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 2), Integer32().subtype(subtypeSpec=ValueRangeConstraint(0, 2))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaUserPriorityNumber.setStatus('current') cllaEapParams = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5)) cllaEapMethodPacTtl = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 1), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(1, 1000)).clone(10)).setUnits('days').setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapMethodPacTtl.setStatus('current') cllaEapAnonymousProvEnabled = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 2), TruthValue().clone('true')).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapAnonymousProvEnabled.setStatus('current') cllaEapAuthorityId = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 3), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 128))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapAuthorityId.setStatus('current') cllaEapAuthorityInfo = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 4), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapAuthorityInfo.setStatus('current') cllaEapServerKey = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 5), OctetString().subtype(subtypeSpec=ValueSizeConstraint(1, 32))).setMaxAccess("readwrite") if mibBuilder.loadTexts: cllaEapServerKey.setStatus('current') cllaEapAuthorityIdLength = MibScalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 6), Unsigned32().subtype(subtypeSpec=ValueRangeConstraint(0, 128)).clone(32)).setMaxAccess("readonly") if mibBuilder.loadTexts: cllaEapAuthorityIdLength.setStatus('current') ciscoLwappLocalAuthMIBCompliances = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1)) ciscoLwappLocalAuthMIBGroups = MibIdentifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2)) ciscoLwappLocalAuthMIBCompliance = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 1)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "ciscoLwappLocalAuthMIBConfigGroup")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoLwappLocalAuthMIBCompliance = ciscoLwappLocalAuthMIBCompliance.setStatus('deprecated') ciscoLwappLocalAuthMIBComplianceRev1 = ModuleCompliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 2)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "ciscoLwappLocalAuthMIBConfigGroupSup1")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoLwappLocalAuthMIBComplianceRev1 = ciscoLwappLocalAuthMIBComplianceRev1.setStatus('current') ciscoLwappLocalAuthMIBConfigGroup = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 1)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaActiveTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileMethods"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCertIssuer"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCaCertificationCheck"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCnCertificationIdVerify"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileDateValidityEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileLocalCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileClientCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileRowStatus"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileName"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileState"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserPriorityNumber"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMethodPacTtl"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAnonymousProvEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityId"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityInfo"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapServerKey"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityIdLength")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoLwappLocalAuthMIBConfigGroup = ciscoLwappLocalAuthMIBConfigGroup.setStatus('deprecated') ciscoLwappLocalAuthMIBConfigGroupSup1 = ObjectGroup((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 2)).setObjects(("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaActiveTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapIdentityReqTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapIdentityReqMaxRetries"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapDynamicWepKeyIndex"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapReqTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapReqMaxRetries"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileMethods"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCertIssuer"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCaCertificationCheck"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileCnCertificationIdVerify"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileDateValidityEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileLocalCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileClientCertificateRequired"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapProfileRowStatus"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileName"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaWlanProfileState"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaUserPriorityNumber"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMethodPacTtl"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAnonymousProvEnabled"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityId"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityInfo"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapServerKey"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapAuthorityIdLength"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapMaxLoginIgnIdResp"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapKeyTimeout"), ("CISCO-LWAPP-LOCAL-AUTH-MIB", "cllaEapKeyMaxRetries")) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): ciscoLwappLocalAuthMIBConfigGroupSup1 = ciscoLwappLocalAuthMIBConfigGroupSup1.setStatus('current') mibBuilder.exportSymbols("CISCO-LWAPP-LOCAL-AUTH-MIB", cllaEapProfileName=cllaEapProfileName, cllaLocalAuth=cllaLocalAuth, cllaEapProfileLocalCertificateRequired=cllaEapProfileLocalCertificateRequired, cllaUserCredential=cllaUserCredential, cllaEapProfileClientCertificateRequired=cllaEapProfileClientCertificateRequired, cllaWlanProfileTable=cllaWlanProfileTable, cllaActiveTimeout=cllaActiveTimeout, cllaUserPriorityTable=cllaUserPriorityTable, cllaEapServerKey=cllaEapServerKey, cllaEapProfileCnCertificationIdVerify=cllaEapProfileCnCertificationIdVerify, cllaEapAnonymousProvEnabled=cllaEapAnonymousProvEnabled, cllaEapKeyTimeout=cllaEapKeyTimeout, cllaConfig=cllaConfig, cllaWlanProfileName=cllaWlanProfileName, cllaEapMethodPacTtl=cllaEapMethodPacTtl, ciscoLwappLocalAuthMIBObjects=ciscoLwappLocalAuthMIBObjects, cllaEapReqTimeout=cllaEapReqTimeout, cllaEapIdentityReqMaxRetries=cllaEapIdentityReqMaxRetries, cllaEapProfileDateValidityEnabled=cllaEapProfileDateValidityEnabled, cllaEapParams=cllaEapParams, cllaEapAuthorityId=cllaEapAuthorityId, ciscoLwappLocalAuthMIBComplianceRev1=ciscoLwappLocalAuthMIBComplianceRev1, cllaEapIdentityReqTimeout=cllaEapIdentityReqTimeout, cllaEapAuthorityInfo=cllaEapAuthorityInfo, ciscoLwappLocalAuthMIB=ciscoLwappLocalAuthMIB, cllaEapKeyMaxRetries=cllaEapKeyMaxRetries, cllaEapAuthorityIdLength=cllaEapAuthorityIdLength, cllaUserPriorityNumber=cllaUserPriorityNumber, cllaEapProfileMethods=cllaEapProfileMethods, ciscoLwappLocalAuthMIBConfigGroup=ciscoLwappLocalAuthMIBConfigGroup, cllaEapProfileTable=cllaEapProfileTable, PYSNMP_MODULE_ID=ciscoLwappLocalAuthMIB, cllaWlanProfileState=cllaWlanProfileState, ciscoLwappLocalAuthMIBCompliances=ciscoLwappLocalAuthMIBCompliances, cllaEapProfileCaCertificationCheck=cllaEapProfileCaCertificationCheck, cllaEapProfileRowStatus=cllaEapProfileRowStatus, cllaEapDynamicWepKeyIndex=cllaEapDynamicWepKeyIndex, cllaEapMaxLoginIgnIdResp=cllaEapMaxLoginIgnIdResp, cllaEapProfileCertIssuer=cllaEapProfileCertIssuer, cllaUserPriorityEntry=cllaUserPriorityEntry, ciscoLwappLocalAuthMIBNotifs=ciscoLwappLocalAuthMIBNotifs, ciscoLwappLocalAuthMIBConfigGroupSup1=ciscoLwappLocalAuthMIBConfigGroupSup1, ciscoLwappLocalAuthMIBGroups=ciscoLwappLocalAuthMIBGroups, ciscoLwappLocalAuthMIBCompliance=ciscoLwappLocalAuthMIBCompliance, cllaWlanProfileEntry=cllaWlanProfileEntry, ciscoLwappLocalAuthMIBConform=ciscoLwappLocalAuthMIBConform, cllaEapProfileEntry=cllaEapProfileEntry, cllaEapReqMaxRetries=cllaEapReqMaxRetries)
(object_identifier, integer, octet_string) = mibBuilder.importSymbols('ASN1', 'ObjectIdentifier', 'Integer', 'OctetString') (named_values,) = mibBuilder.importSymbols('ASN1-ENUMERATION', 'NamedValues') (value_size_constraint, value_range_constraint, constraints_union, constraints_intersection, single_value_constraint) = mibBuilder.importSymbols('ASN1-REFINEMENT', 'ValueSizeConstraint', 'ValueRangeConstraint', 'ConstraintsUnion', 'ConstraintsIntersection', 'SingleValueConstraint') (c_l_wlan_index,) = mibBuilder.importSymbols('CISCO-LWAPP-WLAN-MIB', 'cLWlanIndex') (cisco_mgmt,) = mibBuilder.importSymbols('CISCO-SMI', 'ciscoMgmt') (object_group, module_compliance, notification_group) = mibBuilder.importSymbols('SNMPv2-CONF', 'ObjectGroup', 'ModuleCompliance', 'NotificationGroup') (time_ticks, ip_address, gauge32, iso, mib_identifier, object_identity, integer32, module_identity, mib_scalar, mib_table, mib_table_row, mib_table_column, bits, unsigned32, counter32, notification_type, counter64) = mibBuilder.importSymbols('SNMPv2-SMI', 'TimeTicks', 'IpAddress', 'Gauge32', 'iso', 'MibIdentifier', 'ObjectIdentity', 'Integer32', 'ModuleIdentity', 'MibScalar', 'MibTable', 'MibTableRow', 'MibTableColumn', 'Bits', 'Unsigned32', 'Counter32', 'NotificationType', 'Counter64') (textual_convention, display_string, row_status, truth_value) = mibBuilder.importSymbols('SNMPv2-TC', 'TextualConvention', 'DisplayString', 'RowStatus', 'TruthValue') cisco_lwapp_local_auth_mib = module_identity((1, 3, 6, 1, 4, 1, 9, 9, 619)) ciscoLwappLocalAuthMIB.setRevisions(('2010-02-09 00:00', '2009-11-24 00:00', '2007-03-15 00:00')) if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setLastUpdated('201002090000Z') if mibBuilder.loadTexts: ciscoLwappLocalAuthMIB.setOrganization('Cisco Systems Inc.') cisco_lwapp_local_auth_mib_notifs = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 0)) cisco_lwapp_local_auth_mib_objects = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1)) cisco_lwapp_local_auth_mib_conform = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2)) clla_config = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1)) clla_local_auth = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1)) clla_active_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 1), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaActiveTimeout.setStatus('current') clla_eap_identity_req_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 2), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapIdentityReqTimeout.setStatus('current') clla_eap_identity_req_max_retries = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 3), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapIdentityReqMaxRetries.setStatus('current') clla_eap_dynamic_wep_key_index = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 4), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 3))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapDynamicWepKeyIndex.setStatus('current') clla_eap_req_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 5), unsigned32()).setUnits('seconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapReqTimeout.setStatus('current') clla_eap_req_max_retries = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 6), unsigned32()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapReqMaxRetries.setStatus('current') clla_eap_max_login_ign_id_resp = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 7), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapMaxLoginIgnIdResp.setStatus('current') clla_eap_key_timeout = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 8), unsigned32().subtype(subtypeSpec=value_range_constraint(200, 5000)).clone(1000)).setUnits('milliseconds').setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapKeyTimeout.setStatus('current') clla_eap_key_max_retries = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 1, 9), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 4)).clone(2)).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapKeyMaxRetries.setStatus('current') clla_eap_profile_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2)) if mibBuilder.loadTexts: cllaEapProfileTable.setStatus('current') clla_eap_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1)).setIndexNames((0, 'CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileName')) if mibBuilder.loadTexts: cllaEapProfileEntry.setStatus('current') clla_eap_profile_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))) if mibBuilder.loadTexts: cllaEapProfileName.setStatus('current') clla_eap_profile_methods = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 2), bits().clone(namedValues=named_values(('none', 0), ('leap', 1), ('eapFast', 2), ('tls', 3), ('peap', 4)))).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileMethods.setStatus('current') clla_eap_profile_cert_issuer = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 3), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('cisco', 1), ('vendor', 2))).clone('cisco')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileCertIssuer.setStatus('current') clla_eap_profile_ca_certification_check = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 4), truth_value().clone('true')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileCaCertificationCheck.setStatus('current') clla_eap_profile_cn_certification_id_verify = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 5), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileCnCertificationIdVerify.setStatus('current') clla_eap_profile_date_validity_enabled = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 6), truth_value().clone('true')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileDateValidityEnabled.setStatus('current') clla_eap_profile_local_certificate_required = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 7), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileLocalCertificateRequired.setStatus('current') clla_eap_profile_client_certificate_required = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 8), truth_value().clone('false')).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileClientCertificateRequired.setStatus('current') clla_eap_profile_row_status = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 2, 1, 9), row_status()).setMaxAccess('readcreate') if mibBuilder.loadTexts: cllaEapProfileRowStatus.setStatus('current') clla_wlan_profile_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3)) if mibBuilder.loadTexts: cllaWlanProfileTable.setStatus('current') clla_wlan_profile_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1)).setIndexNames((0, 'CISCO-LWAPP-WLAN-MIB', 'cLWlanIndex')) if mibBuilder.loadTexts: cllaWlanProfileEntry.setStatus('current') clla_wlan_profile_name = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 1), display_string().subtype(subtypeSpec=value_size_constraint(0, 63))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaWlanProfileName.setStatus('current') clla_wlan_profile_state = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 3, 1, 2), truth_value()).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaWlanProfileState.setStatus('current') clla_user_priority_table = mib_table((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4)) if mibBuilder.loadTexts: cllaUserPriorityTable.setStatus('current') clla_user_priority_entry = mib_table_row((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1)).setIndexNames((0, 'CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaUserCredential')) if mibBuilder.loadTexts: cllaUserPriorityEntry.setStatus('current') clla_user_credential = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 1), integer32().subtype(subtypeSpec=constraints_union(single_value_constraint(1, 2))).clone(namedValues=named_values(('local', 1), ('ldap', 2)))) if mibBuilder.loadTexts: cllaUserCredential.setStatus('current') clla_user_priority_number = mib_table_column((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 4, 1, 2), integer32().subtype(subtypeSpec=value_range_constraint(0, 2))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaUserPriorityNumber.setStatus('current') clla_eap_params = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5)) clla_eap_method_pac_ttl = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 1), unsigned32().subtype(subtypeSpec=value_range_constraint(1, 1000)).clone(10)).setUnits('days').setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapMethodPacTtl.setStatus('current') clla_eap_anonymous_prov_enabled = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 2), truth_value().clone('true')).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapAnonymousProvEnabled.setStatus('current') clla_eap_authority_id = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 3), octet_string().subtype(subtypeSpec=value_size_constraint(0, 128))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapAuthorityId.setStatus('current') clla_eap_authority_info = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 4), octet_string().subtype(subtypeSpec=value_size_constraint(0, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapAuthorityInfo.setStatus('current') clla_eap_server_key = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 5), octet_string().subtype(subtypeSpec=value_size_constraint(1, 32))).setMaxAccess('readwrite') if mibBuilder.loadTexts: cllaEapServerKey.setStatus('current') clla_eap_authority_id_length = mib_scalar((1, 3, 6, 1, 4, 1, 9, 9, 619, 1, 1, 5, 6), unsigned32().subtype(subtypeSpec=value_range_constraint(0, 128)).clone(32)).setMaxAccess('readonly') if mibBuilder.loadTexts: cllaEapAuthorityIdLength.setStatus('current') cisco_lwapp_local_auth_mib_compliances = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1)) cisco_lwapp_local_auth_mib_groups = mib_identifier((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2)) cisco_lwapp_local_auth_mib_compliance = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 1)).setObjects(('CISCO-LWAPP-LOCAL-AUTH-MIB', 'ciscoLwappLocalAuthMIBConfigGroup')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_lwapp_local_auth_mib_compliance = ciscoLwappLocalAuthMIBCompliance.setStatus('deprecated') cisco_lwapp_local_auth_mib_compliance_rev1 = module_compliance((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 1, 2)).setObjects(('CISCO-LWAPP-LOCAL-AUTH-MIB', 'ciscoLwappLocalAuthMIBConfigGroupSup1')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_lwapp_local_auth_mib_compliance_rev1 = ciscoLwappLocalAuthMIBComplianceRev1.setStatus('current') cisco_lwapp_local_auth_mib_config_group = object_group((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 1)).setObjects(('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaActiveTimeout'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileMethods'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCertIssuer'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCaCertificationCheck'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCnCertificationIdVerify'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileDateValidityEnabled'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileLocalCertificateRequired'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileClientCertificateRequired'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileRowStatus'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaWlanProfileName'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaWlanProfileState'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaUserPriorityNumber'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapMethodPacTtl'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAnonymousProvEnabled'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityId'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityInfo'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapServerKey'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityIdLength')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_lwapp_local_auth_mib_config_group = ciscoLwappLocalAuthMIBConfigGroup.setStatus('deprecated') cisco_lwapp_local_auth_mib_config_group_sup1 = object_group((1, 3, 6, 1, 4, 1, 9, 9, 619, 2, 2, 2)).setObjects(('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaActiveTimeout'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapIdentityReqTimeout'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapIdentityReqMaxRetries'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapDynamicWepKeyIndex'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapReqTimeout'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapReqMaxRetries'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileMethods'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCertIssuer'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCaCertificationCheck'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileCnCertificationIdVerify'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileDateValidityEnabled'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileLocalCertificateRequired'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileClientCertificateRequired'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapProfileRowStatus'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaWlanProfileName'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaWlanProfileState'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaUserPriorityNumber'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapMethodPacTtl'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAnonymousProvEnabled'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityId'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityInfo'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapServerKey'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapAuthorityIdLength'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapMaxLoginIgnIdResp'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapKeyTimeout'), ('CISCO-LWAPP-LOCAL-AUTH-MIB', 'cllaEapKeyMaxRetries')) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): cisco_lwapp_local_auth_mib_config_group_sup1 = ciscoLwappLocalAuthMIBConfigGroupSup1.setStatus('current') mibBuilder.exportSymbols('CISCO-LWAPP-LOCAL-AUTH-MIB', cllaEapProfileName=cllaEapProfileName, cllaLocalAuth=cllaLocalAuth, cllaEapProfileLocalCertificateRequired=cllaEapProfileLocalCertificateRequired, cllaUserCredential=cllaUserCredential, cllaEapProfileClientCertificateRequired=cllaEapProfileClientCertificateRequired, cllaWlanProfileTable=cllaWlanProfileTable, cllaActiveTimeout=cllaActiveTimeout, cllaUserPriorityTable=cllaUserPriorityTable, cllaEapServerKey=cllaEapServerKey, cllaEapProfileCnCertificationIdVerify=cllaEapProfileCnCertificationIdVerify, cllaEapAnonymousProvEnabled=cllaEapAnonymousProvEnabled, cllaEapKeyTimeout=cllaEapKeyTimeout, cllaConfig=cllaConfig, cllaWlanProfileName=cllaWlanProfileName, cllaEapMethodPacTtl=cllaEapMethodPacTtl, ciscoLwappLocalAuthMIBObjects=ciscoLwappLocalAuthMIBObjects, cllaEapReqTimeout=cllaEapReqTimeout, cllaEapIdentityReqMaxRetries=cllaEapIdentityReqMaxRetries, cllaEapProfileDateValidityEnabled=cllaEapProfileDateValidityEnabled, cllaEapParams=cllaEapParams, cllaEapAuthorityId=cllaEapAuthorityId, ciscoLwappLocalAuthMIBComplianceRev1=ciscoLwappLocalAuthMIBComplianceRev1, cllaEapIdentityReqTimeout=cllaEapIdentityReqTimeout, cllaEapAuthorityInfo=cllaEapAuthorityInfo, ciscoLwappLocalAuthMIB=ciscoLwappLocalAuthMIB, cllaEapKeyMaxRetries=cllaEapKeyMaxRetries, cllaEapAuthorityIdLength=cllaEapAuthorityIdLength, cllaUserPriorityNumber=cllaUserPriorityNumber, cllaEapProfileMethods=cllaEapProfileMethods, ciscoLwappLocalAuthMIBConfigGroup=ciscoLwappLocalAuthMIBConfigGroup, cllaEapProfileTable=cllaEapProfileTable, PYSNMP_MODULE_ID=ciscoLwappLocalAuthMIB, cllaWlanProfileState=cllaWlanProfileState, ciscoLwappLocalAuthMIBCompliances=ciscoLwappLocalAuthMIBCompliances, cllaEapProfileCaCertificationCheck=cllaEapProfileCaCertificationCheck, cllaEapProfileRowStatus=cllaEapProfileRowStatus, cllaEapDynamicWepKeyIndex=cllaEapDynamicWepKeyIndex, cllaEapMaxLoginIgnIdResp=cllaEapMaxLoginIgnIdResp, cllaEapProfileCertIssuer=cllaEapProfileCertIssuer, cllaUserPriorityEntry=cllaUserPriorityEntry, ciscoLwappLocalAuthMIBNotifs=ciscoLwappLocalAuthMIBNotifs, ciscoLwappLocalAuthMIBConfigGroupSup1=ciscoLwappLocalAuthMIBConfigGroupSup1, ciscoLwappLocalAuthMIBGroups=ciscoLwappLocalAuthMIBGroups, ciscoLwappLocalAuthMIBCompliance=ciscoLwappLocalAuthMIBCompliance, cllaWlanProfileEntry=cllaWlanProfileEntry, ciscoLwappLocalAuthMIBConform=ciscoLwappLocalAuthMIBConform, cllaEapProfileEntry=cllaEapProfileEntry, cllaEapReqMaxRetries=cllaEapReqMaxRetries)
class Human: def method(self): return print(f'Hello - {self}') @classmethod def classmethod(cls): return print('it is a species of "Homo sapiens"') @staticmethod def staticmethod(): return print('Congratulations') name_human = input('Enter your name: ') Human.method(name_human) Human.classmethod() Human.staticmethod()
class Human: def method(self): return print(f'Hello - {self}') @classmethod def classmethod(cls): return print('it is a species of "Homo sapiens"') @staticmethod def staticmethod(): return print('Congratulations') name_human = input('Enter your name: ') Human.method(name_human) Human.classmethod() Human.staticmethod()
""" Created on Oct 13, 2019 @author: majdukovic """ class UrlGenerator: """ This class builds urls """ def __init__(self): self.urls_map = { 'POST_TOKEN': 'auth', 'GET_BOOKING': 'booking', 'POST_BOOKING': 'booking', 'PUT_BOOKING': 'booking', 'PATCH_BOOKING': 'booking', 'DELETE_BOOKING': 'booking' } def get_url(self, api_key): """ Return the url registered for the api_key informed. @param api_key: The key used to register the url in the url_generator.py """ # Check the api alias is valid or registered already if api_key not in self.urls_map: raise Exception(f'API alias {api_key} is not registered in known endpoints.') # endpoint = f'https://restful-booker.herokuapp.com/{self.urls_map[api_key]}' endpoint = f'http://localhost:3001/{self.urls_map[api_key]}' return endpoint
""" Created on Oct 13, 2019 @author: majdukovic """ class Urlgenerator: """ This class builds urls """ def __init__(self): self.urls_map = {'POST_TOKEN': 'auth', 'GET_BOOKING': 'booking', 'POST_BOOKING': 'booking', 'PUT_BOOKING': 'booking', 'PATCH_BOOKING': 'booking', 'DELETE_BOOKING': 'booking'} def get_url(self, api_key): """ Return the url registered for the api_key informed. @param api_key: The key used to register the url in the url_generator.py """ if api_key not in self.urls_map: raise exception(f'API alias {api_key} is not registered in known endpoints.') endpoint = f'http://localhost:3001/{self.urls_map[api_key]}' return endpoint
""" Views for the admin interface """ def includeme(config): config.scan("admin.views")
""" Views for the admin interface """ def includeme(config): config.scan('admin.views')
#!/usr/bin/env python # -*- coding: utf-8 -*- SUCCESS = "0" NEED_SMS = "1" SMS_FAIL = "2"
success = '0' need_sms = '1' sms_fail = '2'
#Vigenere cipher + b64 - substitution ''' method = sys.argv[1] key = sys.argv[2] string = sys.argv[3] ''' def encode(key, string) : encoded_chars = [] for i in range(len(string)) : key_c = key[i % len(key)] encoded_c = chr(ord(string[i]) + ord(key_c) % 256) encoded_chars.append(encoded_c) encoded_string = "".join(encoded_chars) return encoded_string def decode(key, string) : decoded_chars = [] for i in range(len(string)) : key_c = key[i % len(key)] decoded_c = chr(ord(string[i]) - ord(key_c) % 256) decoded_chars.append(decoded_c) decoded_string = "".join(decoded_chars) return decoded_string def mainFunc(plaintext, key, method): if method == 'e' or method == 'E' : print (encode(key, plaintext)) else : print (decode(key, plaintext))
""" method = sys.argv[1] key = sys.argv[2] string = sys.argv[3] """ def encode(key, string): encoded_chars = [] for i in range(len(string)): key_c = key[i % len(key)] encoded_c = chr(ord(string[i]) + ord(key_c) % 256) encoded_chars.append(encoded_c) encoded_string = ''.join(encoded_chars) return encoded_string def decode(key, string): decoded_chars = [] for i in range(len(string)): key_c = key[i % len(key)] decoded_c = chr(ord(string[i]) - ord(key_c) % 256) decoded_chars.append(decoded_c) decoded_string = ''.join(decoded_chars) return decoded_string def main_func(plaintext, key, method): if method == 'e' or method == 'E': print(encode(key, plaintext)) else: print(decode(key, plaintext))
"""TCS module""" #def hello(who): # """function that greats""" # return "hello " + who def tcs(d): """TCS test function""" return d
"""TCS module""" def tcs(d): """TCS test function""" return d
def ForceDefaultLocale(get_response): """ Ignore Accept-Language HTTP headers This will force the I18N machinery to always choose settings.LANGUAGE_CODE as the default initial language, unless another one is set via sessions or cookies Should be installed *before* any middleware that checks request.META['HTTP_ACCEPT_LANGUAGE'], namely django.middleware.locale.LocaleMiddleware """ def process_request(request): if 'HTTP_ACCEPT_LANGUAGE' in request.META: del request.META['HTTP_ACCEPT_LANGUAGE'] response = get_response(request) return response return process_request
def force_default_locale(get_response): """ Ignore Accept-Language HTTP headers This will force the I18N machinery to always choose settings.LANGUAGE_CODE as the default initial language, unless another one is set via sessions or cookies Should be installed *before* any middleware that checks request.META['HTTP_ACCEPT_LANGUAGE'], namely django.middleware.locale.LocaleMiddleware """ def process_request(request): if 'HTTP_ACCEPT_LANGUAGE' in request.META: del request.META['HTTP_ACCEPT_LANGUAGE'] response = get_response(request) return response return process_request
def mult_by_two(num): return num * 2 def mult_by_five(num): return num * 5 def square(num): return num * num def add_one(num): return num + 1 def apply(num, func): return func(num) result = apply(10, mult_by_two) print(result) print(apply(10, mult_by_five)) print(apply(10, square)) print(apply(10, add_one)) print(apply(10, mult_by_two))
def mult_by_two(num): return num * 2 def mult_by_five(num): return num * 5 def square(num): return num * num def add_one(num): return num + 1 def apply(num, func): return func(num) result = apply(10, mult_by_two) print(result) print(apply(10, mult_by_five)) print(apply(10, square)) print(apply(10, add_one)) print(apply(10, mult_by_two))
class BisectionMap(object): __slots__ = ('nodes') #//-------------------------------------------------------// def __init__(self, dict = {} ): self.nodes = [] for key, value in dict.iteritems(): self[ key ] = value #//-------------------------------------------------------// def __findPosition( self, key ): nodes = self.nodes pos = 0 end = len(nodes) while pos < end: mid = (pos + end) // 2 if nodes[mid][0] < key: pos = mid + 1 else: end = mid try: node = nodes[pos] if not (key < node[0]): return pos, node except IndexError: pass return pos, None #//-------------------------------------------------------// def __getitem__(self, key ): pos, node = self.__findPosition( key ) if node is None: raise KeyError(str(key)) return node[1] #//-------------------------------------------------------// def __setitem__(self, key, value ): pos, node = self.__findPosition( key ) if node is not None: node[1] = value else: self.nodes.insert( pos, [ key, value ] ) #//-------------------------------------------------------// def setdefault(self, key, value = None ): pos, node = self.__findPosition( key ) if node is not None: return node[1] self.nodes.insert( pos, [key, value] ) return value #//-------------------------------------------------------// def __delitem__(self, key): pos, node = self.__findPosition( key ) if node is not None: del nodes[pos] raise KeyError(str(key)) #//-------------------------------------------------------// def __contains__(self, key): return self.__findPosition( key )[1] is not None #//-------------------------------------------------------// def has_key(self, key): return self.__findPosition( key )[1] is not None #//-------------------------------------------------------// def get(self, key, default = None): try: return self[key] except KeyError: return default #//-------------------------------------------------------// def keys(self): return tuple( self.iterkeys() ) #//-------------------------------------------------------// def values(self): return tuple( self.itervalues() ) #//-------------------------------------------------------// def items(self): return tuple( self.iteritems() ) #//-------------------------------------------------------// def itervalues(self): for node in self.nodes: yield node[1] #//-------------------------------------------------------// def iterkeys(self): for node in self.nodes: yield node[0] #//-------------------------------------------------------// def iteritems(self): for node in self.nodes: yield ( node[0], node[1] ) #//-------------------------------------------------------// def __iter__(self): return self.iterkeys() #//-------------------------------------------------------// def clear(self): self.nodes = [] #//-------------------------------------------------------// def copy(self): clone = BisectionMap() clone.nodes = list(self.nodes) return clone #//-------------------------------------------------------// def update(self, other): for key in other.iterkeys(): self[key] = other[key] #//-------------------------------------------------------// def __str__(self): return '{'+ ', '.join( map(lambda node: repr(node[0]) + ': ' + repr(node[1]), self.nodes) ) + '}' #//-------------------------------------------------------// def __repr__(self): return self.__str__()
class Bisectionmap(object): __slots__ = 'nodes' def __init__(self, dict={}): self.nodes = [] for (key, value) in dict.iteritems(): self[key] = value def __find_position(self, key): nodes = self.nodes pos = 0 end = len(nodes) while pos < end: mid = (pos + end) // 2 if nodes[mid][0] < key: pos = mid + 1 else: end = mid try: node = nodes[pos] if not key < node[0]: return (pos, node) except IndexError: pass return (pos, None) def __getitem__(self, key): (pos, node) = self.__findPosition(key) if node is None: raise key_error(str(key)) return node[1] def __setitem__(self, key, value): (pos, node) = self.__findPosition(key) if node is not None: node[1] = value else: self.nodes.insert(pos, [key, value]) def setdefault(self, key, value=None): (pos, node) = self.__findPosition(key) if node is not None: return node[1] self.nodes.insert(pos, [key, value]) return value def __delitem__(self, key): (pos, node) = self.__findPosition(key) if node is not None: del nodes[pos] raise key_error(str(key)) def __contains__(self, key): return self.__findPosition(key)[1] is not None def has_key(self, key): return self.__findPosition(key)[1] is not None def get(self, key, default=None): try: return self[key] except KeyError: return default def keys(self): return tuple(self.iterkeys()) def values(self): return tuple(self.itervalues()) def items(self): return tuple(self.iteritems()) def itervalues(self): for node in self.nodes: yield node[1] def iterkeys(self): for node in self.nodes: yield node[0] def iteritems(self): for node in self.nodes: yield (node[0], node[1]) def __iter__(self): return self.iterkeys() def clear(self): self.nodes = [] def copy(self): clone = bisection_map() clone.nodes = list(self.nodes) return clone def update(self, other): for key in other.iterkeys(): self[key] = other[key] def __str__(self): return '{' + ', '.join(map(lambda node: repr(node[0]) + ': ' + repr(node[1]), self.nodes)) + '}' def __repr__(self): return self.__str__()
# YASS, Yet Another Subdomainer Software # Copyright 2015-2019 Francesco Marano (@mrnfrancesco) and individual contributors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. def without_duplicates(args): """ Removes duplicated items from an iterable. :param args: the iterable to remove duplicates from :type args: iterable :return: the same iterable without duplicated items :rtype: iterable :raise TypeError: if *args* is not iterable """ if hasattr(args, '__iter__') and not isinstance(args, str): if args: return type(args)(set(args)) else: return args else: raise TypeError("Expected iterable, got {args_type} insted".format(args_type=type(args)))
def without_duplicates(args): """ Removes duplicated items from an iterable. :param args: the iterable to remove duplicates from :type args: iterable :return: the same iterable without duplicated items :rtype: iterable :raise TypeError: if *args* is not iterable """ if hasattr(args, '__iter__') and (not isinstance(args, str)): if args: return type(args)(set(args)) else: return args else: raise type_error('Expected iterable, got {args_type} insted'.format(args_type=type(args)))
# Copyright 2017 The Bazel Authors. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Support functions used when processing resources in Apple bundles.""" load("@bazel_skylib//lib:paths.bzl", "paths") def _bundle_relative_path(f): """Returns the portion of `f`'s path relative to its containing `.bundle`. This function fails if `f` does not have an ancestor directory named with the `.bundle` extension. Args: f: A file. Returns: The `.bundle`-relative path to the file. """ return paths.relativize( f.short_path, _farthest_directory_matching(f.short_path, "bundle")) def _farthest_directory_matching(path, extension): """Returns the part of a path with the given extension closest to the root. For example, if `path` is `"foo/bar.bundle/baz.bundle"`, passing `".bundle"` as the extension will return `"foo/bar.bundle"`. Args: path: The path. extension: The extension of the directory to find. Returns: The portion of the path that ends in the given extension that is closest to the root of the path. """ prefix, ext, _ = path.partition("." + extension) if ext: return prefix + ext fail("Expected path %r to contain %r, but it did not" % ( path, "." + extension)) def _owner_relative_path(f): """Returns the portion of `f`'s path relative to its owner. Args: f: A file. Returns: The owner-relative path to the file. """ return paths.relativize(f.short_path, f.owner.package) # Define the loadable module that lists the exported symbols in this file. resource_support = struct( bundle_relative_path=_bundle_relative_path, owner_relative_path=_owner_relative_path, )
"""Support functions used when processing resources in Apple bundles.""" load('@bazel_skylib//lib:paths.bzl', 'paths') def _bundle_relative_path(f): """Returns the portion of `f`'s path relative to its containing `.bundle`. This function fails if `f` does not have an ancestor directory named with the `.bundle` extension. Args: f: A file. Returns: The `.bundle`-relative path to the file. """ return paths.relativize(f.short_path, _farthest_directory_matching(f.short_path, 'bundle')) def _farthest_directory_matching(path, extension): """Returns the part of a path with the given extension closest to the root. For example, if `path` is `"foo/bar.bundle/baz.bundle"`, passing `".bundle"` as the extension will return `"foo/bar.bundle"`. Args: path: The path. extension: The extension of the directory to find. Returns: The portion of the path that ends in the given extension that is closest to the root of the path. """ (prefix, ext, _) = path.partition('.' + extension) if ext: return prefix + ext fail('Expected path %r to contain %r, but it did not' % (path, '.' + extension)) def _owner_relative_path(f): """Returns the portion of `f`'s path relative to its owner. Args: f: A file. Returns: The owner-relative path to the file. """ return paths.relativize(f.short_path, f.owner.package) resource_support = struct(bundle_relative_path=_bundle_relative_path, owner_relative_path=_owner_relative_path)
# -*- coding: utf-8 -*- test = 0 while True: test += 1 deposits = int(input()) if deposits == 0: break delta = 0 print("Teste %d" % test) for i in range(deposits): values = input().split() a = int(values[0]) b = int(values[1]) delta += a - b print(delta) print("")
test = 0 while True: test += 1 deposits = int(input()) if deposits == 0: break delta = 0 print('Teste %d' % test) for i in range(deposits): values = input().split() a = int(values[0]) b = int(values[1]) delta += a - b print(delta) print('')
#LEETOCDE: 104. Maximum Depth of Binary Tree class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None def maxDepth(root: TreeNode) -> int: if not root: return 0 else: return max(1+maxDepth(root.left), 1+maxDepth(root.right)) #TODO: Implement iterative way for a O(1) space solution def maxDepthII(root: TreeNode) -> int: print("PLACEHODLER") if __name__ == "__main__": n1 = TreeNode(1) n2 = TreeNode(2) n3 = TreeNode(3) n1.left = n2 n2.left = n3 print(maxDepth(n1))
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None def max_depth(root: TreeNode) -> int: if not root: return 0 else: return max(1 + max_depth(root.left), 1 + max_depth(root.right)) def max_depth_ii(root: TreeNode) -> int: print('PLACEHODLER') if __name__ == '__main__': n1 = tree_node(1) n2 = tree_node(2) n3 = tree_node(3) n1.left = n2 n2.left = n3 print(max_depth(n1))
# Definition for a binary tree node. # from typing import List # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution: def solve(self, preorder: List[int], inorder: List[int]) -> TreeNode: if not preorder: return None root = TreeNode(preorder[0]) if len(inorder) == 1: return root root_idx_inorder = inorder.index(preorder[0]) lchild = self.solve(preorder[1:root_idx_inorder + 1], inorder[:root_idx_inorder]) rchild = self.solve(preorder[root_idx_inorder + 1:], inorder[root_idx_inorder + 1:]) root.left = lchild root.right = rchild return root def buildTree(self, preorder: List[int], inorder: List[int]) -> TreeNode: return self.solve(preorder, inorder)
class Solution: def solve(self, preorder: List[int], inorder: List[int]) -> TreeNode: if not preorder: return None root = tree_node(preorder[0]) if len(inorder) == 1: return root root_idx_inorder = inorder.index(preorder[0]) lchild = self.solve(preorder[1:root_idx_inorder + 1], inorder[:root_idx_inorder]) rchild = self.solve(preorder[root_idx_inorder + 1:], inorder[root_idx_inorder + 1:]) root.left = lchild root.right = rchild return root def build_tree(self, preorder: List[int], inorder: List[int]) -> TreeNode: return self.solve(preorder, inorder)
# sorting algorithms # mergeSort def merge_sort(a): n = len(a) if n < 2: return a q = int(n / 2) left = a[:q] right = a[q:] # print("left : {%s} , right : {%s}, A : {%s}" % (left, right, a)) merge_sort(left) merge_sort(right) a = merge(a, left, right) # print("Result A ", a) return a def merge(a, left, right): l = len(left) r = len(right) i, j, k = 0, 0, 0 # print("In merge function left : {%s} , right : {%s}, A : {%s}" % (left, right, a)) while i < l and j < r: if left[i] <= right[j]: a[k] = left[i] k = k + 1 i = i + 1 else: a[k] = right[j] k = k + 1 j = j + 1 while i < l: a[k] = left[i] k = k + 1 i = i + 1 while j < r: a[k] = right[j] k = k + 1 j = j + 1 return a # A=[8.01203212, 7, 6.2, 4.123122, 3-3, 43, 432, -2, 43, 42, 224, 2432, -432.0102, -42.4, -242342, -242342, 24234232, # -4, 0, 20, 0.0001, 00.2, 00.32, -0.41, 2, 432, 2, -224223423] A = ['A', 'B', 'C', 'EF', 'ALPHA', 'ZOOM', 'AAPPLE', 'COMP', 'JAGA', 'KKDAL'] # A = [8, 7, 6, 3, 9, -2, 19, 21, -2] print("UnSorted list : ", A) merge_sort(A) print("Sorted list : ", A)
def merge_sort(a): n = len(a) if n < 2: return a q = int(n / 2) left = a[:q] right = a[q:] merge_sort(left) merge_sort(right) a = merge(a, left, right) return a def merge(a, left, right): l = len(left) r = len(right) (i, j, k) = (0, 0, 0) while i < l and j < r: if left[i] <= right[j]: a[k] = left[i] k = k + 1 i = i + 1 else: a[k] = right[j] k = k + 1 j = j + 1 while i < l: a[k] = left[i] k = k + 1 i = i + 1 while j < r: a[k] = right[j] k = k + 1 j = j + 1 return a a = ['A', 'B', 'C', 'EF', 'ALPHA', 'ZOOM', 'AAPPLE', 'COMP', 'JAGA', 'KKDAL'] print('UnSorted list : ', A) merge_sort(A) print('Sorted list : ', A)
# AUTOGENERATED BY NBDEV! DO NOT EDIT! __all__ = ["index", "modules", "custom_doc_links", "git_url"] index = {"file_exists": "01_data.ipynb", "ds_file_exists": "01_data.ipynb", "filter_for_exists": "01_data.ipynb", "drop_missing_files": "01_data.ipynb", "add_ds": "01_data.ipynb", "merge_ds": "01_data.ipynb", "remove_special_characters": "01_data.ipynb", "chars_to_ignore_regex": "01_data.ipynb", "extract_all_chars": "01_data.ipynb", "get_char_vocab": "01_data.ipynb", "process_vocab": "01_data.ipynb", "extract_vocab": "01_data.ipynb", "speech_file_to_array": "01_data.ipynb", "DataCollatorCTCWithPadding": "03_training.ipynb", "wer_metric": "04_evaluation.ipynb", "compute_wer_metric": "03_training.ipynb", "evaluate_xlsr": "04_evaluation.ipynb", "setup_wandb": "05_wandb_utils.ipynb"} modules = ["data.py", "augmentation.py", "training.py", "evaluation.py", "wandbutils.py"] doc_url = "https://morganmcg1.github.io/xlsr_finetune/" git_url = "https://github.com/morganmcg1/xlsr_finetune/tree/master/" def custom_doc_links(name): return None
__all__ = ['index', 'modules', 'custom_doc_links', 'git_url'] index = {'file_exists': '01_data.ipynb', 'ds_file_exists': '01_data.ipynb', 'filter_for_exists': '01_data.ipynb', 'drop_missing_files': '01_data.ipynb', 'add_ds': '01_data.ipynb', 'merge_ds': '01_data.ipynb', 'remove_special_characters': '01_data.ipynb', 'chars_to_ignore_regex': '01_data.ipynb', 'extract_all_chars': '01_data.ipynb', 'get_char_vocab': '01_data.ipynb', 'process_vocab': '01_data.ipynb', 'extract_vocab': '01_data.ipynb', 'speech_file_to_array': '01_data.ipynb', 'DataCollatorCTCWithPadding': '03_training.ipynb', 'wer_metric': '04_evaluation.ipynb', 'compute_wer_metric': '03_training.ipynb', 'evaluate_xlsr': '04_evaluation.ipynb', 'setup_wandb': '05_wandb_utils.ipynb'} modules = ['data.py', 'augmentation.py', 'training.py', 'evaluation.py', 'wandbutils.py'] doc_url = 'https://morganmcg1.github.io/xlsr_finetune/' git_url = 'https://github.com/morganmcg1/xlsr_finetune/tree/master/' def custom_doc_links(name): return None
# Copyright 2021 Jason Rumney # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. DOMAIN = "metlink" ATTRIBUTION = "Data provided by Greater Wellington Regional Council" CONF_STOPS = "stops" CONF_STOP_ID = "stop_id" CONF_DEST = "destination" CONF_ROUTE = "route" CONF_NUM_DEPARTURES = "num_departures" ATTR_ACCESSIBLE = "wheelchair_accessible" ATTR_AIMED = "aimed" ATTR_ARRIVAL = "arrival" ATTR_CLOSED = "closed" ATTR_DELAY = "delay" ATTR_DEPARTURE = "departure" ATTR_DEPARTURES = "departures" ATTR_DESCRIPTION = "description" ATTR_DESTINATION = "destination" ATTR_DESTINATION_ID = "destination_id" ATTR_DIRECTION = "direction" ATTR_EXPECTED = "expected" ATTR_FAREZONE = "farezone" ATTR_MONITORED = "monitored" ATTR_NAME = "name" ATTR_OPERATOR = "operator" ATTR_ORIGIN = "origin" ATTR_SERVICE = "service_id" ATTR_STATUS = "status" ATTR_STOP = "stop_id" ATTR_STOP_NAME = "stop_name" ATTR_VEHICLE = "vehicle_id"
domain = 'metlink' attribution = 'Data provided by Greater Wellington Regional Council' conf_stops = 'stops' conf_stop_id = 'stop_id' conf_dest = 'destination' conf_route = 'route' conf_num_departures = 'num_departures' attr_accessible = 'wheelchair_accessible' attr_aimed = 'aimed' attr_arrival = 'arrival' attr_closed = 'closed' attr_delay = 'delay' attr_departure = 'departure' attr_departures = 'departures' attr_description = 'description' attr_destination = 'destination' attr_destination_id = 'destination_id' attr_direction = 'direction' attr_expected = 'expected' attr_farezone = 'farezone' attr_monitored = 'monitored' attr_name = 'name' attr_operator = 'operator' attr_origin = 'origin' attr_service = 'service_id' attr_status = 'status' attr_stop = 'stop_id' attr_stop_name = 'stop_name' attr_vehicle = 'vehicle_id'
def cria_matriz(linhas, colunas, valor): matriz = [] for i in range(linhas): lin = [] for j in range(colunas): lin.append(valor) matriz.append(lin) return matriz def le_matriz(): linhas = int(input("Digite a quantidade de linhas: ")) colunas = int(input("Digite a quantidade de colunas: ")) return cria_matriz(linhas, colunas) def imprime_matriz(tabela): for i in tabela: print(i)
def cria_matriz(linhas, colunas, valor): matriz = [] for i in range(linhas): lin = [] for j in range(colunas): lin.append(valor) matriz.append(lin) return matriz def le_matriz(): linhas = int(input('Digite a quantidade de linhas: ')) colunas = int(input('Digite a quantidade de colunas: ')) return cria_matriz(linhas, colunas) def imprime_matriz(tabela): for i in tabela: print(i)
ELECTION_HOME="election@home" ELECTION_VIEW="election@view" ELECTION_META="election@meta" ELECTION_EDIT="election@edit" ELECTION_SCHEDULE="election@schedule" ELECTION_EXTEND="election@extend" ELECTION_ARCHIVE="election@archive" ELECTION_COPY="election@copy" ELECTION_BADGE="election@badge" ELECTION_TRUSTEES_HOME="election@trustees" ELECTION_TRUSTEES_VIEW="election@trustees@view" ELECTION_TRUSTEES_NEW="election@trustees@new" ELECTION_TRUSTEES_ADD_HELIOS="election@trustees@add-helios" ELECTION_TRUSTEES_DELETE="election@trustees@delete" ELECTION_TRUSTEE_HOME="election@trustee" ELECTION_TRUSTEE_SEND_URL="election@trustee@send-url" ELECTION_TRUSTEE_KEY_GENERATOR="election@trustee@key-generator" ELECTION_TRUSTEE_CHECK_SK="election@trustee@check-sk" ELECTION_TRUSTEE_UPLOAD_PK="election@trustee@upload-pk" ELECTION_TRUSTEE_DECRYPT_AND_PROVE="election@trustee@decrypt-and-prove" ELECTION_TRUSTEE_UPLOAD_DECRYPTION="election@trustee@upload-decryption" ELECTION_RESULT="election@result" ELECTION_RESULT_PROOF="election@result@proof" ELECTION_BBOARD="election@bboard" ELECTION_AUDITED_BALLOTS="election@audited-ballots" ELECTION_GET_RANDOMNESS="election@get-randomness" ELECTION_ENCRYPT_BALLOT="election@encrypt-ballot" ELECTION_QUESTIONS="election@questions" ELECTION_SET_REG="election@set-reg" ELECTION_SET_FEATURED="election@set-featured" ELECTION_SAVE_QUESTIONS="election@save-questions" ELECTION_REGISTER="election@register" ELECTION_FREEZE="election@freeze" ELECTION_COMPUTE_TALLY="election@compute-tally" ELECTION_COMBINE_DECRYPTIONS="election@combine-decryptions" ELECTION_RELEASE_RESULT="election@release-result" ELECTION_CAST="election@cast" ELECTION_CAST_CONFIRM="election@cast-confirm" ELECTION_PASSWORD_VOTER_LOGIN="election@password-voter-login" ELECTION_CAST_DONE="election@cast-done" ELECTION_POST_AUDITED_BALLOT="election@post-audited-ballot" ELECTION_VOTERS_HOME="election@voters" ELECTION_VOTERS_UPLOAD="election@voters@upload" ELECTION_VOTERS_UPLOAD_CANCEL="election@voters@upload-cancel" ELECTION_VOTERS_LIST="election@voters@list" ELECTION_VOTERS_LIST_PRETTY="election@voters@list-pretty" ELECTION_VOTERS_ELIGIBILITY="election@voters@eligibility" ELECTION_VOTERS_EMAIL="election@voters@email" ELECTION_VOTER="election@voter" ELECTION_VOTER_DELETE="election@voter@delete" ELECTION_BALLOTS_LIST="election@ballots@list" ELECTION_BALLOTS_VOTER="election@ballots@voter" ELECTION_BALLOTS_VOTER_LAST="election@ballots@voter@last"
election_home = 'election@home' election_view = 'election@view' election_meta = 'election@meta' election_edit = 'election@edit' election_schedule = 'election@schedule' election_extend = 'election@extend' election_archive = 'election@archive' election_copy = 'election@copy' election_badge = 'election@badge' election_trustees_home = 'election@trustees' election_trustees_view = 'election@trustees@view' election_trustees_new = 'election@trustees@new' election_trustees_add_helios = 'election@trustees@add-helios' election_trustees_delete = 'election@trustees@delete' election_trustee_home = 'election@trustee' election_trustee_send_url = 'election@trustee@send-url' election_trustee_key_generator = 'election@trustee@key-generator' election_trustee_check_sk = 'election@trustee@check-sk' election_trustee_upload_pk = 'election@trustee@upload-pk' election_trustee_decrypt_and_prove = 'election@trustee@decrypt-and-prove' election_trustee_upload_decryption = 'election@trustee@upload-decryption' election_result = 'election@result' election_result_proof = 'election@result@proof' election_bboard = 'election@bboard' election_audited_ballots = 'election@audited-ballots' election_get_randomness = 'election@get-randomness' election_encrypt_ballot = 'election@encrypt-ballot' election_questions = 'election@questions' election_set_reg = 'election@set-reg' election_set_featured = 'election@set-featured' election_save_questions = 'election@save-questions' election_register = 'election@register' election_freeze = 'election@freeze' election_compute_tally = 'election@compute-tally' election_combine_decryptions = 'election@combine-decryptions' election_release_result = 'election@release-result' election_cast = 'election@cast' election_cast_confirm = 'election@cast-confirm' election_password_voter_login = 'election@password-voter-login' election_cast_done = 'election@cast-done' election_post_audited_ballot = 'election@post-audited-ballot' election_voters_home = 'election@voters' election_voters_upload = 'election@voters@upload' election_voters_upload_cancel = 'election@voters@upload-cancel' election_voters_list = 'election@voters@list' election_voters_list_pretty = 'election@voters@list-pretty' election_voters_eligibility = 'election@voters@eligibility' election_voters_email = 'election@voters@email' election_voter = 'election@voter' election_voter_delete = 'election@voter@delete' election_ballots_list = 'election@ballots@list' election_ballots_voter = 'election@ballots@voter' election_ballots_voter_last = 'election@ballots@voter@last'
class IdentifierLabels: ID = "CMPLNT_NUM" class DateTimeEventLabels: EVENT_START_TIMESTAMP = "CMPLNT_FR_DT" EVENT_END_TIMESTAMP = "CMPLNT_TO_DT" class DateTimeSubmissionLabels: SUBMISSION_TO_POLICE_TIMESTAMP = "RPT_DT" class LawBreakingLabels: KEY_CODE = "KY_CD" PD_CODE = "PD_CD" LAW_BREAKING_LEVEL = "LAW_CAT_CD" class EventStatusLabels: EVENT_STATUS = "CRM_ATPT_CPTD_CD" class EventSurroundingsLabels: PLACE_TYPE = "PREM_TYP_DESC" PLACE_TYPE_POSITION = "LOC_OF_OCCUR_DESC" class EventLocationLabels: PRECINCT_CODE = "ADDR_PCT_CD" BOROUGH_NAME = "BORO_NM" LATITUDE = "Latitude" LONGITUDE = "Longitude" class SuspectLabels: SUSPECT_AGE_GROUP = "SUSP_AGE_GROUP" SUSPECT_RACE = "SUSP_RACE" SUSPECT_SEX = "SUSP_SEX" class VictimLabels: VICTIM_AGE_GROUP = "VIC_AGE_GROUP" VICTIM_RACE = "VIC_RACE" VICTIM_SEX = "VIC_SEX"
class Identifierlabels: id = 'CMPLNT_NUM' class Datetimeeventlabels: event_start_timestamp = 'CMPLNT_FR_DT' event_end_timestamp = 'CMPLNT_TO_DT' class Datetimesubmissionlabels: submission_to_police_timestamp = 'RPT_DT' class Lawbreakinglabels: key_code = 'KY_CD' pd_code = 'PD_CD' law_breaking_level = 'LAW_CAT_CD' class Eventstatuslabels: event_status = 'CRM_ATPT_CPTD_CD' class Eventsurroundingslabels: place_type = 'PREM_TYP_DESC' place_type_position = 'LOC_OF_OCCUR_DESC' class Eventlocationlabels: precinct_code = 'ADDR_PCT_CD' borough_name = 'BORO_NM' latitude = 'Latitude' longitude = 'Longitude' class Suspectlabels: suspect_age_group = 'SUSP_AGE_GROUP' suspect_race = 'SUSP_RACE' suspect_sex = 'SUSP_SEX' class Victimlabels: victim_age_group = 'VIC_AGE_GROUP' victim_race = 'VIC_RACE' victim_sex = 'VIC_SEX'
class Solution: def longestArithSeqLength(self, A: List[int]) -> int: if len(A) <= 2: return len(A) ans = 2 dp = collections.defaultdict(set) for i, num in enumerate(A): if num in dp: for d, cnt in dp.pop(num): dp[num + d].add((d, cnt + 1)) ans = max(ans, cnt + 1) for j in range(i): first = A[j] dp[num * 2 - first].add((num - first, 2)) return ans
class Solution: def longest_arith_seq_length(self, A: List[int]) -> int: if len(A) <= 2: return len(A) ans = 2 dp = collections.defaultdict(set) for (i, num) in enumerate(A): if num in dp: for (d, cnt) in dp.pop(num): dp[num + d].add((d, cnt + 1)) ans = max(ans, cnt + 1) for j in range(i): first = A[j] dp[num * 2 - first].add((num - first, 2)) return ans
H, W = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(H)] for i1 in range(H): for i2 in range(i1 + 1, H): for j1 in range(W): for j2 in range(j1 + 1, W): if A[i1][j1] + A[i2][j2] > A[i2][j1] + A[i1][j2]: print('No') exit() print('Yes')
(h, w) = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(H)] for i1 in range(H): for i2 in range(i1 + 1, H): for j1 in range(W): for j2 in range(j1 + 1, W): if A[i1][j1] + A[i2][j2] > A[i2][j1] + A[i1][j2]: print('No') exit() print('Yes')
# s.remove(0) s = {1, 2, 3} s.remove(0) print(s) # bug as it should return a KeyError exception !!!
s = {1, 2, 3} s.remove(0) print(s)
class Contacts: def __init__(self, first_name=None, last_name=None, id=None, email_1=None, email_2=None, email_3=None, home_phone=None, mobile_phone=None, work_phone=None): self.first_name = first_name self.last_name = last_name self.mobile_phone = mobile_phone self.home_phone = home_phone self.work_phone = work_phone self.id = id self.email_1 = email_1 self.email_2 = email_2 self.email_3 = email_3 def __eq__(self, other): return (self.id == other.id or self.id is None or other.id is None) \ and self.first_name == other.first_name and self.last_name==other.last_name
class Contacts: def __init__(self, first_name=None, last_name=None, id=None, email_1=None, email_2=None, email_3=None, home_phone=None, mobile_phone=None, work_phone=None): self.first_name = first_name self.last_name = last_name self.mobile_phone = mobile_phone self.home_phone = home_phone self.work_phone = work_phone self.id = id self.email_1 = email_1 self.email_2 = email_2 self.email_3 = email_3 def __eq__(self, other): return (self.id == other.id or self.id is None or other.id is None) and self.first_name == other.first_name and (self.last_name == other.last_name)
""" CRUD system for Task Create, Read, Update, Delete """ # Create Task def create_task(): """ Create a task into the database """
""" CRUD system for Task Create, Read, Update, Delete """ def create_task(): """ Create a task into the database """
''' The rows of levels in the .azr file are converted to list of strings. These indices make it more convenient to access the desired parameter. ''' J_INDEX = 0 PI_INDEX = 1 ENERGY_INDEX = 2 ENERGY_FIXED_INDEX = 3 CHANNEL_INDEX = 5 WIDTH_INDEX = 11 WIDTH_FIXED_INDEX = 10 SEPARATION_ENERGY_INDEX = 21 CHANNEL_RADIUS_INDEX = 27 OUTPUT_DIR_INDEX = 2 DATA_FILEPATH_INDEX = 11 LEVEL_INCLUDE_INDEX = 9 ''' Data-related constants. ''' INCLUDE_INDEX = 0 IN_CHANNEL_INDEX = 1 OUT_CHANNEL_INDEX = 2 NORM_FACTOR_INDEX = 8 VARY_NORM_FACTOR_INDEX = 9 FILEPATH_INDEX = 11
""" The rows of levels in the .azr file are converted to list of strings. These indices make it more convenient to access the desired parameter. """ j_index = 0 pi_index = 1 energy_index = 2 energy_fixed_index = 3 channel_index = 5 width_index = 11 width_fixed_index = 10 separation_energy_index = 21 channel_radius_index = 27 output_dir_index = 2 data_filepath_index = 11 level_include_index = 9 '\nData-related constants.\n' include_index = 0 in_channel_index = 1 out_channel_index = 2 norm_factor_index = 8 vary_norm_factor_index = 9 filepath_index = 11
class ModelMinxi: def to_dict(self,*exclude): attr_dict = {} for field in self._meta.fields: name = field.attname if name not in exclude: attr_dict[name] = getattr(self,name) return attr_dict
class Modelminxi: def to_dict(self, *exclude): attr_dict = {} for field in self._meta.fields: name = field.attname if name not in exclude: attr_dict[name] = getattr(self, name) return attr_dict
""" ********** LESSON 1A ********** In the following code (lines 12-17), change x to 10, and then print out whether or not x is 10. """ x = 5 if x == 5: print("x is five!") else: print("x is not five...") """ Expected solution: x = 10 if x == 10: print("x is ten!") else: print("x is not ten...") """
""" ********** LESSON 1A ********** In the following code (lines 12-17), change x to 10, and then print out whether or not x is 10. """ x = 5 if x == 5: print('x is five!') else: print('x is not five...') '\n\nExpected solution:\n\nx = 10\n\nif x == 10:\n print("x is ten!")\nelse:\n print("x is not ten...")\n\n'
"""248-Get current file name and path. Download all snippets so far: https://wp.me/Pa5TU8-1yg Blog: stevepython.wordpress.com requirements: None. origin: Various. """ # To get the name and path of the current file in use: print(__file__)
"""248-Get current file name and path. Download all snippets so far: https://wp.me/Pa5TU8-1yg Blog: stevepython.wordpress.com requirements: None. origin: Various. """ print(__file__)
numbers = [] for i in range(1,101) : numbers.append(i) prime_number = [] for number in numbers : zero_mod = [] if number == 1 : continue else : for divider in range(1,number+1) : remain = number % divider if remain == 0 : zero_mod.append(divider) if len(zero_mod) == 2 : prime_number.append(number) print(prime_number)
numbers = [] for i in range(1, 101): numbers.append(i) prime_number = [] for number in numbers: zero_mod = [] if number == 1: continue else: for divider in range(1, number + 1): remain = number % divider if remain == 0: zero_mod.append(divider) if len(zero_mod) == 2: prime_number.append(number) print(prime_number)
def get_data(): data = [] data_file = open("data.txt") # data_file = open("test.txt") for val in data_file: data.append(val.strip()) data_file.close() cubes = {} for row in range(len(data)): for col in range(len(data[row])): if data[row][col] == '#': cubes[f'{row}|{col}|0|0'] = 1 print(f"read {len(data)} lines\n") return cubes def print_state(cube_active_neighbor_counts, active_cubes): for z in range(-7, 8): print(f'z:{z}') for x in range(-7, 8): count_line = '' active_line = '' for y in range(-7, 8): cube_location = f'{x}|{y}|{z}' spacer = ' ' if cube_location == '0|0|0': spacer = '<' if cube_location in cube_active_neighbor_counts: count_line += str( cube_active_neighbor_counts[cube_location]) + spacer else: count_line += ' ' active = '#' inactive = '.' if cube_location == '0|0|0': active = '*' inactive = '+' if cube_location in active_cubes: active_line += active else: active_line += inactive print(active_line, ' ', count_line) def check_data(active_cubes): for cycle in range(6): print(f'\nCycle: {cycle + 1}') cube_active_neighbor_counts = {} for cube in active_cubes: cx, cy, cz, cw = [int(c) for c in cube.split('|')] # set neighbor counts # print(cube) for x in range(cx-1, cx+2): for y in range(cy-1, cy+2): for z in range(cz-1, cz+2): for w in range(cw-1, cw+2): cube_location = f'{x}|{y}|{z}|{w}' if not (cube_location == cube): if cube_location in cube_active_neighbor_counts: cube_active_neighbor_counts[cube_location] += 1 else: cube_active_neighbor_counts[cube_location] = 1 else: if cube_location not in cube_active_neighbor_counts: cube_active_neighbor_counts[cube_location] = 0 # print(cube_location, # cube_active_neighbor_counts[cube_location]) # now make new cubes new_cubes = {} for cube_location in cube_active_neighbor_counts: is_active = False if cube_location in active_cubes: is_active = active_cubes[cube_location] if is_active and (cube_active_neighbor_counts[cube_location] == 2 or cube_active_neighbor_counts[cube_location] == 3): new_cubes[cube_location] = 1 if not (is_active) and cube_active_neighbor_counts[cube_location] == 3: new_cubes[cube_location] = 1 active_cubes = new_cubes print(f'Active Cube Count: {len(active_cubes)}') # print_state(cube_active_neighbor_counts, active_cubes) print(len(active_cubes)) def main(): data = get_data() check_data(data) main() # track only live cubes # track them as x-y-z strings in a hash # so '1-2-1' in the hash means that cube is live.
def get_data(): data = [] data_file = open('data.txt') for val in data_file: data.append(val.strip()) data_file.close() cubes = {} for row in range(len(data)): for col in range(len(data[row])): if data[row][col] == '#': cubes[f'{row}|{col}|0|0'] = 1 print(f'read {len(data)} lines\n') return cubes def print_state(cube_active_neighbor_counts, active_cubes): for z in range(-7, 8): print(f'z:{z}') for x in range(-7, 8): count_line = '' active_line = '' for y in range(-7, 8): cube_location = f'{x}|{y}|{z}' spacer = ' ' if cube_location == '0|0|0': spacer = '<' if cube_location in cube_active_neighbor_counts: count_line += str(cube_active_neighbor_counts[cube_location]) + spacer else: count_line += ' ' active = '#' inactive = '.' if cube_location == '0|0|0': active = '*' inactive = '+' if cube_location in active_cubes: active_line += active else: active_line += inactive print(active_line, ' ', count_line) def check_data(active_cubes): for cycle in range(6): print(f'\nCycle: {cycle + 1}') cube_active_neighbor_counts = {} for cube in active_cubes: (cx, cy, cz, cw) = [int(c) for c in cube.split('|')] for x in range(cx - 1, cx + 2): for y in range(cy - 1, cy + 2): for z in range(cz - 1, cz + 2): for w in range(cw - 1, cw + 2): cube_location = f'{x}|{y}|{z}|{w}' if not cube_location == cube: if cube_location in cube_active_neighbor_counts: cube_active_neighbor_counts[cube_location] += 1 else: cube_active_neighbor_counts[cube_location] = 1 elif cube_location not in cube_active_neighbor_counts: cube_active_neighbor_counts[cube_location] = 0 new_cubes = {} for cube_location in cube_active_neighbor_counts: is_active = False if cube_location in active_cubes: is_active = active_cubes[cube_location] if is_active and (cube_active_neighbor_counts[cube_location] == 2 or cube_active_neighbor_counts[cube_location] == 3): new_cubes[cube_location] = 1 if not is_active and cube_active_neighbor_counts[cube_location] == 3: new_cubes[cube_location] = 1 active_cubes = new_cubes print(f'Active Cube Count: {len(active_cubes)}') print(len(active_cubes)) def main(): data = get_data() check_data(data) main()
# Write a python program to get a single string from two givan string, separated by a space # and swap a first two char of each string # Simple string = "abc", "xyz" # Expected result = "xyc", "abz" # st = "abc", "xyz" # print(st[1][:2] + st[0][-1:]) # print(st[0][:2] + st[1][-1:]) def char_swap(a, b): x = b[:2] + a[2:] y = a[:2] + b[2:] return x + " " + y if __name__ == "__main__": print(char_swap("abc", "xyz"))
def char_swap(a, b): x = b[:2] + a[2:] y = a[:2] + b[2:] return x + ' ' + y if __name__ == '__main__': print(char_swap('abc', 'xyz'))
''' Write a function that takes variable number of arguments and returns the sum , sum of squares, sum of cubes, average, multiplication, multiplication of squares, multiplication of cubes of that numbers. ''' def calc(*a): sum = 0 mul = 1 sumSQR = 0 sumCubes = 0 mulSQR = 1 mulCubes = 1 for i in a: sum = sum+i mul = mul*i sumSQR = sumSQR+(i**2) sumCubes = sumCubes+ (i**3) mulSQR = mulSQR*(i**2) mulCubes = mulCubes*(i**3) return sum,mul,sumSQR,sumCubes,mulSQR,mulCubes #Call sum,mul,sumSQR,sumCubes,mulSQR,mulCubes=calc(1,2,4,5,6,7,8) print("sum = {},mul= {},sumSQR= {},sumCubes={},mulSQR={},mulCubes={}".format(sum,mul,sumSQR,sumCubes,mulSQR,mulCubes))
""" Write a function that takes variable number of arguments and returns the sum , sum of squares, sum of cubes, average, multiplication, multiplication of squares, multiplication of cubes of that numbers. """ def calc(*a): sum = 0 mul = 1 sum_sqr = 0 sum_cubes = 0 mul_sqr = 1 mul_cubes = 1 for i in a: sum = sum + i mul = mul * i sum_sqr = sumSQR + i ** 2 sum_cubes = sumCubes + i ** 3 mul_sqr = mulSQR * i ** 2 mul_cubes = mulCubes * i ** 3 return (sum, mul, sumSQR, sumCubes, mulSQR, mulCubes) (sum, mul, sum_sqr, sum_cubes, mul_sqr, mul_cubes) = calc(1, 2, 4, 5, 6, 7, 8) print('sum = {},mul= {},sumSQR= {},sumCubes={},mulSQR={},mulCubes={}'.format(sum, mul, sumSQR, sumCubes, mulSQR, mulCubes))
# URLs MEXC_BASE_URL = "https://www.mexc.com" MEXC_SYMBOL_URL = '/open/api/v2/market/symbols' MEXC_TICKERS_URL = '/open/api/v2/market/ticker' MEXC_DEPTH_URL = '/open/api/v2/market/depth?symbol={trading_pair}&depth=200' MEXC_PRICE_URL = '/open/api/v2/market/ticker?symbol={trading_pair}' MEXC_PING_URL = '/open/api/v2/common/ping' MEXC_PLACE_ORDER = "/open/api/v2/order/place" MEXC_ORDER_DETAILS_URL = '/open/api/v2/order/query' MEXC_ORDER_CANCEL = '/open/api/v2/order/cancel' MEXC_BATCH_ORDER_CANCEL = '/open/api/v2/order/cancel' MEXC_BALANCE_URL = '/open/api/v2/account/info' MEXC_DEAL_DETAIL = '/open/api/v2/order/deal_detail' # WS MEXC_WS_URL_PUBLIC = 'wss://wbs.mexc.com/raw/ws'
mexc_base_url = 'https://www.mexc.com' mexc_symbol_url = '/open/api/v2/market/symbols' mexc_tickers_url = '/open/api/v2/market/ticker' mexc_depth_url = '/open/api/v2/market/depth?symbol={trading_pair}&depth=200' mexc_price_url = '/open/api/v2/market/ticker?symbol={trading_pair}' mexc_ping_url = '/open/api/v2/common/ping' mexc_place_order = '/open/api/v2/order/place' mexc_order_details_url = '/open/api/v2/order/query' mexc_order_cancel = '/open/api/v2/order/cancel' mexc_batch_order_cancel = '/open/api/v2/order/cancel' mexc_balance_url = '/open/api/v2/account/info' mexc_deal_detail = '/open/api/v2/order/deal_detail' mexc_ws_url_public = 'wss://wbs.mexc.com/raw/ws'
CONFUSION_MATRIX = "confusion_matrix" AP = "ap" DETECTION_AP = "detection_mAP" DETECTION_APS = "detection_APs" MOTA = "MOTA" MOTP = "MOTP" FALSE_POSITIVES = "false_positives" FALSE_NEGATIVES = "false_negatives" ID_SWITCHES = "id_switches" AP_INTERPOLATED = "ap_interpolated" ERRORS = "errors" IOU = "iou" BINARY_IOU = "binary_IOU" RANKS = "ranks" DT_NEG = "u0" DT_POS = "u1" CLICKS = "clicks" FORWARD_INTERACTIVE = "forward_interactive" FORWARD_RECURSIVE = "forward_recursive" ONESHOT_INTERACTIVE = "oneshot_interactive" ITERATIVE_FORWARD = "iterative_forward" INTERACTIVE_DT_METHOD = "dt_method" DT_NEG_PARAMS = "dt_neg_params" DT_POS_PARAMS = "dt_pos_params" USE_CLICKS = "use_clicks" OLD_LABEL_AS_DT = "old_label_as_distance_transform" STRATEGY = "STRATEGY" IGNORE_CLASSES = "ignore_classes" DT_FN_ARGS = "distance_transform_fn_args" # Train recursively - add a click based on the previous output mask for the interactive correction network. RECURSIVE_TRAINING = "recursive_training" YS_ARGMAX = "ys_argmax" TAGS = "tags" BBOXES = "bboxes" IGNORE_REGIONS = "ignore_regions" CLASSES = "classes" IDS = "ids" UNNORMALIZED_IMG = "unnormalized_img" IMG_IDS = "img_ids" ORIGINAL_SIZES = "original_size" RESIZED_SIZES = "resized_size" CLUSTER_IDS = "cluster_ids" ORIGINAL_LABELS = "original_labels" ADJUSTED_MUTUAL_INFORMATION = "AMI" HOMOGENEITY = "homogeneity" COMPLETENESS = "completeness" EMBEDDING = "embedding" PREV_NEG_CLICKS = 'prev_neg_clicks' PREV_POS_CLICKS = 'prev_pos_clicks' SCENE_INFOS = "scene_infos" LABELS = "labels" INPUTS = "inputs" BYPASS_MASKS_FLAG = "bypass_masks_flag"
confusion_matrix = 'confusion_matrix' ap = 'ap' detection_ap = 'detection_mAP' detection_aps = 'detection_APs' mota = 'MOTA' motp = 'MOTP' false_positives = 'false_positives' false_negatives = 'false_negatives' id_switches = 'id_switches' ap_interpolated = 'ap_interpolated' errors = 'errors' iou = 'iou' binary_iou = 'binary_IOU' ranks = 'ranks' dt_neg = 'u0' dt_pos = 'u1' clicks = 'clicks' forward_interactive = 'forward_interactive' forward_recursive = 'forward_recursive' oneshot_interactive = 'oneshot_interactive' iterative_forward = 'iterative_forward' interactive_dt_method = 'dt_method' dt_neg_params = 'dt_neg_params' dt_pos_params = 'dt_pos_params' use_clicks = 'use_clicks' old_label_as_dt = 'old_label_as_distance_transform' strategy = 'STRATEGY' ignore_classes = 'ignore_classes' dt_fn_args = 'distance_transform_fn_args' recursive_training = 'recursive_training' ys_argmax = 'ys_argmax' tags = 'tags' bboxes = 'bboxes' ignore_regions = 'ignore_regions' classes = 'classes' ids = 'ids' unnormalized_img = 'unnormalized_img' img_ids = 'img_ids' original_sizes = 'original_size' resized_sizes = 'resized_size' cluster_ids = 'cluster_ids' original_labels = 'original_labels' adjusted_mutual_information = 'AMI' homogeneity = 'homogeneity' completeness = 'completeness' embedding = 'embedding' prev_neg_clicks = 'prev_neg_clicks' prev_pos_clicks = 'prev_pos_clicks' scene_infos = 'scene_infos' labels = 'labels' inputs = 'inputs' bypass_masks_flag = 'bypass_masks_flag'
class GitRequire(object): def __init__(self, git_url=None, branch=None, submodule=False): self.git_url = git_url self.submodule = submodule self.branch = branch def clone_params(self): clone_params = {"single_branch": True} if self.branch is not None: clone_params["branch"] = self.branch return clone_params def __eq__(self, other): return ( self.git_url == other.git_url and self.submodule == other.submodule and self.branch == other.branch ) def __repr__(self): return "%s,%s,%s" % (self.git_url, self.branch, self.submodule)
class Gitrequire(object): def __init__(self, git_url=None, branch=None, submodule=False): self.git_url = git_url self.submodule = submodule self.branch = branch def clone_params(self): clone_params = {'single_branch': True} if self.branch is not None: clone_params['branch'] = self.branch return clone_params def __eq__(self, other): return self.git_url == other.git_url and self.submodule == other.submodule and (self.branch == other.branch) def __repr__(self): return '%s,%s,%s' % (self.git_url, self.branch, self.submodule)
# Object in Python do not have a fixed layout. class X: def __init__(self, a): self.a = a x = X(1) print(x.a) # 1 # For example, we can add new attributes to objects: x.b = 5 print(x.b) # 5 # Or even new methods into a class: X.foo = lambda self: 10 print(x.foo()) # 10 # Or even changing base classes during runtime (this is just for illustration, # I do not recommend doing this in practice): class A: def foo(self): return 1 class B(A): pass class C: def foo(self): return 2 b = B() print(b.foo(), B.__bases__) # 1 (<class '__main__.A'>,) B.__bases__ = (C,) print(b.foo(), B.__bases__) # 2 (<class '__main__.C'>,)
class X: def __init__(self, a): self.a = a x = x(1) print(x.a) x.b = 5 print(x.b) X.foo = lambda self: 10 print(x.foo()) class A: def foo(self): return 1 class B(A): pass class C: def foo(self): return 2 b = b() print(b.foo(), B.__bases__) B.__bases__ = (C,) print(b.foo(), B.__bases__)
# encoding: utf-8 # module _locale # from (built-in) # by generator 1.145 """ Support for POSIX locales. """ # no imports # Variables with simple values ABDAY_1 = 131072 ABDAY_2 = 131073 ABDAY_3 = 131074 ABDAY_4 = 131075 ABDAY_5 = 131076 ABDAY_6 = 131077 ABDAY_7 = 131078 ABMON_1 = 131086 ABMON_10 = 131095 ABMON_11 = 131096 ABMON_12 = 131097 ABMON_2 = 131087 ABMON_3 = 131088 ABMON_4 = 131089 ABMON_5 = 131090 ABMON_6 = 131091 ABMON_7 = 131092 ABMON_8 = 131093 ABMON_9 = 131094 ALT_DIGITS = 131119 AM_STR = 131110 CHAR_MAX = 127 CODESET = 14 CRNCYSTR = 262159 DAY_1 = 131079 DAY_2 = 131080 DAY_3 = 131081 DAY_4 = 131082 DAY_5 = 131083 DAY_6 = 131084 DAY_7 = 131085 D_FMT = 131113 D_T_FMT = 131112 ERA = 131116 ERA_D_FMT = 131118 ERA_D_T_FMT = 131120 ERA_T_FMT = 131121 LC_ALL = 6 LC_COLLATE = 3 LC_CTYPE = 0 LC_MESSAGES = 5 LC_MONETARY = 4 LC_NUMERIC = 1 LC_TIME = 2 MON_1 = 131098 MON_10 = 131107 MON_11 = 131108 MON_12 = 131109 MON_2 = 131099 MON_3 = 131100 MON_4 = 131101 MON_5 = 131102 MON_6 = 131103 MON_7 = 131104 MON_8 = 131105 MON_9 = 131106 NOEXPR = 327681 PM_STR = 131111 RADIXCHAR = 65536 THOUSEP = 65537 T_FMT = 131114 T_FMT_AMPM = 131115 YESEXPR = 327680 _DATE_FMT = 131180 # functions def bindtextdomain(domain, dir): # real signature unknown; restored from __doc__ """ bindtextdomain(domain, dir) -> string Bind the C library's domain to dir. """ return "" def bind_textdomain_codeset(domain, codeset): # real signature unknown; restored from __doc__ """ bind_textdomain_codeset(domain, codeset) -> string Bind the C library's domain to codeset. """ return "" def dcgettext(domain, msg, category): # real signature unknown; restored from __doc__ """ dcgettext(domain, msg, category) -> string Return translation of msg in domain and category. """ return "" def dgettext(domain, msg): # real signature unknown; restored from __doc__ """ dgettext(domain, msg) -> string Return translation of msg in domain. """ return "" def gettext(msg): # real signature unknown; restored from __doc__ """ gettext(msg) -> string Return translation of msg. """ return "" def localeconv(*args, **kwargs): # real signature unknown """ () -> dict. Returns numeric and monetary locale-specific parameters. """ pass def nl_langinfo(key): # real signature unknown; restored from __doc__ """ nl_langinfo(key) -> string Return the value for the locale information associated with key. """ return "" def setlocale(*args, **kwargs): # real signature unknown """ (integer,string=None) -> string. Activates/queries locale processing. """ pass def strcoll(*args, **kwargs): # real signature unknown """ string,string -> int. Compares two strings according to the locale. """ pass def strxfrm(string): # real signature unknown; restored from __doc__ """ strxfrm(string) -> string. Return a string that can be used as a key for locale-aware comparisons. """ pass def textdomain(domain): # real signature unknown; restored from __doc__ """ textdomain(domain) -> string Set the C library's textdmain to domain, returning the new domain. """ return "" # classes class Error(Exception): # no doc def __init__(self, *args, **kwargs): # real signature unknown pass __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """list of weak references to the object (if defined)""" class __loader__(object): """ Meta path import for built-in modules. All methods are either class or static methods to avoid the need to instantiate the class. """ @classmethod def create_module(cls, *args, **kwargs): # real signature unknown """ Create a built-in module """ pass @classmethod def exec_module(cls, *args, **kwargs): # real signature unknown """ Exec a built-in module """ pass @classmethod def find_module(cls, *args, **kwargs): # real signature unknown """ Find the built-in module. If 'path' is ever specified then the search is considered a failure. This method is deprecated. Use find_spec() instead. """ pass @classmethod def find_spec(cls, *args, **kwargs): # real signature unknown pass @classmethod def get_code(cls, *args, **kwargs): # real signature unknown """ Return None as built-in modules do not have code objects. """ pass @classmethod def get_source(cls, *args, **kwargs): # real signature unknown """ Return None as built-in modules do not have source code. """ pass @classmethod def is_package(cls, *args, **kwargs): # real signature unknown """ Return False as built-in modules are never packages. """ pass @classmethod def load_module(cls, *args, **kwargs): # real signature unknown """ Load the specified module into sys.modules and return it. This method is deprecated. Use loader.exec_module instead. """ pass def module_repr(module): # reliably restored by inspect """ Return repr for the module. The method is deprecated. The import machinery does the job itself. """ pass def __init__(self, *args, **kwargs): # real signature unknown pass __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) # default """list of weak references to the object (if defined)""" __dict__ = None # (!) real value is '' # variables with complex values __spec__ = None # (!) real value is ''
""" Support for POSIX locales. """ abday_1 = 131072 abday_2 = 131073 abday_3 = 131074 abday_4 = 131075 abday_5 = 131076 abday_6 = 131077 abday_7 = 131078 abmon_1 = 131086 abmon_10 = 131095 abmon_11 = 131096 abmon_12 = 131097 abmon_2 = 131087 abmon_3 = 131088 abmon_4 = 131089 abmon_5 = 131090 abmon_6 = 131091 abmon_7 = 131092 abmon_8 = 131093 abmon_9 = 131094 alt_digits = 131119 am_str = 131110 char_max = 127 codeset = 14 crncystr = 262159 day_1 = 131079 day_2 = 131080 day_3 = 131081 day_4 = 131082 day_5 = 131083 day_6 = 131084 day_7 = 131085 d_fmt = 131113 d_t_fmt = 131112 era = 131116 era_d_fmt = 131118 era_d_t_fmt = 131120 era_t_fmt = 131121 lc_all = 6 lc_collate = 3 lc_ctype = 0 lc_messages = 5 lc_monetary = 4 lc_numeric = 1 lc_time = 2 mon_1 = 131098 mon_10 = 131107 mon_11 = 131108 mon_12 = 131109 mon_2 = 131099 mon_3 = 131100 mon_4 = 131101 mon_5 = 131102 mon_6 = 131103 mon_7 = 131104 mon_8 = 131105 mon_9 = 131106 noexpr = 327681 pm_str = 131111 radixchar = 65536 thousep = 65537 t_fmt = 131114 t_fmt_ampm = 131115 yesexpr = 327680 _date_fmt = 131180 def bindtextdomain(domain, dir): """ bindtextdomain(domain, dir) -> string Bind the C library's domain to dir. """ return '' def bind_textdomain_codeset(domain, codeset): """ bind_textdomain_codeset(domain, codeset) -> string Bind the C library's domain to codeset. """ return '' def dcgettext(domain, msg, category): """ dcgettext(domain, msg, category) -> string Return translation of msg in domain and category. """ return '' def dgettext(domain, msg): """ dgettext(domain, msg) -> string Return translation of msg in domain. """ return '' def gettext(msg): """ gettext(msg) -> string Return translation of msg. """ return '' def localeconv(*args, **kwargs): """ () -> dict. Returns numeric and monetary locale-specific parameters. """ pass def nl_langinfo(key): """ nl_langinfo(key) -> string Return the value for the locale information associated with key. """ return '' def setlocale(*args, **kwargs): """ (integer,string=None) -> string. Activates/queries locale processing. """ pass def strcoll(*args, **kwargs): """ string,string -> int. Compares two strings according to the locale. """ pass def strxfrm(string): """ strxfrm(string) -> string. Return a string that can be used as a key for locale-aware comparisons. """ pass def textdomain(domain): """ textdomain(domain) -> string Set the C library's textdmain to domain, returning the new domain. """ return '' class Error(Exception): def __init__(self, *args, **kwargs): pass __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) 'list of weak references to the object (if defined)' class __Loader__(object): """ Meta path import for built-in modules. All methods are either class or static methods to avoid the need to instantiate the class. """ @classmethod def create_module(cls, *args, **kwargs): """ Create a built-in module """ pass @classmethod def exec_module(cls, *args, **kwargs): """ Exec a built-in module """ pass @classmethod def find_module(cls, *args, **kwargs): """ Find the built-in module. If 'path' is ever specified then the search is considered a failure. This method is deprecated. Use find_spec() instead. """ pass @classmethod def find_spec(cls, *args, **kwargs): pass @classmethod def get_code(cls, *args, **kwargs): """ Return None as built-in modules do not have code objects. """ pass @classmethod def get_source(cls, *args, **kwargs): """ Return None as built-in modules do not have source code. """ pass @classmethod def is_package(cls, *args, **kwargs): """ Return False as built-in modules are never packages. """ pass @classmethod def load_module(cls, *args, **kwargs): """ Load the specified module into sys.modules and return it. This method is deprecated. Use loader.exec_module instead. """ pass def module_repr(module): """ Return repr for the module. The method is deprecated. The import machinery does the job itself. """ pass def __init__(self, *args, **kwargs): pass __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None) 'list of weak references to the object (if defined)' __dict__ = None __spec__ = None
class Solution: # @param A : list of strings # @return a strings def longestCommonPrefix(self, A): common_substring = "" if A: common_substring = A[0] for s in A[1:]: i = 0 l = len(min(common_substring, s)) while i < l: if s[i] != common_substring[i]: break else: i += 1 common_substring = common_substring[:i] return common_substring s = Solution() print(s.longestCommonPrefix(["abcdefgh", "abefghijk", "abcefgh"])) print(s.longestCommonPrefix([ "aaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ]))
class Solution: def longest_common_prefix(self, A): common_substring = '' if A: common_substring = A[0] for s in A[1:]: i = 0 l = len(min(common_substring, s)) while i < l: if s[i] != common_substring[i]: break else: i += 1 common_substring = common_substring[:i] return common_substring s = solution() print(s.longestCommonPrefix(['abcdefgh', 'abefghijk', 'abcefgh'])) print(s.longestCommonPrefix(['aaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa']))
# Link to the problem: https://www.codechef.com/LTIME63B/problems/EID def EID(): _ = input() A = list(map(int, input().split())) A.sort() size = len(A) diff = A[size - 1] for i in range(size - 1): tempDiff = A[i + 1] - A[i] if tempDiff < diff: diff = tempDiff return diff def main(): T = int(input()) while T: T -= 1 res = EID() print(res) if __name__ == "__main__": main()
def eid(): _ = input() a = list(map(int, input().split())) A.sort() size = len(A) diff = A[size - 1] for i in range(size - 1): temp_diff = A[i + 1] - A[i] if tempDiff < diff: diff = tempDiff return diff def main(): t = int(input()) while T: t -= 1 res = eid() print(res) if __name__ == '__main__': main()
monster = ['fairy', 'goblin', 'ogre', 'werewolf', 'vampire', 'gargoyle', 'pirate', 'undead'] weapon1 = ['dagger', 'stone', 'pistol', 'knife'] weapon2 = ['sword', 'war hammer', 'machine gun', 'battle axe', 'war scythe'] scene = ['grass and yellow wildflowers.', 'sand and sea shells', 'sand and cactus'] place = ['field', 'beach', 'jungle', 'dessert', 'rainforest', 'city']
monster = ['fairy', 'goblin', 'ogre', 'werewolf', 'vampire', 'gargoyle', 'pirate', 'undead'] weapon1 = ['dagger', 'stone', 'pistol', 'knife'] weapon2 = ['sword', 'war hammer', 'machine gun', 'battle axe', 'war scythe'] scene = ['grass and yellow wildflowers.', 'sand and sea shells', 'sand and cactus'] place = ['field', 'beach', 'jungle', 'dessert', 'rainforest', 'city']
# if-elif-else ladder ''' if is a conditional statement that is used to perform different actions based on different conditions. ''' if (5 < 6): print('5 is less than 6') print() print() a = 6 if (a == 5): print('a is equal to 5') else: print('a is not equal to 5') print() print() a = 6 b = 5 if (a < b): print('a is less than b') elif (a == b): print('a is equal to b') else: print('a is greater than b') # elif stands for `else if` ''' On comaparing 2 numbers, we get one of the following 3 results: - a is less than b - a is equal to b - a is greater than b ''' print() print() if (a < b): print('a is less than b') elif (a == b): print('a is equal to b') elif (a > b): print('a is greater than b') ''' Conclusion: - An if statement states whether to execute some code or not. - An elif statement states the same as if, but is executed only if the previous if statement is not true. - An else statement is executed if all the previous conditions are not true. ''' ''' NOTE: If a if condition is true, then the code under the if block is executed and the successive elif and else blocks are not executed. '''
""" if is a conditional statement that is used to perform different actions based on different conditions. """ if 5 < 6: print('5 is less than 6') print() print() a = 6 if a == 5: print('a is equal to 5') else: print('a is not equal to 5') print() print() a = 6 b = 5 if a < b: print('a is less than b') elif a == b: print('a is equal to b') else: print('a is greater than b') '\nOn comaparing 2 numbers, we get one of the following 3 results:\n\n- a is less than b\n- a is equal to b\n- a is greater than b\n' print() print() if a < b: print('a is less than b') elif a == b: print('a is equal to b') elif a > b: print('a is greater than b') '\nConclusion:\n\n - An if statement states whether to execute some code or not.\n - An elif statement states the same as if, but is executed only if the previous if statement is not true.\n - An else statement is executed if all the previous conditions are not true.\n' '\nNOTE:\n\nIf a if condition is true, then the code under the if block is executed and the successive elif and else blocks are not executed.\n'
def conta_votos(lista_candidatos_numeros, lista_votos, numeros): brancos = 0 nulos = 0 contagem_geral = [] for i in range(len(lista_candidatos_numeros)): contagem_individual = [lista_candidatos_numeros[i][0], numeros[i], 0] contagem_geral.append(contagem_individual) for v in votos: if v in numeros: for c in range(len(lista_candidatos_numeros)): if v == lista_candidatos_numeros[c][1]: contagem_geral[c][2] += 1 elif v == 0: brancos += 1 else: nulos += 1 print("-----------------------------") for candidato in contagem_geral: print(candidato[0], "-", candidato[1], "- com ", candidato[2], " voto(s)") print("Brancos - com ", brancos, " voto(s)") print("Nulos - com ", nulos, " voto(s)") print("-----------------------------") n = int(input()) cadidatos_numeros = [] numeros = [] for i in range(n): nome_numero = [] x = input().split("#") nome_numero.append(x[0]) nome_numero.append(int(x[1])) numeros.append(int(x[1])) cadidatos_numeros.append(nome_numero) voto = int(input()) votos = [] while voto >= 0: votos.append(voto) voto = int(input()) conta_votos(cadidatos_numeros, votos, numeros)
def conta_votos(lista_candidatos_numeros, lista_votos, numeros): brancos = 0 nulos = 0 contagem_geral = [] for i in range(len(lista_candidatos_numeros)): contagem_individual = [lista_candidatos_numeros[i][0], numeros[i], 0] contagem_geral.append(contagem_individual) for v in votos: if v in numeros: for c in range(len(lista_candidatos_numeros)): if v == lista_candidatos_numeros[c][1]: contagem_geral[c][2] += 1 elif v == 0: brancos += 1 else: nulos += 1 print('-----------------------------') for candidato in contagem_geral: print(candidato[0], '-', candidato[1], '- com ', candidato[2], ' voto(s)') print('Brancos - com ', brancos, ' voto(s)') print('Nulos - com ', nulos, ' voto(s)') print('-----------------------------') n = int(input()) cadidatos_numeros = [] numeros = [] for i in range(n): nome_numero = [] x = input().split('#') nome_numero.append(x[0]) nome_numero.append(int(x[1])) numeros.append(int(x[1])) cadidatos_numeros.append(nome_numero) voto = int(input()) votos = [] while voto >= 0: votos.append(voto) voto = int(input()) conta_votos(cadidatos_numeros, votos, numeros)
global T_D,EPS,MU,ETA,dt T_D = 12.0 L0 = 1.0 EPS = 0.05 # Osborne 2017 params MU = -50. ETA = 1.0 dt = 0.005 #hours
global T_D, EPS, MU, ETA, dt t_d = 12.0 l0 = 1.0 eps = 0.05 mu = -50.0 eta = 1.0 dt = 0.005
class Solution: def numberOfArithmeticSlices(self, nums: List[int]) -> int: if len(nums)<3: return 0 output=[] slices=[nums[0], nums[1]] for num in nums[2:]: if num-slices[-1]==slices[1]-slices[0]: slices.append(num) else: if len(slices)>=3: output.append(slices) slices=[slices[-1], num] output.append(slices) result = 0 for o in output: result+= int((len(o)-2)*(len(o)-1)/2) return result
class Solution: def number_of_arithmetic_slices(self, nums: List[int]) -> int: if len(nums) < 3: return 0 output = [] slices = [nums[0], nums[1]] for num in nums[2:]: if num - slices[-1] == slices[1] - slices[0]: slices.append(num) else: if len(slices) >= 3: output.append(slices) slices = [slices[-1], num] output.append(slices) result = 0 for o in output: result += int((len(o) - 2) * (len(o) - 1) / 2) return result
# Definition for a binary tree node. class TreeNode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def isSymmetric(self, root: TreeNode) -> bool: if not root: return True return self.isSymmetricHelper(root.left, root.right) def isSymmetricHelper(self, leftNode: TreeNode, rightNode: TreeNode) -> bool: if not leftNode and not rightNode: return True if not leftNode or not rightNode: return False if leftNode.val != rightNode.val: return False return self.isSymmetricHelper(leftNode.left, rightNode.right) and self.isSymmetricHelper(leftNode.right, rightNode.left)
class Treenode: def __init__(self, x): self.val = x self.left = None self.right = None class Solution: def is_symmetric(self, root: TreeNode) -> bool: if not root: return True return self.isSymmetricHelper(root.left, root.right) def is_symmetric_helper(self, leftNode: TreeNode, rightNode: TreeNode) -> bool: if not leftNode and (not rightNode): return True if not leftNode or not rightNode: return False if leftNode.val != rightNode.val: return False return self.isSymmetricHelper(leftNode.left, rightNode.right) and self.isSymmetricHelper(leftNode.right, rightNode.left)
# Copyright 2019 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== def preprocess_input(x, data_format=None, mode=None): if mode == 'tf': x /= 127.5 x -= 1. return x elif mode == 'torch': x /= 255. mean = [0.485, 0.456, 0.406] std = [0.229, 0.224, 0.225] elif mode == 'caffe': if data_format == 'channels_first': # 'RGB'->'BGR' if x.ndim == 3: x = x[::-1, ...] else: x = x[:, ::-1, ...] else: # 'RGB'->'BGR' x = x[..., ::-1] mean = [103.939, 116.779, 123.68] std = None elif mode == 'tfhub': x /= 255. return x else: return x # Zero-center by mean pixel if data_format == 'channels_first': if x.ndim == 3: x[0, :, :] -= mean[0] x[1, :, :] -= mean[1] x[2, :, :] -= mean[2] if std is not None: x[0, :, :] /= std[0] x[1, :, :] /= std[1] x[2, :, :] /= std[2] else: x[:, 0, :, :] -= mean[0] x[:, 1, :, :] -= mean[1] x[:, 2, :, :] -= mean[2] if std is not None: x[:, 0, :, :] /= std[0] x[:, 1, :, :] /= std[1] x[:, 2, :, :] /= std[2] else: x[..., 0] -= mean[0] x[..., 1] -= mean[1] x[..., 2] -= mean[2] if std is not None: x[..., 0] /= std[0] x[..., 1] /= std[1] x[..., 2] /= std[2] return x
def preprocess_input(x, data_format=None, mode=None): if mode == 'tf': x /= 127.5 x -= 1.0 return x elif mode == 'torch': x /= 255.0 mean = [0.485, 0.456, 0.406] std = [0.229, 0.224, 0.225] elif mode == 'caffe': if data_format == 'channels_first': if x.ndim == 3: x = x[::-1, ...] else: x = x[:, ::-1, ...] else: x = x[..., ::-1] mean = [103.939, 116.779, 123.68] std = None elif mode == 'tfhub': x /= 255.0 return x else: return x if data_format == 'channels_first': if x.ndim == 3: x[0, :, :] -= mean[0] x[1, :, :] -= mean[1] x[2, :, :] -= mean[2] if std is not None: x[0, :, :] /= std[0] x[1, :, :] /= std[1] x[2, :, :] /= std[2] else: x[:, 0, :, :] -= mean[0] x[:, 1, :, :] -= mean[1] x[:, 2, :, :] -= mean[2] if std is not None: x[:, 0, :, :] /= std[0] x[:, 1, :, :] /= std[1] x[:, 2, :, :] /= std[2] else: x[..., 0] -= mean[0] x[..., 1] -= mean[1] x[..., 2] -= mean[2] if std is not None: x[..., 0] /= std[0] x[..., 1] /= std[1] x[..., 2] /= std[2] return x
### Insertion Sort - Part 2 - Solution def insertionSort2(nums): for i in range(1, len(nums)): comp, prev = nums[i], i-1 while (prev >= 0) and (nums[prev] > comp): nums[prev+1] = nums[prev] prev -= 1 nums[prev+1] = comp print(*nums) n = int(input()) nums = list(map(int, input().split()[:n])) insertionSort2(nums)
def insertion_sort2(nums): for i in range(1, len(nums)): (comp, prev) = (nums[i], i - 1) while prev >= 0 and nums[prev] > comp: nums[prev + 1] = nums[prev] prev -= 1 nums[prev + 1] = comp print(*nums) n = int(input()) nums = list(map(int, input().split()[:n])) insertion_sort2(nums)
### CLASSES class TrackPoint: def __init__(self, time, coordinates, alt): self.time = time self.coordinates = coordinates self.alt = alt def __repr__(self): return "%s %s %dm" % (self.time.strftime("%H:%m:%S"), self.coordinates, self.alt)
class Trackpoint: def __init__(self, time, coordinates, alt): self.time = time self.coordinates = coordinates self.alt = alt def __repr__(self): return '%s %s %dm' % (self.time.strftime('%H:%m:%S'), self.coordinates, self.alt)
VARS = [ {'name': 'script_name', 'required': True, 'example': 'fancy_script'}, {'name': 'description', 'example': 'Super fancy script'} ]
vars = [{'name': 'script_name', 'required': True, 'example': 'fancy_script'}, {'name': 'description', 'example': 'Super fancy script'}]
def test_api_docs(api_client): rv = api_client.get("/apidocs", follow_redirects=True) assert rv.status_code == 200 assert b"JournalsDB API Docs" in rv.data
def test_api_docs(api_client): rv = api_client.get('/apidocs', follow_redirects=True) assert rv.status_code == 200 assert b'JournalsDB API Docs' in rv.data
# Solution A class Solution: def isLongPressedName(self, name: str, typed: str) -> bool: i = 0 name += "1" for s in typed: if s == name[i]: i += 1 elif s != name[i - 1]: return False return i == len(name) - 1 # Solution B class Solution: def isLongPressedName(self, name: str, typed: str) -> bool: i, j = 0, 0 m, n = len(name), len(typed) while j < n: if i < m and name[i] == typed[j]: i += 1 elif j == 0 or typed[j - 1] != typed[j]: return False j += 1 return i == m
class Solution: def is_long_pressed_name(self, name: str, typed: str) -> bool: i = 0 name += '1' for s in typed: if s == name[i]: i += 1 elif s != name[i - 1]: return False return i == len(name) - 1 class Solution: def is_long_pressed_name(self, name: str, typed: str) -> bool: (i, j) = (0, 0) (m, n) = (len(name), len(typed)) while j < n: if i < m and name[i] == typed[j]: i += 1 elif j == 0 or typed[j - 1] != typed[j]: return False j += 1 return i == m
#!/usr/bin/env python # coding: utf-8 # # Re-implement some Python built-in functions # In[1]: def my_max(l1): max_number = l1[0] for number in l1: if number > max_number: max_number = number return max_number # In[2]: def my_min(l1): min_number = l1[0] for number in l1: if number < min_number: min_number = number return min_number # In[3]: def my_sum(l1): total = 0 for number in l1: total += number return total # In[4]: def my_len(l1): count = 0 for i in l1: count += 1 return count # In[5]: def my_divmod(x, y): result = x // y reminder = x % y return result, reminder # In[6]: def my_power(x, y): return x ** y # In[7]: def my_abs(x): if x >= 0: return x else: return x * -1 # # # calls # # # In[8]: # # # print(my_max([1, 2, 5])) # # # # In[9]: # # # print(my_min([1, 2, 5])) # # # # In[10]: # # # print(my_sum([1, 2, 5])) # # # # In[11]: # # # print(my_len([1, 2, 5])) # # # # In[12]: # # # print(my_divmod(23, 5)) # # # # In[13]: # # # print(my_power(23, 5)) # # # # In[14]: # # # print(my_abs(-12))
def my_max(l1): max_number = l1[0] for number in l1: if number > max_number: max_number = number return max_number def my_min(l1): min_number = l1[0] for number in l1: if number < min_number: min_number = number return min_number def my_sum(l1): total = 0 for number in l1: total += number return total def my_len(l1): count = 0 for i in l1: count += 1 return count def my_divmod(x, y): result = x // y reminder = x % y return (result, reminder) def my_power(x, y): return x ** y def my_abs(x): if x >= 0: return x else: return x * -1
# Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def __init__(self): self.maxval=0 def countbst(self,root,minval,maxval): if not root: return 0 if root.val<minval or root.val>maxval: return -1 left=self.countbst(root.left,minval,root.val) if left==-1:return -1 right=self.countbst(root.right,root.val,maxval) if right==-1: return -1 return left+right+1 def dfs(self,root): cnt=self.countbst(root,-1<<31,(1<<31)-1) if cnt!=-1: self.maxval=max(self.maxval,cnt) return # otherwise try left self.dfs(root.left) # try right self.dfs(root.right) def bottomup(self,root,parent): # return (size,minval,maxval) if not root: return (0,parent.val,parent.val) left=self.bottomup(root.left,root) right=self.bottomup(root.right,root) if root.val<left[2] or root.val>right[1] or left[0]==-1 or right[0]==-1: return (-1,0,0) newsize=left[0]+right[0]+1 self.maxval=max(self.maxval,newsize) return (newsize,left[1],right[2]) def largestBSTSubtree(self, root): """ :type root: TreeNode :rtype: int """ # up-bottom # self.dfs(root) # bottom-up # O(n) solution if not root: return 0 self.bottomup(root,None) return self.maxval
class Solution(object): def __init__(self): self.maxval = 0 def countbst(self, root, minval, maxval): if not root: return 0 if root.val < minval or root.val > maxval: return -1 left = self.countbst(root.left, minval, root.val) if left == -1: return -1 right = self.countbst(root.right, root.val, maxval) if right == -1: return -1 return left + right + 1 def dfs(self, root): cnt = self.countbst(root, -1 << 31, (1 << 31) - 1) if cnt != -1: self.maxval = max(self.maxval, cnt) return self.dfs(root.left) self.dfs(root.right) def bottomup(self, root, parent): if not root: return (0, parent.val, parent.val) left = self.bottomup(root.left, root) right = self.bottomup(root.right, root) if root.val < left[2] or root.val > right[1] or left[0] == -1 or (right[0] == -1): return (-1, 0, 0) newsize = left[0] + right[0] + 1 self.maxval = max(self.maxval, newsize) return (newsize, left[1], right[2]) def largest_bst_subtree(self, root): """ :type root: TreeNode :rtype: int """ if not root: return 0 self.bottomup(root, None) return self.maxval
#!/usr/bin/python """ Custom counting functions """ def ptcount(particledatalist, ptypelist, ptsums, ypoint=0.0, deltay=2.0): """ Particle pT counter for mean pT calculation. Input: particledatalist -- List of ParticleData objects ptypelist -- List of particle types for which to do the count ptsums -- Dictionary of pT sums for given particle type ypoint -- Center point of rapidity bin deltay -- Width of rapidity bin """ for particle in particledatalist: if particle.ptype in ptypelist: if abs(particle.rap - ypoint) < deltay / 2.: try: ptsum = ptsums[particle.ptype][0] + particle.pt npart = ptsums[particle.ptype][1] + 1 ptsums[particle.ptype] = (ptsum, npart) except IndexError: continue
""" Custom counting functions """ def ptcount(particledatalist, ptypelist, ptsums, ypoint=0.0, deltay=2.0): """ Particle pT counter for mean pT calculation. Input: particledatalist -- List of ParticleData objects ptypelist -- List of particle types for which to do the count ptsums -- Dictionary of pT sums for given particle type ypoint -- Center point of rapidity bin deltay -- Width of rapidity bin """ for particle in particledatalist: if particle.ptype in ptypelist: if abs(particle.rap - ypoint) < deltay / 2.0: try: ptsum = ptsums[particle.ptype][0] + particle.pt npart = ptsums[particle.ptype][1] + 1 ptsums[particle.ptype] = (ptsum, npart) except IndexError: continue
# Copyright 2021 The Chromium OS Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. register_npcx_project( project_name="herobrine_npcx9", zephyr_board="herobrine_npcx9", dts_overlays=[ "gpio.dts", "battery.dts", "i2c.dts", "motionsense.dts", "switchcap.dts", "usbc.dts", ], )
register_npcx_project(project_name='herobrine_npcx9', zephyr_board='herobrine_npcx9', dts_overlays=['gpio.dts', 'battery.dts', 'i2c.dts', 'motionsense.dts', 'switchcap.dts', 'usbc.dts'])
num1=num2=res=0 def cn(): global canal canal="CFB Cursos" cn() print(canal)
num1 = num2 = res = 0 def cn(): global canal canal = 'CFB Cursos' cn() print(canal)