Best Python code snippet using tox_python
SuitBuildingGlobals.py
Source: SuitBuildingGlobals.py
1from ElevatorConstants import *2from toontown.toonbase import ToontownGlobals3try:4 config = base.config5except:6 config = simbase.config7SuitBuildingInfo = (((1, 1),8 (1, 3),9 (4, 4),10 (8, 10),11 (1,)),12 ((1, 2),13 (2, 4),14 (5, 5),15 (8, 10),16 (1, 1.2)),17 ((1, 3),18 (3, 5),19 (6, 6),20 (8, 10),21 (1, 1.3, 1.6)),22 ((2, 3),23 (4, 6),24 (7, 7),25 (8, 10),26 (1, 1.4, 1.8)),27 ((2, 4),28 (5, 7),29 (8, 8),30 (8, 10),31 (1,32 1.6,33 1.8,34 2)),35 ((3, 4),36 (6, 8),37 (9, 9),38 (10, 12),39 (1,40 1.6,41 2,42 2.4)),43 ((3, 5),44 (7, 9),45 (10, 10),46 (10, 14),47 (1,48 1.6,49 1.8,50 2.2,51 2.4)),52 ((4, 5),53 (8, 10),54 (11, 11),55 (12, 16),56 (1,57 1.8,58 2.4,59 3,60 3.2)),61 ((5, 5),62 (9, 11),63 (12, 12),64 (14, 20),65 (1.4,66 1.8,67 2.6,68 3.4,69 4)),70 ((1, 1),71 (1, 12),72 (12, 12),73 (67, 67),74 (1,75 1,76 1,77 1,78 1)),79 ((1, 1),80 (8, 12),81 (12, 12),82 (100, 100),83 (1,84 1,85 1,86 1,87 1)),88 ((1, 1),89 (1, 12),90 (12, 12),91 (100, 100),92 (1,93 1,94 1,95 1,96 1)),97 ((1, 1),98 (8, 12),99 (12, 12),100 (150, 150),101 (1,102 1,103 1,104 1,105 1)),106 ((1, 1),107 (8, 12),108 (12, 12),109 (275, 275),110 (1,111 1,112 1,113 1,114 1)),115 ((1, 1),116 (9, 12),117 (12, 12),118 (206, 206),119 (1,120 1,121 1,122 1,123 1),124 (1,)),125 ((1, 1),126 (1, 5),127 (5, 5),128 (33, 33),129 (1,130 1,131 1,132 1,133 1)),134 ((1, 1),135 (4, 5),136 (5, 5),137 (50, 50),138 (1,139 1,140 1,141 1,142 1)),143 ((1, 1),144 (11, 12),145 (12, 12),146 (206, 206),147 (1,148 1,149 1,150 1,151 1),152 (1,)))153SUIT_BLDG_INFO_FLOORS = 0154SUIT_BLDG_INFO_SUIT_LVLS = 1155SUIT_BLDG_INFO_BOSS_LVLS = 2156SUIT_BLDG_INFO_LVL_POOL = 3157SUIT_BLDG_INFO_LVL_POOL_MULTS = 4158SUIT_BLDG_INFO_REVIVES = 5159VICTORY_RUN_TIME = ElevatorData[ELEVATOR_NORMAL]['openTime'] + TOON_VICTORY_EXIT_TIME160TO_TOON_BLDG_TIME = 8161VICTORY_SEQUENCE_TIME = VICTORY_RUN_TIME + TO_TOON_BLDG_TIME162CLEAR_OUT_TOON_BLDG_TIME = 4163TO_SUIT_BLDG_TIME = 8164buildingMinMax = {165 ToontownGlobals.SillyStreet: (config.GetInt('silly-street-building-min', 0),166 config.GetInt('silly-street-building-max', 3)),167 ToontownGlobals.LoopyLane: (config.GetInt('loopy-lane-building-min', 0),168 config.GetInt('loopy-lane-building-max', 3)),169 ToontownGlobals.PunchlinePlace: (config.GetInt('punchline-place-building-min', 0),170 config.GetInt('punchline-place-building-max', 3)),171 ToontownGlobals.BarnacleBoulevard: (config.GetInt('barnacle-boulevard-building-min', 1),172 config.GetInt('barnacle-boulevard-building-max', 5)),173 ToontownGlobals.SeaweedStreet: (config.GetInt('seaweed-street-building-min', 1),174 config.GetInt('seaweed-street-building-max', 5)),175 ToontownGlobals.LighthouseLane: (config.GetInt('lighthouse-lane-building-min', 1),176 config.GetInt('lighthouse-lane-building-max', 5)),177 ToontownGlobals.ElmStreet: (config.GetInt('elm-street-building-min', 2),178 config.GetInt('elm-street-building-max', 6)),179 ToontownGlobals.MapleStreet: (config.GetInt('maple-street-building-min', 2),180 config.GetInt('maple-street-building-max', 6)),181 ToontownGlobals.OakStreet: (config.GetInt('oak-street-building-min', 2),182 config.GetInt('oak-street-building-max', 6)),183 ToontownGlobals.AltoAvenue: (config.GetInt('alto-avenue-building-min', 3),184 config.GetInt('alto-avenue-building-max', 7)),185 ToontownGlobals.BaritoneBoulevard: (config.GetInt('baritone-boulevard-building-min', 3),186 config.GetInt('baritone-boulevard-building-max', 7)),187 ToontownGlobals.TenorTerrace: (config.GetInt('tenor-terrace-building-min', 3),188 config.GetInt('tenor-terrace-building-max', 7)),189 ToontownGlobals.WalrusWay: (config.GetInt('walrus-way-building-min', 5),190 config.GetInt('walrus-way-building-max', 10)),191 ToontownGlobals.SleetStreet: (config.GetInt('sleet-street-building-min', 5),192 config.GetInt('sleet-street-building-max', 10)),193 ToontownGlobals.PolarPlace: (config.GetInt('polar-place-building-min', 5),194 config.GetInt('polar-place-building-max', 10)),195 ToontownGlobals.LullabyLane: (config.GetInt('lullaby-lane-building-min', 6),196 config.GetInt('lullaby-lane-building-max', 12)),197 ToontownGlobals.PajamaPlace: (config.GetInt('pajama-place-building-min', 6),198 config.GetInt('pajama-place-building-max', 12)),199 ToontownGlobals.SellbotHQ: (0, 0),200 ToontownGlobals.SellbotFactoryExt: (0, 0),201 ToontownGlobals.CashbotHQ: (0, 0),202 ToontownGlobals.LawbotHQ: (0, 0),203 ToontownGlobals.BossbotHQ: (0, 0)204}205buildingChance = {206 ToontownGlobals.SillyStreet: config.GetFloat('silly-street-building-chance', 2.0),207 ToontownGlobals.LoopyLane: config.GetFloat('loopy-lane-building-chance', 2.0),208 ToontownGlobals.PunchlinePlace: config.GetFloat('punchline-place-building-chance', 2.0),209 ToontownGlobals.BarnacleBoulevard: config.GetFloat('barnacle-boulevard-building-chance', 75.0),210 ToontownGlobals.SeaweedStreet: config.GetFloat('seaweed-street-building-chance', 75.0),211 ToontownGlobals.LighthouseLane: config.GetFloat('lighthouse-lane-building-chance', 75.0),212 ToontownGlobals.ElmStreet: config.GetFloat('elm-street-building-chance', 90.0),213 ToontownGlobals.MapleStreet: config.GetFloat('maple-street-building-chance', 90.0),214 ToontownGlobals.OakStreet: config.GetFloat('oak-street-building-chance', 90.0),215 ToontownGlobals.AltoAvenue: config.GetFloat('alto-avenue-building-chance', 95.0),216 ToontownGlobals.BaritoneBoulevard: config.GetFloat('baritone-boulevard-building-chance', 95.0),217 ToontownGlobals.TenorTerrace: config.GetFloat('tenor-terrace-building-chance', 95.0),218 ToontownGlobals.WalrusWay: config.GetFloat('walrus-way-building-chance', 100.0),219 ToontownGlobals.SleetStreet: config.GetFloat('sleet-street-building-chance', 100.0),220 ToontownGlobals.PolarPlace: config.GetFloat('polar-place-building-chance', 100.0),221 ToontownGlobals.LullabyLane: config.GetFloat('lullaby-lane-building-chance', 100.0),222 ToontownGlobals.PajamaPlace: config.GetFloat('pajama-place-building-chance', 100.0),223 ToontownGlobals.SellbotHQ: 0.0,224 ToontownGlobals.SellbotFactoryExt: 0.0,225 ToontownGlobals.CashbotHQ: 0.0,226 ToontownGlobals.LawbotHQ: 0.0,227 ToontownGlobals.BossbotHQ: 0.0...
db41.py
Source: db41.py
...28 self.assertTrue(os.path.exists(config.filename + '.db41.bak'))29 def test_default_ordering(self):30 config = self.env.config31 db41.do_upgrade(self.env, VERSION, None)32 self.assertEqual(1.0, config.getfloat('mainnav', 'wiki.order'))33 self.assertEqual(2.0, config.getfloat('mainnav', 'timeline.order'))34 self.assertEqual(3.0, config.getfloat('mainnav', 'roadmap.order'))35 self.assertEqual(4.0, config.getfloat('mainnav', 'browser.order'))36 self.assertEqual(5.0, config.getfloat('mainnav', 'tickets.order'))37 self.assertEqual(6.0, config.getfloat('mainnav', 'newticket.order'))38 self.assertEqual(7.0, config.getfloat('mainnav', 'search.order'))39 self.assertEqual(8.0, config.getfloat('mainnav', 'admin.order'))40 self.assertEqual(1.0, config.getfloat('metanav', 'login.order'))41 self.assertEqual(2.0, config.getfloat('metanav', 'logout.order'))42 self.assertEqual(3.0, config.getfloat('metanav', 'prefs.order'))43 self.assertEqual(4.0, config.getfloat('metanav', 'help.order'))44 self.assertEqual(5.0, config.getfloat('metanav', 'about.order'))45 self.assertIsNone(config.get('trac', 'mainnav', None))46 self.assertIsNone(config.get('trac', 'metanav', None))47 def test_nondefault_ordering(self):48 config = self.env.config49 config.set('trac', 'mainnav', 'search, newticket, tickets, browser, '50 'roadmap, timeline, wiki')51 config.set('trac', 'metanav', 'about, help, prefs, logout, login')52 db41.do_upgrade(self.env, VERSION, None)53 self.assertEqual(1.0, config.getfloat('mainnav', 'search.order'))54 self.assertEqual(2.0, config.getfloat('mainnav', 'newticket.order'))55 self.assertEqual(3.0, config.getfloat('mainnav', 'tickets.order'))56 self.assertEqual(4.0, config.getfloat('mainnav', 'browser.order'))57 self.assertEqual(5.0, config.getfloat('mainnav', 'roadmap.order'))58 self.assertEqual(6.0, config.getfloat('mainnav', 'timeline.order'))59 self.assertEqual(7.0, config.getfloat('mainnav', 'wiki.order'))60 self.assertEqual(-1, config.getfloat('mainnav', 'admin.order', -1))61 self.assertEqual(1.0, config.getfloat('metanav', 'about.order'))62 self.assertEqual(2.0, config.getfloat('metanav', 'help.order'))63 self.assertEqual(3.0, config.getfloat('metanav', 'prefs.order'))64 self.assertEqual(4.0, config.getfloat('metanav', 'logout.order'))65 self.assertEqual(5.0, config.getfloat('metanav', 'login.order'))66 self.assertIsNone(config.get('trac', 'mainnav', None))67 self.assertIsNone(config.get('trac', 'metanav', None))68def test_suite():69 return unittest.makeSuite(UpgradeTestCase)70if __name__ == '__main__':...
cfg.py
Source: cfg.py
...6 cfg = {}7 # General8 cfg['shm'] = config.getboolean('Main', 'shm')9 cfg['psana_ds'] = config.get('Main', 'psana_ds')10 cfg['update_period'] = config.getfloat('Main', 'update_period')11 cfg['perc_too_high'] = config.getfloat('Main', 'perc_too_high')12 cfg['perc_too_low'] = config.getfloat('Main', 'perc_too_low')13 # MCP14 cfg['mcp_chan'] = config.getint('mcp', 'mcp_chan')15 cfg['mcp_sig_start'] = config.getfloat('mcp', 'sig_start')16 cfg['mcp_sig_end'] = config.getfloat('mcp', 'sig_end')17 cfg['mcp_dead_start'] = config.getfloat('mcp', 'dead_start')18 cfg['mcp_dead_end'] = config.getfloat('mcp', 'dead_end')19 # MCP420 cfg['mcp4_chan'] = config.getint('mcp4', 'mcp4_chan')21 cfg['mcp4_sig1_start'] = config.getfloat('mcp4', 'sig1_start')22 cfg['mcp4_sig1_end'] = config.getfloat('mcp4', 'sig1_end')23 cfg['mcp4_sig2_start'] = config.getfloat('mcp4', 'sig2_start')24 cfg['mcp4_sig2_end'] = config.getfloat('mcp4', 'sig2_end')25 cfg['mcp4_sig3_start'] = config.getfloat('mcp4', 'sig3_start')26 cfg['mcp4_sig3_end'] = config.getfloat('mcp4', 'sig3_end')27 cfg['mcp4_sig4_start'] = config.getfloat('mcp4', 'sig4_start')28 cfg['mcp4_sig4_end'] = config.getfloat('mcp4', 'sig4_end')29 cfg['mcp4_dead_start'] = config.getfloat('mcp4', 'dead_start')30 cfg['mcp4_dead_end'] = config.getfloat('mcp4', 'dead_end')31 # CCD32 cfg['ccd_name'] = config.get('ccd', 'name')33 cfg['ccd_sig_top'] = config.getfloat('ccd', 'sig_top')34 cfg['ccd_sig_bottom'] = config.getfloat('ccd', 'sig_bottom')35 cfg['ccd_sig_left'] = config.getfloat('ccd', 'sig_left')36 cfg['ccd_sig_right'] = config.getfloat('ccd', 'sig_right')37 cfg['ccd_dead_top'] = config.getfloat('ccd', 'dead_top')38 cfg['ccd_dead_bottom'] = config.getfloat('ccd', 'dead_bottom')39 cfg['ccd_dead_left'] = config.getfloat('ccd', 'dead_left')40 cfg['ccd_dead_right'] = config.getfloat('ccd', 'dead_right')41 # magnet42 cfg['magnet_threshold'] = config.getfloat('magnet', 'threshold')43 # scanning variables44 cfg['scan_key'] = config.get('scan', 'key')45 heading = cfg['scan_key']+'scan'46 cfg['scan_start'] = config.getfloat(heading, 'start')47 cfg['scan_stop'] = config.getfloat(heading, 'stop')48 cfg['num_bins'] = config.getfloat(heading, 'num_bins')...
Check out the latest blogs from LambdaTest on this topic:
I was once asked at a testing summit, “How do you manage a QA team using scrum?” After some consideration, I realized it would make a good article, so here I am. Understand that the idea behind developing software in a scrum environment is for development teams to self-organize.
The web paradigm has changed considerably over the last few years. Web 2.0, a term coined way back in 1999, was one of the pivotal moments in the history of the Internet. UGC (User Generated Content), ease of use, and interoperability for the end-users were the key pillars of Web 2.0. Consumers who were only consuming content up till now started creating different forms of content (e.g., text, audio, video, etc.).
Mobile devices and mobile applications – both are booming in the world today. The idea of having the power of a computer in your pocket is revolutionary. As per Statista, mobile accounts for more than half of the web traffic worldwide. Mobile devices (excluding tablets) contributed to 54.4 percent of global website traffic in the fourth quarter of 2021, increasing consistently over the past couple of years.
Even though several frameworks are available in the market for automation testing, Selenium is one of the most renowned open-source frameworks used by experts due to its numerous features and benefits.
JUnit is one of the most popular unit testing frameworks in the Java ecosystem. The JUnit 5 version (also known as Jupiter) contains many exciting innovations, including support for new features in Java 8 and above. However, many developers still prefer to use the JUnit 4 framework since certain features like parallel execution with JUnit 5 are still in the experimental phase.
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!