How to use foreach method in elementium

Best Python code snippet using elementium_python

su.py

Source:su.py Github

copy

Full Screen

1#!/usr/bin/env python2debug=13def clean():4 foreach bR (0,1,2):5 foreach bC (0,1,2)6 :7 foreach lR (0,1,2)8 :9 foreach lC (0,1,2)10 :11 if (sudoku[bR][bC][lR][lC]{is not = 0)12 :13 foreach i (1,2,3,4,5,6,7,8,9)14 :15 sudoku[bR][bC][lR][lC]{couldbe{i = 016 17 value = sudoku[bR][bC][lR][lC]{is18 # eliminate couldbe' bR/lilrow19 foreach i (0,1,2)20 :21 foreach j (0,1,2)22 :23 # eliminate couldbe' bR/lR24 sudoku[bR][i][lR][j]{couldbe{value = 025 # eliminate couldbe' bC/lC26 sudoku[i][bC][j][lC]{couldbe{value = 027 # eliminate couldbe' bR/bC28 sudoku[bR][bC][i][j]{couldbe{value = 029 30 31 32 33 34 35 36 if (debug)37 :38 print "done cleaning+++\n"39 printMatrix()40 41def markOnlyOneAnswer():42 foreach bR (0,1,2)43 :44 foreach bC (0,1,2)45 :46 foreach lR (0,1,2)47 :48 foreach lC (0,1,2)49 :50 if (sudoku[bR][bC][lR][lC]{is == 0)51 :52 #=============================================================53 # evaluate couldbe to see if there is only 1 answer54 answer = 055 foreach i (1,2,3,4,5,6,7,8,9)56 :57 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)58 :59 answer += 160 value = i61 62 63 if (answer == 1)64 :65 sudoku[bR][bC][lR][lC]{is = value66 changes++67 if (debug)68 :69 print "found answer: "70 print "bR+bC+lR+lC = value\n"71 printMatrix()72 73 74 elsif (answer == 0)75 :76 print "ERROR bR+bC+lR+lC = value not not \n"; exit77 78 #=============================================================79 # evaluate 80 81 82 83 84 85def clearNumbersOnlyInXCells():86 # This analysis has to do with the X numbers only appearing in X cells in a row87 # or a column+ Say for instance you have 1,2,3 as possible choices in 3 cells88 # in a row+ Then you can safely eliminate 4,5,6,7,8,9 as possible choices in89 # those cells+90 foreach first (1,2,3,4,5,6,7,8,9)91 :92 foreach second (1,2,3,4,5,6,7,8,9)93 :94 if (second > first)95 :96 ### foreach third (1,2,3,4,5,6,7,8,9)97 ### :98 ### foreach fourth (1,2,3,4,5,6,7,8,9)99 ### :100 ### foreach fifth (1,2,3,4,5,6,7,8,9)101 ### :102 ### Check Rows103 foreach bR (0,1,2)104 :105 foreach lR (0,1,2)106 :107 rowCount=0108 rowFails=0109 foreach bC (0,1,2)110 :111 foreach lC (0,1,2)112 :113 value = ""114 115 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 && 116 sudoku[bR][bC][lR][lC]{couldbe{second == 1)117 :118 rowCount++119 120 elsif (sudoku[bR][bC][lR][lC]{couldbe{first == 1 ||121 sudoku[bR][bC][lR][lC]{couldbe{second == 1)122 :123 rowFails++124 125 126 127 if ( not rowFails && rowCount == 2)128 :129 if (debug) { print "found a hidden pair first,second in br=bR,lr=lR\n"; 130 foreach bC (0,1,2)131 :132 foreach lC (0,1,2)133 :134 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 &&135 sudoku[bR][bC][lR][lC]{couldbe{second == 1)136 :137 foreach i (1,2,3,4,5,6,7,8,9)138 :139 if (i not = first && i not = second)140 :141 sudoku[bR][bC][lR][lC]{couldbe{i = 0142 143 144 145 146 147 148 149 150 ### Check Columns151 foreach bC (0,1,2)152 :153 foreach lC (0,1,2)154 :155 colCount=0156 colFails=0157 foreach bR (0,1,2)158 :159 foreach lR (0,1,2)160 :161 value = ""162 163 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 && 164 sudoku[bR][bC][lR][lC]{couldbe{second == 1)165 :166 colCount++167 168 elsif (sudoku[bR][bC][lR][lC]{couldbe{first == 1 ||169 sudoku[bR][bC][lR][lC]{couldbe{second == 1)170 :171 colFails++172 173 174 175 if ( not colFails && colCount == 2)176 :177 if (debug) { print "found a hidden pair first,second in bc=bC,lc=lC\n"; 178 foreach bR (0,1,2)179 :180 foreach lR (0,1,2)181 :182 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 &&183 sudoku[bR][bC][lR][lC]{couldbe{second == 1)184 :185 foreach i (1,2,3,4,5,6,7,8,9)186 :187 if (i not = first && i not = second)188 :189 sudoku[bR][bC][lR][lC]{couldbe{i = 0190 191 192 193 194 195 196 197 198 ### 199 ### 200 ### 201 202 203 204def xwinganlysis_rows():205 foreach first (1,2,3,4,5,6,7,8,9)206 :207 vecs208 ### Check Rows209 foreach bR (0,1,2)210 :211 foreach lR (0,1,2)212 :213 rownum=bR*3+lR214 # create vectors for each first, see if there are 2 solutions and compare215 vecs[rownum]=sudoku[bR][*][lR][*]{couldbe{first216 217 218 #find vecs that have exactly 2 solutions219 foreach vec @vecs220 :221 @{vec222 223 if ( not rowFails && rowCount == 2)224 :225 if (debug) { print "found a hidden pair first,second in br=bR,lr=lR\n"; 226 foreach bC (0,1,2)227 :228 foreach lC (0,1,2)229 :230 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 &&231 sudoku[bR][bC][lR][lC]{couldbe{second == 1)232 :233 foreach i (1,2,3,4,5,6,7,8,9)234 :235 if (i not = first && i not = second)236 :237 sudoku[bR][bC][lR][lC]{couldbe{i = 0238 239 240 241 242 243 244 ### Check Columns245 foreach bC (0,1,2)246 :247 foreach lC (0,1,2)248 :249 colCount=0250 colFails=0251 foreach bR (0,1,2)252 :253 foreach lR (0,1,2)254 :255 value = ""256 257 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 && 258 sudoku[bR][bC][lR][lC]{couldbe{second == 1)259 :260 colCount++261 262 elsif (sudoku[bR][bC][lR][lC]{couldbe{first == 1 ||263 sudoku[bR][bC][lR][lC]{couldbe{second == 1)264 :265 colFails++266 267 268 269 if ( not colFails && colCount == 2)270 :271 if (debug) { print "found a hidden pair first,second in bc=bC,lc=lC\n"; 272 foreach bR (0,1,2)273 :274 foreach lR (0,1,2)275 :276 if (sudoku[bR][bC][lR][lC]{couldbe{first == 1 &&277 sudoku[bR][bC][lR][lC]{couldbe{second == 1)278 :279 foreach i (1,2,3,4,5,6,7,8,9)280 :281 if (i not = first && i not = second)282 :283 sudoku[bR][bC][lR][lC]{couldbe{i = 0284 285 286 287 288 289 290 291 292 293def clearPairROW():294 my (clearValue,bR,lR) = @_295 if (debug)296 :297 print "clearing pair row, clearValue, from bigRow, bR, lilRow, lR\n"298 299 foreach bC (0,1,2)300 :301 foreach lC (0,1,2)302 :303 value = ""304 foreach i (1,2,3,4,5,6,7,8,9)305 :306 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)307 :308 value = value+i309 310 311 if (value ne clearValue)312 :313 for (i=0; i < length(clearValue); i++)314 :315 foo = substr(clearValue,i,1)316 sudoku[bR][bC][lR][lC]{couldbe{foo = 0317 318 319 320 321def clearPairCOL():322 my (clearValue,bC,lC) = @_323 if (debug)324 :325 print "clearing pair col, clearValue, from bigCol, bC, lilCol, lC\n"326 327 foreach bR (0,1,2)328 :329 foreach lR (0,1,2)330 :331 value = ""332 foreach i (1,2,3,4,5,6,7,8,9)333 :334 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)335 :336 value = value+i337 338 339 if (value ne clearValue)340 :341 for (i=0; i < length(clearValue); i++)342 :343 foo = substr(clearValue,i,1)344 sudoku[bR][bC][lR][lC]{couldbe{foo = 0345 346 347 348 349def clearBlockExceptROW():350 my (clearValue,bR,bC,excludelR) = @_351 if (debug)352 :353 print "clearing block exept row, clearValue, from bigRow, bR, bigCol, "354 print "bC, lilRow, excludelR\n"355 356 foreach lR (0,1,2)357 :358 if (lR not = excludelR)359 :360 foreach lC (0,1,2)361 :362 for (i =0; i < length(clearValue); i++)363 :364 foo = substr(clearValue,i,1)365 sudoku[bR][bC][lR][lC]{couldbe{foo = 0366 367 368 369 370def clearBlockExceptCOL():371 my (clearValue,bR,bC,excludelC) = @_372 if (debug)373 :374 print "clearing block exept col, clearValue, from bigRow, bR, bigCol, "375 print "bC, lilCol, excludelC\n"376 377 foreach lR (0,1,2)378 :379 foreach lC (0,1,2)380 :381 if (lC not = excludelC)382 :383 for (i =0; i < length(clearValue); i++)384 :385 foo = substr(clearValue,i,1)386 sudoku[bR][bC][lR][lC]{couldbe{foo = 0387 388 389 390 391def printMatrix():392 my %numbersLeft393 394 if (debug)395 :396 foreach bR (0,1,2)397 :398 foreach lR (0,1,2)399 :400 for(i =0; i<3; i++)401 :402 foreach bC (0,1,2)403 :404 foreach lC (0,1,2)405 :406 if (sudoku[bR][bC][lR][lC]{is not = 0)407 :408 ### if (i == 0 || i == 2)409 ### :410 ### print "***"411 ### 412 ### elsif (i == 1)413 ### :414 ### print "*"+sudoku[bR][bC][lR][lC]{is+"*"415 ### 416 print sudoku[bR][bC][lR][lC]{is+sudoku[bR][bC][lR][lC]{is+sudoku[bR][bC][lR][lC]{is417 418 else419 :420 my @subset421 if (i == 0)422 :423 @subset = (1,2,3)424 425 elsif (i == 1)426 :427 @subset = (4,5,6)428 429 elsif (i == 2)430 :431 @subset = (7,8,9)432 433 foreach i (@subset)434 :435 if(sudoku[bR][bC][lR][lC]{couldbe{i)436 :437 print "i"438 numbersLeft{i++439 440 else441 :442 print "_"443 444 445 446 print " "447 448 449 print " "450 451 print "\n"452 453 print "\n"454 455 print "\n"456 457 foreach i (1,2,3,4,5,6,7,8,9)458 :459 print "i: numbersLeft{i\n"460 461 462 else463 :464 foreach bR (0,1,2)465 :466 foreach lR (0,1,2)467 :468 foreach bC (0,1,2)469 :470 foreach lC (0,1,2)471 :472 if (sudoku[bR][bC][lR][lC]{is not = 0)473 :474 print "sudoku[bR][bC][lR][lC]{is"475 476 else477 :478 print "?"479 480 481 print " "482 483 print " "484 485 print "\n"486 487 print "\n"488 489 490def puzzleSolved():491 # calculate whether the puzzle is solved or not492 if (debug)493 :494 print "checking if puzzle solved+++"495 496 foreach bR (0,1,2)497 :498 foreach bC (0,1,2)499 :500 foreach lR (0,1,2)501 :502 foreach lC (0,1,2)503 :504 foreach i (1,2,3,4,5,6,7,8,9)505 :506 if (sudoku[bR][bC][lR][lC]{couldbe{i not = 0)507 :508 if (debug)509 :510 print " nope\n"511 512 return 0513 514 515 516 517 518 519 if (debug)520 :521 print " YES not \n"522 523 return 1524#=======================525# START526#=======================527@input528foreach bR (0,1,2)529:530 foreach lR (0,1,2)531 :532 foreach bC (0,1,2)533 :534 foreach lC (0,1,2)535 :536 while (#input == -1 | 0)537 :538 chomp(entry = <>)539 @input = split(/ /,entry)540 541 sudoku[bR][bC][lR][lC]{is = shift(@input)542 543 544 545#=======================546# Initialize547#=======================548foreach bR (0,1,2)549:550 foreach bC (0,1,2)551 :552 foreach lR (0,1,2)553 :554 foreach lC (0,1,2)555 :556 if (sudoku[bR][bC][lR][lC]{is not = 0)557 :558 foreach i (1,2,3,4,5,6,7,8,9)559 :560 sudoku[bR][bC][lR][lC]{couldbe{i = 0561 562 563 else564 :565 foreach i (1,2,3,4,5,6,7,8,9)566 :567 sudoku[bR][bC][lR][lC]{couldbe{i = 1568 569 570 571 572 573while ( not puzzleSolved)574:575 iterations++576 changes = 0577 clean()578 # check each ROW for single values579 if (debug) { print "check each ROW for single values\n"; 580 foreach bR (0,1,2)581 :582 foreach lR (0,1,2)583 :584 foreach i (1,2,3,4,5,6,7,8,9)585 :586 answer = 0587 foreach bC (0,1,2)588 :589 foreach lC (0,1,2)590 :591 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)592 :593 answer += 1594 value = i595 valueBC = bC596 valueLC = lC597 598 599 600 if (answer == 1)601 :602 sudoku[bR][valueBC][lR][valueLC]{is = value603 changes++604 if (debug)605 { 606 print "found ROW answer: "607 print "bR+valueBC+lR+valueLC = value\n"608 printMatrix()609 610 clean()611 612 613 614 615 clean()616 # check each COL for single values617 if (debug) { print "check each COL for single values\n"; 618 foreach bC (0,1,2)619 :620 foreach lC (0,1,2)621 :622 foreach i (1,2,3,4,5,6,7,8,9)623 :624 answer = 0625 foreach bR (0,1,2)626 :627 foreach lR (0,1,2)628 :629 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)630 :631 answer += 1632 value = i633 valueBR = bR634 valueLR = lR635 636 637 638 if (answer == 1)639 :640 sudoku[valueBR][bC][valueLR][lC]{is = value641 changes++642 if (debug)643 { 644 print "found COL answer: "645 print "valueBR+bC+valueLR+lC = value\n"646 printMatrix()647 648 clean()649 650 651 652 653 # check each COL for BLOCK only values654 if (debug) { print "check each COL for BLOCK only values\n"; 655 foreach bC (0,1,2)656 :657 foreach lC (0,1,2)658 :659 foreach i (1,2,3,4,5,6,7,8,9)660 :661 my %colBlockOnly662 answer = 0663 foreach bR (0,1,2)664 :665 foreach lR (0,1,2)666 :667 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)668 :669 colBlockOnly{bR = 1670 671 672 673 my @foo = keys %colBlockOnly674 if (#foo == 0)675 :676 print "found COL for BLOCK only, i,foo[0],bC,lC\n"677 clearBlockExceptCOL(i,foo[0],bC,lC)678 clean()679 680 undef %colBlockOnly681 682 683 684 # check each ROW for BLOCK only values685 if (debug) { print "check each ROW for BLOCK only values\n"; 686 foreach bR (0,1,2)687 :688 foreach lR (0,1,2)689 :690 foreach i (1,2,3,4,5,6,7,8,9)691 :692 my %rowBlockOnly693 answer = 0694 foreach bC (0,1,2)695 :696 foreach lC (0,1,2)697 :698 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)699 :700 rowBlockOnly{bC = 1701 702 703 704 my @foo = keys %rowBlockOnly705 if (#foo == 0)706 :707 print "found ROW for BLOCK only, i,bR,foo[0],lR\n"708 clearBlockExceptROW(i,bR,foo[0],lR)709 clean()710 711 undef %rowBlockOnly712 713 714 715 # check each BLOCK for single values716 if (debug) { print "check each BLOCK for single values\n"; 717 foreach bR (0,1,2)718 :719 foreach bC (0,1,2)720 :721 foreach i (1,2,3,4,5,6,7,8,9)722 :723 answer = 0724 foreach lR (0,1,2)725 :726 foreach lC (0,1,2)727 :728 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)729 :730 answer += 1731 value = i732 valueLC = lC733 valueLR = lR734 735 736 737 if (answer == 1)738 :739 sudoku[bR][bC][valueLR][valueLC]{is = value740 changes++741 if (debug)742 { 743 print "found BLOCK answer: "744 print "bR+bC+valueLR+valueLC = value\n"745 printMatrix()746 747 clean()748 749 750 751 752 clean()753 markOnlyOneAnswer()754 if (debug) { print "check each ROW for pairs\n"; 755 foreach bR (0,1,2)756 :757 foreach lR (0,1,2)758 :759 my @savedValue760 count = 0761 foreach bC (0,1,2)762 :763 foreach lC (0,1,2)764 :765 answer = 0766 value = ""767 foreach i (1,2,3,4,5,6,7,8,9)768 :769 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)770 :771 answer += 1772 value = value+i773 774 775 if (answer == 2)776 :777 found = 0778 for (i=0; i <= #savedValue; i++)779 :780 if (value eq savedValue[i])781 :782print "FOUND: #savedValue savedValue[i] value\n"783 found = 1784 785 786 if (found == 0)787 :788 savedValue[count] = value789print "FOUND0: #savedValue savedValue[i] value\n"790 count++791 792 else793 :794 # we have found a "pair"795 if (debug) { print "ROW pair found: bR+bC+lR+lC = value\n"; printMatrix(); 796 clearPairROW(value,bR,lR)797 798 799 800 801 undef @savedValue802 803 804 clean()805 markOnlyOneAnswer()806 if (debug) { print "check each ROW for cell pairs\n"; 807 foreach bR (0,1,2)808 :809 foreach lR (0,1,2)810 :811 my @value812 foreach bC (0,1,2)813 :814 foreach lC (0,1,2)815 :816 answer = 0817 foreach i (1,2,3,4,5,6,7,8,9)818 :819 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)820 :821 value[i]++822 823 824 825 826 foreach i (1,2,3,4,5,6,7,8,9)827 :828 #### TODO ####829 830 831 832 if (debug) { print "check each COL for pairs\n"; 833 foreach bC (0,1,2)834 :835 foreach lC (0,1,2)836 :837 my @savedValueCOL838 count = 0839 foreach bR (0,1,2)840 :841 foreach lR (0,1,2)842 :843 answer = 0844 value = ""845 foreach i (1,2,3,4,5,6,7,8,9)846 :847 if (sudoku[bR][bC][lR][lC]{couldbe{i == 1)848 :849 answer += 1850 value = value+i851 852 853 if (answer == 2)854 :855 found = 0856 for (i=0; i <= #savedValueCOL; i++)857 :858 if (value eq savedValueCOL[i])859 :860 found = 1861 862 863 if (found == 0)864 :865 savedValueCOL[count] = value866 count++867 868 else869 :870 # we have found a "pair"871 if (debug) { print "COL pair found: bR+bC+lR+lC = value\n"; printMatrix(); 872 clearPairCOL(value,bC,lC)873 874 875 876 877 undef @savedValueCOL878 879 880 clearNumbersOnlyInXCells()881 if (debug)882 :883 printMatrix()884 print "================================================================================\n"885 886 if (changes == 0)887 :888 if (changeIterations++ == 40)889 :890 print "something's hosed+++\n"; exit891 892 893 else894 :895 changeIterations = 0896 897print "Solved in iterations Iterations \n"...

Full Screen

Full Screen

foreach.py

Source:foreach.py Github

copy

Full Screen

2import os3from collections import defaultdict4from zaf.component.decorator import requires5@requires(zk2='Zk2')6def test_foreach(zk2):7 result = zk2(8 [9 'runcommand',10 'testrunner',11 'testfinder',12 'testscheduler',13 'testresults',14 'textreport',15 'sut',16 ], 'run --suts-ids one --suts-ids two systest.data.suites.test_foreach')17 stdout = result.stdout18 assert (19 'systest.data.suites.test_foreach.'20 'test_foreach_config_entity[s=one]') in stdout, stdout...

Full Screen

Full Screen

ForEach.js

Source:ForEach.js Github

copy

Full Screen

1define([2 '../../Core/defined'3 ], function(4 defined) {5 'use strict';67 /**8 * Contains traversal functions for processing elements of the glTF hierarchy.9 */10 var ForEach = {};1112 ForEach.object = function(arrayOfObjects, handler) {13 if (defined(arrayOfObjects)) {14 for (var i = 0; i < arrayOfObjects.length; i++) {15 var object = arrayOfObjects[i];16 var returnValue = handler(object, i);17 if (typeof returnValue === 'number') {18 i += returnValue;19 }20 else if (returnValue) {21 break;22 }23 }24 }25 };2627 ForEach.topLevel = function(gltf, name, handler) {28 var arrayOfObjects = gltf[name];29 ForEach.object(arrayOfObjects, handler);30 };3132 ForEach.accessor = function(gltf, handler) {33 ForEach.topLevel(gltf, 'accessors', handler);34 };3536 ForEach.accessorWithSemantic = function(gltf, semantic, handler) {37 ForEach.mesh(gltf, function(mesh) {38 ForEach.meshPrimitive(mesh, function(primitive) {39 ForEach.meshPrimitiveAttribute(primitive, function(accessorId, attributeSemantic) {40 if (attributeSemantic.indexOf(semantic) === 0) {41 handler(accessorId, attributeSemantic, primitive);42 }43 });44 });45 });46 };4748 ForEach.animation = function(gltf, handler) {49 ForEach.topLevel(gltf, 'animations', handler);50 };5152 ForEach.animationSampler = function(animation, handler) {53 var samplers = animation.samplers;54 if (defined(samplers)) {55 ForEach.object(samplers, handler);56 }57 };5859 ForEach.buffer = function(gltf, handler) {60 ForEach.topLevel(gltf, 'buffers', handler);61 };6263 ForEach.bufferView = function(gltf, handler) {64 ForEach.topLevel(gltf, 'bufferViews', handler);65 };6667 ForEach.camera = function(gltf, handler) {68 ForEach.topLevel(gltf, 'cameras', handler);69 };7071 ForEach.image = function(gltf, handler) {72 ForEach.topLevel(gltf, 'images', handler);73 };7475 ForEach.material = function(gltf, handler) {76 ForEach.topLevel(gltf, 'materials', handler);77 };7879 ForEach.materialValue = function(material, handler) {80 var values = material.values;81 if (defined(values)) {82 for (var name in values) {83 if (values.hasOwnProperty(name)) {84 handler(values[name], name);85 }86 }87 }88 };8990 ForEach.mesh = function(gltf, handler) {91 ForEach.topLevel(gltf, 'meshes', handler);92 };9394 ForEach.meshPrimitive = function(mesh, handler) {95 var primitives = mesh.primitives;96 if (defined(primitives)) {97 var primitivesLength = primitives.length;98 for (var i = 0; i < primitivesLength; i++) {99 var primitive = primitives[i];100 handler(primitive, i);101 }102 }103 };104105 ForEach.meshPrimitiveAttribute = function(primitive, handler) {106 var attributes = primitive.attributes;107 if (defined(attributes)) {108 for (var semantic in attributes) {109 if (attributes.hasOwnProperty(semantic)) {110 handler(attributes[semantic], semantic);111 }112 }113 }114 };115116 ForEach.meshPrimitiveTargetAttribute = function(primitive, handler) {117 var targets = primitive.targets;118 if (defined(targets)) {119 for (var targetId in targets) {120 if (targets.hasOwnProperty(targetId)) {121 var target = targets[targetId];122 for (var attributeId in target) {123 if (target.hasOwnProperty(attributeId) && attributeId !== 'extras') {124 handler(target[attributeId], attributeId);125 }126 }127 }128 }129 }130 };131132 ForEach.node = function(gltf, handler) {133 ForEach.topLevel(gltf, 'nodes', handler);134 };135136 ForEach.nodeInTree = function(gltf, nodeIds, handler) {137 var nodes = gltf.nodes;138 if (defined(nodes)) {139 for (var i = 0; i < nodeIds.length; i++) {140 var nodeId = nodeIds[i];141 var node = nodes[nodeId];142 if (defined(node)) {143 handler(node, nodeId);144 var children = node.children;145 if (defined(children)) {146 ForEach.nodeInTree(gltf, children, handler);147 }148 }149 }150 }151 };152153 ForEach.nodeInScene = function(gltf, scene, handler) {154 var sceneNodeIds = scene.nodes;155 if (defined(sceneNodeIds)) {156 ForEach.nodeInTree(gltf, sceneNodeIds, handler);157 }158 };159160 ForEach.program = function(gltf, handler) {161 ForEach.topLevel(gltf, 'programs', handler);162 };163164 ForEach.sampler = function(gltf, handler) {165 ForEach.topLevel(gltf, 'samplers', handler);166 };167168 ForEach.scene = function(gltf, handler) {169 ForEach.topLevel(gltf, 'scenes', handler);170 };171172 ForEach.shader = function(gltf, handler) {173 ForEach.topLevel(gltf, 'shaders', handler);174 };175176 ForEach.skin = function(gltf, handler) {177 ForEach.topLevel(gltf, 'skins', handler);178 };179180 ForEach.techniqueAttribute = function(technique, handler) {181 var attributes = technique.attributes;182 if (defined(attributes)) {183 for (var semantic in attributes) {184 if (attributes.hasOwnProperty(semantic)) {185 if (handler(attributes[semantic], semantic)) {186 break;187 }188 }189 }190 }191 };192193 ForEach.techniqueParameter = function(technique, handler) {194 var parameters = technique.parameters;195 if (defined(parameters)) {196 for (var parameterName in parameters) {197 if (parameters.hasOwnProperty(parameterName)) {198 if (handler(parameters[parameterName], parameterName)) {199 break;200 }201 }202 }203 }204 };205206 ForEach.technique = function(gltf, handler) {207 ForEach.topLevel(gltf, 'techniques', handler);208 };209210 ForEach.texture = function(gltf, handler) {211 ForEach.topLevel(gltf, 'textures', handler);212 };213214 return ForEach; ...

Full Screen

Full Screen

d3.node.js

Source:d3.node.js Github

copy

Full Screen

1'use strict';2Object.defineProperty(exports, '__esModule', { value: true });3var d3Array = require('d3-array');4var d3Axis = require('d3-axis');5var d3Brush = require('d3-brush');6var d3Chord = require('d3-chord');7var d3Collection = require('d3-collection');8var d3Color = require('d3-color');9var d3Contour = require('d3-contour');10var d3Dispatch = require('d3-dispatch');11var d3Drag = require('d3-drag');12var d3Dsv = require('d3-dsv');13var d3Ease = require('d3-ease');14var d3Fetch = require('d3-fetch');15var d3Force = require('d3-force');16var d3Format = require('d3-format');17var d3Geo = require('d3-geo');18var d3Hierarchy = require('d3-hierarchy');19var d3Interpolate = require('d3-interpolate');20var d3Path = require('d3-path');21var d3Polygon = require('d3-polygon');22var d3Quadtree = require('d3-quadtree');23var d3Random = require('d3-random');24var d3Scale = require('d3-scale');25var d3ScaleChromatic = require('d3-scale-chromatic');26var d3Selection = require('d3-selection');27var d3Shape = require('d3-shape');28var d3Time = require('d3-time');29var d3TimeFormat = require('d3-time-format');30var d3Timer = require('d3-timer');31var d3Transition = require('d3-transition');32var d3Voronoi = require('d3-voronoi');33var d3Zoom = require('d3-zoom');34var version = "5.7.0";35Object.keys(d3Array).forEach(function (key) { exports[key] = d3Array[key]; });36Object.keys(d3Axis).forEach(function (key) { exports[key] = d3Axis[key]; });37Object.keys(d3Brush).forEach(function (key) { exports[key] = d3Brush[key]; });38Object.keys(d3Chord).forEach(function (key) { exports[key] = d3Chord[key]; });39Object.keys(d3Collection).forEach(function (key) { exports[key] = d3Collection[key]; });40Object.keys(d3Color).forEach(function (key) { exports[key] = d3Color[key]; });41Object.keys(d3Contour).forEach(function (key) { exports[key] = d3Contour[key]; });42Object.keys(d3Dispatch).forEach(function (key) { exports[key] = d3Dispatch[key]; });43Object.keys(d3Drag).forEach(function (key) { exports[key] = d3Drag[key]; });44Object.keys(d3Dsv).forEach(function (key) { exports[key] = d3Dsv[key]; });45Object.keys(d3Ease).forEach(function (key) { exports[key] = d3Ease[key]; });46Object.keys(d3Fetch).forEach(function (key) { exports[key] = d3Fetch[key]; });47Object.keys(d3Force).forEach(function (key) { exports[key] = d3Force[key]; });48Object.keys(d3Format).forEach(function (key) { exports[key] = d3Format[key]; });49Object.keys(d3Geo).forEach(function (key) { exports[key] = d3Geo[key]; });50Object.keys(d3Hierarchy).forEach(function (key) { exports[key] = d3Hierarchy[key]; });51Object.keys(d3Interpolate).forEach(function (key) { exports[key] = d3Interpolate[key]; });52Object.keys(d3Path).forEach(function (key) { exports[key] = d3Path[key]; });53Object.keys(d3Polygon).forEach(function (key) { exports[key] = d3Polygon[key]; });54Object.keys(d3Quadtree).forEach(function (key) { exports[key] = d3Quadtree[key]; });55Object.keys(d3Random).forEach(function (key) { exports[key] = d3Random[key]; });56Object.keys(d3Scale).forEach(function (key) { exports[key] = d3Scale[key]; });57Object.keys(d3ScaleChromatic).forEach(function (key) { exports[key] = d3ScaleChromatic[key]; });58Object.keys(d3Selection).forEach(function (key) { exports[key] = d3Selection[key]; });59Object.keys(d3Shape).forEach(function (key) { exports[key] = d3Shape[key]; });60Object.keys(d3Time).forEach(function (key) { exports[key] = d3Time[key]; });61Object.keys(d3TimeFormat).forEach(function (key) { exports[key] = d3TimeFormat[key]; });62Object.keys(d3Timer).forEach(function (key) { exports[key] = d3Timer[key]; });63Object.keys(d3Transition).forEach(function (key) { exports[key] = d3Transition[key]; });64Object.keys(d3Voronoi).forEach(function (key) { exports[key] = d3Voronoi[key]; });65Object.keys(d3Zoom).forEach(function (key) { exports[key] = d3Zoom[key]; });66exports.version = version;...

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 elementium 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