How to use run_time method in stestr

Best Python code snippet using stestr_python

test_data.py

Source:test_data.py Github

copy

Full Screen

1expected_list_of_journey_pattern_section_refs = [2 {3 'journey_pattern_info': {4 'direction': 'outbound',5 'destination_display': None6 },7 'journey_pattern_section_refs': ['JPSection-9', 'JPSection-27', 'JPSection-13', 'JPSection-1']8 },9 {10 'journey_pattern_info': {11 'direction': 'outbound',12 'destination_display': None13 },14 'journey_pattern_section_refs': ['JPSection-11', 'JPSection-5', 'JPSection-28']15 },16 {17 'journey_pattern_info': {18 'direction': 'outbound',19 'destination_display': None20 },21 'journey_pattern_section_refs': ['JPSection-12']22 },23 {24 'journey_pattern_info': {25 'direction': 'outbound',26 'destination_display': None27 },28 'journey_pattern_section_refs': ['JPSection-10', 'JPSection-6', 'JPSection-13', 'JPSection-27', 'JPSection-4']29 },30]31expected_list_of_journey_patterns = \32 [{'journey_pattern_sections':33 [[{'from_atco_code': '0600MA6152',34 'from_timing_status': 'PTP',35 'from_sequence_number': '1',36 'to_atco_code': '0600MA6001',37 'to_timing_status': 'OTH', 'run_time': 'PT1M',38 'to_sequence_number': '2'}], [39 {'from_atco_code': '0600MA0018',40 'from_timing_status': 'OTH',41 'from_sequence_number': '6',42 'to_atco_code': '0600MA0020A',43 'to_timing_status': 'OTH', 'run_time': 'PT2M',44 'to_sequence_number': '7'},45 {'from_atco_code': '0600MA0020A',46 'from_timing_status': 'OTH',47 'from_sequence_number': '7',48 'to_atco_code': '0600MA6032',49 'to_timing_status': 'OTH', 'run_time': 'PT1M',50 'to_sequence_number': '8'},51 {'from_atco_code': '0600MA6032',52 'from_timing_status': 'OTH',53 'from_sequence_number': '8',54 'to_atco_code': '0600MA0023',55 'to_timing_status': 'OTH', 'run_time': 'PT1M',56 'to_sequence_number': '9'},57 {'from_atco_code': '0600MA0023',58 'from_timing_status': 'OTH',59 'from_sequence_number': '9',60 'to_atco_code': '0600MA0026A',61 'to_timing_status': 'OTH', 'run_time': 'PT2M',62 'to_sequence_number': '10'},63 {'from_atco_code': '0600MA0026A',64 'from_timing_status': 'OTH',65 'from_sequence_number': '10',66 'to_atco_code': '0600MA6030',67 'to_timing_status': 'OTH', 'run_time': 'PT1M',68 'to_sequence_number': '11'}], [69 {'from_atco_code': '0600MA6152',70 'from_timing_status': 'PTP',71 'from_sequence_number': '1',72 'to_atco_code': '0600MA6001',73 'to_timing_status': 'OTH', 'run_time': 'PT1M',74 'to_sequence_number': '2'},75 {'from_atco_code': '0600MA6001',76 'from_timing_status': 'OTH',77 'from_sequence_number': '2',78 'to_atco_code': '0600MA0050',79 'to_timing_status': 'OTH', 'run_time': 'PT2M',80 'to_sequence_number': '3'}], [81 {'from_atco_code': '0600MA6189',82 'from_timing_status': 'OTH',83 'from_sequence_number': '12',84 'to_atco_code': '0600MA0028A',85 'to_timing_status': 'OTH', 'run_time': 'PT1M',86 'to_sequence_number': '13'},87 {'from_atco_code': '0600MA0028A',88 'from_timing_status': 'OTH',89 'from_sequence_number': '13',90 'to_atco_code': '0600MA0029',91 'to_timing_status': 'OTH', 'run_time': 'PT1M',92 'to_sequence_number': '14'},93 {'from_atco_code': '0600MA0029',94 'from_timing_status': 'OTH',95 'from_sequence_number': '14',96 'to_atco_code': '0600MA0030',97 'to_timing_status': 'PTP', 'run_time': 'PT1M',98 'to_sequence_number': '15'},99 {'from_atco_code': '0600MA0030',100 'from_timing_status': 'PTP',101 'from_sequence_number': '15',102 'to_atco_code': '0600MA0031',103 'to_timing_status': 'OTH', 'run_time': 'PT1M',104 'to_sequence_number': '16'},105 {'from_atco_code': '0600MA0031',106 'from_timing_status': 'OTH',107 'from_sequence_number': '16',108 'to_atco_code': '0600MA6031',109 'to_timing_status': 'OTH', 'run_time': 'PT0M',110 'to_sequence_number': '17'},111 {'from_atco_code': '0600MA6031',112 'from_timing_status': 'OTH',113 'from_sequence_number': '17',114 'to_atco_code': '0600MA0022',115 'to_timing_status': 'OTH', 'run_time': 'PT2M',116 'to_sequence_number': '18'},117 {'from_atco_code': '0600MA0022',118 'from_timing_status': 'OTH',119 'from_sequence_number': '18',120 'to_atco_code': '0600MA0021',121 'to_timing_status': 'OTH', 'run_time': 'PT1M',122 'to_sequence_number': '19'},123 {'from_atco_code': '0600MA0021',124 'from_timing_status': 'OTH',125 'from_sequence_number': '19',126 'to_atco_code': '0600MA0020',127 'to_timing_status': 'OTH', 'run_time': 'PT1M',128 'to_sequence_number': '20'},129 {'from_atco_code': '0600MA0020',130 'from_timing_status': 'OTH',131 'from_sequence_number': '20',132 'to_atco_code': '0600MA0019',133 'to_timing_status': 'OTH', 'run_time': 'PT1M',134 'to_sequence_number': '21'},135 {'from_atco_code': '0600MA0019',136 'from_timing_status': 'OTH',137 'from_sequence_number': '21',138 'to_atco_code': '0600MA6033',139 'to_timing_status': 'OTH', 'run_time': 'PT1M',140 'to_sequence_number': '22'},141 {'from_atco_code': '0600MA6033',142 'from_timing_status': 'OTH',143 'from_sequence_number': '22',144 'to_atco_code': '0600MA6002',145 'to_timing_status': 'OTH', 'run_time': 'PT0M',146 'to_sequence_number': '23'},147 {'from_atco_code': '0600MA6002',148 'from_timing_status': 'OTH',149 'from_sequence_number': '23',150 'to_atco_code': '0600MA0049',151 'to_timing_status': 'OTH', 'run_time': 'PT1M',152 'to_sequence_number': '24'},153 {'from_atco_code': '0600MA0049',154 'from_timing_status': 'OTH',155 'from_sequence_number': '24',156 'to_atco_code': '0600MA0096',157 'to_timing_status': 'OTH', 'run_time': 'PT2M',158 'to_sequence_number': '25'},159 {'from_atco_code': '0600MA0096',160 'from_timing_status': 'OTH',161 'from_sequence_number': '25',162 'to_atco_code': '0600MA6105',163 'to_timing_status': 'OTH', 'run_time': 'PT1M',164 'to_sequence_number': '26'},165 {'from_atco_code': '0600MA6105',166 'from_timing_status': 'OTH',167 'from_sequence_number': '26',168 'to_atco_code': '0600MA6152',169 'to_timing_status': 'PTP', 'run_time': 'PT1M',170 'to_sequence_number': '27'}]],171 'journey_pattern_info': {'direction': 'outbound', 'destination_display': None}}, {172 'journey_pattern_sections': [[{'from_atco_code': '0600MA6152',173 'from_timing_status': 'PTP',174 'from_sequence_number': '1',175 'to_atco_code': '0600MA6001',176 'to_timing_status': 'OTH', 'run_time': 'PT1M',177 'to_sequence_number': '2'},178 {'from_atco_code': '0600MA6001',179 'from_timing_status': 'OTH',180 'from_sequence_number': '2',181 'to_atco_code': '0600MA0050',182 'to_timing_status': 'OTH', 'run_time': 'PT2M',183 'to_sequence_number': '3'}], [184 {'from_atco_code': '0600MA0050',185 'from_timing_status': 'OTH',186 'from_sequence_number': '3',187 'to_atco_code': '0600MA0046',188 'to_timing_status': 'OTH',189 'run_time': 'PT1M',190 'to_sequence_number': '4'},191 {'from_atco_code': '0600MA0046',192 'from_timing_status': 'OTH',193 'from_sequence_number': '4',194 'to_atco_code': '0600MA0017',195 'to_timing_status': 'OTH',196 'run_time': 'PT1M',197 'to_sequence_number': '5'},198 {'from_atco_code': '0600MA0017',199 'from_timing_status': 'OTH',200 'from_sequence_number': '5',201 'to_atco_code': '0600MA0018',202 'to_timing_status': 'OTH',203 'run_time': 'PT1M',204 'to_sequence_number': '6'},205 {'from_atco_code': '0600MA0018',206 'from_timing_status': 'OTH',207 'from_sequence_number': '6',208 'to_atco_code': '0600MA0020A',209 'to_timing_status': 'OTH',210 'run_time': 'PT1M',211 'to_sequence_number': '7'},212 {'from_atco_code': '0600MA0020A',213 'from_timing_status': 'OTH',214 'from_sequence_number': '7',215 'to_atco_code': '0600MA6032',216 'to_timing_status': 'OTH',217 'run_time': 'PT1M',218 'to_sequence_number': '8'},219 {'from_atco_code': '0600MA6032',220 'from_timing_status': 'OTH',221 'from_sequence_number': '8',222 'to_atco_code': '0600MA0023',223 'to_timing_status': 'OTH',224 'run_time': 'PT1M',225 'to_sequence_number': '9'},226 {'from_atco_code': '0600MA0023',227 'from_timing_status': 'OTH',228 'from_sequence_number': '9',229 'to_atco_code': '0600MA0026A',230 'to_timing_status': 'OTH',231 'run_time': 'PT3M',232 'to_sequence_number': '10'},233 {'from_atco_code': '0600MA0026A',234 'from_timing_status': 'OTH',235 'from_sequence_number': '10',236 'to_atco_code': '0600MA6030',237 'to_timing_status': 'OTH',238 'run_time': 'PT1M',239 'to_sequence_number': '11'}], [240 {'from_atco_code': '0600MA0028A',241 'from_timing_status': 'OTH',242 'from_sequence_number': '13',243 'to_atco_code': '0600MA0029',244 'to_timing_status': 'OTH',245 'run_time': 'PT1M',246 'to_sequence_number': '14'},247 {'from_atco_code': '0600MA0029',248 'from_timing_status': 'OTH',249 'from_sequence_number': '14',250 'to_atco_code': '0600MA0030',251 'to_timing_status': 'PTP',252 'run_time': 'PT1M',253 'to_sequence_number': '15'},254 {'from_atco_code': '0600MA0030',255 'from_timing_status': 'PTP',256 'from_sequence_number': '15',257 'to_atco_code': '0600MA0031',258 'to_timing_status': 'OTH',259 'run_time': 'PT1M',260 'to_sequence_number': '16'},261 {'from_atco_code': '0600MA0031',262 'from_timing_status': 'OTH',263 'from_sequence_number': '16',264 'to_atco_code': '0600MA6031',265 'to_timing_status': 'OTH',266 'run_time': 'PT1M',267 'to_sequence_number': '17'},268 {'from_atco_code': '0600MA6031',269 'from_timing_status': 'OTH',270 'from_sequence_number': '17',271 'to_atco_code': '0600MA0022',272 'to_timing_status': 'OTH',273 'run_time': 'PT2M',274 'to_sequence_number': '18'},275 {'from_atco_code': '0600MA0022',276 'from_timing_status': 'OTH',277 'from_sequence_number': '18',278 'to_atco_code': '0600MA0021',279 'to_timing_status': 'OTH',280 'run_time': 'PT1M',281 'to_sequence_number': '19'},282 {'from_atco_code': '0600MA0021',283 'from_timing_status': 'OTH',284 'from_sequence_number': '19',285 'to_atco_code': '0600MA0020',286 'to_timing_status': 'OTH',287 'run_time': 'PT1M',288 'to_sequence_number': '20'},289 {'from_atco_code': '0600MA0020',290 'from_timing_status': 'OTH',291 'from_sequence_number': '20',292 'to_atco_code': '0600MA0019',293 'to_timing_status': 'OTH',294 'run_time': 'PT2M',295 'to_sequence_number': '21'},296 {'from_atco_code': '0600MA0019',297 'from_timing_status': 'OTH',298 'from_sequence_number': '21',299 'to_atco_code': '0600MA6033',300 'to_timing_status': 'OTH',301 'run_time': 'PT0M',302 'to_sequence_number': '22'},303 {'from_atco_code': '0600MA6033',304 'from_timing_status': 'OTH',305 'from_sequence_number': '22',306 'to_atco_code': '0600MA6002',307 'to_timing_status': 'OTH',308 'run_time': 'PT1M',309 'to_sequence_number': '23'},310 {'from_atco_code': '0600MA6002',311 'from_timing_status': 'OTH',312 'from_sequence_number': '23',313 'to_atco_code': '0600MA0049',314 'to_timing_status': 'OTH',315 'run_time': 'PT2M',316 'to_sequence_number': '24'},317 {'from_atco_code': '0600MA0049',318 'from_timing_status': 'OTH',319 'from_sequence_number': '24',320 'to_atco_code': '0600MA0096',321 'to_timing_status': 'OTH',322 'run_time': 'PT1M',323 'to_sequence_number': '25'},324 {'from_atco_code': '0600MA0096',325 'from_timing_status': 'OTH',326 'from_sequence_number': '25',327 'to_atco_code': '0600MA6105',328 'to_timing_status': 'OTH',329 'run_time': 'PT2M',330 'to_sequence_number': '26'},331 {'from_atco_code': '0600MA6105',332 'from_timing_status': 'OTH',333 'from_sequence_number': '26',334 'to_atco_code': '0600MA6152',335 'to_timing_status': 'PTP',336 'run_time': 'PT1M',337 'to_sequence_number': '27'}]],338 'journey_pattern_info': {'direction': 'outbound',339 'destination_display': None}}, {340 'journey_pattern_sections': [[{'from_atco_code': '0600MA6001',341 'from_timing_status': 'OTH',342 'from_sequence_number': '2',343 'to_atco_code': '0600MA0050',344 'to_timing_status': 'OTH', 'run_time': 'PT2M',345 'to_sequence_number': '3'}]],346 'journey_pattern_info': {'direction': 'outbound',347 'destination_display': None}}, {348 'journey_pattern_sections': [[{'from_atco_code': '0600MA6152',349 'from_timing_status': 'PTP',350 'from_sequence_number': '1',351 'to_atco_code': '0600MA6001',352 'to_timing_status': 'OTH', 'run_time': 'PT1M',353 'to_sequence_number': '2'},354 {'from_atco_code': '0600MA6001',355 'from_timing_status': 'OTH',356 'from_sequence_number': '2',357 'to_atco_code': '0600MA0050',358 'to_timing_status': 'OTH', 'run_time': 'PT1M',359 'to_sequence_number': '3'}], [360 {'from_atco_code': '0600MA0050',361 'from_timing_status': 'OTH',362 'from_sequence_number': '3',363 'to_atco_code': '0600MA0046',364 'to_timing_status': 'OTH',365 'run_time': 'PT1M',366 'to_sequence_number': '4'},367 {'from_atco_code': '0600MA0046',368 'from_timing_status': 'OTH',369 'from_sequence_number': '4',370 'to_atco_code': '0600MA0017',371 'to_timing_status': 'OTH',372 'run_time': 'PT1M',373 'to_sequence_number': '5'},374 {'from_atco_code': '0600MA0017',375 'from_timing_status': 'OTH',376 'from_sequence_number': '5',377 'to_atco_code': '0600MA0018',378 'to_timing_status': 'OTH',379 'run_time': 'PT1M',380 'to_sequence_number': '6'},381 {'from_atco_code': '0600MA0018',382 'from_timing_status': 'OTH',383 'from_sequence_number': '6',384 'to_atco_code': '0600MA0020A',385 'to_timing_status': 'OTH',386 'run_time': 'PT1M',387 'to_sequence_number': '7'},388 {'from_atco_code': '0600MA0020A',389 'from_timing_status': 'OTH',390 'from_sequence_number': '7',391 'to_atco_code': '0600MA6032',392 'to_timing_status': 'OTH',393 'run_time': 'PT1M',394 'to_sequence_number': '8'},395 {'from_atco_code': '0600MA6032',396 'from_timing_status': 'OTH',397 'from_sequence_number': '8',398 'to_atco_code': '0600MA0023',399 'to_timing_status': 'OTH',400 'run_time': 'PT1M',401 'to_sequence_number': '9'},402 {'from_atco_code': '0600MA0023',403 'from_timing_status': 'OTH',404 'from_sequence_number': '9',405 'to_atco_code': '0600MA0026A',406 'to_timing_status': 'OTH',407 'run_time': 'PT3M',408 'to_sequence_number': '10'},409 {'from_atco_code': '0600MA0026A',410 'from_timing_status': 'OTH',411 'from_sequence_number': '10',412 'to_atco_code': '0600MA6030',413 'to_timing_status': 'OTH',414 'run_time': 'PT1M',415 'to_sequence_number': '11'}], [416 {'from_atco_code': '0600MA6152',417 'from_timing_status': 'PTP',418 'from_sequence_number': '1',419 'to_atco_code': '0600MA6001',420 'to_timing_status': 'OTH',421 'run_time': 'PT1M',422 'to_sequence_number': '2'},423 {'from_atco_code': '0600MA6001',424 'from_timing_status': 'OTH',425 'from_sequence_number': '2',426 'to_atco_code': '0600MA0050',427 'to_timing_status': 'OTH',428 'run_time': 'PT2M',429 'to_sequence_number': '3'}], [430 {'from_atco_code': '0600MA0018',431 'from_timing_status': 'OTH',432 'from_sequence_number': '6',433 'to_atco_code': '0600MA0020A',434 'to_timing_status': 'OTH',435 'run_time': 'PT2M',436 'to_sequence_number': '7'},437 {'from_atco_code': '0600MA0020A',438 'from_timing_status': 'OTH',439 'from_sequence_number': '7',440 'to_atco_code': '0600MA6032',441 'to_timing_status': 'OTH',442 'run_time': 'PT1M',443 'to_sequence_number': '8'},444 {'from_atco_code': '0600MA6032',445 'from_timing_status': 'OTH',446 'from_sequence_number': '8',447 'to_atco_code': '0600MA0023',448 'to_timing_status': 'OTH',449 'run_time': 'PT1M',450 'to_sequence_number': '9'},451 {'from_atco_code': '0600MA0023',452 'from_timing_status': 'OTH',453 'from_sequence_number': '9',454 'to_atco_code': '0600MA0026A',455 'to_timing_status': 'OTH',456 'run_time': 'PT2M',457 'to_sequence_number': '10'},458 {'from_atco_code': '0600MA0026A',459 'from_timing_status': 'OTH',460 'from_sequence_number': '10',461 'to_atco_code': '0600MA6030',462 'to_timing_status': 'OTH',463 'run_time': 'PT1M',464 'to_sequence_number': '11'}], [465 {'from_atco_code': '0600MA0028A',466 'from_timing_status': 'OTH',467 'from_sequence_number': '13',468 'to_atco_code': '0600MA0029',469 'to_timing_status': 'OTH',470 'run_time': 'PT1M',471 'to_sequence_number': '14'},472 {'from_atco_code': '0600MA0029',473 'from_timing_status': 'OTH',474 'from_sequence_number': '14',475 'to_atco_code': '0600MA0030',476 'to_timing_status': 'PTP',477 'run_time': 'PT1M',478 'to_sequence_number': '15'},479 {'from_atco_code': '0600MA0030',480 'from_timing_status': 'PTP',481 'from_sequence_number': '15',482 'to_atco_code': '0600MA0031',483 'to_timing_status': 'OTH',484 'run_time': 'PT1M',485 'to_sequence_number': '16'},486 {'from_atco_code': '0600MA0031',487 'from_timing_status': 'OTH',488 'from_sequence_number': '16',489 'to_atco_code': '0600MA6031',490 'to_timing_status': 'OTH',491 'run_time': 'PT0M',492 'to_sequence_number': '17'},493 {'from_atco_code': '0600MA6031',494 'from_timing_status': 'OTH',495 'from_sequence_number': '17',496 'to_atco_code': '0600MA0022',497 'to_timing_status': 'OTH',498 'run_time': 'PT3M',499 'to_sequence_number': '18'},500 {'from_atco_code': '0600MA0022',501 'from_timing_status': 'OTH',502 'from_sequence_number': '18',503 'to_atco_code': '0600MA0021',504 'to_timing_status': 'OTH',505 'run_time': 'PT0M',506 'to_sequence_number': '19'},507 {'from_atco_code': '0600MA0021',508 'from_timing_status': 'OTH',509 'from_sequence_number': '19',510 'to_atco_code': '0600MA0020',511 'to_timing_status': 'OTH',512 'run_time': 'PT1M',513 'to_sequence_number': '20'},514 {'from_atco_code': '0600MA0020',515 'from_timing_status': 'OTH',516 'from_sequence_number': '20',517 'to_atco_code': '0600MA0019',518 'to_timing_status': 'OTH',519 'run_time': 'PT2M',520 'to_sequence_number': '21'},521 {'from_atco_code': '0600MA0019',522 'from_timing_status': 'OTH',523 'from_sequence_number': '21',524 'to_atco_code': '0600MA6033',525 'to_timing_status': 'OTH',526 'run_time': 'PT0M',527 'to_sequence_number': '22'},528 {'from_atco_code': '0600MA6033',529 'from_timing_status': 'OTH',530 'from_sequence_number': '22',531 'to_atco_code': '0600MA6002',532 'to_timing_status': 'OTH',533 'run_time': 'PT1M',534 'to_sequence_number': '23'},535 {'from_atco_code': '0600MA6002',536 'from_timing_status': 'OTH',537 'from_sequence_number': '23',538 'to_atco_code': '0600MA0049',539 'to_timing_status': 'OTH',540 'run_time': 'PT1M',541 'to_sequence_number': '24'},542 {'from_atco_code': '0600MA0049',543 'from_timing_status': 'OTH',544 'from_sequence_number': '24',545 'to_atco_code': '0600MA0096',546 'to_timing_status': 'OTH',547 'run_time': 'PT2M',548 'to_sequence_number': '25'},549 {'from_atco_code': '0600MA0096',550 'from_timing_status': 'OTH',551 'from_sequence_number': '25',552 'to_atco_code': '0600MA6105',553 'to_timing_status': 'OTH',554 'run_time': 'PT1M',555 'to_sequence_number': '26'},556 {'from_atco_code': '0600MA6105',557 'from_timing_status': 'OTH',558 'from_sequence_number': '26',559 'to_atco_code': '0600MA6152',560 'to_timing_status': 'PTP',561 'run_time': 'PT1M',562 'to_sequence_number': '27'}]],563 'journey_pattern_info': {'direction': 'outbound',...

Full Screen

Full Screen

EqTriangleProblem.py

Source:EqTriangleProblem.py Github

copy

Full Screen

1from big_ol_pile_of_manim_imports import *2import random3class EqTriangleProblem(Scene):4 def construct(self):5 title1 = TexMobject("An equilateral triangle", color=BLACK)6 title1.shift(np.array([ 0., 3.3, 0.]))7 title1.scale(0.9)8 title2 = TexMobject("Show that the sum of the", "red", "areas equals the sum of the", "green", "areas", color=BLACK)9 title2.set_color_by_tex("red", RED_E)10 title2.set_color_by_tex("green", GREEN_E)11 title2.shift(np.array([ 0., 3.3, 0.]))12 title2.scale(0.7)13 A0=Dot(np.array([ -2.5, -3, 0.]), color=BLACK)14 A0.scale(0.5)15 B0=Dot(np.array([ 4, -3, 0.]), color=BLACK)16 B0.scale(0.5)17 C0=Dot(np.array([ 0.75, 2.63, 0.]), color=BLACK)18 C0.scale(0.5)19 D0=Dot(np.array([ 0.38, -0.12, 0.]), color=BLACK)20 D0.scale(0.5)21 E0=Dot(np.array([ -0.53, 0.4, 0.]), color=BLACK)22 E0.scale(0.5)23 F0=Dot(np.array([ 1.85, 0.72, 0.]), color=BLACK)24 F0.scale(0.5)25 I0=Dot(np.array([ 0.39, -3, 0.]), color=BLACK)26 I0.scale(0.5)27 J0=Dot(np.array([ -0.84, -0.12, 0.]), color=BLACK)28 J0.scale(0.5)29 K0=Dot(np.array([ 2.34, -0.12, 0.]), color=BLACK)30 K0.scale(0.5)31 L0=Dot(np.array([ 2.34, -3, 0.]), color=BLACK)32 L0.scale(0.5)33 M0=Dot(np.array([ -0.84, -3, 0.]), color=BLACK)34 M0.scale(0.5)35 N0=Dot(np.array([ -0.23, 0.93, 0.]), color=BLACK)36 N0.scale(0.5)37 O0=Dot(np.array([ 1.24, 1.78, 0.]), color=BLACK)38 O0.scale(0.5)39 A=np.array([ -2.5, -3, 0.])40 B=np.array([ 4, -3, 0.])41 C=np.array([ 0.75, 2.63, 0.])42 D=np.array([ 0.38, -0.12, 0.])43 E=np.array([ -0.53, 0.4, 0.])44 F=np.array([ 1.85, 0.72, 0.])45 I=np.array([ 0.39, -3, 0.])46 J=np.array([ -0.84, -0.12, 0.])47 K=np.array([ 2.34, -0.12, 0.])48 L=np.array([ 2.34, -3, 0.])49 M=np.array([ -0.84, -3, 0.])50 N=np.array([ -0.23, 0.93, 0.])51 O=np.array([ 1.24, 1.78, 0.])52 lineAB = Line( A, B, color = BLACK , stroke_width=0.5)53 lineBC = Line( B, C, color = BLACK , stroke_width=0.5)54 lineCA = Line( C, A, color = BLACK , stroke_width=0.5)55 lineDF = Line( D, F, color = BLACK , stroke_width=0.5)56 lineDI = Line( D, I, color = BLACK , stroke_width=0.5)57 lineDE = Line( D, E, color = BLACK , stroke_width=0.5)58 lineJK = Line( J, K, color = BLACK , stroke_width=0.5)59 lineDO = Line( D, O, color = BLACK , stroke_width=0.5)60 lineDN = Line( D, N, color = BLACK , stroke_width=0.5)61 lineJM = Line( J, M, color = BLACK , stroke_width=0.5)62 lineKL = Line( K, L, color = BLACK , stroke_width=0.5)63 lineNO = Line( N, O, color = BLACK , stroke_width=0.5)64 lineDM = Line( D, M, color = BLACK , stroke_width=0.5)65 lineDA = Line( D, A, color = BLACK , stroke_width=0.5)66 lineDL = Line( D, L, color = BLACK , stroke_width=0.5)67 lineDO = Line( D, O, color = BLACK , stroke_width=0.5)68 lineDC = Line( D, C, color = BLACK , stroke_width=0.5)69 lineDB = Line( D, B, color = BLACK , stroke_width=0.5)70 lineDC = Line( D, C, color = BLACK , stroke_width=0.5)71 poly0=Polygon(C, B, A)72 poly0.set_stroke(color=BLACK, width = 0.)73 poly0.set_fill(color = RED_E, opacity=0.1)74 75 self.play(ShowCreation(lineAB), ShowCreation(lineBC), ShowCreation(lineCA), ShowCreation(A0), ShowCreation(B0), ShowCreation(C0), ShowCreation(poly0), run_time=0.5)76 self.play(ShowCreation(D0), run_time=0.5)77 self.play(ShowCreation(E0), ShowCreation(F0), ShowCreation(I0), ShowCreation(lineDF), ShowCreation(lineDI), ShowCreation(lineDE), run_time=0.5)78 self.wait(0.5)79 self.play(Write(title1))80 self.wait(1.5)81 self.play(*map(FadeOut, [title1]), run_time=0.5)82 poly1=Polygon(D, C, O)83 poly1.set_stroke(color=BLACK, width = 0.)84 poly1.set_fill(color = GREEN_E, opacity=0.9)85 poly1d=Polygon(N, C, O)86 poly1d.set_stroke(color=BLACK, width = 0.)87 poly1d.set_fill(color = GREEN_E, opacity=0.9)88 poly2=Polygon(D, O, F)89 poly2.set_stroke(color=BLACK, width = 0.)90 poly2.set_fill(color = GREEN_E, opacity=0.9)91 poly2_12=Polygon(D, N, F)92 poly2_12.set_stroke(color=BLACK, width = 0.)93 poly2_12.set_fill(color = GOLD_E, opacity=0.5)94 poly3=Polygon(D, F, K)95 poly3.set_stroke(color=BLACK, width = 0.)96 poly3.set_fill(color = RED_E, opacity=0.9)97 poly3w=Polygon(D, K, F)98 poly3w.set_stroke(color=BLACK, width = 0.)99 poly3w.set_fill(color = WHITE, opacity=0.9)100 poly4=Polygon(D, K, B)101 poly4.set_stroke(color=BLACK, width = 0.)102 poly4.set_fill(color = RED_E, opacity=0.9)103 poly4w=Polygon(D, K, B)104 poly4w.set_stroke(color=BLACK, width = 0.)105 poly4w.set_fill(color = WHITE, opacity=0.9)106 poly5=Polygon(D, B, L)107 poly5.set_stroke(color=BLACK, width = 0.)108 poly5.set_fill(color = GREEN_E, opacity=0.9)109 poly5d=Polygon(K, B, L)110 poly5d.set_stroke(color=BLACK, width = 0.)111 poly5d.set_fill(color = GREEN_E, opacity=0.9)112 poly6=Polygon(D, L, I)113 poly6.set_stroke(color=BLACK, width = 0.)114 poly6.set_fill(color = GREEN_E, opacity=0.9)115 poly6_4=Polygon(D, K, I)116 poly6_4.set_stroke(color=BLACK, width = 0.)117 poly6_4.set_fill(color = GOLD_E, opacity=0.5)118 poly7=Polygon(D, I, M)119 poly7.set_stroke(color=BLACK, width = 0.)120 poly7.set_fill(color = RED_E, opacity=0.9)121 poly7w=Polygon(D, I, M)122 poly7w.set_stroke(color=BLACK, width = 0.)123 poly7w.set_fill(color = WHITE, opacity=0.9)124 poly8=Polygon(D, M, A)125 poly8.set_stroke(color=BLACK, width = 0.)126 poly8.set_fill(color = RED_E, opacity=0.9)127 poly8d=Polygon(J, M, A)128 poly8d.set_stroke(color=BLACK, width = 0.)129 poly8d.set_fill(color = RED_E, opacity=0.9)130 poly8dw=Polygon(J, A, M)131 poly8dw.set_stroke(color=BLACK, width = 0.)132 poly8dw.set_fill(color = WHITE, opacity=0.9)133 poly9=Polygon(D, A, J)134 poly9.set_stroke(color=BLACK, width = 0.)135 poly9.set_fill(color = GREEN_E, opacity=0.9)136 poly9_7=Polygon(D, I, J)137 poly9_7.set_stroke(color=BLACK, width = 0.)138 poly9_7.set_fill(color = GOLD_E, opacity=0.5)139 poly10=Polygon(D, J, E)140 poly10.set_stroke(color=BLACK, width = 0.)141 poly10.set_fill(color = GREEN_E, opacity=0.9)142 poly11=Polygon(D, E, N)143 poly11.set_stroke(color=BLACK, width = 0.)144 poly11.set_fill(color = RED_E, opacity=0.9)145 poly11w=Polygon(D, N, E)146 poly11w.set_stroke(color=BLACK, width = 0.)147 poly11w.set_fill(color = WHITE, opacity=0.9)148 poly12=Polygon(D, N, C)149 poly12.set_stroke(color=BLACK, width = 0.)150 poly12.set_fill(color = RED_E, opacity=0.9)151 poly12w=Polygon(D, N, C)152 poly12w.set_stroke(color=BLACK, width = 0.)153 poly12w.set_fill(color = WHITE, opacity=0.9)154 poly1_2=Polygon(D, C, F)155 poly1_2.set_stroke(color=BLACK, width = 0.3)156 poly1_2.set_fill(color = GREEN_E, opacity=0.9)157 poly3_4=Polygon(D, F, B)158 poly3_4.set_stroke(color=BLACK, width = 0.3)159 poly3_4.set_fill(color = RED_E, opacity=0.9)160 poly5_6=Polygon(D, B, I)161 poly5_6.set_stroke(color=BLACK, width = 0.3)162 poly5_6.set_fill(color = GREEN_E, opacity=0.9)163 poly7_8=Polygon(D, I, A)164 poly7_8.set_stroke(color=BLACK, width = 0.3)165 poly7_8.set_fill(color = RED_E, opacity=0.9)166 poly9_10=Polygon(D, A, E)167 poly9_10.set_stroke(color=BLACK, width = 0.3)168 poly9_10.set_fill(color = GREEN_E, opacity=0.9)169 poly11_12=Polygon(D, E, C)170 poly11_12.set_stroke(color=BLACK, width = 0.3)171 poly11_12.set_fill(color = RED_E, opacity=0.9)172 dt=1.173 self.play(ShowCreation(poly1_2), run_time=0.7)174 self.play(ShowCreation(poly3_4), run_time=0.7)175 self.play(ShowCreation(poly5_6), run_time=0.7)176 self.play(ShowCreation(poly7_8), run_time=0.7)177 self.play(ShowCreation(poly9_10), run_time=0.7)178 self.play(ShowCreation(poly11_12), run_time=0.7)179 self.play(Write(title2))180 self.wait(2.)181 self.play(*map(FadeOut, [title2]), run_time=0.5)182 self.play(FadeIn(poly1), FadeIn(poly2), FadeIn(poly3), FadeIn(poly4), FadeIn(poly5), FadeIn(poly6), FadeIn(poly7), FadeIn(poly8), FadeIn(poly9), FadeIn(poly10), FadeIn(poly11), FadeIn(poly12), run_time=dt)183 self.remove(poly1_2, poly3_4, poly5_6, poly7_8, poly9_10, poly11_12)184 self.play(ShowCreation(D0), ShowCreation(F0), ShowCreation(I0), ShowCreation(E0), ShowCreation(lineDF), ShowCreation(lineDI), ShowCreation(lineDE), run_time=dt)185 self.wait(0.5)186 self.play(ShowCreation(lineJK), ShowCreation(J0), ShowCreation(K0))187 self.play(ShowCreation(lineDN), ShowCreation(N0))188 self.play(ShowCreation(lineJM), ShowCreation(lineKL), ShowCreation(lineNO), ShowCreation(L0), ShowCreation(M0), ShowCreation(O0), run_time=0.5)189 self.play(ShowCreation(lineDM), ShowCreation(lineDL), ShowCreation(lineDO), run_time=0.5)190 self.play(ReplacementTransform(poly6,poly6_4), run_time=4.)191 self.play(ReplacementTransform(poly6_4,poly4w), run_time=4.)192 self.play(FadeIn(K0), FadeIn(B0), FadeIn(D0), FadeIn(lineKL), FadeIn(lineAB), FadeIn(lineBC), run_time=dt)193 self.play(ReplacementTransform(poly9,poly9_7), run_time=4.)194 self.play(ReplacementTransform(poly9_7,poly7w), run_time=4.)195 self.play(FadeIn(M0), FadeIn(I0), FadeIn(D0), FadeIn(lineAB), FadeIn(lineDI), FadeIn(lineDM), FadeIn(lineDA), run_time=dt)196 self.play(ReplacementTransform(poly2,poly2_12), run_time=4.)197 self.play(ReplacementTransform(poly2_12,poly12w), run_time=4.)198 self.play(FadeIn(C0), FadeIn(N0), FadeIn(D0), FadeIn(O0), FadeIn(lineNO), FadeIn(lineCA), FadeIn(lineDC), run_time=dt)199 self.play(ReplacementTransform(poly1,poly1d), run_time=3.)200 self.play(FadeIn(C0), FadeIn(N0), FadeIn(O0), FadeIn(lineDB), run_time=dt)201 self.play(ReplacementTransform(poly5,poly5d), run_time=3.)202 self.play(FadeIn(L0), FadeIn(K0), FadeIn(B0), run_time=dt)203 self.play(ReplacementTransform(poly8,poly8d), run_time=3.)204 self.play(FadeIn(A0), FadeIn(M0), FadeIn(J0), FadeIn(lineDA), run_time=dt)205 self.play(ReplacementTransform(poly10,poly11w), run_time=4.)206 self.play(FadeIn(N0), FadeIn(D0), FadeIn(E0), FadeIn(lineDE), FadeIn(lineDN), FadeIn(lineCA), run_time=dt)207 self.play(ReplacementTransform(poly1d,poly3w), run_time=4.)208 self.play(FadeIn(D0), FadeIn(F0), FadeIn(K0), FadeIn(lineJK), FadeIn(lineDF), FadeIn(lineBC), run_time=dt)209 self.play(ReplacementTransform(poly5d,poly8dw), run_time=4.)...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

...19l_color = ColorSensor(Port.S2)20gyro = GyroSensor(Port.S4)21while True:22 if ev3.buttons.pressed():23 r_motor.run_time(200,2500, wait = False)24 l_motor.run_time(200,2500)25 c = range(41)26 for i in c: 27 first_val = r_color.reflection() - 2528 if first_val > 0:29 l_motor.run_time(200,4*(first_val+20), wait = False)30 r_motor.run_time(200,1*(first_val+20))31 elif first_val < 0:32 r_motor.run_time(200,5*abs(first_val-50), wait = False)33 l_motor.run_time(200,2*abs(first_val-50))34 else:35 r_motor.run_time(200,120, wait = False)36 l_motor.run_time(200,120)37 gyro.reset_angle(0)38 while True:39 if gyro.angle() >= 67:40 break41 else:42 ev3.screen.print(gyro.angle())43 r_motor.run_time(100,100,wait = False)44 c = range(39)45 for i in c: 46 first_val = r_color.reflection() - 2547 if first_val > 0:48 l_motor.run_time(200,4*(first_val+20), wait = False)49 r_motor.run_time(200,1*(first_val+20))50 elif first_val < 0:51 r_motor.run_time(200,5*abs(first_val-50), wait = False)52 l_motor.run_time(200,2*abs(first_val-50))53 else:54 r_motor.run_time(200,120, wait = False)55 l_motor.run_time(200,120)56 c = range(70)57 for i in c: 58 first_val = r_color.reflection() - 2559 if first_val > 0:60 l_motor.run_time(100,3*(first_val+20), wait = False)61 r_motor.run_time(100,1*(first_val+20))62 elif first_val < 0:63 r_motor.run_time(100,3*abs(first_val-40), wait = False)64 l_motor.run_time(100,1*abs(first_val-50))65 else:66 r_motor.run_time(200,120, wait = False)67 l_motor.run_time(200,120) 68 r_motor.run_time(100,2000)69 r_motor.run_time(100,100, wait = False)70 l_motor.run_time(100,100)71 gyro.reset_angle(0)72 while True:73 if gyro.angle() <= -1:74 break75 else:76 ev3.screen.print(gyro.angle())77 l_motor.run_time(100,100,wait = False)78 r_motor.run_time(0,0)79 ml_motor.run_time(600,7500)80 # r_motor.run_time(200,5*abs(first_val-50), wait = False)81 # l_motor.run_time(200,2*abs(first_val-50))82 # The code above also works but is a bit inaccurate83 r_motor.run_time(-200,200, wait = False)84 l_motor.run_time(-200,200)85 ml_motor.run_time(-400,5500)86 r_motor.run_time(-200,700, wait = False)87 l_motor.run_time(-200,700)88 gyro.reset_angle(0)89 while True:90 if gyro.angle() <= -3:91 break92 else:93 ev3.screen.print(gyro.angle())94 r_motor.run_time(-100,100,wait = False)95 r_motor.run_time(100,1740, wait = False)96 l_motor.run_time(100,1740)97 r_motor.run_time(-100,1000, wait = False)98 l_motor.run_time(-100,1000)99 100 gyro.reset_angle(0)101 while True:102 if gyro.angle() <= -21:103 break104 else:105 ev3.screen.print(gyro.angle())106 r_motor.run_time(-100,100,wait = False)107 108 r_motor.run_time(200,400, wait = False)109 l_motor.run_time(200,400)110 ml_motor.run_time(400,3800)111 112 r_motor.run_time(-200,2300, wait = False)113 l_motor.run_time(-200,2300)114 gyro.reset_angle(0)115 while True:116 if gyro.angle() <= -40:117 break118 else:119 ev3.screen.print(gyro.angle())120 l_motor.run_time(100,100,wait = False)121 r_motor.run_time(0,0)122 r_motor.run_time(200,3400, wait = False)123 l_motor.run_time(200,3400)124 mr_motor.run_time(-500,4700) 125 mr_motor.run_time(500,2800)126 gyro.reset_angle(0)127 while True:128 if gyro.angle() >= 7:129 break130 else:131 ev3.screen.print(gyro.angle())132 l_motor.run_time(-100,100,wait = False)133 r_motor.run_time(0,0)134 r_motor.run_time(-200,2200, wait = False)135 l_motor.run_time(-200,2200)136 137 r_motor.run_time(-200,400)138 l_motor.run_time(200,400)139 r_motor.run_time(-200,5000, wait = False)140 l_motor.run_time(-200,5000)141 gyro.reset_angle(0)142 while True:143 if gyro.angle() <= -52:144 break145 else:146 ev3.screen.print(gyro.angle())147 r_motor.run_time(-100,100,wait = False)148 l_motor.run_time(0,0) 149 r_motor.run_time(-400,3700, wait = False)150 l_motor.run_time(-400,3700)151 else:...

Full Screen

Full Screen

Automation Testing Tutorials

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.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run stestr automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful