benchmarking.c 860 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546
  1. /* Generated by Cython 0.20.1 on Sun Mar 16 22:58:12 2014 */
  2. #define PY_SSIZE_T_CLEAN
  3. #ifndef CYTHON_USE_PYLONG_INTERNALS
  4. #ifdef PYLONG_BITS_IN_DIGIT
  5. #define CYTHON_USE_PYLONG_INTERNALS 0
  6. #else
  7. #include "pyconfig.h"
  8. #ifdef PYLONG_BITS_IN_DIGIT
  9. #define CYTHON_USE_PYLONG_INTERNALS 1
  10. #else
  11. #define CYTHON_USE_PYLONG_INTERNALS 0
  12. #endif
  13. #endif
  14. #endif
  15. #include "Python.h"
  16. #ifndef Py_PYTHON_H
  17. #error Python headers needed to compile C extensions, please install development version of Python.
  18. #elif PY_VERSION_HEX < 0x02040000
  19. #error Cython requires Python 2.4+.
  20. #else
  21. #define CYTHON_ABI "0_20_1"
  22. #include <stddef.h> /* For offsetof */
  23. #ifndef offsetof
  24. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  25. #endif
  26. #if !defined(WIN32) && !defined(MS_WINDOWS)
  27. #ifndef __stdcall
  28. #define __stdcall
  29. #endif
  30. #ifndef __cdecl
  31. #define __cdecl
  32. #endif
  33. #ifndef __fastcall
  34. #define __fastcall
  35. #endif
  36. #endif
  37. #ifndef DL_IMPORT
  38. #define DL_IMPORT(t) t
  39. #endif
  40. #ifndef DL_EXPORT
  41. #define DL_EXPORT(t) t
  42. #endif
  43. #ifndef PY_LONG_LONG
  44. #define PY_LONG_LONG LONG_LONG
  45. #endif
  46. #ifndef Py_HUGE_VAL
  47. #define Py_HUGE_VAL HUGE_VAL
  48. #endif
  49. #ifdef PYPY_VERSION
  50. #define CYTHON_COMPILING_IN_PYPY 1
  51. #define CYTHON_COMPILING_IN_CPYTHON 0
  52. #else
  53. #define CYTHON_COMPILING_IN_PYPY 0
  54. #define CYTHON_COMPILING_IN_CPYTHON 1
  55. #endif
  56. #if CYTHON_COMPILING_IN_PYPY
  57. #define Py_OptimizeFlag 0
  58. #endif
  59. #if PY_VERSION_HEX < 0x02050000
  60. typedef int Py_ssize_t;
  61. #define PY_SSIZE_T_MAX INT_MAX
  62. #define PY_SSIZE_T_MIN INT_MIN
  63. #define PY_FORMAT_SIZE_T ""
  64. #define CYTHON_FORMAT_SSIZE_T ""
  65. #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  66. #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
  67. #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
  68. (PyErr_Format(PyExc_TypeError, \
  69. "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
  70. (PyObject*)0))
  71. #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
  72. !PyComplex_Check(o))
  73. #define PyIndex_Check __Pyx_PyIndex_Check
  74. #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
  75. #define __PYX_BUILD_PY_SSIZE_T "i"
  76. #else
  77. #define __PYX_BUILD_PY_SSIZE_T "n"
  78. #define CYTHON_FORMAT_SSIZE_T "z"
  79. #define __Pyx_PyIndex_Check PyIndex_Check
  80. #endif
  81. #if PY_VERSION_HEX < 0x02060000
  82. #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
  83. #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
  84. #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
  85. #define PyVarObject_HEAD_INIT(type, size) \
  86. PyObject_HEAD_INIT(type) size,
  87. #define PyType_Modified(t)
  88. typedef struct {
  89. void *buf;
  90. PyObject *obj;
  91. Py_ssize_t len;
  92. Py_ssize_t itemsize;
  93. int readonly;
  94. int ndim;
  95. char *format;
  96. Py_ssize_t *shape;
  97. Py_ssize_t *strides;
  98. Py_ssize_t *suboffsets;
  99. void *internal;
  100. } Py_buffer;
  101. #define PyBUF_SIMPLE 0
  102. #define PyBUF_WRITABLE 0x0001
  103. #define PyBUF_FORMAT 0x0004
  104. #define PyBUF_ND 0x0008
  105. #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
  106. #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
  107. #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
  108. #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
  109. #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
  110. #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
  111. #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
  112. typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
  113. typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
  114. #endif
  115. #if PY_MAJOR_VERSION < 3
  116. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  117. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  118. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  119. #define __Pyx_DefaultClassType PyClass_Type
  120. #else
  121. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  122. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
  123. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  124. #define __Pyx_DefaultClassType PyType_Type
  125. #endif
  126. #if PY_VERSION_HEX < 0x02060000
  127. #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
  128. #endif
  129. #if PY_MAJOR_VERSION >= 3
  130. #define Py_TPFLAGS_CHECKTYPES 0
  131. #define Py_TPFLAGS_HAVE_INDEX 0
  132. #endif
  133. #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
  134. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  135. #endif
  136. #if PY_VERSION_HEX < 0x02060000
  137. #define Py_TPFLAGS_HAVE_VERSION_TAG 0
  138. #endif
  139. #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
  140. #define Py_TPFLAGS_IS_ABSTRACT 0
  141. #endif
  142. #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
  143. #define Py_TPFLAGS_HAVE_FINALIZE 0
  144. #endif
  145. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  146. #define CYTHON_PEP393_ENABLED 1
  147. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
  148. 0 : _PyUnicode_Ready((PyObject *)(op)))
  149. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  150. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  151. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  152. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  153. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  154. #else
  155. #define CYTHON_PEP393_ENABLED 0
  156. #define __Pyx_PyUnicode_READY(op) (0)
  157. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  158. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  159. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  160. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  161. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  162. #endif
  163. #if CYTHON_COMPILING_IN_PYPY
  164. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  165. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  166. #else
  167. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  168. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
  169. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  170. #endif
  171. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  172. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  173. #if PY_MAJOR_VERSION >= 3
  174. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  175. #else
  176. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  177. #endif
  178. #if PY_MAJOR_VERSION >= 3
  179. #define PyBaseString_Type PyUnicode_Type
  180. #define PyStringObject PyUnicodeObject
  181. #define PyString_Type PyUnicode_Type
  182. #define PyString_Check PyUnicode_Check
  183. #define PyString_CheckExact PyUnicode_CheckExact
  184. #endif
  185. #if PY_VERSION_HEX < 0x02060000
  186. #define PyBytesObject PyStringObject
  187. #define PyBytes_Type PyString_Type
  188. #define PyBytes_Check PyString_Check
  189. #define PyBytes_CheckExact PyString_CheckExact
  190. #define PyBytes_FromString PyString_FromString
  191. #define PyBytes_FromStringAndSize PyString_FromStringAndSize
  192. #define PyBytes_FromFormat PyString_FromFormat
  193. #define PyBytes_DecodeEscape PyString_DecodeEscape
  194. #define PyBytes_AsString PyString_AsString
  195. #define PyBytes_AsStringAndSize PyString_AsStringAndSize
  196. #define PyBytes_Size PyString_Size
  197. #define PyBytes_AS_STRING PyString_AS_STRING
  198. #define PyBytes_GET_SIZE PyString_GET_SIZE
  199. #define PyBytes_Repr PyString_Repr
  200. #define PyBytes_Concat PyString_Concat
  201. #define PyBytes_ConcatAndDel PyString_ConcatAndDel
  202. #endif
  203. #if PY_MAJOR_VERSION >= 3
  204. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  205. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  206. #else
  207. #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
  208. PyString_Check(obj) || PyUnicode_Check(obj))
  209. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  210. #endif
  211. #if PY_VERSION_HEX < 0x02060000
  212. #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
  213. #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
  214. #endif
  215. #ifndef PySet_CheckExact
  216. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  217. #endif
  218. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  219. #if PY_MAJOR_VERSION >= 3
  220. #define PyIntObject PyLongObject
  221. #define PyInt_Type PyLong_Type
  222. #define PyInt_Check(op) PyLong_Check(op)
  223. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  224. #define PyInt_FromString PyLong_FromString
  225. #define PyInt_FromUnicode PyLong_FromUnicode
  226. #define PyInt_FromLong PyLong_FromLong
  227. #define PyInt_FromSize_t PyLong_FromSize_t
  228. #define PyInt_FromSsize_t PyLong_FromSsize_t
  229. #define PyInt_AsLong PyLong_AsLong
  230. #define PyInt_AS_LONG PyLong_AS_LONG
  231. #define PyInt_AsSsize_t PyLong_AsSsize_t
  232. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  233. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  234. #define PyNumber_Int PyNumber_Long
  235. #endif
  236. #if PY_MAJOR_VERSION >= 3
  237. #define PyBoolObject PyLongObject
  238. #endif
  239. #if PY_VERSION_HEX < 0x030200A4
  240. typedef long Py_hash_t;
  241. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  242. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  243. #else
  244. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  245. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  246. #endif
  247. #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
  248. #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
  249. #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
  250. #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
  251. #else
  252. #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
  253. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
  254. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
  255. (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
  256. #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
  257. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  258. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
  259. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
  260. #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
  261. (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
  262. (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
  263. (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
  264. #endif
  265. #if PY_MAJOR_VERSION >= 3
  266. #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
  267. #endif
  268. #if PY_VERSION_HEX < 0x02050000
  269. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
  270. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
  271. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
  272. #else
  273. #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
  274. #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
  275. #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
  276. #endif
  277. #if PY_VERSION_HEX < 0x02050000
  278. #define __Pyx_NAMESTR(n) ((char *)(n))
  279. #define __Pyx_DOCSTR(n) ((char *)(n))
  280. #else
  281. #define __Pyx_NAMESTR(n) (n)
  282. #define __Pyx_DOCSTR(n) (n)
  283. #endif
  284. #ifndef CYTHON_INLINE
  285. #if defined(__GNUC__)
  286. #define CYTHON_INLINE __inline__
  287. #elif defined(_MSC_VER)
  288. #define CYTHON_INLINE __inline
  289. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  290. #define CYTHON_INLINE inline
  291. #else
  292. #define CYTHON_INLINE
  293. #endif
  294. #endif
  295. #ifndef CYTHON_RESTRICT
  296. #if defined(__GNUC__)
  297. #define CYTHON_RESTRICT __restrict__
  298. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  299. #define CYTHON_RESTRICT __restrict
  300. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  301. #define CYTHON_RESTRICT restrict
  302. #else
  303. #define CYTHON_RESTRICT
  304. #endif
  305. #endif
  306. #ifdef NAN
  307. #define __PYX_NAN() ((float) NAN)
  308. #else
  309. static CYTHON_INLINE float __PYX_NAN() {
  310. /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
  311. a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
  312. a quiet NaN. */
  313. float value;
  314. memset(&value, 0xFF, sizeof(value));
  315. return value;
  316. }
  317. #endif
  318. #if PY_MAJOR_VERSION >= 3
  319. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  320. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  321. #else
  322. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  323. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  324. #endif
  325. #ifndef __PYX_EXTERN_C
  326. #ifdef __cplusplus
  327. #define __PYX_EXTERN_C extern "C"
  328. #else
  329. #define __PYX_EXTERN_C extern
  330. #endif
  331. #endif
  332. #if defined(WIN32) || defined(MS_WINDOWS)
  333. #define _USE_MATH_DEFINES
  334. #endif
  335. #include <math.h>
  336. #define __PYX_HAVE__lib__Naked__toolshed__c__benchmarking
  337. #define __PYX_HAVE_API__lib__Naked__toolshed__c__benchmarking
  338. #ifdef _OPENMP
  339. #include <omp.h>
  340. #endif /* _OPENMP */
  341. #ifdef PYREX_WITHOUT_ASSERTIONS
  342. #define CYTHON_WITHOUT_ASSERTIONS
  343. #endif
  344. #ifndef CYTHON_UNUSED
  345. # if defined(__GNUC__)
  346. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  347. # define CYTHON_UNUSED __attribute__ ((__unused__))
  348. # else
  349. # define CYTHON_UNUSED
  350. # endif
  351. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  352. # define CYTHON_UNUSED __attribute__ ((__unused__))
  353. # else
  354. # define CYTHON_UNUSED
  355. # endif
  356. #endif
  357. typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
  358. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
  359. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  360. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
  361. #define __PYX_DEFAULT_STRING_ENCODING ""
  362. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  363. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  364. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
  365. (sizeof(type) < sizeof(Py_ssize_t)) || \
  366. (sizeof(type) > sizeof(Py_ssize_t) && \
  367. likely(v < (type)PY_SSIZE_T_MAX || \
  368. v == (type)PY_SSIZE_T_MAX) && \
  369. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
  370. v == (type)PY_SSIZE_T_MIN))) || \
  371. (sizeof(type) == sizeof(Py_ssize_t) && \
  372. (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
  373. v == (type)PY_SSIZE_T_MAX))) )
  374. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
  375. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  376. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  377. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  378. #define __Pyx_PyBytes_FromString PyBytes_FromString
  379. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  380. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
  381. #if PY_MAJOR_VERSION < 3
  382. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  383. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  384. #else
  385. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  386. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  387. #endif
  388. #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  389. #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  390. #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
  391. #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
  392. #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((char*)s)
  393. #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
  394. #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
  395. #if PY_MAJOR_VERSION < 3
  396. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  397. {
  398. const Py_UNICODE *u_end = u;
  399. while (*u_end++) ;
  400. return u_end - u - 1;
  401. }
  402. #else
  403. #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
  404. #endif
  405. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  406. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  407. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  408. #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
  409. #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
  410. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  411. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
  412. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  413. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  414. #if CYTHON_COMPILING_IN_CPYTHON
  415. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  416. #else
  417. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  418. #endif
  419. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  420. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  421. static int __Pyx_sys_getdefaultencoding_not_ascii;
  422. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  423. PyObject* sys = NULL;
  424. PyObject* default_encoding = NULL;
  425. PyObject* ascii_chars_u = NULL;
  426. PyObject* ascii_chars_b = NULL;
  427. sys = PyImport_ImportModule("sys");
  428. if (sys == NULL) goto bad;
  429. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  430. if (default_encoding == NULL) goto bad;
  431. if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
  432. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  433. } else {
  434. const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
  435. char ascii_chars[128];
  436. int c;
  437. for (c = 0; c < 128; c++) {
  438. ascii_chars[c] = c;
  439. }
  440. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  441. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  442. if (ascii_chars_u == NULL) goto bad;
  443. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  444. if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  445. PyErr_Format(
  446. PyExc_ValueError,
  447. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  448. default_encoding_c);
  449. goto bad;
  450. }
  451. }
  452. Py_XDECREF(sys);
  453. Py_XDECREF(default_encoding);
  454. Py_XDECREF(ascii_chars_u);
  455. Py_XDECREF(ascii_chars_b);
  456. return 0;
  457. bad:
  458. Py_XDECREF(sys);
  459. Py_XDECREF(default_encoding);
  460. Py_XDECREF(ascii_chars_u);
  461. Py_XDECREF(ascii_chars_b);
  462. return -1;
  463. }
  464. #endif
  465. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  466. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  467. #else
  468. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  469. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  470. static char* __PYX_DEFAULT_STRING_ENCODING;
  471. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  472. PyObject* sys = NULL;
  473. PyObject* default_encoding = NULL;
  474. char* default_encoding_c;
  475. sys = PyImport_ImportModule("sys");
  476. if (sys == NULL) goto bad;
  477. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  478. if (default_encoding == NULL) goto bad;
  479. default_encoding_c = PyBytes_AS_STRING(default_encoding);
  480. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
  481. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  482. Py_DECREF(sys);
  483. Py_DECREF(default_encoding);
  484. return 0;
  485. bad:
  486. Py_XDECREF(sys);
  487. Py_XDECREF(default_encoding);
  488. return -1;
  489. }
  490. #endif
  491. #endif
  492. #ifdef __GNUC__
  493. /* Test for GCC > 2.95 */
  494. #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
  495. #define likely(x) __builtin_expect(!!(x), 1)
  496. #define unlikely(x) __builtin_expect(!!(x), 0)
  497. #else /* __GNUC__ > 2 ... */
  498. #define likely(x) (x)
  499. #define unlikely(x) (x)
  500. #endif /* __GNUC__ > 2 ... */
  501. #else /* __GNUC__ */
  502. #define likely(x) (x)
  503. #define unlikely(x) (x)
  504. #endif /* __GNUC__ */
  505. static PyObject *__pyx_m;
  506. static PyObject *__pyx_d;
  507. static PyObject *__pyx_b;
  508. static PyObject *__pyx_empty_tuple;
  509. static PyObject *__pyx_empty_bytes;
  510. static int __pyx_lineno;
  511. static int __pyx_clineno = 0;
  512. static const char * __pyx_cfilenm= __FILE__;
  513. static const char *__pyx_filename;
  514. static const char *__pyx_f[] = {
  515. "benchmarking.pyx",
  516. };
  517. /*--- Type declarations ---*/
  518. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer;
  519. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10;
  520. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100;
  521. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k;
  522. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k;
  523. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m;
  524. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark;
  525. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10;
  526. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100;
  527. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k;
  528. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k;
  529. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m;
  530. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  531. * # def myfunction():
  532. * #------------------------------------------------------------------------------
  533. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  534. * @wraps(func)
  535. * def wrapper(*args, **kwargs):
  536. */
  537. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer {
  538. PyObject_HEAD
  539. PyObject *__pyx_v_func;
  540. PyObject *__pyx_v_repetitions;
  541. };
  542. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  543. * #------------------------------------------------------------------------------
  544. *
  545. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  546. * @wraps(func)
  547. * def wrapper(*args, **kwargs):
  548. */
  549. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 {
  550. PyObject_HEAD
  551. PyObject *__pyx_v_func;
  552. PyObject *__pyx_v_repetitions;
  553. };
  554. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  555. * return wrapper
  556. *
  557. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  558. * @wraps(func)
  559. * def wrapper(*args, **kwargs):
  560. */
  561. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 {
  562. PyObject_HEAD
  563. PyObject *__pyx_v_func;
  564. PyObject *__pyx_v_repetitions;
  565. };
  566. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  567. * return wrapper
  568. *
  569. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  570. * @wraps(func)
  571. * def wrapper(*args, **kwargs):
  572. */
  573. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k {
  574. PyObject_HEAD
  575. PyObject *__pyx_v_func;
  576. PyObject *__pyx_v_repetitions;
  577. };
  578. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  579. * return wrapper
  580. *
  581. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  582. * @wraps(func)
  583. * def wrapper(*args, **kwargs):
  584. */
  585. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k {
  586. PyObject_HEAD
  587. PyObject *__pyx_v_func;
  588. PyObject *__pyx_v_repetitions;
  589. };
  590. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  591. * return wrapper
  592. *
  593. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  594. * @wraps(func)
  595. * def wrapper(*args, **kwargs):
  596. */
  597. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m {
  598. PyObject_HEAD
  599. PyObject *__pyx_v_func;
  600. PyObject *__pyx_v_repetitions;
  601. };
  602. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  603. * # def myfunction():
  604. * #------------------------------------------------------------------------------
  605. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  606. * @wraps(func)
  607. * def wrapper(*args, **kwargs):
  608. */
  609. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark {
  610. PyObject_HEAD
  611. PyObject *__pyx_v_func;
  612. PyObject *__pyx_v_repetitions;
  613. PyObject *__pyx_v_trials;
  614. };
  615. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  616. * # additional benchmark decorators that replicate the above function with different # repetitions
  617. * #------------------------------------------------------------------------------
  618. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  619. * @wraps(func)
  620. * def wrapper(*args, **kwargs):
  621. */
  622. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 {
  623. PyObject_HEAD
  624. PyObject *__pyx_v_func;
  625. PyObject *__pyx_v_repetitions;
  626. PyObject *__pyx_v_trials;
  627. };
  628. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  629. * return wrapper
  630. *
  631. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  632. * @wraps(func)
  633. * def wrapper(*args, **kwargs):
  634. */
  635. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 {
  636. PyObject_HEAD
  637. PyObject *__pyx_v_func;
  638. PyObject *__pyx_v_repetitions;
  639. PyObject *__pyx_v_trials;
  640. };
  641. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  642. * return wrapper
  643. *
  644. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  645. * @wraps(func)
  646. * def wrapper(*args, **kwargs):
  647. */
  648. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k {
  649. PyObject_HEAD
  650. PyObject *__pyx_v_func;
  651. PyObject *__pyx_v_repetitions;
  652. PyObject *__pyx_v_trials;
  653. };
  654. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  655. * return wrapper
  656. *
  657. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  658. * @wraps(func)
  659. * def wrapper(*args, **kwargs):
  660. */
  661. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k {
  662. PyObject_HEAD
  663. PyObject *__pyx_v_func;
  664. PyObject *__pyx_v_repetitions;
  665. PyObject *__pyx_v_trials;
  666. };
  667. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  668. * return wrapper
  669. *
  670. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  671. * @wraps(func)
  672. * def wrapper(*args, **kwargs):
  673. */
  674. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m {
  675. PyObject_HEAD
  676. PyObject *__pyx_v_func;
  677. PyObject *__pyx_v_repetitions;
  678. PyObject *__pyx_v_trials;
  679. };
  680. #ifndef CYTHON_REFNANNY
  681. #define CYTHON_REFNANNY 0
  682. #endif
  683. #if CYTHON_REFNANNY
  684. typedef struct {
  685. void (*INCREF)(void*, PyObject*, int);
  686. void (*DECREF)(void*, PyObject*, int);
  687. void (*GOTREF)(void*, PyObject*, int);
  688. void (*GIVEREF)(void*, PyObject*, int);
  689. void* (*SetupContext)(const char*, int, const char*);
  690. void (*FinishContext)(void**);
  691. } __Pyx_RefNannyAPIStruct;
  692. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  693. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
  694. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  695. #ifdef WITH_THREAD
  696. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  697. if (acquire_gil) { \
  698. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
  699. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  700. PyGILState_Release(__pyx_gilstate_save); \
  701. } else { \
  702. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
  703. }
  704. #else
  705. #define __Pyx_RefNannySetupContext(name, acquire_gil) \
  706. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  707. #endif
  708. #define __Pyx_RefNannyFinishContext() \
  709. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  710. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  711. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  712. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  713. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  714. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  715. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  716. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  717. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  718. #else
  719. #define __Pyx_RefNannyDeclarations
  720. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  721. #define __Pyx_RefNannyFinishContext()
  722. #define __Pyx_INCREF(r) Py_INCREF(r)
  723. #define __Pyx_DECREF(r) Py_DECREF(r)
  724. #define __Pyx_GOTREF(r)
  725. #define __Pyx_GIVEREF(r)
  726. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  727. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  728. #define __Pyx_XGOTREF(r)
  729. #define __Pyx_XGIVEREF(r)
  730. #endif /* CYTHON_REFNANNY */
  731. #define __Pyx_XDECREF_SET(r, v) do { \
  732. PyObject *tmp = (PyObject *) r; \
  733. r = v; __Pyx_XDECREF(tmp); \
  734. } while (0)
  735. #define __Pyx_DECREF_SET(r, v) do { \
  736. PyObject *tmp = (PyObject *) r; \
  737. r = v; __Pyx_DECREF(tmp); \
  738. } while (0)
  739. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  740. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  741. #if CYTHON_COMPILING_IN_CPYTHON
  742. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  743. PyTypeObject* tp = Py_TYPE(obj);
  744. if (likely(tp->tp_getattro))
  745. return tp->tp_getattro(obj, attr_name);
  746. #if PY_MAJOR_VERSION < 3
  747. if (likely(tp->tp_getattr))
  748. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  749. #endif
  750. return PyObject_GetAttr(obj, attr_name);
  751. }
  752. #else
  753. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  754. #endif
  755. static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
  756. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
  757. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
  758. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
  759. const char* function_name); /*proto*/
  760. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  761. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
  762. static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed); /*proto*/
  763. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
  764. static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
  765. #if CYTHON_COMPILING_IN_CPYTHON
  766. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
  767. #else
  768. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  769. #endif
  770. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
  771. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  772. #define __Pyx_CyFunction_USED 1
  773. #include <structmember.h>
  774. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  775. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  776. #define __Pyx_CYFUNCTION_CCLASS 0x04
  777. #define __Pyx_CyFunction_GetClosure(f) \
  778. (((__pyx_CyFunctionObject *) (f))->func_closure)
  779. #define __Pyx_CyFunction_GetClassObj(f) \
  780. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  781. #define __Pyx_CyFunction_Defaults(type, f) \
  782. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  783. #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
  784. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  785. typedef struct {
  786. PyCFunctionObject func;
  787. PyObject *func_dict;
  788. PyObject *func_weakreflist;
  789. PyObject *func_name;
  790. PyObject *func_qualname;
  791. PyObject *func_doc;
  792. PyObject *func_globals;
  793. PyObject *func_code;
  794. PyObject *func_closure;
  795. PyObject *func_classobj; /* No-args super() class cell */
  796. void *defaults;
  797. int defaults_pyobjects;
  798. int flags;
  799. PyObject *defaults_tuple; /* Const defaults tuple */
  800. PyObject *defaults_kwdict; /* Const kwonly defaults dict */
  801. PyObject *(*defaults_getter)(PyObject *);
  802. PyObject *func_annotations; /* function annotations dict */
  803. } __pyx_CyFunctionObject;
  804. static PyTypeObject *__pyx_CyFunctionType = 0;
  805. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
  806. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  807. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  808. int flags, PyObject* qualname,
  809. PyObject *self,
  810. PyObject *module, PyObject *globals,
  811. PyObject* code);
  812. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  813. size_t size,
  814. int pyobjects);
  815. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  816. PyObject *tuple);
  817. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  818. PyObject *dict);
  819. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  820. PyObject *dict);
  821. static int __Pyx_CyFunction_init(void);
  822. #if CYTHON_COMPILING_IN_CPYTHON
  823. static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
  824. PyListObject* L = (PyListObject*) list;
  825. Py_ssize_t len = Py_SIZE(list);
  826. if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
  827. Py_INCREF(x);
  828. PyList_SET_ITEM(list, len, x);
  829. Py_SIZE(list) = len+1;
  830. return 0;
  831. }
  832. return PyList_Append(list, x);
  833. }
  834. #else
  835. #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
  836. #endif
  837. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  838. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
  839. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
  840. #include <string.h>
  841. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name); /*proto*/
  842. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  843. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
  844. #if PY_MAJOR_VERSION >= 3
  845. #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
  846. #else
  847. #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
  848. #endif
  849. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
  850. static int __Pyx_Print(PyObject*, PyObject *, int); /*proto*/
  851. #if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
  852. static PyObject* __pyx_print = 0;
  853. static PyObject* __pyx_print_kwargs = 0;
  854. #endif
  855. static int __Pyx_PrintOne(PyObject* stream, PyObject *o); /*proto*/
  856. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  857. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  858. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  859. static int __Pyx_check_binary_version(void);
  860. typedef struct {
  861. int code_line;
  862. PyCodeObject* code_object;
  863. } __Pyx_CodeObjectCacheEntry;
  864. struct __Pyx_CodeObjectCache {
  865. int count;
  866. int max_count;
  867. __Pyx_CodeObjectCacheEntry* entries;
  868. };
  869. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  870. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  871. static PyCodeObject *__pyx_find_code_object(int code_line);
  872. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  873. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  874. int py_line, const char *filename); /*proto*/
  875. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
  876. /* Module declarations from 'lib.Naked.toolshed.c.benchmarking' */
  877. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0;
  878. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0;
  879. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0;
  880. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0;
  881. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0;
  882. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0;
  883. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0;
  884. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0;
  885. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0;
  886. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0;
  887. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0;
  888. static PyTypeObject *__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0;
  889. #define __Pyx_MODULE_NAME "lib.Naked.toolshed.c.benchmarking"
  890. int __pyx_module_is_main_lib__Naked__toolshed__c__benchmarking = 0;
  891. /* Implementation of 'lib.Naked.toolshed.c.benchmarking' */
  892. static PyObject *__pyx_builtin_range;
  893. static PyObject *__pyx_builtin_sum;
  894. static PyObject *__pyx_builtin_ImportError;
  895. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  896. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  897. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  898. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  899. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  900. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  901. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  902. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  903. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  904. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  905. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  906. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions); /* proto */
  907. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  908. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  909. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  910. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  911. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  912. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  913. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  914. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  915. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  916. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  917. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
  918. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials); /* proto */
  919. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  920. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  921. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  922. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  923. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  924. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  925. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  926. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  927. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  928. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  929. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  930. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  931. static char __pyx_k_[] = "()...";
  932. static char __pyx_k_L[] = "L";
  933. static char __pyx_k_i[] = "i";
  934. static char __pyx_k_j[] = "j";
  935. static char __pyx_k_n[] = "n";
  936. static char __pyx_k_x[] = "x";
  937. static char __pyx_k_y[] = "y";
  938. static char __pyx_k__2[] = " ";
  939. static char __pyx_k__3[] = " : ";
  940. static char __pyx_k_gc[] = "gc";
  941. static char __pyx_k_ie[] = "ie";
  942. static char __pyx_k_np[] = "np";
  943. static char __pyx_k__16[] = "()";
  944. static char __pyx_k__17[] = ".";
  945. static char __pyx_k__19[] = ":\t";
  946. static char __pyx_k__20[] = "-";
  947. static char __pyx_k_end[] = "end";
  948. static char __pyx_k_run[] = "run";
  949. static char __pyx_k_sec[] = " sec";
  950. static char __pyx_k_std[] = "std";
  951. static char __pyx_k_sum[] = "sum";
  952. static char __pyx_k_sys[] = "sys";
  953. static char __pyx_k_args[] = "args";
  954. static char __pyx_k_end2[] = "end2";
  955. static char __pyx_k_file[] = "file";
  956. static char __pyx_k_func[] = "func";
  957. static char __pyx_k_main[] = "__main__";
  958. static char __pyx_k_mean[] = "mean";
  959. static char __pyx_k_name[] = "__name__";
  960. static char __pyx_k_test[] = "__test__";
  961. static char __pyx_k_time[] = "time";
  962. static char __pyx_k_Ratio[] = "Ratio: ";
  963. static char __pyx_k_Trial[] = "Trial ";
  964. static char __pyx_k_array[] = "array";
  965. static char __pyx_k_flush[] = "flush";
  966. static char __pyx_k_numpy[] = "numpy";
  967. static char __pyx_k_print[] = "print";
  968. static char __pyx_k_range[] = "range";
  969. static char __pyx_k_start[] = "start";
  970. static char __pyx_k_timer[] = "timer";
  971. static char __pyx_k_wraps[] = "wraps";
  972. static char __pyx_k_write[] = "write";
  973. static char __pyx_k_enable[] = "enable";
  974. static char __pyx_k_import[] = "__import__";
  975. static char __pyx_k_kwargs[] = "kwargs";
  976. static char __pyx_k_result[] = "result";
  977. static char __pyx_k_start2[] = "start2";
  978. static char __pyx_k_stdout[] = "stdout";
  979. static char __pyx_k_trials[] = "trials";
  980. static char __pyx_k_collect[] = "collect";
  981. static char __pyx_k_disable[] = "disable";
  982. static char __pyx_k_wrapper[] = "wrapper";
  983. static char __pyx_k_Mean_for[] = "Mean for ";
  984. static char __pyx_k_Starting[] = "Starting ";
  985. static char __pyx_k_timer_10[] = "timer_10";
  986. static char __pyx_k_timer_1k[] = "timer_1k";
  987. static char __pyx_k_timer_1m[] = "timer_1m";
  988. static char __pyx_k_functools[] = "functools";
  989. static char __pyx_k_timer_100[] = "timer_100";
  990. static char __pyx_k_timer_10k[] = "timer_10k";
  991. static char __pyx_k_ImportError[] = "ImportError";
  992. static char __pyx_k_repetitions[] = "repetitions";
  993. static char __pyx_k_result_list[] = "result_list";
  994. static char __pyx_k_repetitions_2[] = " repetitions: ";
  995. static char __pyx_k_benchmark_list[] = "benchmark_list";
  996. static char __pyx_k_mean_benchmark[] = "mean_benchmark";
  997. static char __pyx_k_repetitions_of[] = " repetitions of ";
  998. static char __pyx_k_Standard_Deviation[] = "Standard Deviation: ";
  999. static char __pyx_k_Mean_per_repetition[] = "Mean per repetition: ";
  1000. static char __pyx_k_timer_locals_wrapper[] = "timer.<locals>.wrapper";
  1001. static char __pyx_k_of_benchmark_function[] = " of benchmark function:";
  1002. static char __pyx_k_timer_trials_benchmark[] = "timer_trials_benchmark";
  1003. static char __pyx_k_timer_10_locals_wrapper[] = "timer_10.<locals>.wrapper";
  1004. static char __pyx_k_timer_1k_locals_wrapper[] = "timer_1k.<locals>.wrapper";
  1005. static char __pyx_k_timer_1m_locals_wrapper[] = "timer_1m.<locals>.wrapper";
  1006. static char __pyx_k_Starting_timed_trials_of[] = "Starting timed trials of ";
  1007. static char __pyx_k_timer_100_locals_wrapper[] = "timer_100.<locals>.wrapper";
  1008. static char __pyx_k_timer_10k_locals_wrapper[] = "timer_10k.<locals>.wrapper";
  1009. static char __pyx_k_timer_trials_benchmark_10[] = "timer_trials_benchmark_10";
  1010. static char __pyx_k_timer_trials_benchmark_1k[] = "timer_trials_benchmark_1k";
  1011. static char __pyx_k_timer_trials_benchmark_1m[] = "timer_trials_benchmark_1m";
  1012. static char __pyx_k_timer_trials_benchmark_100[] = "timer_trials_benchmark_100";
  1013. static char __pyx_k_timer_trials_benchmark_10k[] = "timer_trials_benchmark_10k";
  1014. static char __pyx_k_Users_ces_Desktop_code_naked_li[] = "/Users/ces/Desktop/code/naked/lib/Naked/toolshed/c/benchmarking.pyx";
  1015. static char __pyx_k_lib_Naked_toolshed_c_benchmarkin[] = "lib.Naked.toolshed.c.benchmarking";
  1016. static char __pyx_k_timer_trials_benchmark_100_local[] = "timer_trials_benchmark_100.<locals>.wrapper";
  1017. static char __pyx_k_timer_trials_benchmark_10_locals[] = "timer_trials_benchmark_10.<locals>.wrapper";
  1018. static char __pyx_k_timer_trials_benchmark_10k_local[] = "timer_trials_benchmark_10k.<locals>.wrapper";
  1019. static char __pyx_k_timer_trials_benchmark_1k_locals[] = "timer_trials_benchmark_1k.<locals>.wrapper";
  1020. static char __pyx_k_timer_trials_benchmark_1m_locals[] = "timer_trials_benchmark_1m.<locals>.wrapper";
  1021. static char __pyx_k_timer_trials_benchmark_locals_wr[] = "timer_trials_benchmark.<locals>.wrapper";
  1022. static PyObject *__pyx_kp_s_;
  1023. static PyObject *__pyx_n_s_ImportError;
  1024. static PyObject *__pyx_n_s_L;
  1025. static PyObject *__pyx_kp_s_Mean_for;
  1026. static PyObject *__pyx_kp_s_Mean_per_repetition;
  1027. static PyObject *__pyx_kp_s_Ratio;
  1028. static PyObject *__pyx_kp_s_Standard_Deviation;
  1029. static PyObject *__pyx_kp_s_Starting;
  1030. static PyObject *__pyx_kp_s_Starting_timed_trials_of;
  1031. static PyObject *__pyx_kp_s_Trial;
  1032. static PyObject *__pyx_kp_s_Users_ces_Desktop_code_naked_li;
  1033. static PyObject *__pyx_kp_s__16;
  1034. static PyObject *__pyx_kp_s__17;
  1035. static PyObject *__pyx_kp_s__19;
  1036. static PyObject *__pyx_kp_s__2;
  1037. static PyObject *__pyx_kp_s__20;
  1038. static PyObject *__pyx_kp_s__3;
  1039. static PyObject *__pyx_n_s_args;
  1040. static PyObject *__pyx_n_s_array;
  1041. static PyObject *__pyx_n_s_benchmark_list;
  1042. static PyObject *__pyx_n_s_collect;
  1043. static PyObject *__pyx_n_s_disable;
  1044. static PyObject *__pyx_n_s_enable;
  1045. static PyObject *__pyx_n_s_end;
  1046. static PyObject *__pyx_n_s_end2;
  1047. static PyObject *__pyx_n_s_file;
  1048. static PyObject *__pyx_n_s_flush;
  1049. static PyObject *__pyx_n_s_func;
  1050. static PyObject *__pyx_n_s_functools;
  1051. static PyObject *__pyx_n_s_gc;
  1052. static PyObject *__pyx_n_s_i;
  1053. static PyObject *__pyx_n_s_ie;
  1054. static PyObject *__pyx_n_s_import;
  1055. static PyObject *__pyx_n_s_j;
  1056. static PyObject *__pyx_n_s_kwargs;
  1057. static PyObject *__pyx_n_s_lib_Naked_toolshed_c_benchmarkin;
  1058. static PyObject *__pyx_n_s_main;
  1059. static PyObject *__pyx_n_s_mean;
  1060. static PyObject *__pyx_n_s_mean_benchmark;
  1061. static PyObject *__pyx_n_s_n;
  1062. static PyObject *__pyx_n_s_name;
  1063. static PyObject *__pyx_n_s_np;
  1064. static PyObject *__pyx_n_s_numpy;
  1065. static PyObject *__pyx_kp_s_of_benchmark_function;
  1066. static PyObject *__pyx_n_s_print;
  1067. static PyObject *__pyx_n_s_range;
  1068. static PyObject *__pyx_n_s_repetitions;
  1069. static PyObject *__pyx_kp_s_repetitions_2;
  1070. static PyObject *__pyx_kp_s_repetitions_of;
  1071. static PyObject *__pyx_n_s_result;
  1072. static PyObject *__pyx_n_s_result_list;
  1073. static PyObject *__pyx_n_s_run;
  1074. static PyObject *__pyx_kp_s_sec;
  1075. static PyObject *__pyx_n_s_start;
  1076. static PyObject *__pyx_n_s_start2;
  1077. static PyObject *__pyx_n_s_std;
  1078. static PyObject *__pyx_n_s_stdout;
  1079. static PyObject *__pyx_n_s_sum;
  1080. static PyObject *__pyx_n_s_sys;
  1081. static PyObject *__pyx_n_s_test;
  1082. static PyObject *__pyx_n_s_time;
  1083. static PyObject *__pyx_n_s_timer;
  1084. static PyObject *__pyx_n_s_timer_10;
  1085. static PyObject *__pyx_n_s_timer_100;
  1086. static PyObject *__pyx_n_s_timer_100_locals_wrapper;
  1087. static PyObject *__pyx_n_s_timer_10_locals_wrapper;
  1088. static PyObject *__pyx_n_s_timer_10k;
  1089. static PyObject *__pyx_n_s_timer_10k_locals_wrapper;
  1090. static PyObject *__pyx_n_s_timer_1k;
  1091. static PyObject *__pyx_n_s_timer_1k_locals_wrapper;
  1092. static PyObject *__pyx_n_s_timer_1m;
  1093. static PyObject *__pyx_n_s_timer_1m_locals_wrapper;
  1094. static PyObject *__pyx_n_s_timer_locals_wrapper;
  1095. static PyObject *__pyx_n_s_timer_trials_benchmark;
  1096. static PyObject *__pyx_n_s_timer_trials_benchmark_10;
  1097. static PyObject *__pyx_n_s_timer_trials_benchmark_100;
  1098. static PyObject *__pyx_n_s_timer_trials_benchmark_100_local;
  1099. static PyObject *__pyx_n_s_timer_trials_benchmark_10_locals;
  1100. static PyObject *__pyx_n_s_timer_trials_benchmark_10k;
  1101. static PyObject *__pyx_n_s_timer_trials_benchmark_10k_local;
  1102. static PyObject *__pyx_n_s_timer_trials_benchmark_1k;
  1103. static PyObject *__pyx_n_s_timer_trials_benchmark_1k_locals;
  1104. static PyObject *__pyx_n_s_timer_trials_benchmark_1m;
  1105. static PyObject *__pyx_n_s_timer_trials_benchmark_1m_locals;
  1106. static PyObject *__pyx_n_s_timer_trials_benchmark_locals_wr;
  1107. static PyObject *__pyx_n_s_trials;
  1108. static PyObject *__pyx_n_s_wrapper;
  1109. static PyObject *__pyx_n_s_wraps;
  1110. static PyObject *__pyx_n_s_write;
  1111. static PyObject *__pyx_n_s_x;
  1112. static PyObject *__pyx_n_s_y;
  1113. static PyObject *__pyx_int_1;
  1114. static PyObject *__pyx_int_10;
  1115. static PyObject *__pyx_int_50;
  1116. static PyObject *__pyx_int_100;
  1117. static PyObject *__pyx_int_1000;
  1118. static PyObject *__pyx_int_10000;
  1119. static PyObject *__pyx_int_100000;
  1120. static PyObject *__pyx_int_1000000;
  1121. static PyObject *__pyx_tuple__4;
  1122. static PyObject *__pyx_tuple__6;
  1123. static PyObject *__pyx_tuple__8;
  1124. static PyObject *__pyx_tuple__10;
  1125. static PyObject *__pyx_tuple__12;
  1126. static PyObject *__pyx_tuple__14;
  1127. static PyObject *__pyx_tuple__18;
  1128. static PyObject *__pyx_tuple__21;
  1129. static PyObject *__pyx_tuple__23;
  1130. static PyObject *__pyx_tuple__24;
  1131. static PyObject *__pyx_tuple__26;
  1132. static PyObject *__pyx_tuple__27;
  1133. static PyObject *__pyx_tuple__29;
  1134. static PyObject *__pyx_tuple__30;
  1135. static PyObject *__pyx_tuple__32;
  1136. static PyObject *__pyx_tuple__33;
  1137. static PyObject *__pyx_tuple__35;
  1138. static PyObject *__pyx_tuple__36;
  1139. static PyObject *__pyx_tuple__38;
  1140. static PyObject *__pyx_tuple__40;
  1141. static PyObject *__pyx_tuple__42;
  1142. static PyObject *__pyx_tuple__44;
  1143. static PyObject *__pyx_tuple__46;
  1144. static PyObject *__pyx_tuple__48;
  1145. static PyObject *__pyx_tuple__50;
  1146. static PyObject *__pyx_tuple__52;
  1147. static PyObject *__pyx_tuple__54;
  1148. static PyObject *__pyx_tuple__56;
  1149. static PyObject *__pyx_tuple__58;
  1150. static PyObject *__pyx_tuple__60;
  1151. static PyObject *__pyx_codeobj__5;
  1152. static PyObject *__pyx_codeobj__7;
  1153. static PyObject *__pyx_codeobj__9;
  1154. static PyObject *__pyx_codeobj__11;
  1155. static PyObject *__pyx_codeobj__13;
  1156. static PyObject *__pyx_codeobj__15;
  1157. static PyObject *__pyx_codeobj__22;
  1158. static PyObject *__pyx_codeobj__25;
  1159. static PyObject *__pyx_codeobj__28;
  1160. static PyObject *__pyx_codeobj__31;
  1161. static PyObject *__pyx_codeobj__34;
  1162. static PyObject *__pyx_codeobj__37;
  1163. static PyObject *__pyx_codeobj__39;
  1164. static PyObject *__pyx_codeobj__41;
  1165. static PyObject *__pyx_codeobj__43;
  1166. static PyObject *__pyx_codeobj__45;
  1167. static PyObject *__pyx_codeobj__47;
  1168. static PyObject *__pyx_codeobj__49;
  1169. static PyObject *__pyx_codeobj__51;
  1170. static PyObject *__pyx_codeobj__53;
  1171. static PyObject *__pyx_codeobj__55;
  1172. static PyObject *__pyx_codeobj__57;
  1173. static PyObject *__pyx_codeobj__59;
  1174. static PyObject *__pyx_codeobj__61;
  1175. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  1176. * # def myfunction():
  1177. * #------------------------------------------------------------------------------
  1178. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  1179. * @wraps(func)
  1180. * def wrapper(*args, **kwargs):
  1181. */
  1182. /* Python wrapper */
  1183. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1184. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer = {__Pyx_NAMESTR("timer"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1185. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_1timer(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1186. PyObject *__pyx_v_func = 0;
  1187. PyObject *__pyx_v_repetitions = 0;
  1188. int __pyx_lineno = 0;
  1189. const char *__pyx_filename = NULL;
  1190. int __pyx_clineno = 0;
  1191. PyObject *__pyx_r = 0;
  1192. __Pyx_RefNannyDeclarations
  1193. __Pyx_RefNannySetupContext("timer (wrapper)", 0);
  1194. {
  1195. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  1196. PyObject* values[2] = {0,0};
  1197. values[1] = ((PyObject *)__pyx_int_100000);
  1198. if (unlikely(__pyx_kwds)) {
  1199. Py_ssize_t kw_args;
  1200. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1201. switch (pos_args) {
  1202. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1203. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1204. case 0: break;
  1205. default: goto __pyx_L5_argtuple_error;
  1206. }
  1207. kw_args = PyDict_Size(__pyx_kwds);
  1208. switch (pos_args) {
  1209. case 0:
  1210. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  1211. else goto __pyx_L5_argtuple_error;
  1212. case 1:
  1213. if (kw_args > 0) {
  1214. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  1215. if (value) { values[1] = value; kw_args--; }
  1216. }
  1217. }
  1218. if (unlikely(kw_args > 0)) {
  1219. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1220. }
  1221. } else {
  1222. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1223. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1224. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1225. break;
  1226. default: goto __pyx_L5_argtuple_error;
  1227. }
  1228. }
  1229. __pyx_v_func = values[0];
  1230. __pyx_v_repetitions = values[1];
  1231. }
  1232. goto __pyx_L4_argument_unpacking_done;
  1233. __pyx_L5_argtuple_error:;
  1234. __Pyx_RaiseArgtupleInvalid("timer", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1235. __pyx_L3_error:;
  1236. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1237. __Pyx_RefNannyFinishContext();
  1238. return NULL;
  1239. __pyx_L4_argument_unpacking_done:;
  1240. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  1241. /* function exit code */
  1242. __Pyx_RefNannyFinishContext();
  1243. return __pyx_r;
  1244. }
  1245. /* "lib/Naked/toolshed/c/benchmarking.pyx":21
  1246. * def timer(func, repetitions=100000):
  1247. * @wraps(func)
  1248. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  1249. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1250. * sys.stdout.flush()
  1251. */
  1252. /* Python wrapper */
  1253. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1254. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1255. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1256. PyObject *__pyx_v_args = 0;
  1257. PyObject *__pyx_v_kwargs = 0;
  1258. PyObject *__pyx_r = 0;
  1259. __Pyx_RefNannyDeclarations
  1260. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  1261. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  1262. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  1263. if (unlikely(!__pyx_v_kwargs)) return NULL;
  1264. __Pyx_GOTREF(__pyx_v_kwargs);
  1265. __Pyx_INCREF(__pyx_args);
  1266. __pyx_v_args = __pyx_args;
  1267. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  1268. /* function exit code */
  1269. __Pyx_XDECREF(__pyx_v_args);
  1270. __Pyx_XDECREF(__pyx_v_kwargs);
  1271. __Pyx_RefNannyFinishContext();
  1272. return __pyx_r;
  1273. }
  1274. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  1275. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope;
  1276. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_outer_scope;
  1277. PyObject *__pyx_v_start = NULL;
  1278. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  1279. PyObject *__pyx_v_result = NULL;
  1280. PyObject *__pyx_v_end = NULL;
  1281. PyObject *__pyx_r = NULL;
  1282. __Pyx_RefNannyDeclarations
  1283. PyObject *__pyx_t_1 = NULL;
  1284. PyObject *__pyx_t_2 = NULL;
  1285. PyObject *__pyx_t_3 = NULL;
  1286. PyObject *__pyx_t_4 = NULL;
  1287. Py_ssize_t __pyx_t_5;
  1288. PyObject *(*__pyx_t_6)(PyObject *);
  1289. int __pyx_lineno = 0;
  1290. const char *__pyx_filename = NULL;
  1291. int __pyx_clineno = 0;
  1292. __Pyx_RefNannySetupContext("wrapper", 0);
  1293. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *) __Pyx_CyFunction_GetClosure(__pyx_self);
  1294. __pyx_cur_scope = __pyx_outer_scope;
  1295. /* "lib/Naked/toolshed/c/benchmarking.pyx":22
  1296. * @wraps(func)
  1297. * def wrapper(*args, **kwargs):
  1298. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  1299. * sys.stdout.flush()
  1300. * print(" ")
  1301. */
  1302. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1303. __Pyx_GOTREF(__pyx_t_1);
  1304. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1305. __Pyx_GOTREF(__pyx_t_2);
  1306. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1307. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1308. __Pyx_GOTREF(__pyx_t_1);
  1309. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1310. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1311. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1312. __Pyx_GOTREF(__pyx_t_2);
  1313. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1314. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  1315. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1316. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1317. __Pyx_GOTREF(__pyx_t_3);
  1318. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1319. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1320. __Pyx_GOTREF(__pyx_t_2);
  1321. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1322. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1323. __Pyx_GOTREF(__pyx_t_3);
  1324. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1325. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1326. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1327. __Pyx_GOTREF(__pyx_t_2);
  1328. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1329. __Pyx_GOTREF(__pyx_t_4);
  1330. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1331. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1332. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1333. __Pyx_GOTREF(__pyx_t_2);
  1334. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1335. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1336. __Pyx_GOTREF(__pyx_t_4);
  1337. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  1338. __Pyx_GIVEREF(__pyx_t_2);
  1339. __pyx_t_2 = 0;
  1340. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1341. __Pyx_GOTREF(__pyx_t_2);
  1342. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1343. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1344. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1345. /* "lib/Naked/toolshed/c/benchmarking.pyx":23
  1346. * def wrapper(*args, **kwargs):
  1347. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1348. * sys.stdout.flush() # <<<<<<<<<<<<<<
  1349. * print(" ")
  1350. * # disable garbage collection
  1351. */
  1352. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1353. __Pyx_GOTREF(__pyx_t_2);
  1354. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1355. __Pyx_GOTREF(__pyx_t_4);
  1356. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1357. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1358. __Pyx_GOTREF(__pyx_t_2);
  1359. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1360. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1361. __Pyx_GOTREF(__pyx_t_4);
  1362. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1363. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1364. /* "lib/Naked/toolshed/c/benchmarking.pyx":24
  1365. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1366. * sys.stdout.flush()
  1367. * print(" ") # <<<<<<<<<<<<<<
  1368. * # disable garbage collection
  1369. * gc.collect()
  1370. */
  1371. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1372. /* "lib/Naked/toolshed/c/benchmarking.pyx":26
  1373. * print(" ")
  1374. * # disable garbage collection
  1375. * gc.collect() # <<<<<<<<<<<<<<
  1376. * gc.disable()
  1377. * start = time.time()
  1378. */
  1379. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1380. __Pyx_GOTREF(__pyx_t_4);
  1381. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1382. __Pyx_GOTREF(__pyx_t_2);
  1383. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1384. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1385. __Pyx_GOTREF(__pyx_t_4);
  1386. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1387. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1388. /* "lib/Naked/toolshed/c/benchmarking.pyx":27
  1389. * # disable garbage collection
  1390. * gc.collect()
  1391. * gc.disable() # <<<<<<<<<<<<<<
  1392. * start = time.time()
  1393. * for x in range(repetitions):
  1394. */
  1395. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1396. __Pyx_GOTREF(__pyx_t_4);
  1397. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1398. __Pyx_GOTREF(__pyx_t_2);
  1399. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1400. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1401. __Pyx_GOTREF(__pyx_t_4);
  1402. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1403. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1404. /* "lib/Naked/toolshed/c/benchmarking.pyx":28
  1405. * gc.collect()
  1406. * gc.disable()
  1407. * start = time.time() # <<<<<<<<<<<<<<
  1408. * for x in range(repetitions):
  1409. * result = func(*args, **kwargs)
  1410. */
  1411. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1412. __Pyx_GOTREF(__pyx_t_4);
  1413. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1414. __Pyx_GOTREF(__pyx_t_2);
  1415. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1416. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1417. __Pyx_GOTREF(__pyx_t_4);
  1418. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1419. __pyx_v_start = __pyx_t_4;
  1420. __pyx_t_4 = 0;
  1421. /* "lib/Naked/toolshed/c/benchmarking.pyx":29
  1422. * gc.disable()
  1423. * start = time.time()
  1424. * for x in range(repetitions): # <<<<<<<<<<<<<<
  1425. * result = func(*args, **kwargs)
  1426. * end = time.time()
  1427. */
  1428. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1429. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1430. __Pyx_GOTREF(__pyx_t_4);
  1431. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1432. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  1433. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1434. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1435. __Pyx_GOTREF(__pyx_t_2);
  1436. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1437. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  1438. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  1439. __pyx_t_6 = NULL;
  1440. } else {
  1441. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1442. __Pyx_GOTREF(__pyx_t_4);
  1443. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  1444. }
  1445. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1446. for (;;) {
  1447. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  1448. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  1449. #if CYTHON_COMPILING_IN_CPYTHON
  1450. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1451. #else
  1452. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1453. #endif
  1454. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  1455. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  1456. #if CYTHON_COMPILING_IN_CPYTHON
  1457. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1458. #else
  1459. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1460. #endif
  1461. } else {
  1462. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  1463. if (unlikely(!__pyx_t_2)) {
  1464. PyObject* exc_type = PyErr_Occurred();
  1465. if (exc_type) {
  1466. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  1467. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1468. }
  1469. break;
  1470. }
  1471. __Pyx_GOTREF(__pyx_t_2);
  1472. }
  1473. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  1474. __pyx_t_2 = 0;
  1475. /* "lib/Naked/toolshed/c/benchmarking.pyx":30
  1476. * start = time.time()
  1477. * for x in range(repetitions):
  1478. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  1479. * end = time.time()
  1480. * gc.enable() # re-enable garbage collection
  1481. */
  1482. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1483. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1484. __Pyx_GOTREF(__pyx_t_2);
  1485. __pyx_t_1 = __pyx_v_kwargs;
  1486. __Pyx_INCREF(__pyx_t_1);
  1487. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1488. __Pyx_GOTREF(__pyx_t_3);
  1489. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1490. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1491. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  1492. __pyx_t_3 = 0;
  1493. }
  1494. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1495. /* "lib/Naked/toolshed/c/benchmarking.pyx":31
  1496. * for x in range(repetitions):
  1497. * result = func(*args, **kwargs)
  1498. * end = time.time() # <<<<<<<<<<<<<<
  1499. * gc.enable() # re-enable garbage collection
  1500. * gc.collect()
  1501. */
  1502. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1503. __Pyx_GOTREF(__pyx_t_4);
  1504. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1505. __Pyx_GOTREF(__pyx_t_3);
  1506. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1507. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1508. __Pyx_GOTREF(__pyx_t_4);
  1509. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1510. __pyx_v_end = __pyx_t_4;
  1511. __pyx_t_4 = 0;
  1512. /* "lib/Naked/toolshed/c/benchmarking.pyx":32
  1513. * result = func(*args, **kwargs)
  1514. * end = time.time()
  1515. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  1516. * gc.collect()
  1517. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  1518. */
  1519. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1520. __Pyx_GOTREF(__pyx_t_4);
  1521. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1522. __Pyx_GOTREF(__pyx_t_3);
  1523. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1524. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1525. __Pyx_GOTREF(__pyx_t_4);
  1526. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1527. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1528. /* "lib/Naked/toolshed/c/benchmarking.pyx":33
  1529. * end = time.time()
  1530. * gc.enable() # re-enable garbage collection
  1531. * gc.collect() # <<<<<<<<<<<<<<
  1532. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  1533. * return result
  1534. */
  1535. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1536. __Pyx_GOTREF(__pyx_t_4);
  1537. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1538. __Pyx_GOTREF(__pyx_t_3);
  1539. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1540. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1541. __Pyx_GOTREF(__pyx_t_4);
  1542. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1543. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1544. /* "lib/Naked/toolshed/c/benchmarking.pyx":34
  1545. * gc.enable() # re-enable garbage collection
  1546. * gc.collect()
  1547. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  1548. * return result
  1549. * return wrapper
  1550. */
  1551. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1552. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1553. __Pyx_GOTREF(__pyx_t_4);
  1554. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1555. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  1556. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1557. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1558. __Pyx_GOTREF(__pyx_t_3);
  1559. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1560. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1561. __Pyx_GOTREF(__pyx_t_4);
  1562. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1563. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1564. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1565. __Pyx_GOTREF(__pyx_t_3);
  1566. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1567. __Pyx_GOTREF(__pyx_t_1);
  1568. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1569. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1570. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1571. __Pyx_GOTREF(__pyx_t_3);
  1572. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1573. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1574. __Pyx_GOTREF(__pyx_t_1);
  1575. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1576. __Pyx_GOTREF(__pyx_t_4);
  1577. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  1578. __Pyx_GIVEREF(__pyx_t_1);
  1579. __pyx_t_1 = 0;
  1580. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1581. __Pyx_GOTREF(__pyx_t_1);
  1582. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1583. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1584. __Pyx_GOTREF(__pyx_t_4);
  1585. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1586. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1587. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1588. __Pyx_GOTREF(__pyx_t_1);
  1589. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1590. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1591. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1592. /* "lib/Naked/toolshed/c/benchmarking.pyx":35
  1593. * gc.collect()
  1594. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  1595. * return result # <<<<<<<<<<<<<<
  1596. * return wrapper
  1597. *
  1598. */
  1599. __Pyx_XDECREF(__pyx_r);
  1600. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1601. __Pyx_INCREF(__pyx_v_result);
  1602. __pyx_r = __pyx_v_result;
  1603. goto __pyx_L0;
  1604. /* "lib/Naked/toolshed/c/benchmarking.pyx":21
  1605. * def timer(func, repetitions=100000):
  1606. * @wraps(func)
  1607. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  1608. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1609. * sys.stdout.flush()
  1610. */
  1611. /* function exit code */
  1612. __pyx_L1_error:;
  1613. __Pyx_XDECREF(__pyx_t_1);
  1614. __Pyx_XDECREF(__pyx_t_2);
  1615. __Pyx_XDECREF(__pyx_t_3);
  1616. __Pyx_XDECREF(__pyx_t_4);
  1617. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1618. __pyx_r = NULL;
  1619. __pyx_L0:;
  1620. __Pyx_XDECREF(__pyx_v_start);
  1621. __Pyx_XDECREF(__pyx_v_x);
  1622. __Pyx_XDECREF(__pyx_v_result);
  1623. __Pyx_XDECREF(__pyx_v_end);
  1624. __Pyx_XGIVEREF(__pyx_r);
  1625. __Pyx_RefNannyFinishContext();
  1626. return __pyx_r;
  1627. }
  1628. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  1629. * # def myfunction():
  1630. * #------------------------------------------------------------------------------
  1631. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  1632. * @wraps(func)
  1633. * def wrapper(*args, **kwargs):
  1634. */
  1635. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_timer(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  1636. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_cur_scope;
  1637. PyObject *__pyx_v_wrapper = 0;
  1638. PyObject *__pyx_r = NULL;
  1639. __Pyx_RefNannyDeclarations
  1640. PyObject *__pyx_t_1 = NULL;
  1641. PyObject *__pyx_t_2 = NULL;
  1642. PyObject *__pyx_t_3 = NULL;
  1643. int __pyx_lineno = 0;
  1644. const char *__pyx_filename = NULL;
  1645. int __pyx_clineno = 0;
  1646. __Pyx_RefNannySetupContext("timer", 0);
  1647. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, __pyx_empty_tuple, NULL);
  1648. if (unlikely(!__pyx_cur_scope)) {
  1649. __Pyx_RefNannyFinishContext();
  1650. return NULL;
  1651. }
  1652. __Pyx_GOTREF(__pyx_cur_scope);
  1653. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  1654. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  1655. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  1656. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  1657. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1658. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1659. /* "lib/Naked/toolshed/c/benchmarking.pyx":20
  1660. * #------------------------------------------------------------------------------
  1661. * def timer(func, repetitions=100000):
  1662. * @wraps(func) # <<<<<<<<<<<<<<
  1663. * def wrapper(*args, **kwargs):
  1664. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1665. */
  1666. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1667. __Pyx_GOTREF(__pyx_t_1);
  1668. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1669. __Pyx_GOTREF(__pyx_t_2);
  1670. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  1671. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  1672. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  1673. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1674. __Pyx_GOTREF(__pyx_t_3);
  1675. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1676. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1677. /* "lib/Naked/toolshed/c/benchmarking.pyx":21
  1678. * def timer(func, repetitions=100000):
  1679. * @wraps(func)
  1680. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  1681. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1682. * sys.stdout.flush()
  1683. */
  1684. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_1wrapper, 0, __pyx_n_s_timer_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1685. __Pyx_GOTREF(__pyx_t_2);
  1686. /* "lib/Naked/toolshed/c/benchmarking.pyx":20
  1687. * #------------------------------------------------------------------------------
  1688. * def timer(func, repetitions=100000):
  1689. * @wraps(func) # <<<<<<<<<<<<<<
  1690. * def wrapper(*args, **kwargs):
  1691. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1692. */
  1693. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1694. __Pyx_GOTREF(__pyx_t_1);
  1695. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  1696. __Pyx_GIVEREF(__pyx_t_2);
  1697. __pyx_t_2 = 0;
  1698. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1699. __Pyx_GOTREF(__pyx_t_2);
  1700. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1701. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1702. __pyx_v_wrapper = __pyx_t_2;
  1703. __pyx_t_2 = 0;
  1704. /* "lib/Naked/toolshed/c/benchmarking.pyx":36
  1705. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  1706. * return result
  1707. * return wrapper # <<<<<<<<<<<<<<
  1708. *
  1709. * #------------------------------------------------------------------------------
  1710. */
  1711. __Pyx_XDECREF(__pyx_r);
  1712. __Pyx_INCREF(__pyx_v_wrapper);
  1713. __pyx_r = __pyx_v_wrapper;
  1714. goto __pyx_L0;
  1715. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  1716. * # def myfunction():
  1717. * #------------------------------------------------------------------------------
  1718. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  1719. * @wraps(func)
  1720. * def wrapper(*args, **kwargs):
  1721. */
  1722. /* function exit code */
  1723. __pyx_L1_error:;
  1724. __Pyx_XDECREF(__pyx_t_1);
  1725. __Pyx_XDECREF(__pyx_t_2);
  1726. __Pyx_XDECREF(__pyx_t_3);
  1727. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1728. __pyx_r = NULL;
  1729. __pyx_L0:;
  1730. __Pyx_XDECREF(__pyx_v_wrapper);
  1731. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  1732. __Pyx_XGIVEREF(__pyx_r);
  1733. __Pyx_RefNannyFinishContext();
  1734. return __pyx_r;
  1735. }
  1736. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  1737. * #------------------------------------------------------------------------------
  1738. *
  1739. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  1740. * @wraps(func)
  1741. * def wrapper(*args, **kwargs):
  1742. */
  1743. /* Python wrapper */
  1744. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1745. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10 = {__Pyx_NAMESTR("timer_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1746. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1747. PyObject *__pyx_v_func = 0;
  1748. PyObject *__pyx_v_repetitions = 0;
  1749. int __pyx_lineno = 0;
  1750. const char *__pyx_filename = NULL;
  1751. int __pyx_clineno = 0;
  1752. PyObject *__pyx_r = 0;
  1753. __Pyx_RefNannyDeclarations
  1754. __Pyx_RefNannySetupContext("timer_10 (wrapper)", 0);
  1755. {
  1756. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  1757. PyObject* values[2] = {0,0};
  1758. values[1] = ((PyObject *)__pyx_int_10);
  1759. if (unlikely(__pyx_kwds)) {
  1760. Py_ssize_t kw_args;
  1761. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  1762. switch (pos_args) {
  1763. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1764. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1765. case 0: break;
  1766. default: goto __pyx_L5_argtuple_error;
  1767. }
  1768. kw_args = PyDict_Size(__pyx_kwds);
  1769. switch (pos_args) {
  1770. case 0:
  1771. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  1772. else goto __pyx_L5_argtuple_error;
  1773. case 1:
  1774. if (kw_args > 0) {
  1775. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  1776. if (value) { values[1] = value; kw_args--; }
  1777. }
  1778. }
  1779. if (unlikely(kw_args > 0)) {
  1780. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1781. }
  1782. } else {
  1783. switch (PyTuple_GET_SIZE(__pyx_args)) {
  1784. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  1785. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  1786. break;
  1787. default: goto __pyx_L5_argtuple_error;
  1788. }
  1789. }
  1790. __pyx_v_func = values[0];
  1791. __pyx_v_repetitions = values[1];
  1792. }
  1793. goto __pyx_L4_argument_unpacking_done;
  1794. __pyx_L5_argtuple_error:;
  1795. __Pyx_RaiseArgtupleInvalid("timer_10", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  1796. __pyx_L3_error:;
  1797. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  1798. __Pyx_RefNannyFinishContext();
  1799. return NULL;
  1800. __pyx_L4_argument_unpacking_done:;
  1801. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  1802. /* function exit code */
  1803. __Pyx_RefNannyFinishContext();
  1804. return __pyx_r;
  1805. }
  1806. /* "lib/Naked/toolshed/c/benchmarking.pyx":45
  1807. * def timer_10(func, repetitions=10):
  1808. * @wraps(func)
  1809. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  1810. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1811. * sys.stdout.flush()
  1812. */
  1813. /* Python wrapper */
  1814. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  1815. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  1816. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  1817. PyObject *__pyx_v_args = 0;
  1818. PyObject *__pyx_v_kwargs = 0;
  1819. PyObject *__pyx_r = 0;
  1820. __Pyx_RefNannyDeclarations
  1821. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  1822. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  1823. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  1824. if (unlikely(!__pyx_v_kwargs)) return NULL;
  1825. __Pyx_GOTREF(__pyx_v_kwargs);
  1826. __Pyx_INCREF(__pyx_args);
  1827. __pyx_v_args = __pyx_args;
  1828. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  1829. /* function exit code */
  1830. __Pyx_XDECREF(__pyx_v_args);
  1831. __Pyx_XDECREF(__pyx_v_kwargs);
  1832. __Pyx_RefNannyFinishContext();
  1833. return __pyx_r;
  1834. }
  1835. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  1836. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope;
  1837. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_outer_scope;
  1838. PyObject *__pyx_v_start = NULL;
  1839. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  1840. PyObject *__pyx_v_result = NULL;
  1841. PyObject *__pyx_v_end = NULL;
  1842. PyObject *__pyx_r = NULL;
  1843. __Pyx_RefNannyDeclarations
  1844. PyObject *__pyx_t_1 = NULL;
  1845. PyObject *__pyx_t_2 = NULL;
  1846. PyObject *__pyx_t_3 = NULL;
  1847. PyObject *__pyx_t_4 = NULL;
  1848. Py_ssize_t __pyx_t_5;
  1849. PyObject *(*__pyx_t_6)(PyObject *);
  1850. int __pyx_lineno = 0;
  1851. const char *__pyx_filename = NULL;
  1852. int __pyx_clineno = 0;
  1853. __Pyx_RefNannySetupContext("wrapper", 0);
  1854. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *) __Pyx_CyFunction_GetClosure(__pyx_self);
  1855. __pyx_cur_scope = __pyx_outer_scope;
  1856. /* "lib/Naked/toolshed/c/benchmarking.pyx":46
  1857. * @wraps(func)
  1858. * def wrapper(*args, **kwargs):
  1859. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  1860. * sys.stdout.flush()
  1861. * print(" ")
  1862. */
  1863. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1864. __Pyx_GOTREF(__pyx_t_1);
  1865. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1866. __Pyx_GOTREF(__pyx_t_2);
  1867. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1868. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1869. __Pyx_GOTREF(__pyx_t_1);
  1870. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1871. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1872. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1873. __Pyx_GOTREF(__pyx_t_2);
  1874. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1875. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  1876. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1877. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1878. __Pyx_GOTREF(__pyx_t_3);
  1879. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1880. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1881. __Pyx_GOTREF(__pyx_t_2);
  1882. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1883. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1884. __Pyx_GOTREF(__pyx_t_3);
  1885. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1886. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1887. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1888. __Pyx_GOTREF(__pyx_t_2);
  1889. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1890. __Pyx_GOTREF(__pyx_t_4);
  1891. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  1892. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1893. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1894. __Pyx_GOTREF(__pyx_t_2);
  1895. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1896. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1897. __Pyx_GOTREF(__pyx_t_4);
  1898. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  1899. __Pyx_GIVEREF(__pyx_t_2);
  1900. __pyx_t_2 = 0;
  1901. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1902. __Pyx_GOTREF(__pyx_t_2);
  1903. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  1904. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1905. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1906. /* "lib/Naked/toolshed/c/benchmarking.pyx":47
  1907. * def wrapper(*args, **kwargs):
  1908. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1909. * sys.stdout.flush() # <<<<<<<<<<<<<<
  1910. * print(" ")
  1911. * # disable garbage collection
  1912. */
  1913. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1914. __Pyx_GOTREF(__pyx_t_2);
  1915. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1916. __Pyx_GOTREF(__pyx_t_4);
  1917. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1918. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1919. __Pyx_GOTREF(__pyx_t_2);
  1920. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1921. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 47; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1922. __Pyx_GOTREF(__pyx_t_4);
  1923. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1924. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1925. /* "lib/Naked/toolshed/c/benchmarking.pyx":48
  1926. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  1927. * sys.stdout.flush()
  1928. * print(" ") # <<<<<<<<<<<<<<
  1929. * # disable garbage collection
  1930. * gc.collect()
  1931. */
  1932. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1933. /* "lib/Naked/toolshed/c/benchmarking.pyx":50
  1934. * print(" ")
  1935. * # disable garbage collection
  1936. * gc.collect() # <<<<<<<<<<<<<<
  1937. * gc.disable()
  1938. * start = time.time()
  1939. */
  1940. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1941. __Pyx_GOTREF(__pyx_t_4);
  1942. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1943. __Pyx_GOTREF(__pyx_t_2);
  1944. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1945. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 50; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1946. __Pyx_GOTREF(__pyx_t_4);
  1947. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1948. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1949. /* "lib/Naked/toolshed/c/benchmarking.pyx":51
  1950. * # disable garbage collection
  1951. * gc.collect()
  1952. * gc.disable() # <<<<<<<<<<<<<<
  1953. * start = time.time()
  1954. * for x in range(repetitions):
  1955. */
  1956. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1957. __Pyx_GOTREF(__pyx_t_4);
  1958. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1959. __Pyx_GOTREF(__pyx_t_2);
  1960. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1961. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1962. __Pyx_GOTREF(__pyx_t_4);
  1963. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1964. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1965. /* "lib/Naked/toolshed/c/benchmarking.pyx":52
  1966. * gc.collect()
  1967. * gc.disable()
  1968. * start = time.time() # <<<<<<<<<<<<<<
  1969. * for x in range(repetitions):
  1970. * result = func(*args, **kwargs)
  1971. */
  1972. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1973. __Pyx_GOTREF(__pyx_t_4);
  1974. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1975. __Pyx_GOTREF(__pyx_t_2);
  1976. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1977. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1978. __Pyx_GOTREF(__pyx_t_4);
  1979. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  1980. __pyx_v_start = __pyx_t_4;
  1981. __pyx_t_4 = 0;
  1982. /* "lib/Naked/toolshed/c/benchmarking.pyx":53
  1983. * gc.disable()
  1984. * start = time.time()
  1985. * for x in range(repetitions): # <<<<<<<<<<<<<<
  1986. * result = func(*args, **kwargs)
  1987. * end = time.time()
  1988. */
  1989. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  1990. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1991. __Pyx_GOTREF(__pyx_t_4);
  1992. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  1993. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  1994. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  1995. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  1996. __Pyx_GOTREF(__pyx_t_2);
  1997. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  1998. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  1999. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  2000. __pyx_t_6 = NULL;
  2001. } else {
  2002. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2003. __Pyx_GOTREF(__pyx_t_4);
  2004. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  2005. }
  2006. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2007. for (;;) {
  2008. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  2009. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  2010. #if CYTHON_COMPILING_IN_CPYTHON
  2011. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2012. #else
  2013. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2014. #endif
  2015. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  2016. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  2017. #if CYTHON_COMPILING_IN_CPYTHON
  2018. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2019. #else
  2020. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2021. #endif
  2022. } else {
  2023. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  2024. if (unlikely(!__pyx_t_2)) {
  2025. PyObject* exc_type = PyErr_Occurred();
  2026. if (exc_type) {
  2027. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  2028. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2029. }
  2030. break;
  2031. }
  2032. __Pyx_GOTREF(__pyx_t_2);
  2033. }
  2034. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  2035. __pyx_t_2 = 0;
  2036. /* "lib/Naked/toolshed/c/benchmarking.pyx":54
  2037. * start = time.time()
  2038. * for x in range(repetitions):
  2039. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  2040. * end = time.time()
  2041. * gc.enable() # re-enable garbage collection
  2042. */
  2043. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2044. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2045. __Pyx_GOTREF(__pyx_t_2);
  2046. __pyx_t_1 = __pyx_v_kwargs;
  2047. __Pyx_INCREF(__pyx_t_1);
  2048. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2049. __Pyx_GOTREF(__pyx_t_3);
  2050. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2051. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2052. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  2053. __pyx_t_3 = 0;
  2054. }
  2055. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2056. /* "lib/Naked/toolshed/c/benchmarking.pyx":55
  2057. * for x in range(repetitions):
  2058. * result = func(*args, **kwargs)
  2059. * end = time.time() # <<<<<<<<<<<<<<
  2060. * gc.enable() # re-enable garbage collection
  2061. * gc.collect()
  2062. */
  2063. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2064. __Pyx_GOTREF(__pyx_t_4);
  2065. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2066. __Pyx_GOTREF(__pyx_t_3);
  2067. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2068. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2069. __Pyx_GOTREF(__pyx_t_4);
  2070. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2071. __pyx_v_end = __pyx_t_4;
  2072. __pyx_t_4 = 0;
  2073. /* "lib/Naked/toolshed/c/benchmarking.pyx":56
  2074. * result = func(*args, **kwargs)
  2075. * end = time.time()
  2076. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  2077. * gc.collect()
  2078. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2079. */
  2080. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2081. __Pyx_GOTREF(__pyx_t_4);
  2082. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2083. __Pyx_GOTREF(__pyx_t_3);
  2084. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2085. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2086. __Pyx_GOTREF(__pyx_t_4);
  2087. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2088. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2089. /* "lib/Naked/toolshed/c/benchmarking.pyx":57
  2090. * end = time.time()
  2091. * gc.enable() # re-enable garbage collection
  2092. * gc.collect() # <<<<<<<<<<<<<<
  2093. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2094. * return result
  2095. */
  2096. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2097. __Pyx_GOTREF(__pyx_t_4);
  2098. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2099. __Pyx_GOTREF(__pyx_t_3);
  2100. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2101. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2102. __Pyx_GOTREF(__pyx_t_4);
  2103. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2104. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2105. /* "lib/Naked/toolshed/c/benchmarking.pyx":58
  2106. * gc.enable() # re-enable garbage collection
  2107. * gc.collect()
  2108. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  2109. * return result
  2110. * return wrapper
  2111. */
  2112. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2113. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2114. __Pyx_GOTREF(__pyx_t_4);
  2115. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2116. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  2117. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2118. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2119. __Pyx_GOTREF(__pyx_t_3);
  2120. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2121. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2122. __Pyx_GOTREF(__pyx_t_4);
  2123. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2124. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2125. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2126. __Pyx_GOTREF(__pyx_t_3);
  2127. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2128. __Pyx_GOTREF(__pyx_t_1);
  2129. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2130. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2131. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2132. __Pyx_GOTREF(__pyx_t_3);
  2133. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2134. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2135. __Pyx_GOTREF(__pyx_t_1);
  2136. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2137. __Pyx_GOTREF(__pyx_t_4);
  2138. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2139. __Pyx_GIVEREF(__pyx_t_1);
  2140. __pyx_t_1 = 0;
  2141. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2142. __Pyx_GOTREF(__pyx_t_1);
  2143. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2144. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2145. __Pyx_GOTREF(__pyx_t_4);
  2146. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2147. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2148. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2149. __Pyx_GOTREF(__pyx_t_1);
  2150. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2151. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2152. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2153. /* "lib/Naked/toolshed/c/benchmarking.pyx":59
  2154. * gc.collect()
  2155. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2156. * return result # <<<<<<<<<<<<<<
  2157. * return wrapper
  2158. *
  2159. */
  2160. __Pyx_XDECREF(__pyx_r);
  2161. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2162. __Pyx_INCREF(__pyx_v_result);
  2163. __pyx_r = __pyx_v_result;
  2164. goto __pyx_L0;
  2165. /* "lib/Naked/toolshed/c/benchmarking.pyx":45
  2166. * def timer_10(func, repetitions=10):
  2167. * @wraps(func)
  2168. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2169. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2170. * sys.stdout.flush()
  2171. */
  2172. /* function exit code */
  2173. __pyx_L1_error:;
  2174. __Pyx_XDECREF(__pyx_t_1);
  2175. __Pyx_XDECREF(__pyx_t_2);
  2176. __Pyx_XDECREF(__pyx_t_3);
  2177. __Pyx_XDECREF(__pyx_t_4);
  2178. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2179. __pyx_r = NULL;
  2180. __pyx_L0:;
  2181. __Pyx_XDECREF(__pyx_v_start);
  2182. __Pyx_XDECREF(__pyx_v_x);
  2183. __Pyx_XDECREF(__pyx_v_result);
  2184. __Pyx_XDECREF(__pyx_v_end);
  2185. __Pyx_XGIVEREF(__pyx_r);
  2186. __Pyx_RefNannyFinishContext();
  2187. return __pyx_r;
  2188. }
  2189. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  2190. * #------------------------------------------------------------------------------
  2191. *
  2192. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  2193. * @wraps(func)
  2194. * def wrapper(*args, **kwargs):
  2195. */
  2196. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_2timer_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  2197. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_cur_scope;
  2198. PyObject *__pyx_v_wrapper = 0;
  2199. PyObject *__pyx_r = NULL;
  2200. __Pyx_RefNannyDeclarations
  2201. PyObject *__pyx_t_1 = NULL;
  2202. PyObject *__pyx_t_2 = NULL;
  2203. PyObject *__pyx_t_3 = NULL;
  2204. int __pyx_lineno = 0;
  2205. const char *__pyx_filename = NULL;
  2206. int __pyx_clineno = 0;
  2207. __Pyx_RefNannySetupContext("timer_10", 0);
  2208. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, __pyx_empty_tuple, NULL);
  2209. if (unlikely(!__pyx_cur_scope)) {
  2210. __Pyx_RefNannyFinishContext();
  2211. return NULL;
  2212. }
  2213. __Pyx_GOTREF(__pyx_cur_scope);
  2214. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  2215. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2216. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2217. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  2218. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2219. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2220. /* "lib/Naked/toolshed/c/benchmarking.pyx":44
  2221. *
  2222. * def timer_10(func, repetitions=10):
  2223. * @wraps(func) # <<<<<<<<<<<<<<
  2224. * def wrapper(*args, **kwargs):
  2225. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2226. */
  2227. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2228. __Pyx_GOTREF(__pyx_t_1);
  2229. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2230. __Pyx_GOTREF(__pyx_t_2);
  2231. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2232. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  2233. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2234. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2235. __Pyx_GOTREF(__pyx_t_3);
  2236. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2237. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2238. /* "lib/Naked/toolshed/c/benchmarking.pyx":45
  2239. * def timer_10(func, repetitions=10):
  2240. * @wraps(func)
  2241. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2242. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2243. * sys.stdout.flush()
  2244. */
  2245. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10_1wrapper, 0, __pyx_n_s_timer_10_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2246. __Pyx_GOTREF(__pyx_t_2);
  2247. /* "lib/Naked/toolshed/c/benchmarking.pyx":44
  2248. *
  2249. * def timer_10(func, repetitions=10):
  2250. * @wraps(func) # <<<<<<<<<<<<<<
  2251. * def wrapper(*args, **kwargs):
  2252. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2253. */
  2254. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2255. __Pyx_GOTREF(__pyx_t_1);
  2256. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  2257. __Pyx_GIVEREF(__pyx_t_2);
  2258. __pyx_t_2 = 0;
  2259. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2260. __Pyx_GOTREF(__pyx_t_2);
  2261. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2262. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2263. __pyx_v_wrapper = __pyx_t_2;
  2264. __pyx_t_2 = 0;
  2265. /* "lib/Naked/toolshed/c/benchmarking.pyx":60
  2266. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2267. * return result
  2268. * return wrapper # <<<<<<<<<<<<<<
  2269. *
  2270. * def timer_100(func, repetitions=100):
  2271. */
  2272. __Pyx_XDECREF(__pyx_r);
  2273. __Pyx_INCREF(__pyx_v_wrapper);
  2274. __pyx_r = __pyx_v_wrapper;
  2275. goto __pyx_L0;
  2276. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  2277. * #------------------------------------------------------------------------------
  2278. *
  2279. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  2280. * @wraps(func)
  2281. * def wrapper(*args, **kwargs):
  2282. */
  2283. /* function exit code */
  2284. __pyx_L1_error:;
  2285. __Pyx_XDECREF(__pyx_t_1);
  2286. __Pyx_XDECREF(__pyx_t_2);
  2287. __Pyx_XDECREF(__pyx_t_3);
  2288. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2289. __pyx_r = NULL;
  2290. __pyx_L0:;
  2291. __Pyx_XDECREF(__pyx_v_wrapper);
  2292. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  2293. __Pyx_XGIVEREF(__pyx_r);
  2294. __Pyx_RefNannyFinishContext();
  2295. return __pyx_r;
  2296. }
  2297. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  2298. * return wrapper
  2299. *
  2300. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  2301. * @wraps(func)
  2302. * def wrapper(*args, **kwargs):
  2303. */
  2304. /* Python wrapper */
  2305. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2306. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100 = {__Pyx_NAMESTR("timer_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2307. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2308. PyObject *__pyx_v_func = 0;
  2309. PyObject *__pyx_v_repetitions = 0;
  2310. int __pyx_lineno = 0;
  2311. const char *__pyx_filename = NULL;
  2312. int __pyx_clineno = 0;
  2313. PyObject *__pyx_r = 0;
  2314. __Pyx_RefNannyDeclarations
  2315. __Pyx_RefNannySetupContext("timer_100 (wrapper)", 0);
  2316. {
  2317. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  2318. PyObject* values[2] = {0,0};
  2319. values[1] = ((PyObject *)__pyx_int_100);
  2320. if (unlikely(__pyx_kwds)) {
  2321. Py_ssize_t kw_args;
  2322. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2323. switch (pos_args) {
  2324. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2325. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2326. case 0: break;
  2327. default: goto __pyx_L5_argtuple_error;
  2328. }
  2329. kw_args = PyDict_Size(__pyx_kwds);
  2330. switch (pos_args) {
  2331. case 0:
  2332. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  2333. else goto __pyx_L5_argtuple_error;
  2334. case 1:
  2335. if (kw_args > 0) {
  2336. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  2337. if (value) { values[1] = value; kw_args--; }
  2338. }
  2339. }
  2340. if (unlikely(kw_args > 0)) {
  2341. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2342. }
  2343. } else {
  2344. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2345. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2346. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2347. break;
  2348. default: goto __pyx_L5_argtuple_error;
  2349. }
  2350. }
  2351. __pyx_v_func = values[0];
  2352. __pyx_v_repetitions = values[1];
  2353. }
  2354. goto __pyx_L4_argument_unpacking_done;
  2355. __pyx_L5_argtuple_error:;
  2356. __Pyx_RaiseArgtupleInvalid("timer_100", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2357. __pyx_L3_error:;
  2358. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2359. __Pyx_RefNannyFinishContext();
  2360. return NULL;
  2361. __pyx_L4_argument_unpacking_done:;
  2362. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  2363. /* function exit code */
  2364. __Pyx_RefNannyFinishContext();
  2365. return __pyx_r;
  2366. }
  2367. /* "lib/Naked/toolshed/c/benchmarking.pyx":64
  2368. * def timer_100(func, repetitions=100):
  2369. * @wraps(func)
  2370. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2371. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2372. * sys.stdout.flush()
  2373. */
  2374. /* Python wrapper */
  2375. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2376. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2377. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2378. PyObject *__pyx_v_args = 0;
  2379. PyObject *__pyx_v_kwargs = 0;
  2380. PyObject *__pyx_r = 0;
  2381. __Pyx_RefNannyDeclarations
  2382. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  2383. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  2384. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  2385. if (unlikely(!__pyx_v_kwargs)) return NULL;
  2386. __Pyx_GOTREF(__pyx_v_kwargs);
  2387. __Pyx_INCREF(__pyx_args);
  2388. __pyx_v_args = __pyx_args;
  2389. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  2390. /* function exit code */
  2391. __Pyx_XDECREF(__pyx_v_args);
  2392. __Pyx_XDECREF(__pyx_v_kwargs);
  2393. __Pyx_RefNannyFinishContext();
  2394. return __pyx_r;
  2395. }
  2396. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  2397. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope;
  2398. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_outer_scope;
  2399. PyObject *__pyx_v_start = NULL;
  2400. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  2401. PyObject *__pyx_v_result = NULL;
  2402. PyObject *__pyx_v_end = NULL;
  2403. PyObject *__pyx_r = NULL;
  2404. __Pyx_RefNannyDeclarations
  2405. PyObject *__pyx_t_1 = NULL;
  2406. PyObject *__pyx_t_2 = NULL;
  2407. PyObject *__pyx_t_3 = NULL;
  2408. PyObject *__pyx_t_4 = NULL;
  2409. Py_ssize_t __pyx_t_5;
  2410. PyObject *(*__pyx_t_6)(PyObject *);
  2411. int __pyx_lineno = 0;
  2412. const char *__pyx_filename = NULL;
  2413. int __pyx_clineno = 0;
  2414. __Pyx_RefNannySetupContext("wrapper", 0);
  2415. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *) __Pyx_CyFunction_GetClosure(__pyx_self);
  2416. __pyx_cur_scope = __pyx_outer_scope;
  2417. /* "lib/Naked/toolshed/c/benchmarking.pyx":65
  2418. * @wraps(func)
  2419. * def wrapper(*args, **kwargs):
  2420. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  2421. * sys.stdout.flush()
  2422. * print(" ")
  2423. */
  2424. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2425. __Pyx_GOTREF(__pyx_t_1);
  2426. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2427. __Pyx_GOTREF(__pyx_t_2);
  2428. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2429. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2430. __Pyx_GOTREF(__pyx_t_1);
  2431. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2432. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2433. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2434. __Pyx_GOTREF(__pyx_t_2);
  2435. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2436. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  2437. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2438. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2439. __Pyx_GOTREF(__pyx_t_3);
  2440. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2441. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2442. __Pyx_GOTREF(__pyx_t_2);
  2443. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2444. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2445. __Pyx_GOTREF(__pyx_t_3);
  2446. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2447. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2448. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2449. __Pyx_GOTREF(__pyx_t_2);
  2450. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2451. __Pyx_GOTREF(__pyx_t_4);
  2452. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2453. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2454. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2455. __Pyx_GOTREF(__pyx_t_2);
  2456. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2457. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2458. __Pyx_GOTREF(__pyx_t_4);
  2459. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  2460. __Pyx_GIVEREF(__pyx_t_2);
  2461. __pyx_t_2 = 0;
  2462. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2463. __Pyx_GOTREF(__pyx_t_2);
  2464. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2465. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2466. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2467. /* "lib/Naked/toolshed/c/benchmarking.pyx":66
  2468. * def wrapper(*args, **kwargs):
  2469. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2470. * sys.stdout.flush() # <<<<<<<<<<<<<<
  2471. * print(" ")
  2472. * # disable garbage collection
  2473. */
  2474. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2475. __Pyx_GOTREF(__pyx_t_2);
  2476. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2477. __Pyx_GOTREF(__pyx_t_4);
  2478. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2479. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2480. __Pyx_GOTREF(__pyx_t_2);
  2481. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2482. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2483. __Pyx_GOTREF(__pyx_t_4);
  2484. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2485. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2486. /* "lib/Naked/toolshed/c/benchmarking.pyx":67
  2487. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2488. * sys.stdout.flush()
  2489. * print(" ") # <<<<<<<<<<<<<<
  2490. * # disable garbage collection
  2491. * gc.collect()
  2492. */
  2493. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2494. /* "lib/Naked/toolshed/c/benchmarking.pyx":69
  2495. * print(" ")
  2496. * # disable garbage collection
  2497. * gc.collect() # <<<<<<<<<<<<<<
  2498. * gc.disable()
  2499. * start = time.time()
  2500. */
  2501. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2502. __Pyx_GOTREF(__pyx_t_4);
  2503. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2504. __Pyx_GOTREF(__pyx_t_2);
  2505. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2506. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2507. __Pyx_GOTREF(__pyx_t_4);
  2508. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2509. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2510. /* "lib/Naked/toolshed/c/benchmarking.pyx":70
  2511. * # disable garbage collection
  2512. * gc.collect()
  2513. * gc.disable() # <<<<<<<<<<<<<<
  2514. * start = time.time()
  2515. * for x in range(repetitions):
  2516. */
  2517. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2518. __Pyx_GOTREF(__pyx_t_4);
  2519. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2520. __Pyx_GOTREF(__pyx_t_2);
  2521. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2522. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2523. __Pyx_GOTREF(__pyx_t_4);
  2524. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2525. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2526. /* "lib/Naked/toolshed/c/benchmarking.pyx":71
  2527. * gc.collect()
  2528. * gc.disable()
  2529. * start = time.time() # <<<<<<<<<<<<<<
  2530. * for x in range(repetitions):
  2531. * result = func(*args, **kwargs)
  2532. */
  2533. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2534. __Pyx_GOTREF(__pyx_t_4);
  2535. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2536. __Pyx_GOTREF(__pyx_t_2);
  2537. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2538. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2539. __Pyx_GOTREF(__pyx_t_4);
  2540. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2541. __pyx_v_start = __pyx_t_4;
  2542. __pyx_t_4 = 0;
  2543. /* "lib/Naked/toolshed/c/benchmarking.pyx":72
  2544. * gc.disable()
  2545. * start = time.time()
  2546. * for x in range(repetitions): # <<<<<<<<<<<<<<
  2547. * result = func(*args, **kwargs)
  2548. * end = time.time()
  2549. */
  2550. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2551. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2552. __Pyx_GOTREF(__pyx_t_4);
  2553. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2554. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  2555. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2556. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2557. __Pyx_GOTREF(__pyx_t_2);
  2558. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2559. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  2560. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  2561. __pyx_t_6 = NULL;
  2562. } else {
  2563. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2564. __Pyx_GOTREF(__pyx_t_4);
  2565. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  2566. }
  2567. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2568. for (;;) {
  2569. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  2570. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  2571. #if CYTHON_COMPILING_IN_CPYTHON
  2572. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2573. #else
  2574. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2575. #endif
  2576. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  2577. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  2578. #if CYTHON_COMPILING_IN_CPYTHON
  2579. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2580. #else
  2581. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2582. #endif
  2583. } else {
  2584. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  2585. if (unlikely(!__pyx_t_2)) {
  2586. PyObject* exc_type = PyErr_Occurred();
  2587. if (exc_type) {
  2588. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  2589. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2590. }
  2591. break;
  2592. }
  2593. __Pyx_GOTREF(__pyx_t_2);
  2594. }
  2595. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  2596. __pyx_t_2 = 0;
  2597. /* "lib/Naked/toolshed/c/benchmarking.pyx":73
  2598. * start = time.time()
  2599. * for x in range(repetitions):
  2600. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  2601. * end = time.time()
  2602. * gc.enable() # re-enable garbage collection
  2603. */
  2604. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2605. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2606. __Pyx_GOTREF(__pyx_t_2);
  2607. __pyx_t_1 = __pyx_v_kwargs;
  2608. __Pyx_INCREF(__pyx_t_1);
  2609. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2610. __Pyx_GOTREF(__pyx_t_3);
  2611. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2612. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2613. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  2614. __pyx_t_3 = 0;
  2615. }
  2616. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2617. /* "lib/Naked/toolshed/c/benchmarking.pyx":74
  2618. * for x in range(repetitions):
  2619. * result = func(*args, **kwargs)
  2620. * end = time.time() # <<<<<<<<<<<<<<
  2621. * gc.enable() # re-enable garbage collection
  2622. * gc.collect()
  2623. */
  2624. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2625. __Pyx_GOTREF(__pyx_t_4);
  2626. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2627. __Pyx_GOTREF(__pyx_t_3);
  2628. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2629. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2630. __Pyx_GOTREF(__pyx_t_4);
  2631. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2632. __pyx_v_end = __pyx_t_4;
  2633. __pyx_t_4 = 0;
  2634. /* "lib/Naked/toolshed/c/benchmarking.pyx":75
  2635. * result = func(*args, **kwargs)
  2636. * end = time.time()
  2637. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  2638. * gc.collect()
  2639. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2640. */
  2641. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2642. __Pyx_GOTREF(__pyx_t_4);
  2643. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2644. __Pyx_GOTREF(__pyx_t_3);
  2645. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2646. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2647. __Pyx_GOTREF(__pyx_t_4);
  2648. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2649. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2650. /* "lib/Naked/toolshed/c/benchmarking.pyx":76
  2651. * end = time.time()
  2652. * gc.enable() # re-enable garbage collection
  2653. * gc.collect() # <<<<<<<<<<<<<<
  2654. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2655. * return result
  2656. */
  2657. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2658. __Pyx_GOTREF(__pyx_t_4);
  2659. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2660. __Pyx_GOTREF(__pyx_t_3);
  2661. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2662. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2663. __Pyx_GOTREF(__pyx_t_4);
  2664. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2665. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2666. /* "lib/Naked/toolshed/c/benchmarking.pyx":77
  2667. * gc.enable() # re-enable garbage collection
  2668. * gc.collect()
  2669. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  2670. * return result
  2671. * return wrapper
  2672. */
  2673. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2674. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2675. __Pyx_GOTREF(__pyx_t_4);
  2676. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2677. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  2678. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2679. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2680. __Pyx_GOTREF(__pyx_t_3);
  2681. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2682. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2683. __Pyx_GOTREF(__pyx_t_4);
  2684. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2685. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2686. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2687. __Pyx_GOTREF(__pyx_t_3);
  2688. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2689. __Pyx_GOTREF(__pyx_t_1);
  2690. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2691. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2692. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2693. __Pyx_GOTREF(__pyx_t_3);
  2694. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2695. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2696. __Pyx_GOTREF(__pyx_t_1);
  2697. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2698. __Pyx_GOTREF(__pyx_t_4);
  2699. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  2700. __Pyx_GIVEREF(__pyx_t_1);
  2701. __pyx_t_1 = 0;
  2702. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2703. __Pyx_GOTREF(__pyx_t_1);
  2704. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2705. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2706. __Pyx_GOTREF(__pyx_t_4);
  2707. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2708. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2709. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2710. __Pyx_GOTREF(__pyx_t_1);
  2711. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2712. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2713. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2714. /* "lib/Naked/toolshed/c/benchmarking.pyx":78
  2715. * gc.collect()
  2716. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2717. * return result # <<<<<<<<<<<<<<
  2718. * return wrapper
  2719. *
  2720. */
  2721. __Pyx_XDECREF(__pyx_r);
  2722. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2723. __Pyx_INCREF(__pyx_v_result);
  2724. __pyx_r = __pyx_v_result;
  2725. goto __pyx_L0;
  2726. /* "lib/Naked/toolshed/c/benchmarking.pyx":64
  2727. * def timer_100(func, repetitions=100):
  2728. * @wraps(func)
  2729. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2730. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2731. * sys.stdout.flush()
  2732. */
  2733. /* function exit code */
  2734. __pyx_L1_error:;
  2735. __Pyx_XDECREF(__pyx_t_1);
  2736. __Pyx_XDECREF(__pyx_t_2);
  2737. __Pyx_XDECREF(__pyx_t_3);
  2738. __Pyx_XDECREF(__pyx_t_4);
  2739. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2740. __pyx_r = NULL;
  2741. __pyx_L0:;
  2742. __Pyx_XDECREF(__pyx_v_start);
  2743. __Pyx_XDECREF(__pyx_v_x);
  2744. __Pyx_XDECREF(__pyx_v_result);
  2745. __Pyx_XDECREF(__pyx_v_end);
  2746. __Pyx_XGIVEREF(__pyx_r);
  2747. __Pyx_RefNannyFinishContext();
  2748. return __pyx_r;
  2749. }
  2750. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  2751. * return wrapper
  2752. *
  2753. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  2754. * @wraps(func)
  2755. * def wrapper(*args, **kwargs):
  2756. */
  2757. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_4timer_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  2758. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_cur_scope;
  2759. PyObject *__pyx_v_wrapper = 0;
  2760. PyObject *__pyx_r = NULL;
  2761. __Pyx_RefNannyDeclarations
  2762. PyObject *__pyx_t_1 = NULL;
  2763. PyObject *__pyx_t_2 = NULL;
  2764. PyObject *__pyx_t_3 = NULL;
  2765. int __pyx_lineno = 0;
  2766. const char *__pyx_filename = NULL;
  2767. int __pyx_clineno = 0;
  2768. __Pyx_RefNannySetupContext("timer_100", 0);
  2769. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, __pyx_empty_tuple, NULL);
  2770. if (unlikely(!__pyx_cur_scope)) {
  2771. __Pyx_RefNannyFinishContext();
  2772. return NULL;
  2773. }
  2774. __Pyx_GOTREF(__pyx_cur_scope);
  2775. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  2776. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2777. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2778. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  2779. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2780. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2781. /* "lib/Naked/toolshed/c/benchmarking.pyx":63
  2782. *
  2783. * def timer_100(func, repetitions=100):
  2784. * @wraps(func) # <<<<<<<<<<<<<<
  2785. * def wrapper(*args, **kwargs):
  2786. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2787. */
  2788. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2789. __Pyx_GOTREF(__pyx_t_1);
  2790. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2791. __Pyx_GOTREF(__pyx_t_2);
  2792. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  2793. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  2794. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  2795. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2796. __Pyx_GOTREF(__pyx_t_3);
  2797. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2798. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2799. /* "lib/Naked/toolshed/c/benchmarking.pyx":64
  2800. * def timer_100(func, repetitions=100):
  2801. * @wraps(func)
  2802. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2803. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2804. * sys.stdout.flush()
  2805. */
  2806. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_100_1wrapper, 0, __pyx_n_s_timer_100_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2807. __Pyx_GOTREF(__pyx_t_2);
  2808. /* "lib/Naked/toolshed/c/benchmarking.pyx":63
  2809. *
  2810. * def timer_100(func, repetitions=100):
  2811. * @wraps(func) # <<<<<<<<<<<<<<
  2812. * def wrapper(*args, **kwargs):
  2813. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2814. */
  2815. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2816. __Pyx_GOTREF(__pyx_t_1);
  2817. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  2818. __Pyx_GIVEREF(__pyx_t_2);
  2819. __pyx_t_2 = 0;
  2820. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2821. __Pyx_GOTREF(__pyx_t_2);
  2822. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2823. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2824. __pyx_v_wrapper = __pyx_t_2;
  2825. __pyx_t_2 = 0;
  2826. /* "lib/Naked/toolshed/c/benchmarking.pyx":79
  2827. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  2828. * return result
  2829. * return wrapper # <<<<<<<<<<<<<<
  2830. *
  2831. * def timer_1k(func, repetitions=1000):
  2832. */
  2833. __Pyx_XDECREF(__pyx_r);
  2834. __Pyx_INCREF(__pyx_v_wrapper);
  2835. __pyx_r = __pyx_v_wrapper;
  2836. goto __pyx_L0;
  2837. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  2838. * return wrapper
  2839. *
  2840. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  2841. * @wraps(func)
  2842. * def wrapper(*args, **kwargs):
  2843. */
  2844. /* function exit code */
  2845. __pyx_L1_error:;
  2846. __Pyx_XDECREF(__pyx_t_1);
  2847. __Pyx_XDECREF(__pyx_t_2);
  2848. __Pyx_XDECREF(__pyx_t_3);
  2849. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_100", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2850. __pyx_r = NULL;
  2851. __pyx_L0:;
  2852. __Pyx_XDECREF(__pyx_v_wrapper);
  2853. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  2854. __Pyx_XGIVEREF(__pyx_r);
  2855. __Pyx_RefNannyFinishContext();
  2856. return __pyx_r;
  2857. }
  2858. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  2859. * return wrapper
  2860. *
  2861. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  2862. * @wraps(func)
  2863. * def wrapper(*args, **kwargs):
  2864. */
  2865. /* Python wrapper */
  2866. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2867. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k = {__Pyx_NAMESTR("timer_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2868. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2869. PyObject *__pyx_v_func = 0;
  2870. PyObject *__pyx_v_repetitions = 0;
  2871. int __pyx_lineno = 0;
  2872. const char *__pyx_filename = NULL;
  2873. int __pyx_clineno = 0;
  2874. PyObject *__pyx_r = 0;
  2875. __Pyx_RefNannyDeclarations
  2876. __Pyx_RefNannySetupContext("timer_1k (wrapper)", 0);
  2877. {
  2878. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  2879. PyObject* values[2] = {0,0};
  2880. values[1] = ((PyObject *)__pyx_int_1000);
  2881. if (unlikely(__pyx_kwds)) {
  2882. Py_ssize_t kw_args;
  2883. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  2884. switch (pos_args) {
  2885. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2886. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2887. case 0: break;
  2888. default: goto __pyx_L5_argtuple_error;
  2889. }
  2890. kw_args = PyDict_Size(__pyx_kwds);
  2891. switch (pos_args) {
  2892. case 0:
  2893. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  2894. else goto __pyx_L5_argtuple_error;
  2895. case 1:
  2896. if (kw_args > 0) {
  2897. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  2898. if (value) { values[1] = value; kw_args--; }
  2899. }
  2900. }
  2901. if (unlikely(kw_args > 0)) {
  2902. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2903. }
  2904. } else {
  2905. switch (PyTuple_GET_SIZE(__pyx_args)) {
  2906. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  2907. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  2908. break;
  2909. default: goto __pyx_L5_argtuple_error;
  2910. }
  2911. }
  2912. __pyx_v_func = values[0];
  2913. __pyx_v_repetitions = values[1];
  2914. }
  2915. goto __pyx_L4_argument_unpacking_done;
  2916. __pyx_L5_argtuple_error:;
  2917. __Pyx_RaiseArgtupleInvalid("timer_1k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  2918. __pyx_L3_error:;
  2919. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2920. __Pyx_RefNannyFinishContext();
  2921. return NULL;
  2922. __pyx_L4_argument_unpacking_done:;
  2923. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  2924. /* function exit code */
  2925. __Pyx_RefNannyFinishContext();
  2926. return __pyx_r;
  2927. }
  2928. /* "lib/Naked/toolshed/c/benchmarking.pyx":83
  2929. * def timer_1k(func, repetitions=1000):
  2930. * @wraps(func)
  2931. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  2932. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  2933. * sys.stdout.flush()
  2934. */
  2935. /* Python wrapper */
  2936. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2937. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  2938. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2939. PyObject *__pyx_v_args = 0;
  2940. PyObject *__pyx_v_kwargs = 0;
  2941. PyObject *__pyx_r = 0;
  2942. __Pyx_RefNannyDeclarations
  2943. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  2944. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  2945. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  2946. if (unlikely(!__pyx_v_kwargs)) return NULL;
  2947. __Pyx_GOTREF(__pyx_v_kwargs);
  2948. __Pyx_INCREF(__pyx_args);
  2949. __pyx_v_args = __pyx_args;
  2950. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  2951. /* function exit code */
  2952. __Pyx_XDECREF(__pyx_v_args);
  2953. __Pyx_XDECREF(__pyx_v_kwargs);
  2954. __Pyx_RefNannyFinishContext();
  2955. return __pyx_r;
  2956. }
  2957. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  2958. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope;
  2959. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_outer_scope;
  2960. PyObject *__pyx_v_start = NULL;
  2961. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  2962. PyObject *__pyx_v_result = NULL;
  2963. PyObject *__pyx_v_end = NULL;
  2964. PyObject *__pyx_r = NULL;
  2965. __Pyx_RefNannyDeclarations
  2966. PyObject *__pyx_t_1 = NULL;
  2967. PyObject *__pyx_t_2 = NULL;
  2968. PyObject *__pyx_t_3 = NULL;
  2969. PyObject *__pyx_t_4 = NULL;
  2970. Py_ssize_t __pyx_t_5;
  2971. PyObject *(*__pyx_t_6)(PyObject *);
  2972. int __pyx_lineno = 0;
  2973. const char *__pyx_filename = NULL;
  2974. int __pyx_clineno = 0;
  2975. __Pyx_RefNannySetupContext("wrapper", 0);
  2976. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *) __Pyx_CyFunction_GetClosure(__pyx_self);
  2977. __pyx_cur_scope = __pyx_outer_scope;
  2978. /* "lib/Naked/toolshed/c/benchmarking.pyx":84
  2979. * @wraps(func)
  2980. * def wrapper(*args, **kwargs):
  2981. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  2982. * sys.stdout.flush()
  2983. * print(" ")
  2984. */
  2985. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2986. __Pyx_GOTREF(__pyx_t_1);
  2987. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2988. __Pyx_GOTREF(__pyx_t_2);
  2989. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2990. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2991. __Pyx_GOTREF(__pyx_t_1);
  2992. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  2993. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  2994. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  2995. __Pyx_GOTREF(__pyx_t_2);
  2996. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  2997. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  2998. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  2999. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3000. __Pyx_GOTREF(__pyx_t_3);
  3001. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3002. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3003. __Pyx_GOTREF(__pyx_t_2);
  3004. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3005. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3006. __Pyx_GOTREF(__pyx_t_3);
  3007. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3008. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3009. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3010. __Pyx_GOTREF(__pyx_t_2);
  3011. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3012. __Pyx_GOTREF(__pyx_t_4);
  3013. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3014. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3015. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3016. __Pyx_GOTREF(__pyx_t_2);
  3017. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3018. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3019. __Pyx_GOTREF(__pyx_t_4);
  3020. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  3021. __Pyx_GIVEREF(__pyx_t_2);
  3022. __pyx_t_2 = 0;
  3023. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3024. __Pyx_GOTREF(__pyx_t_2);
  3025. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3026. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3027. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3028. /* "lib/Naked/toolshed/c/benchmarking.pyx":85
  3029. * def wrapper(*args, **kwargs):
  3030. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3031. * sys.stdout.flush() # <<<<<<<<<<<<<<
  3032. * print(" ")
  3033. * # disable garbage collection
  3034. */
  3035. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3036. __Pyx_GOTREF(__pyx_t_2);
  3037. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3038. __Pyx_GOTREF(__pyx_t_4);
  3039. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3040. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3041. __Pyx_GOTREF(__pyx_t_2);
  3042. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3043. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3044. __Pyx_GOTREF(__pyx_t_4);
  3045. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3046. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3047. /* "lib/Naked/toolshed/c/benchmarking.pyx":86
  3048. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3049. * sys.stdout.flush()
  3050. * print(" ") # <<<<<<<<<<<<<<
  3051. * # disable garbage collection
  3052. * gc.collect()
  3053. */
  3054. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3055. /* "lib/Naked/toolshed/c/benchmarking.pyx":88
  3056. * print(" ")
  3057. * # disable garbage collection
  3058. * gc.collect() # <<<<<<<<<<<<<<
  3059. * gc.disable()
  3060. * start = time.time()
  3061. */
  3062. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3063. __Pyx_GOTREF(__pyx_t_4);
  3064. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3065. __Pyx_GOTREF(__pyx_t_2);
  3066. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3067. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3068. __Pyx_GOTREF(__pyx_t_4);
  3069. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3070. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3071. /* "lib/Naked/toolshed/c/benchmarking.pyx":89
  3072. * # disable garbage collection
  3073. * gc.collect()
  3074. * gc.disable() # <<<<<<<<<<<<<<
  3075. * start = time.time()
  3076. * for x in range(repetitions):
  3077. */
  3078. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3079. __Pyx_GOTREF(__pyx_t_4);
  3080. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3081. __Pyx_GOTREF(__pyx_t_2);
  3082. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3083. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3084. __Pyx_GOTREF(__pyx_t_4);
  3085. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3086. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3087. /* "lib/Naked/toolshed/c/benchmarking.pyx":90
  3088. * gc.collect()
  3089. * gc.disable()
  3090. * start = time.time() # <<<<<<<<<<<<<<
  3091. * for x in range(repetitions):
  3092. * result = func(*args, **kwargs)
  3093. */
  3094. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3095. __Pyx_GOTREF(__pyx_t_4);
  3096. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3097. __Pyx_GOTREF(__pyx_t_2);
  3098. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3099. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3100. __Pyx_GOTREF(__pyx_t_4);
  3101. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3102. __pyx_v_start = __pyx_t_4;
  3103. __pyx_t_4 = 0;
  3104. /* "lib/Naked/toolshed/c/benchmarking.pyx":91
  3105. * gc.disable()
  3106. * start = time.time()
  3107. * for x in range(repetitions): # <<<<<<<<<<<<<<
  3108. * result = func(*args, **kwargs)
  3109. * end = time.time()
  3110. */
  3111. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3112. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3113. __Pyx_GOTREF(__pyx_t_4);
  3114. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3115. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  3116. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3117. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3118. __Pyx_GOTREF(__pyx_t_2);
  3119. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3120. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  3121. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  3122. __pyx_t_6 = NULL;
  3123. } else {
  3124. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3125. __Pyx_GOTREF(__pyx_t_4);
  3126. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  3127. }
  3128. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3129. for (;;) {
  3130. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  3131. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  3132. #if CYTHON_COMPILING_IN_CPYTHON
  3133. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3134. #else
  3135. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3136. #endif
  3137. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  3138. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  3139. #if CYTHON_COMPILING_IN_CPYTHON
  3140. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3141. #else
  3142. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3143. #endif
  3144. } else {
  3145. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  3146. if (unlikely(!__pyx_t_2)) {
  3147. PyObject* exc_type = PyErr_Occurred();
  3148. if (exc_type) {
  3149. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  3150. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3151. }
  3152. break;
  3153. }
  3154. __Pyx_GOTREF(__pyx_t_2);
  3155. }
  3156. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  3157. __pyx_t_2 = 0;
  3158. /* "lib/Naked/toolshed/c/benchmarking.pyx":92
  3159. * start = time.time()
  3160. * for x in range(repetitions):
  3161. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  3162. * end = time.time()
  3163. * gc.enable() # re-enable garbage collection
  3164. */
  3165. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3166. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3167. __Pyx_GOTREF(__pyx_t_2);
  3168. __pyx_t_1 = __pyx_v_kwargs;
  3169. __Pyx_INCREF(__pyx_t_1);
  3170. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3171. __Pyx_GOTREF(__pyx_t_3);
  3172. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3173. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3174. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  3175. __pyx_t_3 = 0;
  3176. }
  3177. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3178. /* "lib/Naked/toolshed/c/benchmarking.pyx":93
  3179. * for x in range(repetitions):
  3180. * result = func(*args, **kwargs)
  3181. * end = time.time() # <<<<<<<<<<<<<<
  3182. * gc.enable() # re-enable garbage collection
  3183. * gc.collect()
  3184. */
  3185. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3186. __Pyx_GOTREF(__pyx_t_4);
  3187. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3188. __Pyx_GOTREF(__pyx_t_3);
  3189. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3190. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3191. __Pyx_GOTREF(__pyx_t_4);
  3192. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3193. __pyx_v_end = __pyx_t_4;
  3194. __pyx_t_4 = 0;
  3195. /* "lib/Naked/toolshed/c/benchmarking.pyx":94
  3196. * result = func(*args, **kwargs)
  3197. * end = time.time()
  3198. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  3199. * gc.collect()
  3200. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3201. */
  3202. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3203. __Pyx_GOTREF(__pyx_t_4);
  3204. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3205. __Pyx_GOTREF(__pyx_t_3);
  3206. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3207. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3208. __Pyx_GOTREF(__pyx_t_4);
  3209. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3210. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3211. /* "lib/Naked/toolshed/c/benchmarking.pyx":95
  3212. * end = time.time()
  3213. * gc.enable() # re-enable garbage collection
  3214. * gc.collect() # <<<<<<<<<<<<<<
  3215. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3216. * return result
  3217. */
  3218. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3219. __Pyx_GOTREF(__pyx_t_4);
  3220. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3221. __Pyx_GOTREF(__pyx_t_3);
  3222. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3223. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3224. __Pyx_GOTREF(__pyx_t_4);
  3225. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3226. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3227. /* "lib/Naked/toolshed/c/benchmarking.pyx":96
  3228. * gc.enable() # re-enable garbage collection
  3229. * gc.collect()
  3230. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  3231. * return result
  3232. * return wrapper
  3233. */
  3234. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3235. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3236. __Pyx_GOTREF(__pyx_t_4);
  3237. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3238. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  3239. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3240. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3241. __Pyx_GOTREF(__pyx_t_3);
  3242. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3243. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3244. __Pyx_GOTREF(__pyx_t_4);
  3245. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3246. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3247. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3248. __Pyx_GOTREF(__pyx_t_3);
  3249. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3250. __Pyx_GOTREF(__pyx_t_1);
  3251. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3252. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3253. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3254. __Pyx_GOTREF(__pyx_t_3);
  3255. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3256. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3257. __Pyx_GOTREF(__pyx_t_1);
  3258. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3259. __Pyx_GOTREF(__pyx_t_4);
  3260. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  3261. __Pyx_GIVEREF(__pyx_t_1);
  3262. __pyx_t_1 = 0;
  3263. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3264. __Pyx_GOTREF(__pyx_t_1);
  3265. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3266. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3267. __Pyx_GOTREF(__pyx_t_4);
  3268. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3269. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3270. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3271. __Pyx_GOTREF(__pyx_t_1);
  3272. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3273. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3274. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3275. /* "lib/Naked/toolshed/c/benchmarking.pyx":97
  3276. * gc.collect()
  3277. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3278. * return result # <<<<<<<<<<<<<<
  3279. * return wrapper
  3280. *
  3281. */
  3282. __Pyx_XDECREF(__pyx_r);
  3283. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3284. __Pyx_INCREF(__pyx_v_result);
  3285. __pyx_r = __pyx_v_result;
  3286. goto __pyx_L0;
  3287. /* "lib/Naked/toolshed/c/benchmarking.pyx":83
  3288. * def timer_1k(func, repetitions=1000):
  3289. * @wraps(func)
  3290. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3291. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3292. * sys.stdout.flush()
  3293. */
  3294. /* function exit code */
  3295. __pyx_L1_error:;
  3296. __Pyx_XDECREF(__pyx_t_1);
  3297. __Pyx_XDECREF(__pyx_t_2);
  3298. __Pyx_XDECREF(__pyx_t_3);
  3299. __Pyx_XDECREF(__pyx_t_4);
  3300. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3301. __pyx_r = NULL;
  3302. __pyx_L0:;
  3303. __Pyx_XDECREF(__pyx_v_start);
  3304. __Pyx_XDECREF(__pyx_v_x);
  3305. __Pyx_XDECREF(__pyx_v_result);
  3306. __Pyx_XDECREF(__pyx_v_end);
  3307. __Pyx_XGIVEREF(__pyx_r);
  3308. __Pyx_RefNannyFinishContext();
  3309. return __pyx_r;
  3310. }
  3311. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  3312. * return wrapper
  3313. *
  3314. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  3315. * @wraps(func)
  3316. * def wrapper(*args, **kwargs):
  3317. */
  3318. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_6timer_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  3319. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_cur_scope;
  3320. PyObject *__pyx_v_wrapper = 0;
  3321. PyObject *__pyx_r = NULL;
  3322. __Pyx_RefNannyDeclarations
  3323. PyObject *__pyx_t_1 = NULL;
  3324. PyObject *__pyx_t_2 = NULL;
  3325. PyObject *__pyx_t_3 = NULL;
  3326. int __pyx_lineno = 0;
  3327. const char *__pyx_filename = NULL;
  3328. int __pyx_clineno = 0;
  3329. __Pyx_RefNannySetupContext("timer_1k", 0);
  3330. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, __pyx_empty_tuple, NULL);
  3331. if (unlikely(!__pyx_cur_scope)) {
  3332. __Pyx_RefNannyFinishContext();
  3333. return NULL;
  3334. }
  3335. __Pyx_GOTREF(__pyx_cur_scope);
  3336. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  3337. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3338. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3339. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  3340. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3341. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3342. /* "lib/Naked/toolshed/c/benchmarking.pyx":82
  3343. *
  3344. * def timer_1k(func, repetitions=1000):
  3345. * @wraps(func) # <<<<<<<<<<<<<<
  3346. * def wrapper(*args, **kwargs):
  3347. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3348. */
  3349. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3350. __Pyx_GOTREF(__pyx_t_1);
  3351. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3352. __Pyx_GOTREF(__pyx_t_2);
  3353. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3354. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  3355. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3356. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3357. __Pyx_GOTREF(__pyx_t_3);
  3358. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3359. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3360. /* "lib/Naked/toolshed/c/benchmarking.pyx":83
  3361. * def timer_1k(func, repetitions=1000):
  3362. * @wraps(func)
  3363. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3364. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3365. * sys.stdout.flush()
  3366. */
  3367. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1k_1wrapper, 0, __pyx_n_s_timer_1k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3368. __Pyx_GOTREF(__pyx_t_2);
  3369. /* "lib/Naked/toolshed/c/benchmarking.pyx":82
  3370. *
  3371. * def timer_1k(func, repetitions=1000):
  3372. * @wraps(func) # <<<<<<<<<<<<<<
  3373. * def wrapper(*args, **kwargs):
  3374. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3375. */
  3376. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3377. __Pyx_GOTREF(__pyx_t_1);
  3378. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  3379. __Pyx_GIVEREF(__pyx_t_2);
  3380. __pyx_t_2 = 0;
  3381. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3382. __Pyx_GOTREF(__pyx_t_2);
  3383. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3384. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3385. __pyx_v_wrapper = __pyx_t_2;
  3386. __pyx_t_2 = 0;
  3387. /* "lib/Naked/toolshed/c/benchmarking.pyx":98
  3388. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3389. * return result
  3390. * return wrapper # <<<<<<<<<<<<<<
  3391. *
  3392. * def timer_10k(func, repetitions=10000):
  3393. */
  3394. __Pyx_XDECREF(__pyx_r);
  3395. __Pyx_INCREF(__pyx_v_wrapper);
  3396. __pyx_r = __pyx_v_wrapper;
  3397. goto __pyx_L0;
  3398. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  3399. * return wrapper
  3400. *
  3401. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  3402. * @wraps(func)
  3403. * def wrapper(*args, **kwargs):
  3404. */
  3405. /* function exit code */
  3406. __pyx_L1_error:;
  3407. __Pyx_XDECREF(__pyx_t_1);
  3408. __Pyx_XDECREF(__pyx_t_2);
  3409. __Pyx_XDECREF(__pyx_t_3);
  3410. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3411. __pyx_r = NULL;
  3412. __pyx_L0:;
  3413. __Pyx_XDECREF(__pyx_v_wrapper);
  3414. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  3415. __Pyx_XGIVEREF(__pyx_r);
  3416. __Pyx_RefNannyFinishContext();
  3417. return __pyx_r;
  3418. }
  3419. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  3420. * return wrapper
  3421. *
  3422. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  3423. * @wraps(func)
  3424. * def wrapper(*args, **kwargs):
  3425. */
  3426. /* Python wrapper */
  3427. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3428. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k = {__Pyx_NAMESTR("timer_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3429. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3430. PyObject *__pyx_v_func = 0;
  3431. PyObject *__pyx_v_repetitions = 0;
  3432. int __pyx_lineno = 0;
  3433. const char *__pyx_filename = NULL;
  3434. int __pyx_clineno = 0;
  3435. PyObject *__pyx_r = 0;
  3436. __Pyx_RefNannyDeclarations
  3437. __Pyx_RefNannySetupContext("timer_10k (wrapper)", 0);
  3438. {
  3439. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  3440. PyObject* values[2] = {0,0};
  3441. values[1] = ((PyObject *)__pyx_int_10000);
  3442. if (unlikely(__pyx_kwds)) {
  3443. Py_ssize_t kw_args;
  3444. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3445. switch (pos_args) {
  3446. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3447. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3448. case 0: break;
  3449. default: goto __pyx_L5_argtuple_error;
  3450. }
  3451. kw_args = PyDict_Size(__pyx_kwds);
  3452. switch (pos_args) {
  3453. case 0:
  3454. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  3455. else goto __pyx_L5_argtuple_error;
  3456. case 1:
  3457. if (kw_args > 0) {
  3458. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  3459. if (value) { values[1] = value; kw_args--; }
  3460. }
  3461. }
  3462. if (unlikely(kw_args > 0)) {
  3463. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3464. }
  3465. } else {
  3466. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3467. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3468. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3469. break;
  3470. default: goto __pyx_L5_argtuple_error;
  3471. }
  3472. }
  3473. __pyx_v_func = values[0];
  3474. __pyx_v_repetitions = values[1];
  3475. }
  3476. goto __pyx_L4_argument_unpacking_done;
  3477. __pyx_L5_argtuple_error:;
  3478. __Pyx_RaiseArgtupleInvalid("timer_10k", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  3479. __pyx_L3_error:;
  3480. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3481. __Pyx_RefNannyFinishContext();
  3482. return NULL;
  3483. __pyx_L4_argument_unpacking_done:;
  3484. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  3485. /* function exit code */
  3486. __Pyx_RefNannyFinishContext();
  3487. return __pyx_r;
  3488. }
  3489. /* "lib/Naked/toolshed/c/benchmarking.pyx":102
  3490. * def timer_10k(func, repetitions=10000):
  3491. * @wraps(func)
  3492. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3493. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3494. * sys.stdout.flush()
  3495. */
  3496. /* Python wrapper */
  3497. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3498. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3499. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3500. PyObject *__pyx_v_args = 0;
  3501. PyObject *__pyx_v_kwargs = 0;
  3502. PyObject *__pyx_r = 0;
  3503. __Pyx_RefNannyDeclarations
  3504. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  3505. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  3506. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  3507. if (unlikely(!__pyx_v_kwargs)) return NULL;
  3508. __Pyx_GOTREF(__pyx_v_kwargs);
  3509. __Pyx_INCREF(__pyx_args);
  3510. __pyx_v_args = __pyx_args;
  3511. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  3512. /* function exit code */
  3513. __Pyx_XDECREF(__pyx_v_args);
  3514. __Pyx_XDECREF(__pyx_v_kwargs);
  3515. __Pyx_RefNannyFinishContext();
  3516. return __pyx_r;
  3517. }
  3518. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  3519. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope;
  3520. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_outer_scope;
  3521. PyObject *__pyx_v_start = NULL;
  3522. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  3523. PyObject *__pyx_v_result = NULL;
  3524. PyObject *__pyx_v_end = NULL;
  3525. PyObject *__pyx_r = NULL;
  3526. __Pyx_RefNannyDeclarations
  3527. PyObject *__pyx_t_1 = NULL;
  3528. PyObject *__pyx_t_2 = NULL;
  3529. PyObject *__pyx_t_3 = NULL;
  3530. PyObject *__pyx_t_4 = NULL;
  3531. Py_ssize_t __pyx_t_5;
  3532. PyObject *(*__pyx_t_6)(PyObject *);
  3533. int __pyx_lineno = 0;
  3534. const char *__pyx_filename = NULL;
  3535. int __pyx_clineno = 0;
  3536. __Pyx_RefNannySetupContext("wrapper", 0);
  3537. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *) __Pyx_CyFunction_GetClosure(__pyx_self);
  3538. __pyx_cur_scope = __pyx_outer_scope;
  3539. /* "lib/Naked/toolshed/c/benchmarking.pyx":103
  3540. * @wraps(func)
  3541. * def wrapper(*args, **kwargs):
  3542. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  3543. * sys.stdout.flush()
  3544. * print(" ")
  3545. */
  3546. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3547. __Pyx_GOTREF(__pyx_t_1);
  3548. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3549. __Pyx_GOTREF(__pyx_t_2);
  3550. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3551. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3552. __Pyx_GOTREF(__pyx_t_1);
  3553. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3554. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3555. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3556. __Pyx_GOTREF(__pyx_t_2);
  3557. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3558. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  3559. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3560. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3561. __Pyx_GOTREF(__pyx_t_3);
  3562. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3563. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3564. __Pyx_GOTREF(__pyx_t_2);
  3565. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3566. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3567. __Pyx_GOTREF(__pyx_t_3);
  3568. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3569. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3570. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3571. __Pyx_GOTREF(__pyx_t_2);
  3572. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3573. __Pyx_GOTREF(__pyx_t_4);
  3574. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3575. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3576. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3577. __Pyx_GOTREF(__pyx_t_2);
  3578. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3579. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3580. __Pyx_GOTREF(__pyx_t_4);
  3581. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  3582. __Pyx_GIVEREF(__pyx_t_2);
  3583. __pyx_t_2 = 0;
  3584. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3585. __Pyx_GOTREF(__pyx_t_2);
  3586. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3587. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3588. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3589. /* "lib/Naked/toolshed/c/benchmarking.pyx":104
  3590. * def wrapper(*args, **kwargs):
  3591. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3592. * sys.stdout.flush() # <<<<<<<<<<<<<<
  3593. * print(" ")
  3594. * # disable garbage collection
  3595. */
  3596. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3597. __Pyx_GOTREF(__pyx_t_2);
  3598. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3599. __Pyx_GOTREF(__pyx_t_4);
  3600. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3601. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3602. __Pyx_GOTREF(__pyx_t_2);
  3603. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3604. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3605. __Pyx_GOTREF(__pyx_t_4);
  3606. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3607. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3608. /* "lib/Naked/toolshed/c/benchmarking.pyx":105
  3609. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3610. * sys.stdout.flush()
  3611. * print(" ") # <<<<<<<<<<<<<<
  3612. * # disable garbage collection
  3613. * gc.collect()
  3614. */
  3615. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3616. /* "lib/Naked/toolshed/c/benchmarking.pyx":107
  3617. * print(" ")
  3618. * # disable garbage collection
  3619. * gc.collect() # <<<<<<<<<<<<<<
  3620. * gc.disable()
  3621. * start = time.time()
  3622. */
  3623. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3624. __Pyx_GOTREF(__pyx_t_4);
  3625. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3626. __Pyx_GOTREF(__pyx_t_2);
  3627. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3628. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3629. __Pyx_GOTREF(__pyx_t_4);
  3630. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3631. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3632. /* "lib/Naked/toolshed/c/benchmarking.pyx":108
  3633. * # disable garbage collection
  3634. * gc.collect()
  3635. * gc.disable() # <<<<<<<<<<<<<<
  3636. * start = time.time()
  3637. * for x in range(repetitions):
  3638. */
  3639. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3640. __Pyx_GOTREF(__pyx_t_4);
  3641. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3642. __Pyx_GOTREF(__pyx_t_2);
  3643. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3644. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3645. __Pyx_GOTREF(__pyx_t_4);
  3646. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3647. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3648. /* "lib/Naked/toolshed/c/benchmarking.pyx":109
  3649. * gc.collect()
  3650. * gc.disable()
  3651. * start = time.time() # <<<<<<<<<<<<<<
  3652. * for x in range(repetitions):
  3653. * result = func(*args, **kwargs)
  3654. */
  3655. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3656. __Pyx_GOTREF(__pyx_t_4);
  3657. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3658. __Pyx_GOTREF(__pyx_t_2);
  3659. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3660. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3661. __Pyx_GOTREF(__pyx_t_4);
  3662. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3663. __pyx_v_start = __pyx_t_4;
  3664. __pyx_t_4 = 0;
  3665. /* "lib/Naked/toolshed/c/benchmarking.pyx":110
  3666. * gc.disable()
  3667. * start = time.time()
  3668. * for x in range(repetitions): # <<<<<<<<<<<<<<
  3669. * result = func(*args, **kwargs)
  3670. * end = time.time()
  3671. */
  3672. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3673. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3674. __Pyx_GOTREF(__pyx_t_4);
  3675. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3676. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  3677. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3678. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3679. __Pyx_GOTREF(__pyx_t_2);
  3680. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3681. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  3682. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  3683. __pyx_t_6 = NULL;
  3684. } else {
  3685. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3686. __Pyx_GOTREF(__pyx_t_4);
  3687. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  3688. }
  3689. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3690. for (;;) {
  3691. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  3692. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  3693. #if CYTHON_COMPILING_IN_CPYTHON
  3694. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3695. #else
  3696. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3697. #endif
  3698. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  3699. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  3700. #if CYTHON_COMPILING_IN_CPYTHON
  3701. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3702. #else
  3703. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3704. #endif
  3705. } else {
  3706. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  3707. if (unlikely(!__pyx_t_2)) {
  3708. PyObject* exc_type = PyErr_Occurred();
  3709. if (exc_type) {
  3710. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  3711. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3712. }
  3713. break;
  3714. }
  3715. __Pyx_GOTREF(__pyx_t_2);
  3716. }
  3717. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  3718. __pyx_t_2 = 0;
  3719. /* "lib/Naked/toolshed/c/benchmarking.pyx":111
  3720. * start = time.time()
  3721. * for x in range(repetitions):
  3722. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  3723. * end = time.time()
  3724. * gc.enable() # re-enable garbage collection
  3725. */
  3726. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3727. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3728. __Pyx_GOTREF(__pyx_t_2);
  3729. __pyx_t_1 = __pyx_v_kwargs;
  3730. __Pyx_INCREF(__pyx_t_1);
  3731. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3732. __Pyx_GOTREF(__pyx_t_3);
  3733. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3734. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3735. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  3736. __pyx_t_3 = 0;
  3737. }
  3738. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3739. /* "lib/Naked/toolshed/c/benchmarking.pyx":112
  3740. * for x in range(repetitions):
  3741. * result = func(*args, **kwargs)
  3742. * end = time.time() # <<<<<<<<<<<<<<
  3743. * gc.enable() # re-enable garbage collection
  3744. * gc.collect()
  3745. */
  3746. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3747. __Pyx_GOTREF(__pyx_t_4);
  3748. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3749. __Pyx_GOTREF(__pyx_t_3);
  3750. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3751. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3752. __Pyx_GOTREF(__pyx_t_4);
  3753. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3754. __pyx_v_end = __pyx_t_4;
  3755. __pyx_t_4 = 0;
  3756. /* "lib/Naked/toolshed/c/benchmarking.pyx":113
  3757. * result = func(*args, **kwargs)
  3758. * end = time.time()
  3759. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  3760. * gc.collect()
  3761. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3762. */
  3763. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3764. __Pyx_GOTREF(__pyx_t_4);
  3765. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3766. __Pyx_GOTREF(__pyx_t_3);
  3767. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3768. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3769. __Pyx_GOTREF(__pyx_t_4);
  3770. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3771. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3772. /* "lib/Naked/toolshed/c/benchmarking.pyx":114
  3773. * end = time.time()
  3774. * gc.enable() # re-enable garbage collection
  3775. * gc.collect() # <<<<<<<<<<<<<<
  3776. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3777. * return result
  3778. */
  3779. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3780. __Pyx_GOTREF(__pyx_t_4);
  3781. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3782. __Pyx_GOTREF(__pyx_t_3);
  3783. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3784. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3785. __Pyx_GOTREF(__pyx_t_4);
  3786. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3787. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3788. /* "lib/Naked/toolshed/c/benchmarking.pyx":115
  3789. * gc.enable() # re-enable garbage collection
  3790. * gc.collect()
  3791. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  3792. * return result
  3793. * return wrapper
  3794. */
  3795. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3796. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3797. __Pyx_GOTREF(__pyx_t_4);
  3798. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3799. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  3800. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3801. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3802. __Pyx_GOTREF(__pyx_t_3);
  3803. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3804. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3805. __Pyx_GOTREF(__pyx_t_4);
  3806. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3807. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3808. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3809. __Pyx_GOTREF(__pyx_t_3);
  3810. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3811. __Pyx_GOTREF(__pyx_t_1);
  3812. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3813. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3814. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3815. __Pyx_GOTREF(__pyx_t_3);
  3816. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3817. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3818. __Pyx_GOTREF(__pyx_t_1);
  3819. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3820. __Pyx_GOTREF(__pyx_t_4);
  3821. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  3822. __Pyx_GIVEREF(__pyx_t_1);
  3823. __pyx_t_1 = 0;
  3824. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3825. __Pyx_GOTREF(__pyx_t_1);
  3826. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3827. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3828. __Pyx_GOTREF(__pyx_t_4);
  3829. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3830. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3831. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3832. __Pyx_GOTREF(__pyx_t_1);
  3833. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3834. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3835. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3836. /* "lib/Naked/toolshed/c/benchmarking.pyx":116
  3837. * gc.collect()
  3838. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3839. * return result # <<<<<<<<<<<<<<
  3840. * return wrapper
  3841. *
  3842. */
  3843. __Pyx_XDECREF(__pyx_r);
  3844. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  3845. __Pyx_INCREF(__pyx_v_result);
  3846. __pyx_r = __pyx_v_result;
  3847. goto __pyx_L0;
  3848. /* "lib/Naked/toolshed/c/benchmarking.pyx":102
  3849. * def timer_10k(func, repetitions=10000):
  3850. * @wraps(func)
  3851. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3852. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3853. * sys.stdout.flush()
  3854. */
  3855. /* function exit code */
  3856. __pyx_L1_error:;
  3857. __Pyx_XDECREF(__pyx_t_1);
  3858. __Pyx_XDECREF(__pyx_t_2);
  3859. __Pyx_XDECREF(__pyx_t_3);
  3860. __Pyx_XDECREF(__pyx_t_4);
  3861. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3862. __pyx_r = NULL;
  3863. __pyx_L0:;
  3864. __Pyx_XDECREF(__pyx_v_start);
  3865. __Pyx_XDECREF(__pyx_v_x);
  3866. __Pyx_XDECREF(__pyx_v_result);
  3867. __Pyx_XDECREF(__pyx_v_end);
  3868. __Pyx_XGIVEREF(__pyx_r);
  3869. __Pyx_RefNannyFinishContext();
  3870. return __pyx_r;
  3871. }
  3872. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  3873. * return wrapper
  3874. *
  3875. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  3876. * @wraps(func)
  3877. * def wrapper(*args, **kwargs):
  3878. */
  3879. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  3880. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_cur_scope;
  3881. PyObject *__pyx_v_wrapper = 0;
  3882. PyObject *__pyx_r = NULL;
  3883. __Pyx_RefNannyDeclarations
  3884. PyObject *__pyx_t_1 = NULL;
  3885. PyObject *__pyx_t_2 = NULL;
  3886. PyObject *__pyx_t_3 = NULL;
  3887. int __pyx_lineno = 0;
  3888. const char *__pyx_filename = NULL;
  3889. int __pyx_clineno = 0;
  3890. __Pyx_RefNannySetupContext("timer_10k", 0);
  3891. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, __pyx_empty_tuple, NULL);
  3892. if (unlikely(!__pyx_cur_scope)) {
  3893. __Pyx_RefNannyFinishContext();
  3894. return NULL;
  3895. }
  3896. __Pyx_GOTREF(__pyx_cur_scope);
  3897. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  3898. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3899. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3900. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  3901. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  3902. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  3903. /* "lib/Naked/toolshed/c/benchmarking.pyx":101
  3904. *
  3905. * def timer_10k(func, repetitions=10000):
  3906. * @wraps(func) # <<<<<<<<<<<<<<
  3907. * def wrapper(*args, **kwargs):
  3908. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3909. */
  3910. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3911. __Pyx_GOTREF(__pyx_t_1);
  3912. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3913. __Pyx_GOTREF(__pyx_t_2);
  3914. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  3915. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  3916. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  3917. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3918. __Pyx_GOTREF(__pyx_t_3);
  3919. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3920. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3921. /* "lib/Naked/toolshed/c/benchmarking.pyx":102
  3922. * def timer_10k(func, repetitions=10000):
  3923. * @wraps(func)
  3924. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  3925. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3926. * sys.stdout.flush()
  3927. */
  3928. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k_1wrapper, 0, __pyx_n_s_timer_10k_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3929. __Pyx_GOTREF(__pyx_t_2);
  3930. /* "lib/Naked/toolshed/c/benchmarking.pyx":101
  3931. *
  3932. * def timer_10k(func, repetitions=10000):
  3933. * @wraps(func) # <<<<<<<<<<<<<<
  3934. * def wrapper(*args, **kwargs):
  3935. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  3936. */
  3937. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3938. __Pyx_GOTREF(__pyx_t_1);
  3939. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  3940. __Pyx_GIVEREF(__pyx_t_2);
  3941. __pyx_t_2 = 0;
  3942. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  3943. __Pyx_GOTREF(__pyx_t_2);
  3944. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3945. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3946. __pyx_v_wrapper = __pyx_t_2;
  3947. __pyx_t_2 = 0;
  3948. /* "lib/Naked/toolshed/c/benchmarking.pyx":117
  3949. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  3950. * return result
  3951. * return wrapper # <<<<<<<<<<<<<<
  3952. *
  3953. * def timer_1m(func, repetitions=1000000):
  3954. */
  3955. __Pyx_XDECREF(__pyx_r);
  3956. __Pyx_INCREF(__pyx_v_wrapper);
  3957. __pyx_r = __pyx_v_wrapper;
  3958. goto __pyx_L0;
  3959. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  3960. * return wrapper
  3961. *
  3962. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  3963. * @wraps(func)
  3964. * def wrapper(*args, **kwargs):
  3965. */
  3966. /* function exit code */
  3967. __pyx_L1_error:;
  3968. __Pyx_XDECREF(__pyx_t_1);
  3969. __Pyx_XDECREF(__pyx_t_2);
  3970. __Pyx_XDECREF(__pyx_t_3);
  3971. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_10k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3972. __pyx_r = NULL;
  3973. __pyx_L0:;
  3974. __Pyx_XDECREF(__pyx_v_wrapper);
  3975. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  3976. __Pyx_XGIVEREF(__pyx_r);
  3977. __Pyx_RefNannyFinishContext();
  3978. return __pyx_r;
  3979. }
  3980. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  3981. * return wrapper
  3982. *
  3983. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  3984. * @wraps(func)
  3985. * def wrapper(*args, **kwargs):
  3986. */
  3987. /* Python wrapper */
  3988. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3989. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m = {__Pyx_NAMESTR("timer_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  3990. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3991. PyObject *__pyx_v_func = 0;
  3992. PyObject *__pyx_v_repetitions = 0;
  3993. int __pyx_lineno = 0;
  3994. const char *__pyx_filename = NULL;
  3995. int __pyx_clineno = 0;
  3996. PyObject *__pyx_r = 0;
  3997. __Pyx_RefNannyDeclarations
  3998. __Pyx_RefNannySetupContext("timer_1m (wrapper)", 0);
  3999. {
  4000. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,0};
  4001. PyObject* values[2] = {0,0};
  4002. values[1] = ((PyObject *)__pyx_int_1000000);
  4003. if (unlikely(__pyx_kwds)) {
  4004. Py_ssize_t kw_args;
  4005. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4006. switch (pos_args) {
  4007. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4008. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4009. case 0: break;
  4010. default: goto __pyx_L5_argtuple_error;
  4011. }
  4012. kw_args = PyDict_Size(__pyx_kwds);
  4013. switch (pos_args) {
  4014. case 0:
  4015. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  4016. else goto __pyx_L5_argtuple_error;
  4017. case 1:
  4018. if (kw_args > 0) {
  4019. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  4020. if (value) { values[1] = value; kw_args--; }
  4021. }
  4022. }
  4023. if (unlikely(kw_args > 0)) {
  4024. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4025. }
  4026. } else {
  4027. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4028. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4029. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4030. break;
  4031. default: goto __pyx_L5_argtuple_error;
  4032. }
  4033. }
  4034. __pyx_v_func = values[0];
  4035. __pyx_v_repetitions = values[1];
  4036. }
  4037. goto __pyx_L4_argument_unpacking_done;
  4038. __pyx_L5_argtuple_error:;
  4039. __Pyx_RaiseArgtupleInvalid("timer_1m", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4040. __pyx_L3_error:;
  4041. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4042. __Pyx_RefNannyFinishContext();
  4043. return NULL;
  4044. __pyx_L4_argument_unpacking_done:;
  4045. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions);
  4046. /* function exit code */
  4047. __Pyx_RefNannyFinishContext();
  4048. return __pyx_r;
  4049. }
  4050. /* "lib/Naked/toolshed/c/benchmarking.pyx":121
  4051. * def timer_1m(func, repetitions=1000000):
  4052. * @wraps(func)
  4053. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  4054. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4055. * sys.stdout.flush()
  4056. */
  4057. /* Python wrapper */
  4058. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4059. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4060. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4061. PyObject *__pyx_v_args = 0;
  4062. PyObject *__pyx_v_kwargs = 0;
  4063. PyObject *__pyx_r = 0;
  4064. __Pyx_RefNannyDeclarations
  4065. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  4066. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  4067. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  4068. if (unlikely(!__pyx_v_kwargs)) return NULL;
  4069. __Pyx_GOTREF(__pyx_v_kwargs);
  4070. __Pyx_INCREF(__pyx_args);
  4071. __pyx_v_args = __pyx_args;
  4072. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  4073. /* function exit code */
  4074. __Pyx_XDECREF(__pyx_v_args);
  4075. __Pyx_XDECREF(__pyx_v_kwargs);
  4076. __Pyx_RefNannyFinishContext();
  4077. return __pyx_r;
  4078. }
  4079. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  4080. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope;
  4081. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_outer_scope;
  4082. PyObject *__pyx_v_start = NULL;
  4083. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  4084. PyObject *__pyx_v_result = NULL;
  4085. PyObject *__pyx_v_end = NULL;
  4086. PyObject *__pyx_r = NULL;
  4087. __Pyx_RefNannyDeclarations
  4088. PyObject *__pyx_t_1 = NULL;
  4089. PyObject *__pyx_t_2 = NULL;
  4090. PyObject *__pyx_t_3 = NULL;
  4091. PyObject *__pyx_t_4 = NULL;
  4092. Py_ssize_t __pyx_t_5;
  4093. PyObject *(*__pyx_t_6)(PyObject *);
  4094. int __pyx_lineno = 0;
  4095. const char *__pyx_filename = NULL;
  4096. int __pyx_clineno = 0;
  4097. __Pyx_RefNannySetupContext("wrapper", 0);
  4098. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *) __Pyx_CyFunction_GetClosure(__pyx_self);
  4099. __pyx_cur_scope = __pyx_outer_scope;
  4100. /* "lib/Naked/toolshed/c/benchmarking.pyx":122
  4101. * @wraps(func)
  4102. * def wrapper(*args, **kwargs):
  4103. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...") # <<<<<<<<<<<<<<
  4104. * sys.stdout.flush()
  4105. * print(" ")
  4106. */
  4107. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4108. __Pyx_GOTREF(__pyx_t_1);
  4109. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4110. __Pyx_GOTREF(__pyx_t_2);
  4111. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4112. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4113. __Pyx_GOTREF(__pyx_t_1);
  4114. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4115. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4116. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4117. __Pyx_GOTREF(__pyx_t_2);
  4118. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  4119. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  4120. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  4121. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4122. __Pyx_GOTREF(__pyx_t_3);
  4123. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4124. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Starting, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4125. __Pyx_GOTREF(__pyx_t_2);
  4126. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4127. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4128. __Pyx_GOTREF(__pyx_t_3);
  4129. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4130. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4131. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4132. __Pyx_GOTREF(__pyx_t_2);
  4133. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4134. __Pyx_GOTREF(__pyx_t_4);
  4135. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4136. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4137. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4138. __Pyx_GOTREF(__pyx_t_2);
  4139. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4140. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4141. __Pyx_GOTREF(__pyx_t_4);
  4142. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  4143. __Pyx_GIVEREF(__pyx_t_2);
  4144. __pyx_t_2 = 0;
  4145. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4146. __Pyx_GOTREF(__pyx_t_2);
  4147. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4148. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4149. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4150. /* "lib/Naked/toolshed/c/benchmarking.pyx":123
  4151. * def wrapper(*args, **kwargs):
  4152. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4153. * sys.stdout.flush() # <<<<<<<<<<<<<<
  4154. * print(" ")
  4155. * # disable garbage collection
  4156. */
  4157. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4158. __Pyx_GOTREF(__pyx_t_2);
  4159. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4160. __Pyx_GOTREF(__pyx_t_4);
  4161. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4162. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4163. __Pyx_GOTREF(__pyx_t_2);
  4164. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4165. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4166. __Pyx_GOTREF(__pyx_t_4);
  4167. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4168. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4169. /* "lib/Naked/toolshed/c/benchmarking.pyx":124
  4170. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4171. * sys.stdout.flush()
  4172. * print(" ") # <<<<<<<<<<<<<<
  4173. * # disable garbage collection
  4174. * gc.collect()
  4175. */
  4176. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4177. /* "lib/Naked/toolshed/c/benchmarking.pyx":126
  4178. * print(" ")
  4179. * # disable garbage collection
  4180. * gc.collect() # <<<<<<<<<<<<<<
  4181. * gc.disable()
  4182. * start = time.time()
  4183. */
  4184. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4185. __Pyx_GOTREF(__pyx_t_4);
  4186. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4187. __Pyx_GOTREF(__pyx_t_2);
  4188. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4189. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4190. __Pyx_GOTREF(__pyx_t_4);
  4191. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4192. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4193. /* "lib/Naked/toolshed/c/benchmarking.pyx":127
  4194. * # disable garbage collection
  4195. * gc.collect()
  4196. * gc.disable() # <<<<<<<<<<<<<<
  4197. * start = time.time()
  4198. * for x in range(repetitions):
  4199. */
  4200. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4201. __Pyx_GOTREF(__pyx_t_4);
  4202. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4203. __Pyx_GOTREF(__pyx_t_2);
  4204. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4205. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4206. __Pyx_GOTREF(__pyx_t_4);
  4207. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4208. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4209. /* "lib/Naked/toolshed/c/benchmarking.pyx":128
  4210. * gc.collect()
  4211. * gc.disable()
  4212. * start = time.time() # <<<<<<<<<<<<<<
  4213. * for x in range(repetitions):
  4214. * result = func(*args, **kwargs)
  4215. */
  4216. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4217. __Pyx_GOTREF(__pyx_t_4);
  4218. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4219. __Pyx_GOTREF(__pyx_t_2);
  4220. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4221. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4222. __Pyx_GOTREF(__pyx_t_4);
  4223. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4224. __pyx_v_start = __pyx_t_4;
  4225. __pyx_t_4 = 0;
  4226. /* "lib/Naked/toolshed/c/benchmarking.pyx":129
  4227. * gc.disable()
  4228. * start = time.time()
  4229. * for x in range(repetitions): # <<<<<<<<<<<<<<
  4230. * result = func(*args, **kwargs)
  4231. * end = time.time()
  4232. */
  4233. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4234. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4235. __Pyx_GOTREF(__pyx_t_4);
  4236. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  4237. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  4238. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  4239. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4240. __Pyx_GOTREF(__pyx_t_2);
  4241. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4242. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  4243. __pyx_t_4 = __pyx_t_2; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
  4244. __pyx_t_6 = NULL;
  4245. } else {
  4246. __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4247. __Pyx_GOTREF(__pyx_t_4);
  4248. __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
  4249. }
  4250. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4251. for (;;) {
  4252. if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
  4253. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
  4254. #if CYTHON_COMPILING_IN_CPYTHON
  4255. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4256. #else
  4257. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4258. #endif
  4259. } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
  4260. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  4261. #if CYTHON_COMPILING_IN_CPYTHON
  4262. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4263. #else
  4264. __pyx_t_2 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4265. #endif
  4266. } else {
  4267. __pyx_t_2 = __pyx_t_6(__pyx_t_4);
  4268. if (unlikely(!__pyx_t_2)) {
  4269. PyObject* exc_type = PyErr_Occurred();
  4270. if (exc_type) {
  4271. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  4272. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4273. }
  4274. break;
  4275. }
  4276. __Pyx_GOTREF(__pyx_t_2);
  4277. }
  4278. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  4279. __pyx_t_2 = 0;
  4280. /* "lib/Naked/toolshed/c/benchmarking.pyx":130
  4281. * start = time.time()
  4282. * for x in range(repetitions):
  4283. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  4284. * end = time.time()
  4285. * gc.enable() # re-enable garbage collection
  4286. */
  4287. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4288. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4289. __Pyx_GOTREF(__pyx_t_2);
  4290. __pyx_t_1 = __pyx_v_kwargs;
  4291. __Pyx_INCREF(__pyx_t_1);
  4292. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4293. __Pyx_GOTREF(__pyx_t_3);
  4294. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4295. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4296. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_3);
  4297. __pyx_t_3 = 0;
  4298. }
  4299. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4300. /* "lib/Naked/toolshed/c/benchmarking.pyx":131
  4301. * for x in range(repetitions):
  4302. * result = func(*args, **kwargs)
  4303. * end = time.time() # <<<<<<<<<<<<<<
  4304. * gc.enable() # re-enable garbage collection
  4305. * gc.collect()
  4306. */
  4307. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4308. __Pyx_GOTREF(__pyx_t_4);
  4309. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_time); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4310. __Pyx_GOTREF(__pyx_t_3);
  4311. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4312. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4313. __Pyx_GOTREF(__pyx_t_4);
  4314. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4315. __pyx_v_end = __pyx_t_4;
  4316. __pyx_t_4 = 0;
  4317. /* "lib/Naked/toolshed/c/benchmarking.pyx":132
  4318. * result = func(*args, **kwargs)
  4319. * end = time.time()
  4320. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  4321. * gc.collect()
  4322. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  4323. */
  4324. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4325. __Pyx_GOTREF(__pyx_t_4);
  4326. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_enable); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4327. __Pyx_GOTREF(__pyx_t_3);
  4328. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4329. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4330. __Pyx_GOTREF(__pyx_t_4);
  4331. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4332. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4333. /* "lib/Naked/toolshed/c/benchmarking.pyx":133
  4334. * end = time.time()
  4335. * gc.enable() # re-enable garbage collection
  4336. * gc.collect() # <<<<<<<<<<<<<<
  4337. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  4338. * return result
  4339. */
  4340. __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4341. __Pyx_GOTREF(__pyx_t_4);
  4342. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_collect); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4343. __Pyx_GOTREF(__pyx_t_3);
  4344. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4345. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4346. __Pyx_GOTREF(__pyx_t_4);
  4347. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4348. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4349. /* "lib/Naked/toolshed/c/benchmarking.pyx":134
  4350. * gc.enable() # re-enable garbage collection
  4351. * gc.collect()
  4352. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec") # <<<<<<<<<<<<<<
  4353. * return result
  4354. * return wrapper
  4355. */
  4356. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4357. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4358. __Pyx_GOTREF(__pyx_t_4);
  4359. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  4360. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_cur_scope->__pyx_v_repetitions);
  4361. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  4362. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4363. __Pyx_GOTREF(__pyx_t_3);
  4364. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4365. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_repetitions_of); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4366. __Pyx_GOTREF(__pyx_t_4);
  4367. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4368. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4369. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4370. __Pyx_GOTREF(__pyx_t_3);
  4371. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4372. __Pyx_GOTREF(__pyx_t_1);
  4373. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4374. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4375. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4376. __Pyx_GOTREF(__pyx_t_3);
  4377. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4378. __pyx_t_1 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4379. __Pyx_GOTREF(__pyx_t_1);
  4380. __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4381. __Pyx_GOTREF(__pyx_t_4);
  4382. PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  4383. __Pyx_GIVEREF(__pyx_t_1);
  4384. __pyx_t_1 = 0;
  4385. __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4386. __Pyx_GOTREF(__pyx_t_1);
  4387. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4388. __pyx_t_4 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4389. __Pyx_GOTREF(__pyx_t_4);
  4390. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4391. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4392. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_s_sec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4393. __Pyx_GOTREF(__pyx_t_1);
  4394. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4395. if (__Pyx_PrintOne(0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4396. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4397. /* "lib/Naked/toolshed/c/benchmarking.pyx":135
  4398. * gc.collect()
  4399. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  4400. * return result # <<<<<<<<<<<<<<
  4401. * return wrapper
  4402. *
  4403. */
  4404. __Pyx_XDECREF(__pyx_r);
  4405. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4406. __Pyx_INCREF(__pyx_v_result);
  4407. __pyx_r = __pyx_v_result;
  4408. goto __pyx_L0;
  4409. /* "lib/Naked/toolshed/c/benchmarking.pyx":121
  4410. * def timer_1m(func, repetitions=1000000):
  4411. * @wraps(func)
  4412. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  4413. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4414. * sys.stdout.flush()
  4415. */
  4416. /* function exit code */
  4417. __pyx_L1_error:;
  4418. __Pyx_XDECREF(__pyx_t_1);
  4419. __Pyx_XDECREF(__pyx_t_2);
  4420. __Pyx_XDECREF(__pyx_t_3);
  4421. __Pyx_XDECREF(__pyx_t_4);
  4422. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4423. __pyx_r = NULL;
  4424. __pyx_L0:;
  4425. __Pyx_XDECREF(__pyx_v_start);
  4426. __Pyx_XDECREF(__pyx_v_x);
  4427. __Pyx_XDECREF(__pyx_v_result);
  4428. __Pyx_XDECREF(__pyx_v_end);
  4429. __Pyx_XGIVEREF(__pyx_r);
  4430. __Pyx_RefNannyFinishContext();
  4431. return __pyx_r;
  4432. }
  4433. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  4434. * return wrapper
  4435. *
  4436. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  4437. * @wraps(func)
  4438. * def wrapper(*args, **kwargs):
  4439. */
  4440. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_10timer_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions) {
  4441. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_cur_scope;
  4442. PyObject *__pyx_v_wrapper = 0;
  4443. PyObject *__pyx_r = NULL;
  4444. __Pyx_RefNannyDeclarations
  4445. PyObject *__pyx_t_1 = NULL;
  4446. PyObject *__pyx_t_2 = NULL;
  4447. PyObject *__pyx_t_3 = NULL;
  4448. int __pyx_lineno = 0;
  4449. const char *__pyx_filename = NULL;
  4450. int __pyx_clineno = 0;
  4451. __Pyx_RefNannySetupContext("timer_1m", 0);
  4452. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, __pyx_empty_tuple, NULL);
  4453. if (unlikely(!__pyx_cur_scope)) {
  4454. __Pyx_RefNannyFinishContext();
  4455. return NULL;
  4456. }
  4457. __Pyx_GOTREF(__pyx_cur_scope);
  4458. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  4459. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  4460. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  4461. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  4462. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  4463. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  4464. /* "lib/Naked/toolshed/c/benchmarking.pyx":120
  4465. *
  4466. * def timer_1m(func, repetitions=1000000):
  4467. * @wraps(func) # <<<<<<<<<<<<<<
  4468. * def wrapper(*args, **kwargs):
  4469. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4470. */
  4471. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4472. __Pyx_GOTREF(__pyx_t_1);
  4473. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4474. __Pyx_GOTREF(__pyx_t_2);
  4475. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  4476. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  4477. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  4478. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4479. __Pyx_GOTREF(__pyx_t_3);
  4480. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4481. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4482. /* "lib/Naked/toolshed/c/benchmarking.pyx":121
  4483. * def timer_1m(func, repetitions=1000000):
  4484. * @wraps(func)
  4485. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  4486. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4487. * sys.stdout.flush()
  4488. */
  4489. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_8timer_1m_1wrapper, 0, __pyx_n_s_timer_1m_locals_wrapper, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4490. __Pyx_GOTREF(__pyx_t_2);
  4491. /* "lib/Naked/toolshed/c/benchmarking.pyx":120
  4492. *
  4493. * def timer_1m(func, repetitions=1000000):
  4494. * @wraps(func) # <<<<<<<<<<<<<<
  4495. * def wrapper(*args, **kwargs):
  4496. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  4497. */
  4498. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4499. __Pyx_GOTREF(__pyx_t_1);
  4500. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  4501. __Pyx_GIVEREF(__pyx_t_2);
  4502. __pyx_t_2 = 0;
  4503. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4504. __Pyx_GOTREF(__pyx_t_2);
  4505. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4506. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4507. __pyx_v_wrapper = __pyx_t_2;
  4508. __pyx_t_2 = 0;
  4509. /* "lib/Naked/toolshed/c/benchmarking.pyx":136
  4510. * print(str(repetitions) + " repetitions of " + func.__name__ + " : " + str(end-start) + " sec")
  4511. * return result
  4512. * return wrapper # <<<<<<<<<<<<<<
  4513. *
  4514. * #------------------------------------------------------------------------------
  4515. */
  4516. __Pyx_XDECREF(__pyx_r);
  4517. __Pyx_INCREF(__pyx_v_wrapper);
  4518. __pyx_r = __pyx_v_wrapper;
  4519. goto __pyx_L0;
  4520. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  4521. * return wrapper
  4522. *
  4523. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  4524. * @wraps(func)
  4525. * def wrapper(*args, **kwargs):
  4526. */
  4527. /* function exit code */
  4528. __pyx_L1_error:;
  4529. __Pyx_XDECREF(__pyx_t_1);
  4530. __Pyx_XDECREF(__pyx_t_2);
  4531. __Pyx_XDECREF(__pyx_t_3);
  4532. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_1m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4533. __pyx_r = NULL;
  4534. __pyx_L0:;
  4535. __Pyx_XDECREF(__pyx_v_wrapper);
  4536. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  4537. __Pyx_XGIVEREF(__pyx_r);
  4538. __Pyx_RefNannyFinishContext();
  4539. return __pyx_r;
  4540. }
  4541. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  4542. * # def myfunction():
  4543. * #------------------------------------------------------------------------------
  4544. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  4545. * @wraps(func)
  4546. * def wrapper(*args, **kwargs):
  4547. */
  4548. /* Python wrapper */
  4549. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4550. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark = {__Pyx_NAMESTR("timer_trials_benchmark"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4551. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4552. PyObject *__pyx_v_func = 0;
  4553. PyObject *__pyx_v_repetitions = 0;
  4554. PyObject *__pyx_v_trials = 0;
  4555. int __pyx_lineno = 0;
  4556. const char *__pyx_filename = NULL;
  4557. int __pyx_clineno = 0;
  4558. PyObject *__pyx_r = 0;
  4559. __Pyx_RefNannyDeclarations
  4560. __Pyx_RefNannySetupContext("timer_trials_benchmark (wrapper)", 0);
  4561. {
  4562. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  4563. PyObject* values[3] = {0,0,0};
  4564. values[1] = ((PyObject *)__pyx_int_100000);
  4565. values[2] = ((PyObject *)__pyx_int_10);
  4566. if (unlikely(__pyx_kwds)) {
  4567. Py_ssize_t kw_args;
  4568. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4569. switch (pos_args) {
  4570. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4571. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4572. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4573. case 0: break;
  4574. default: goto __pyx_L5_argtuple_error;
  4575. }
  4576. kw_args = PyDict_Size(__pyx_kwds);
  4577. switch (pos_args) {
  4578. case 0:
  4579. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  4580. else goto __pyx_L5_argtuple_error;
  4581. case 1:
  4582. if (kw_args > 0) {
  4583. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  4584. if (value) { values[1] = value; kw_args--; }
  4585. }
  4586. case 2:
  4587. if (kw_args > 0) {
  4588. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  4589. if (value) { values[2] = value; kw_args--; }
  4590. }
  4591. }
  4592. if (unlikely(kw_args > 0)) {
  4593. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4594. }
  4595. } else {
  4596. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4597. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4598. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4599. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4600. break;
  4601. default: goto __pyx_L5_argtuple_error;
  4602. }
  4603. }
  4604. __pyx_v_func = values[0];
  4605. __pyx_v_repetitions = values[1];
  4606. __pyx_v_trials = values[2];
  4607. }
  4608. goto __pyx_L4_argument_unpacking_done;
  4609. __pyx_L5_argtuple_error:;
  4610. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  4611. __pyx_L3_error:;
  4612. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4613. __Pyx_RefNannyFinishContext();
  4614. return NULL;
  4615. __pyx_L4_argument_unpacking_done:;
  4616. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  4617. /* function exit code */
  4618. __Pyx_RefNannyFinishContext();
  4619. return __pyx_r;
  4620. }
  4621. /* "lib/Naked/toolshed/c/benchmarking.pyx":154
  4622. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  4623. * @wraps(func)
  4624. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  4625. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  4626. * sys.stdout.flush()
  4627. */
  4628. /* Python wrapper */
  4629. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4630. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  4631. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4632. PyObject *__pyx_v_args = 0;
  4633. PyObject *__pyx_v_kwargs = 0;
  4634. PyObject *__pyx_r = 0;
  4635. __Pyx_RefNannyDeclarations
  4636. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  4637. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  4638. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  4639. if (unlikely(!__pyx_v_kwargs)) return NULL;
  4640. __Pyx_GOTREF(__pyx_v_kwargs);
  4641. __Pyx_INCREF(__pyx_args);
  4642. __pyx_v_args = __pyx_args;
  4643. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  4644. /* function exit code */
  4645. __Pyx_XDECREF(__pyx_v_args);
  4646. __Pyx_XDECREF(__pyx_v_kwargs);
  4647. __Pyx_RefNannyFinishContext();
  4648. return __pyx_r;
  4649. }
  4650. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  4651. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope;
  4652. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_outer_scope;
  4653. PyObject *__pyx_v_result_list = NULL;
  4654. PyObject *__pyx_v_benchmark_list = NULL;
  4655. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  4656. PyObject *__pyx_v_start = NULL;
  4657. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  4658. PyObject *__pyx_v_end = NULL;
  4659. PyObject *__pyx_v_result = NULL;
  4660. PyObject *__pyx_v_L = NULL;
  4661. PyObject *__pyx_v_start2 = NULL;
  4662. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  4663. long __pyx_v_i;
  4664. PyObject *__pyx_v_end2 = NULL;
  4665. PyObject *__pyx_v_n = NULL;
  4666. PyObject *__pyx_v_run = NULL;
  4667. PyObject *__pyx_v_mean = NULL;
  4668. PyObject *__pyx_v_mean_benchmark = NULL;
  4669. PyObject *__pyx_v_np = NULL;
  4670. PyObject *__pyx_v_array = NULL;
  4671. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  4672. PyObject *__pyx_r = NULL;
  4673. __Pyx_RefNannyDeclarations
  4674. PyObject *__pyx_t_1 = NULL;
  4675. PyObject *__pyx_t_2 = NULL;
  4676. PyObject *__pyx_t_3 = NULL;
  4677. Py_ssize_t __pyx_t_4;
  4678. PyObject *(*__pyx_t_5)(PyObject *);
  4679. Py_ssize_t __pyx_t_6;
  4680. PyObject *(*__pyx_t_7)(PyObject *);
  4681. PyObject *__pyx_t_8 = NULL;
  4682. PyObject *__pyx_t_9 = NULL;
  4683. int __pyx_t_10;
  4684. long __pyx_t_11;
  4685. PyObject *__pyx_t_12 = NULL;
  4686. PyObject *__pyx_t_13 = NULL;
  4687. PyObject *__pyx_t_14 = NULL;
  4688. int __pyx_t_15;
  4689. int __pyx_lineno = 0;
  4690. const char *__pyx_filename = NULL;
  4691. int __pyx_clineno = 0;
  4692. __Pyx_RefNannySetupContext("wrapper", 0);
  4693. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *) __Pyx_CyFunction_GetClosure(__pyx_self);
  4694. __pyx_cur_scope = __pyx_outer_scope;
  4695. /* "lib/Naked/toolshed/c/benchmarking.pyx":155
  4696. * @wraps(func)
  4697. * def wrapper(*args, **kwargs):
  4698. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  4699. * sys.stdout.flush()
  4700. * result_list = []
  4701. */
  4702. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4703. __Pyx_GOTREF(__pyx_t_1);
  4704. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4705. __Pyx_GOTREF(__pyx_t_2);
  4706. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4707. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4708. __Pyx_GOTREF(__pyx_t_1);
  4709. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4710. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4711. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4712. __Pyx_GOTREF(__pyx_t_2);
  4713. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4714. __Pyx_GOTREF(__pyx_t_3);
  4715. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4716. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4717. __Pyx_GOTREF(__pyx_t_2);
  4718. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4719. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4720. __Pyx_GOTREF(__pyx_t_3);
  4721. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  4722. __Pyx_GIVEREF(__pyx_t_2);
  4723. __pyx_t_2 = 0;
  4724. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4725. __Pyx_GOTREF(__pyx_t_2);
  4726. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4727. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4728. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4729. /* "lib/Naked/toolshed/c/benchmarking.pyx":156
  4730. * def wrapper(*args, **kwargs):
  4731. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  4732. * sys.stdout.flush() # <<<<<<<<<<<<<<
  4733. * result_list = []
  4734. * benchmark_list = []
  4735. */
  4736. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4737. __Pyx_GOTREF(__pyx_t_2);
  4738. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4739. __Pyx_GOTREF(__pyx_t_3);
  4740. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4741. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4742. __Pyx_GOTREF(__pyx_t_2);
  4743. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4744. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4745. __Pyx_GOTREF(__pyx_t_3);
  4746. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4747. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4748. /* "lib/Naked/toolshed/c/benchmarking.pyx":157
  4749. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  4750. * sys.stdout.flush()
  4751. * result_list = [] # <<<<<<<<<<<<<<
  4752. * benchmark_list = []
  4753. * # disable garbage collection
  4754. */
  4755. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4756. __Pyx_GOTREF(__pyx_t_3);
  4757. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  4758. __pyx_t_3 = 0;
  4759. /* "lib/Naked/toolshed/c/benchmarking.pyx":158
  4760. * sys.stdout.flush()
  4761. * result_list = []
  4762. * benchmark_list = [] # <<<<<<<<<<<<<<
  4763. * # disable garbage collection
  4764. * gc.collect()
  4765. */
  4766. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4767. __Pyx_GOTREF(__pyx_t_3);
  4768. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  4769. __pyx_t_3 = 0;
  4770. /* "lib/Naked/toolshed/c/benchmarking.pyx":160
  4771. * benchmark_list = []
  4772. * # disable garbage collection
  4773. * gc.collect() # <<<<<<<<<<<<<<
  4774. * gc.disable()
  4775. * for x in range(trials):
  4776. */
  4777. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4778. __Pyx_GOTREF(__pyx_t_3);
  4779. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4780. __Pyx_GOTREF(__pyx_t_2);
  4781. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4782. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4783. __Pyx_GOTREF(__pyx_t_3);
  4784. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4785. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4786. /* "lib/Naked/toolshed/c/benchmarking.pyx":161
  4787. * # disable garbage collection
  4788. * gc.collect()
  4789. * gc.disable() # <<<<<<<<<<<<<<
  4790. * for x in range(trials):
  4791. * # test function
  4792. */
  4793. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4794. __Pyx_GOTREF(__pyx_t_3);
  4795. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4796. __Pyx_GOTREF(__pyx_t_2);
  4797. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4798. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4799. __Pyx_GOTREF(__pyx_t_3);
  4800. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4801. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4802. /* "lib/Naked/toolshed/c/benchmarking.pyx":162
  4803. * gc.collect()
  4804. * gc.disable()
  4805. * for x in range(trials): # <<<<<<<<<<<<<<
  4806. * # test function
  4807. * start = time.time()
  4808. */
  4809. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4810. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4811. __Pyx_GOTREF(__pyx_t_3);
  4812. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  4813. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  4814. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  4815. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4816. __Pyx_GOTREF(__pyx_t_2);
  4817. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4818. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  4819. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  4820. __pyx_t_5 = NULL;
  4821. } else {
  4822. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4823. __Pyx_GOTREF(__pyx_t_3);
  4824. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  4825. }
  4826. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4827. for (;;) {
  4828. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  4829. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  4830. #if CYTHON_COMPILING_IN_CPYTHON
  4831. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4832. #else
  4833. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4834. #endif
  4835. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  4836. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  4837. #if CYTHON_COMPILING_IN_CPYTHON
  4838. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4839. #else
  4840. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4841. #endif
  4842. } else {
  4843. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  4844. if (unlikely(!__pyx_t_2)) {
  4845. PyObject* exc_type = PyErr_Occurred();
  4846. if (exc_type) {
  4847. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  4848. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4849. }
  4850. break;
  4851. }
  4852. __Pyx_GOTREF(__pyx_t_2);
  4853. }
  4854. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  4855. __pyx_t_2 = 0;
  4856. /* "lib/Naked/toolshed/c/benchmarking.pyx":164
  4857. * for x in range(trials):
  4858. * # test function
  4859. * start = time.time() # <<<<<<<<<<<<<<
  4860. * for y in range(repetitions):
  4861. * func(*args, **kwargs)
  4862. */
  4863. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4864. __Pyx_GOTREF(__pyx_t_2);
  4865. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4866. __Pyx_GOTREF(__pyx_t_1);
  4867. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4868. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4869. __Pyx_GOTREF(__pyx_t_2);
  4870. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4871. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  4872. __pyx_t_2 = 0;
  4873. /* "lib/Naked/toolshed/c/benchmarking.pyx":165
  4874. * # test function
  4875. * start = time.time()
  4876. * for y in range(repetitions): # <<<<<<<<<<<<<<
  4877. * func(*args, **kwargs)
  4878. * end = time.time()
  4879. */
  4880. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4881. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4882. __Pyx_GOTREF(__pyx_t_2);
  4883. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  4884. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  4885. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  4886. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4887. __Pyx_GOTREF(__pyx_t_1);
  4888. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4889. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  4890. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  4891. __pyx_t_7 = NULL;
  4892. } else {
  4893. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4894. __Pyx_GOTREF(__pyx_t_2);
  4895. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  4896. }
  4897. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4898. for (;;) {
  4899. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  4900. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  4901. #if CYTHON_COMPILING_IN_CPYTHON
  4902. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4903. #else
  4904. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4905. #endif
  4906. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  4907. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  4908. #if CYTHON_COMPILING_IN_CPYTHON
  4909. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4910. #else
  4911. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4912. #endif
  4913. } else {
  4914. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  4915. if (unlikely(!__pyx_t_1)) {
  4916. PyObject* exc_type = PyErr_Occurred();
  4917. if (exc_type) {
  4918. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  4919. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4920. }
  4921. break;
  4922. }
  4923. __Pyx_GOTREF(__pyx_t_1);
  4924. }
  4925. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  4926. __pyx_t_1 = 0;
  4927. /* "lib/Naked/toolshed/c/benchmarking.pyx":166
  4928. * start = time.time()
  4929. * for y in range(repetitions):
  4930. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  4931. * end = time.time()
  4932. * result = func(*args, **kwargs)
  4933. */
  4934. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4935. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4936. __Pyx_GOTREF(__pyx_t_1);
  4937. __pyx_t_8 = __pyx_v_kwargs;
  4938. __Pyx_INCREF(__pyx_t_8);
  4939. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4940. __Pyx_GOTREF(__pyx_t_9);
  4941. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4942. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4943. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4944. }
  4945. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4946. /* "lib/Naked/toolshed/c/benchmarking.pyx":167
  4947. * for y in range(repetitions):
  4948. * func(*args, **kwargs)
  4949. * end = time.time() # <<<<<<<<<<<<<<
  4950. * result = func(*args, **kwargs)
  4951. * result_list.append(end-start)
  4952. */
  4953. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4954. __Pyx_GOTREF(__pyx_t_2);
  4955. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4956. __Pyx_GOTREF(__pyx_t_9);
  4957. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4958. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4959. __Pyx_GOTREF(__pyx_t_2);
  4960. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4961. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  4962. __pyx_t_2 = 0;
  4963. /* "lib/Naked/toolshed/c/benchmarking.pyx":168
  4964. * func(*args, **kwargs)
  4965. * end = time.time()
  4966. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  4967. * result_list.append(end-start)
  4968. * # benchmark function
  4969. */
  4970. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  4971. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4972. __Pyx_GOTREF(__pyx_t_2);
  4973. __pyx_t_9 = __pyx_v_kwargs;
  4974. __Pyx_INCREF(__pyx_t_9);
  4975. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4976. __Pyx_GOTREF(__pyx_t_8);
  4977. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4978. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4979. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  4980. __pyx_t_8 = 0;
  4981. /* "lib/Naked/toolshed/c/benchmarking.pyx":169
  4982. * end = time.time()
  4983. * result = func(*args, **kwargs)
  4984. * result_list.append(end-start) # <<<<<<<<<<<<<<
  4985. * # benchmark function
  4986. * L = []
  4987. */
  4988. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4989. __Pyx_GOTREF(__pyx_t_8);
  4990. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  4991. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4992. /* "lib/Naked/toolshed/c/benchmarking.pyx":171
  4993. * result_list.append(end-start)
  4994. * # benchmark function
  4995. * L = [] # <<<<<<<<<<<<<<
  4996. * start2 = time.time()
  4997. * for j in range(repetitions):
  4998. */
  4999. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5000. __Pyx_GOTREF(__pyx_t_8);
  5001. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  5002. __pyx_t_8 = 0;
  5003. /* "lib/Naked/toolshed/c/benchmarking.pyx":172
  5004. * # benchmark function
  5005. * L = []
  5006. * start2 = time.time() # <<<<<<<<<<<<<<
  5007. * for j in range(repetitions):
  5008. * for i in range(10):
  5009. */
  5010. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5011. __Pyx_GOTREF(__pyx_t_8);
  5012. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5013. __Pyx_GOTREF(__pyx_t_9);
  5014. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5015. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5016. __Pyx_GOTREF(__pyx_t_8);
  5017. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5018. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  5019. __pyx_t_8 = 0;
  5020. /* "lib/Naked/toolshed/c/benchmarking.pyx":173
  5021. * L = []
  5022. * start2 = time.time()
  5023. * for j in range(repetitions): # <<<<<<<<<<<<<<
  5024. * for i in range(10):
  5025. * L.append(i)
  5026. */
  5027. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5028. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5029. __Pyx_GOTREF(__pyx_t_8);
  5030. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  5031. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  5032. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  5033. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5034. __Pyx_GOTREF(__pyx_t_9);
  5035. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5036. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  5037. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  5038. __pyx_t_7 = NULL;
  5039. } else {
  5040. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5041. __Pyx_GOTREF(__pyx_t_8);
  5042. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  5043. }
  5044. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5045. for (;;) {
  5046. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  5047. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  5048. #if CYTHON_COMPILING_IN_CPYTHON
  5049. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5050. #else
  5051. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5052. #endif
  5053. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  5054. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  5055. #if CYTHON_COMPILING_IN_CPYTHON
  5056. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5057. #else
  5058. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5059. #endif
  5060. } else {
  5061. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  5062. if (unlikely(!__pyx_t_9)) {
  5063. PyObject* exc_type = PyErr_Occurred();
  5064. if (exc_type) {
  5065. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  5066. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5067. }
  5068. break;
  5069. }
  5070. __Pyx_GOTREF(__pyx_t_9);
  5071. }
  5072. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  5073. __pyx_t_9 = 0;
  5074. /* "lib/Naked/toolshed/c/benchmarking.pyx":174
  5075. * start2 = time.time()
  5076. * for j in range(repetitions):
  5077. * for i in range(10): # <<<<<<<<<<<<<<
  5078. * L.append(i)
  5079. * end2 = time.time()
  5080. */
  5081. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  5082. __pyx_v_i = __pyx_t_11;
  5083. /* "lib/Naked/toolshed/c/benchmarking.pyx":175
  5084. * for j in range(repetitions):
  5085. * for i in range(10):
  5086. * L.append(i) # <<<<<<<<<<<<<<
  5087. * end2 = time.time()
  5088. * benchmark_list.append(end2 - start2)
  5089. */
  5090. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5091. __Pyx_GOTREF(__pyx_t_9);
  5092. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5093. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5094. }
  5095. }
  5096. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5097. /* "lib/Naked/toolshed/c/benchmarking.pyx":176
  5098. * for i in range(10):
  5099. * L.append(i)
  5100. * end2 = time.time() # <<<<<<<<<<<<<<
  5101. * benchmark_list.append(end2 - start2)
  5102. * sys.stdout.write(".")
  5103. */
  5104. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5105. __Pyx_GOTREF(__pyx_t_8);
  5106. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5107. __Pyx_GOTREF(__pyx_t_9);
  5108. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5109. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5110. __Pyx_GOTREF(__pyx_t_8);
  5111. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5112. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  5113. __pyx_t_8 = 0;
  5114. /* "lib/Naked/toolshed/c/benchmarking.pyx":177
  5115. * L.append(i)
  5116. * end2 = time.time()
  5117. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  5118. * sys.stdout.write(".")
  5119. * sys.stdout.flush()
  5120. */
  5121. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5122. __Pyx_GOTREF(__pyx_t_8);
  5123. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5124. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5125. /* "lib/Naked/toolshed/c/benchmarking.pyx":178
  5126. * end2 = time.time()
  5127. * benchmark_list.append(end2 - start2)
  5128. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  5129. * sys.stdout.flush()
  5130. * gc.enable() # re-enable garbage collection
  5131. */
  5132. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5133. __Pyx_GOTREF(__pyx_t_8);
  5134. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5135. __Pyx_GOTREF(__pyx_t_9);
  5136. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5137. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5138. __Pyx_GOTREF(__pyx_t_8);
  5139. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5140. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5141. __Pyx_GOTREF(__pyx_t_9);
  5142. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5143. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5144. /* "lib/Naked/toolshed/c/benchmarking.pyx":179
  5145. * benchmark_list.append(end2 - start2)
  5146. * sys.stdout.write(".")
  5147. * sys.stdout.flush() # <<<<<<<<<<<<<<
  5148. * gc.enable() # re-enable garbage collection
  5149. * gc.collect()
  5150. */
  5151. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5152. __Pyx_GOTREF(__pyx_t_9);
  5153. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5154. __Pyx_GOTREF(__pyx_t_8);
  5155. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5156. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5157. __Pyx_GOTREF(__pyx_t_9);
  5158. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5159. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5160. __Pyx_GOTREF(__pyx_t_8);
  5161. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5162. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5163. }
  5164. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5165. /* "lib/Naked/toolshed/c/benchmarking.pyx":180
  5166. * sys.stdout.write(".")
  5167. * sys.stdout.flush()
  5168. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  5169. * gc.collect()
  5170. * print(" ")
  5171. */
  5172. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5173. __Pyx_GOTREF(__pyx_t_3);
  5174. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5175. __Pyx_GOTREF(__pyx_t_8);
  5176. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5177. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5178. __Pyx_GOTREF(__pyx_t_3);
  5179. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5180. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5181. /* "lib/Naked/toolshed/c/benchmarking.pyx":181
  5182. * sys.stdout.flush()
  5183. * gc.enable() # re-enable garbage collection
  5184. * gc.collect() # <<<<<<<<<<<<<<
  5185. * print(" ")
  5186. * n = 1
  5187. */
  5188. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5189. __Pyx_GOTREF(__pyx_t_3);
  5190. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5191. __Pyx_GOTREF(__pyx_t_8);
  5192. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5193. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5194. __Pyx_GOTREF(__pyx_t_3);
  5195. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5196. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5197. /* "lib/Naked/toolshed/c/benchmarking.pyx":182
  5198. * gc.enable() # re-enable garbage collection
  5199. * gc.collect()
  5200. * print(" ") # <<<<<<<<<<<<<<
  5201. * n = 1
  5202. * for run in result_list:
  5203. */
  5204. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5205. /* "lib/Naked/toolshed/c/benchmarking.pyx":183
  5206. * gc.collect()
  5207. * print(" ")
  5208. * n = 1 # <<<<<<<<<<<<<<
  5209. * for run in result_list:
  5210. * print("Trial " + str(n) + ":\t" + str(run))
  5211. */
  5212. __Pyx_INCREF(__pyx_int_1);
  5213. __pyx_v_n = __pyx_int_1;
  5214. /* "lib/Naked/toolshed/c/benchmarking.pyx":184
  5215. * print(" ")
  5216. * n = 1
  5217. * for run in result_list: # <<<<<<<<<<<<<<
  5218. * print("Trial " + str(n) + ":\t" + str(run))
  5219. * n += 1
  5220. */
  5221. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  5222. for (;;) {
  5223. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  5224. #if CYTHON_COMPILING_IN_CPYTHON
  5225. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5226. #else
  5227. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5228. #endif
  5229. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  5230. __pyx_t_8 = 0;
  5231. /* "lib/Naked/toolshed/c/benchmarking.pyx":185
  5232. * n = 1
  5233. * for run in result_list:
  5234. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  5235. * n += 1
  5236. * print("-"*50)
  5237. */
  5238. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5239. __Pyx_GOTREF(__pyx_t_8);
  5240. __Pyx_INCREF(__pyx_v_n);
  5241. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  5242. __Pyx_GIVEREF(__pyx_v_n);
  5243. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5244. __Pyx_GOTREF(__pyx_t_9);
  5245. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5246. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5247. __Pyx_GOTREF(__pyx_t_8);
  5248. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5249. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5250. __Pyx_GOTREF(__pyx_t_9);
  5251. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5252. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5253. __Pyx_GOTREF(__pyx_t_8);
  5254. __Pyx_INCREF(__pyx_v_run);
  5255. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  5256. __Pyx_GIVEREF(__pyx_v_run);
  5257. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5258. __Pyx_GOTREF(__pyx_t_2);
  5259. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5260. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5261. __Pyx_GOTREF(__pyx_t_8);
  5262. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  5263. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5264. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5265. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5266. /* "lib/Naked/toolshed/c/benchmarking.pyx":186
  5267. * for run in result_list:
  5268. * print("Trial " + str(n) + ":\t" + str(run))
  5269. * n += 1 # <<<<<<<<<<<<<<
  5270. * print("-"*50)
  5271. * mean = sum(result_list)/len(result_list)
  5272. */
  5273. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5274. __Pyx_GOTREF(__pyx_t_8);
  5275. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  5276. __pyx_t_8 = 0;
  5277. }
  5278. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5279. /* "lib/Naked/toolshed/c/benchmarking.pyx":187
  5280. * print("Trial " + str(n) + ":\t" + str(run))
  5281. * n += 1
  5282. * print("-"*50) # <<<<<<<<<<<<<<
  5283. * mean = sum(result_list)/len(result_list)
  5284. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  5285. */
  5286. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5287. __Pyx_GOTREF(__pyx_t_3);
  5288. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5289. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5290. /* "lib/Naked/toolshed/c/benchmarking.pyx":188
  5291. * n += 1
  5292. * print("-"*50)
  5293. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  5294. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  5295. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  5296. */
  5297. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5298. __Pyx_GOTREF(__pyx_t_3);
  5299. __Pyx_INCREF(__pyx_v_result_list);
  5300. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  5301. __Pyx_GIVEREF(__pyx_v_result_list);
  5302. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5303. __Pyx_GOTREF(__pyx_t_8);
  5304. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5305. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5306. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5307. __Pyx_GOTREF(__pyx_t_3);
  5308. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5309. __Pyx_GOTREF(__pyx_t_2);
  5310. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5311. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5312. __pyx_v_mean = __pyx_t_2;
  5313. __pyx_t_2 = 0;
  5314. /* "lib/Naked/toolshed/c/benchmarking.pyx":189
  5315. * print("-"*50)
  5316. * mean = sum(result_list)/len(result_list)
  5317. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  5318. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  5319. * try:
  5320. */
  5321. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5322. __Pyx_GOTREF(__pyx_t_2);
  5323. __Pyx_INCREF(__pyx_v_benchmark_list);
  5324. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  5325. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  5326. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5327. __Pyx_GOTREF(__pyx_t_3);
  5328. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5329. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5330. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5331. __Pyx_GOTREF(__pyx_t_2);
  5332. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 189; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5333. __Pyx_GOTREF(__pyx_t_8);
  5334. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5335. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5336. __pyx_v_mean_benchmark = __pyx_t_8;
  5337. __pyx_t_8 = 0;
  5338. /* "lib/Naked/toolshed/c/benchmarking.pyx":190
  5339. * mean = sum(result_list)/len(result_list)
  5340. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  5341. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  5342. * try:
  5343. * import numpy as np
  5344. */
  5345. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5346. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5347. __Pyx_GOTREF(__pyx_t_8);
  5348. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  5349. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  5350. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  5351. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5352. __Pyx_GOTREF(__pyx_t_2);
  5353. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5354. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5355. __Pyx_GOTREF(__pyx_t_8);
  5356. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5357. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5358. __Pyx_GOTREF(__pyx_t_2);
  5359. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5360. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5361. __Pyx_GOTREF(__pyx_t_8);
  5362. __Pyx_INCREF(__pyx_v_mean);
  5363. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  5364. __Pyx_GIVEREF(__pyx_v_mean);
  5365. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5366. __Pyx_GOTREF(__pyx_t_3);
  5367. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5368. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5369. __Pyx_GOTREF(__pyx_t_8);
  5370. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5371. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5372. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5373. __Pyx_GOTREF(__pyx_t_3);
  5374. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5375. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5376. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5377. /* "lib/Naked/toolshed/c/benchmarking.pyx":191
  5378. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  5379. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  5380. * try: # <<<<<<<<<<<<<<
  5381. * import numpy as np
  5382. * array = np.array(result_list)
  5383. */
  5384. {
  5385. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  5386. __Pyx_XGOTREF(__pyx_t_12);
  5387. __Pyx_XGOTREF(__pyx_t_13);
  5388. __Pyx_XGOTREF(__pyx_t_14);
  5389. /*try:*/ {
  5390. /* "lib/Naked/toolshed/c/benchmarking.pyx":192
  5391. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  5392. * try:
  5393. * import numpy as np # <<<<<<<<<<<<<<
  5394. * array = np.array(result_list)
  5395. * print( "Standard Deviation: " + str(np.std(array)))
  5396. */
  5397. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5398. __Pyx_GOTREF(__pyx_t_3);
  5399. __pyx_v_np = __pyx_t_3;
  5400. __pyx_t_3 = 0;
  5401. /* "lib/Naked/toolshed/c/benchmarking.pyx":193
  5402. * try:
  5403. * import numpy as np
  5404. * array = np.array(result_list) # <<<<<<<<<<<<<<
  5405. * print( "Standard Deviation: " + str(np.std(array)))
  5406. * except ImportError as ie:
  5407. */
  5408. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5409. __Pyx_GOTREF(__pyx_t_3);
  5410. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5411. __Pyx_GOTREF(__pyx_t_8);
  5412. __Pyx_INCREF(__pyx_v_result_list);
  5413. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  5414. __Pyx_GIVEREF(__pyx_v_result_list);
  5415. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5416. __Pyx_GOTREF(__pyx_t_2);
  5417. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5418. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5419. __pyx_v_array = __pyx_t_2;
  5420. __pyx_t_2 = 0;
  5421. /* "lib/Naked/toolshed/c/benchmarking.pyx":194
  5422. * import numpy as np
  5423. * array = np.array(result_list)
  5424. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  5425. * except ImportError as ie:
  5426. * pass
  5427. */
  5428. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5429. __Pyx_GOTREF(__pyx_t_2);
  5430. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5431. __Pyx_GOTREF(__pyx_t_8);
  5432. __Pyx_INCREF(__pyx_v_array);
  5433. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  5434. __Pyx_GIVEREF(__pyx_v_array);
  5435. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5436. __Pyx_GOTREF(__pyx_t_3);
  5437. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5438. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5439. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5440. __Pyx_GOTREF(__pyx_t_8);
  5441. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  5442. __Pyx_GIVEREF(__pyx_t_3);
  5443. __pyx_t_3 = 0;
  5444. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5445. __Pyx_GOTREF(__pyx_t_3);
  5446. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5447. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5448. __Pyx_GOTREF(__pyx_t_8);
  5449. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5450. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  5451. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5452. }
  5453. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  5454. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  5455. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  5456. goto __pyx_L20_try_end;
  5457. __pyx_L13_error:;
  5458. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  5459. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  5460. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5461. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  5462. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  5463. /* "lib/Naked/toolshed/c/benchmarking.pyx":195
  5464. * array = np.array(result_list)
  5465. * print( "Standard Deviation: " + str(np.std(array)))
  5466. * except ImportError as ie: # <<<<<<<<<<<<<<
  5467. * pass
  5468. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  5469. */
  5470. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  5471. if (__pyx_t_15) {
  5472. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5473. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  5474. __Pyx_GOTREF(__pyx_t_8);
  5475. __Pyx_GOTREF(__pyx_t_3);
  5476. __Pyx_GOTREF(__pyx_t_2);
  5477. __Pyx_INCREF(__pyx_t_3);
  5478. __pyx_v_ie = __pyx_t_3;
  5479. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5480. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5481. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5482. goto __pyx_L14_exception_handled;
  5483. }
  5484. goto __pyx_L15_except_error;
  5485. __pyx_L15_except_error:;
  5486. __Pyx_XGIVEREF(__pyx_t_12);
  5487. __Pyx_XGIVEREF(__pyx_t_13);
  5488. __Pyx_XGIVEREF(__pyx_t_14);
  5489. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  5490. goto __pyx_L1_error;
  5491. __pyx_L14_exception_handled:;
  5492. __Pyx_XGIVEREF(__pyx_t_12);
  5493. __Pyx_XGIVEREF(__pyx_t_13);
  5494. __Pyx_XGIVEREF(__pyx_t_14);
  5495. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  5496. __pyx_L20_try_end:;
  5497. }
  5498. /* "lib/Naked/toolshed/c/benchmarking.pyx":197
  5499. * except ImportError as ie:
  5500. * pass
  5501. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  5502. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  5503. * print("Ratio: " + str(mean/mean_benchmark))
  5504. */
  5505. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5506. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5507. __Pyx_GOTREF(__pyx_t_2);
  5508. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5509. __Pyx_GOTREF(__pyx_t_3);
  5510. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  5511. __Pyx_GIVEREF(__pyx_t_2);
  5512. __pyx_t_2 = 0;
  5513. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5514. __Pyx_GOTREF(__pyx_t_2);
  5515. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5516. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5517. __Pyx_GOTREF(__pyx_t_3);
  5518. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5519. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5520. __Pyx_GOTREF(__pyx_t_2);
  5521. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5522. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5523. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5524. /* "lib/Naked/toolshed/c/benchmarking.pyx":198
  5525. * pass
  5526. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  5527. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  5528. * print("Ratio: " + str(mean/mean_benchmark))
  5529. * return result
  5530. */
  5531. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5532. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5533. __Pyx_GOTREF(__pyx_t_2);
  5534. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  5535. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  5536. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  5537. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5538. __Pyx_GOTREF(__pyx_t_3);
  5539. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5540. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5541. __Pyx_GOTREF(__pyx_t_2);
  5542. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5543. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5544. __Pyx_GOTREF(__pyx_t_3);
  5545. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5546. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5547. __Pyx_GOTREF(__pyx_t_2);
  5548. __Pyx_INCREF(__pyx_v_mean_benchmark);
  5549. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  5550. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  5551. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5552. __Pyx_GOTREF(__pyx_t_8);
  5553. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5554. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5555. __Pyx_GOTREF(__pyx_t_2);
  5556. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5557. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5558. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5559. __Pyx_GOTREF(__pyx_t_8);
  5560. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5561. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5562. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5563. /* "lib/Naked/toolshed/c/benchmarking.pyx":199
  5564. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  5565. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  5566. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  5567. * return result
  5568. * return wrapper
  5569. */
  5570. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5571. __Pyx_GOTREF(__pyx_t_8);
  5572. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5573. __Pyx_GOTREF(__pyx_t_2);
  5574. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  5575. __Pyx_GIVEREF(__pyx_t_8);
  5576. __pyx_t_8 = 0;
  5577. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5578. __Pyx_GOTREF(__pyx_t_8);
  5579. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5580. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5581. __Pyx_GOTREF(__pyx_t_2);
  5582. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  5583. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5584. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5585. /* "lib/Naked/toolshed/c/benchmarking.pyx":200
  5586. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  5587. * print("Ratio: " + str(mean/mean_benchmark))
  5588. * return result # <<<<<<<<<<<<<<
  5589. * return wrapper
  5590. *
  5591. */
  5592. __Pyx_XDECREF(__pyx_r);
  5593. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5594. __Pyx_INCREF(__pyx_v_result);
  5595. __pyx_r = __pyx_v_result;
  5596. goto __pyx_L0;
  5597. /* "lib/Naked/toolshed/c/benchmarking.pyx":154
  5598. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  5599. * @wraps(func)
  5600. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  5601. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5602. * sys.stdout.flush()
  5603. */
  5604. /* function exit code */
  5605. __pyx_L1_error:;
  5606. __Pyx_XDECREF(__pyx_t_1);
  5607. __Pyx_XDECREF(__pyx_t_2);
  5608. __Pyx_XDECREF(__pyx_t_3);
  5609. __Pyx_XDECREF(__pyx_t_8);
  5610. __Pyx_XDECREF(__pyx_t_9);
  5611. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5612. __pyx_r = NULL;
  5613. __pyx_L0:;
  5614. __Pyx_XDECREF(__pyx_v_result_list);
  5615. __Pyx_XDECREF(__pyx_v_benchmark_list);
  5616. __Pyx_XDECREF(__pyx_v_x);
  5617. __Pyx_XDECREF(__pyx_v_start);
  5618. __Pyx_XDECREF(__pyx_v_y);
  5619. __Pyx_XDECREF(__pyx_v_end);
  5620. __Pyx_XDECREF(__pyx_v_result);
  5621. __Pyx_XDECREF(__pyx_v_L);
  5622. __Pyx_XDECREF(__pyx_v_start2);
  5623. __Pyx_XDECREF(__pyx_v_j);
  5624. __Pyx_XDECREF(__pyx_v_end2);
  5625. __Pyx_XDECREF(__pyx_v_n);
  5626. __Pyx_XDECREF(__pyx_v_run);
  5627. __Pyx_XDECREF(__pyx_v_mean);
  5628. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  5629. __Pyx_XDECREF(__pyx_v_np);
  5630. __Pyx_XDECREF(__pyx_v_array);
  5631. __Pyx_XDECREF(__pyx_v_ie);
  5632. __Pyx_XGIVEREF(__pyx_r);
  5633. __Pyx_RefNannyFinishContext();
  5634. return __pyx_r;
  5635. }
  5636. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  5637. * # def myfunction():
  5638. * #------------------------------------------------------------------------------
  5639. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  5640. * @wraps(func)
  5641. * def wrapper(*args, **kwargs):
  5642. */
  5643. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_12timer_trials_benchmark(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  5644. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_cur_scope;
  5645. PyObject *__pyx_v_wrapper = 0;
  5646. PyObject *__pyx_r = NULL;
  5647. __Pyx_RefNannyDeclarations
  5648. PyObject *__pyx_t_1 = NULL;
  5649. PyObject *__pyx_t_2 = NULL;
  5650. PyObject *__pyx_t_3 = NULL;
  5651. int __pyx_lineno = 0;
  5652. const char *__pyx_filename = NULL;
  5653. int __pyx_clineno = 0;
  5654. __Pyx_RefNannySetupContext("timer_trials_benchmark", 0);
  5655. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, __pyx_empty_tuple, NULL);
  5656. if (unlikely(!__pyx_cur_scope)) {
  5657. __Pyx_RefNannyFinishContext();
  5658. return NULL;
  5659. }
  5660. __Pyx_GOTREF(__pyx_cur_scope);
  5661. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  5662. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  5663. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  5664. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  5665. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  5666. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  5667. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  5668. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  5669. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  5670. /* "lib/Naked/toolshed/c/benchmarking.pyx":153
  5671. * #------------------------------------------------------------------------------
  5672. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  5673. * @wraps(func) # <<<<<<<<<<<<<<
  5674. * def wrapper(*args, **kwargs):
  5675. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5676. */
  5677. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5678. __Pyx_GOTREF(__pyx_t_1);
  5679. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5680. __Pyx_GOTREF(__pyx_t_2);
  5681. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  5682. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  5683. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  5684. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5685. __Pyx_GOTREF(__pyx_t_3);
  5686. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5687. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5688. /* "lib/Naked/toolshed/c/benchmarking.pyx":154
  5689. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  5690. * @wraps(func)
  5691. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  5692. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5693. * sys.stdout.flush()
  5694. */
  5695. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_locals_wr, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5696. __Pyx_GOTREF(__pyx_t_2);
  5697. /* "lib/Naked/toolshed/c/benchmarking.pyx":153
  5698. * #------------------------------------------------------------------------------
  5699. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  5700. * @wraps(func) # <<<<<<<<<<<<<<
  5701. * def wrapper(*args, **kwargs):
  5702. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5703. */
  5704. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5705. __Pyx_GOTREF(__pyx_t_1);
  5706. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  5707. __Pyx_GIVEREF(__pyx_t_2);
  5708. __pyx_t_2 = 0;
  5709. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5710. __Pyx_GOTREF(__pyx_t_2);
  5711. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5712. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5713. __pyx_v_wrapper = __pyx_t_2;
  5714. __pyx_t_2 = 0;
  5715. /* "lib/Naked/toolshed/c/benchmarking.pyx":201
  5716. * print("Ratio: " + str(mean/mean_benchmark))
  5717. * return result
  5718. * return wrapper # <<<<<<<<<<<<<<
  5719. *
  5720. * #------------------------------------------------------------------------------
  5721. */
  5722. __Pyx_XDECREF(__pyx_r);
  5723. __Pyx_INCREF(__pyx_v_wrapper);
  5724. __pyx_r = __pyx_v_wrapper;
  5725. goto __pyx_L0;
  5726. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  5727. * # def myfunction():
  5728. * #------------------------------------------------------------------------------
  5729. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  5730. * @wraps(func)
  5731. * def wrapper(*args, **kwargs):
  5732. */
  5733. /* function exit code */
  5734. __pyx_L1_error:;
  5735. __Pyx_XDECREF(__pyx_t_1);
  5736. __Pyx_XDECREF(__pyx_t_2);
  5737. __Pyx_XDECREF(__pyx_t_3);
  5738. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5739. __pyx_r = NULL;
  5740. __pyx_L0:;
  5741. __Pyx_XDECREF(__pyx_v_wrapper);
  5742. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  5743. __Pyx_XGIVEREF(__pyx_r);
  5744. __Pyx_RefNannyFinishContext();
  5745. return __pyx_r;
  5746. }
  5747. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  5748. * # additional benchmark decorators that replicate the above function with different # repetitions
  5749. * #------------------------------------------------------------------------------
  5750. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  5751. * @wraps(func)
  5752. * def wrapper(*args, **kwargs):
  5753. */
  5754. /* Python wrapper */
  5755. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5756. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10 = {__Pyx_NAMESTR("timer_trials_benchmark_10"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  5757. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5758. PyObject *__pyx_v_func = 0;
  5759. PyObject *__pyx_v_repetitions = 0;
  5760. PyObject *__pyx_v_trials = 0;
  5761. int __pyx_lineno = 0;
  5762. const char *__pyx_filename = NULL;
  5763. int __pyx_clineno = 0;
  5764. PyObject *__pyx_r = 0;
  5765. __Pyx_RefNannyDeclarations
  5766. __Pyx_RefNannySetupContext("timer_trials_benchmark_10 (wrapper)", 0);
  5767. {
  5768. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  5769. PyObject* values[3] = {0,0,0};
  5770. values[1] = ((PyObject *)__pyx_int_10);
  5771. values[2] = ((PyObject *)__pyx_int_10);
  5772. if (unlikely(__pyx_kwds)) {
  5773. Py_ssize_t kw_args;
  5774. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5775. switch (pos_args) {
  5776. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  5777. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5778. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5779. case 0: break;
  5780. default: goto __pyx_L5_argtuple_error;
  5781. }
  5782. kw_args = PyDict_Size(__pyx_kwds);
  5783. switch (pos_args) {
  5784. case 0:
  5785. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  5786. else goto __pyx_L5_argtuple_error;
  5787. case 1:
  5788. if (kw_args > 0) {
  5789. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  5790. if (value) { values[1] = value; kw_args--; }
  5791. }
  5792. case 2:
  5793. if (kw_args > 0) {
  5794. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  5795. if (value) { values[2] = value; kw_args--; }
  5796. }
  5797. }
  5798. if (unlikely(kw_args > 0)) {
  5799. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5800. }
  5801. } else {
  5802. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5803. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  5804. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5805. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5806. break;
  5807. default: goto __pyx_L5_argtuple_error;
  5808. }
  5809. }
  5810. __pyx_v_func = values[0];
  5811. __pyx_v_repetitions = values[1];
  5812. __pyx_v_trials = values[2];
  5813. }
  5814. goto __pyx_L4_argument_unpacking_done;
  5815. __pyx_L5_argtuple_error:;
  5816. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  5817. __pyx_L3_error:;
  5818. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5819. __Pyx_RefNannyFinishContext();
  5820. return NULL;
  5821. __pyx_L4_argument_unpacking_done:;
  5822. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  5823. /* function exit code */
  5824. __Pyx_RefNannyFinishContext();
  5825. return __pyx_r;
  5826. }
  5827. /* "lib/Naked/toolshed/c/benchmarking.pyx":209
  5828. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  5829. * @wraps(func)
  5830. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  5831. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5832. * sys.stdout.flush()
  5833. */
  5834. /* Python wrapper */
  5835. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5836. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  5837. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5838. PyObject *__pyx_v_args = 0;
  5839. PyObject *__pyx_v_kwargs = 0;
  5840. PyObject *__pyx_r = 0;
  5841. __Pyx_RefNannyDeclarations
  5842. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  5843. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  5844. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  5845. if (unlikely(!__pyx_v_kwargs)) return NULL;
  5846. __Pyx_GOTREF(__pyx_v_kwargs);
  5847. __Pyx_INCREF(__pyx_args);
  5848. __pyx_v_args = __pyx_args;
  5849. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  5850. /* function exit code */
  5851. __Pyx_XDECREF(__pyx_v_args);
  5852. __Pyx_XDECREF(__pyx_v_kwargs);
  5853. __Pyx_RefNannyFinishContext();
  5854. return __pyx_r;
  5855. }
  5856. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  5857. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope;
  5858. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_outer_scope;
  5859. PyObject *__pyx_v_result_list = NULL;
  5860. PyObject *__pyx_v_benchmark_list = NULL;
  5861. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  5862. PyObject *__pyx_v_start = NULL;
  5863. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  5864. PyObject *__pyx_v_end = NULL;
  5865. PyObject *__pyx_v_result = NULL;
  5866. PyObject *__pyx_v_L = NULL;
  5867. PyObject *__pyx_v_start2 = NULL;
  5868. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  5869. long __pyx_v_i;
  5870. PyObject *__pyx_v_end2 = NULL;
  5871. PyObject *__pyx_v_n = NULL;
  5872. PyObject *__pyx_v_run = NULL;
  5873. PyObject *__pyx_v_mean = NULL;
  5874. PyObject *__pyx_v_mean_benchmark = NULL;
  5875. PyObject *__pyx_v_np = NULL;
  5876. PyObject *__pyx_v_array = NULL;
  5877. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  5878. PyObject *__pyx_r = NULL;
  5879. __Pyx_RefNannyDeclarations
  5880. PyObject *__pyx_t_1 = NULL;
  5881. PyObject *__pyx_t_2 = NULL;
  5882. PyObject *__pyx_t_3 = NULL;
  5883. Py_ssize_t __pyx_t_4;
  5884. PyObject *(*__pyx_t_5)(PyObject *);
  5885. Py_ssize_t __pyx_t_6;
  5886. PyObject *(*__pyx_t_7)(PyObject *);
  5887. PyObject *__pyx_t_8 = NULL;
  5888. PyObject *__pyx_t_9 = NULL;
  5889. int __pyx_t_10;
  5890. long __pyx_t_11;
  5891. PyObject *__pyx_t_12 = NULL;
  5892. PyObject *__pyx_t_13 = NULL;
  5893. PyObject *__pyx_t_14 = NULL;
  5894. int __pyx_t_15;
  5895. int __pyx_lineno = 0;
  5896. const char *__pyx_filename = NULL;
  5897. int __pyx_clineno = 0;
  5898. __Pyx_RefNannySetupContext("wrapper", 0);
  5899. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *) __Pyx_CyFunction_GetClosure(__pyx_self);
  5900. __pyx_cur_scope = __pyx_outer_scope;
  5901. /* "lib/Naked/toolshed/c/benchmarking.pyx":210
  5902. * @wraps(func)
  5903. * def wrapper(*args, **kwargs):
  5904. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  5905. * sys.stdout.flush()
  5906. * result_list = []
  5907. */
  5908. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5909. __Pyx_GOTREF(__pyx_t_1);
  5910. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5911. __Pyx_GOTREF(__pyx_t_2);
  5912. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5913. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5914. __Pyx_GOTREF(__pyx_t_1);
  5915. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5916. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  5917. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5918. __Pyx_GOTREF(__pyx_t_2);
  5919. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5920. __Pyx_GOTREF(__pyx_t_3);
  5921. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5922. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5923. __Pyx_GOTREF(__pyx_t_2);
  5924. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5925. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5926. __Pyx_GOTREF(__pyx_t_3);
  5927. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  5928. __Pyx_GIVEREF(__pyx_t_2);
  5929. __pyx_t_2 = 0;
  5930. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5931. __Pyx_GOTREF(__pyx_t_2);
  5932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5934. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5935. /* "lib/Naked/toolshed/c/benchmarking.pyx":211
  5936. * def wrapper(*args, **kwargs):
  5937. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5938. * sys.stdout.flush() # <<<<<<<<<<<<<<
  5939. * result_list = []
  5940. * benchmark_list = []
  5941. */
  5942. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5943. __Pyx_GOTREF(__pyx_t_2);
  5944. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5945. __Pyx_GOTREF(__pyx_t_3);
  5946. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5947. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5948. __Pyx_GOTREF(__pyx_t_2);
  5949. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5950. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5951. __Pyx_GOTREF(__pyx_t_3);
  5952. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5953. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5954. /* "lib/Naked/toolshed/c/benchmarking.pyx":212
  5955. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  5956. * sys.stdout.flush()
  5957. * result_list = [] # <<<<<<<<<<<<<<
  5958. * benchmark_list = []
  5959. * # disable garbage collection
  5960. */
  5961. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5962. __Pyx_GOTREF(__pyx_t_3);
  5963. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  5964. __pyx_t_3 = 0;
  5965. /* "lib/Naked/toolshed/c/benchmarking.pyx":213
  5966. * sys.stdout.flush()
  5967. * result_list = []
  5968. * benchmark_list = [] # <<<<<<<<<<<<<<
  5969. * # disable garbage collection
  5970. * gc.collect()
  5971. */
  5972. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5973. __Pyx_GOTREF(__pyx_t_3);
  5974. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  5975. __pyx_t_3 = 0;
  5976. /* "lib/Naked/toolshed/c/benchmarking.pyx":215
  5977. * benchmark_list = []
  5978. * # disable garbage collection
  5979. * gc.collect() # <<<<<<<<<<<<<<
  5980. * gc.disable()
  5981. * for x in range(trials):
  5982. */
  5983. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5984. __Pyx_GOTREF(__pyx_t_3);
  5985. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5986. __Pyx_GOTREF(__pyx_t_2);
  5987. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5988. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  5989. __Pyx_GOTREF(__pyx_t_3);
  5990. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5991. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5992. /* "lib/Naked/toolshed/c/benchmarking.pyx":216
  5993. * # disable garbage collection
  5994. * gc.collect()
  5995. * gc.disable() # <<<<<<<<<<<<<<
  5996. * for x in range(trials):
  5997. * # test function
  5998. */
  5999. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6000. __Pyx_GOTREF(__pyx_t_3);
  6001. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6002. __Pyx_GOTREF(__pyx_t_2);
  6003. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6004. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6005. __Pyx_GOTREF(__pyx_t_3);
  6006. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6007. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6008. /* "lib/Naked/toolshed/c/benchmarking.pyx":217
  6009. * gc.collect()
  6010. * gc.disable()
  6011. * for x in range(trials): # <<<<<<<<<<<<<<
  6012. * # test function
  6013. * start = time.time()
  6014. */
  6015. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6016. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6017. __Pyx_GOTREF(__pyx_t_3);
  6018. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  6019. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  6020. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  6021. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6022. __Pyx_GOTREF(__pyx_t_2);
  6023. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6024. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  6025. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  6026. __pyx_t_5 = NULL;
  6027. } else {
  6028. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6029. __Pyx_GOTREF(__pyx_t_3);
  6030. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  6031. }
  6032. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6033. for (;;) {
  6034. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  6035. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  6036. #if CYTHON_COMPILING_IN_CPYTHON
  6037. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6038. #else
  6039. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6040. #endif
  6041. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  6042. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  6043. #if CYTHON_COMPILING_IN_CPYTHON
  6044. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6045. #else
  6046. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6047. #endif
  6048. } else {
  6049. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  6050. if (unlikely(!__pyx_t_2)) {
  6051. PyObject* exc_type = PyErr_Occurred();
  6052. if (exc_type) {
  6053. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6054. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6055. }
  6056. break;
  6057. }
  6058. __Pyx_GOTREF(__pyx_t_2);
  6059. }
  6060. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  6061. __pyx_t_2 = 0;
  6062. /* "lib/Naked/toolshed/c/benchmarking.pyx":219
  6063. * for x in range(trials):
  6064. * # test function
  6065. * start = time.time() # <<<<<<<<<<<<<<
  6066. * for y in range(repetitions):
  6067. * func(*args, **kwargs)
  6068. */
  6069. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6070. __Pyx_GOTREF(__pyx_t_2);
  6071. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6072. __Pyx_GOTREF(__pyx_t_1);
  6073. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6074. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6075. __Pyx_GOTREF(__pyx_t_2);
  6076. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6077. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  6078. __pyx_t_2 = 0;
  6079. /* "lib/Naked/toolshed/c/benchmarking.pyx":220
  6080. * # test function
  6081. * start = time.time()
  6082. * for y in range(repetitions): # <<<<<<<<<<<<<<
  6083. * func(*args, **kwargs)
  6084. * end = time.time()
  6085. */
  6086. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6087. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6088. __Pyx_GOTREF(__pyx_t_2);
  6089. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  6090. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  6091. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  6092. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6093. __Pyx_GOTREF(__pyx_t_1);
  6094. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6095. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  6096. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  6097. __pyx_t_7 = NULL;
  6098. } else {
  6099. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6100. __Pyx_GOTREF(__pyx_t_2);
  6101. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  6102. }
  6103. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6104. for (;;) {
  6105. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  6106. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  6107. #if CYTHON_COMPILING_IN_CPYTHON
  6108. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6109. #else
  6110. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6111. #endif
  6112. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  6113. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  6114. #if CYTHON_COMPILING_IN_CPYTHON
  6115. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6116. #else
  6117. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6118. #endif
  6119. } else {
  6120. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  6121. if (unlikely(!__pyx_t_1)) {
  6122. PyObject* exc_type = PyErr_Occurred();
  6123. if (exc_type) {
  6124. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6125. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6126. }
  6127. break;
  6128. }
  6129. __Pyx_GOTREF(__pyx_t_1);
  6130. }
  6131. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  6132. __pyx_t_1 = 0;
  6133. /* "lib/Naked/toolshed/c/benchmarking.pyx":221
  6134. * start = time.time()
  6135. * for y in range(repetitions):
  6136. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  6137. * end = time.time()
  6138. * result = func(*args, **kwargs)
  6139. */
  6140. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6141. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6142. __Pyx_GOTREF(__pyx_t_1);
  6143. __pyx_t_8 = __pyx_v_kwargs;
  6144. __Pyx_INCREF(__pyx_t_8);
  6145. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6146. __Pyx_GOTREF(__pyx_t_9);
  6147. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6148. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6149. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6150. }
  6151. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6152. /* "lib/Naked/toolshed/c/benchmarking.pyx":222
  6153. * for y in range(repetitions):
  6154. * func(*args, **kwargs)
  6155. * end = time.time() # <<<<<<<<<<<<<<
  6156. * result = func(*args, **kwargs)
  6157. * result_list.append(end-start)
  6158. */
  6159. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6160. __Pyx_GOTREF(__pyx_t_2);
  6161. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6162. __Pyx_GOTREF(__pyx_t_9);
  6163. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6164. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6165. __Pyx_GOTREF(__pyx_t_2);
  6166. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6167. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  6168. __pyx_t_2 = 0;
  6169. /* "lib/Naked/toolshed/c/benchmarking.pyx":223
  6170. * func(*args, **kwargs)
  6171. * end = time.time()
  6172. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  6173. * result_list.append(end-start)
  6174. * # benchmark function
  6175. */
  6176. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6177. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6178. __Pyx_GOTREF(__pyx_t_2);
  6179. __pyx_t_9 = __pyx_v_kwargs;
  6180. __Pyx_INCREF(__pyx_t_9);
  6181. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6182. __Pyx_GOTREF(__pyx_t_8);
  6183. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6184. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6185. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  6186. __pyx_t_8 = 0;
  6187. /* "lib/Naked/toolshed/c/benchmarking.pyx":224
  6188. * end = time.time()
  6189. * result = func(*args, **kwargs)
  6190. * result_list.append(end-start) # <<<<<<<<<<<<<<
  6191. * # benchmark function
  6192. * L = []
  6193. */
  6194. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6195. __Pyx_GOTREF(__pyx_t_8);
  6196. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6197. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6198. /* "lib/Naked/toolshed/c/benchmarking.pyx":226
  6199. * result_list.append(end-start)
  6200. * # benchmark function
  6201. * L = [] # <<<<<<<<<<<<<<
  6202. * start2 = time.time()
  6203. * for j in range(repetitions):
  6204. */
  6205. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6206. __Pyx_GOTREF(__pyx_t_8);
  6207. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  6208. __pyx_t_8 = 0;
  6209. /* "lib/Naked/toolshed/c/benchmarking.pyx":227
  6210. * # benchmark function
  6211. * L = []
  6212. * start2 = time.time() # <<<<<<<<<<<<<<
  6213. * for j in range(repetitions):
  6214. * for i in range(10):
  6215. */
  6216. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6217. __Pyx_GOTREF(__pyx_t_8);
  6218. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6219. __Pyx_GOTREF(__pyx_t_9);
  6220. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6221. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 227; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6222. __Pyx_GOTREF(__pyx_t_8);
  6223. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6224. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  6225. __pyx_t_8 = 0;
  6226. /* "lib/Naked/toolshed/c/benchmarking.pyx":228
  6227. * L = []
  6228. * start2 = time.time()
  6229. * for j in range(repetitions): # <<<<<<<<<<<<<<
  6230. * for i in range(10):
  6231. * L.append(i)
  6232. */
  6233. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6234. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6235. __Pyx_GOTREF(__pyx_t_8);
  6236. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  6237. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  6238. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  6239. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6240. __Pyx_GOTREF(__pyx_t_9);
  6241. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6242. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  6243. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  6244. __pyx_t_7 = NULL;
  6245. } else {
  6246. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6247. __Pyx_GOTREF(__pyx_t_8);
  6248. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  6249. }
  6250. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6251. for (;;) {
  6252. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  6253. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6254. #if CYTHON_COMPILING_IN_CPYTHON
  6255. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6256. #else
  6257. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6258. #endif
  6259. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  6260. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  6261. #if CYTHON_COMPILING_IN_CPYTHON
  6262. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6263. #else
  6264. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6265. #endif
  6266. } else {
  6267. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  6268. if (unlikely(!__pyx_t_9)) {
  6269. PyObject* exc_type = PyErr_Occurred();
  6270. if (exc_type) {
  6271. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  6272. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6273. }
  6274. break;
  6275. }
  6276. __Pyx_GOTREF(__pyx_t_9);
  6277. }
  6278. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  6279. __pyx_t_9 = 0;
  6280. /* "lib/Naked/toolshed/c/benchmarking.pyx":229
  6281. * start2 = time.time()
  6282. * for j in range(repetitions):
  6283. * for i in range(10): # <<<<<<<<<<<<<<
  6284. * L.append(i)
  6285. * end2 = time.time()
  6286. */
  6287. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  6288. __pyx_v_i = __pyx_t_11;
  6289. /* "lib/Naked/toolshed/c/benchmarking.pyx":230
  6290. * for j in range(repetitions):
  6291. * for i in range(10):
  6292. * L.append(i) # <<<<<<<<<<<<<<
  6293. * end2 = time.time()
  6294. * benchmark_list.append(end2 - start2)
  6295. */
  6296. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6297. __Pyx_GOTREF(__pyx_t_9);
  6298. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6299. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6300. }
  6301. }
  6302. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6303. /* "lib/Naked/toolshed/c/benchmarking.pyx":231
  6304. * for i in range(10):
  6305. * L.append(i)
  6306. * end2 = time.time() # <<<<<<<<<<<<<<
  6307. * benchmark_list.append(end2 - start2)
  6308. * sys.stdout.write(".")
  6309. */
  6310. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6311. __Pyx_GOTREF(__pyx_t_8);
  6312. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6313. __Pyx_GOTREF(__pyx_t_9);
  6314. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6315. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6316. __Pyx_GOTREF(__pyx_t_8);
  6317. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6318. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  6319. __pyx_t_8 = 0;
  6320. /* "lib/Naked/toolshed/c/benchmarking.pyx":232
  6321. * L.append(i)
  6322. * end2 = time.time()
  6323. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  6324. * sys.stdout.write(".")
  6325. * sys.stdout.flush()
  6326. */
  6327. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6328. __Pyx_GOTREF(__pyx_t_8);
  6329. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6330. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6331. /* "lib/Naked/toolshed/c/benchmarking.pyx":233
  6332. * end2 = time.time()
  6333. * benchmark_list.append(end2 - start2)
  6334. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  6335. * sys.stdout.flush()
  6336. * gc.enable() # re-enable garbage collection
  6337. */
  6338. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6339. __Pyx_GOTREF(__pyx_t_8);
  6340. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6341. __Pyx_GOTREF(__pyx_t_9);
  6342. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6343. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6344. __Pyx_GOTREF(__pyx_t_8);
  6345. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6346. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6347. __Pyx_GOTREF(__pyx_t_9);
  6348. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6349. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6350. /* "lib/Naked/toolshed/c/benchmarking.pyx":234
  6351. * benchmark_list.append(end2 - start2)
  6352. * sys.stdout.write(".")
  6353. * sys.stdout.flush() # <<<<<<<<<<<<<<
  6354. * gc.enable() # re-enable garbage collection
  6355. * gc.collect()
  6356. */
  6357. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6358. __Pyx_GOTREF(__pyx_t_9);
  6359. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6360. __Pyx_GOTREF(__pyx_t_8);
  6361. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6362. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6363. __Pyx_GOTREF(__pyx_t_9);
  6364. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6365. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6366. __Pyx_GOTREF(__pyx_t_8);
  6367. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6368. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6369. }
  6370. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6371. /* "lib/Naked/toolshed/c/benchmarking.pyx":235
  6372. * sys.stdout.write(".")
  6373. * sys.stdout.flush()
  6374. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  6375. * gc.collect()
  6376. * print(" ")
  6377. */
  6378. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6379. __Pyx_GOTREF(__pyx_t_3);
  6380. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6381. __Pyx_GOTREF(__pyx_t_8);
  6382. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6383. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6384. __Pyx_GOTREF(__pyx_t_3);
  6385. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6386. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6387. /* "lib/Naked/toolshed/c/benchmarking.pyx":236
  6388. * sys.stdout.flush()
  6389. * gc.enable() # re-enable garbage collection
  6390. * gc.collect() # <<<<<<<<<<<<<<
  6391. * print(" ")
  6392. * n = 1
  6393. */
  6394. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6395. __Pyx_GOTREF(__pyx_t_3);
  6396. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6397. __Pyx_GOTREF(__pyx_t_8);
  6398. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6399. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6400. __Pyx_GOTREF(__pyx_t_3);
  6401. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6402. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6403. /* "lib/Naked/toolshed/c/benchmarking.pyx":237
  6404. * gc.enable() # re-enable garbage collection
  6405. * gc.collect()
  6406. * print(" ") # <<<<<<<<<<<<<<
  6407. * n = 1
  6408. * for run in result_list:
  6409. */
  6410. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 237; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6411. /* "lib/Naked/toolshed/c/benchmarking.pyx":238
  6412. * gc.collect()
  6413. * print(" ")
  6414. * n = 1 # <<<<<<<<<<<<<<
  6415. * for run in result_list:
  6416. * print("Trial " + str(n) + ":\t" + str(run))
  6417. */
  6418. __Pyx_INCREF(__pyx_int_1);
  6419. __pyx_v_n = __pyx_int_1;
  6420. /* "lib/Naked/toolshed/c/benchmarking.pyx":239
  6421. * print(" ")
  6422. * n = 1
  6423. * for run in result_list: # <<<<<<<<<<<<<<
  6424. * print("Trial " + str(n) + ":\t" + str(run))
  6425. * n += 1
  6426. */
  6427. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  6428. for (;;) {
  6429. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  6430. #if CYTHON_COMPILING_IN_CPYTHON
  6431. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6432. #else
  6433. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6434. #endif
  6435. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  6436. __pyx_t_8 = 0;
  6437. /* "lib/Naked/toolshed/c/benchmarking.pyx":240
  6438. * n = 1
  6439. * for run in result_list:
  6440. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  6441. * n += 1
  6442. * print("-"*50)
  6443. */
  6444. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6445. __Pyx_GOTREF(__pyx_t_8);
  6446. __Pyx_INCREF(__pyx_v_n);
  6447. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  6448. __Pyx_GIVEREF(__pyx_v_n);
  6449. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6450. __Pyx_GOTREF(__pyx_t_9);
  6451. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6452. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6453. __Pyx_GOTREF(__pyx_t_8);
  6454. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6455. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6456. __Pyx_GOTREF(__pyx_t_9);
  6457. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6458. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6459. __Pyx_GOTREF(__pyx_t_8);
  6460. __Pyx_INCREF(__pyx_v_run);
  6461. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  6462. __Pyx_GIVEREF(__pyx_v_run);
  6463. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6464. __Pyx_GOTREF(__pyx_t_2);
  6465. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6466. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6467. __Pyx_GOTREF(__pyx_t_8);
  6468. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6469. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6470. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6471. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6472. /* "lib/Naked/toolshed/c/benchmarking.pyx":241
  6473. * for run in result_list:
  6474. * print("Trial " + str(n) + ":\t" + str(run))
  6475. * n += 1 # <<<<<<<<<<<<<<
  6476. * print("-"*50)
  6477. * mean = sum(result_list)/len(result_list)
  6478. */
  6479. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6480. __Pyx_GOTREF(__pyx_t_8);
  6481. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  6482. __pyx_t_8 = 0;
  6483. }
  6484. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6485. /* "lib/Naked/toolshed/c/benchmarking.pyx":242
  6486. * print("Trial " + str(n) + ":\t" + str(run))
  6487. * n += 1
  6488. * print("-"*50) # <<<<<<<<<<<<<<
  6489. * mean = sum(result_list)/len(result_list)
  6490. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  6491. */
  6492. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6493. __Pyx_GOTREF(__pyx_t_3);
  6494. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6495. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6496. /* "lib/Naked/toolshed/c/benchmarking.pyx":243
  6497. * n += 1
  6498. * print("-"*50)
  6499. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  6500. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  6501. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  6502. */
  6503. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6504. __Pyx_GOTREF(__pyx_t_3);
  6505. __Pyx_INCREF(__pyx_v_result_list);
  6506. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  6507. __Pyx_GIVEREF(__pyx_v_result_list);
  6508. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6509. __Pyx_GOTREF(__pyx_t_8);
  6510. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6511. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6512. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6513. __Pyx_GOTREF(__pyx_t_3);
  6514. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 243; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6515. __Pyx_GOTREF(__pyx_t_2);
  6516. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6517. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6518. __pyx_v_mean = __pyx_t_2;
  6519. __pyx_t_2 = 0;
  6520. /* "lib/Naked/toolshed/c/benchmarking.pyx":244
  6521. * print("-"*50)
  6522. * mean = sum(result_list)/len(result_list)
  6523. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  6524. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  6525. * try:
  6526. */
  6527. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6528. __Pyx_GOTREF(__pyx_t_2);
  6529. __Pyx_INCREF(__pyx_v_benchmark_list);
  6530. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  6531. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  6532. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6533. __Pyx_GOTREF(__pyx_t_3);
  6534. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6535. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6536. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6537. __Pyx_GOTREF(__pyx_t_2);
  6538. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6539. __Pyx_GOTREF(__pyx_t_8);
  6540. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6541. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6542. __pyx_v_mean_benchmark = __pyx_t_8;
  6543. __pyx_t_8 = 0;
  6544. /* "lib/Naked/toolshed/c/benchmarking.pyx":245
  6545. * mean = sum(result_list)/len(result_list)
  6546. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  6547. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  6548. * try:
  6549. * import numpy as np
  6550. */
  6551. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6552. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6553. __Pyx_GOTREF(__pyx_t_8);
  6554. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  6555. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  6556. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  6557. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6558. __Pyx_GOTREF(__pyx_t_2);
  6559. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6560. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6561. __Pyx_GOTREF(__pyx_t_8);
  6562. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6563. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6564. __Pyx_GOTREF(__pyx_t_2);
  6565. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6566. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6567. __Pyx_GOTREF(__pyx_t_8);
  6568. __Pyx_INCREF(__pyx_v_mean);
  6569. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  6570. __Pyx_GIVEREF(__pyx_v_mean);
  6571. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6572. __Pyx_GOTREF(__pyx_t_3);
  6573. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6574. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6575. __Pyx_GOTREF(__pyx_t_8);
  6576. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6577. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6578. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6579. __Pyx_GOTREF(__pyx_t_3);
  6580. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6581. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6582. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6583. /* "lib/Naked/toolshed/c/benchmarking.pyx":246
  6584. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  6585. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  6586. * try: # <<<<<<<<<<<<<<
  6587. * import numpy as np
  6588. * array = np.array(result_list)
  6589. */
  6590. {
  6591. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  6592. __Pyx_XGOTREF(__pyx_t_12);
  6593. __Pyx_XGOTREF(__pyx_t_13);
  6594. __Pyx_XGOTREF(__pyx_t_14);
  6595. /*try:*/ {
  6596. /* "lib/Naked/toolshed/c/benchmarking.pyx":247
  6597. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  6598. * try:
  6599. * import numpy as np # <<<<<<<<<<<<<<
  6600. * array = np.array(result_list)
  6601. * print( "Standard Deviation: " + str(np.std(array)))
  6602. */
  6603. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6604. __Pyx_GOTREF(__pyx_t_3);
  6605. __pyx_v_np = __pyx_t_3;
  6606. __pyx_t_3 = 0;
  6607. /* "lib/Naked/toolshed/c/benchmarking.pyx":248
  6608. * try:
  6609. * import numpy as np
  6610. * array = np.array(result_list) # <<<<<<<<<<<<<<
  6611. * print( "Standard Deviation: " + str(np.std(array)))
  6612. * except ImportError as ie:
  6613. */
  6614. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6615. __Pyx_GOTREF(__pyx_t_3);
  6616. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6617. __Pyx_GOTREF(__pyx_t_8);
  6618. __Pyx_INCREF(__pyx_v_result_list);
  6619. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  6620. __Pyx_GIVEREF(__pyx_v_result_list);
  6621. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6622. __Pyx_GOTREF(__pyx_t_2);
  6623. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6624. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6625. __pyx_v_array = __pyx_t_2;
  6626. __pyx_t_2 = 0;
  6627. /* "lib/Naked/toolshed/c/benchmarking.pyx":249
  6628. * import numpy as np
  6629. * array = np.array(result_list)
  6630. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  6631. * except ImportError as ie:
  6632. * pass
  6633. */
  6634. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6635. __Pyx_GOTREF(__pyx_t_2);
  6636. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6637. __Pyx_GOTREF(__pyx_t_8);
  6638. __Pyx_INCREF(__pyx_v_array);
  6639. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  6640. __Pyx_GIVEREF(__pyx_v_array);
  6641. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6642. __Pyx_GOTREF(__pyx_t_3);
  6643. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6644. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6645. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6646. __Pyx_GOTREF(__pyx_t_8);
  6647. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  6648. __Pyx_GIVEREF(__pyx_t_3);
  6649. __pyx_t_3 = 0;
  6650. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6651. __Pyx_GOTREF(__pyx_t_3);
  6652. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6653. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6654. __Pyx_GOTREF(__pyx_t_8);
  6655. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6656. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  6657. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6658. }
  6659. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  6660. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6661. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  6662. goto __pyx_L20_try_end;
  6663. __pyx_L13_error:;
  6664. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  6665. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6666. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  6667. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6668. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  6669. /* "lib/Naked/toolshed/c/benchmarking.pyx":250
  6670. * array = np.array(result_list)
  6671. * print( "Standard Deviation: " + str(np.std(array)))
  6672. * except ImportError as ie: # <<<<<<<<<<<<<<
  6673. * pass
  6674. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  6675. */
  6676. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  6677. if (__pyx_t_15) {
  6678. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6679. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  6680. __Pyx_GOTREF(__pyx_t_8);
  6681. __Pyx_GOTREF(__pyx_t_3);
  6682. __Pyx_GOTREF(__pyx_t_2);
  6683. __Pyx_INCREF(__pyx_t_3);
  6684. __pyx_v_ie = __pyx_t_3;
  6685. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6686. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6687. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6688. goto __pyx_L14_exception_handled;
  6689. }
  6690. goto __pyx_L15_except_error;
  6691. __pyx_L15_except_error:;
  6692. __Pyx_XGIVEREF(__pyx_t_12);
  6693. __Pyx_XGIVEREF(__pyx_t_13);
  6694. __Pyx_XGIVEREF(__pyx_t_14);
  6695. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  6696. goto __pyx_L1_error;
  6697. __pyx_L14_exception_handled:;
  6698. __Pyx_XGIVEREF(__pyx_t_12);
  6699. __Pyx_XGIVEREF(__pyx_t_13);
  6700. __Pyx_XGIVEREF(__pyx_t_14);
  6701. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  6702. __pyx_L20_try_end:;
  6703. }
  6704. /* "lib/Naked/toolshed/c/benchmarking.pyx":252
  6705. * except ImportError as ie:
  6706. * pass
  6707. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  6708. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  6709. * print("Ratio: " + str(mean/mean_benchmark))
  6710. */
  6711. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6712. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6713. __Pyx_GOTREF(__pyx_t_2);
  6714. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6715. __Pyx_GOTREF(__pyx_t_3);
  6716. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  6717. __Pyx_GIVEREF(__pyx_t_2);
  6718. __pyx_t_2 = 0;
  6719. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6720. __Pyx_GOTREF(__pyx_t_2);
  6721. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6722. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6723. __Pyx_GOTREF(__pyx_t_3);
  6724. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6725. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6726. __Pyx_GOTREF(__pyx_t_2);
  6727. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6728. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6729. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6730. /* "lib/Naked/toolshed/c/benchmarking.pyx":253
  6731. * pass
  6732. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  6733. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  6734. * print("Ratio: " + str(mean/mean_benchmark))
  6735. * return result
  6736. */
  6737. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6738. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6739. __Pyx_GOTREF(__pyx_t_2);
  6740. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  6741. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  6742. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  6743. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6744. __Pyx_GOTREF(__pyx_t_3);
  6745. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6746. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6747. __Pyx_GOTREF(__pyx_t_2);
  6748. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6749. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6750. __Pyx_GOTREF(__pyx_t_3);
  6751. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6752. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6753. __Pyx_GOTREF(__pyx_t_2);
  6754. __Pyx_INCREF(__pyx_v_mean_benchmark);
  6755. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  6756. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  6757. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6758. __Pyx_GOTREF(__pyx_t_8);
  6759. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6760. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6761. __Pyx_GOTREF(__pyx_t_2);
  6762. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6763. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6764. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6765. __Pyx_GOTREF(__pyx_t_8);
  6766. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6767. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6768. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6769. /* "lib/Naked/toolshed/c/benchmarking.pyx":254
  6770. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  6771. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  6772. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  6773. * return result
  6774. * return wrapper
  6775. */
  6776. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6777. __Pyx_GOTREF(__pyx_t_8);
  6778. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6779. __Pyx_GOTREF(__pyx_t_2);
  6780. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  6781. __Pyx_GIVEREF(__pyx_t_8);
  6782. __pyx_t_8 = 0;
  6783. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6784. __Pyx_GOTREF(__pyx_t_8);
  6785. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6786. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6787. __Pyx_GOTREF(__pyx_t_2);
  6788. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6789. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 254; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6790. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6791. /* "lib/Naked/toolshed/c/benchmarking.pyx":255
  6792. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  6793. * print("Ratio: " + str(mean/mean_benchmark))
  6794. * return result # <<<<<<<<<<<<<<
  6795. * return wrapper
  6796. *
  6797. */
  6798. __Pyx_XDECREF(__pyx_r);
  6799. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 255; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  6800. __Pyx_INCREF(__pyx_v_result);
  6801. __pyx_r = __pyx_v_result;
  6802. goto __pyx_L0;
  6803. /* "lib/Naked/toolshed/c/benchmarking.pyx":209
  6804. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  6805. * @wraps(func)
  6806. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  6807. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  6808. * sys.stdout.flush()
  6809. */
  6810. /* function exit code */
  6811. __pyx_L1_error:;
  6812. __Pyx_XDECREF(__pyx_t_1);
  6813. __Pyx_XDECREF(__pyx_t_2);
  6814. __Pyx_XDECREF(__pyx_t_3);
  6815. __Pyx_XDECREF(__pyx_t_8);
  6816. __Pyx_XDECREF(__pyx_t_9);
  6817. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6818. __pyx_r = NULL;
  6819. __pyx_L0:;
  6820. __Pyx_XDECREF(__pyx_v_result_list);
  6821. __Pyx_XDECREF(__pyx_v_benchmark_list);
  6822. __Pyx_XDECREF(__pyx_v_x);
  6823. __Pyx_XDECREF(__pyx_v_start);
  6824. __Pyx_XDECREF(__pyx_v_y);
  6825. __Pyx_XDECREF(__pyx_v_end);
  6826. __Pyx_XDECREF(__pyx_v_result);
  6827. __Pyx_XDECREF(__pyx_v_L);
  6828. __Pyx_XDECREF(__pyx_v_start2);
  6829. __Pyx_XDECREF(__pyx_v_j);
  6830. __Pyx_XDECREF(__pyx_v_end2);
  6831. __Pyx_XDECREF(__pyx_v_n);
  6832. __Pyx_XDECREF(__pyx_v_run);
  6833. __Pyx_XDECREF(__pyx_v_mean);
  6834. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  6835. __Pyx_XDECREF(__pyx_v_np);
  6836. __Pyx_XDECREF(__pyx_v_array);
  6837. __Pyx_XDECREF(__pyx_v_ie);
  6838. __Pyx_XGIVEREF(__pyx_r);
  6839. __Pyx_RefNannyFinishContext();
  6840. return __pyx_r;
  6841. }
  6842. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  6843. * # additional benchmark decorators that replicate the above function with different # repetitions
  6844. * #------------------------------------------------------------------------------
  6845. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  6846. * @wraps(func)
  6847. * def wrapper(*args, **kwargs):
  6848. */
  6849. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_14timer_trials_benchmark_10(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  6850. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_cur_scope;
  6851. PyObject *__pyx_v_wrapper = 0;
  6852. PyObject *__pyx_r = NULL;
  6853. __Pyx_RefNannyDeclarations
  6854. PyObject *__pyx_t_1 = NULL;
  6855. PyObject *__pyx_t_2 = NULL;
  6856. PyObject *__pyx_t_3 = NULL;
  6857. int __pyx_lineno = 0;
  6858. const char *__pyx_filename = NULL;
  6859. int __pyx_clineno = 0;
  6860. __Pyx_RefNannySetupContext("timer_trials_benchmark_10", 0);
  6861. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, __pyx_empty_tuple, NULL);
  6862. if (unlikely(!__pyx_cur_scope)) {
  6863. __Pyx_RefNannyFinishContext();
  6864. return NULL;
  6865. }
  6866. __Pyx_GOTREF(__pyx_cur_scope);
  6867. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  6868. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  6869. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  6870. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  6871. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  6872. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  6873. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  6874. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  6875. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  6876. /* "lib/Naked/toolshed/c/benchmarking.pyx":208
  6877. * #------------------------------------------------------------------------------
  6878. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  6879. * @wraps(func) # <<<<<<<<<<<<<<
  6880. * def wrapper(*args, **kwargs):
  6881. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  6882. */
  6883. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6884. __Pyx_GOTREF(__pyx_t_1);
  6885. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6886. __Pyx_GOTREF(__pyx_t_2);
  6887. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  6888. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  6889. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  6890. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6891. __Pyx_GOTREF(__pyx_t_3);
  6892. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6893. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6894. /* "lib/Naked/toolshed/c/benchmarking.pyx":209
  6895. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  6896. * @wraps(func)
  6897. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  6898. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  6899. * sys.stdout.flush()
  6900. */
  6901. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_10_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6902. __Pyx_GOTREF(__pyx_t_2);
  6903. /* "lib/Naked/toolshed/c/benchmarking.pyx":208
  6904. * #------------------------------------------------------------------------------
  6905. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  6906. * @wraps(func) # <<<<<<<<<<<<<<
  6907. * def wrapper(*args, **kwargs):
  6908. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  6909. */
  6910. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6911. __Pyx_GOTREF(__pyx_t_1);
  6912. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  6913. __Pyx_GIVEREF(__pyx_t_2);
  6914. __pyx_t_2 = 0;
  6915. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  6916. __Pyx_GOTREF(__pyx_t_2);
  6917. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6918. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6919. __pyx_v_wrapper = __pyx_t_2;
  6920. __pyx_t_2 = 0;
  6921. /* "lib/Naked/toolshed/c/benchmarking.pyx":256
  6922. * print("Ratio: " + str(mean/mean_benchmark))
  6923. * return result
  6924. * return wrapper # <<<<<<<<<<<<<<
  6925. *
  6926. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  6927. */
  6928. __Pyx_XDECREF(__pyx_r);
  6929. __Pyx_INCREF(__pyx_v_wrapper);
  6930. __pyx_r = __pyx_v_wrapper;
  6931. goto __pyx_L0;
  6932. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  6933. * # additional benchmark decorators that replicate the above function with different # repetitions
  6934. * #------------------------------------------------------------------------------
  6935. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  6936. * @wraps(func)
  6937. * def wrapper(*args, **kwargs):
  6938. */
  6939. /* function exit code */
  6940. __pyx_L1_error:;
  6941. __Pyx_XDECREF(__pyx_t_1);
  6942. __Pyx_XDECREF(__pyx_t_2);
  6943. __Pyx_XDECREF(__pyx_t_3);
  6944. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6945. __pyx_r = NULL;
  6946. __pyx_L0:;
  6947. __Pyx_XDECREF(__pyx_v_wrapper);
  6948. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  6949. __Pyx_XGIVEREF(__pyx_r);
  6950. __Pyx_RefNannyFinishContext();
  6951. return __pyx_r;
  6952. }
  6953. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  6954. * return wrapper
  6955. *
  6956. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  6957. * @wraps(func)
  6958. * def wrapper(*args, **kwargs):
  6959. */
  6960. /* Python wrapper */
  6961. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6962. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100 = {__Pyx_NAMESTR("timer_trials_benchmark_100"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  6963. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6964. PyObject *__pyx_v_func = 0;
  6965. PyObject *__pyx_v_repetitions = 0;
  6966. PyObject *__pyx_v_trials = 0;
  6967. int __pyx_lineno = 0;
  6968. const char *__pyx_filename = NULL;
  6969. int __pyx_clineno = 0;
  6970. PyObject *__pyx_r = 0;
  6971. __Pyx_RefNannyDeclarations
  6972. __Pyx_RefNannySetupContext("timer_trials_benchmark_100 (wrapper)", 0);
  6973. {
  6974. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  6975. PyObject* values[3] = {0,0,0};
  6976. values[1] = ((PyObject *)__pyx_int_100);
  6977. values[2] = ((PyObject *)__pyx_int_10);
  6978. if (unlikely(__pyx_kwds)) {
  6979. Py_ssize_t kw_args;
  6980. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6981. switch (pos_args) {
  6982. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6983. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6984. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6985. case 0: break;
  6986. default: goto __pyx_L5_argtuple_error;
  6987. }
  6988. kw_args = PyDict_Size(__pyx_kwds);
  6989. switch (pos_args) {
  6990. case 0:
  6991. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  6992. else goto __pyx_L5_argtuple_error;
  6993. case 1:
  6994. if (kw_args > 0) {
  6995. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  6996. if (value) { values[1] = value; kw_args--; }
  6997. }
  6998. case 2:
  6999. if (kw_args > 0) {
  7000. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  7001. if (value) { values[2] = value; kw_args--; }
  7002. }
  7003. }
  7004. if (unlikely(kw_args > 0)) {
  7005. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_100") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7006. }
  7007. } else {
  7008. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7009. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7010. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7011. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7012. break;
  7013. default: goto __pyx_L5_argtuple_error;
  7014. }
  7015. }
  7016. __pyx_v_func = values[0];
  7017. __pyx_v_repetitions = values[1];
  7018. __pyx_v_trials = values[2];
  7019. }
  7020. goto __pyx_L4_argument_unpacking_done;
  7021. __pyx_L5_argtuple_error:;
  7022. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_100", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  7023. __pyx_L3_error:;
  7024. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7025. __Pyx_RefNannyFinishContext();
  7026. return NULL;
  7027. __pyx_L4_argument_unpacking_done:;
  7028. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  7029. /* function exit code */
  7030. __Pyx_RefNannyFinishContext();
  7031. return __pyx_r;
  7032. }
  7033. /* "lib/Naked/toolshed/c/benchmarking.pyx":260
  7034. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  7035. * @wraps(func)
  7036. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  7037. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  7038. * sys.stdout.flush()
  7039. */
  7040. /* Python wrapper */
  7041. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7042. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  7043. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7044. PyObject *__pyx_v_args = 0;
  7045. PyObject *__pyx_v_kwargs = 0;
  7046. PyObject *__pyx_r = 0;
  7047. __Pyx_RefNannyDeclarations
  7048. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  7049. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  7050. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  7051. if (unlikely(!__pyx_v_kwargs)) return NULL;
  7052. __Pyx_GOTREF(__pyx_v_kwargs);
  7053. __Pyx_INCREF(__pyx_args);
  7054. __pyx_v_args = __pyx_args;
  7055. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  7056. /* function exit code */
  7057. __Pyx_XDECREF(__pyx_v_args);
  7058. __Pyx_XDECREF(__pyx_v_kwargs);
  7059. __Pyx_RefNannyFinishContext();
  7060. return __pyx_r;
  7061. }
  7062. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  7063. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope;
  7064. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_outer_scope;
  7065. PyObject *__pyx_v_result_list = NULL;
  7066. PyObject *__pyx_v_benchmark_list = NULL;
  7067. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  7068. PyObject *__pyx_v_start = NULL;
  7069. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  7070. PyObject *__pyx_v_end = NULL;
  7071. PyObject *__pyx_v_result = NULL;
  7072. PyObject *__pyx_v_L = NULL;
  7073. PyObject *__pyx_v_start2 = NULL;
  7074. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  7075. long __pyx_v_i;
  7076. PyObject *__pyx_v_end2 = NULL;
  7077. PyObject *__pyx_v_n = NULL;
  7078. PyObject *__pyx_v_run = NULL;
  7079. PyObject *__pyx_v_mean = NULL;
  7080. PyObject *__pyx_v_mean_benchmark = NULL;
  7081. PyObject *__pyx_v_np = NULL;
  7082. PyObject *__pyx_v_array = NULL;
  7083. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  7084. PyObject *__pyx_r = NULL;
  7085. __Pyx_RefNannyDeclarations
  7086. PyObject *__pyx_t_1 = NULL;
  7087. PyObject *__pyx_t_2 = NULL;
  7088. PyObject *__pyx_t_3 = NULL;
  7089. Py_ssize_t __pyx_t_4;
  7090. PyObject *(*__pyx_t_5)(PyObject *);
  7091. Py_ssize_t __pyx_t_6;
  7092. PyObject *(*__pyx_t_7)(PyObject *);
  7093. PyObject *__pyx_t_8 = NULL;
  7094. PyObject *__pyx_t_9 = NULL;
  7095. int __pyx_t_10;
  7096. long __pyx_t_11;
  7097. PyObject *__pyx_t_12 = NULL;
  7098. PyObject *__pyx_t_13 = NULL;
  7099. PyObject *__pyx_t_14 = NULL;
  7100. int __pyx_t_15;
  7101. int __pyx_lineno = 0;
  7102. const char *__pyx_filename = NULL;
  7103. int __pyx_clineno = 0;
  7104. __Pyx_RefNannySetupContext("wrapper", 0);
  7105. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *) __Pyx_CyFunction_GetClosure(__pyx_self);
  7106. __pyx_cur_scope = __pyx_outer_scope;
  7107. /* "lib/Naked/toolshed/c/benchmarking.pyx":261
  7108. * @wraps(func)
  7109. * def wrapper(*args, **kwargs):
  7110. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  7111. * sys.stdout.flush()
  7112. * result_list = []
  7113. */
  7114. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7115. __Pyx_GOTREF(__pyx_t_1);
  7116. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7117. __Pyx_GOTREF(__pyx_t_2);
  7118. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7119. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7120. __Pyx_GOTREF(__pyx_t_1);
  7121. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7122. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7123. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7124. __Pyx_GOTREF(__pyx_t_2);
  7125. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7126. __Pyx_GOTREF(__pyx_t_3);
  7127. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7128. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7129. __Pyx_GOTREF(__pyx_t_2);
  7130. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7131. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7132. __Pyx_GOTREF(__pyx_t_3);
  7133. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  7134. __Pyx_GIVEREF(__pyx_t_2);
  7135. __pyx_t_2 = 0;
  7136. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 261; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7137. __Pyx_GOTREF(__pyx_t_2);
  7138. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7139. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7140. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7141. /* "lib/Naked/toolshed/c/benchmarking.pyx":262
  7142. * def wrapper(*args, **kwargs):
  7143. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  7144. * sys.stdout.flush() # <<<<<<<<<<<<<<
  7145. * result_list = []
  7146. * benchmark_list = []
  7147. */
  7148. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7149. __Pyx_GOTREF(__pyx_t_2);
  7150. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7151. __Pyx_GOTREF(__pyx_t_3);
  7152. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7153. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7154. __Pyx_GOTREF(__pyx_t_2);
  7155. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7156. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7157. __Pyx_GOTREF(__pyx_t_3);
  7158. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7159. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7160. /* "lib/Naked/toolshed/c/benchmarking.pyx":263
  7161. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  7162. * sys.stdout.flush()
  7163. * result_list = [] # <<<<<<<<<<<<<<
  7164. * benchmark_list = []
  7165. * # disable garbage collection
  7166. */
  7167. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7168. __Pyx_GOTREF(__pyx_t_3);
  7169. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  7170. __pyx_t_3 = 0;
  7171. /* "lib/Naked/toolshed/c/benchmarking.pyx":264
  7172. * sys.stdout.flush()
  7173. * result_list = []
  7174. * benchmark_list = [] # <<<<<<<<<<<<<<
  7175. * # disable garbage collection
  7176. * gc.collect()
  7177. */
  7178. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7179. __Pyx_GOTREF(__pyx_t_3);
  7180. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  7181. __pyx_t_3 = 0;
  7182. /* "lib/Naked/toolshed/c/benchmarking.pyx":266
  7183. * benchmark_list = []
  7184. * # disable garbage collection
  7185. * gc.collect() # <<<<<<<<<<<<<<
  7186. * gc.disable()
  7187. * for x in range(trials):
  7188. */
  7189. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7190. __Pyx_GOTREF(__pyx_t_3);
  7191. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7192. __Pyx_GOTREF(__pyx_t_2);
  7193. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7194. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7195. __Pyx_GOTREF(__pyx_t_3);
  7196. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7197. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7198. /* "lib/Naked/toolshed/c/benchmarking.pyx":267
  7199. * # disable garbage collection
  7200. * gc.collect()
  7201. * gc.disable() # <<<<<<<<<<<<<<
  7202. * for x in range(trials):
  7203. * # test function
  7204. */
  7205. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7206. __Pyx_GOTREF(__pyx_t_3);
  7207. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7208. __Pyx_GOTREF(__pyx_t_2);
  7209. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7210. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7211. __Pyx_GOTREF(__pyx_t_3);
  7212. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7213. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7214. /* "lib/Naked/toolshed/c/benchmarking.pyx":268
  7215. * gc.collect()
  7216. * gc.disable()
  7217. * for x in range(trials): # <<<<<<<<<<<<<<
  7218. * # test function
  7219. * start = time.time()
  7220. */
  7221. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7222. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7223. __Pyx_GOTREF(__pyx_t_3);
  7224. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  7225. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  7226. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  7227. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7228. __Pyx_GOTREF(__pyx_t_2);
  7229. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7230. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  7231. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  7232. __pyx_t_5 = NULL;
  7233. } else {
  7234. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7235. __Pyx_GOTREF(__pyx_t_3);
  7236. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  7237. }
  7238. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7239. for (;;) {
  7240. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  7241. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  7242. #if CYTHON_COMPILING_IN_CPYTHON
  7243. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7244. #else
  7245. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7246. #endif
  7247. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  7248. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  7249. #if CYTHON_COMPILING_IN_CPYTHON
  7250. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7251. #else
  7252. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7253. #endif
  7254. } else {
  7255. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  7256. if (unlikely(!__pyx_t_2)) {
  7257. PyObject* exc_type = PyErr_Occurred();
  7258. if (exc_type) {
  7259. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7260. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7261. }
  7262. break;
  7263. }
  7264. __Pyx_GOTREF(__pyx_t_2);
  7265. }
  7266. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  7267. __pyx_t_2 = 0;
  7268. /* "lib/Naked/toolshed/c/benchmarking.pyx":270
  7269. * for x in range(trials):
  7270. * # test function
  7271. * start = time.time() # <<<<<<<<<<<<<<
  7272. * for y in range(repetitions):
  7273. * func(*args, **kwargs)
  7274. */
  7275. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7276. __Pyx_GOTREF(__pyx_t_2);
  7277. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7278. __Pyx_GOTREF(__pyx_t_1);
  7279. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7280. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 270; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7281. __Pyx_GOTREF(__pyx_t_2);
  7282. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7283. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  7284. __pyx_t_2 = 0;
  7285. /* "lib/Naked/toolshed/c/benchmarking.pyx":271
  7286. * # test function
  7287. * start = time.time()
  7288. * for y in range(repetitions): # <<<<<<<<<<<<<<
  7289. * func(*args, **kwargs)
  7290. * end = time.time()
  7291. */
  7292. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7293. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7294. __Pyx_GOTREF(__pyx_t_2);
  7295. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  7296. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  7297. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  7298. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7299. __Pyx_GOTREF(__pyx_t_1);
  7300. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7301. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  7302. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  7303. __pyx_t_7 = NULL;
  7304. } else {
  7305. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7306. __Pyx_GOTREF(__pyx_t_2);
  7307. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  7308. }
  7309. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7310. for (;;) {
  7311. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  7312. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  7313. #if CYTHON_COMPILING_IN_CPYTHON
  7314. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7315. #else
  7316. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7317. #endif
  7318. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  7319. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  7320. #if CYTHON_COMPILING_IN_CPYTHON
  7321. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7322. #else
  7323. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7324. #endif
  7325. } else {
  7326. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  7327. if (unlikely(!__pyx_t_1)) {
  7328. PyObject* exc_type = PyErr_Occurred();
  7329. if (exc_type) {
  7330. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7331. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7332. }
  7333. break;
  7334. }
  7335. __Pyx_GOTREF(__pyx_t_1);
  7336. }
  7337. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  7338. __pyx_t_1 = 0;
  7339. /* "lib/Naked/toolshed/c/benchmarking.pyx":272
  7340. * start = time.time()
  7341. * for y in range(repetitions):
  7342. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  7343. * end = time.time()
  7344. * result = func(*args, **kwargs)
  7345. */
  7346. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7347. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7348. __Pyx_GOTREF(__pyx_t_1);
  7349. __pyx_t_8 = __pyx_v_kwargs;
  7350. __Pyx_INCREF(__pyx_t_8);
  7351. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7352. __Pyx_GOTREF(__pyx_t_9);
  7353. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7354. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7355. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7356. }
  7357. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7358. /* "lib/Naked/toolshed/c/benchmarking.pyx":273
  7359. * for y in range(repetitions):
  7360. * func(*args, **kwargs)
  7361. * end = time.time() # <<<<<<<<<<<<<<
  7362. * result = func(*args, **kwargs)
  7363. * result_list.append(end-start)
  7364. */
  7365. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7366. __Pyx_GOTREF(__pyx_t_2);
  7367. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7368. __Pyx_GOTREF(__pyx_t_9);
  7369. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7370. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7371. __Pyx_GOTREF(__pyx_t_2);
  7372. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7373. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  7374. __pyx_t_2 = 0;
  7375. /* "lib/Naked/toolshed/c/benchmarking.pyx":274
  7376. * func(*args, **kwargs)
  7377. * end = time.time()
  7378. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  7379. * result_list.append(end-start)
  7380. * # benchmark function
  7381. */
  7382. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7383. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7384. __Pyx_GOTREF(__pyx_t_2);
  7385. __pyx_t_9 = __pyx_v_kwargs;
  7386. __Pyx_INCREF(__pyx_t_9);
  7387. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7388. __Pyx_GOTREF(__pyx_t_8);
  7389. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7390. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7391. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  7392. __pyx_t_8 = 0;
  7393. /* "lib/Naked/toolshed/c/benchmarking.pyx":275
  7394. * end = time.time()
  7395. * result = func(*args, **kwargs)
  7396. * result_list.append(end-start) # <<<<<<<<<<<<<<
  7397. * # benchmark function
  7398. * L = []
  7399. */
  7400. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7401. __Pyx_GOTREF(__pyx_t_8);
  7402. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7403. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7404. /* "lib/Naked/toolshed/c/benchmarking.pyx":277
  7405. * result_list.append(end-start)
  7406. * # benchmark function
  7407. * L = [] # <<<<<<<<<<<<<<
  7408. * start2 = time.time()
  7409. * for j in range(repetitions):
  7410. */
  7411. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7412. __Pyx_GOTREF(__pyx_t_8);
  7413. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  7414. __pyx_t_8 = 0;
  7415. /* "lib/Naked/toolshed/c/benchmarking.pyx":278
  7416. * # benchmark function
  7417. * L = []
  7418. * start2 = time.time() # <<<<<<<<<<<<<<
  7419. * for j in range(repetitions):
  7420. * for i in range(10):
  7421. */
  7422. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7423. __Pyx_GOTREF(__pyx_t_8);
  7424. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7425. __Pyx_GOTREF(__pyx_t_9);
  7426. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7427. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 278; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7428. __Pyx_GOTREF(__pyx_t_8);
  7429. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7430. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  7431. __pyx_t_8 = 0;
  7432. /* "lib/Naked/toolshed/c/benchmarking.pyx":279
  7433. * L = []
  7434. * start2 = time.time()
  7435. * for j in range(repetitions): # <<<<<<<<<<<<<<
  7436. * for i in range(10):
  7437. * L.append(i)
  7438. */
  7439. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7440. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7441. __Pyx_GOTREF(__pyx_t_8);
  7442. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  7443. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  7444. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  7445. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7446. __Pyx_GOTREF(__pyx_t_9);
  7447. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7448. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  7449. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  7450. __pyx_t_7 = NULL;
  7451. } else {
  7452. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7453. __Pyx_GOTREF(__pyx_t_8);
  7454. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  7455. }
  7456. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7457. for (;;) {
  7458. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  7459. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  7460. #if CYTHON_COMPILING_IN_CPYTHON
  7461. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7462. #else
  7463. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7464. #endif
  7465. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  7466. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  7467. #if CYTHON_COMPILING_IN_CPYTHON
  7468. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7469. #else
  7470. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7471. #endif
  7472. } else {
  7473. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  7474. if (unlikely(!__pyx_t_9)) {
  7475. PyObject* exc_type = PyErr_Occurred();
  7476. if (exc_type) {
  7477. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7478. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 279; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7479. }
  7480. break;
  7481. }
  7482. __Pyx_GOTREF(__pyx_t_9);
  7483. }
  7484. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  7485. __pyx_t_9 = 0;
  7486. /* "lib/Naked/toolshed/c/benchmarking.pyx":280
  7487. * start2 = time.time()
  7488. * for j in range(repetitions):
  7489. * for i in range(10): # <<<<<<<<<<<<<<
  7490. * L.append(i)
  7491. * end2 = time.time()
  7492. */
  7493. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  7494. __pyx_v_i = __pyx_t_11;
  7495. /* "lib/Naked/toolshed/c/benchmarking.pyx":281
  7496. * for j in range(repetitions):
  7497. * for i in range(10):
  7498. * L.append(i) # <<<<<<<<<<<<<<
  7499. * end2 = time.time()
  7500. * benchmark_list.append(end2 - start2)
  7501. */
  7502. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7503. __Pyx_GOTREF(__pyx_t_9);
  7504. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7505. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7506. }
  7507. }
  7508. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7509. /* "lib/Naked/toolshed/c/benchmarking.pyx":282
  7510. * for i in range(10):
  7511. * L.append(i)
  7512. * end2 = time.time() # <<<<<<<<<<<<<<
  7513. * benchmark_list.append(end2 - start2)
  7514. * sys.stdout.write(".")
  7515. */
  7516. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7517. __Pyx_GOTREF(__pyx_t_8);
  7518. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7519. __Pyx_GOTREF(__pyx_t_9);
  7520. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7521. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7522. __Pyx_GOTREF(__pyx_t_8);
  7523. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7524. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  7525. __pyx_t_8 = 0;
  7526. /* "lib/Naked/toolshed/c/benchmarking.pyx":283
  7527. * L.append(i)
  7528. * end2 = time.time()
  7529. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  7530. * sys.stdout.write(".")
  7531. * sys.stdout.flush()
  7532. */
  7533. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7534. __Pyx_GOTREF(__pyx_t_8);
  7535. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7536. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7537. /* "lib/Naked/toolshed/c/benchmarking.pyx":284
  7538. * end2 = time.time()
  7539. * benchmark_list.append(end2 - start2)
  7540. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  7541. * sys.stdout.flush()
  7542. * gc.enable() # re-enable garbage collection
  7543. */
  7544. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7545. __Pyx_GOTREF(__pyx_t_8);
  7546. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7547. __Pyx_GOTREF(__pyx_t_9);
  7548. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7549. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7550. __Pyx_GOTREF(__pyx_t_8);
  7551. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7552. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7553. __Pyx_GOTREF(__pyx_t_9);
  7554. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7555. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7556. /* "lib/Naked/toolshed/c/benchmarking.pyx":285
  7557. * benchmark_list.append(end2 - start2)
  7558. * sys.stdout.write(".")
  7559. * sys.stdout.flush() # <<<<<<<<<<<<<<
  7560. * gc.enable() # re-enable garbage collection
  7561. * gc.collect()
  7562. */
  7563. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7564. __Pyx_GOTREF(__pyx_t_9);
  7565. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7566. __Pyx_GOTREF(__pyx_t_8);
  7567. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7568. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7569. __Pyx_GOTREF(__pyx_t_9);
  7570. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7571. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7572. __Pyx_GOTREF(__pyx_t_8);
  7573. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7574. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7575. }
  7576. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7577. /* "lib/Naked/toolshed/c/benchmarking.pyx":286
  7578. * sys.stdout.write(".")
  7579. * sys.stdout.flush()
  7580. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  7581. * gc.collect()
  7582. * print(" ")
  7583. */
  7584. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7585. __Pyx_GOTREF(__pyx_t_3);
  7586. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7587. __Pyx_GOTREF(__pyx_t_8);
  7588. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7589. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7590. __Pyx_GOTREF(__pyx_t_3);
  7591. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7592. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7593. /* "lib/Naked/toolshed/c/benchmarking.pyx":287
  7594. * sys.stdout.flush()
  7595. * gc.enable() # re-enable garbage collection
  7596. * gc.collect() # <<<<<<<<<<<<<<
  7597. * print(" ")
  7598. * n = 1
  7599. */
  7600. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7601. __Pyx_GOTREF(__pyx_t_3);
  7602. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7603. __Pyx_GOTREF(__pyx_t_8);
  7604. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7605. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7606. __Pyx_GOTREF(__pyx_t_3);
  7607. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7608. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7609. /* "lib/Naked/toolshed/c/benchmarking.pyx":288
  7610. * gc.enable() # re-enable garbage collection
  7611. * gc.collect()
  7612. * print(" ") # <<<<<<<<<<<<<<
  7613. * n = 1
  7614. * for run in result_list:
  7615. */
  7616. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7617. /* "lib/Naked/toolshed/c/benchmarking.pyx":289
  7618. * gc.collect()
  7619. * print(" ")
  7620. * n = 1 # <<<<<<<<<<<<<<
  7621. * for run in result_list:
  7622. * print("Trial " + str(n) + ":\t" + str(run))
  7623. */
  7624. __Pyx_INCREF(__pyx_int_1);
  7625. __pyx_v_n = __pyx_int_1;
  7626. /* "lib/Naked/toolshed/c/benchmarking.pyx":290
  7627. * print(" ")
  7628. * n = 1
  7629. * for run in result_list: # <<<<<<<<<<<<<<
  7630. * print("Trial " + str(n) + ":\t" + str(run))
  7631. * n += 1
  7632. */
  7633. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  7634. for (;;) {
  7635. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  7636. #if CYTHON_COMPILING_IN_CPYTHON
  7637. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7638. #else
  7639. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7640. #endif
  7641. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  7642. __pyx_t_8 = 0;
  7643. /* "lib/Naked/toolshed/c/benchmarking.pyx":291
  7644. * n = 1
  7645. * for run in result_list:
  7646. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  7647. * n += 1
  7648. * print("-"*50)
  7649. */
  7650. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7651. __Pyx_GOTREF(__pyx_t_8);
  7652. __Pyx_INCREF(__pyx_v_n);
  7653. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  7654. __Pyx_GIVEREF(__pyx_v_n);
  7655. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7656. __Pyx_GOTREF(__pyx_t_9);
  7657. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7658. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7659. __Pyx_GOTREF(__pyx_t_8);
  7660. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7661. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7662. __Pyx_GOTREF(__pyx_t_9);
  7663. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7664. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7665. __Pyx_GOTREF(__pyx_t_8);
  7666. __Pyx_INCREF(__pyx_v_run);
  7667. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  7668. __Pyx_GIVEREF(__pyx_v_run);
  7669. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7670. __Pyx_GOTREF(__pyx_t_2);
  7671. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7672. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7673. __Pyx_GOTREF(__pyx_t_8);
  7674. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7675. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7676. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7677. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7678. /* "lib/Naked/toolshed/c/benchmarking.pyx":292
  7679. * for run in result_list:
  7680. * print("Trial " + str(n) + ":\t" + str(run))
  7681. * n += 1 # <<<<<<<<<<<<<<
  7682. * print("-"*50)
  7683. * mean = sum(result_list)/len(result_list)
  7684. */
  7685. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7686. __Pyx_GOTREF(__pyx_t_8);
  7687. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  7688. __pyx_t_8 = 0;
  7689. }
  7690. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7691. /* "lib/Naked/toolshed/c/benchmarking.pyx":293
  7692. * print("Trial " + str(n) + ":\t" + str(run))
  7693. * n += 1
  7694. * print("-"*50) # <<<<<<<<<<<<<<
  7695. * mean = sum(result_list)/len(result_list)
  7696. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  7697. */
  7698. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7699. __Pyx_GOTREF(__pyx_t_3);
  7700. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7701. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7702. /* "lib/Naked/toolshed/c/benchmarking.pyx":294
  7703. * n += 1
  7704. * print("-"*50)
  7705. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  7706. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  7707. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  7708. */
  7709. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7710. __Pyx_GOTREF(__pyx_t_3);
  7711. __Pyx_INCREF(__pyx_v_result_list);
  7712. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  7713. __Pyx_GIVEREF(__pyx_v_result_list);
  7714. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7715. __Pyx_GOTREF(__pyx_t_8);
  7716. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7717. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7718. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7719. __Pyx_GOTREF(__pyx_t_3);
  7720. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7721. __Pyx_GOTREF(__pyx_t_2);
  7722. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7723. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7724. __pyx_v_mean = __pyx_t_2;
  7725. __pyx_t_2 = 0;
  7726. /* "lib/Naked/toolshed/c/benchmarking.pyx":295
  7727. * print("-"*50)
  7728. * mean = sum(result_list)/len(result_list)
  7729. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  7730. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  7731. * try:
  7732. */
  7733. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7734. __Pyx_GOTREF(__pyx_t_2);
  7735. __Pyx_INCREF(__pyx_v_benchmark_list);
  7736. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  7737. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  7738. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7739. __Pyx_GOTREF(__pyx_t_3);
  7740. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7741. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7742. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7743. __Pyx_GOTREF(__pyx_t_2);
  7744. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7745. __Pyx_GOTREF(__pyx_t_8);
  7746. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7747. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7748. __pyx_v_mean_benchmark = __pyx_t_8;
  7749. __pyx_t_8 = 0;
  7750. /* "lib/Naked/toolshed/c/benchmarking.pyx":296
  7751. * mean = sum(result_list)/len(result_list)
  7752. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  7753. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  7754. * try:
  7755. * import numpy as np
  7756. */
  7757. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7758. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7759. __Pyx_GOTREF(__pyx_t_8);
  7760. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  7761. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  7762. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  7763. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7764. __Pyx_GOTREF(__pyx_t_2);
  7765. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7766. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7767. __Pyx_GOTREF(__pyx_t_8);
  7768. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7769. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7770. __Pyx_GOTREF(__pyx_t_2);
  7771. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7772. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7773. __Pyx_GOTREF(__pyx_t_8);
  7774. __Pyx_INCREF(__pyx_v_mean);
  7775. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  7776. __Pyx_GIVEREF(__pyx_v_mean);
  7777. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7778. __Pyx_GOTREF(__pyx_t_3);
  7779. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7780. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7781. __Pyx_GOTREF(__pyx_t_8);
  7782. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7783. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7784. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7785. __Pyx_GOTREF(__pyx_t_3);
  7786. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7787. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7788. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7789. /* "lib/Naked/toolshed/c/benchmarking.pyx":297
  7790. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  7791. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  7792. * try: # <<<<<<<<<<<<<<
  7793. * import numpy as np
  7794. * array = np.array(result_list)
  7795. */
  7796. {
  7797. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  7798. __Pyx_XGOTREF(__pyx_t_12);
  7799. __Pyx_XGOTREF(__pyx_t_13);
  7800. __Pyx_XGOTREF(__pyx_t_14);
  7801. /*try:*/ {
  7802. /* "lib/Naked/toolshed/c/benchmarking.pyx":298
  7803. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  7804. * try:
  7805. * import numpy as np # <<<<<<<<<<<<<<
  7806. * array = np.array(result_list)
  7807. * print( "Standard Deviation: " + str(np.std(array)))
  7808. */
  7809. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7810. __Pyx_GOTREF(__pyx_t_3);
  7811. __pyx_v_np = __pyx_t_3;
  7812. __pyx_t_3 = 0;
  7813. /* "lib/Naked/toolshed/c/benchmarking.pyx":299
  7814. * try:
  7815. * import numpy as np
  7816. * array = np.array(result_list) # <<<<<<<<<<<<<<
  7817. * print( "Standard Deviation: " + str(np.std(array)))
  7818. * except ImportError as ie:
  7819. */
  7820. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7821. __Pyx_GOTREF(__pyx_t_3);
  7822. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7823. __Pyx_GOTREF(__pyx_t_8);
  7824. __Pyx_INCREF(__pyx_v_result_list);
  7825. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  7826. __Pyx_GIVEREF(__pyx_v_result_list);
  7827. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7828. __Pyx_GOTREF(__pyx_t_2);
  7829. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7830. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7831. __pyx_v_array = __pyx_t_2;
  7832. __pyx_t_2 = 0;
  7833. /* "lib/Naked/toolshed/c/benchmarking.pyx":300
  7834. * import numpy as np
  7835. * array = np.array(result_list)
  7836. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  7837. * except ImportError as ie:
  7838. * pass
  7839. */
  7840. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7841. __Pyx_GOTREF(__pyx_t_2);
  7842. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7843. __Pyx_GOTREF(__pyx_t_8);
  7844. __Pyx_INCREF(__pyx_v_array);
  7845. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  7846. __Pyx_GIVEREF(__pyx_v_array);
  7847. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7848. __Pyx_GOTREF(__pyx_t_3);
  7849. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7850. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7851. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7852. __Pyx_GOTREF(__pyx_t_8);
  7853. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  7854. __Pyx_GIVEREF(__pyx_t_3);
  7855. __pyx_t_3 = 0;
  7856. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7857. __Pyx_GOTREF(__pyx_t_3);
  7858. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7859. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7860. __Pyx_GOTREF(__pyx_t_8);
  7861. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7862. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  7863. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7864. }
  7865. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  7866. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  7867. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  7868. goto __pyx_L20_try_end;
  7869. __pyx_L13_error:;
  7870. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  7871. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7872. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  7873. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7874. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  7875. /* "lib/Naked/toolshed/c/benchmarking.pyx":301
  7876. * array = np.array(result_list)
  7877. * print( "Standard Deviation: " + str(np.std(array)))
  7878. * except ImportError as ie: # <<<<<<<<<<<<<<
  7879. * pass
  7880. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  7881. */
  7882. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  7883. if (__pyx_t_15) {
  7884. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7885. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  7886. __Pyx_GOTREF(__pyx_t_8);
  7887. __Pyx_GOTREF(__pyx_t_3);
  7888. __Pyx_GOTREF(__pyx_t_2);
  7889. __Pyx_INCREF(__pyx_t_3);
  7890. __pyx_v_ie = __pyx_t_3;
  7891. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7892. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7893. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7894. goto __pyx_L14_exception_handled;
  7895. }
  7896. goto __pyx_L15_except_error;
  7897. __pyx_L15_except_error:;
  7898. __Pyx_XGIVEREF(__pyx_t_12);
  7899. __Pyx_XGIVEREF(__pyx_t_13);
  7900. __Pyx_XGIVEREF(__pyx_t_14);
  7901. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  7902. goto __pyx_L1_error;
  7903. __pyx_L14_exception_handled:;
  7904. __Pyx_XGIVEREF(__pyx_t_12);
  7905. __Pyx_XGIVEREF(__pyx_t_13);
  7906. __Pyx_XGIVEREF(__pyx_t_14);
  7907. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  7908. __pyx_L20_try_end:;
  7909. }
  7910. /* "lib/Naked/toolshed/c/benchmarking.pyx":303
  7911. * except ImportError as ie:
  7912. * pass
  7913. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  7914. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  7915. * print("Ratio: " + str(mean/mean_benchmark))
  7916. */
  7917. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7918. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7919. __Pyx_GOTREF(__pyx_t_2);
  7920. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7921. __Pyx_GOTREF(__pyx_t_3);
  7922. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  7923. __Pyx_GIVEREF(__pyx_t_2);
  7924. __pyx_t_2 = 0;
  7925. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7926. __Pyx_GOTREF(__pyx_t_2);
  7927. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7928. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7929. __Pyx_GOTREF(__pyx_t_3);
  7930. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7931. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7932. __Pyx_GOTREF(__pyx_t_2);
  7933. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7934. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7935. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7936. /* "lib/Naked/toolshed/c/benchmarking.pyx":304
  7937. * pass
  7938. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  7939. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  7940. * print("Ratio: " + str(mean/mean_benchmark))
  7941. * return result
  7942. */
  7943. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  7944. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7945. __Pyx_GOTREF(__pyx_t_2);
  7946. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  7947. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  7948. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  7949. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7950. __Pyx_GOTREF(__pyx_t_3);
  7951. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7952. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7953. __Pyx_GOTREF(__pyx_t_2);
  7954. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7955. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7956. __Pyx_GOTREF(__pyx_t_3);
  7957. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7958. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7959. __Pyx_GOTREF(__pyx_t_2);
  7960. __Pyx_INCREF(__pyx_v_mean_benchmark);
  7961. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  7962. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  7963. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7964. __Pyx_GOTREF(__pyx_t_8);
  7965. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7966. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7967. __Pyx_GOTREF(__pyx_t_2);
  7968. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7969. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7970. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7971. __Pyx_GOTREF(__pyx_t_8);
  7972. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7973. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7974. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7975. /* "lib/Naked/toolshed/c/benchmarking.pyx":305
  7976. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  7977. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  7978. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  7979. * return result
  7980. * return wrapper
  7981. */
  7982. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7983. __Pyx_GOTREF(__pyx_t_8);
  7984. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7985. __Pyx_GOTREF(__pyx_t_2);
  7986. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  7987. __Pyx_GIVEREF(__pyx_t_8);
  7988. __pyx_t_8 = 0;
  7989. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7990. __Pyx_GOTREF(__pyx_t_8);
  7991. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7992. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7993. __Pyx_GOTREF(__pyx_t_2);
  7994. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7995. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  7996. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7997. /* "lib/Naked/toolshed/c/benchmarking.pyx":306
  7998. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  7999. * print("Ratio: " + str(mean/mean_benchmark))
  8000. * return result # <<<<<<<<<<<<<<
  8001. * return wrapper
  8002. *
  8003. */
  8004. __Pyx_XDECREF(__pyx_r);
  8005. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8006. __Pyx_INCREF(__pyx_v_result);
  8007. __pyx_r = __pyx_v_result;
  8008. goto __pyx_L0;
  8009. /* "lib/Naked/toolshed/c/benchmarking.pyx":260
  8010. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  8011. * @wraps(func)
  8012. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  8013. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8014. * sys.stdout.flush()
  8015. */
  8016. /* function exit code */
  8017. __pyx_L1_error:;
  8018. __Pyx_XDECREF(__pyx_t_1);
  8019. __Pyx_XDECREF(__pyx_t_2);
  8020. __Pyx_XDECREF(__pyx_t_3);
  8021. __Pyx_XDECREF(__pyx_t_8);
  8022. __Pyx_XDECREF(__pyx_t_9);
  8023. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8024. __pyx_r = NULL;
  8025. __pyx_L0:;
  8026. __Pyx_XDECREF(__pyx_v_result_list);
  8027. __Pyx_XDECREF(__pyx_v_benchmark_list);
  8028. __Pyx_XDECREF(__pyx_v_x);
  8029. __Pyx_XDECREF(__pyx_v_start);
  8030. __Pyx_XDECREF(__pyx_v_y);
  8031. __Pyx_XDECREF(__pyx_v_end);
  8032. __Pyx_XDECREF(__pyx_v_result);
  8033. __Pyx_XDECREF(__pyx_v_L);
  8034. __Pyx_XDECREF(__pyx_v_start2);
  8035. __Pyx_XDECREF(__pyx_v_j);
  8036. __Pyx_XDECREF(__pyx_v_end2);
  8037. __Pyx_XDECREF(__pyx_v_n);
  8038. __Pyx_XDECREF(__pyx_v_run);
  8039. __Pyx_XDECREF(__pyx_v_mean);
  8040. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  8041. __Pyx_XDECREF(__pyx_v_np);
  8042. __Pyx_XDECREF(__pyx_v_array);
  8043. __Pyx_XDECREF(__pyx_v_ie);
  8044. __Pyx_XGIVEREF(__pyx_r);
  8045. __Pyx_RefNannyFinishContext();
  8046. return __pyx_r;
  8047. }
  8048. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  8049. * return wrapper
  8050. *
  8051. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  8052. * @wraps(func)
  8053. * def wrapper(*args, **kwargs):
  8054. */
  8055. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_16timer_trials_benchmark_100(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  8056. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_cur_scope;
  8057. PyObject *__pyx_v_wrapper = 0;
  8058. PyObject *__pyx_r = NULL;
  8059. __Pyx_RefNannyDeclarations
  8060. PyObject *__pyx_t_1 = NULL;
  8061. PyObject *__pyx_t_2 = NULL;
  8062. PyObject *__pyx_t_3 = NULL;
  8063. int __pyx_lineno = 0;
  8064. const char *__pyx_filename = NULL;
  8065. int __pyx_clineno = 0;
  8066. __Pyx_RefNannySetupContext("timer_trials_benchmark_100", 0);
  8067. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, __pyx_empty_tuple, NULL);
  8068. if (unlikely(!__pyx_cur_scope)) {
  8069. __Pyx_RefNannyFinishContext();
  8070. return NULL;
  8071. }
  8072. __Pyx_GOTREF(__pyx_cur_scope);
  8073. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  8074. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  8075. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  8076. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  8077. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  8078. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  8079. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  8080. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  8081. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  8082. /* "lib/Naked/toolshed/c/benchmarking.pyx":259
  8083. *
  8084. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  8085. * @wraps(func) # <<<<<<<<<<<<<<
  8086. * def wrapper(*args, **kwargs):
  8087. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8088. */
  8089. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8090. __Pyx_GOTREF(__pyx_t_1);
  8091. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8092. __Pyx_GOTREF(__pyx_t_2);
  8093. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  8094. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  8095. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  8096. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8097. __Pyx_GOTREF(__pyx_t_3);
  8098. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8099. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8100. /* "lib/Naked/toolshed/c/benchmarking.pyx":260
  8101. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  8102. * @wraps(func)
  8103. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  8104. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8105. * sys.stdout.flush()
  8106. */
  8107. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_100_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_100_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__28)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8108. __Pyx_GOTREF(__pyx_t_2);
  8109. /* "lib/Naked/toolshed/c/benchmarking.pyx":259
  8110. *
  8111. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  8112. * @wraps(func) # <<<<<<<<<<<<<<
  8113. * def wrapper(*args, **kwargs):
  8114. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8115. */
  8116. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8117. __Pyx_GOTREF(__pyx_t_1);
  8118. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  8119. __Pyx_GIVEREF(__pyx_t_2);
  8120. __pyx_t_2 = 0;
  8121. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8122. __Pyx_GOTREF(__pyx_t_2);
  8123. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8124. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8125. __pyx_v_wrapper = __pyx_t_2;
  8126. __pyx_t_2 = 0;
  8127. /* "lib/Naked/toolshed/c/benchmarking.pyx":307
  8128. * print("Ratio: " + str(mean/mean_benchmark))
  8129. * return result
  8130. * return wrapper # <<<<<<<<<<<<<<
  8131. *
  8132. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  8133. */
  8134. __Pyx_XDECREF(__pyx_r);
  8135. __Pyx_INCREF(__pyx_v_wrapper);
  8136. __pyx_r = __pyx_v_wrapper;
  8137. goto __pyx_L0;
  8138. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  8139. * return wrapper
  8140. *
  8141. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  8142. * @wraps(func)
  8143. * def wrapper(*args, **kwargs):
  8144. */
  8145. /* function exit code */
  8146. __pyx_L1_error:;
  8147. __Pyx_XDECREF(__pyx_t_1);
  8148. __Pyx_XDECREF(__pyx_t_2);
  8149. __Pyx_XDECREF(__pyx_t_3);
  8150. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_100", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8151. __pyx_r = NULL;
  8152. __pyx_L0:;
  8153. __Pyx_XDECREF(__pyx_v_wrapper);
  8154. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  8155. __Pyx_XGIVEREF(__pyx_r);
  8156. __Pyx_RefNannyFinishContext();
  8157. return __pyx_r;
  8158. }
  8159. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  8160. * return wrapper
  8161. *
  8162. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  8163. * @wraps(func)
  8164. * def wrapper(*args, **kwargs):
  8165. */
  8166. /* Python wrapper */
  8167. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8168. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k = {__Pyx_NAMESTR("timer_trials_benchmark_1k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  8169. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8170. PyObject *__pyx_v_func = 0;
  8171. PyObject *__pyx_v_repetitions = 0;
  8172. PyObject *__pyx_v_trials = 0;
  8173. int __pyx_lineno = 0;
  8174. const char *__pyx_filename = NULL;
  8175. int __pyx_clineno = 0;
  8176. PyObject *__pyx_r = 0;
  8177. __Pyx_RefNannyDeclarations
  8178. __Pyx_RefNannySetupContext("timer_trials_benchmark_1k (wrapper)", 0);
  8179. {
  8180. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  8181. PyObject* values[3] = {0,0,0};
  8182. values[1] = ((PyObject *)__pyx_int_1000);
  8183. values[2] = ((PyObject *)__pyx_int_10);
  8184. if (unlikely(__pyx_kwds)) {
  8185. Py_ssize_t kw_args;
  8186. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8187. switch (pos_args) {
  8188. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8189. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8190. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8191. case 0: break;
  8192. default: goto __pyx_L5_argtuple_error;
  8193. }
  8194. kw_args = PyDict_Size(__pyx_kwds);
  8195. switch (pos_args) {
  8196. case 0:
  8197. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  8198. else goto __pyx_L5_argtuple_error;
  8199. case 1:
  8200. if (kw_args > 0) {
  8201. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  8202. if (value) { values[1] = value; kw_args--; }
  8203. }
  8204. case 2:
  8205. if (kw_args > 0) {
  8206. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  8207. if (value) { values[2] = value; kw_args--; }
  8208. }
  8209. }
  8210. if (unlikely(kw_args > 0)) {
  8211. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8212. }
  8213. } else {
  8214. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8215. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8216. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8217. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8218. break;
  8219. default: goto __pyx_L5_argtuple_error;
  8220. }
  8221. }
  8222. __pyx_v_func = values[0];
  8223. __pyx_v_repetitions = values[1];
  8224. __pyx_v_trials = values[2];
  8225. }
  8226. goto __pyx_L4_argument_unpacking_done;
  8227. __pyx_L5_argtuple_error:;
  8228. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  8229. __pyx_L3_error:;
  8230. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8231. __Pyx_RefNannyFinishContext();
  8232. return NULL;
  8233. __pyx_L4_argument_unpacking_done:;
  8234. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  8235. /* function exit code */
  8236. __Pyx_RefNannyFinishContext();
  8237. return __pyx_r;
  8238. }
  8239. /* "lib/Naked/toolshed/c/benchmarking.pyx":311
  8240. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  8241. * @wraps(func)
  8242. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  8243. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8244. * sys.stdout.flush()
  8245. */
  8246. /* Python wrapper */
  8247. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8248. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  8249. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8250. PyObject *__pyx_v_args = 0;
  8251. PyObject *__pyx_v_kwargs = 0;
  8252. PyObject *__pyx_r = 0;
  8253. __Pyx_RefNannyDeclarations
  8254. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  8255. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  8256. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  8257. if (unlikely(!__pyx_v_kwargs)) return NULL;
  8258. __Pyx_GOTREF(__pyx_v_kwargs);
  8259. __Pyx_INCREF(__pyx_args);
  8260. __pyx_v_args = __pyx_args;
  8261. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  8262. /* function exit code */
  8263. __Pyx_XDECREF(__pyx_v_args);
  8264. __Pyx_XDECREF(__pyx_v_kwargs);
  8265. __Pyx_RefNannyFinishContext();
  8266. return __pyx_r;
  8267. }
  8268. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  8269. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope;
  8270. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_outer_scope;
  8271. PyObject *__pyx_v_result_list = NULL;
  8272. PyObject *__pyx_v_benchmark_list = NULL;
  8273. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  8274. PyObject *__pyx_v_start = NULL;
  8275. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  8276. PyObject *__pyx_v_end = NULL;
  8277. PyObject *__pyx_v_result = NULL;
  8278. PyObject *__pyx_v_L = NULL;
  8279. PyObject *__pyx_v_start2 = NULL;
  8280. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  8281. long __pyx_v_i;
  8282. PyObject *__pyx_v_end2 = NULL;
  8283. PyObject *__pyx_v_n = NULL;
  8284. PyObject *__pyx_v_run = NULL;
  8285. PyObject *__pyx_v_mean = NULL;
  8286. PyObject *__pyx_v_mean_benchmark = NULL;
  8287. PyObject *__pyx_v_np = NULL;
  8288. PyObject *__pyx_v_array = NULL;
  8289. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  8290. PyObject *__pyx_r = NULL;
  8291. __Pyx_RefNannyDeclarations
  8292. PyObject *__pyx_t_1 = NULL;
  8293. PyObject *__pyx_t_2 = NULL;
  8294. PyObject *__pyx_t_3 = NULL;
  8295. Py_ssize_t __pyx_t_4;
  8296. PyObject *(*__pyx_t_5)(PyObject *);
  8297. Py_ssize_t __pyx_t_6;
  8298. PyObject *(*__pyx_t_7)(PyObject *);
  8299. PyObject *__pyx_t_8 = NULL;
  8300. PyObject *__pyx_t_9 = NULL;
  8301. int __pyx_t_10;
  8302. long __pyx_t_11;
  8303. PyObject *__pyx_t_12 = NULL;
  8304. PyObject *__pyx_t_13 = NULL;
  8305. PyObject *__pyx_t_14 = NULL;
  8306. int __pyx_t_15;
  8307. int __pyx_lineno = 0;
  8308. const char *__pyx_filename = NULL;
  8309. int __pyx_clineno = 0;
  8310. __Pyx_RefNannySetupContext("wrapper", 0);
  8311. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *) __Pyx_CyFunction_GetClosure(__pyx_self);
  8312. __pyx_cur_scope = __pyx_outer_scope;
  8313. /* "lib/Naked/toolshed/c/benchmarking.pyx":312
  8314. * @wraps(func)
  8315. * def wrapper(*args, **kwargs):
  8316. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  8317. * sys.stdout.flush()
  8318. * result_list = []
  8319. */
  8320. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8321. __Pyx_GOTREF(__pyx_t_1);
  8322. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8323. __Pyx_GOTREF(__pyx_t_2);
  8324. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8325. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8326. __Pyx_GOTREF(__pyx_t_1);
  8327. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8328. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8329. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8330. __Pyx_GOTREF(__pyx_t_2);
  8331. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8332. __Pyx_GOTREF(__pyx_t_3);
  8333. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8334. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8335. __Pyx_GOTREF(__pyx_t_2);
  8336. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8337. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8338. __Pyx_GOTREF(__pyx_t_3);
  8339. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  8340. __Pyx_GIVEREF(__pyx_t_2);
  8341. __pyx_t_2 = 0;
  8342. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8343. __Pyx_GOTREF(__pyx_t_2);
  8344. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8345. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8346. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8347. /* "lib/Naked/toolshed/c/benchmarking.pyx":313
  8348. * def wrapper(*args, **kwargs):
  8349. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8350. * sys.stdout.flush() # <<<<<<<<<<<<<<
  8351. * result_list = []
  8352. * benchmark_list = []
  8353. */
  8354. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8355. __Pyx_GOTREF(__pyx_t_2);
  8356. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8357. __Pyx_GOTREF(__pyx_t_3);
  8358. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8359. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8360. __Pyx_GOTREF(__pyx_t_2);
  8361. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8362. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8363. __Pyx_GOTREF(__pyx_t_3);
  8364. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8365. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8366. /* "lib/Naked/toolshed/c/benchmarking.pyx":314
  8367. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  8368. * sys.stdout.flush()
  8369. * result_list = [] # <<<<<<<<<<<<<<
  8370. * benchmark_list = []
  8371. * # disable garbage collection
  8372. */
  8373. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8374. __Pyx_GOTREF(__pyx_t_3);
  8375. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  8376. __pyx_t_3 = 0;
  8377. /* "lib/Naked/toolshed/c/benchmarking.pyx":315
  8378. * sys.stdout.flush()
  8379. * result_list = []
  8380. * benchmark_list = [] # <<<<<<<<<<<<<<
  8381. * # disable garbage collection
  8382. * gc.collect()
  8383. */
  8384. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8385. __Pyx_GOTREF(__pyx_t_3);
  8386. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  8387. __pyx_t_3 = 0;
  8388. /* "lib/Naked/toolshed/c/benchmarking.pyx":317
  8389. * benchmark_list = []
  8390. * # disable garbage collection
  8391. * gc.collect() # <<<<<<<<<<<<<<
  8392. * gc.disable()
  8393. * for x in range(trials):
  8394. */
  8395. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8396. __Pyx_GOTREF(__pyx_t_3);
  8397. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8398. __Pyx_GOTREF(__pyx_t_2);
  8399. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8400. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8401. __Pyx_GOTREF(__pyx_t_3);
  8402. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8403. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8404. /* "lib/Naked/toolshed/c/benchmarking.pyx":318
  8405. * # disable garbage collection
  8406. * gc.collect()
  8407. * gc.disable() # <<<<<<<<<<<<<<
  8408. * for x in range(trials):
  8409. * # test function
  8410. */
  8411. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8412. __Pyx_GOTREF(__pyx_t_3);
  8413. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8414. __Pyx_GOTREF(__pyx_t_2);
  8415. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8416. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8417. __Pyx_GOTREF(__pyx_t_3);
  8418. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8419. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8420. /* "lib/Naked/toolshed/c/benchmarking.pyx":319
  8421. * gc.collect()
  8422. * gc.disable()
  8423. * for x in range(trials): # <<<<<<<<<<<<<<
  8424. * # test function
  8425. * start = time.time()
  8426. */
  8427. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8428. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8429. __Pyx_GOTREF(__pyx_t_3);
  8430. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  8431. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  8432. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  8433. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8434. __Pyx_GOTREF(__pyx_t_2);
  8435. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8436. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  8437. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  8438. __pyx_t_5 = NULL;
  8439. } else {
  8440. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8441. __Pyx_GOTREF(__pyx_t_3);
  8442. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  8443. }
  8444. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8445. for (;;) {
  8446. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  8447. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  8448. #if CYTHON_COMPILING_IN_CPYTHON
  8449. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8450. #else
  8451. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8452. #endif
  8453. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  8454. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  8455. #if CYTHON_COMPILING_IN_CPYTHON
  8456. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8457. #else
  8458. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8459. #endif
  8460. } else {
  8461. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  8462. if (unlikely(!__pyx_t_2)) {
  8463. PyObject* exc_type = PyErr_Occurred();
  8464. if (exc_type) {
  8465. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8466. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8467. }
  8468. break;
  8469. }
  8470. __Pyx_GOTREF(__pyx_t_2);
  8471. }
  8472. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  8473. __pyx_t_2 = 0;
  8474. /* "lib/Naked/toolshed/c/benchmarking.pyx":321
  8475. * for x in range(trials):
  8476. * # test function
  8477. * start = time.time() # <<<<<<<<<<<<<<
  8478. * for y in range(repetitions):
  8479. * func(*args, **kwargs)
  8480. */
  8481. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8482. __Pyx_GOTREF(__pyx_t_2);
  8483. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8484. __Pyx_GOTREF(__pyx_t_1);
  8485. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8486. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 321; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8487. __Pyx_GOTREF(__pyx_t_2);
  8488. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8489. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  8490. __pyx_t_2 = 0;
  8491. /* "lib/Naked/toolshed/c/benchmarking.pyx":322
  8492. * # test function
  8493. * start = time.time()
  8494. * for y in range(repetitions): # <<<<<<<<<<<<<<
  8495. * func(*args, **kwargs)
  8496. * end = time.time()
  8497. */
  8498. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8499. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8500. __Pyx_GOTREF(__pyx_t_2);
  8501. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  8502. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  8503. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  8504. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8505. __Pyx_GOTREF(__pyx_t_1);
  8506. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8507. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  8508. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  8509. __pyx_t_7 = NULL;
  8510. } else {
  8511. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8512. __Pyx_GOTREF(__pyx_t_2);
  8513. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  8514. }
  8515. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8516. for (;;) {
  8517. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  8518. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  8519. #if CYTHON_COMPILING_IN_CPYTHON
  8520. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8521. #else
  8522. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8523. #endif
  8524. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  8525. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  8526. #if CYTHON_COMPILING_IN_CPYTHON
  8527. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8528. #else
  8529. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8530. #endif
  8531. } else {
  8532. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  8533. if (unlikely(!__pyx_t_1)) {
  8534. PyObject* exc_type = PyErr_Occurred();
  8535. if (exc_type) {
  8536. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8537. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 322; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8538. }
  8539. break;
  8540. }
  8541. __Pyx_GOTREF(__pyx_t_1);
  8542. }
  8543. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  8544. __pyx_t_1 = 0;
  8545. /* "lib/Naked/toolshed/c/benchmarking.pyx":323
  8546. * start = time.time()
  8547. * for y in range(repetitions):
  8548. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  8549. * end = time.time()
  8550. * result = func(*args, **kwargs)
  8551. */
  8552. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8553. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8554. __Pyx_GOTREF(__pyx_t_1);
  8555. __pyx_t_8 = __pyx_v_kwargs;
  8556. __Pyx_INCREF(__pyx_t_8);
  8557. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8558. __Pyx_GOTREF(__pyx_t_9);
  8559. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8560. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8561. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8562. }
  8563. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8564. /* "lib/Naked/toolshed/c/benchmarking.pyx":324
  8565. * for y in range(repetitions):
  8566. * func(*args, **kwargs)
  8567. * end = time.time() # <<<<<<<<<<<<<<
  8568. * result = func(*args, **kwargs)
  8569. * result_list.append(end-start)
  8570. */
  8571. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8572. __Pyx_GOTREF(__pyx_t_2);
  8573. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8574. __Pyx_GOTREF(__pyx_t_9);
  8575. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8576. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8577. __Pyx_GOTREF(__pyx_t_2);
  8578. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8579. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  8580. __pyx_t_2 = 0;
  8581. /* "lib/Naked/toolshed/c/benchmarking.pyx":325
  8582. * func(*args, **kwargs)
  8583. * end = time.time()
  8584. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  8585. * result_list.append(end-start)
  8586. * # benchmark function
  8587. */
  8588. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8589. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8590. __Pyx_GOTREF(__pyx_t_2);
  8591. __pyx_t_9 = __pyx_v_kwargs;
  8592. __Pyx_INCREF(__pyx_t_9);
  8593. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8594. __Pyx_GOTREF(__pyx_t_8);
  8595. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8596. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8597. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  8598. __pyx_t_8 = 0;
  8599. /* "lib/Naked/toolshed/c/benchmarking.pyx":326
  8600. * end = time.time()
  8601. * result = func(*args, **kwargs)
  8602. * result_list.append(end-start) # <<<<<<<<<<<<<<
  8603. * # benchmark function
  8604. * L = []
  8605. */
  8606. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8607. __Pyx_GOTREF(__pyx_t_8);
  8608. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8609. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8610. /* "lib/Naked/toolshed/c/benchmarking.pyx":328
  8611. * result_list.append(end-start)
  8612. * # benchmark function
  8613. * L = [] # <<<<<<<<<<<<<<
  8614. * start2 = time.time()
  8615. * for j in range(repetitions):
  8616. */
  8617. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8618. __Pyx_GOTREF(__pyx_t_8);
  8619. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  8620. __pyx_t_8 = 0;
  8621. /* "lib/Naked/toolshed/c/benchmarking.pyx":329
  8622. * # benchmark function
  8623. * L = []
  8624. * start2 = time.time() # <<<<<<<<<<<<<<
  8625. * for j in range(repetitions):
  8626. * for i in range(10):
  8627. */
  8628. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8629. __Pyx_GOTREF(__pyx_t_8);
  8630. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8631. __Pyx_GOTREF(__pyx_t_9);
  8632. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8633. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8634. __Pyx_GOTREF(__pyx_t_8);
  8635. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8636. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  8637. __pyx_t_8 = 0;
  8638. /* "lib/Naked/toolshed/c/benchmarking.pyx":330
  8639. * L = []
  8640. * start2 = time.time()
  8641. * for j in range(repetitions): # <<<<<<<<<<<<<<
  8642. * for i in range(10):
  8643. * L.append(i)
  8644. */
  8645. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8646. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8647. __Pyx_GOTREF(__pyx_t_8);
  8648. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  8649. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  8650. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  8651. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8652. __Pyx_GOTREF(__pyx_t_9);
  8653. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8654. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  8655. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  8656. __pyx_t_7 = NULL;
  8657. } else {
  8658. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8659. __Pyx_GOTREF(__pyx_t_8);
  8660. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  8661. }
  8662. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8663. for (;;) {
  8664. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  8665. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  8666. #if CYTHON_COMPILING_IN_CPYTHON
  8667. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8668. #else
  8669. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8670. #endif
  8671. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  8672. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  8673. #if CYTHON_COMPILING_IN_CPYTHON
  8674. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8675. #else
  8676. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8677. #endif
  8678. } else {
  8679. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  8680. if (unlikely(!__pyx_t_9)) {
  8681. PyObject* exc_type = PyErr_Occurred();
  8682. if (exc_type) {
  8683. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8684. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 330; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8685. }
  8686. break;
  8687. }
  8688. __Pyx_GOTREF(__pyx_t_9);
  8689. }
  8690. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  8691. __pyx_t_9 = 0;
  8692. /* "lib/Naked/toolshed/c/benchmarking.pyx":331
  8693. * start2 = time.time()
  8694. * for j in range(repetitions):
  8695. * for i in range(10): # <<<<<<<<<<<<<<
  8696. * L.append(i)
  8697. * end2 = time.time()
  8698. */
  8699. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  8700. __pyx_v_i = __pyx_t_11;
  8701. /* "lib/Naked/toolshed/c/benchmarking.pyx":332
  8702. * for j in range(repetitions):
  8703. * for i in range(10):
  8704. * L.append(i) # <<<<<<<<<<<<<<
  8705. * end2 = time.time()
  8706. * benchmark_list.append(end2 - start2)
  8707. */
  8708. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8709. __Pyx_GOTREF(__pyx_t_9);
  8710. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8711. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8712. }
  8713. }
  8714. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8715. /* "lib/Naked/toolshed/c/benchmarking.pyx":333
  8716. * for i in range(10):
  8717. * L.append(i)
  8718. * end2 = time.time() # <<<<<<<<<<<<<<
  8719. * benchmark_list.append(end2 - start2)
  8720. * sys.stdout.write(".")
  8721. */
  8722. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8723. __Pyx_GOTREF(__pyx_t_8);
  8724. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8725. __Pyx_GOTREF(__pyx_t_9);
  8726. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8727. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8728. __Pyx_GOTREF(__pyx_t_8);
  8729. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8730. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  8731. __pyx_t_8 = 0;
  8732. /* "lib/Naked/toolshed/c/benchmarking.pyx":334
  8733. * L.append(i)
  8734. * end2 = time.time()
  8735. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  8736. * sys.stdout.write(".")
  8737. * sys.stdout.flush()
  8738. */
  8739. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8740. __Pyx_GOTREF(__pyx_t_8);
  8741. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8742. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8743. /* "lib/Naked/toolshed/c/benchmarking.pyx":335
  8744. * end2 = time.time()
  8745. * benchmark_list.append(end2 - start2)
  8746. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  8747. * sys.stdout.flush()
  8748. * gc.enable() # re-enable garbage collection
  8749. */
  8750. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8751. __Pyx_GOTREF(__pyx_t_8);
  8752. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8753. __Pyx_GOTREF(__pyx_t_9);
  8754. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8755. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8756. __Pyx_GOTREF(__pyx_t_8);
  8757. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8758. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8759. __Pyx_GOTREF(__pyx_t_9);
  8760. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8761. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8762. /* "lib/Naked/toolshed/c/benchmarking.pyx":336
  8763. * benchmark_list.append(end2 - start2)
  8764. * sys.stdout.write(".")
  8765. * sys.stdout.flush() # <<<<<<<<<<<<<<
  8766. * gc.enable() # re-enable garbage collection
  8767. * gc.collect()
  8768. */
  8769. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8770. __Pyx_GOTREF(__pyx_t_9);
  8771. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8772. __Pyx_GOTREF(__pyx_t_8);
  8773. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8774. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8775. __Pyx_GOTREF(__pyx_t_9);
  8776. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8777. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8778. __Pyx_GOTREF(__pyx_t_8);
  8779. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8780. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8781. }
  8782. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8783. /* "lib/Naked/toolshed/c/benchmarking.pyx":337
  8784. * sys.stdout.write(".")
  8785. * sys.stdout.flush()
  8786. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  8787. * gc.collect()
  8788. * print(" ")
  8789. */
  8790. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8791. __Pyx_GOTREF(__pyx_t_3);
  8792. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8793. __Pyx_GOTREF(__pyx_t_8);
  8794. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8795. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8796. __Pyx_GOTREF(__pyx_t_3);
  8797. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8798. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8799. /* "lib/Naked/toolshed/c/benchmarking.pyx":338
  8800. * sys.stdout.flush()
  8801. * gc.enable() # re-enable garbage collection
  8802. * gc.collect() # <<<<<<<<<<<<<<
  8803. * print(" ")
  8804. * n = 1
  8805. */
  8806. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8807. __Pyx_GOTREF(__pyx_t_3);
  8808. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8809. __Pyx_GOTREF(__pyx_t_8);
  8810. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8811. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8812. __Pyx_GOTREF(__pyx_t_3);
  8813. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8814. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8815. /* "lib/Naked/toolshed/c/benchmarking.pyx":339
  8816. * gc.enable() # re-enable garbage collection
  8817. * gc.collect()
  8818. * print(" ") # <<<<<<<<<<<<<<
  8819. * n = 1
  8820. * for run in result_list:
  8821. */
  8822. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8823. /* "lib/Naked/toolshed/c/benchmarking.pyx":340
  8824. * gc.collect()
  8825. * print(" ")
  8826. * n = 1 # <<<<<<<<<<<<<<
  8827. * for run in result_list:
  8828. * print("Trial " + str(n) + ":\t" + str(run))
  8829. */
  8830. __Pyx_INCREF(__pyx_int_1);
  8831. __pyx_v_n = __pyx_int_1;
  8832. /* "lib/Naked/toolshed/c/benchmarking.pyx":341
  8833. * print(" ")
  8834. * n = 1
  8835. * for run in result_list: # <<<<<<<<<<<<<<
  8836. * print("Trial " + str(n) + ":\t" + str(run))
  8837. * n += 1
  8838. */
  8839. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  8840. for (;;) {
  8841. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  8842. #if CYTHON_COMPILING_IN_CPYTHON
  8843. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8844. #else
  8845. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8846. #endif
  8847. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  8848. __pyx_t_8 = 0;
  8849. /* "lib/Naked/toolshed/c/benchmarking.pyx":342
  8850. * n = 1
  8851. * for run in result_list:
  8852. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  8853. * n += 1
  8854. * print("-"*50)
  8855. */
  8856. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8857. __Pyx_GOTREF(__pyx_t_8);
  8858. __Pyx_INCREF(__pyx_v_n);
  8859. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  8860. __Pyx_GIVEREF(__pyx_v_n);
  8861. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8862. __Pyx_GOTREF(__pyx_t_9);
  8863. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8864. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8865. __Pyx_GOTREF(__pyx_t_8);
  8866. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8867. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8868. __Pyx_GOTREF(__pyx_t_9);
  8869. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8870. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8871. __Pyx_GOTREF(__pyx_t_8);
  8872. __Pyx_INCREF(__pyx_v_run);
  8873. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  8874. __Pyx_GIVEREF(__pyx_v_run);
  8875. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8876. __Pyx_GOTREF(__pyx_t_2);
  8877. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8878. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8879. __Pyx_GOTREF(__pyx_t_8);
  8880. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8881. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8882. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 342; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8883. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8884. /* "lib/Naked/toolshed/c/benchmarking.pyx":343
  8885. * for run in result_list:
  8886. * print("Trial " + str(n) + ":\t" + str(run))
  8887. * n += 1 # <<<<<<<<<<<<<<
  8888. * print("-"*50)
  8889. * mean = sum(result_list)/len(result_list)
  8890. */
  8891. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8892. __Pyx_GOTREF(__pyx_t_8);
  8893. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  8894. __pyx_t_8 = 0;
  8895. }
  8896. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8897. /* "lib/Naked/toolshed/c/benchmarking.pyx":344
  8898. * print("Trial " + str(n) + ":\t" + str(run))
  8899. * n += 1
  8900. * print("-"*50) # <<<<<<<<<<<<<<
  8901. * mean = sum(result_list)/len(result_list)
  8902. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  8903. */
  8904. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8905. __Pyx_GOTREF(__pyx_t_3);
  8906. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 344; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8907. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8908. /* "lib/Naked/toolshed/c/benchmarking.pyx":345
  8909. * n += 1
  8910. * print("-"*50)
  8911. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  8912. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  8913. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  8914. */
  8915. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8916. __Pyx_GOTREF(__pyx_t_3);
  8917. __Pyx_INCREF(__pyx_v_result_list);
  8918. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  8919. __Pyx_GIVEREF(__pyx_v_result_list);
  8920. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8921. __Pyx_GOTREF(__pyx_t_8);
  8922. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8923. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8924. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8925. __Pyx_GOTREF(__pyx_t_3);
  8926. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8927. __Pyx_GOTREF(__pyx_t_2);
  8928. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8929. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8930. __pyx_v_mean = __pyx_t_2;
  8931. __pyx_t_2 = 0;
  8932. /* "lib/Naked/toolshed/c/benchmarking.pyx":346
  8933. * print("-"*50)
  8934. * mean = sum(result_list)/len(result_list)
  8935. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  8936. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  8937. * try:
  8938. */
  8939. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8940. __Pyx_GOTREF(__pyx_t_2);
  8941. __Pyx_INCREF(__pyx_v_benchmark_list);
  8942. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  8943. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  8944. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8945. __Pyx_GOTREF(__pyx_t_3);
  8946. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8947. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8948. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8949. __Pyx_GOTREF(__pyx_t_2);
  8950. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8951. __Pyx_GOTREF(__pyx_t_8);
  8952. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8953. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8954. __pyx_v_mean_benchmark = __pyx_t_8;
  8955. __pyx_t_8 = 0;
  8956. /* "lib/Naked/toolshed/c/benchmarking.pyx":347
  8957. * mean = sum(result_list)/len(result_list)
  8958. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  8959. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  8960. * try:
  8961. * import numpy as np
  8962. */
  8963. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  8964. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8965. __Pyx_GOTREF(__pyx_t_8);
  8966. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  8967. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  8968. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  8969. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8970. __Pyx_GOTREF(__pyx_t_2);
  8971. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8972. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8973. __Pyx_GOTREF(__pyx_t_8);
  8974. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8975. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8976. __Pyx_GOTREF(__pyx_t_2);
  8977. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8978. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8979. __Pyx_GOTREF(__pyx_t_8);
  8980. __Pyx_INCREF(__pyx_v_mean);
  8981. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  8982. __Pyx_GIVEREF(__pyx_v_mean);
  8983. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8984. __Pyx_GOTREF(__pyx_t_3);
  8985. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8986. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8987. __Pyx_GOTREF(__pyx_t_8);
  8988. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8989. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8990. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8991. __Pyx_GOTREF(__pyx_t_3);
  8992. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8993. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  8994. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8995. /* "lib/Naked/toolshed/c/benchmarking.pyx":348
  8996. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  8997. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  8998. * try: # <<<<<<<<<<<<<<
  8999. * import numpy as np
  9000. * array = np.array(result_list)
  9001. */
  9002. {
  9003. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  9004. __Pyx_XGOTREF(__pyx_t_12);
  9005. __Pyx_XGOTREF(__pyx_t_13);
  9006. __Pyx_XGOTREF(__pyx_t_14);
  9007. /*try:*/ {
  9008. /* "lib/Naked/toolshed/c/benchmarking.pyx":349
  9009. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  9010. * try:
  9011. * import numpy as np # <<<<<<<<<<<<<<
  9012. * array = np.array(result_list)
  9013. * print( "Standard Deviation: " + str(np.std(array)))
  9014. */
  9015. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9016. __Pyx_GOTREF(__pyx_t_3);
  9017. __pyx_v_np = __pyx_t_3;
  9018. __pyx_t_3 = 0;
  9019. /* "lib/Naked/toolshed/c/benchmarking.pyx":350
  9020. * try:
  9021. * import numpy as np
  9022. * array = np.array(result_list) # <<<<<<<<<<<<<<
  9023. * print( "Standard Deviation: " + str(np.std(array)))
  9024. * except ImportError as ie:
  9025. */
  9026. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9027. __Pyx_GOTREF(__pyx_t_3);
  9028. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9029. __Pyx_GOTREF(__pyx_t_8);
  9030. __Pyx_INCREF(__pyx_v_result_list);
  9031. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  9032. __Pyx_GIVEREF(__pyx_v_result_list);
  9033. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9034. __Pyx_GOTREF(__pyx_t_2);
  9035. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9036. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9037. __pyx_v_array = __pyx_t_2;
  9038. __pyx_t_2 = 0;
  9039. /* "lib/Naked/toolshed/c/benchmarking.pyx":351
  9040. * import numpy as np
  9041. * array = np.array(result_list)
  9042. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  9043. * except ImportError as ie:
  9044. * pass
  9045. */
  9046. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9047. __Pyx_GOTREF(__pyx_t_2);
  9048. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9049. __Pyx_GOTREF(__pyx_t_8);
  9050. __Pyx_INCREF(__pyx_v_array);
  9051. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  9052. __Pyx_GIVEREF(__pyx_v_array);
  9053. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9054. __Pyx_GOTREF(__pyx_t_3);
  9055. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9056. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9057. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9058. __Pyx_GOTREF(__pyx_t_8);
  9059. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  9060. __Pyx_GIVEREF(__pyx_t_3);
  9061. __pyx_t_3 = 0;
  9062. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9063. __Pyx_GOTREF(__pyx_t_3);
  9064. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9065. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9066. __Pyx_GOTREF(__pyx_t_8);
  9067. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9068. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  9069. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9070. }
  9071. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  9072. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  9073. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  9074. goto __pyx_L20_try_end;
  9075. __pyx_L13_error:;
  9076. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  9077. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  9078. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  9079. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9080. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  9081. /* "lib/Naked/toolshed/c/benchmarking.pyx":352
  9082. * array = np.array(result_list)
  9083. * print( "Standard Deviation: " + str(np.std(array)))
  9084. * except ImportError as ie: # <<<<<<<<<<<<<<
  9085. * pass
  9086. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  9087. */
  9088. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  9089. if (__pyx_t_15) {
  9090. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9091. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  9092. __Pyx_GOTREF(__pyx_t_8);
  9093. __Pyx_GOTREF(__pyx_t_3);
  9094. __Pyx_GOTREF(__pyx_t_2);
  9095. __Pyx_INCREF(__pyx_t_3);
  9096. __pyx_v_ie = __pyx_t_3;
  9097. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9098. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9099. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9100. goto __pyx_L14_exception_handled;
  9101. }
  9102. goto __pyx_L15_except_error;
  9103. __pyx_L15_except_error:;
  9104. __Pyx_XGIVEREF(__pyx_t_12);
  9105. __Pyx_XGIVEREF(__pyx_t_13);
  9106. __Pyx_XGIVEREF(__pyx_t_14);
  9107. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  9108. goto __pyx_L1_error;
  9109. __pyx_L14_exception_handled:;
  9110. __Pyx_XGIVEREF(__pyx_t_12);
  9111. __Pyx_XGIVEREF(__pyx_t_13);
  9112. __Pyx_XGIVEREF(__pyx_t_14);
  9113. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  9114. __pyx_L20_try_end:;
  9115. }
  9116. /* "lib/Naked/toolshed/c/benchmarking.pyx":354
  9117. * except ImportError as ie:
  9118. * pass
  9119. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  9120. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  9121. * print("Ratio: " + str(mean/mean_benchmark))
  9122. */
  9123. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9124. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9125. __Pyx_GOTREF(__pyx_t_2);
  9126. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9127. __Pyx_GOTREF(__pyx_t_3);
  9128. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9129. __Pyx_GIVEREF(__pyx_t_2);
  9130. __pyx_t_2 = 0;
  9131. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9132. __Pyx_GOTREF(__pyx_t_2);
  9133. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9134. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9135. __Pyx_GOTREF(__pyx_t_3);
  9136. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9137. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9138. __Pyx_GOTREF(__pyx_t_2);
  9139. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9140. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9141. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9142. /* "lib/Naked/toolshed/c/benchmarking.pyx":355
  9143. * pass
  9144. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  9145. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  9146. * print("Ratio: " + str(mean/mean_benchmark))
  9147. * return result
  9148. */
  9149. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9150. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9151. __Pyx_GOTREF(__pyx_t_2);
  9152. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  9153. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  9154. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  9155. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9156. __Pyx_GOTREF(__pyx_t_3);
  9157. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9158. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9159. __Pyx_GOTREF(__pyx_t_2);
  9160. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9161. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9162. __Pyx_GOTREF(__pyx_t_3);
  9163. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9164. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9165. __Pyx_GOTREF(__pyx_t_2);
  9166. __Pyx_INCREF(__pyx_v_mean_benchmark);
  9167. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  9168. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  9169. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9170. __Pyx_GOTREF(__pyx_t_8);
  9171. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9172. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9173. __Pyx_GOTREF(__pyx_t_2);
  9174. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9175. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9176. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9177. __Pyx_GOTREF(__pyx_t_8);
  9178. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9179. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 355; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9180. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9181. /* "lib/Naked/toolshed/c/benchmarking.pyx":356
  9182. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  9183. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  9184. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  9185. * return result
  9186. * return wrapper
  9187. */
  9188. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9189. __Pyx_GOTREF(__pyx_t_8);
  9190. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9191. __Pyx_GOTREF(__pyx_t_2);
  9192. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  9193. __Pyx_GIVEREF(__pyx_t_8);
  9194. __pyx_t_8 = 0;
  9195. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9196. __Pyx_GOTREF(__pyx_t_8);
  9197. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9198. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9199. __Pyx_GOTREF(__pyx_t_2);
  9200. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9201. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9202. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9203. /* "lib/Naked/toolshed/c/benchmarking.pyx":357
  9204. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  9205. * print("Ratio: " + str(mean/mean_benchmark))
  9206. * return result # <<<<<<<<<<<<<<
  9207. * return wrapper
  9208. *
  9209. */
  9210. __Pyx_XDECREF(__pyx_r);
  9211. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9212. __Pyx_INCREF(__pyx_v_result);
  9213. __pyx_r = __pyx_v_result;
  9214. goto __pyx_L0;
  9215. /* "lib/Naked/toolshed/c/benchmarking.pyx":311
  9216. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  9217. * @wraps(func)
  9218. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  9219. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9220. * sys.stdout.flush()
  9221. */
  9222. /* function exit code */
  9223. __pyx_L1_error:;
  9224. __Pyx_XDECREF(__pyx_t_1);
  9225. __Pyx_XDECREF(__pyx_t_2);
  9226. __Pyx_XDECREF(__pyx_t_3);
  9227. __Pyx_XDECREF(__pyx_t_8);
  9228. __Pyx_XDECREF(__pyx_t_9);
  9229. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9230. __pyx_r = NULL;
  9231. __pyx_L0:;
  9232. __Pyx_XDECREF(__pyx_v_result_list);
  9233. __Pyx_XDECREF(__pyx_v_benchmark_list);
  9234. __Pyx_XDECREF(__pyx_v_x);
  9235. __Pyx_XDECREF(__pyx_v_start);
  9236. __Pyx_XDECREF(__pyx_v_y);
  9237. __Pyx_XDECREF(__pyx_v_end);
  9238. __Pyx_XDECREF(__pyx_v_result);
  9239. __Pyx_XDECREF(__pyx_v_L);
  9240. __Pyx_XDECREF(__pyx_v_start2);
  9241. __Pyx_XDECREF(__pyx_v_j);
  9242. __Pyx_XDECREF(__pyx_v_end2);
  9243. __Pyx_XDECREF(__pyx_v_n);
  9244. __Pyx_XDECREF(__pyx_v_run);
  9245. __Pyx_XDECREF(__pyx_v_mean);
  9246. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  9247. __Pyx_XDECREF(__pyx_v_np);
  9248. __Pyx_XDECREF(__pyx_v_array);
  9249. __Pyx_XDECREF(__pyx_v_ie);
  9250. __Pyx_XGIVEREF(__pyx_r);
  9251. __Pyx_RefNannyFinishContext();
  9252. return __pyx_r;
  9253. }
  9254. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  9255. * return wrapper
  9256. *
  9257. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  9258. * @wraps(func)
  9259. * def wrapper(*args, **kwargs):
  9260. */
  9261. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_18timer_trials_benchmark_1k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  9262. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_cur_scope;
  9263. PyObject *__pyx_v_wrapper = 0;
  9264. PyObject *__pyx_r = NULL;
  9265. __Pyx_RefNannyDeclarations
  9266. PyObject *__pyx_t_1 = NULL;
  9267. PyObject *__pyx_t_2 = NULL;
  9268. PyObject *__pyx_t_3 = NULL;
  9269. int __pyx_lineno = 0;
  9270. const char *__pyx_filename = NULL;
  9271. int __pyx_clineno = 0;
  9272. __Pyx_RefNannySetupContext("timer_trials_benchmark_1k", 0);
  9273. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, __pyx_empty_tuple, NULL);
  9274. if (unlikely(!__pyx_cur_scope)) {
  9275. __Pyx_RefNannyFinishContext();
  9276. return NULL;
  9277. }
  9278. __Pyx_GOTREF(__pyx_cur_scope);
  9279. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  9280. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  9281. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  9282. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  9283. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  9284. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  9285. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  9286. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  9287. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  9288. /* "lib/Naked/toolshed/c/benchmarking.pyx":310
  9289. *
  9290. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  9291. * @wraps(func) # <<<<<<<<<<<<<<
  9292. * def wrapper(*args, **kwargs):
  9293. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9294. */
  9295. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9296. __Pyx_GOTREF(__pyx_t_1);
  9297. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9298. __Pyx_GOTREF(__pyx_t_2);
  9299. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  9300. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  9301. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  9302. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9303. __Pyx_GOTREF(__pyx_t_3);
  9304. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9305. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9306. /* "lib/Naked/toolshed/c/benchmarking.pyx":311
  9307. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  9308. * @wraps(func)
  9309. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  9310. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9311. * sys.stdout.flush()
  9312. */
  9313. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1k_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9314. __Pyx_GOTREF(__pyx_t_2);
  9315. /* "lib/Naked/toolshed/c/benchmarking.pyx":310
  9316. *
  9317. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  9318. * @wraps(func) # <<<<<<<<<<<<<<
  9319. * def wrapper(*args, **kwargs):
  9320. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9321. */
  9322. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9323. __Pyx_GOTREF(__pyx_t_1);
  9324. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  9325. __Pyx_GIVEREF(__pyx_t_2);
  9326. __pyx_t_2 = 0;
  9327. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9328. __Pyx_GOTREF(__pyx_t_2);
  9329. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9330. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9331. __pyx_v_wrapper = __pyx_t_2;
  9332. __pyx_t_2 = 0;
  9333. /* "lib/Naked/toolshed/c/benchmarking.pyx":358
  9334. * print("Ratio: " + str(mean/mean_benchmark))
  9335. * return result
  9336. * return wrapper # <<<<<<<<<<<<<<
  9337. *
  9338. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  9339. */
  9340. __Pyx_XDECREF(__pyx_r);
  9341. __Pyx_INCREF(__pyx_v_wrapper);
  9342. __pyx_r = __pyx_v_wrapper;
  9343. goto __pyx_L0;
  9344. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  9345. * return wrapper
  9346. *
  9347. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  9348. * @wraps(func)
  9349. * def wrapper(*args, **kwargs):
  9350. */
  9351. /* function exit code */
  9352. __pyx_L1_error:;
  9353. __Pyx_XDECREF(__pyx_t_1);
  9354. __Pyx_XDECREF(__pyx_t_2);
  9355. __Pyx_XDECREF(__pyx_t_3);
  9356. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9357. __pyx_r = NULL;
  9358. __pyx_L0:;
  9359. __Pyx_XDECREF(__pyx_v_wrapper);
  9360. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  9361. __Pyx_XGIVEREF(__pyx_r);
  9362. __Pyx_RefNannyFinishContext();
  9363. return __pyx_r;
  9364. }
  9365. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  9366. * return wrapper
  9367. *
  9368. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  9369. * @wraps(func)
  9370. * def wrapper(*args, **kwargs):
  9371. */
  9372. /* Python wrapper */
  9373. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9374. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k = {__Pyx_NAMESTR("timer_trials_benchmark_10k"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  9375. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9376. PyObject *__pyx_v_func = 0;
  9377. PyObject *__pyx_v_repetitions = 0;
  9378. PyObject *__pyx_v_trials = 0;
  9379. int __pyx_lineno = 0;
  9380. const char *__pyx_filename = NULL;
  9381. int __pyx_clineno = 0;
  9382. PyObject *__pyx_r = 0;
  9383. __Pyx_RefNannyDeclarations
  9384. __Pyx_RefNannySetupContext("timer_trials_benchmark_10k (wrapper)", 0);
  9385. {
  9386. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  9387. PyObject* values[3] = {0,0,0};
  9388. values[1] = ((PyObject *)__pyx_int_10000);
  9389. values[2] = ((PyObject *)__pyx_int_10);
  9390. if (unlikely(__pyx_kwds)) {
  9391. Py_ssize_t kw_args;
  9392. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  9393. switch (pos_args) {
  9394. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9395. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9396. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9397. case 0: break;
  9398. default: goto __pyx_L5_argtuple_error;
  9399. }
  9400. kw_args = PyDict_Size(__pyx_kwds);
  9401. switch (pos_args) {
  9402. case 0:
  9403. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  9404. else goto __pyx_L5_argtuple_error;
  9405. case 1:
  9406. if (kw_args > 0) {
  9407. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  9408. if (value) { values[1] = value; kw_args--; }
  9409. }
  9410. case 2:
  9411. if (kw_args > 0) {
  9412. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  9413. if (value) { values[2] = value; kw_args--; }
  9414. }
  9415. }
  9416. if (unlikely(kw_args > 0)) {
  9417. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_10k") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  9418. }
  9419. } else {
  9420. switch (PyTuple_GET_SIZE(__pyx_args)) {
  9421. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9422. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9423. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9424. break;
  9425. default: goto __pyx_L5_argtuple_error;
  9426. }
  9427. }
  9428. __pyx_v_func = values[0];
  9429. __pyx_v_repetitions = values[1];
  9430. __pyx_v_trials = values[2];
  9431. }
  9432. goto __pyx_L4_argument_unpacking_done;
  9433. __pyx_L5_argtuple_error:;
  9434. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_10k", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  9435. __pyx_L3_error:;
  9436. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9437. __Pyx_RefNannyFinishContext();
  9438. return NULL;
  9439. __pyx_L4_argument_unpacking_done:;
  9440. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  9441. /* function exit code */
  9442. __Pyx_RefNannyFinishContext();
  9443. return __pyx_r;
  9444. }
  9445. /* "lib/Naked/toolshed/c/benchmarking.pyx":362
  9446. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  9447. * @wraps(func)
  9448. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  9449. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9450. * sys.stdout.flush()
  9451. */
  9452. /* Python wrapper */
  9453. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9454. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  9455. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9456. PyObject *__pyx_v_args = 0;
  9457. PyObject *__pyx_v_kwargs = 0;
  9458. PyObject *__pyx_r = 0;
  9459. __Pyx_RefNannyDeclarations
  9460. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  9461. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  9462. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  9463. if (unlikely(!__pyx_v_kwargs)) return NULL;
  9464. __Pyx_GOTREF(__pyx_v_kwargs);
  9465. __Pyx_INCREF(__pyx_args);
  9466. __pyx_v_args = __pyx_args;
  9467. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  9468. /* function exit code */
  9469. __Pyx_XDECREF(__pyx_v_args);
  9470. __Pyx_XDECREF(__pyx_v_kwargs);
  9471. __Pyx_RefNannyFinishContext();
  9472. return __pyx_r;
  9473. }
  9474. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  9475. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope;
  9476. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_outer_scope;
  9477. PyObject *__pyx_v_result_list = NULL;
  9478. PyObject *__pyx_v_benchmark_list = NULL;
  9479. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  9480. PyObject *__pyx_v_start = NULL;
  9481. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  9482. PyObject *__pyx_v_end = NULL;
  9483. PyObject *__pyx_v_result = NULL;
  9484. PyObject *__pyx_v_L = NULL;
  9485. PyObject *__pyx_v_start2 = NULL;
  9486. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  9487. long __pyx_v_i;
  9488. PyObject *__pyx_v_end2 = NULL;
  9489. PyObject *__pyx_v_n = NULL;
  9490. PyObject *__pyx_v_run = NULL;
  9491. PyObject *__pyx_v_mean = NULL;
  9492. PyObject *__pyx_v_mean_benchmark = NULL;
  9493. PyObject *__pyx_v_np = NULL;
  9494. PyObject *__pyx_v_array = NULL;
  9495. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  9496. PyObject *__pyx_r = NULL;
  9497. __Pyx_RefNannyDeclarations
  9498. PyObject *__pyx_t_1 = NULL;
  9499. PyObject *__pyx_t_2 = NULL;
  9500. PyObject *__pyx_t_3 = NULL;
  9501. Py_ssize_t __pyx_t_4;
  9502. PyObject *(*__pyx_t_5)(PyObject *);
  9503. Py_ssize_t __pyx_t_6;
  9504. PyObject *(*__pyx_t_7)(PyObject *);
  9505. PyObject *__pyx_t_8 = NULL;
  9506. PyObject *__pyx_t_9 = NULL;
  9507. int __pyx_t_10;
  9508. long __pyx_t_11;
  9509. PyObject *__pyx_t_12 = NULL;
  9510. PyObject *__pyx_t_13 = NULL;
  9511. PyObject *__pyx_t_14 = NULL;
  9512. int __pyx_t_15;
  9513. int __pyx_lineno = 0;
  9514. const char *__pyx_filename = NULL;
  9515. int __pyx_clineno = 0;
  9516. __Pyx_RefNannySetupContext("wrapper", 0);
  9517. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *) __Pyx_CyFunction_GetClosure(__pyx_self);
  9518. __pyx_cur_scope = __pyx_outer_scope;
  9519. /* "lib/Naked/toolshed/c/benchmarking.pyx":363
  9520. * @wraps(func)
  9521. * def wrapper(*args, **kwargs):
  9522. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  9523. * sys.stdout.flush()
  9524. * result_list = []
  9525. */
  9526. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9527. __Pyx_GOTREF(__pyx_t_1);
  9528. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9529. __Pyx_GOTREF(__pyx_t_2);
  9530. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9531. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9532. __Pyx_GOTREF(__pyx_t_1);
  9533. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9534. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9535. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9536. __Pyx_GOTREF(__pyx_t_2);
  9537. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9538. __Pyx_GOTREF(__pyx_t_3);
  9539. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9540. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9541. __Pyx_GOTREF(__pyx_t_2);
  9542. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9543. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9544. __Pyx_GOTREF(__pyx_t_3);
  9545. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9546. __Pyx_GIVEREF(__pyx_t_2);
  9547. __pyx_t_2 = 0;
  9548. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9549. __Pyx_GOTREF(__pyx_t_2);
  9550. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9551. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9553. /* "lib/Naked/toolshed/c/benchmarking.pyx":364
  9554. * def wrapper(*args, **kwargs):
  9555. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9556. * sys.stdout.flush() # <<<<<<<<<<<<<<
  9557. * result_list = []
  9558. * benchmark_list = []
  9559. */
  9560. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9561. __Pyx_GOTREF(__pyx_t_2);
  9562. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9563. __Pyx_GOTREF(__pyx_t_3);
  9564. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9565. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9566. __Pyx_GOTREF(__pyx_t_2);
  9567. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9568. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9569. __Pyx_GOTREF(__pyx_t_3);
  9570. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9571. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9572. /* "lib/Naked/toolshed/c/benchmarking.pyx":365
  9573. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  9574. * sys.stdout.flush()
  9575. * result_list = [] # <<<<<<<<<<<<<<
  9576. * benchmark_list = []
  9577. * # disable garbage collection
  9578. */
  9579. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9580. __Pyx_GOTREF(__pyx_t_3);
  9581. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  9582. __pyx_t_3 = 0;
  9583. /* "lib/Naked/toolshed/c/benchmarking.pyx":366
  9584. * sys.stdout.flush()
  9585. * result_list = []
  9586. * benchmark_list = [] # <<<<<<<<<<<<<<
  9587. * # disable garbage collection
  9588. * gc.collect()
  9589. */
  9590. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9591. __Pyx_GOTREF(__pyx_t_3);
  9592. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  9593. __pyx_t_3 = 0;
  9594. /* "lib/Naked/toolshed/c/benchmarking.pyx":368
  9595. * benchmark_list = []
  9596. * # disable garbage collection
  9597. * gc.collect() # <<<<<<<<<<<<<<
  9598. * gc.disable()
  9599. * for x in range(trials):
  9600. */
  9601. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9602. __Pyx_GOTREF(__pyx_t_3);
  9603. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9604. __Pyx_GOTREF(__pyx_t_2);
  9605. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9606. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9607. __Pyx_GOTREF(__pyx_t_3);
  9608. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9609. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9610. /* "lib/Naked/toolshed/c/benchmarking.pyx":369
  9611. * # disable garbage collection
  9612. * gc.collect()
  9613. * gc.disable() # <<<<<<<<<<<<<<
  9614. * for x in range(trials):
  9615. * # test function
  9616. */
  9617. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9618. __Pyx_GOTREF(__pyx_t_3);
  9619. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9620. __Pyx_GOTREF(__pyx_t_2);
  9621. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9622. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9623. __Pyx_GOTREF(__pyx_t_3);
  9624. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9625. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9626. /* "lib/Naked/toolshed/c/benchmarking.pyx":370
  9627. * gc.collect()
  9628. * gc.disable()
  9629. * for x in range(trials): # <<<<<<<<<<<<<<
  9630. * # test function
  9631. * start = time.time()
  9632. */
  9633. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9634. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9635. __Pyx_GOTREF(__pyx_t_3);
  9636. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  9637. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  9638. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  9639. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9640. __Pyx_GOTREF(__pyx_t_2);
  9641. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9642. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  9643. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  9644. __pyx_t_5 = NULL;
  9645. } else {
  9646. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9647. __Pyx_GOTREF(__pyx_t_3);
  9648. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  9649. }
  9650. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9651. for (;;) {
  9652. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  9653. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  9654. #if CYTHON_COMPILING_IN_CPYTHON
  9655. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9656. #else
  9657. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9658. #endif
  9659. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  9660. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  9661. #if CYTHON_COMPILING_IN_CPYTHON
  9662. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9663. #else
  9664. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9665. #endif
  9666. } else {
  9667. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  9668. if (unlikely(!__pyx_t_2)) {
  9669. PyObject* exc_type = PyErr_Occurred();
  9670. if (exc_type) {
  9671. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9672. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9673. }
  9674. break;
  9675. }
  9676. __Pyx_GOTREF(__pyx_t_2);
  9677. }
  9678. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  9679. __pyx_t_2 = 0;
  9680. /* "lib/Naked/toolshed/c/benchmarking.pyx":372
  9681. * for x in range(trials):
  9682. * # test function
  9683. * start = time.time() # <<<<<<<<<<<<<<
  9684. * for y in range(repetitions):
  9685. * func(*args, **kwargs)
  9686. */
  9687. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9688. __Pyx_GOTREF(__pyx_t_2);
  9689. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9690. __Pyx_GOTREF(__pyx_t_1);
  9691. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9692. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9693. __Pyx_GOTREF(__pyx_t_2);
  9694. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9695. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  9696. __pyx_t_2 = 0;
  9697. /* "lib/Naked/toolshed/c/benchmarking.pyx":373
  9698. * # test function
  9699. * start = time.time()
  9700. * for y in range(repetitions): # <<<<<<<<<<<<<<
  9701. * func(*args, **kwargs)
  9702. * end = time.time()
  9703. */
  9704. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9705. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9706. __Pyx_GOTREF(__pyx_t_2);
  9707. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  9708. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  9709. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  9710. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9711. __Pyx_GOTREF(__pyx_t_1);
  9712. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9713. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  9714. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  9715. __pyx_t_7 = NULL;
  9716. } else {
  9717. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9718. __Pyx_GOTREF(__pyx_t_2);
  9719. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  9720. }
  9721. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9722. for (;;) {
  9723. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  9724. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  9725. #if CYTHON_COMPILING_IN_CPYTHON
  9726. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9727. #else
  9728. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9729. #endif
  9730. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  9731. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  9732. #if CYTHON_COMPILING_IN_CPYTHON
  9733. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9734. #else
  9735. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9736. #endif
  9737. } else {
  9738. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  9739. if (unlikely(!__pyx_t_1)) {
  9740. PyObject* exc_type = PyErr_Occurred();
  9741. if (exc_type) {
  9742. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9743. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9744. }
  9745. break;
  9746. }
  9747. __Pyx_GOTREF(__pyx_t_1);
  9748. }
  9749. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  9750. __pyx_t_1 = 0;
  9751. /* "lib/Naked/toolshed/c/benchmarking.pyx":374
  9752. * start = time.time()
  9753. * for y in range(repetitions):
  9754. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  9755. * end = time.time()
  9756. * result = func(*args, **kwargs)
  9757. */
  9758. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9759. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9760. __Pyx_GOTREF(__pyx_t_1);
  9761. __pyx_t_8 = __pyx_v_kwargs;
  9762. __Pyx_INCREF(__pyx_t_8);
  9763. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9764. __Pyx_GOTREF(__pyx_t_9);
  9765. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9766. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9767. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9768. }
  9769. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9770. /* "lib/Naked/toolshed/c/benchmarking.pyx":375
  9771. * for y in range(repetitions):
  9772. * func(*args, **kwargs)
  9773. * end = time.time() # <<<<<<<<<<<<<<
  9774. * result = func(*args, **kwargs)
  9775. * result_list.append(end-start)
  9776. */
  9777. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9778. __Pyx_GOTREF(__pyx_t_2);
  9779. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9780. __Pyx_GOTREF(__pyx_t_9);
  9781. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9782. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9783. __Pyx_GOTREF(__pyx_t_2);
  9784. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9785. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  9786. __pyx_t_2 = 0;
  9787. /* "lib/Naked/toolshed/c/benchmarking.pyx":376
  9788. * func(*args, **kwargs)
  9789. * end = time.time()
  9790. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  9791. * result_list.append(end-start)
  9792. * # benchmark function
  9793. */
  9794. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9795. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9796. __Pyx_GOTREF(__pyx_t_2);
  9797. __pyx_t_9 = __pyx_v_kwargs;
  9798. __Pyx_INCREF(__pyx_t_9);
  9799. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9800. __Pyx_GOTREF(__pyx_t_8);
  9801. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9802. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9803. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  9804. __pyx_t_8 = 0;
  9805. /* "lib/Naked/toolshed/c/benchmarking.pyx":377
  9806. * end = time.time()
  9807. * result = func(*args, **kwargs)
  9808. * result_list.append(end-start) # <<<<<<<<<<<<<<
  9809. * # benchmark function
  9810. * L = []
  9811. */
  9812. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9813. __Pyx_GOTREF(__pyx_t_8);
  9814. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9815. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9816. /* "lib/Naked/toolshed/c/benchmarking.pyx":379
  9817. * result_list.append(end-start)
  9818. * # benchmark function
  9819. * L = [] # <<<<<<<<<<<<<<
  9820. * start2 = time.time()
  9821. * for j in range(repetitions):
  9822. */
  9823. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9824. __Pyx_GOTREF(__pyx_t_8);
  9825. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  9826. __pyx_t_8 = 0;
  9827. /* "lib/Naked/toolshed/c/benchmarking.pyx":380
  9828. * # benchmark function
  9829. * L = []
  9830. * start2 = time.time() # <<<<<<<<<<<<<<
  9831. * for j in range(repetitions):
  9832. * for i in range(10):
  9833. */
  9834. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9835. __Pyx_GOTREF(__pyx_t_8);
  9836. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9837. __Pyx_GOTREF(__pyx_t_9);
  9838. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9839. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9840. __Pyx_GOTREF(__pyx_t_8);
  9841. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9842. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  9843. __pyx_t_8 = 0;
  9844. /* "lib/Naked/toolshed/c/benchmarking.pyx":381
  9845. * L = []
  9846. * start2 = time.time()
  9847. * for j in range(repetitions): # <<<<<<<<<<<<<<
  9848. * for i in range(10):
  9849. * L.append(i)
  9850. */
  9851. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  9852. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9853. __Pyx_GOTREF(__pyx_t_8);
  9854. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  9855. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  9856. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  9857. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9858. __Pyx_GOTREF(__pyx_t_9);
  9859. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9860. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  9861. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  9862. __pyx_t_7 = NULL;
  9863. } else {
  9864. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9865. __Pyx_GOTREF(__pyx_t_8);
  9866. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  9867. }
  9868. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9869. for (;;) {
  9870. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  9871. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  9872. #if CYTHON_COMPILING_IN_CPYTHON
  9873. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9874. #else
  9875. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9876. #endif
  9877. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  9878. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  9879. #if CYTHON_COMPILING_IN_CPYTHON
  9880. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9881. #else
  9882. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9883. #endif
  9884. } else {
  9885. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  9886. if (unlikely(!__pyx_t_9)) {
  9887. PyObject* exc_type = PyErr_Occurred();
  9888. if (exc_type) {
  9889. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9890. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9891. }
  9892. break;
  9893. }
  9894. __Pyx_GOTREF(__pyx_t_9);
  9895. }
  9896. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  9897. __pyx_t_9 = 0;
  9898. /* "lib/Naked/toolshed/c/benchmarking.pyx":382
  9899. * start2 = time.time()
  9900. * for j in range(repetitions):
  9901. * for i in range(10): # <<<<<<<<<<<<<<
  9902. * L.append(i)
  9903. * end2 = time.time()
  9904. */
  9905. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  9906. __pyx_v_i = __pyx_t_11;
  9907. /* "lib/Naked/toolshed/c/benchmarking.pyx":383
  9908. * for j in range(repetitions):
  9909. * for i in range(10):
  9910. * L.append(i) # <<<<<<<<<<<<<<
  9911. * end2 = time.time()
  9912. * benchmark_list.append(end2 - start2)
  9913. */
  9914. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9915. __Pyx_GOTREF(__pyx_t_9);
  9916. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9917. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9918. }
  9919. }
  9920. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9921. /* "lib/Naked/toolshed/c/benchmarking.pyx":384
  9922. * for i in range(10):
  9923. * L.append(i)
  9924. * end2 = time.time() # <<<<<<<<<<<<<<
  9925. * benchmark_list.append(end2 - start2)
  9926. * sys.stdout.write(".")
  9927. */
  9928. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9929. __Pyx_GOTREF(__pyx_t_8);
  9930. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9931. __Pyx_GOTREF(__pyx_t_9);
  9932. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9933. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9934. __Pyx_GOTREF(__pyx_t_8);
  9935. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9936. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  9937. __pyx_t_8 = 0;
  9938. /* "lib/Naked/toolshed/c/benchmarking.pyx":385
  9939. * L.append(i)
  9940. * end2 = time.time()
  9941. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  9942. * sys.stdout.write(".")
  9943. * sys.stdout.flush()
  9944. */
  9945. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9946. __Pyx_GOTREF(__pyx_t_8);
  9947. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9948. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9949. /* "lib/Naked/toolshed/c/benchmarking.pyx":386
  9950. * end2 = time.time()
  9951. * benchmark_list.append(end2 - start2)
  9952. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  9953. * sys.stdout.flush()
  9954. * gc.enable() # re-enable garbage collection
  9955. */
  9956. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9957. __Pyx_GOTREF(__pyx_t_8);
  9958. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9959. __Pyx_GOTREF(__pyx_t_9);
  9960. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9961. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9962. __Pyx_GOTREF(__pyx_t_8);
  9963. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9964. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9965. __Pyx_GOTREF(__pyx_t_9);
  9966. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9967. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9968. /* "lib/Naked/toolshed/c/benchmarking.pyx":387
  9969. * benchmark_list.append(end2 - start2)
  9970. * sys.stdout.write(".")
  9971. * sys.stdout.flush() # <<<<<<<<<<<<<<
  9972. * gc.enable() # re-enable garbage collection
  9973. * gc.collect()
  9974. */
  9975. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9976. __Pyx_GOTREF(__pyx_t_9);
  9977. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9978. __Pyx_GOTREF(__pyx_t_8);
  9979. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9980. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9981. __Pyx_GOTREF(__pyx_t_9);
  9982. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9983. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9984. __Pyx_GOTREF(__pyx_t_8);
  9985. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9986. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  9987. }
  9988. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9989. /* "lib/Naked/toolshed/c/benchmarking.pyx":388
  9990. * sys.stdout.write(".")
  9991. * sys.stdout.flush()
  9992. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  9993. * gc.collect()
  9994. * print(" ")
  9995. */
  9996. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9997. __Pyx_GOTREF(__pyx_t_3);
  9998. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  9999. __Pyx_GOTREF(__pyx_t_8);
  10000. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10001. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10002. __Pyx_GOTREF(__pyx_t_3);
  10003. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10004. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10005. /* "lib/Naked/toolshed/c/benchmarking.pyx":389
  10006. * sys.stdout.flush()
  10007. * gc.enable() # re-enable garbage collection
  10008. * gc.collect() # <<<<<<<<<<<<<<
  10009. * print(" ")
  10010. * n = 1
  10011. */
  10012. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10013. __Pyx_GOTREF(__pyx_t_3);
  10014. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10015. __Pyx_GOTREF(__pyx_t_8);
  10016. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10017. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10018. __Pyx_GOTREF(__pyx_t_3);
  10019. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10020. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10021. /* "lib/Naked/toolshed/c/benchmarking.pyx":390
  10022. * gc.enable() # re-enable garbage collection
  10023. * gc.collect()
  10024. * print(" ") # <<<<<<<<<<<<<<
  10025. * n = 1
  10026. * for run in result_list:
  10027. */
  10028. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10029. /* "lib/Naked/toolshed/c/benchmarking.pyx":391
  10030. * gc.collect()
  10031. * print(" ")
  10032. * n = 1 # <<<<<<<<<<<<<<
  10033. * for run in result_list:
  10034. * print("Trial " + str(n) + ":\t" + str(run))
  10035. */
  10036. __Pyx_INCREF(__pyx_int_1);
  10037. __pyx_v_n = __pyx_int_1;
  10038. /* "lib/Naked/toolshed/c/benchmarking.pyx":392
  10039. * print(" ")
  10040. * n = 1
  10041. * for run in result_list: # <<<<<<<<<<<<<<
  10042. * print("Trial " + str(n) + ":\t" + str(run))
  10043. * n += 1
  10044. */
  10045. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  10046. for (;;) {
  10047. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10048. #if CYTHON_COMPILING_IN_CPYTHON
  10049. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10050. #else
  10051. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10052. #endif
  10053. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  10054. __pyx_t_8 = 0;
  10055. /* "lib/Naked/toolshed/c/benchmarking.pyx":393
  10056. * n = 1
  10057. * for run in result_list:
  10058. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  10059. * n += 1
  10060. * print("-"*50)
  10061. */
  10062. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10063. __Pyx_GOTREF(__pyx_t_8);
  10064. __Pyx_INCREF(__pyx_v_n);
  10065. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  10066. __Pyx_GIVEREF(__pyx_v_n);
  10067. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10068. __Pyx_GOTREF(__pyx_t_9);
  10069. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10070. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10071. __Pyx_GOTREF(__pyx_t_8);
  10072. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10073. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10074. __Pyx_GOTREF(__pyx_t_9);
  10075. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10076. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10077. __Pyx_GOTREF(__pyx_t_8);
  10078. __Pyx_INCREF(__pyx_v_run);
  10079. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  10080. __Pyx_GIVEREF(__pyx_v_run);
  10081. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10082. __Pyx_GOTREF(__pyx_t_2);
  10083. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10084. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10085. __Pyx_GOTREF(__pyx_t_8);
  10086. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10087. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10088. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10089. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10090. /* "lib/Naked/toolshed/c/benchmarking.pyx":394
  10091. * for run in result_list:
  10092. * print("Trial " + str(n) + ":\t" + str(run))
  10093. * n += 1 # <<<<<<<<<<<<<<
  10094. * print("-"*50)
  10095. * mean = sum(result_list)/len(result_list)
  10096. */
  10097. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10098. __Pyx_GOTREF(__pyx_t_8);
  10099. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  10100. __pyx_t_8 = 0;
  10101. }
  10102. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10103. /* "lib/Naked/toolshed/c/benchmarking.pyx":395
  10104. * print("Trial " + str(n) + ":\t" + str(run))
  10105. * n += 1
  10106. * print("-"*50) # <<<<<<<<<<<<<<
  10107. * mean = sum(result_list)/len(result_list)
  10108. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  10109. */
  10110. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10111. __Pyx_GOTREF(__pyx_t_3);
  10112. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10113. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10114. /* "lib/Naked/toolshed/c/benchmarking.pyx":396
  10115. * n += 1
  10116. * print("-"*50)
  10117. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  10118. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  10119. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  10120. */
  10121. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10122. __Pyx_GOTREF(__pyx_t_3);
  10123. __Pyx_INCREF(__pyx_v_result_list);
  10124. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  10125. __Pyx_GIVEREF(__pyx_v_result_list);
  10126. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10127. __Pyx_GOTREF(__pyx_t_8);
  10128. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10129. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10130. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10131. __Pyx_GOTREF(__pyx_t_3);
  10132. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10133. __Pyx_GOTREF(__pyx_t_2);
  10134. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10135. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10136. __pyx_v_mean = __pyx_t_2;
  10137. __pyx_t_2 = 0;
  10138. /* "lib/Naked/toolshed/c/benchmarking.pyx":397
  10139. * print("-"*50)
  10140. * mean = sum(result_list)/len(result_list)
  10141. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  10142. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  10143. * try:
  10144. */
  10145. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10146. __Pyx_GOTREF(__pyx_t_2);
  10147. __Pyx_INCREF(__pyx_v_benchmark_list);
  10148. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  10149. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  10150. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10151. __Pyx_GOTREF(__pyx_t_3);
  10152. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10153. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10154. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10155. __Pyx_GOTREF(__pyx_t_2);
  10156. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10157. __Pyx_GOTREF(__pyx_t_8);
  10158. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10159. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10160. __pyx_v_mean_benchmark = __pyx_t_8;
  10161. __pyx_t_8 = 0;
  10162. /* "lib/Naked/toolshed/c/benchmarking.pyx":398
  10163. * mean = sum(result_list)/len(result_list)
  10164. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  10165. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  10166. * try:
  10167. * import numpy as np
  10168. */
  10169. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10170. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10171. __Pyx_GOTREF(__pyx_t_8);
  10172. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  10173. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  10174. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  10175. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10176. __Pyx_GOTREF(__pyx_t_2);
  10177. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10178. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10179. __Pyx_GOTREF(__pyx_t_8);
  10180. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10181. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10182. __Pyx_GOTREF(__pyx_t_2);
  10183. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10184. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10185. __Pyx_GOTREF(__pyx_t_8);
  10186. __Pyx_INCREF(__pyx_v_mean);
  10187. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  10188. __Pyx_GIVEREF(__pyx_v_mean);
  10189. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10190. __Pyx_GOTREF(__pyx_t_3);
  10191. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10192. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10193. __Pyx_GOTREF(__pyx_t_8);
  10194. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10195. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10196. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10197. __Pyx_GOTREF(__pyx_t_3);
  10198. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10199. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 398; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10200. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10201. /* "lib/Naked/toolshed/c/benchmarking.pyx":399
  10202. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  10203. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  10204. * try: # <<<<<<<<<<<<<<
  10205. * import numpy as np
  10206. * array = np.array(result_list)
  10207. */
  10208. {
  10209. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  10210. __Pyx_XGOTREF(__pyx_t_12);
  10211. __Pyx_XGOTREF(__pyx_t_13);
  10212. __Pyx_XGOTREF(__pyx_t_14);
  10213. /*try:*/ {
  10214. /* "lib/Naked/toolshed/c/benchmarking.pyx":400
  10215. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  10216. * try:
  10217. * import numpy as np # <<<<<<<<<<<<<<
  10218. * array = np.array(result_list)
  10219. * print( "Standard Deviation: " + str(np.std(array)))
  10220. */
  10221. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10222. __Pyx_GOTREF(__pyx_t_3);
  10223. __pyx_v_np = __pyx_t_3;
  10224. __pyx_t_3 = 0;
  10225. /* "lib/Naked/toolshed/c/benchmarking.pyx":401
  10226. * try:
  10227. * import numpy as np
  10228. * array = np.array(result_list) # <<<<<<<<<<<<<<
  10229. * print( "Standard Deviation: " + str(np.std(array)))
  10230. * except ImportError as ie:
  10231. */
  10232. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10233. __Pyx_GOTREF(__pyx_t_3);
  10234. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10235. __Pyx_GOTREF(__pyx_t_8);
  10236. __Pyx_INCREF(__pyx_v_result_list);
  10237. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  10238. __Pyx_GIVEREF(__pyx_v_result_list);
  10239. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10240. __Pyx_GOTREF(__pyx_t_2);
  10241. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10242. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10243. __pyx_v_array = __pyx_t_2;
  10244. __pyx_t_2 = 0;
  10245. /* "lib/Naked/toolshed/c/benchmarking.pyx":402
  10246. * import numpy as np
  10247. * array = np.array(result_list)
  10248. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  10249. * except ImportError as ie:
  10250. * pass
  10251. */
  10252. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10253. __Pyx_GOTREF(__pyx_t_2);
  10254. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10255. __Pyx_GOTREF(__pyx_t_8);
  10256. __Pyx_INCREF(__pyx_v_array);
  10257. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  10258. __Pyx_GIVEREF(__pyx_v_array);
  10259. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10260. __Pyx_GOTREF(__pyx_t_3);
  10261. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10262. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10263. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10264. __Pyx_GOTREF(__pyx_t_8);
  10265. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  10266. __Pyx_GIVEREF(__pyx_t_3);
  10267. __pyx_t_3 = 0;
  10268. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10269. __Pyx_GOTREF(__pyx_t_3);
  10270. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10271. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10272. __Pyx_GOTREF(__pyx_t_8);
  10273. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10274. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  10275. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10276. }
  10277. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10278. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  10279. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  10280. goto __pyx_L20_try_end;
  10281. __pyx_L13_error:;
  10282. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  10283. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  10284. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  10285. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10286. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  10287. /* "lib/Naked/toolshed/c/benchmarking.pyx":403
  10288. * array = np.array(result_list)
  10289. * print( "Standard Deviation: " + str(np.std(array)))
  10290. * except ImportError as ie: # <<<<<<<<<<<<<<
  10291. * pass
  10292. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  10293. */
  10294. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  10295. if (__pyx_t_15) {
  10296. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10297. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  10298. __Pyx_GOTREF(__pyx_t_8);
  10299. __Pyx_GOTREF(__pyx_t_3);
  10300. __Pyx_GOTREF(__pyx_t_2);
  10301. __Pyx_INCREF(__pyx_t_3);
  10302. __pyx_v_ie = __pyx_t_3;
  10303. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10304. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10305. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10306. goto __pyx_L14_exception_handled;
  10307. }
  10308. goto __pyx_L15_except_error;
  10309. __pyx_L15_except_error:;
  10310. __Pyx_XGIVEREF(__pyx_t_12);
  10311. __Pyx_XGIVEREF(__pyx_t_13);
  10312. __Pyx_XGIVEREF(__pyx_t_14);
  10313. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  10314. goto __pyx_L1_error;
  10315. __pyx_L14_exception_handled:;
  10316. __Pyx_XGIVEREF(__pyx_t_12);
  10317. __Pyx_XGIVEREF(__pyx_t_13);
  10318. __Pyx_XGIVEREF(__pyx_t_14);
  10319. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  10320. __pyx_L20_try_end:;
  10321. }
  10322. /* "lib/Naked/toolshed/c/benchmarking.pyx":405
  10323. * except ImportError as ie:
  10324. * pass
  10325. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  10326. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  10327. * print("Ratio: " + str(mean/mean_benchmark))
  10328. */
  10329. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10330. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10331. __Pyx_GOTREF(__pyx_t_2);
  10332. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10333. __Pyx_GOTREF(__pyx_t_3);
  10334. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10335. __Pyx_GIVEREF(__pyx_t_2);
  10336. __pyx_t_2 = 0;
  10337. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10338. __Pyx_GOTREF(__pyx_t_2);
  10339. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10340. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10341. __Pyx_GOTREF(__pyx_t_3);
  10342. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10343. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10344. __Pyx_GOTREF(__pyx_t_2);
  10345. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10346. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10347. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10348. /* "lib/Naked/toolshed/c/benchmarking.pyx":406
  10349. * pass
  10350. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  10351. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  10352. * print("Ratio: " + str(mean/mean_benchmark))
  10353. * return result
  10354. */
  10355. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10356. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10357. __Pyx_GOTREF(__pyx_t_2);
  10358. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  10359. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  10360. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  10361. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10362. __Pyx_GOTREF(__pyx_t_3);
  10363. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10364. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10365. __Pyx_GOTREF(__pyx_t_2);
  10366. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10367. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10368. __Pyx_GOTREF(__pyx_t_3);
  10369. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10370. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10371. __Pyx_GOTREF(__pyx_t_2);
  10372. __Pyx_INCREF(__pyx_v_mean_benchmark);
  10373. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  10374. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  10375. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10376. __Pyx_GOTREF(__pyx_t_8);
  10377. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10378. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10379. __Pyx_GOTREF(__pyx_t_2);
  10380. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10381. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10382. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10383. __Pyx_GOTREF(__pyx_t_8);
  10384. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10385. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10386. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10387. /* "lib/Naked/toolshed/c/benchmarking.pyx":407
  10388. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  10389. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  10390. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  10391. * return result
  10392. * return wrapper
  10393. */
  10394. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10395. __Pyx_GOTREF(__pyx_t_8);
  10396. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10397. __Pyx_GOTREF(__pyx_t_2);
  10398. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  10399. __Pyx_GIVEREF(__pyx_t_8);
  10400. __pyx_t_8 = 0;
  10401. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10402. __Pyx_GOTREF(__pyx_t_8);
  10403. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10404. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10405. __Pyx_GOTREF(__pyx_t_2);
  10406. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10407. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10408. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10409. /* "lib/Naked/toolshed/c/benchmarking.pyx":408
  10410. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  10411. * print("Ratio: " + str(mean/mean_benchmark))
  10412. * return result # <<<<<<<<<<<<<<
  10413. * return wrapper
  10414. *
  10415. */
  10416. __Pyx_XDECREF(__pyx_r);
  10417. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 408; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10418. __Pyx_INCREF(__pyx_v_result);
  10419. __pyx_r = __pyx_v_result;
  10420. goto __pyx_L0;
  10421. /* "lib/Naked/toolshed/c/benchmarking.pyx":362
  10422. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  10423. * @wraps(func)
  10424. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  10425. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10426. * sys.stdout.flush()
  10427. */
  10428. /* function exit code */
  10429. __pyx_L1_error:;
  10430. __Pyx_XDECREF(__pyx_t_1);
  10431. __Pyx_XDECREF(__pyx_t_2);
  10432. __Pyx_XDECREF(__pyx_t_3);
  10433. __Pyx_XDECREF(__pyx_t_8);
  10434. __Pyx_XDECREF(__pyx_t_9);
  10435. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10436. __pyx_r = NULL;
  10437. __pyx_L0:;
  10438. __Pyx_XDECREF(__pyx_v_result_list);
  10439. __Pyx_XDECREF(__pyx_v_benchmark_list);
  10440. __Pyx_XDECREF(__pyx_v_x);
  10441. __Pyx_XDECREF(__pyx_v_start);
  10442. __Pyx_XDECREF(__pyx_v_y);
  10443. __Pyx_XDECREF(__pyx_v_end);
  10444. __Pyx_XDECREF(__pyx_v_result);
  10445. __Pyx_XDECREF(__pyx_v_L);
  10446. __Pyx_XDECREF(__pyx_v_start2);
  10447. __Pyx_XDECREF(__pyx_v_j);
  10448. __Pyx_XDECREF(__pyx_v_end2);
  10449. __Pyx_XDECREF(__pyx_v_n);
  10450. __Pyx_XDECREF(__pyx_v_run);
  10451. __Pyx_XDECREF(__pyx_v_mean);
  10452. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  10453. __Pyx_XDECREF(__pyx_v_np);
  10454. __Pyx_XDECREF(__pyx_v_array);
  10455. __Pyx_XDECREF(__pyx_v_ie);
  10456. __Pyx_XGIVEREF(__pyx_r);
  10457. __Pyx_RefNannyFinishContext();
  10458. return __pyx_r;
  10459. }
  10460. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  10461. * return wrapper
  10462. *
  10463. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  10464. * @wraps(func)
  10465. * def wrapper(*args, **kwargs):
  10466. */
  10467. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_20timer_trials_benchmark_10k(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  10468. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_cur_scope;
  10469. PyObject *__pyx_v_wrapper = 0;
  10470. PyObject *__pyx_r = NULL;
  10471. __Pyx_RefNannyDeclarations
  10472. PyObject *__pyx_t_1 = NULL;
  10473. PyObject *__pyx_t_2 = NULL;
  10474. PyObject *__pyx_t_3 = NULL;
  10475. int __pyx_lineno = 0;
  10476. const char *__pyx_filename = NULL;
  10477. int __pyx_clineno = 0;
  10478. __Pyx_RefNannySetupContext("timer_trials_benchmark_10k", 0);
  10479. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, __pyx_empty_tuple, NULL);
  10480. if (unlikely(!__pyx_cur_scope)) {
  10481. __Pyx_RefNannyFinishContext();
  10482. return NULL;
  10483. }
  10484. __Pyx_GOTREF(__pyx_cur_scope);
  10485. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  10486. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  10487. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  10488. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  10489. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  10490. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  10491. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  10492. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  10493. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  10494. /* "lib/Naked/toolshed/c/benchmarking.pyx":361
  10495. *
  10496. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  10497. * @wraps(func) # <<<<<<<<<<<<<<
  10498. * def wrapper(*args, **kwargs):
  10499. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10500. */
  10501. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10502. __Pyx_GOTREF(__pyx_t_1);
  10503. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10504. __Pyx_GOTREF(__pyx_t_2);
  10505. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  10506. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  10507. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  10508. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10509. __Pyx_GOTREF(__pyx_t_3);
  10510. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10511. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10512. /* "lib/Naked/toolshed/c/benchmarking.pyx":362
  10513. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  10514. * @wraps(func)
  10515. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  10516. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10517. * sys.stdout.flush()
  10518. */
  10519. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_26timer_trials_benchmark_10k_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_10k_local, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10520. __Pyx_GOTREF(__pyx_t_2);
  10521. /* "lib/Naked/toolshed/c/benchmarking.pyx":361
  10522. *
  10523. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  10524. * @wraps(func) # <<<<<<<<<<<<<<
  10525. * def wrapper(*args, **kwargs):
  10526. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10527. */
  10528. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10529. __Pyx_GOTREF(__pyx_t_1);
  10530. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  10531. __Pyx_GIVEREF(__pyx_t_2);
  10532. __pyx_t_2 = 0;
  10533. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10534. __Pyx_GOTREF(__pyx_t_2);
  10535. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10536. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10537. __pyx_v_wrapper = __pyx_t_2;
  10538. __pyx_t_2 = 0;
  10539. /* "lib/Naked/toolshed/c/benchmarking.pyx":409
  10540. * print("Ratio: " + str(mean/mean_benchmark))
  10541. * return result
  10542. * return wrapper # <<<<<<<<<<<<<<
  10543. *
  10544. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  10545. */
  10546. __Pyx_XDECREF(__pyx_r);
  10547. __Pyx_INCREF(__pyx_v_wrapper);
  10548. __pyx_r = __pyx_v_wrapper;
  10549. goto __pyx_L0;
  10550. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  10551. * return wrapper
  10552. *
  10553. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  10554. * @wraps(func)
  10555. * def wrapper(*args, **kwargs):
  10556. */
  10557. /* function exit code */
  10558. __pyx_L1_error:;
  10559. __Pyx_XDECREF(__pyx_t_1);
  10560. __Pyx_XDECREF(__pyx_t_2);
  10561. __Pyx_XDECREF(__pyx_t_3);
  10562. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_10k", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10563. __pyx_r = NULL;
  10564. __pyx_L0:;
  10565. __Pyx_XDECREF(__pyx_v_wrapper);
  10566. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  10567. __Pyx_XGIVEREF(__pyx_r);
  10568. __Pyx_RefNannyFinishContext();
  10569. return __pyx_r;
  10570. }
  10571. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  10572. * return wrapper
  10573. *
  10574. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  10575. * @wraps(func)
  10576. * def wrapper(*args, **kwargs):
  10577. */
  10578. /* Python wrapper */
  10579. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10580. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m = {__Pyx_NAMESTR("timer_trials_benchmark_1m"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  10581. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10582. PyObject *__pyx_v_func = 0;
  10583. PyObject *__pyx_v_repetitions = 0;
  10584. PyObject *__pyx_v_trials = 0;
  10585. int __pyx_lineno = 0;
  10586. const char *__pyx_filename = NULL;
  10587. int __pyx_clineno = 0;
  10588. PyObject *__pyx_r = 0;
  10589. __Pyx_RefNannyDeclarations
  10590. __Pyx_RefNannySetupContext("timer_trials_benchmark_1m (wrapper)", 0);
  10591. {
  10592. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_func,&__pyx_n_s_repetitions,&__pyx_n_s_trials,0};
  10593. PyObject* values[3] = {0,0,0};
  10594. values[1] = ((PyObject *)__pyx_int_1000000);
  10595. values[2] = ((PyObject *)__pyx_int_10);
  10596. if (unlikely(__pyx_kwds)) {
  10597. Py_ssize_t kw_args;
  10598. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  10599. switch (pos_args) {
  10600. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10601. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10602. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10603. case 0: break;
  10604. default: goto __pyx_L5_argtuple_error;
  10605. }
  10606. kw_args = PyDict_Size(__pyx_kwds);
  10607. switch (pos_args) {
  10608. case 0:
  10609. if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_func)) != 0)) kw_args--;
  10610. else goto __pyx_L5_argtuple_error;
  10611. case 1:
  10612. if (kw_args > 0) {
  10613. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_repetitions);
  10614. if (value) { values[1] = value; kw_args--; }
  10615. }
  10616. case 2:
  10617. if (kw_args > 0) {
  10618. PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_trials);
  10619. if (value) { values[2] = value; kw_args--; }
  10620. }
  10621. }
  10622. if (unlikely(kw_args > 0)) {
  10623. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "timer_trials_benchmark_1m") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  10624. }
  10625. } else {
  10626. switch (PyTuple_GET_SIZE(__pyx_args)) {
  10627. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10628. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10629. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10630. break;
  10631. default: goto __pyx_L5_argtuple_error;
  10632. }
  10633. }
  10634. __pyx_v_func = values[0];
  10635. __pyx_v_repetitions = values[1];
  10636. __pyx_v_trials = values[2];
  10637. }
  10638. goto __pyx_L4_argument_unpacking_done;
  10639. __pyx_L5_argtuple_error:;
  10640. __Pyx_RaiseArgtupleInvalid("timer_trials_benchmark_1m", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  10641. __pyx_L3_error:;
  10642. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10643. __Pyx_RefNannyFinishContext();
  10644. return NULL;
  10645. __pyx_L4_argument_unpacking_done:;
  10646. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(__pyx_self, __pyx_v_func, __pyx_v_repetitions, __pyx_v_trials);
  10647. /* function exit code */
  10648. __Pyx_RefNannyFinishContext();
  10649. return __pyx_r;
  10650. }
  10651. /* "lib/Naked/toolshed/c/benchmarking.pyx":413
  10652. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  10653. * @wraps(func)
  10654. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  10655. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10656. * sys.stdout.flush()
  10657. */
  10658. /* Python wrapper */
  10659. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10660. static PyMethodDef __pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper = {__Pyx_NAMESTR("wrapper"), (PyCFunction)__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
  10661. static PyObject *__pyx_pw_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10662. PyObject *__pyx_v_args = 0;
  10663. PyObject *__pyx_v_kwargs = 0;
  10664. PyObject *__pyx_r = 0;
  10665. __Pyx_RefNannyDeclarations
  10666. __Pyx_RefNannySetupContext("wrapper (wrapper)", 0);
  10667. if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "wrapper", 1))) return NULL;
  10668. __pyx_v_kwargs = (__pyx_kwds) ? PyDict_Copy(__pyx_kwds) : PyDict_New();
  10669. if (unlikely(!__pyx_v_kwargs)) return NULL;
  10670. __Pyx_GOTREF(__pyx_v_kwargs);
  10671. __Pyx_INCREF(__pyx_args);
  10672. __pyx_v_args = __pyx_args;
  10673. __pyx_r = __pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(__pyx_self, __pyx_v_args, __pyx_v_kwargs);
  10674. /* function exit code */
  10675. __Pyx_XDECREF(__pyx_v_args);
  10676. __Pyx_XDECREF(__pyx_v_kwargs);
  10677. __Pyx_RefNannyFinishContext();
  10678. return __pyx_r;
  10679. }
  10680. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_wrapper(PyObject *__pyx_self, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  10681. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope;
  10682. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_outer_scope;
  10683. PyObject *__pyx_v_result_list = NULL;
  10684. PyObject *__pyx_v_benchmark_list = NULL;
  10685. CYTHON_UNUSED PyObject *__pyx_v_x = NULL;
  10686. PyObject *__pyx_v_start = NULL;
  10687. CYTHON_UNUSED PyObject *__pyx_v_y = NULL;
  10688. PyObject *__pyx_v_end = NULL;
  10689. PyObject *__pyx_v_result = NULL;
  10690. PyObject *__pyx_v_L = NULL;
  10691. PyObject *__pyx_v_start2 = NULL;
  10692. CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  10693. long __pyx_v_i;
  10694. PyObject *__pyx_v_end2 = NULL;
  10695. PyObject *__pyx_v_n = NULL;
  10696. PyObject *__pyx_v_run = NULL;
  10697. PyObject *__pyx_v_mean = NULL;
  10698. PyObject *__pyx_v_mean_benchmark = NULL;
  10699. PyObject *__pyx_v_np = NULL;
  10700. PyObject *__pyx_v_array = NULL;
  10701. CYTHON_UNUSED PyObject *__pyx_v_ie = NULL;
  10702. PyObject *__pyx_r = NULL;
  10703. __Pyx_RefNannyDeclarations
  10704. PyObject *__pyx_t_1 = NULL;
  10705. PyObject *__pyx_t_2 = NULL;
  10706. PyObject *__pyx_t_3 = NULL;
  10707. Py_ssize_t __pyx_t_4;
  10708. PyObject *(*__pyx_t_5)(PyObject *);
  10709. Py_ssize_t __pyx_t_6;
  10710. PyObject *(*__pyx_t_7)(PyObject *);
  10711. PyObject *__pyx_t_8 = NULL;
  10712. PyObject *__pyx_t_9 = NULL;
  10713. int __pyx_t_10;
  10714. long __pyx_t_11;
  10715. PyObject *__pyx_t_12 = NULL;
  10716. PyObject *__pyx_t_13 = NULL;
  10717. PyObject *__pyx_t_14 = NULL;
  10718. int __pyx_t_15;
  10719. int __pyx_lineno = 0;
  10720. const char *__pyx_filename = NULL;
  10721. int __pyx_clineno = 0;
  10722. __Pyx_RefNannySetupContext("wrapper", 0);
  10723. __pyx_outer_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *) __Pyx_CyFunction_GetClosure(__pyx_self);
  10724. __pyx_cur_scope = __pyx_outer_scope;
  10725. /* "lib/Naked/toolshed/c/benchmarking.pyx":414
  10726. * @wraps(func)
  10727. * def wrapper(*args, **kwargs):
  10728. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()") # <<<<<<<<<<<<<<
  10729. * sys.stdout.flush()
  10730. * result_list = []
  10731. */
  10732. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10733. __Pyx_GOTREF(__pyx_t_1);
  10734. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_stdout); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10735. __Pyx_GOTREF(__pyx_t_2);
  10736. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10737. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_write); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10738. __Pyx_GOTREF(__pyx_t_1);
  10739. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10740. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10741. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_func, __pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10742. __Pyx_GOTREF(__pyx_t_2);
  10743. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Starting_timed_trials_of, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10744. __Pyx_GOTREF(__pyx_t_3);
  10745. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10746. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s__16); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10747. __Pyx_GOTREF(__pyx_t_2);
  10748. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10749. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10750. __Pyx_GOTREF(__pyx_t_3);
  10751. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10752. __Pyx_GIVEREF(__pyx_t_2);
  10753. __pyx_t_2 = 0;
  10754. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10755. __Pyx_GOTREF(__pyx_t_2);
  10756. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10757. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10758. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10759. /* "lib/Naked/toolshed/c/benchmarking.pyx":415
  10760. * def wrapper(*args, **kwargs):
  10761. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10762. * sys.stdout.flush() # <<<<<<<<<<<<<<
  10763. * result_list = []
  10764. * benchmark_list = []
  10765. */
  10766. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10767. __Pyx_GOTREF(__pyx_t_2);
  10768. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_stdout); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10769. __Pyx_GOTREF(__pyx_t_3);
  10770. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10771. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_flush); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10772. __Pyx_GOTREF(__pyx_t_2);
  10773. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10774. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10775. __Pyx_GOTREF(__pyx_t_3);
  10776. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10777. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10778. /* "lib/Naked/toolshed/c/benchmarking.pyx":416
  10779. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  10780. * sys.stdout.flush()
  10781. * result_list = [] # <<<<<<<<<<<<<<
  10782. * benchmark_list = []
  10783. * # disable garbage collection
  10784. */
  10785. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10786. __Pyx_GOTREF(__pyx_t_3);
  10787. __pyx_v_result_list = ((PyObject*)__pyx_t_3);
  10788. __pyx_t_3 = 0;
  10789. /* "lib/Naked/toolshed/c/benchmarking.pyx":417
  10790. * sys.stdout.flush()
  10791. * result_list = []
  10792. * benchmark_list = [] # <<<<<<<<<<<<<<
  10793. * # disable garbage collection
  10794. * gc.collect()
  10795. */
  10796. __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10797. __Pyx_GOTREF(__pyx_t_3);
  10798. __pyx_v_benchmark_list = ((PyObject*)__pyx_t_3);
  10799. __pyx_t_3 = 0;
  10800. /* "lib/Naked/toolshed/c/benchmarking.pyx":419
  10801. * benchmark_list = []
  10802. * # disable garbage collection
  10803. * gc.collect() # <<<<<<<<<<<<<<
  10804. * gc.disable()
  10805. * for x in range(trials):
  10806. */
  10807. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10808. __Pyx_GOTREF(__pyx_t_3);
  10809. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10810. __Pyx_GOTREF(__pyx_t_2);
  10811. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10812. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10813. __Pyx_GOTREF(__pyx_t_3);
  10814. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10815. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10816. /* "lib/Naked/toolshed/c/benchmarking.pyx":420
  10817. * # disable garbage collection
  10818. * gc.collect()
  10819. * gc.disable() # <<<<<<<<<<<<<<
  10820. * for x in range(trials):
  10821. * # test function
  10822. */
  10823. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10824. __Pyx_GOTREF(__pyx_t_3);
  10825. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_disable); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10826. __Pyx_GOTREF(__pyx_t_2);
  10827. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10828. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10829. __Pyx_GOTREF(__pyx_t_3);
  10830. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10831. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10832. /* "lib/Naked/toolshed/c/benchmarking.pyx":421
  10833. * gc.collect()
  10834. * gc.disable()
  10835. * for x in range(trials): # <<<<<<<<<<<<<<
  10836. * # test function
  10837. * start = time.time()
  10838. */
  10839. if (unlikely(!__pyx_cur_scope->__pyx_v_trials)) { __Pyx_RaiseClosureNameError("trials"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10840. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10841. __Pyx_GOTREF(__pyx_t_3);
  10842. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  10843. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_cur_scope->__pyx_v_trials);
  10844. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  10845. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10846. __Pyx_GOTREF(__pyx_t_2);
  10847. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10848. if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
  10849. __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  10850. __pyx_t_5 = NULL;
  10851. } else {
  10852. __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10853. __Pyx_GOTREF(__pyx_t_3);
  10854. __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext;
  10855. }
  10856. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10857. for (;;) {
  10858. if (!__pyx_t_5 && PyList_CheckExact(__pyx_t_3)) {
  10859. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10860. #if CYTHON_COMPILING_IN_CPYTHON
  10861. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10862. #else
  10863. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10864. #endif
  10865. } else if (!__pyx_t_5 && PyTuple_CheckExact(__pyx_t_3)) {
  10866. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  10867. #if CYTHON_COMPILING_IN_CPYTHON
  10868. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10869. #else
  10870. __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10871. #endif
  10872. } else {
  10873. __pyx_t_2 = __pyx_t_5(__pyx_t_3);
  10874. if (unlikely(!__pyx_t_2)) {
  10875. PyObject* exc_type = PyErr_Occurred();
  10876. if (exc_type) {
  10877. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10878. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10879. }
  10880. break;
  10881. }
  10882. __Pyx_GOTREF(__pyx_t_2);
  10883. }
  10884. __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_2);
  10885. __pyx_t_2 = 0;
  10886. /* "lib/Naked/toolshed/c/benchmarking.pyx":423
  10887. * for x in range(trials):
  10888. * # test function
  10889. * start = time.time() # <<<<<<<<<<<<<<
  10890. * for y in range(repetitions):
  10891. * func(*args, **kwargs)
  10892. */
  10893. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10894. __Pyx_GOTREF(__pyx_t_2);
  10895. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10896. __Pyx_GOTREF(__pyx_t_1);
  10897. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10898. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10899. __Pyx_GOTREF(__pyx_t_2);
  10900. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10901. __Pyx_XDECREF_SET(__pyx_v_start, __pyx_t_2);
  10902. __pyx_t_2 = 0;
  10903. /* "lib/Naked/toolshed/c/benchmarking.pyx":424
  10904. * # test function
  10905. * start = time.time()
  10906. * for y in range(repetitions): # <<<<<<<<<<<<<<
  10907. * func(*args, **kwargs)
  10908. * end = time.time()
  10909. */
  10910. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10911. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10912. __Pyx_GOTREF(__pyx_t_2);
  10913. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  10914. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  10915. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  10916. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10917. __Pyx_GOTREF(__pyx_t_1);
  10918. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10919. if (PyList_CheckExact(__pyx_t_1) || PyTuple_CheckExact(__pyx_t_1)) {
  10920. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
  10921. __pyx_t_7 = NULL;
  10922. } else {
  10923. __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10924. __Pyx_GOTREF(__pyx_t_2);
  10925. __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext;
  10926. }
  10927. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10928. for (;;) {
  10929. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_2)) {
  10930. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
  10931. #if CYTHON_COMPILING_IN_CPYTHON
  10932. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10933. #else
  10934. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10935. #endif
  10936. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_2)) {
  10937. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  10938. #if CYTHON_COMPILING_IN_CPYTHON
  10939. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10940. #else
  10941. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10942. #endif
  10943. } else {
  10944. __pyx_t_1 = __pyx_t_7(__pyx_t_2);
  10945. if (unlikely(!__pyx_t_1)) {
  10946. PyObject* exc_type = PyErr_Occurred();
  10947. if (exc_type) {
  10948. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10949. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10950. }
  10951. break;
  10952. }
  10953. __Pyx_GOTREF(__pyx_t_1);
  10954. }
  10955. __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_1);
  10956. __pyx_t_1 = 0;
  10957. /* "lib/Naked/toolshed/c/benchmarking.pyx":425
  10958. * start = time.time()
  10959. * for y in range(repetitions):
  10960. * func(*args, **kwargs) # <<<<<<<<<<<<<<
  10961. * end = time.time()
  10962. * result = func(*args, **kwargs)
  10963. */
  10964. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  10965. __pyx_t_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10966. __Pyx_GOTREF(__pyx_t_1);
  10967. __pyx_t_8 = __pyx_v_kwargs;
  10968. __Pyx_INCREF(__pyx_t_8);
  10969. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10970. __Pyx_GOTREF(__pyx_t_9);
  10971. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10972. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  10973. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10974. }
  10975. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10976. /* "lib/Naked/toolshed/c/benchmarking.pyx":426
  10977. * for y in range(repetitions):
  10978. * func(*args, **kwargs)
  10979. * end = time.time() # <<<<<<<<<<<<<<
  10980. * result = func(*args, **kwargs)
  10981. * result_list.append(end-start)
  10982. */
  10983. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10984. __Pyx_GOTREF(__pyx_t_2);
  10985. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10986. __Pyx_GOTREF(__pyx_t_9);
  10987. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10988. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  10989. __Pyx_GOTREF(__pyx_t_2);
  10990. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10991. __Pyx_XDECREF_SET(__pyx_v_end, __pyx_t_2);
  10992. __pyx_t_2 = 0;
  10993. /* "lib/Naked/toolshed/c/benchmarking.pyx":427
  10994. * func(*args, **kwargs)
  10995. * end = time.time()
  10996. * result = func(*args, **kwargs) # <<<<<<<<<<<<<<
  10997. * result_list.append(end-start)
  10998. * # benchmark function
  10999. */
  11000. if (unlikely(!__pyx_cur_scope->__pyx_v_func)) { __Pyx_RaiseClosureNameError("func"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11001. __pyx_t_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11002. __Pyx_GOTREF(__pyx_t_2);
  11003. __pyx_t_9 = __pyx_v_kwargs;
  11004. __Pyx_INCREF(__pyx_t_9);
  11005. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_cur_scope->__pyx_v_func, __pyx_t_2, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11006. __Pyx_GOTREF(__pyx_t_8);
  11007. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11008. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11009. __Pyx_XDECREF_SET(__pyx_v_result, __pyx_t_8);
  11010. __pyx_t_8 = 0;
  11011. /* "lib/Naked/toolshed/c/benchmarking.pyx":428
  11012. * end = time.time()
  11013. * result = func(*args, **kwargs)
  11014. * result_list.append(end-start) # <<<<<<<<<<<<<<
  11015. * # benchmark function
  11016. * L = []
  11017. */
  11018. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end, __pyx_v_start); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11019. __Pyx_GOTREF(__pyx_t_8);
  11020. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_result_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11021. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11022. /* "lib/Naked/toolshed/c/benchmarking.pyx":430
  11023. * result_list.append(end-start)
  11024. * # benchmark function
  11025. * L = [] # <<<<<<<<<<<<<<
  11026. * start2 = time.time()
  11027. * for j in range(repetitions):
  11028. */
  11029. __pyx_t_8 = PyList_New(0); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 430; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11030. __Pyx_GOTREF(__pyx_t_8);
  11031. __Pyx_XDECREF_SET(__pyx_v_L, ((PyObject*)__pyx_t_8));
  11032. __pyx_t_8 = 0;
  11033. /* "lib/Naked/toolshed/c/benchmarking.pyx":431
  11034. * # benchmark function
  11035. * L = []
  11036. * start2 = time.time() # <<<<<<<<<<<<<<
  11037. * for j in range(repetitions):
  11038. * for i in range(10):
  11039. */
  11040. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11041. __Pyx_GOTREF(__pyx_t_8);
  11042. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11043. __Pyx_GOTREF(__pyx_t_9);
  11044. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11045. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11046. __Pyx_GOTREF(__pyx_t_8);
  11047. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11048. __Pyx_XDECREF_SET(__pyx_v_start2, __pyx_t_8);
  11049. __pyx_t_8 = 0;
  11050. /* "lib/Naked/toolshed/c/benchmarking.pyx":432
  11051. * L = []
  11052. * start2 = time.time()
  11053. * for j in range(repetitions): # <<<<<<<<<<<<<<
  11054. * for i in range(10):
  11055. * L.append(i)
  11056. */
  11057. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11058. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11059. __Pyx_GOTREF(__pyx_t_8);
  11060. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  11061. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  11062. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  11063. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11064. __Pyx_GOTREF(__pyx_t_9);
  11065. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11066. if (PyList_CheckExact(__pyx_t_9) || PyTuple_CheckExact(__pyx_t_9)) {
  11067. __pyx_t_8 = __pyx_t_9; __Pyx_INCREF(__pyx_t_8); __pyx_t_6 = 0;
  11068. __pyx_t_7 = NULL;
  11069. } else {
  11070. __pyx_t_6 = -1; __pyx_t_8 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11071. __Pyx_GOTREF(__pyx_t_8);
  11072. __pyx_t_7 = Py_TYPE(__pyx_t_8)->tp_iternext;
  11073. }
  11074. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11075. for (;;) {
  11076. if (!__pyx_t_7 && PyList_CheckExact(__pyx_t_8)) {
  11077. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_8)) break;
  11078. #if CYTHON_COMPILING_IN_CPYTHON
  11079. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11080. #else
  11081. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11082. #endif
  11083. } else if (!__pyx_t_7 && PyTuple_CheckExact(__pyx_t_8)) {
  11084. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_8)) break;
  11085. #if CYTHON_COMPILING_IN_CPYTHON
  11086. __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_8, __pyx_t_6); __Pyx_INCREF(__pyx_t_9); __pyx_t_6++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11087. #else
  11088. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11089. #endif
  11090. } else {
  11091. __pyx_t_9 = __pyx_t_7(__pyx_t_8);
  11092. if (unlikely(!__pyx_t_9)) {
  11093. PyObject* exc_type = PyErr_Occurred();
  11094. if (exc_type) {
  11095. if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11096. else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 432; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11097. }
  11098. break;
  11099. }
  11100. __Pyx_GOTREF(__pyx_t_9);
  11101. }
  11102. __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_9);
  11103. __pyx_t_9 = 0;
  11104. /* "lib/Naked/toolshed/c/benchmarking.pyx":433
  11105. * start2 = time.time()
  11106. * for j in range(repetitions):
  11107. * for i in range(10): # <<<<<<<<<<<<<<
  11108. * L.append(i)
  11109. * end2 = time.time()
  11110. */
  11111. for (__pyx_t_11 = 0; __pyx_t_11 < 10; __pyx_t_11+=1) {
  11112. __pyx_v_i = __pyx_t_11;
  11113. /* "lib/Naked/toolshed/c/benchmarking.pyx":434
  11114. * for j in range(repetitions):
  11115. * for i in range(10):
  11116. * L.append(i) # <<<<<<<<<<<<<<
  11117. * end2 = time.time()
  11118. * benchmark_list.append(end2 - start2)
  11119. */
  11120. __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11121. __Pyx_GOTREF(__pyx_t_9);
  11122. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_L, __pyx_t_9); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11123. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11124. }
  11125. }
  11126. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11127. /* "lib/Naked/toolshed/c/benchmarking.pyx":435
  11128. * for i in range(10):
  11129. * L.append(i)
  11130. * end2 = time.time() # <<<<<<<<<<<<<<
  11131. * benchmark_list.append(end2 - start2)
  11132. * sys.stdout.write(".")
  11133. */
  11134. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_time); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11135. __Pyx_GOTREF(__pyx_t_8);
  11136. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_time); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11137. __Pyx_GOTREF(__pyx_t_9);
  11138. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11139. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11140. __Pyx_GOTREF(__pyx_t_8);
  11141. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11142. __Pyx_XDECREF_SET(__pyx_v_end2, __pyx_t_8);
  11143. __pyx_t_8 = 0;
  11144. /* "lib/Naked/toolshed/c/benchmarking.pyx":436
  11145. * L.append(i)
  11146. * end2 = time.time()
  11147. * benchmark_list.append(end2 - start2) # <<<<<<<<<<<<<<
  11148. * sys.stdout.write(".")
  11149. * sys.stdout.flush()
  11150. */
  11151. __pyx_t_8 = PyNumber_Subtract(__pyx_v_end2, __pyx_v_start2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11152. __Pyx_GOTREF(__pyx_t_8);
  11153. __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_benchmark_list, __pyx_t_8); if (unlikely(__pyx_t_10 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11154. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11155. /* "lib/Naked/toolshed/c/benchmarking.pyx":437
  11156. * end2 = time.time()
  11157. * benchmark_list.append(end2 - start2)
  11158. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  11159. * sys.stdout.flush()
  11160. * gc.enable() # re-enable garbage collection
  11161. */
  11162. __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11163. __Pyx_GOTREF(__pyx_t_8);
  11164. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_stdout); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11165. __Pyx_GOTREF(__pyx_t_9);
  11166. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11167. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_write); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11168. __Pyx_GOTREF(__pyx_t_8);
  11169. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11170. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11171. __Pyx_GOTREF(__pyx_t_9);
  11172. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11173. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11174. /* "lib/Naked/toolshed/c/benchmarking.pyx":438
  11175. * benchmark_list.append(end2 - start2)
  11176. * sys.stdout.write(".")
  11177. * sys.stdout.flush() # <<<<<<<<<<<<<<
  11178. * gc.enable() # re-enable garbage collection
  11179. * gc.collect()
  11180. */
  11181. __pyx_t_9 = __Pyx_GetModuleGlobalName(__pyx_n_s_sys); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11182. __Pyx_GOTREF(__pyx_t_9);
  11183. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_stdout); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11184. __Pyx_GOTREF(__pyx_t_8);
  11185. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11186. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_flush); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11187. __Pyx_GOTREF(__pyx_t_9);
  11188. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11189. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11190. __Pyx_GOTREF(__pyx_t_8);
  11191. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11192. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11193. }
  11194. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11195. /* "lib/Naked/toolshed/c/benchmarking.pyx":439
  11196. * sys.stdout.write(".")
  11197. * sys.stdout.flush()
  11198. * gc.enable() # re-enable garbage collection # <<<<<<<<<<<<<<
  11199. * gc.collect()
  11200. * print(" ")
  11201. */
  11202. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11203. __Pyx_GOTREF(__pyx_t_3);
  11204. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_enable); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11205. __Pyx_GOTREF(__pyx_t_8);
  11206. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11207. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11208. __Pyx_GOTREF(__pyx_t_3);
  11209. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11210. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11211. /* "lib/Naked/toolshed/c/benchmarking.pyx":440
  11212. * sys.stdout.flush()
  11213. * gc.enable() # re-enable garbage collection
  11214. * gc.collect() # <<<<<<<<<<<<<<
  11215. * print(" ")
  11216. * n = 1
  11217. */
  11218. __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_gc); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11219. __Pyx_GOTREF(__pyx_t_3);
  11220. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_collect); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11221. __Pyx_GOTREF(__pyx_t_8);
  11222. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11223. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_empty_tuple, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11224. __Pyx_GOTREF(__pyx_t_3);
  11225. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11226. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11227. /* "lib/Naked/toolshed/c/benchmarking.pyx":441
  11228. * gc.enable() # re-enable garbage collection
  11229. * gc.collect()
  11230. * print(" ") # <<<<<<<<<<<<<<
  11231. * n = 1
  11232. * for run in result_list:
  11233. */
  11234. if (__Pyx_PrintOne(0, __pyx_kp_s__2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 441; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11235. /* "lib/Naked/toolshed/c/benchmarking.pyx":442
  11236. * gc.collect()
  11237. * print(" ")
  11238. * n = 1 # <<<<<<<<<<<<<<
  11239. * for run in result_list:
  11240. * print("Trial " + str(n) + ":\t" + str(run))
  11241. */
  11242. __Pyx_INCREF(__pyx_int_1);
  11243. __pyx_v_n = __pyx_int_1;
  11244. /* "lib/Naked/toolshed/c/benchmarking.pyx":443
  11245. * print(" ")
  11246. * n = 1
  11247. * for run in result_list: # <<<<<<<<<<<<<<
  11248. * print("Trial " + str(n) + ":\t" + str(run))
  11249. * n += 1
  11250. */
  11251. __pyx_t_3 = __pyx_v_result_list; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
  11252. for (;;) {
  11253. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
  11254. #if CYTHON_COMPILING_IN_CPYTHON
  11255. __pyx_t_8 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_8); __pyx_t_4++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11256. #else
  11257. __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 443; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11258. #endif
  11259. __Pyx_XDECREF_SET(__pyx_v_run, __pyx_t_8);
  11260. __pyx_t_8 = 0;
  11261. /* "lib/Naked/toolshed/c/benchmarking.pyx":444
  11262. * n = 1
  11263. * for run in result_list:
  11264. * print("Trial " + str(n) + ":\t" + str(run)) # <<<<<<<<<<<<<<
  11265. * n += 1
  11266. * print("-"*50)
  11267. */
  11268. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11269. __Pyx_GOTREF(__pyx_t_8);
  11270. __Pyx_INCREF(__pyx_v_n);
  11271. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_n);
  11272. __Pyx_GIVEREF(__pyx_v_n);
  11273. __pyx_t_9 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11274. __Pyx_GOTREF(__pyx_t_9);
  11275. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11276. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Trial, __pyx_t_9); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11277. __Pyx_GOTREF(__pyx_t_8);
  11278. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11279. __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_kp_s__19); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11280. __Pyx_GOTREF(__pyx_t_9);
  11281. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11282. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11283. __Pyx_GOTREF(__pyx_t_8);
  11284. __Pyx_INCREF(__pyx_v_run);
  11285. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_run);
  11286. __Pyx_GIVEREF(__pyx_v_run);
  11287. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11288. __Pyx_GOTREF(__pyx_t_2);
  11289. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11290. __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11291. __Pyx_GOTREF(__pyx_t_8);
  11292. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  11293. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11294. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11295. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11296. /* "lib/Naked/toolshed/c/benchmarking.pyx":445
  11297. * for run in result_list:
  11298. * print("Trial " + str(n) + ":\t" + str(run))
  11299. * n += 1 # <<<<<<<<<<<<<<
  11300. * print("-"*50)
  11301. * mean = sum(result_list)/len(result_list)
  11302. */
  11303. __pyx_t_8 = PyNumber_InPlaceAdd(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11304. __Pyx_GOTREF(__pyx_t_8);
  11305. __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_8);
  11306. __pyx_t_8 = 0;
  11307. }
  11308. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11309. /* "lib/Naked/toolshed/c/benchmarking.pyx":446
  11310. * print("Trial " + str(n) + ":\t" + str(run))
  11311. * n += 1
  11312. * print("-"*50) # <<<<<<<<<<<<<<
  11313. * mean = sum(result_list)/len(result_list)
  11314. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  11315. */
  11316. __pyx_t_3 = PyNumber_Multiply(__pyx_kp_s__20, __pyx_int_50); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11317. __Pyx_GOTREF(__pyx_t_3);
  11318. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11319. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11320. /* "lib/Naked/toolshed/c/benchmarking.pyx":447
  11321. * n += 1
  11322. * print("-"*50)
  11323. * mean = sum(result_list)/len(result_list) # <<<<<<<<<<<<<<
  11324. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  11325. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  11326. */
  11327. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11328. __Pyx_GOTREF(__pyx_t_3);
  11329. __Pyx_INCREF(__pyx_v_result_list);
  11330. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_result_list);
  11331. __Pyx_GIVEREF(__pyx_v_result_list);
  11332. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_3, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11333. __Pyx_GOTREF(__pyx_t_8);
  11334. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11335. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_result_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11336. __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11337. __Pyx_GOTREF(__pyx_t_3);
  11338. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_8, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11339. __Pyx_GOTREF(__pyx_t_2);
  11340. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11341. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11342. __pyx_v_mean = __pyx_t_2;
  11343. __pyx_t_2 = 0;
  11344. /* "lib/Naked/toolshed/c/benchmarking.pyx":448
  11345. * print("-"*50)
  11346. * mean = sum(result_list)/len(result_list)
  11347. * mean_benchmark = sum(benchmark_list)/len(benchmark_list) # <<<<<<<<<<<<<<
  11348. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  11349. * try:
  11350. */
  11351. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11352. __Pyx_GOTREF(__pyx_t_2);
  11353. __Pyx_INCREF(__pyx_v_benchmark_list);
  11354. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_benchmark_list);
  11355. __Pyx_GIVEREF(__pyx_v_benchmark_list);
  11356. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11357. __Pyx_GOTREF(__pyx_t_3);
  11358. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11359. __pyx_t_4 = PyList_GET_SIZE(__pyx_v_benchmark_list); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11360. __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11361. __Pyx_GOTREF(__pyx_t_2);
  11362. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11363. __Pyx_GOTREF(__pyx_t_8);
  11364. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11365. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11366. __pyx_v_mean_benchmark = __pyx_t_8;
  11367. __pyx_t_8 = 0;
  11368. /* "lib/Naked/toolshed/c/benchmarking.pyx":449
  11369. * mean = sum(result_list)/len(result_list)
  11370. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  11371. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec") # <<<<<<<<<<<<<<
  11372. * try:
  11373. * import numpy as np
  11374. */
  11375. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11376. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11377. __Pyx_GOTREF(__pyx_t_8);
  11378. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  11379. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_cur_scope->__pyx_v_repetitions);
  11380. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  11381. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11382. __Pyx_GOTREF(__pyx_t_2);
  11383. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11384. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_2); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11385. __Pyx_GOTREF(__pyx_t_8);
  11386. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11387. __pyx_t_2 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_repetitions_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11388. __Pyx_GOTREF(__pyx_t_2);
  11389. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11390. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11391. __Pyx_GOTREF(__pyx_t_8);
  11392. __Pyx_INCREF(__pyx_v_mean);
  11393. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_mean);
  11394. __Pyx_GIVEREF(__pyx_v_mean);
  11395. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11396. __Pyx_GOTREF(__pyx_t_3);
  11397. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11398. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11399. __Pyx_GOTREF(__pyx_t_8);
  11400. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11401. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11402. __pyx_t_3 = PyNumber_Add(__pyx_t_8, __pyx_kp_s_sec); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11403. __Pyx_GOTREF(__pyx_t_3);
  11404. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11405. if (__Pyx_PrintOne(0, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11406. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11407. /* "lib/Naked/toolshed/c/benchmarking.pyx":450
  11408. * mean_benchmark = sum(benchmark_list)/len(benchmark_list)
  11409. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  11410. * try: # <<<<<<<<<<<<<<
  11411. * import numpy as np
  11412. * array = np.array(result_list)
  11413. */
  11414. {
  11415. __Pyx_ExceptionSave(&__pyx_t_12, &__pyx_t_13, &__pyx_t_14);
  11416. __Pyx_XGOTREF(__pyx_t_12);
  11417. __Pyx_XGOTREF(__pyx_t_13);
  11418. __Pyx_XGOTREF(__pyx_t_14);
  11419. /*try:*/ {
  11420. /* "lib/Naked/toolshed/c/benchmarking.pyx":451
  11421. * print("Mean for " + str(repetitions) + " repetitions: " + str(mean) + " sec")
  11422. * try:
  11423. * import numpy as np # <<<<<<<<<<<<<<
  11424. * array = np.array(result_list)
  11425. * print( "Standard Deviation: " + str(np.std(array)))
  11426. */
  11427. __pyx_t_3 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11428. __Pyx_GOTREF(__pyx_t_3);
  11429. __pyx_v_np = __pyx_t_3;
  11430. __pyx_t_3 = 0;
  11431. /* "lib/Naked/toolshed/c/benchmarking.pyx":452
  11432. * try:
  11433. * import numpy as np
  11434. * array = np.array(result_list) # <<<<<<<<<<<<<<
  11435. * print( "Standard Deviation: " + str(np.std(array)))
  11436. * except ImportError as ie:
  11437. */
  11438. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11439. __Pyx_GOTREF(__pyx_t_3);
  11440. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11441. __Pyx_GOTREF(__pyx_t_8);
  11442. __Pyx_INCREF(__pyx_v_result_list);
  11443. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_result_list);
  11444. __Pyx_GIVEREF(__pyx_v_result_list);
  11445. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11446. __Pyx_GOTREF(__pyx_t_2);
  11447. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11448. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11449. __pyx_v_array = __pyx_t_2;
  11450. __pyx_t_2 = 0;
  11451. /* "lib/Naked/toolshed/c/benchmarking.pyx":453
  11452. * import numpy as np
  11453. * array = np.array(result_list)
  11454. * print( "Standard Deviation: " + str(np.std(array))) # <<<<<<<<<<<<<<
  11455. * except ImportError as ie:
  11456. * pass
  11457. */
  11458. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_np, __pyx_n_s_std); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11459. __Pyx_GOTREF(__pyx_t_2);
  11460. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11461. __Pyx_GOTREF(__pyx_t_8);
  11462. __Pyx_INCREF(__pyx_v_array);
  11463. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_array);
  11464. __Pyx_GIVEREF(__pyx_v_array);
  11465. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11466. __Pyx_GOTREF(__pyx_t_3);
  11467. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11468. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11469. __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11470. __Pyx_GOTREF(__pyx_t_8);
  11471. PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_3);
  11472. __Pyx_GIVEREF(__pyx_t_3);
  11473. __pyx_t_3 = 0;
  11474. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11475. __Pyx_GOTREF(__pyx_t_3);
  11476. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11477. __pyx_t_8 = PyNumber_Add(__pyx_kp_s_Standard_Deviation, __pyx_t_3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11478. __Pyx_GOTREF(__pyx_t_8);
  11479. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11480. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 453; __pyx_clineno = __LINE__; goto __pyx_L13_error;}
  11481. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11482. }
  11483. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  11484. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  11485. __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
  11486. goto __pyx_L20_try_end;
  11487. __pyx_L13_error:;
  11488. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  11489. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  11490. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  11491. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11492. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  11493. /* "lib/Naked/toolshed/c/benchmarking.pyx":454
  11494. * array = np.array(result_list)
  11495. * print( "Standard Deviation: " + str(np.std(array)))
  11496. * except ImportError as ie: # <<<<<<<<<<<<<<
  11497. * pass
  11498. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  11499. */
  11500. __pyx_t_15 = PyErr_ExceptionMatches(__pyx_builtin_ImportError);
  11501. if (__pyx_t_15) {
  11502. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11503. if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_3, &__pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__; goto __pyx_L15_except_error;}
  11504. __Pyx_GOTREF(__pyx_t_8);
  11505. __Pyx_GOTREF(__pyx_t_3);
  11506. __Pyx_GOTREF(__pyx_t_2);
  11507. __Pyx_INCREF(__pyx_t_3);
  11508. __pyx_v_ie = __pyx_t_3;
  11509. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11510. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11511. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11512. goto __pyx_L14_exception_handled;
  11513. }
  11514. goto __pyx_L15_except_error;
  11515. __pyx_L15_except_error:;
  11516. __Pyx_XGIVEREF(__pyx_t_12);
  11517. __Pyx_XGIVEREF(__pyx_t_13);
  11518. __Pyx_XGIVEREF(__pyx_t_14);
  11519. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  11520. goto __pyx_L1_error;
  11521. __pyx_L14_exception_handled:;
  11522. __Pyx_XGIVEREF(__pyx_t_12);
  11523. __Pyx_XGIVEREF(__pyx_t_13);
  11524. __Pyx_XGIVEREF(__pyx_t_14);
  11525. __Pyx_ExceptionReset(__pyx_t_12, __pyx_t_13, __pyx_t_14);
  11526. __pyx_L20_try_end:;
  11527. }
  11528. /* "lib/Naked/toolshed/c/benchmarking.pyx":456
  11529. * except ImportError as ie:
  11530. * pass
  11531. * print("Mean per repetition: " + str(mean/repetitions) + " sec") # <<<<<<<<<<<<<<
  11532. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  11533. * print("Ratio: " + str(mean/mean_benchmark))
  11534. */
  11535. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11536. __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_cur_scope->__pyx_v_repetitions); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11537. __Pyx_GOTREF(__pyx_t_2);
  11538. __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11539. __Pyx_GOTREF(__pyx_t_3);
  11540. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  11541. __Pyx_GIVEREF(__pyx_t_2);
  11542. __pyx_t_2 = 0;
  11543. __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11544. __Pyx_GOTREF(__pyx_t_2);
  11545. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11546. __pyx_t_3 = PyNumber_Add(__pyx_kp_s_Mean_per_repetition, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11547. __Pyx_GOTREF(__pyx_t_3);
  11548. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11549. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_kp_s_sec); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11550. __Pyx_GOTREF(__pyx_t_2);
  11551. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11552. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11553. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11554. /* "lib/Naked/toolshed/c/benchmarking.pyx":457
  11555. * pass
  11556. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  11557. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec") # <<<<<<<<<<<<<<
  11558. * print("Ratio: " + str(mean/mean_benchmark))
  11559. * return result
  11560. */
  11561. if (unlikely(!__pyx_cur_scope->__pyx_v_repetitions)) { __Pyx_RaiseClosureNameError("repetitions"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11562. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11563. __Pyx_GOTREF(__pyx_t_2);
  11564. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  11565. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_repetitions);
  11566. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  11567. __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11568. __Pyx_GOTREF(__pyx_t_3);
  11569. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11570. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Mean_for, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11571. __Pyx_GOTREF(__pyx_t_2);
  11572. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11573. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_of_benchmark_function); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11574. __Pyx_GOTREF(__pyx_t_3);
  11575. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11576. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11577. __Pyx_GOTREF(__pyx_t_2);
  11578. __Pyx_INCREF(__pyx_v_mean_benchmark);
  11579. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_mean_benchmark);
  11580. __Pyx_GIVEREF(__pyx_v_mean_benchmark);
  11581. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11582. __Pyx_GOTREF(__pyx_t_8);
  11583. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11584. __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11585. __Pyx_GOTREF(__pyx_t_2);
  11586. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11587. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11588. __pyx_t_8 = PyNumber_Add(__pyx_t_2, __pyx_kp_s_sec); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11589. __Pyx_GOTREF(__pyx_t_8);
  11590. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11591. if (__Pyx_PrintOne(0, __pyx_t_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 457; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11592. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11593. /* "lib/Naked/toolshed/c/benchmarking.pyx":458
  11594. * print("Mean per repetition: " + str(mean/repetitions) + " sec")
  11595. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  11596. * print("Ratio: " + str(mean/mean_benchmark)) # <<<<<<<<<<<<<<
  11597. * return result
  11598. * return wrapper
  11599. */
  11600. __pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_v_mean, __pyx_v_mean_benchmark); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11601. __Pyx_GOTREF(__pyx_t_8);
  11602. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11603. __Pyx_GOTREF(__pyx_t_2);
  11604. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_8);
  11605. __Pyx_GIVEREF(__pyx_t_8);
  11606. __pyx_t_8 = 0;
  11607. __pyx_t_8 = __Pyx_PyObject_Call(((PyObject *)((PyObject*)(&PyString_Type))), __pyx_t_2, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11608. __Pyx_GOTREF(__pyx_t_8);
  11609. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11610. __pyx_t_2 = PyNumber_Add(__pyx_kp_s_Ratio, __pyx_t_8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11611. __Pyx_GOTREF(__pyx_t_2);
  11612. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  11613. if (__Pyx_PrintOne(0, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11614. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11615. /* "lib/Naked/toolshed/c/benchmarking.pyx":459
  11616. * print("Mean for " + str(repetitions) + " of benchmark function:" + str(mean_benchmark) + " sec")
  11617. * print("Ratio: " + str(mean/mean_benchmark))
  11618. * return result # <<<<<<<<<<<<<<
  11619. * return wrapper
  11620. *
  11621. */
  11622. __Pyx_XDECREF(__pyx_r);
  11623. if (unlikely(!__pyx_v_result)) { __Pyx_RaiseUnboundLocalError("result"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 459; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
  11624. __Pyx_INCREF(__pyx_v_result);
  11625. __pyx_r = __pyx_v_result;
  11626. goto __pyx_L0;
  11627. /* "lib/Naked/toolshed/c/benchmarking.pyx":413
  11628. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  11629. * @wraps(func)
  11630. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  11631. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  11632. * sys.stdout.flush()
  11633. */
  11634. /* function exit code */
  11635. __pyx_L1_error:;
  11636. __Pyx_XDECREF(__pyx_t_1);
  11637. __Pyx_XDECREF(__pyx_t_2);
  11638. __Pyx_XDECREF(__pyx_t_3);
  11639. __Pyx_XDECREF(__pyx_t_8);
  11640. __Pyx_XDECREF(__pyx_t_9);
  11641. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m.wrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11642. __pyx_r = NULL;
  11643. __pyx_L0:;
  11644. __Pyx_XDECREF(__pyx_v_result_list);
  11645. __Pyx_XDECREF(__pyx_v_benchmark_list);
  11646. __Pyx_XDECREF(__pyx_v_x);
  11647. __Pyx_XDECREF(__pyx_v_start);
  11648. __Pyx_XDECREF(__pyx_v_y);
  11649. __Pyx_XDECREF(__pyx_v_end);
  11650. __Pyx_XDECREF(__pyx_v_result);
  11651. __Pyx_XDECREF(__pyx_v_L);
  11652. __Pyx_XDECREF(__pyx_v_start2);
  11653. __Pyx_XDECREF(__pyx_v_j);
  11654. __Pyx_XDECREF(__pyx_v_end2);
  11655. __Pyx_XDECREF(__pyx_v_n);
  11656. __Pyx_XDECREF(__pyx_v_run);
  11657. __Pyx_XDECREF(__pyx_v_mean);
  11658. __Pyx_XDECREF(__pyx_v_mean_benchmark);
  11659. __Pyx_XDECREF(__pyx_v_np);
  11660. __Pyx_XDECREF(__pyx_v_array);
  11661. __Pyx_XDECREF(__pyx_v_ie);
  11662. __Pyx_XGIVEREF(__pyx_r);
  11663. __Pyx_RefNannyFinishContext();
  11664. return __pyx_r;
  11665. }
  11666. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  11667. * return wrapper
  11668. *
  11669. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  11670. * @wraps(func)
  11671. * def wrapper(*args, **kwargs):
  11672. */
  11673. static PyObject *__pyx_pf_3lib_5Naked_8toolshed_1c_12benchmarking_22timer_trials_benchmark_1m(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_func, PyObject *__pyx_v_repetitions, PyObject *__pyx_v_trials) {
  11674. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_cur_scope;
  11675. PyObject *__pyx_v_wrapper = 0;
  11676. PyObject *__pyx_r = NULL;
  11677. __Pyx_RefNannyDeclarations
  11678. PyObject *__pyx_t_1 = NULL;
  11679. PyObject *__pyx_t_2 = NULL;
  11680. PyObject *__pyx_t_3 = NULL;
  11681. int __pyx_lineno = 0;
  11682. const char *__pyx_filename = NULL;
  11683. int __pyx_clineno = 0;
  11684. __Pyx_RefNannySetupContext("timer_trials_benchmark_1m", 0);
  11685. __pyx_cur_scope = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(__pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, __pyx_empty_tuple, NULL);
  11686. if (unlikely(!__pyx_cur_scope)) {
  11687. __Pyx_RefNannyFinishContext();
  11688. return NULL;
  11689. }
  11690. __Pyx_GOTREF(__pyx_cur_scope);
  11691. __pyx_cur_scope->__pyx_v_func = __pyx_v_func;
  11692. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  11693. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  11694. __pyx_cur_scope->__pyx_v_repetitions = __pyx_v_repetitions;
  11695. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_repetitions);
  11696. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_repetitions);
  11697. __pyx_cur_scope->__pyx_v_trials = __pyx_v_trials;
  11698. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_trials);
  11699. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_trials);
  11700. /* "lib/Naked/toolshed/c/benchmarking.pyx":412
  11701. *
  11702. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  11703. * @wraps(func) # <<<<<<<<<<<<<<
  11704. * def wrapper(*args, **kwargs):
  11705. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  11706. */
  11707. __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11708. __Pyx_GOTREF(__pyx_t_1);
  11709. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11710. __Pyx_GOTREF(__pyx_t_2);
  11711. __Pyx_INCREF(__pyx_cur_scope->__pyx_v_func);
  11712. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_cur_scope->__pyx_v_func);
  11713. __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_func);
  11714. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11715. __Pyx_GOTREF(__pyx_t_3);
  11716. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11717. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11718. /* "lib/Naked/toolshed/c/benchmarking.pyx":413
  11719. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  11720. * @wraps(func)
  11721. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  11722. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  11723. * sys.stdout.flush()
  11724. */
  11725. __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_25timer_trials_benchmark_1m_1wrapper, 0, __pyx_n_s_timer_trials_benchmark_1m_locals, ((PyObject*)__pyx_cur_scope), __pyx_n_s_lib_Naked_toolshed_c_benchmarkin, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__37)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11726. __Pyx_GOTREF(__pyx_t_2);
  11727. /* "lib/Naked/toolshed/c/benchmarking.pyx":412
  11728. *
  11729. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  11730. * @wraps(func) # <<<<<<<<<<<<<<
  11731. * def wrapper(*args, **kwargs):
  11732. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  11733. */
  11734. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11735. __Pyx_GOTREF(__pyx_t_1);
  11736. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  11737. __Pyx_GIVEREF(__pyx_t_2);
  11738. __pyx_t_2 = 0;
  11739. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  11740. __Pyx_GOTREF(__pyx_t_2);
  11741. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  11742. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11743. __pyx_v_wrapper = __pyx_t_2;
  11744. __pyx_t_2 = 0;
  11745. /* "lib/Naked/toolshed/c/benchmarking.pyx":460
  11746. * print("Ratio: " + str(mean/mean_benchmark))
  11747. * return result
  11748. * return wrapper # <<<<<<<<<<<<<<
  11749. *
  11750. * if __name__ == '__main__':
  11751. */
  11752. __Pyx_XDECREF(__pyx_r);
  11753. __Pyx_INCREF(__pyx_v_wrapper);
  11754. __pyx_r = __pyx_v_wrapper;
  11755. goto __pyx_L0;
  11756. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  11757. * return wrapper
  11758. *
  11759. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  11760. * @wraps(func)
  11761. * def wrapper(*args, **kwargs):
  11762. */
  11763. /* function exit code */
  11764. __pyx_L1_error:;
  11765. __Pyx_XDECREF(__pyx_t_1);
  11766. __Pyx_XDECREF(__pyx_t_2);
  11767. __Pyx_XDECREF(__pyx_t_3);
  11768. __Pyx_AddTraceback("lib.Naked.toolshed.c.benchmarking.timer_trials_benchmark_1m", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11769. __pyx_r = NULL;
  11770. __pyx_L0:;
  11771. __Pyx_XDECREF(__pyx_v_wrapper);
  11772. __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  11773. __Pyx_XGIVEREF(__pyx_r);
  11774. __Pyx_RefNannyFinishContext();
  11775. return __pyx_r;
  11776. }
  11777. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[8];
  11778. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = 0;
  11779. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  11780. PyObject *o;
  11781. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer)))) {
  11782. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer];
  11783. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer));
  11784. (void) PyObject_INIT(o, t);
  11785. PyObject_GC_Track(o);
  11786. } else {
  11787. o = (*t->tp_alloc)(t, 0);
  11788. if (unlikely(!o)) return 0;
  11789. }
  11790. return o;
  11791. }
  11792. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) {
  11793. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o;
  11794. PyObject_GC_UnTrack(o);
  11795. Py_CLEAR(p->__pyx_v_func);
  11796. Py_CLEAR(p->__pyx_v_repetitions);
  11797. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer))) {
  11798. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o);
  11799. } else {
  11800. (*Py_TYPE(o)->tp_free)(o);
  11801. }
  11802. }
  11803. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o, visitproc v, void *a) {
  11804. int e;
  11805. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o;
  11806. if (p->__pyx_v_func) {
  11807. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  11808. }
  11809. if (p->__pyx_v_repetitions) {
  11810. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  11811. }
  11812. return 0;
  11813. }
  11814. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer(PyObject *o) {
  11815. PyObject* tmp;
  11816. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer *)o;
  11817. tmp = ((PyObject*)p->__pyx_v_func);
  11818. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  11819. Py_XDECREF(tmp);
  11820. tmp = ((PyObject*)p->__pyx_v_repetitions);
  11821. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  11822. Py_XDECREF(tmp);
  11823. return 0;
  11824. }
  11825. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = {
  11826. PyVarObject_HEAD_INIT(0, 0)
  11827. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct__timer"), /*tp_name*/
  11828. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer), /*tp_basicsize*/
  11829. 0, /*tp_itemsize*/
  11830. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_dealloc*/
  11831. 0, /*tp_print*/
  11832. 0, /*tp_getattr*/
  11833. 0, /*tp_setattr*/
  11834. #if PY_MAJOR_VERSION < 3
  11835. 0, /*tp_compare*/
  11836. #else
  11837. 0, /*reserved*/
  11838. #endif
  11839. 0, /*tp_repr*/
  11840. 0, /*tp_as_number*/
  11841. 0, /*tp_as_sequence*/
  11842. 0, /*tp_as_mapping*/
  11843. 0, /*tp_hash*/
  11844. 0, /*tp_call*/
  11845. 0, /*tp_str*/
  11846. 0, /*tp_getattro*/
  11847. 0, /*tp_setattro*/
  11848. 0, /*tp_as_buffer*/
  11849. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  11850. 0, /*tp_doc*/
  11851. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_traverse*/
  11852. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_clear*/
  11853. 0, /*tp_richcompare*/
  11854. 0, /*tp_weaklistoffset*/
  11855. 0, /*tp_iter*/
  11856. 0, /*tp_iternext*/
  11857. 0, /*tp_methods*/
  11858. 0, /*tp_members*/
  11859. 0, /*tp_getset*/
  11860. 0, /*tp_base*/
  11861. 0, /*tp_dict*/
  11862. 0, /*tp_descr_get*/
  11863. 0, /*tp_descr_set*/
  11864. 0, /*tp_dictoffset*/
  11865. 0, /*tp_init*/
  11866. 0, /*tp_alloc*/
  11867. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer, /*tp_new*/
  11868. 0, /*tp_free*/
  11869. 0, /*tp_is_gc*/
  11870. 0, /*tp_bases*/
  11871. 0, /*tp_mro*/
  11872. 0, /*tp_cache*/
  11873. 0, /*tp_subclasses*/
  11874. 0, /*tp_weaklist*/
  11875. 0, /*tp_del*/
  11876. #if PY_VERSION_HEX >= 0x02060000
  11877. 0, /*tp_version_tag*/
  11878. #endif
  11879. #if PY_VERSION_HEX >= 0x030400a1
  11880. 0, /*tp_finalize*/
  11881. #endif
  11882. };
  11883. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[8];
  11884. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = 0;
  11885. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  11886. PyObject *o;
  11887. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10)))) {
  11888. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10];
  11889. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10));
  11890. (void) PyObject_INIT(o, t);
  11891. PyObject_GC_Track(o);
  11892. } else {
  11893. o = (*t->tp_alloc)(t, 0);
  11894. if (unlikely(!o)) return 0;
  11895. }
  11896. return o;
  11897. }
  11898. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) {
  11899. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o;
  11900. PyObject_GC_UnTrack(o);
  11901. Py_CLEAR(p->__pyx_v_func);
  11902. Py_CLEAR(p->__pyx_v_repetitions);
  11903. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10))) {
  11904. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o);
  11905. } else {
  11906. (*Py_TYPE(o)->tp_free)(o);
  11907. }
  11908. }
  11909. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o, visitproc v, void *a) {
  11910. int e;
  11911. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o;
  11912. if (p->__pyx_v_func) {
  11913. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  11914. }
  11915. if (p->__pyx_v_repetitions) {
  11916. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  11917. }
  11918. return 0;
  11919. }
  11920. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10(PyObject *o) {
  11921. PyObject* tmp;
  11922. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 *)o;
  11923. tmp = ((PyObject*)p->__pyx_v_func);
  11924. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  11925. Py_XDECREF(tmp);
  11926. tmp = ((PyObject*)p->__pyx_v_repetitions);
  11927. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  11928. Py_XDECREF(tmp);
  11929. return 0;
  11930. }
  11931. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = {
  11932. PyVarObject_HEAD_INIT(0, 0)
  11933. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_1_timer_10"), /*tp_name*/
  11934. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10), /*tp_basicsize*/
  11935. 0, /*tp_itemsize*/
  11936. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_dealloc*/
  11937. 0, /*tp_print*/
  11938. 0, /*tp_getattr*/
  11939. 0, /*tp_setattr*/
  11940. #if PY_MAJOR_VERSION < 3
  11941. 0, /*tp_compare*/
  11942. #else
  11943. 0, /*reserved*/
  11944. #endif
  11945. 0, /*tp_repr*/
  11946. 0, /*tp_as_number*/
  11947. 0, /*tp_as_sequence*/
  11948. 0, /*tp_as_mapping*/
  11949. 0, /*tp_hash*/
  11950. 0, /*tp_call*/
  11951. 0, /*tp_str*/
  11952. 0, /*tp_getattro*/
  11953. 0, /*tp_setattro*/
  11954. 0, /*tp_as_buffer*/
  11955. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  11956. 0, /*tp_doc*/
  11957. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_traverse*/
  11958. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_clear*/
  11959. 0, /*tp_richcompare*/
  11960. 0, /*tp_weaklistoffset*/
  11961. 0, /*tp_iter*/
  11962. 0, /*tp_iternext*/
  11963. 0, /*tp_methods*/
  11964. 0, /*tp_members*/
  11965. 0, /*tp_getset*/
  11966. 0, /*tp_base*/
  11967. 0, /*tp_dict*/
  11968. 0, /*tp_descr_get*/
  11969. 0, /*tp_descr_set*/
  11970. 0, /*tp_dictoffset*/
  11971. 0, /*tp_init*/
  11972. 0, /*tp_alloc*/
  11973. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10, /*tp_new*/
  11974. 0, /*tp_free*/
  11975. 0, /*tp_is_gc*/
  11976. 0, /*tp_bases*/
  11977. 0, /*tp_mro*/
  11978. 0, /*tp_cache*/
  11979. 0, /*tp_subclasses*/
  11980. 0, /*tp_weaklist*/
  11981. 0, /*tp_del*/
  11982. #if PY_VERSION_HEX >= 0x02060000
  11983. 0, /*tp_version_tag*/
  11984. #endif
  11985. #if PY_VERSION_HEX >= 0x030400a1
  11986. 0, /*tp_finalize*/
  11987. #endif
  11988. };
  11989. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[8];
  11990. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = 0;
  11991. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  11992. PyObject *o;
  11993. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100)))) {
  11994. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100];
  11995. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100));
  11996. (void) PyObject_INIT(o, t);
  11997. PyObject_GC_Track(o);
  11998. } else {
  11999. o = (*t->tp_alloc)(t, 0);
  12000. if (unlikely(!o)) return 0;
  12001. }
  12002. return o;
  12003. }
  12004. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) {
  12005. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o;
  12006. PyObject_GC_UnTrack(o);
  12007. Py_CLEAR(p->__pyx_v_func);
  12008. Py_CLEAR(p->__pyx_v_repetitions);
  12009. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100))) {
  12010. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o);
  12011. } else {
  12012. (*Py_TYPE(o)->tp_free)(o);
  12013. }
  12014. }
  12015. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o, visitproc v, void *a) {
  12016. int e;
  12017. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o;
  12018. if (p->__pyx_v_func) {
  12019. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12020. }
  12021. if (p->__pyx_v_repetitions) {
  12022. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12023. }
  12024. return 0;
  12025. }
  12026. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100(PyObject *o) {
  12027. PyObject* tmp;
  12028. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 *)o;
  12029. tmp = ((PyObject*)p->__pyx_v_func);
  12030. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12031. Py_XDECREF(tmp);
  12032. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12033. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12034. Py_XDECREF(tmp);
  12035. return 0;
  12036. }
  12037. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = {
  12038. PyVarObject_HEAD_INIT(0, 0)
  12039. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_2_timer_100"), /*tp_name*/
  12040. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100), /*tp_basicsize*/
  12041. 0, /*tp_itemsize*/
  12042. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_dealloc*/
  12043. 0, /*tp_print*/
  12044. 0, /*tp_getattr*/
  12045. 0, /*tp_setattr*/
  12046. #if PY_MAJOR_VERSION < 3
  12047. 0, /*tp_compare*/
  12048. #else
  12049. 0, /*reserved*/
  12050. #endif
  12051. 0, /*tp_repr*/
  12052. 0, /*tp_as_number*/
  12053. 0, /*tp_as_sequence*/
  12054. 0, /*tp_as_mapping*/
  12055. 0, /*tp_hash*/
  12056. 0, /*tp_call*/
  12057. 0, /*tp_str*/
  12058. 0, /*tp_getattro*/
  12059. 0, /*tp_setattro*/
  12060. 0, /*tp_as_buffer*/
  12061. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12062. 0, /*tp_doc*/
  12063. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_traverse*/
  12064. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_clear*/
  12065. 0, /*tp_richcompare*/
  12066. 0, /*tp_weaklistoffset*/
  12067. 0, /*tp_iter*/
  12068. 0, /*tp_iternext*/
  12069. 0, /*tp_methods*/
  12070. 0, /*tp_members*/
  12071. 0, /*tp_getset*/
  12072. 0, /*tp_base*/
  12073. 0, /*tp_dict*/
  12074. 0, /*tp_descr_get*/
  12075. 0, /*tp_descr_set*/
  12076. 0, /*tp_dictoffset*/
  12077. 0, /*tp_init*/
  12078. 0, /*tp_alloc*/
  12079. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100, /*tp_new*/
  12080. 0, /*tp_free*/
  12081. 0, /*tp_is_gc*/
  12082. 0, /*tp_bases*/
  12083. 0, /*tp_mro*/
  12084. 0, /*tp_cache*/
  12085. 0, /*tp_subclasses*/
  12086. 0, /*tp_weaklist*/
  12087. 0, /*tp_del*/
  12088. #if PY_VERSION_HEX >= 0x02060000
  12089. 0, /*tp_version_tag*/
  12090. #endif
  12091. #if PY_VERSION_HEX >= 0x030400a1
  12092. 0, /*tp_finalize*/
  12093. #endif
  12094. };
  12095. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[8];
  12096. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = 0;
  12097. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12098. PyObject *o;
  12099. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k)))) {
  12100. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k];
  12101. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k));
  12102. (void) PyObject_INIT(o, t);
  12103. PyObject_GC_Track(o);
  12104. } else {
  12105. o = (*t->tp_alloc)(t, 0);
  12106. if (unlikely(!o)) return 0;
  12107. }
  12108. return o;
  12109. }
  12110. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) {
  12111. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o;
  12112. PyObject_GC_UnTrack(o);
  12113. Py_CLEAR(p->__pyx_v_func);
  12114. Py_CLEAR(p->__pyx_v_repetitions);
  12115. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k))) {
  12116. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o);
  12117. } else {
  12118. (*Py_TYPE(o)->tp_free)(o);
  12119. }
  12120. }
  12121. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o, visitproc v, void *a) {
  12122. int e;
  12123. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o;
  12124. if (p->__pyx_v_func) {
  12125. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12126. }
  12127. if (p->__pyx_v_repetitions) {
  12128. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12129. }
  12130. return 0;
  12131. }
  12132. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k(PyObject *o) {
  12133. PyObject* tmp;
  12134. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k *)o;
  12135. tmp = ((PyObject*)p->__pyx_v_func);
  12136. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12137. Py_XDECREF(tmp);
  12138. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12139. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12140. Py_XDECREF(tmp);
  12141. return 0;
  12142. }
  12143. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = {
  12144. PyVarObject_HEAD_INIT(0, 0)
  12145. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_3_timer_1k"), /*tp_name*/
  12146. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k), /*tp_basicsize*/
  12147. 0, /*tp_itemsize*/
  12148. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_dealloc*/
  12149. 0, /*tp_print*/
  12150. 0, /*tp_getattr*/
  12151. 0, /*tp_setattr*/
  12152. #if PY_MAJOR_VERSION < 3
  12153. 0, /*tp_compare*/
  12154. #else
  12155. 0, /*reserved*/
  12156. #endif
  12157. 0, /*tp_repr*/
  12158. 0, /*tp_as_number*/
  12159. 0, /*tp_as_sequence*/
  12160. 0, /*tp_as_mapping*/
  12161. 0, /*tp_hash*/
  12162. 0, /*tp_call*/
  12163. 0, /*tp_str*/
  12164. 0, /*tp_getattro*/
  12165. 0, /*tp_setattro*/
  12166. 0, /*tp_as_buffer*/
  12167. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12168. 0, /*tp_doc*/
  12169. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_traverse*/
  12170. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_clear*/
  12171. 0, /*tp_richcompare*/
  12172. 0, /*tp_weaklistoffset*/
  12173. 0, /*tp_iter*/
  12174. 0, /*tp_iternext*/
  12175. 0, /*tp_methods*/
  12176. 0, /*tp_members*/
  12177. 0, /*tp_getset*/
  12178. 0, /*tp_base*/
  12179. 0, /*tp_dict*/
  12180. 0, /*tp_descr_get*/
  12181. 0, /*tp_descr_set*/
  12182. 0, /*tp_dictoffset*/
  12183. 0, /*tp_init*/
  12184. 0, /*tp_alloc*/
  12185. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k, /*tp_new*/
  12186. 0, /*tp_free*/
  12187. 0, /*tp_is_gc*/
  12188. 0, /*tp_bases*/
  12189. 0, /*tp_mro*/
  12190. 0, /*tp_cache*/
  12191. 0, /*tp_subclasses*/
  12192. 0, /*tp_weaklist*/
  12193. 0, /*tp_del*/
  12194. #if PY_VERSION_HEX >= 0x02060000
  12195. 0, /*tp_version_tag*/
  12196. #endif
  12197. #if PY_VERSION_HEX >= 0x030400a1
  12198. 0, /*tp_finalize*/
  12199. #endif
  12200. };
  12201. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[8];
  12202. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = 0;
  12203. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12204. PyObject *o;
  12205. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k)))) {
  12206. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k];
  12207. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k));
  12208. (void) PyObject_INIT(o, t);
  12209. PyObject_GC_Track(o);
  12210. } else {
  12211. o = (*t->tp_alloc)(t, 0);
  12212. if (unlikely(!o)) return 0;
  12213. }
  12214. return o;
  12215. }
  12216. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) {
  12217. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o;
  12218. PyObject_GC_UnTrack(o);
  12219. Py_CLEAR(p->__pyx_v_func);
  12220. Py_CLEAR(p->__pyx_v_repetitions);
  12221. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k))) {
  12222. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o);
  12223. } else {
  12224. (*Py_TYPE(o)->tp_free)(o);
  12225. }
  12226. }
  12227. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o, visitproc v, void *a) {
  12228. int e;
  12229. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o;
  12230. if (p->__pyx_v_func) {
  12231. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12232. }
  12233. if (p->__pyx_v_repetitions) {
  12234. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12235. }
  12236. return 0;
  12237. }
  12238. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k(PyObject *o) {
  12239. PyObject* tmp;
  12240. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k *)o;
  12241. tmp = ((PyObject*)p->__pyx_v_func);
  12242. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12243. Py_XDECREF(tmp);
  12244. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12245. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12246. Py_XDECREF(tmp);
  12247. return 0;
  12248. }
  12249. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = {
  12250. PyVarObject_HEAD_INIT(0, 0)
  12251. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_4_timer_10k"), /*tp_name*/
  12252. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k), /*tp_basicsize*/
  12253. 0, /*tp_itemsize*/
  12254. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_dealloc*/
  12255. 0, /*tp_print*/
  12256. 0, /*tp_getattr*/
  12257. 0, /*tp_setattr*/
  12258. #if PY_MAJOR_VERSION < 3
  12259. 0, /*tp_compare*/
  12260. #else
  12261. 0, /*reserved*/
  12262. #endif
  12263. 0, /*tp_repr*/
  12264. 0, /*tp_as_number*/
  12265. 0, /*tp_as_sequence*/
  12266. 0, /*tp_as_mapping*/
  12267. 0, /*tp_hash*/
  12268. 0, /*tp_call*/
  12269. 0, /*tp_str*/
  12270. 0, /*tp_getattro*/
  12271. 0, /*tp_setattro*/
  12272. 0, /*tp_as_buffer*/
  12273. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12274. 0, /*tp_doc*/
  12275. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_traverse*/
  12276. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_clear*/
  12277. 0, /*tp_richcompare*/
  12278. 0, /*tp_weaklistoffset*/
  12279. 0, /*tp_iter*/
  12280. 0, /*tp_iternext*/
  12281. 0, /*tp_methods*/
  12282. 0, /*tp_members*/
  12283. 0, /*tp_getset*/
  12284. 0, /*tp_base*/
  12285. 0, /*tp_dict*/
  12286. 0, /*tp_descr_get*/
  12287. 0, /*tp_descr_set*/
  12288. 0, /*tp_dictoffset*/
  12289. 0, /*tp_init*/
  12290. 0, /*tp_alloc*/
  12291. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k, /*tp_new*/
  12292. 0, /*tp_free*/
  12293. 0, /*tp_is_gc*/
  12294. 0, /*tp_bases*/
  12295. 0, /*tp_mro*/
  12296. 0, /*tp_cache*/
  12297. 0, /*tp_subclasses*/
  12298. 0, /*tp_weaklist*/
  12299. 0, /*tp_del*/
  12300. #if PY_VERSION_HEX >= 0x02060000
  12301. 0, /*tp_version_tag*/
  12302. #endif
  12303. #if PY_VERSION_HEX >= 0x030400a1
  12304. 0, /*tp_finalize*/
  12305. #endif
  12306. };
  12307. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[8];
  12308. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = 0;
  12309. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12310. PyObject *o;
  12311. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m)))) {
  12312. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m];
  12313. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m));
  12314. (void) PyObject_INIT(o, t);
  12315. PyObject_GC_Track(o);
  12316. } else {
  12317. o = (*t->tp_alloc)(t, 0);
  12318. if (unlikely(!o)) return 0;
  12319. }
  12320. return o;
  12321. }
  12322. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) {
  12323. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o;
  12324. PyObject_GC_UnTrack(o);
  12325. Py_CLEAR(p->__pyx_v_func);
  12326. Py_CLEAR(p->__pyx_v_repetitions);
  12327. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m))) {
  12328. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o);
  12329. } else {
  12330. (*Py_TYPE(o)->tp_free)(o);
  12331. }
  12332. }
  12333. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o, visitproc v, void *a) {
  12334. int e;
  12335. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o;
  12336. if (p->__pyx_v_func) {
  12337. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12338. }
  12339. if (p->__pyx_v_repetitions) {
  12340. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12341. }
  12342. return 0;
  12343. }
  12344. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m(PyObject *o) {
  12345. PyObject* tmp;
  12346. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m *)o;
  12347. tmp = ((PyObject*)p->__pyx_v_func);
  12348. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12349. Py_XDECREF(tmp);
  12350. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12351. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12352. Py_XDECREF(tmp);
  12353. return 0;
  12354. }
  12355. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = {
  12356. PyVarObject_HEAD_INIT(0, 0)
  12357. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_5_timer_1m"), /*tp_name*/
  12358. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m), /*tp_basicsize*/
  12359. 0, /*tp_itemsize*/
  12360. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_dealloc*/
  12361. 0, /*tp_print*/
  12362. 0, /*tp_getattr*/
  12363. 0, /*tp_setattr*/
  12364. #if PY_MAJOR_VERSION < 3
  12365. 0, /*tp_compare*/
  12366. #else
  12367. 0, /*reserved*/
  12368. #endif
  12369. 0, /*tp_repr*/
  12370. 0, /*tp_as_number*/
  12371. 0, /*tp_as_sequence*/
  12372. 0, /*tp_as_mapping*/
  12373. 0, /*tp_hash*/
  12374. 0, /*tp_call*/
  12375. 0, /*tp_str*/
  12376. 0, /*tp_getattro*/
  12377. 0, /*tp_setattro*/
  12378. 0, /*tp_as_buffer*/
  12379. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12380. 0, /*tp_doc*/
  12381. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_traverse*/
  12382. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_clear*/
  12383. 0, /*tp_richcompare*/
  12384. 0, /*tp_weaklistoffset*/
  12385. 0, /*tp_iter*/
  12386. 0, /*tp_iternext*/
  12387. 0, /*tp_methods*/
  12388. 0, /*tp_members*/
  12389. 0, /*tp_getset*/
  12390. 0, /*tp_base*/
  12391. 0, /*tp_dict*/
  12392. 0, /*tp_descr_get*/
  12393. 0, /*tp_descr_set*/
  12394. 0, /*tp_dictoffset*/
  12395. 0, /*tp_init*/
  12396. 0, /*tp_alloc*/
  12397. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m, /*tp_new*/
  12398. 0, /*tp_free*/
  12399. 0, /*tp_is_gc*/
  12400. 0, /*tp_bases*/
  12401. 0, /*tp_mro*/
  12402. 0, /*tp_cache*/
  12403. 0, /*tp_subclasses*/
  12404. 0, /*tp_weaklist*/
  12405. 0, /*tp_del*/
  12406. #if PY_VERSION_HEX >= 0x02060000
  12407. 0, /*tp_version_tag*/
  12408. #endif
  12409. #if PY_VERSION_HEX >= 0x030400a1
  12410. 0, /*tp_finalize*/
  12411. #endif
  12412. };
  12413. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[8];
  12414. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = 0;
  12415. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12416. PyObject *o;
  12417. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark)))) {
  12418. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark];
  12419. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark));
  12420. (void) PyObject_INIT(o, t);
  12421. PyObject_GC_Track(o);
  12422. } else {
  12423. o = (*t->tp_alloc)(t, 0);
  12424. if (unlikely(!o)) return 0;
  12425. }
  12426. return o;
  12427. }
  12428. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) {
  12429. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o;
  12430. PyObject_GC_UnTrack(o);
  12431. Py_CLEAR(p->__pyx_v_func);
  12432. Py_CLEAR(p->__pyx_v_repetitions);
  12433. Py_CLEAR(p->__pyx_v_trials);
  12434. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark))) {
  12435. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o);
  12436. } else {
  12437. (*Py_TYPE(o)->tp_free)(o);
  12438. }
  12439. }
  12440. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o, visitproc v, void *a) {
  12441. int e;
  12442. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o;
  12443. if (p->__pyx_v_func) {
  12444. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12445. }
  12446. if (p->__pyx_v_repetitions) {
  12447. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12448. }
  12449. if (p->__pyx_v_trials) {
  12450. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  12451. }
  12452. return 0;
  12453. }
  12454. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark(PyObject *o) {
  12455. PyObject* tmp;
  12456. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark *)o;
  12457. tmp = ((PyObject*)p->__pyx_v_func);
  12458. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12459. Py_XDECREF(tmp);
  12460. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12461. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12462. Py_XDECREF(tmp);
  12463. tmp = ((PyObject*)p->__pyx_v_trials);
  12464. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  12465. Py_XDECREF(tmp);
  12466. return 0;
  12467. }
  12468. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = {
  12469. PyVarObject_HEAD_INIT(0, 0)
  12470. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_6_timer_trials_benchmark"), /*tp_name*/
  12471. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark), /*tp_basicsize*/
  12472. 0, /*tp_itemsize*/
  12473. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_dealloc*/
  12474. 0, /*tp_print*/
  12475. 0, /*tp_getattr*/
  12476. 0, /*tp_setattr*/
  12477. #if PY_MAJOR_VERSION < 3
  12478. 0, /*tp_compare*/
  12479. #else
  12480. 0, /*reserved*/
  12481. #endif
  12482. 0, /*tp_repr*/
  12483. 0, /*tp_as_number*/
  12484. 0, /*tp_as_sequence*/
  12485. 0, /*tp_as_mapping*/
  12486. 0, /*tp_hash*/
  12487. 0, /*tp_call*/
  12488. 0, /*tp_str*/
  12489. 0, /*tp_getattro*/
  12490. 0, /*tp_setattro*/
  12491. 0, /*tp_as_buffer*/
  12492. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12493. 0, /*tp_doc*/
  12494. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_traverse*/
  12495. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_clear*/
  12496. 0, /*tp_richcompare*/
  12497. 0, /*tp_weaklistoffset*/
  12498. 0, /*tp_iter*/
  12499. 0, /*tp_iternext*/
  12500. 0, /*tp_methods*/
  12501. 0, /*tp_members*/
  12502. 0, /*tp_getset*/
  12503. 0, /*tp_base*/
  12504. 0, /*tp_dict*/
  12505. 0, /*tp_descr_get*/
  12506. 0, /*tp_descr_set*/
  12507. 0, /*tp_dictoffset*/
  12508. 0, /*tp_init*/
  12509. 0, /*tp_alloc*/
  12510. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark, /*tp_new*/
  12511. 0, /*tp_free*/
  12512. 0, /*tp_is_gc*/
  12513. 0, /*tp_bases*/
  12514. 0, /*tp_mro*/
  12515. 0, /*tp_cache*/
  12516. 0, /*tp_subclasses*/
  12517. 0, /*tp_weaklist*/
  12518. 0, /*tp_del*/
  12519. #if PY_VERSION_HEX >= 0x02060000
  12520. 0, /*tp_version_tag*/
  12521. #endif
  12522. #if PY_VERSION_HEX >= 0x030400a1
  12523. 0, /*tp_finalize*/
  12524. #endif
  12525. };
  12526. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[8];
  12527. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = 0;
  12528. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12529. PyObject *o;
  12530. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10)))) {
  12531. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10];
  12532. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10));
  12533. (void) PyObject_INIT(o, t);
  12534. PyObject_GC_Track(o);
  12535. } else {
  12536. o = (*t->tp_alloc)(t, 0);
  12537. if (unlikely(!o)) return 0;
  12538. }
  12539. return o;
  12540. }
  12541. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) {
  12542. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o;
  12543. PyObject_GC_UnTrack(o);
  12544. Py_CLEAR(p->__pyx_v_func);
  12545. Py_CLEAR(p->__pyx_v_repetitions);
  12546. Py_CLEAR(p->__pyx_v_trials);
  12547. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10))) {
  12548. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o);
  12549. } else {
  12550. (*Py_TYPE(o)->tp_free)(o);
  12551. }
  12552. }
  12553. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o, visitproc v, void *a) {
  12554. int e;
  12555. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o;
  12556. if (p->__pyx_v_func) {
  12557. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12558. }
  12559. if (p->__pyx_v_repetitions) {
  12560. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12561. }
  12562. if (p->__pyx_v_trials) {
  12563. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  12564. }
  12565. return 0;
  12566. }
  12567. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10(PyObject *o) {
  12568. PyObject* tmp;
  12569. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 *)o;
  12570. tmp = ((PyObject*)p->__pyx_v_func);
  12571. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12572. Py_XDECREF(tmp);
  12573. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12574. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12575. Py_XDECREF(tmp);
  12576. tmp = ((PyObject*)p->__pyx_v_trials);
  12577. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  12578. Py_XDECREF(tmp);
  12579. return 0;
  12580. }
  12581. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = {
  12582. PyVarObject_HEAD_INIT(0, 0)
  12583. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_7_timer_trials_benchmark_10"), /*tp_name*/
  12584. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10), /*tp_basicsize*/
  12585. 0, /*tp_itemsize*/
  12586. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_dealloc*/
  12587. 0, /*tp_print*/
  12588. 0, /*tp_getattr*/
  12589. 0, /*tp_setattr*/
  12590. #if PY_MAJOR_VERSION < 3
  12591. 0, /*tp_compare*/
  12592. #else
  12593. 0, /*reserved*/
  12594. #endif
  12595. 0, /*tp_repr*/
  12596. 0, /*tp_as_number*/
  12597. 0, /*tp_as_sequence*/
  12598. 0, /*tp_as_mapping*/
  12599. 0, /*tp_hash*/
  12600. 0, /*tp_call*/
  12601. 0, /*tp_str*/
  12602. 0, /*tp_getattro*/
  12603. 0, /*tp_setattro*/
  12604. 0, /*tp_as_buffer*/
  12605. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12606. 0, /*tp_doc*/
  12607. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_traverse*/
  12608. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_clear*/
  12609. 0, /*tp_richcompare*/
  12610. 0, /*tp_weaklistoffset*/
  12611. 0, /*tp_iter*/
  12612. 0, /*tp_iternext*/
  12613. 0, /*tp_methods*/
  12614. 0, /*tp_members*/
  12615. 0, /*tp_getset*/
  12616. 0, /*tp_base*/
  12617. 0, /*tp_dict*/
  12618. 0, /*tp_descr_get*/
  12619. 0, /*tp_descr_set*/
  12620. 0, /*tp_dictoffset*/
  12621. 0, /*tp_init*/
  12622. 0, /*tp_alloc*/
  12623. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10, /*tp_new*/
  12624. 0, /*tp_free*/
  12625. 0, /*tp_is_gc*/
  12626. 0, /*tp_bases*/
  12627. 0, /*tp_mro*/
  12628. 0, /*tp_cache*/
  12629. 0, /*tp_subclasses*/
  12630. 0, /*tp_weaklist*/
  12631. 0, /*tp_del*/
  12632. #if PY_VERSION_HEX >= 0x02060000
  12633. 0, /*tp_version_tag*/
  12634. #endif
  12635. #if PY_VERSION_HEX >= 0x030400a1
  12636. 0, /*tp_finalize*/
  12637. #endif
  12638. };
  12639. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[8];
  12640. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = 0;
  12641. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12642. PyObject *o;
  12643. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100)))) {
  12644. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100];
  12645. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100));
  12646. (void) PyObject_INIT(o, t);
  12647. PyObject_GC_Track(o);
  12648. } else {
  12649. o = (*t->tp_alloc)(t, 0);
  12650. if (unlikely(!o)) return 0;
  12651. }
  12652. return o;
  12653. }
  12654. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) {
  12655. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o;
  12656. PyObject_GC_UnTrack(o);
  12657. Py_CLEAR(p->__pyx_v_func);
  12658. Py_CLEAR(p->__pyx_v_repetitions);
  12659. Py_CLEAR(p->__pyx_v_trials);
  12660. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100))) {
  12661. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o);
  12662. } else {
  12663. (*Py_TYPE(o)->tp_free)(o);
  12664. }
  12665. }
  12666. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o, visitproc v, void *a) {
  12667. int e;
  12668. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o;
  12669. if (p->__pyx_v_func) {
  12670. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12671. }
  12672. if (p->__pyx_v_repetitions) {
  12673. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12674. }
  12675. if (p->__pyx_v_trials) {
  12676. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  12677. }
  12678. return 0;
  12679. }
  12680. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100(PyObject *o) {
  12681. PyObject* tmp;
  12682. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 *)o;
  12683. tmp = ((PyObject*)p->__pyx_v_func);
  12684. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12685. Py_XDECREF(tmp);
  12686. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12687. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12688. Py_XDECREF(tmp);
  12689. tmp = ((PyObject*)p->__pyx_v_trials);
  12690. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  12691. Py_XDECREF(tmp);
  12692. return 0;
  12693. }
  12694. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = {
  12695. PyVarObject_HEAD_INIT(0, 0)
  12696. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_8_timer_trials_benchmark_100"), /*tp_name*/
  12697. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100), /*tp_basicsize*/
  12698. 0, /*tp_itemsize*/
  12699. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_dealloc*/
  12700. 0, /*tp_print*/
  12701. 0, /*tp_getattr*/
  12702. 0, /*tp_setattr*/
  12703. #if PY_MAJOR_VERSION < 3
  12704. 0, /*tp_compare*/
  12705. #else
  12706. 0, /*reserved*/
  12707. #endif
  12708. 0, /*tp_repr*/
  12709. 0, /*tp_as_number*/
  12710. 0, /*tp_as_sequence*/
  12711. 0, /*tp_as_mapping*/
  12712. 0, /*tp_hash*/
  12713. 0, /*tp_call*/
  12714. 0, /*tp_str*/
  12715. 0, /*tp_getattro*/
  12716. 0, /*tp_setattro*/
  12717. 0, /*tp_as_buffer*/
  12718. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12719. 0, /*tp_doc*/
  12720. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_traverse*/
  12721. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_clear*/
  12722. 0, /*tp_richcompare*/
  12723. 0, /*tp_weaklistoffset*/
  12724. 0, /*tp_iter*/
  12725. 0, /*tp_iternext*/
  12726. 0, /*tp_methods*/
  12727. 0, /*tp_members*/
  12728. 0, /*tp_getset*/
  12729. 0, /*tp_base*/
  12730. 0, /*tp_dict*/
  12731. 0, /*tp_descr_get*/
  12732. 0, /*tp_descr_set*/
  12733. 0, /*tp_dictoffset*/
  12734. 0, /*tp_init*/
  12735. 0, /*tp_alloc*/
  12736. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100, /*tp_new*/
  12737. 0, /*tp_free*/
  12738. 0, /*tp_is_gc*/
  12739. 0, /*tp_bases*/
  12740. 0, /*tp_mro*/
  12741. 0, /*tp_cache*/
  12742. 0, /*tp_subclasses*/
  12743. 0, /*tp_weaklist*/
  12744. 0, /*tp_del*/
  12745. #if PY_VERSION_HEX >= 0x02060000
  12746. 0, /*tp_version_tag*/
  12747. #endif
  12748. #if PY_VERSION_HEX >= 0x030400a1
  12749. 0, /*tp_finalize*/
  12750. #endif
  12751. };
  12752. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[8];
  12753. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = 0;
  12754. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12755. PyObject *o;
  12756. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k)))) {
  12757. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k];
  12758. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k));
  12759. (void) PyObject_INIT(o, t);
  12760. PyObject_GC_Track(o);
  12761. } else {
  12762. o = (*t->tp_alloc)(t, 0);
  12763. if (unlikely(!o)) return 0;
  12764. }
  12765. return o;
  12766. }
  12767. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) {
  12768. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o;
  12769. PyObject_GC_UnTrack(o);
  12770. Py_CLEAR(p->__pyx_v_func);
  12771. Py_CLEAR(p->__pyx_v_repetitions);
  12772. Py_CLEAR(p->__pyx_v_trials);
  12773. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k))) {
  12774. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o);
  12775. } else {
  12776. (*Py_TYPE(o)->tp_free)(o);
  12777. }
  12778. }
  12779. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o, visitproc v, void *a) {
  12780. int e;
  12781. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o;
  12782. if (p->__pyx_v_func) {
  12783. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12784. }
  12785. if (p->__pyx_v_repetitions) {
  12786. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12787. }
  12788. if (p->__pyx_v_trials) {
  12789. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  12790. }
  12791. return 0;
  12792. }
  12793. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k(PyObject *o) {
  12794. PyObject* tmp;
  12795. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k *)o;
  12796. tmp = ((PyObject*)p->__pyx_v_func);
  12797. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12798. Py_XDECREF(tmp);
  12799. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12800. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12801. Py_XDECREF(tmp);
  12802. tmp = ((PyObject*)p->__pyx_v_trials);
  12803. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  12804. Py_XDECREF(tmp);
  12805. return 0;
  12806. }
  12807. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = {
  12808. PyVarObject_HEAD_INIT(0, 0)
  12809. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_9_timer_trials_benchmark_1k"), /*tp_name*/
  12810. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k), /*tp_basicsize*/
  12811. 0, /*tp_itemsize*/
  12812. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_dealloc*/
  12813. 0, /*tp_print*/
  12814. 0, /*tp_getattr*/
  12815. 0, /*tp_setattr*/
  12816. #if PY_MAJOR_VERSION < 3
  12817. 0, /*tp_compare*/
  12818. #else
  12819. 0, /*reserved*/
  12820. #endif
  12821. 0, /*tp_repr*/
  12822. 0, /*tp_as_number*/
  12823. 0, /*tp_as_sequence*/
  12824. 0, /*tp_as_mapping*/
  12825. 0, /*tp_hash*/
  12826. 0, /*tp_call*/
  12827. 0, /*tp_str*/
  12828. 0, /*tp_getattro*/
  12829. 0, /*tp_setattro*/
  12830. 0, /*tp_as_buffer*/
  12831. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12832. 0, /*tp_doc*/
  12833. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_traverse*/
  12834. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_clear*/
  12835. 0, /*tp_richcompare*/
  12836. 0, /*tp_weaklistoffset*/
  12837. 0, /*tp_iter*/
  12838. 0, /*tp_iternext*/
  12839. 0, /*tp_methods*/
  12840. 0, /*tp_members*/
  12841. 0, /*tp_getset*/
  12842. 0, /*tp_base*/
  12843. 0, /*tp_dict*/
  12844. 0, /*tp_descr_get*/
  12845. 0, /*tp_descr_set*/
  12846. 0, /*tp_dictoffset*/
  12847. 0, /*tp_init*/
  12848. 0, /*tp_alloc*/
  12849. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k, /*tp_new*/
  12850. 0, /*tp_free*/
  12851. 0, /*tp_is_gc*/
  12852. 0, /*tp_bases*/
  12853. 0, /*tp_mro*/
  12854. 0, /*tp_cache*/
  12855. 0, /*tp_subclasses*/
  12856. 0, /*tp_weaklist*/
  12857. 0, /*tp_del*/
  12858. #if PY_VERSION_HEX >= 0x02060000
  12859. 0, /*tp_version_tag*/
  12860. #endif
  12861. #if PY_VERSION_HEX >= 0x030400a1
  12862. 0, /*tp_finalize*/
  12863. #endif
  12864. };
  12865. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[8];
  12866. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = 0;
  12867. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12868. PyObject *o;
  12869. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k)))) {
  12870. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k];
  12871. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k));
  12872. (void) PyObject_INIT(o, t);
  12873. PyObject_GC_Track(o);
  12874. } else {
  12875. o = (*t->tp_alloc)(t, 0);
  12876. if (unlikely(!o)) return 0;
  12877. }
  12878. return o;
  12879. }
  12880. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) {
  12881. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o;
  12882. PyObject_GC_UnTrack(o);
  12883. Py_CLEAR(p->__pyx_v_func);
  12884. Py_CLEAR(p->__pyx_v_repetitions);
  12885. Py_CLEAR(p->__pyx_v_trials);
  12886. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k))) {
  12887. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o);
  12888. } else {
  12889. (*Py_TYPE(o)->tp_free)(o);
  12890. }
  12891. }
  12892. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o, visitproc v, void *a) {
  12893. int e;
  12894. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o;
  12895. if (p->__pyx_v_func) {
  12896. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  12897. }
  12898. if (p->__pyx_v_repetitions) {
  12899. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  12900. }
  12901. if (p->__pyx_v_trials) {
  12902. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  12903. }
  12904. return 0;
  12905. }
  12906. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k(PyObject *o) {
  12907. PyObject* tmp;
  12908. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k *)o;
  12909. tmp = ((PyObject*)p->__pyx_v_func);
  12910. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  12911. Py_XDECREF(tmp);
  12912. tmp = ((PyObject*)p->__pyx_v_repetitions);
  12913. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  12914. Py_XDECREF(tmp);
  12915. tmp = ((PyObject*)p->__pyx_v_trials);
  12916. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  12917. Py_XDECREF(tmp);
  12918. return 0;
  12919. }
  12920. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = {
  12921. PyVarObject_HEAD_INIT(0, 0)
  12922. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_10_timer_trials_benchmark_10k"), /*tp_name*/
  12923. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k), /*tp_basicsize*/
  12924. 0, /*tp_itemsize*/
  12925. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_dealloc*/
  12926. 0, /*tp_print*/
  12927. 0, /*tp_getattr*/
  12928. 0, /*tp_setattr*/
  12929. #if PY_MAJOR_VERSION < 3
  12930. 0, /*tp_compare*/
  12931. #else
  12932. 0, /*reserved*/
  12933. #endif
  12934. 0, /*tp_repr*/
  12935. 0, /*tp_as_number*/
  12936. 0, /*tp_as_sequence*/
  12937. 0, /*tp_as_mapping*/
  12938. 0, /*tp_hash*/
  12939. 0, /*tp_call*/
  12940. 0, /*tp_str*/
  12941. 0, /*tp_getattro*/
  12942. 0, /*tp_setattro*/
  12943. 0, /*tp_as_buffer*/
  12944. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  12945. 0, /*tp_doc*/
  12946. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_traverse*/
  12947. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_clear*/
  12948. 0, /*tp_richcompare*/
  12949. 0, /*tp_weaklistoffset*/
  12950. 0, /*tp_iter*/
  12951. 0, /*tp_iternext*/
  12952. 0, /*tp_methods*/
  12953. 0, /*tp_members*/
  12954. 0, /*tp_getset*/
  12955. 0, /*tp_base*/
  12956. 0, /*tp_dict*/
  12957. 0, /*tp_descr_get*/
  12958. 0, /*tp_descr_set*/
  12959. 0, /*tp_dictoffset*/
  12960. 0, /*tp_init*/
  12961. 0, /*tp_alloc*/
  12962. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k, /*tp_new*/
  12963. 0, /*tp_free*/
  12964. 0, /*tp_is_gc*/
  12965. 0, /*tp_bases*/
  12966. 0, /*tp_mro*/
  12967. 0, /*tp_cache*/
  12968. 0, /*tp_subclasses*/
  12969. 0, /*tp_weaklist*/
  12970. 0, /*tp_del*/
  12971. #if PY_VERSION_HEX >= 0x02060000
  12972. 0, /*tp_version_tag*/
  12973. #endif
  12974. #if PY_VERSION_HEX >= 0x030400a1
  12975. 0, /*tp_finalize*/
  12976. #endif
  12977. };
  12978. static struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[8];
  12979. static int __pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = 0;
  12980. static PyObject *__pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  12981. PyObject *o;
  12982. if (likely((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m)))) {
  12983. o = (PyObject*)__pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[--__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m];
  12984. memset(o, 0, sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m));
  12985. (void) PyObject_INIT(o, t);
  12986. PyObject_GC_Track(o);
  12987. } else {
  12988. o = (*t->tp_alloc)(t, 0);
  12989. if (unlikely(!o)) return 0;
  12990. }
  12991. return o;
  12992. }
  12993. static void __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) {
  12994. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o;
  12995. PyObject_GC_UnTrack(o);
  12996. Py_CLEAR(p->__pyx_v_func);
  12997. Py_CLEAR(p->__pyx_v_repetitions);
  12998. Py_CLEAR(p->__pyx_v_trials);
  12999. if ((__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m))) {
  13000. __pyx_freelist_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m[__pyx_freecount_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m++] = ((struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o);
  13001. } else {
  13002. (*Py_TYPE(o)->tp_free)(o);
  13003. }
  13004. }
  13005. static int __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o, visitproc v, void *a) {
  13006. int e;
  13007. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o;
  13008. if (p->__pyx_v_func) {
  13009. e = (*v)(p->__pyx_v_func, a); if (e) return e;
  13010. }
  13011. if (p->__pyx_v_repetitions) {
  13012. e = (*v)(p->__pyx_v_repetitions, a); if (e) return e;
  13013. }
  13014. if (p->__pyx_v_trials) {
  13015. e = (*v)(p->__pyx_v_trials, a); if (e) return e;
  13016. }
  13017. return 0;
  13018. }
  13019. static int __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m(PyObject *o) {
  13020. PyObject* tmp;
  13021. struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *p = (struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m *)o;
  13022. tmp = ((PyObject*)p->__pyx_v_func);
  13023. p->__pyx_v_func = Py_None; Py_INCREF(Py_None);
  13024. Py_XDECREF(tmp);
  13025. tmp = ((PyObject*)p->__pyx_v_repetitions);
  13026. p->__pyx_v_repetitions = Py_None; Py_INCREF(Py_None);
  13027. Py_XDECREF(tmp);
  13028. tmp = ((PyObject*)p->__pyx_v_trials);
  13029. p->__pyx_v_trials = Py_None; Py_INCREF(Py_None);
  13030. Py_XDECREF(tmp);
  13031. return 0;
  13032. }
  13033. static PyTypeObject __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = {
  13034. PyVarObject_HEAD_INIT(0, 0)
  13035. __Pyx_NAMESTR("lib.Naked.toolshed.c.benchmarking.__pyx_scope_struct_11_timer_trials_benchmark_1m"), /*tp_name*/
  13036. sizeof(struct __pyx_obj_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m), /*tp_basicsize*/
  13037. 0, /*tp_itemsize*/
  13038. __pyx_tp_dealloc_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_dealloc*/
  13039. 0, /*tp_print*/
  13040. 0, /*tp_getattr*/
  13041. 0, /*tp_setattr*/
  13042. #if PY_MAJOR_VERSION < 3
  13043. 0, /*tp_compare*/
  13044. #else
  13045. 0, /*reserved*/
  13046. #endif
  13047. 0, /*tp_repr*/
  13048. 0, /*tp_as_number*/
  13049. 0, /*tp_as_sequence*/
  13050. 0, /*tp_as_mapping*/
  13051. 0, /*tp_hash*/
  13052. 0, /*tp_call*/
  13053. 0, /*tp_str*/
  13054. 0, /*tp_getattro*/
  13055. 0, /*tp_setattro*/
  13056. 0, /*tp_as_buffer*/
  13057. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  13058. 0, /*tp_doc*/
  13059. __pyx_tp_traverse_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_traverse*/
  13060. __pyx_tp_clear_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_clear*/
  13061. 0, /*tp_richcompare*/
  13062. 0, /*tp_weaklistoffset*/
  13063. 0, /*tp_iter*/
  13064. 0, /*tp_iternext*/
  13065. 0, /*tp_methods*/
  13066. 0, /*tp_members*/
  13067. 0, /*tp_getset*/
  13068. 0, /*tp_base*/
  13069. 0, /*tp_dict*/
  13070. 0, /*tp_descr_get*/
  13071. 0, /*tp_descr_set*/
  13072. 0, /*tp_dictoffset*/
  13073. 0, /*tp_init*/
  13074. 0, /*tp_alloc*/
  13075. __pyx_tp_new_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m, /*tp_new*/
  13076. 0, /*tp_free*/
  13077. 0, /*tp_is_gc*/
  13078. 0, /*tp_bases*/
  13079. 0, /*tp_mro*/
  13080. 0, /*tp_cache*/
  13081. 0, /*tp_subclasses*/
  13082. 0, /*tp_weaklist*/
  13083. 0, /*tp_del*/
  13084. #if PY_VERSION_HEX >= 0x02060000
  13085. 0, /*tp_version_tag*/
  13086. #endif
  13087. #if PY_VERSION_HEX >= 0x030400a1
  13088. 0, /*tp_finalize*/
  13089. #endif
  13090. };
  13091. static PyMethodDef __pyx_methods[] = {
  13092. {0, 0, 0, 0}
  13093. };
  13094. #if PY_MAJOR_VERSION >= 3
  13095. static struct PyModuleDef __pyx_moduledef = {
  13096. #if PY_VERSION_HEX < 0x03020000
  13097. { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
  13098. #else
  13099. PyModuleDef_HEAD_INIT,
  13100. #endif
  13101. __Pyx_NAMESTR("benchmarking"),
  13102. 0, /* m_doc */
  13103. -1, /* m_size */
  13104. __pyx_methods /* m_methods */,
  13105. NULL, /* m_reload */
  13106. NULL, /* m_traverse */
  13107. NULL, /* m_clear */
  13108. NULL /* m_free */
  13109. };
  13110. #endif
  13111. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  13112. {&__pyx_kp_s_, __pyx_k_, sizeof(__pyx_k_), 0, 0, 1, 0},
  13113. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  13114. {&__pyx_n_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 1},
  13115. {&__pyx_kp_s_Mean_for, __pyx_k_Mean_for, sizeof(__pyx_k_Mean_for), 0, 0, 1, 0},
  13116. {&__pyx_kp_s_Mean_per_repetition, __pyx_k_Mean_per_repetition, sizeof(__pyx_k_Mean_per_repetition), 0, 0, 1, 0},
  13117. {&__pyx_kp_s_Ratio, __pyx_k_Ratio, sizeof(__pyx_k_Ratio), 0, 0, 1, 0},
  13118. {&__pyx_kp_s_Standard_Deviation, __pyx_k_Standard_Deviation, sizeof(__pyx_k_Standard_Deviation), 0, 0, 1, 0},
  13119. {&__pyx_kp_s_Starting, __pyx_k_Starting, sizeof(__pyx_k_Starting), 0, 0, 1, 0},
  13120. {&__pyx_kp_s_Starting_timed_trials_of, __pyx_k_Starting_timed_trials_of, sizeof(__pyx_k_Starting_timed_trials_of), 0, 0, 1, 0},
  13121. {&__pyx_kp_s_Trial, __pyx_k_Trial, sizeof(__pyx_k_Trial), 0, 0, 1, 0},
  13122. {&__pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_k_Users_ces_Desktop_code_naked_li, sizeof(__pyx_k_Users_ces_Desktop_code_naked_li), 0, 0, 1, 0},
  13123. {&__pyx_kp_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 0},
  13124. {&__pyx_kp_s__17, __pyx_k__17, sizeof(__pyx_k__17), 0, 0, 1, 0},
  13125. {&__pyx_kp_s__19, __pyx_k__19, sizeof(__pyx_k__19), 0, 0, 1, 0},
  13126. {&__pyx_kp_s__2, __pyx_k__2, sizeof(__pyx_k__2), 0, 0, 1, 0},
  13127. {&__pyx_kp_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 0},
  13128. {&__pyx_kp_s__3, __pyx_k__3, sizeof(__pyx_k__3), 0, 0, 1, 0},
  13129. {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  13130. {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
  13131. {&__pyx_n_s_benchmark_list, __pyx_k_benchmark_list, sizeof(__pyx_k_benchmark_list), 0, 0, 1, 1},
  13132. {&__pyx_n_s_collect, __pyx_k_collect, sizeof(__pyx_k_collect), 0, 0, 1, 1},
  13133. {&__pyx_n_s_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 0, 1, 1},
  13134. {&__pyx_n_s_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 0, 1, 1},
  13135. {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  13136. {&__pyx_n_s_end2, __pyx_k_end2, sizeof(__pyx_k_end2), 0, 0, 1, 1},
  13137. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  13138. {&__pyx_n_s_flush, __pyx_k_flush, sizeof(__pyx_k_flush), 0, 0, 1, 1},
  13139. {&__pyx_n_s_func, __pyx_k_func, sizeof(__pyx_k_func), 0, 0, 1, 1},
  13140. {&__pyx_n_s_functools, __pyx_k_functools, sizeof(__pyx_k_functools), 0, 0, 1, 1},
  13141. {&__pyx_n_s_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 0, 1, 1},
  13142. {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  13143. {&__pyx_n_s_ie, __pyx_k_ie, sizeof(__pyx_k_ie), 0, 0, 1, 1},
  13144. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  13145. {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  13146. {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  13147. {&__pyx_n_s_lib_Naked_toolshed_c_benchmarkin, __pyx_k_lib_Naked_toolshed_c_benchmarkin, sizeof(__pyx_k_lib_Naked_toolshed_c_benchmarkin), 0, 0, 1, 1},
  13148. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  13149. {&__pyx_n_s_mean, __pyx_k_mean, sizeof(__pyx_k_mean), 0, 0, 1, 1},
  13150. {&__pyx_n_s_mean_benchmark, __pyx_k_mean_benchmark, sizeof(__pyx_k_mean_benchmark), 0, 0, 1, 1},
  13151. {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  13152. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  13153. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  13154. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  13155. {&__pyx_kp_s_of_benchmark_function, __pyx_k_of_benchmark_function, sizeof(__pyx_k_of_benchmark_function), 0, 0, 1, 0},
  13156. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  13157. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  13158. {&__pyx_n_s_repetitions, __pyx_k_repetitions, sizeof(__pyx_k_repetitions), 0, 0, 1, 1},
  13159. {&__pyx_kp_s_repetitions_2, __pyx_k_repetitions_2, sizeof(__pyx_k_repetitions_2), 0, 0, 1, 0},
  13160. {&__pyx_kp_s_repetitions_of, __pyx_k_repetitions_of, sizeof(__pyx_k_repetitions_of), 0, 0, 1, 0},
  13161. {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  13162. {&__pyx_n_s_result_list, __pyx_k_result_list, sizeof(__pyx_k_result_list), 0, 0, 1, 1},
  13163. {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1},
  13164. {&__pyx_kp_s_sec, __pyx_k_sec, sizeof(__pyx_k_sec), 0, 0, 1, 0},
  13165. {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  13166. {&__pyx_n_s_start2, __pyx_k_start2, sizeof(__pyx_k_start2), 0, 0, 1, 1},
  13167. {&__pyx_n_s_std, __pyx_k_std, sizeof(__pyx_k_std), 0, 0, 1, 1},
  13168. {&__pyx_n_s_stdout, __pyx_k_stdout, sizeof(__pyx_k_stdout), 0, 0, 1, 1},
  13169. {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  13170. {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  13171. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  13172. {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  13173. {&__pyx_n_s_timer, __pyx_k_timer, sizeof(__pyx_k_timer), 0, 0, 1, 1},
  13174. {&__pyx_n_s_timer_10, __pyx_k_timer_10, sizeof(__pyx_k_timer_10), 0, 0, 1, 1},
  13175. {&__pyx_n_s_timer_100, __pyx_k_timer_100, sizeof(__pyx_k_timer_100), 0, 0, 1, 1},
  13176. {&__pyx_n_s_timer_100_locals_wrapper, __pyx_k_timer_100_locals_wrapper, sizeof(__pyx_k_timer_100_locals_wrapper), 0, 0, 1, 1},
  13177. {&__pyx_n_s_timer_10_locals_wrapper, __pyx_k_timer_10_locals_wrapper, sizeof(__pyx_k_timer_10_locals_wrapper), 0, 0, 1, 1},
  13178. {&__pyx_n_s_timer_10k, __pyx_k_timer_10k, sizeof(__pyx_k_timer_10k), 0, 0, 1, 1},
  13179. {&__pyx_n_s_timer_10k_locals_wrapper, __pyx_k_timer_10k_locals_wrapper, sizeof(__pyx_k_timer_10k_locals_wrapper), 0, 0, 1, 1},
  13180. {&__pyx_n_s_timer_1k, __pyx_k_timer_1k, sizeof(__pyx_k_timer_1k), 0, 0, 1, 1},
  13181. {&__pyx_n_s_timer_1k_locals_wrapper, __pyx_k_timer_1k_locals_wrapper, sizeof(__pyx_k_timer_1k_locals_wrapper), 0, 0, 1, 1},
  13182. {&__pyx_n_s_timer_1m, __pyx_k_timer_1m, sizeof(__pyx_k_timer_1m), 0, 0, 1, 1},
  13183. {&__pyx_n_s_timer_1m_locals_wrapper, __pyx_k_timer_1m_locals_wrapper, sizeof(__pyx_k_timer_1m_locals_wrapper), 0, 0, 1, 1},
  13184. {&__pyx_n_s_timer_locals_wrapper, __pyx_k_timer_locals_wrapper, sizeof(__pyx_k_timer_locals_wrapper), 0, 0, 1, 1},
  13185. {&__pyx_n_s_timer_trials_benchmark, __pyx_k_timer_trials_benchmark, sizeof(__pyx_k_timer_trials_benchmark), 0, 0, 1, 1},
  13186. {&__pyx_n_s_timer_trials_benchmark_10, __pyx_k_timer_trials_benchmark_10, sizeof(__pyx_k_timer_trials_benchmark_10), 0, 0, 1, 1},
  13187. {&__pyx_n_s_timer_trials_benchmark_100, __pyx_k_timer_trials_benchmark_100, sizeof(__pyx_k_timer_trials_benchmark_100), 0, 0, 1, 1},
  13188. {&__pyx_n_s_timer_trials_benchmark_100_local, __pyx_k_timer_trials_benchmark_100_local, sizeof(__pyx_k_timer_trials_benchmark_100_local), 0, 0, 1, 1},
  13189. {&__pyx_n_s_timer_trials_benchmark_10_locals, __pyx_k_timer_trials_benchmark_10_locals, sizeof(__pyx_k_timer_trials_benchmark_10_locals), 0, 0, 1, 1},
  13190. {&__pyx_n_s_timer_trials_benchmark_10k, __pyx_k_timer_trials_benchmark_10k, sizeof(__pyx_k_timer_trials_benchmark_10k), 0, 0, 1, 1},
  13191. {&__pyx_n_s_timer_trials_benchmark_10k_local, __pyx_k_timer_trials_benchmark_10k_local, sizeof(__pyx_k_timer_trials_benchmark_10k_local), 0, 0, 1, 1},
  13192. {&__pyx_n_s_timer_trials_benchmark_1k, __pyx_k_timer_trials_benchmark_1k, sizeof(__pyx_k_timer_trials_benchmark_1k), 0, 0, 1, 1},
  13193. {&__pyx_n_s_timer_trials_benchmark_1k_locals, __pyx_k_timer_trials_benchmark_1k_locals, sizeof(__pyx_k_timer_trials_benchmark_1k_locals), 0, 0, 1, 1},
  13194. {&__pyx_n_s_timer_trials_benchmark_1m, __pyx_k_timer_trials_benchmark_1m, sizeof(__pyx_k_timer_trials_benchmark_1m), 0, 0, 1, 1},
  13195. {&__pyx_n_s_timer_trials_benchmark_1m_locals, __pyx_k_timer_trials_benchmark_1m_locals, sizeof(__pyx_k_timer_trials_benchmark_1m_locals), 0, 0, 1, 1},
  13196. {&__pyx_n_s_timer_trials_benchmark_locals_wr, __pyx_k_timer_trials_benchmark_locals_wr, sizeof(__pyx_k_timer_trials_benchmark_locals_wr), 0, 0, 1, 1},
  13197. {&__pyx_n_s_trials, __pyx_k_trials, sizeof(__pyx_k_trials), 0, 0, 1, 1},
  13198. {&__pyx_n_s_wrapper, __pyx_k_wrapper, sizeof(__pyx_k_wrapper), 0, 0, 1, 1},
  13199. {&__pyx_n_s_wraps, __pyx_k_wraps, sizeof(__pyx_k_wraps), 0, 0, 1, 1},
  13200. {&__pyx_n_s_write, __pyx_k_write, sizeof(__pyx_k_write), 0, 0, 1, 1},
  13201. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  13202. {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  13203. {0, 0, 0, 0, 0, 0, 0}
  13204. };
  13205. static int __Pyx_InitCachedBuiltins(void) {
  13206. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13207. __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13208. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13209. return 0;
  13210. __pyx_L1_error:;
  13211. return -1;
  13212. }
  13213. static int __Pyx_InitCachedConstants(void) {
  13214. __Pyx_RefNannyDeclarations
  13215. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  13216. /* "lib/Naked/toolshed/c/benchmarking.pyx":21
  13217. * def timer(func, repetitions=100000):
  13218. * @wraps(func)
  13219. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13220. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13221. * sys.stdout.flush()
  13222. */
  13223. __pyx_tuple__4 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13224. __Pyx_GOTREF(__pyx_tuple__4);
  13225. __Pyx_GIVEREF(__pyx_tuple__4);
  13226. __pyx_codeobj__5 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__4, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 21, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13227. /* "lib/Naked/toolshed/c/benchmarking.pyx":45
  13228. * def timer_10(func, repetitions=10):
  13229. * @wraps(func)
  13230. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13231. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13232. * sys.stdout.flush()
  13233. */
  13234. __pyx_tuple__6 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13235. __Pyx_GOTREF(__pyx_tuple__6);
  13236. __Pyx_GIVEREF(__pyx_tuple__6);
  13237. __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__6, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 45, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13238. /* "lib/Naked/toolshed/c/benchmarking.pyx":64
  13239. * def timer_100(func, repetitions=100):
  13240. * @wraps(func)
  13241. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13242. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13243. * sys.stdout.flush()
  13244. */
  13245. __pyx_tuple__8 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13246. __Pyx_GOTREF(__pyx_tuple__8);
  13247. __Pyx_GIVEREF(__pyx_tuple__8);
  13248. __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__8, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 64, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13249. /* "lib/Naked/toolshed/c/benchmarking.pyx":83
  13250. * def timer_1k(func, repetitions=1000):
  13251. * @wraps(func)
  13252. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13253. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13254. * sys.stdout.flush()
  13255. */
  13256. __pyx_tuple__10 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13257. __Pyx_GOTREF(__pyx_tuple__10);
  13258. __Pyx_GIVEREF(__pyx_tuple__10);
  13259. __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__10, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13260. /* "lib/Naked/toolshed/c/benchmarking.pyx":102
  13261. * def timer_10k(func, repetitions=10000):
  13262. * @wraps(func)
  13263. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13264. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13265. * sys.stdout.flush()
  13266. */
  13267. __pyx_tuple__12 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13268. __Pyx_GOTREF(__pyx_tuple__12);
  13269. __Pyx_GIVEREF(__pyx_tuple__12);
  13270. __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 102, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13271. /* "lib/Naked/toolshed/c/benchmarking.pyx":121
  13272. * def timer_1m(func, repetitions=1000000):
  13273. * @wraps(func)
  13274. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13275. * sys.stdout.write("Starting " + str(repetitions) + " repetitions of " + func.__name__ + "()...")
  13276. * sys.stdout.flush()
  13277. */
  13278. __pyx_tuple__14 = PyTuple_Pack(6, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_start, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_end); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13279. __Pyx_GOTREF(__pyx_tuple__14);
  13280. __Pyx_GIVEREF(__pyx_tuple__14);
  13281. __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(0, 0, 6, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 121, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13282. /* "lib/Naked/toolshed/c/benchmarking.pyx":178
  13283. * end2 = time.time()
  13284. * benchmark_list.append(end2 - start2)
  13285. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13286. * sys.stdout.flush()
  13287. * gc.enable() # re-enable garbage collection
  13288. */
  13289. __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13290. __Pyx_GOTREF(__pyx_tuple__18);
  13291. __Pyx_GIVEREF(__pyx_tuple__18);
  13292. /* "lib/Naked/toolshed/c/benchmarking.pyx":154
  13293. * def timer_trials_benchmark(func, repetitions=100000, trials=10):
  13294. * @wraps(func)
  13295. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13296. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13297. * sys.stdout.flush()
  13298. */
  13299. __pyx_tuple__21 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13300. __Pyx_GOTREF(__pyx_tuple__21);
  13301. __Pyx_GIVEREF(__pyx_tuple__21);
  13302. __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 154, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13303. /* "lib/Naked/toolshed/c/benchmarking.pyx":233
  13304. * end2 = time.time()
  13305. * benchmark_list.append(end2 - start2)
  13306. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13307. * sys.stdout.flush()
  13308. * gc.enable() # re-enable garbage collection
  13309. */
  13310. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13311. __Pyx_GOTREF(__pyx_tuple__23);
  13312. __Pyx_GIVEREF(__pyx_tuple__23);
  13313. /* "lib/Naked/toolshed/c/benchmarking.pyx":209
  13314. * def timer_trials_benchmark_10(func, repetitions=10, trials=10):
  13315. * @wraps(func)
  13316. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13317. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13318. * sys.stdout.flush()
  13319. */
  13320. __pyx_tuple__24 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13321. __Pyx_GOTREF(__pyx_tuple__24);
  13322. __Pyx_GIVEREF(__pyx_tuple__24);
  13323. __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 209, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13324. /* "lib/Naked/toolshed/c/benchmarking.pyx":284
  13325. * end2 = time.time()
  13326. * benchmark_list.append(end2 - start2)
  13327. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13328. * sys.stdout.flush()
  13329. * gc.enable() # re-enable garbage collection
  13330. */
  13331. __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13332. __Pyx_GOTREF(__pyx_tuple__26);
  13333. __Pyx_GIVEREF(__pyx_tuple__26);
  13334. /* "lib/Naked/toolshed/c/benchmarking.pyx":260
  13335. * def timer_trials_benchmark_100(func, repetitions=100, trials=10):
  13336. * @wraps(func)
  13337. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13338. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13339. * sys.stdout.flush()
  13340. */
  13341. __pyx_tuple__27 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13342. __Pyx_GOTREF(__pyx_tuple__27);
  13343. __Pyx_GIVEREF(__pyx_tuple__27);
  13344. __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 260, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13345. /* "lib/Naked/toolshed/c/benchmarking.pyx":335
  13346. * end2 = time.time()
  13347. * benchmark_list.append(end2 - start2)
  13348. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13349. * sys.stdout.flush()
  13350. * gc.enable() # re-enable garbage collection
  13351. */
  13352. __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13353. __Pyx_GOTREF(__pyx_tuple__29);
  13354. __Pyx_GIVEREF(__pyx_tuple__29);
  13355. /* "lib/Naked/toolshed/c/benchmarking.pyx":311
  13356. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10):
  13357. * @wraps(func)
  13358. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13359. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13360. * sys.stdout.flush()
  13361. */
  13362. __pyx_tuple__30 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13363. __Pyx_GOTREF(__pyx_tuple__30);
  13364. __Pyx_GIVEREF(__pyx_tuple__30);
  13365. __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13366. /* "lib/Naked/toolshed/c/benchmarking.pyx":386
  13367. * end2 = time.time()
  13368. * benchmark_list.append(end2 - start2)
  13369. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13370. * sys.stdout.flush()
  13371. * gc.enable() # re-enable garbage collection
  13372. */
  13373. __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13374. __Pyx_GOTREF(__pyx_tuple__32);
  13375. __Pyx_GIVEREF(__pyx_tuple__32);
  13376. /* "lib/Naked/toolshed/c/benchmarking.pyx":362
  13377. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10):
  13378. * @wraps(func)
  13379. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13380. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13381. * sys.stdout.flush()
  13382. */
  13383. __pyx_tuple__33 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13384. __Pyx_GOTREF(__pyx_tuple__33);
  13385. __Pyx_GIVEREF(__pyx_tuple__33);
  13386. __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 362, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13387. /* "lib/Naked/toolshed/c/benchmarking.pyx":437
  13388. * end2 = time.time()
  13389. * benchmark_list.append(end2 - start2)
  13390. * sys.stdout.write(".") # <<<<<<<<<<<<<<
  13391. * sys.stdout.flush()
  13392. * gc.enable() # re-enable garbage collection
  13393. */
  13394. __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s__17); if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13395. __Pyx_GOTREF(__pyx_tuple__35);
  13396. __Pyx_GIVEREF(__pyx_tuple__35);
  13397. /* "lib/Naked/toolshed/c/benchmarking.pyx":413
  13398. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10):
  13399. * @wraps(func)
  13400. * def wrapper(*args, **kwargs): # <<<<<<<<<<<<<<
  13401. * sys.stdout.write("Starting timed trials of " + func.__name__ + "()")
  13402. * sys.stdout.flush()
  13403. */
  13404. __pyx_tuple__36 = PyTuple_Pack(21, __pyx_n_s_args, __pyx_n_s_kwargs, __pyx_n_s_result_list, __pyx_n_s_benchmark_list, __pyx_n_s_x, __pyx_n_s_start, __pyx_n_s_y, __pyx_n_s_end, __pyx_n_s_result, __pyx_n_s_L, __pyx_n_s_start2, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_end2, __pyx_n_s_n, __pyx_n_s_run, __pyx_n_s_mean, __pyx_n_s_mean_benchmark, __pyx_n_s_np, __pyx_n_s_array, __pyx_n_s_ie); if (unlikely(!__pyx_tuple__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13405. __Pyx_GOTREF(__pyx_tuple__36);
  13406. __Pyx_GIVEREF(__pyx_tuple__36);
  13407. __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(0, 0, 21, 0, CO_VARARGS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_wrapper, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13408. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  13409. * # def myfunction():
  13410. * #------------------------------------------------------------------------------
  13411. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  13412. * @wraps(func)
  13413. * def wrapper(*args, **kwargs):
  13414. */
  13415. __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13416. __Pyx_GOTREF(__pyx_tuple__38);
  13417. __Pyx_GIVEREF(__pyx_tuple__38);
  13418. __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer, 19, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13419. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  13420. * #------------------------------------------------------------------------------
  13421. *
  13422. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  13423. * @wraps(func)
  13424. * def wrapper(*args, **kwargs):
  13425. */
  13426. __pyx_tuple__40 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13427. __Pyx_GOTREF(__pyx_tuple__40);
  13428. __Pyx_GIVEREF(__pyx_tuple__40);
  13429. __pyx_codeobj__41 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10, 43, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13430. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  13431. * return wrapper
  13432. *
  13433. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  13434. * @wraps(func)
  13435. * def wrapper(*args, **kwargs):
  13436. */
  13437. __pyx_tuple__42 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13438. __Pyx_GOTREF(__pyx_tuple__42);
  13439. __Pyx_GIVEREF(__pyx_tuple__42);
  13440. __pyx_codeobj__43 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_100, 62, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13441. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  13442. * return wrapper
  13443. *
  13444. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  13445. * @wraps(func)
  13446. * def wrapper(*args, **kwargs):
  13447. */
  13448. __pyx_tuple__44 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13449. __Pyx_GOTREF(__pyx_tuple__44);
  13450. __Pyx_GIVEREF(__pyx_tuple__44);
  13451. __pyx_codeobj__45 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1k, 81, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13452. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  13453. * return wrapper
  13454. *
  13455. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  13456. * @wraps(func)
  13457. * def wrapper(*args, **kwargs):
  13458. */
  13459. __pyx_tuple__46 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13460. __Pyx_GOTREF(__pyx_tuple__46);
  13461. __Pyx_GIVEREF(__pyx_tuple__46);
  13462. __pyx_codeobj__47 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_10k, 100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13463. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  13464. * return wrapper
  13465. *
  13466. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  13467. * @wraps(func)
  13468. * def wrapper(*args, **kwargs):
  13469. */
  13470. __pyx_tuple__48 = PyTuple_Pack(4, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13471. __Pyx_GOTREF(__pyx_tuple__48);
  13472. __Pyx_GIVEREF(__pyx_tuple__48);
  13473. __pyx_codeobj__49 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__48, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_1m, 119, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13474. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  13475. * # def myfunction():
  13476. * #------------------------------------------------------------------------------
  13477. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  13478. * @wraps(func)
  13479. * def wrapper(*args, **kwargs):
  13480. */
  13481. __pyx_tuple__50 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13482. __Pyx_GOTREF(__pyx_tuple__50);
  13483. __Pyx_GIVEREF(__pyx_tuple__50);
  13484. __pyx_codeobj__51 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__50, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark, 152, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13485. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  13486. * # additional benchmark decorators that replicate the above function with different # repetitions
  13487. * #------------------------------------------------------------------------------
  13488. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  13489. * @wraps(func)
  13490. * def wrapper(*args, **kwargs):
  13491. */
  13492. __pyx_tuple__52 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13493. __Pyx_GOTREF(__pyx_tuple__52);
  13494. __Pyx_GIVEREF(__pyx_tuple__52);
  13495. __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10, 207, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13496. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  13497. * return wrapper
  13498. *
  13499. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  13500. * @wraps(func)
  13501. * def wrapper(*args, **kwargs):
  13502. */
  13503. __pyx_tuple__54 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13504. __Pyx_GOTREF(__pyx_tuple__54);
  13505. __Pyx_GIVEREF(__pyx_tuple__54);
  13506. __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_100, 258, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13507. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  13508. * return wrapper
  13509. *
  13510. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  13511. * @wraps(func)
  13512. * def wrapper(*args, **kwargs):
  13513. */
  13514. __pyx_tuple__56 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13515. __Pyx_GOTREF(__pyx_tuple__56);
  13516. __Pyx_GIVEREF(__pyx_tuple__56);
  13517. __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1k, 309, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13518. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  13519. * return wrapper
  13520. *
  13521. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  13522. * @wraps(func)
  13523. * def wrapper(*args, **kwargs):
  13524. */
  13525. __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13526. __Pyx_GOTREF(__pyx_tuple__58);
  13527. __Pyx_GIVEREF(__pyx_tuple__58);
  13528. __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_10k, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13529. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  13530. * return wrapper
  13531. *
  13532. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  13533. * @wraps(func)
  13534. * def wrapper(*args, **kwargs):
  13535. */
  13536. __pyx_tuple__60 = PyTuple_Pack(5, __pyx_n_s_func, __pyx_n_s_repetitions, __pyx_n_s_trials, __pyx_n_s_wrapper, __pyx_n_s_wrapper); if (unlikely(!__pyx_tuple__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13537. __Pyx_GOTREF(__pyx_tuple__60);
  13538. __Pyx_GIVEREF(__pyx_tuple__60);
  13539. __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Users_ces_Desktop_code_naked_li, __pyx_n_s_timer_trials_benchmark_1m, 411, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13540. __Pyx_RefNannyFinishContext();
  13541. return 0;
  13542. __pyx_L1_error:;
  13543. __Pyx_RefNannyFinishContext();
  13544. return -1;
  13545. }
  13546. static int __Pyx_InitGlobals(void) {
  13547. if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  13548. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13549. __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13550. __pyx_int_50 = PyInt_FromLong(50); if (unlikely(!__pyx_int_50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13551. __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13552. __pyx_int_1000 = PyInt_FromLong(1000); if (unlikely(!__pyx_int_1000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13553. __pyx_int_10000 = PyInt_FromLong(10000L); if (unlikely(!__pyx_int_10000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13554. __pyx_int_100000 = PyInt_FromLong(100000L); if (unlikely(!__pyx_int_100000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13555. __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13556. return 0;
  13557. __pyx_L1_error:;
  13558. return -1;
  13559. }
  13560. #if PY_MAJOR_VERSION < 3
  13561. PyMODINIT_FUNC initbenchmarking(void); /*proto*/
  13562. PyMODINIT_FUNC initbenchmarking(void)
  13563. #else
  13564. PyMODINIT_FUNC PyInit_benchmarking(void); /*proto*/
  13565. PyMODINIT_FUNC PyInit_benchmarking(void)
  13566. #endif
  13567. {
  13568. PyObject *__pyx_t_1 = NULL;
  13569. PyObject *__pyx_t_2 = NULL;
  13570. int __pyx_t_3;
  13571. int __pyx_lineno = 0;
  13572. const char *__pyx_filename = NULL;
  13573. int __pyx_clineno = 0;
  13574. __Pyx_RefNannyDeclarations
  13575. #if CYTHON_REFNANNY
  13576. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  13577. if (!__Pyx_RefNanny) {
  13578. PyErr_Clear();
  13579. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  13580. if (!__Pyx_RefNanny)
  13581. Py_FatalError("failed to import 'refnanny' module");
  13582. }
  13583. #endif
  13584. __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_benchmarking(void)", 0);
  13585. if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13586. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13587. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13588. #ifdef __Pyx_CyFunction_USED
  13589. if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13590. #endif
  13591. #ifdef __Pyx_FusedFunction_USED
  13592. if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13593. #endif
  13594. #ifdef __Pyx_Generator_USED
  13595. if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13596. #endif
  13597. /*--- Library function declarations ---*/
  13598. /*--- Threads initialization code ---*/
  13599. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  13600. #ifdef WITH_THREAD /* Python build with threading support? */
  13601. PyEval_InitThreads();
  13602. #endif
  13603. #endif
  13604. /*--- Module creation code ---*/
  13605. #if PY_MAJOR_VERSION < 3
  13606. __pyx_m = Py_InitModule4(__Pyx_NAMESTR("benchmarking"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  13607. #else
  13608. __pyx_m = PyModule_Create(&__pyx_moduledef);
  13609. #endif
  13610. if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13611. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13612. Py_INCREF(__pyx_d);
  13613. __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13614. #if CYTHON_COMPILING_IN_PYPY
  13615. Py_INCREF(__pyx_b);
  13616. #endif
  13617. if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  13618. /*--- Initialize various global constants etc. ---*/
  13619. if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13620. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  13621. if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13622. #endif
  13623. if (__pyx_module_is_main_lib__Naked__toolshed__c__benchmarking) {
  13624. if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  13625. }
  13626. #if PY_MAJOR_VERSION >= 3
  13627. {
  13628. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13629. if (!PyDict_GetItemString(modules, "lib.Naked.toolshed.c.benchmarking")) {
  13630. if (unlikely(PyDict_SetItemString(modules, "lib.Naked.toolshed.c.benchmarking", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13631. }
  13632. }
  13633. #endif
  13634. /*--- Builtin init code ---*/
  13635. if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13636. /*--- Constants init code ---*/
  13637. if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13638. /*--- Global init code ---*/
  13639. /*--- Variable export code ---*/
  13640. /*--- Function export code ---*/
  13641. /*--- Type init code ---*/
  13642. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13643. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer.tp_print = 0;
  13644. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct__timer;
  13645. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13646. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10.tp_print = 0;
  13647. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_1_timer_10;
  13648. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13649. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100.tp_print = 0;
  13650. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_2_timer_100;
  13651. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13652. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k.tp_print = 0;
  13653. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_3_timer_1k;
  13654. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13655. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k.tp_print = 0;
  13656. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_4_timer_10k;
  13657. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13658. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m.tp_print = 0;
  13659. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_5_timer_1m;
  13660. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13661. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark.tp_print = 0;
  13662. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_6_timer_trials_benchmark;
  13663. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13664. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10.tp_print = 0;
  13665. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_7_timer_trials_benchmark_10;
  13666. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13667. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100.tp_print = 0;
  13668. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100 = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_8_timer_trials_benchmark_100;
  13669. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13670. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k.tp_print = 0;
  13671. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_9_timer_trials_benchmark_1k;
  13672. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13673. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k.tp_print = 0;
  13674. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_10_timer_trials_benchmark_10k;
  13675. if (PyType_Ready(&__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13676. __pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m.tp_print = 0;
  13677. __pyx_ptype_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m = &__pyx_type_3lib_5Naked_8toolshed_1c_12benchmarking___pyx_scope_struct_11_timer_trials_benchmark_1m;
  13678. /*--- Type import code ---*/
  13679. /*--- Variable import code ---*/
  13680. /*--- Function import code ---*/
  13681. /*--- Execution code ---*/
  13682. /* "lib/Naked/toolshed/c/benchmarking.pyx":4
  13683. * # encoding: utf-8
  13684. *
  13685. * import sys # <<<<<<<<<<<<<<
  13686. * import time
  13687. * import gc
  13688. */
  13689. __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13690. __Pyx_GOTREF(__pyx_t_1);
  13691. if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 4; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13692. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13693. /* "lib/Naked/toolshed/c/benchmarking.pyx":5
  13694. *
  13695. * import sys
  13696. * import time # <<<<<<<<<<<<<<
  13697. * import gc
  13698. * from functools import wraps
  13699. */
  13700. __pyx_t_1 = __Pyx_Import(__pyx_n_s_time, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13701. __Pyx_GOTREF(__pyx_t_1);
  13702. if (PyDict_SetItem(__pyx_d, __pyx_n_s_time, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 5; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13703. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13704. /* "lib/Naked/toolshed/c/benchmarking.pyx":6
  13705. * import sys
  13706. * import time
  13707. * import gc # <<<<<<<<<<<<<<
  13708. * from functools import wraps
  13709. *
  13710. */
  13711. __pyx_t_1 = __Pyx_Import(__pyx_n_s_gc, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13712. __Pyx_GOTREF(__pyx_t_1);
  13713. if (PyDict_SetItem(__pyx_d, __pyx_n_s_gc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 6; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13714. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13715. /* "lib/Naked/toolshed/c/benchmarking.pyx":7
  13716. * import time
  13717. * import gc
  13718. * from functools import wraps # <<<<<<<<<<<<<<
  13719. *
  13720. * #------------------------------------------------------------------------------
  13721. */
  13722. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13723. __Pyx_GOTREF(__pyx_t_1);
  13724. __Pyx_INCREF(__pyx_n_s_wraps);
  13725. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_wraps);
  13726. __Pyx_GIVEREF(__pyx_n_s_wraps);
  13727. __pyx_t_2 = __Pyx_Import(__pyx_n_s_functools, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13728. __Pyx_GOTREF(__pyx_t_2);
  13729. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13730. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_wraps); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13731. __Pyx_GOTREF(__pyx_t_1);
  13732. if (PyDict_SetItem(__pyx_d, __pyx_n_s_wraps, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 7; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13733. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13734. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13735. /* "lib/Naked/toolshed/c/benchmarking.pyx":19
  13736. * # def myfunction():
  13737. * #------------------------------------------------------------------------------
  13738. * def timer(func, repetitions=100000): # <<<<<<<<<<<<<<
  13739. * @wraps(func)
  13740. * def wrapper(*args, **kwargs):
  13741. */
  13742. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_1timer, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13743. __Pyx_GOTREF(__pyx_t_2);
  13744. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13745. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13746. /* "lib/Naked/toolshed/c/benchmarking.pyx":43
  13747. * #------------------------------------------------------------------------------
  13748. *
  13749. * def timer_10(func, repetitions=10): # <<<<<<<<<<<<<<
  13750. * @wraps(func)
  13751. * def wrapper(*args, **kwargs):
  13752. */
  13753. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_3timer_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13754. __Pyx_GOTREF(__pyx_t_2);
  13755. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13756. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13757. /* "lib/Naked/toolshed/c/benchmarking.pyx":62
  13758. * return wrapper
  13759. *
  13760. * def timer_100(func, repetitions=100): # <<<<<<<<<<<<<<
  13761. * @wraps(func)
  13762. * def wrapper(*args, **kwargs):
  13763. */
  13764. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_5timer_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13765. __Pyx_GOTREF(__pyx_t_2);
  13766. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13767. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13768. /* "lib/Naked/toolshed/c/benchmarking.pyx":81
  13769. * return wrapper
  13770. *
  13771. * def timer_1k(func, repetitions=1000): # <<<<<<<<<<<<<<
  13772. * @wraps(func)
  13773. * def wrapper(*args, **kwargs):
  13774. */
  13775. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_7timer_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13776. __Pyx_GOTREF(__pyx_t_2);
  13777. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 81; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13778. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13779. /* "lib/Naked/toolshed/c/benchmarking.pyx":100
  13780. * return wrapper
  13781. *
  13782. * def timer_10k(func, repetitions=10000): # <<<<<<<<<<<<<<
  13783. * @wraps(func)
  13784. * def wrapper(*args, **kwargs):
  13785. */
  13786. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_9timer_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13787. __Pyx_GOTREF(__pyx_t_2);
  13788. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13789. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13790. /* "lib/Naked/toolshed/c/benchmarking.pyx":119
  13791. * return wrapper
  13792. *
  13793. * def timer_1m(func, repetitions=1000000): # <<<<<<<<<<<<<<
  13794. * @wraps(func)
  13795. * def wrapper(*args, **kwargs):
  13796. */
  13797. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_11timer_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13798. __Pyx_GOTREF(__pyx_t_2);
  13799. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13800. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13801. /* "lib/Naked/toolshed/c/benchmarking.pyx":152
  13802. * # def myfunction():
  13803. * #------------------------------------------------------------------------------
  13804. * def timer_trials_benchmark(func, repetitions=100000, trials=10): # <<<<<<<<<<<<<<
  13805. * @wraps(func)
  13806. * def wrapper(*args, **kwargs):
  13807. */
  13808. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_13timer_trials_benchmark, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13809. __Pyx_GOTREF(__pyx_t_2);
  13810. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13811. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13812. /* "lib/Naked/toolshed/c/benchmarking.pyx":207
  13813. * # additional benchmark decorators that replicate the above function with different # repetitions
  13814. * #------------------------------------------------------------------------------
  13815. * def timer_trials_benchmark_10(func, repetitions=10, trials=10): # <<<<<<<<<<<<<<
  13816. * @wraps(func)
  13817. * def wrapper(*args, **kwargs):
  13818. */
  13819. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_15timer_trials_benchmark_10, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13820. __Pyx_GOTREF(__pyx_t_2);
  13821. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13822. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13823. /* "lib/Naked/toolshed/c/benchmarking.pyx":258
  13824. * return wrapper
  13825. *
  13826. * def timer_trials_benchmark_100(func, repetitions=100, trials=10): # <<<<<<<<<<<<<<
  13827. * @wraps(func)
  13828. * def wrapper(*args, **kwargs):
  13829. */
  13830. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_17timer_trials_benchmark_100, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13831. __Pyx_GOTREF(__pyx_t_2);
  13832. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_100, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13833. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13834. /* "lib/Naked/toolshed/c/benchmarking.pyx":309
  13835. * return wrapper
  13836. *
  13837. * def timer_trials_benchmark_1k(func, repetitions=1000, trials=10): # <<<<<<<<<<<<<<
  13838. * @wraps(func)
  13839. * def wrapper(*args, **kwargs):
  13840. */
  13841. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_19timer_trials_benchmark_1k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13842. __Pyx_GOTREF(__pyx_t_2);
  13843. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13844. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13845. /* "lib/Naked/toolshed/c/benchmarking.pyx":360
  13846. * return wrapper
  13847. *
  13848. * def timer_trials_benchmark_10k(func, repetitions=10000, trials=10): # <<<<<<<<<<<<<<
  13849. * @wraps(func)
  13850. * def wrapper(*args, **kwargs):
  13851. */
  13852. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_21timer_trials_benchmark_10k, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13853. __Pyx_GOTREF(__pyx_t_2);
  13854. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_10k, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13855. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13856. /* "lib/Naked/toolshed/c/benchmarking.pyx":411
  13857. * return wrapper
  13858. *
  13859. * def timer_trials_benchmark_1m(func, repetitions=1000000, trials=10): # <<<<<<<<<<<<<<
  13860. * @wraps(func)
  13861. * def wrapper(*args, **kwargs):
  13862. */
  13863. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_3lib_5Naked_8toolshed_1c_12benchmarking_23timer_trials_benchmark_1m, NULL, __pyx_n_s_lib_Naked_toolshed_c_benchmarkin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13864. __Pyx_GOTREF(__pyx_t_2);
  13865. if (PyDict_SetItem(__pyx_d, __pyx_n_s_timer_trials_benchmark_1m, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13866. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13867. /* "lib/Naked/toolshed/c/benchmarking.pyx":462
  13868. * return wrapper
  13869. *
  13870. * if __name__ == '__main__': # <<<<<<<<<<<<<<
  13871. * pass
  13872. */
  13873. __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13874. __Pyx_GOTREF(__pyx_t_2);
  13875. __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_2, __pyx_n_s_main, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13876. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13877. if (__pyx_t_3) {
  13878. goto __pyx_L2;
  13879. }
  13880. __pyx_L2:;
  13881. /* "lib/Naked/toolshed/c/benchmarking.pyx":1
  13882. * #!/usr/bin/env python # <<<<<<<<<<<<<<
  13883. * # encoding: utf-8
  13884. *
  13885. */
  13886. __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13887. __Pyx_GOTREF(__pyx_t_2);
  13888. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  13889. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13890. goto __pyx_L0;
  13891. __pyx_L1_error:;
  13892. __Pyx_XDECREF(__pyx_t_1);
  13893. __Pyx_XDECREF(__pyx_t_2);
  13894. if (__pyx_m) {
  13895. __Pyx_AddTraceback("init lib.Naked.toolshed.c.benchmarking", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13896. Py_DECREF(__pyx_m); __pyx_m = 0;
  13897. } else if (!PyErr_Occurred()) {
  13898. PyErr_SetString(PyExc_ImportError, "init lib.Naked.toolshed.c.benchmarking");
  13899. }
  13900. __pyx_L0:;
  13901. __Pyx_RefNannyFinishContext();
  13902. #if PY_MAJOR_VERSION < 3
  13903. return;
  13904. #else
  13905. return __pyx_m;
  13906. #endif
  13907. }
  13908. /* Runtime support code */
  13909. #if CYTHON_REFNANNY
  13910. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  13911. PyObject *m = NULL, *p = NULL;
  13912. void *r = NULL;
  13913. m = PyImport_ImportModule((char *)modname);
  13914. if (!m) goto end;
  13915. p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
  13916. if (!p) goto end;
  13917. r = PyLong_AsVoidPtr(p);
  13918. end:
  13919. Py_XDECREF(p);
  13920. Py_XDECREF(m);
  13921. return (__Pyx_RefNannyAPIStruct *)r;
  13922. }
  13923. #endif /* CYTHON_REFNANNY */
  13924. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  13925. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  13926. if (unlikely(!result)) {
  13927. PyErr_Format(PyExc_NameError,
  13928. #if PY_MAJOR_VERSION >= 3
  13929. "name '%U' is not defined", name);
  13930. #else
  13931. "name '%.200s' is not defined", PyString_AS_STRING(name));
  13932. #endif
  13933. }
  13934. return result;
  13935. }
  13936. static void __Pyx_RaiseDoubleKeywordsError(
  13937. const char* func_name,
  13938. PyObject* kw_name)
  13939. {
  13940. PyErr_Format(PyExc_TypeError,
  13941. #if PY_MAJOR_VERSION >= 3
  13942. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  13943. #else
  13944. "%s() got multiple values for keyword argument '%s'", func_name,
  13945. PyString_AsString(kw_name));
  13946. #endif
  13947. }
  13948. static int __Pyx_ParseOptionalKeywords(
  13949. PyObject *kwds,
  13950. PyObject **argnames[],
  13951. PyObject *kwds2,
  13952. PyObject *values[],
  13953. Py_ssize_t num_pos_args,
  13954. const char* function_name)
  13955. {
  13956. PyObject *key = 0, *value = 0;
  13957. Py_ssize_t pos = 0;
  13958. PyObject*** name;
  13959. PyObject*** first_kw_arg = argnames + num_pos_args;
  13960. while (PyDict_Next(kwds, &pos, &key, &value)) {
  13961. name = first_kw_arg;
  13962. while (*name && (**name != key)) name++;
  13963. if (*name) {
  13964. values[name-argnames] = value;
  13965. continue;
  13966. }
  13967. name = first_kw_arg;
  13968. #if PY_MAJOR_VERSION < 3
  13969. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  13970. while (*name) {
  13971. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  13972. && _PyString_Eq(**name, key)) {
  13973. values[name-argnames] = value;
  13974. break;
  13975. }
  13976. name++;
  13977. }
  13978. if (*name) continue;
  13979. else {
  13980. PyObject*** argname = argnames;
  13981. while (argname != first_kw_arg) {
  13982. if ((**argname == key) || (
  13983. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  13984. && _PyString_Eq(**argname, key))) {
  13985. goto arg_passed_twice;
  13986. }
  13987. argname++;
  13988. }
  13989. }
  13990. } else
  13991. #endif
  13992. if (likely(PyUnicode_Check(key))) {
  13993. while (*name) {
  13994. int cmp = (**name == key) ? 0 :
  13995. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  13996. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  13997. #endif
  13998. PyUnicode_Compare(**name, key);
  13999. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  14000. if (cmp == 0) {
  14001. values[name-argnames] = value;
  14002. break;
  14003. }
  14004. name++;
  14005. }
  14006. if (*name) continue;
  14007. else {
  14008. PyObject*** argname = argnames;
  14009. while (argname != first_kw_arg) {
  14010. int cmp = (**argname == key) ? 0 :
  14011. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  14012. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  14013. #endif
  14014. PyUnicode_Compare(**argname, key);
  14015. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  14016. if (cmp == 0) goto arg_passed_twice;
  14017. argname++;
  14018. }
  14019. }
  14020. } else
  14021. goto invalid_keyword_type;
  14022. if (kwds2) {
  14023. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  14024. } else {
  14025. goto invalid_keyword;
  14026. }
  14027. }
  14028. return 0;
  14029. arg_passed_twice:
  14030. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  14031. goto bad;
  14032. invalid_keyword_type:
  14033. PyErr_Format(PyExc_TypeError,
  14034. "%.200s() keywords must be strings", function_name);
  14035. goto bad;
  14036. invalid_keyword:
  14037. PyErr_Format(PyExc_TypeError,
  14038. #if PY_MAJOR_VERSION < 3
  14039. "%.200s() got an unexpected keyword argument '%.200s'",
  14040. function_name, PyString_AsString(key));
  14041. #else
  14042. "%s() got an unexpected keyword argument '%U'",
  14043. function_name, key);
  14044. #endif
  14045. bad:
  14046. return -1;
  14047. }
  14048. static void __Pyx_RaiseArgtupleInvalid(
  14049. const char* func_name,
  14050. int exact,
  14051. Py_ssize_t num_min,
  14052. Py_ssize_t num_max,
  14053. Py_ssize_t num_found)
  14054. {
  14055. Py_ssize_t num_expected;
  14056. const char *more_or_less;
  14057. if (num_found < num_min) {
  14058. num_expected = num_min;
  14059. more_or_less = "at least";
  14060. } else {
  14061. num_expected = num_max;
  14062. more_or_less = "at most";
  14063. }
  14064. if (exact) {
  14065. more_or_less = "exactly";
  14066. }
  14067. PyErr_Format(PyExc_TypeError,
  14068. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  14069. func_name, more_or_less, num_expected,
  14070. (num_expected == 1) ? "" : "s", num_found);
  14071. }
  14072. static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
  14073. PyObject *kwdict,
  14074. const char* function_name,
  14075. int kw_allowed)
  14076. {
  14077. PyObject* key = 0;
  14078. Py_ssize_t pos = 0;
  14079. #if CPYTHON_COMPILING_IN_PYPY
  14080. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  14081. goto invalid_keyword;
  14082. return 1;
  14083. #else
  14084. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  14085. #if PY_MAJOR_VERSION < 3
  14086. if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
  14087. #endif
  14088. if (unlikely(!PyUnicode_Check(key)))
  14089. goto invalid_keyword_type;
  14090. }
  14091. if ((!kw_allowed) && unlikely(key))
  14092. goto invalid_keyword;
  14093. return 1;
  14094. invalid_keyword_type:
  14095. PyErr_Format(PyExc_TypeError,
  14096. "%.200s() keywords must be strings", function_name);
  14097. return 0;
  14098. #endif
  14099. invalid_keyword:
  14100. PyErr_Format(PyExc_TypeError,
  14101. #if PY_MAJOR_VERSION < 3
  14102. "%.200s() got an unexpected keyword argument '%.200s'",
  14103. function_name, PyString_AsString(key));
  14104. #else
  14105. "%s() got an unexpected keyword argument '%U'",
  14106. function_name, key);
  14107. #endif
  14108. return 0;
  14109. }
  14110. static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
  14111. PyObject *result;
  14112. #if CYTHON_COMPILING_IN_CPYTHON
  14113. result = PyDict_GetItem(__pyx_d, name);
  14114. if (result) {
  14115. Py_INCREF(result);
  14116. } else {
  14117. #else
  14118. result = PyObject_GetItem(__pyx_d, name);
  14119. if (!result) {
  14120. PyErr_Clear();
  14121. #endif
  14122. result = __Pyx_GetBuiltinName(name);
  14123. }
  14124. return result;
  14125. }
  14126. static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
  14127. PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
  14128. }
  14129. #if CYTHON_COMPILING_IN_CPYTHON
  14130. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  14131. PyObject *result;
  14132. ternaryfunc call = func->ob_type->tp_call;
  14133. if (unlikely(!call))
  14134. return PyObject_Call(func, arg, kw);
  14135. #if PY_VERSION_HEX >= 0x02060000
  14136. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  14137. return NULL;
  14138. #endif
  14139. result = (*call)(func, arg, kw);
  14140. #if PY_VERSION_HEX >= 0x02060000
  14141. Py_LeaveRecursiveCall();
  14142. #endif
  14143. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  14144. PyErr_SetString(
  14145. PyExc_SystemError,
  14146. "NULL result without error in PyObject_Call");
  14147. }
  14148. return result;
  14149. }
  14150. #endif
  14151. static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
  14152. PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
  14153. }
  14154. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  14155. PyObject* fake_module;
  14156. PyTypeObject* cached_type = NULL;
  14157. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  14158. if (!fake_module) return NULL;
  14159. Py_INCREF(fake_module);
  14160. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  14161. if (cached_type) {
  14162. if (!PyType_Check((PyObject*)cached_type)) {
  14163. PyErr_Format(PyExc_TypeError,
  14164. "Shared Cython type %.200s is not a type object",
  14165. type->tp_name);
  14166. goto bad;
  14167. }
  14168. if (cached_type->tp_basicsize != type->tp_basicsize) {
  14169. PyErr_Format(PyExc_TypeError,
  14170. "Shared Cython type %.200s has the wrong size, try recompiling",
  14171. type->tp_name);
  14172. goto bad;
  14173. }
  14174. } else {
  14175. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  14176. PyErr_Clear();
  14177. if (PyType_Ready(type) < 0) goto bad;
  14178. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  14179. goto bad;
  14180. Py_INCREF(type);
  14181. cached_type = type;
  14182. }
  14183. done:
  14184. Py_DECREF(fake_module);
  14185. return cached_type;
  14186. bad:
  14187. Py_XDECREF(cached_type);
  14188. cached_type = NULL;
  14189. goto done;
  14190. }
  14191. static PyObject *
  14192. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  14193. {
  14194. if (unlikely(op->func_doc == NULL)) {
  14195. if (op->func.m_ml->ml_doc) {
  14196. #if PY_MAJOR_VERSION >= 3
  14197. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  14198. #else
  14199. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  14200. #endif
  14201. if (unlikely(op->func_doc == NULL))
  14202. return NULL;
  14203. } else {
  14204. Py_INCREF(Py_None);
  14205. return Py_None;
  14206. }
  14207. }
  14208. Py_INCREF(op->func_doc);
  14209. return op->func_doc;
  14210. }
  14211. static int
  14212. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
  14213. {
  14214. PyObject *tmp = op->func_doc;
  14215. if (value == NULL)
  14216. value = Py_None; /* Mark as deleted */
  14217. Py_INCREF(value);
  14218. op->func_doc = value;
  14219. Py_XDECREF(tmp);
  14220. return 0;
  14221. }
  14222. static PyObject *
  14223. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
  14224. {
  14225. if (unlikely(op->func_name == NULL)) {
  14226. #if PY_MAJOR_VERSION >= 3
  14227. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  14228. #else
  14229. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  14230. #endif
  14231. if (unlikely(op->func_name == NULL))
  14232. return NULL;
  14233. }
  14234. Py_INCREF(op->func_name);
  14235. return op->func_name;
  14236. }
  14237. static int
  14238. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
  14239. {
  14240. PyObject *tmp;
  14241. #if PY_MAJOR_VERSION >= 3
  14242. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  14243. #else
  14244. if (unlikely(value == NULL || !PyString_Check(value))) {
  14245. #endif
  14246. PyErr_SetString(PyExc_TypeError,
  14247. "__name__ must be set to a string object");
  14248. return -1;
  14249. }
  14250. tmp = op->func_name;
  14251. Py_INCREF(value);
  14252. op->func_name = value;
  14253. Py_XDECREF(tmp);
  14254. return 0;
  14255. }
  14256. static PyObject *
  14257. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
  14258. {
  14259. Py_INCREF(op->func_qualname);
  14260. return op->func_qualname;
  14261. }
  14262. static int
  14263. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
  14264. {
  14265. PyObject *tmp;
  14266. #if PY_MAJOR_VERSION >= 3
  14267. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  14268. #else
  14269. if (unlikely(value == NULL || !PyString_Check(value))) {
  14270. #endif
  14271. PyErr_SetString(PyExc_TypeError,
  14272. "__qualname__ must be set to a string object");
  14273. return -1;
  14274. }
  14275. tmp = op->func_qualname;
  14276. Py_INCREF(value);
  14277. op->func_qualname = value;
  14278. Py_XDECREF(tmp);
  14279. return 0;
  14280. }
  14281. static PyObject *
  14282. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  14283. {
  14284. PyObject *self;
  14285. self = m->func_closure;
  14286. if (self == NULL)
  14287. self = Py_None;
  14288. Py_INCREF(self);
  14289. return self;
  14290. }
  14291. static PyObject *
  14292. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
  14293. {
  14294. if (unlikely(op->func_dict == NULL)) {
  14295. op->func_dict = PyDict_New();
  14296. if (unlikely(op->func_dict == NULL))
  14297. return NULL;
  14298. }
  14299. Py_INCREF(op->func_dict);
  14300. return op->func_dict;
  14301. }
  14302. static int
  14303. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
  14304. {
  14305. PyObject *tmp;
  14306. if (unlikely(value == NULL)) {
  14307. PyErr_SetString(PyExc_TypeError,
  14308. "function's dictionary may not be deleted");
  14309. return -1;
  14310. }
  14311. if (unlikely(!PyDict_Check(value))) {
  14312. PyErr_SetString(PyExc_TypeError,
  14313. "setting function's dictionary to a non-dict");
  14314. return -1;
  14315. }
  14316. tmp = op->func_dict;
  14317. Py_INCREF(value);
  14318. op->func_dict = value;
  14319. Py_XDECREF(tmp);
  14320. return 0;
  14321. }
  14322. static PyObject *
  14323. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
  14324. {
  14325. Py_INCREF(op->func_globals);
  14326. return op->func_globals;
  14327. }
  14328. static PyObject *
  14329. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
  14330. {
  14331. Py_INCREF(Py_None);
  14332. return Py_None;
  14333. }
  14334. static PyObject *
  14335. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
  14336. {
  14337. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  14338. Py_INCREF(result);
  14339. return result;
  14340. }
  14341. static int
  14342. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  14343. PyObject *res = op->defaults_getter((PyObject *) op);
  14344. if (unlikely(!res))
  14345. return -1;
  14346. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  14347. Py_INCREF(op->defaults_tuple);
  14348. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  14349. Py_INCREF(op->defaults_kwdict);
  14350. Py_DECREF(res);
  14351. return 0;
  14352. }
  14353. static int
  14354. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
  14355. PyObject* tmp;
  14356. if (!value) {
  14357. value = Py_None;
  14358. } else if (value != Py_None && !PyTuple_Check(value)) {
  14359. PyErr_SetString(PyExc_TypeError,
  14360. "__defaults__ must be set to a tuple object");
  14361. return -1;
  14362. }
  14363. Py_INCREF(value);
  14364. tmp = op->defaults_tuple;
  14365. op->defaults_tuple = value;
  14366. Py_XDECREF(tmp);
  14367. return 0;
  14368. }
  14369. static PyObject *
  14370. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
  14371. PyObject* result = op->defaults_tuple;
  14372. if (unlikely(!result)) {
  14373. if (op->defaults_getter) {
  14374. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  14375. result = op->defaults_tuple;
  14376. } else {
  14377. result = Py_None;
  14378. }
  14379. }
  14380. Py_INCREF(result);
  14381. return result;
  14382. }
  14383. static int
  14384. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
  14385. PyObject* tmp;
  14386. if (!value) {
  14387. value = Py_None;
  14388. } else if (value != Py_None && !PyDict_Check(value)) {
  14389. PyErr_SetString(PyExc_TypeError,
  14390. "__kwdefaults__ must be set to a dict object");
  14391. return -1;
  14392. }
  14393. Py_INCREF(value);
  14394. tmp = op->defaults_kwdict;
  14395. op->defaults_kwdict = value;
  14396. Py_XDECREF(tmp);
  14397. return 0;
  14398. }
  14399. static PyObject *
  14400. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
  14401. PyObject* result = op->defaults_kwdict;
  14402. if (unlikely(!result)) {
  14403. if (op->defaults_getter) {
  14404. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  14405. result = op->defaults_kwdict;
  14406. } else {
  14407. result = Py_None;
  14408. }
  14409. }
  14410. Py_INCREF(result);
  14411. return result;
  14412. }
  14413. static int
  14414. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
  14415. PyObject* tmp;
  14416. if (!value || value == Py_None) {
  14417. value = NULL;
  14418. } else if (!PyDict_Check(value)) {
  14419. PyErr_SetString(PyExc_TypeError,
  14420. "__annotations__ must be set to a dict object");
  14421. return -1;
  14422. }
  14423. Py_XINCREF(value);
  14424. tmp = op->func_annotations;
  14425. op->func_annotations = value;
  14426. Py_XDECREF(tmp);
  14427. return 0;
  14428. }
  14429. static PyObject *
  14430. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
  14431. PyObject* result = op->func_annotations;
  14432. if (unlikely(!result)) {
  14433. result = PyDict_New();
  14434. if (unlikely(!result)) return NULL;
  14435. op->func_annotations = result;
  14436. }
  14437. Py_INCREF(result);
  14438. return result;
  14439. }
  14440. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  14441. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  14442. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  14443. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  14444. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  14445. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  14446. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  14447. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  14448. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  14449. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  14450. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  14451. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  14452. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  14453. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  14454. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  14455. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  14456. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  14457. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  14458. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  14459. {0, 0, 0, 0, 0}
  14460. };
  14461. #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
  14462. #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
  14463. #endif
  14464. static PyMemberDef __pyx_CyFunction_members[] = {
  14465. {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
  14466. {0, 0, 0, 0, 0}
  14467. };
  14468. static PyObject *
  14469. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  14470. {
  14471. #if PY_MAJOR_VERSION >= 3
  14472. return PyUnicode_FromString(m->func.m_ml->ml_name);
  14473. #else
  14474. return PyString_FromString(m->func.m_ml->ml_name);
  14475. #endif
  14476. }
  14477. static PyMethodDef __pyx_CyFunction_methods[] = {
  14478. {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  14479. {0, 0, 0, 0}
  14480. };
  14481. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  14482. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  14483. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  14484. if (op == NULL)
  14485. return NULL;
  14486. op->flags = flags;
  14487. op->func_weakreflist = NULL;
  14488. op->func.m_ml = ml;
  14489. op->func.m_self = (PyObject *) op;
  14490. Py_XINCREF(closure);
  14491. op->func_closure = closure;
  14492. Py_XINCREF(module);
  14493. op->func.m_module = module;
  14494. op->func_dict = NULL;
  14495. op->func_name = NULL;
  14496. Py_INCREF(qualname);
  14497. op->func_qualname = qualname;
  14498. op->func_doc = NULL;
  14499. op->func_classobj = NULL;
  14500. op->func_globals = globals;
  14501. Py_INCREF(op->func_globals);
  14502. Py_XINCREF(code);
  14503. op->func_code = code;
  14504. op->defaults_pyobjects = 0;
  14505. op->defaults = NULL;
  14506. op->defaults_tuple = NULL;
  14507. op->defaults_kwdict = NULL;
  14508. op->defaults_getter = NULL;
  14509. op->func_annotations = NULL;
  14510. PyObject_GC_Track(op);
  14511. return (PyObject *) op;
  14512. }
  14513. static int
  14514. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  14515. {
  14516. Py_CLEAR(m->func_closure);
  14517. Py_CLEAR(m->func.m_module);
  14518. Py_CLEAR(m->func_dict);
  14519. Py_CLEAR(m->func_name);
  14520. Py_CLEAR(m->func_qualname);
  14521. Py_CLEAR(m->func_doc);
  14522. Py_CLEAR(m->func_globals);
  14523. Py_CLEAR(m->func_code);
  14524. Py_CLEAR(m->func_classobj);
  14525. Py_CLEAR(m->defaults_tuple);
  14526. Py_CLEAR(m->defaults_kwdict);
  14527. Py_CLEAR(m->func_annotations);
  14528. if (m->defaults) {
  14529. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  14530. int i;
  14531. for (i = 0; i < m->defaults_pyobjects; i++)
  14532. Py_XDECREF(pydefaults[i]);
  14533. PyMem_Free(m->defaults);
  14534. m->defaults = NULL;
  14535. }
  14536. return 0;
  14537. }
  14538. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  14539. {
  14540. PyObject_GC_UnTrack(m);
  14541. if (m->func_weakreflist != NULL)
  14542. PyObject_ClearWeakRefs((PyObject *) m);
  14543. __Pyx_CyFunction_clear(m);
  14544. PyObject_GC_Del(m);
  14545. }
  14546. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  14547. {
  14548. Py_VISIT(m->func_closure);
  14549. Py_VISIT(m->func.m_module);
  14550. Py_VISIT(m->func_dict);
  14551. Py_VISIT(m->func_name);
  14552. Py_VISIT(m->func_qualname);
  14553. Py_VISIT(m->func_doc);
  14554. Py_VISIT(m->func_globals);
  14555. Py_VISIT(m->func_code);
  14556. Py_VISIT(m->func_classobj);
  14557. Py_VISIT(m->defaults_tuple);
  14558. Py_VISIT(m->defaults_kwdict);
  14559. if (m->defaults) {
  14560. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  14561. int i;
  14562. for (i = 0; i < m->defaults_pyobjects; i++)
  14563. Py_VISIT(pydefaults[i]);
  14564. }
  14565. return 0;
  14566. }
  14567. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  14568. {
  14569. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  14570. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  14571. Py_INCREF(func);
  14572. return func;
  14573. }
  14574. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  14575. if (type == NULL)
  14576. type = (PyObject *)(Py_TYPE(obj));
  14577. return PyMethod_New(func,
  14578. type, (PyObject *)(Py_TYPE(type)));
  14579. }
  14580. if (obj == Py_None)
  14581. obj = NULL;
  14582. return PyMethod_New(func, obj, type);
  14583. }
  14584. static PyObject*
  14585. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  14586. {
  14587. #if PY_MAJOR_VERSION >= 3
  14588. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  14589. op->func_qualname, (void *)op);
  14590. #else
  14591. return PyString_FromFormat("<cyfunction %s at %p>",
  14592. PyString_AsString(op->func_qualname), (void *)op);
  14593. #endif
  14594. }
  14595. #if CYTHON_COMPILING_IN_PYPY
  14596. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  14597. PyCFunctionObject* f = (PyCFunctionObject*)func;
  14598. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  14599. PyObject *self = PyCFunction_GET_SELF(func);
  14600. Py_ssize_t size;
  14601. switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
  14602. case METH_VARARGS:
  14603. if (likely(kw == NULL) || PyDict_Size(kw) == 0)
  14604. return (*meth)(self, arg);
  14605. break;
  14606. case METH_VARARGS | METH_KEYWORDS:
  14607. return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
  14608. case METH_NOARGS:
  14609. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  14610. size = PyTuple_GET_SIZE(arg);
  14611. if (size == 0)
  14612. return (*meth)(self, NULL);
  14613. PyErr_Format(PyExc_TypeError,
  14614. "%.200s() takes no arguments (%zd given)",
  14615. f->m_ml->ml_name, size);
  14616. return NULL;
  14617. }
  14618. break;
  14619. case METH_O:
  14620. if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
  14621. size = PyTuple_GET_SIZE(arg);
  14622. if (size == 1)
  14623. return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
  14624. PyErr_Format(PyExc_TypeError,
  14625. "%.200s() takes exactly one argument (%zd given)",
  14626. f->m_ml->ml_name, size);
  14627. return NULL;
  14628. }
  14629. break;
  14630. default:
  14631. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  14632. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  14633. "longer supported!");
  14634. return NULL;
  14635. }
  14636. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  14637. f->m_ml->ml_name);
  14638. return NULL;
  14639. }
  14640. #else
  14641. static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  14642. return PyCFunction_Call(func, arg, kw);
  14643. }
  14644. #endif
  14645. static PyTypeObject __pyx_CyFunctionType_type = {
  14646. PyVarObject_HEAD_INIT(0, 0)
  14647. __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
  14648. sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/
  14649. 0, /*tp_itemsize*/
  14650. (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
  14651. 0, /*tp_print*/
  14652. 0, /*tp_getattr*/
  14653. 0, /*tp_setattr*/
  14654. #if PY_MAJOR_VERSION < 3
  14655. 0, /*tp_compare*/
  14656. #else
  14657. 0, /*reserved*/
  14658. #endif
  14659. (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/
  14660. 0, /*tp_as_number*/
  14661. 0, /*tp_as_sequence*/
  14662. 0, /*tp_as_mapping*/
  14663. 0, /*tp_hash*/
  14664. __Pyx_CyFunction_Call, /*tp_call*/
  14665. 0, /*tp_str*/
  14666. 0, /*tp_getattro*/
  14667. 0, /*tp_setattro*/
  14668. 0, /*tp_as_buffer*/
  14669. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
  14670. 0, /*tp_doc*/
  14671. (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
  14672. (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
  14673. 0, /*tp_richcompare*/
  14674. offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
  14675. 0, /*tp_iter*/
  14676. 0, /*tp_iternext*/
  14677. __pyx_CyFunction_methods, /*tp_methods*/
  14678. __pyx_CyFunction_members, /*tp_members*/
  14679. __pyx_CyFunction_getsets, /*tp_getset*/
  14680. 0, /*tp_base*/
  14681. 0, /*tp_dict*/
  14682. __Pyx_CyFunction_descr_get, /*tp_descr_get*/
  14683. 0, /*tp_descr_set*/
  14684. offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
  14685. 0, /*tp_init*/
  14686. 0, /*tp_alloc*/
  14687. 0, /*tp_new*/
  14688. 0, /*tp_free*/
  14689. 0, /*tp_is_gc*/
  14690. 0, /*tp_bases*/
  14691. 0, /*tp_mro*/
  14692. 0, /*tp_cache*/
  14693. 0, /*tp_subclasses*/
  14694. 0, /*tp_weaklist*/
  14695. 0, /*tp_del*/
  14696. #if PY_VERSION_HEX >= 0x02060000
  14697. 0, /*tp_version_tag*/
  14698. #endif
  14699. #if PY_VERSION_HEX >= 0x030400a1
  14700. 0, /*tp_finalize*/
  14701. #endif
  14702. };
  14703. static int __Pyx_CyFunction_init(void) {
  14704. #if !CYTHON_COMPILING_IN_PYPY
  14705. __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
  14706. #endif
  14707. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  14708. if (__pyx_CyFunctionType == NULL) {
  14709. return -1;
  14710. }
  14711. return 0;
  14712. }
  14713. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  14714. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  14715. m->defaults = PyMem_Malloc(size);
  14716. if (!m->defaults)
  14717. return PyErr_NoMemory();
  14718. memset(m->defaults, 0, size);
  14719. m->defaults_pyobjects = pyobjects;
  14720. return m->defaults;
  14721. }
  14722. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  14723. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  14724. m->defaults_tuple = tuple;
  14725. Py_INCREF(tuple);
  14726. }
  14727. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  14728. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  14729. m->defaults_kwdict = dict;
  14730. Py_INCREF(dict);
  14731. }
  14732. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  14733. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  14734. m->func_annotations = dict;
  14735. Py_INCREF(dict);
  14736. }
  14737. static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
  14738. #if CYTHON_COMPILING_IN_CPYTHON
  14739. PyThreadState *tstate = PyThreadState_GET();
  14740. *type = tstate->exc_type;
  14741. *value = tstate->exc_value;
  14742. *tb = tstate->exc_traceback;
  14743. Py_XINCREF(*type);
  14744. Py_XINCREF(*value);
  14745. Py_XINCREF(*tb);
  14746. #else
  14747. PyErr_GetExcInfo(type, value, tb);
  14748. #endif
  14749. }
  14750. static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
  14751. #if CYTHON_COMPILING_IN_CPYTHON
  14752. PyObject *tmp_type, *tmp_value, *tmp_tb;
  14753. PyThreadState *tstate = PyThreadState_GET();
  14754. tmp_type = tstate->exc_type;
  14755. tmp_value = tstate->exc_value;
  14756. tmp_tb = tstate->exc_traceback;
  14757. tstate->exc_type = type;
  14758. tstate->exc_value = value;
  14759. tstate->exc_traceback = tb;
  14760. Py_XDECREF(tmp_type);
  14761. Py_XDECREF(tmp_value);
  14762. Py_XDECREF(tmp_tb);
  14763. #else
  14764. PyErr_SetExcInfo(type, value, tb);
  14765. #endif
  14766. }
  14767. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
  14768. PyObject *local_type, *local_value, *local_tb;
  14769. #if CYTHON_COMPILING_IN_CPYTHON
  14770. PyObject *tmp_type, *tmp_value, *tmp_tb;
  14771. PyThreadState *tstate = PyThreadState_GET();
  14772. local_type = tstate->curexc_type;
  14773. local_value = tstate->curexc_value;
  14774. local_tb = tstate->curexc_traceback;
  14775. tstate->curexc_type = 0;
  14776. tstate->curexc_value = 0;
  14777. tstate->curexc_traceback = 0;
  14778. #else
  14779. PyErr_Fetch(&local_type, &local_value, &local_tb);
  14780. #endif
  14781. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  14782. #if CYTHON_COMPILING_IN_CPYTHON
  14783. if (unlikely(tstate->curexc_type))
  14784. #else
  14785. if (unlikely(PyErr_Occurred()))
  14786. #endif
  14787. goto bad;
  14788. #if PY_MAJOR_VERSION >= 3
  14789. if (local_tb) {
  14790. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  14791. goto bad;
  14792. }
  14793. #endif
  14794. Py_XINCREF(local_tb);
  14795. Py_XINCREF(local_type);
  14796. Py_XINCREF(local_value);
  14797. *type = local_type;
  14798. *value = local_value;
  14799. *tb = local_tb;
  14800. #if CYTHON_COMPILING_IN_CPYTHON
  14801. tmp_type = tstate->exc_type;
  14802. tmp_value = tstate->exc_value;
  14803. tmp_tb = tstate->exc_traceback;
  14804. tstate->exc_type = local_type;
  14805. tstate->exc_value = local_value;
  14806. tstate->exc_traceback = local_tb;
  14807. Py_XDECREF(tmp_type);
  14808. Py_XDECREF(tmp_value);
  14809. Py_XDECREF(tmp_tb);
  14810. #else
  14811. PyErr_SetExcInfo(local_type, local_value, local_tb);
  14812. #endif
  14813. return 0;
  14814. bad:
  14815. *type = 0;
  14816. *value = 0;
  14817. *tb = 0;
  14818. Py_XDECREF(local_type);
  14819. Py_XDECREF(local_value);
  14820. Py_XDECREF(local_tb);
  14821. return -1;
  14822. }
  14823. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  14824. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  14825. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  14826. PyErr_Format(PyExc_ImportError,
  14827. #if PY_MAJOR_VERSION < 3
  14828. "cannot import name %.230s", PyString_AS_STRING(name));
  14829. #else
  14830. "cannot import name %S", name);
  14831. #endif
  14832. }
  14833. return value;
  14834. }
  14835. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
  14836. #if CYTHON_COMPILING_IN_PYPY
  14837. return PyObject_RichCompareBool(s1, s2, equals);
  14838. #else
  14839. if (s1 == s2) {
  14840. return (equals == Py_EQ);
  14841. } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
  14842. const char *ps1, *ps2;
  14843. Py_ssize_t length = PyBytes_GET_SIZE(s1);
  14844. if (length != PyBytes_GET_SIZE(s2))
  14845. return (equals == Py_NE);
  14846. ps1 = PyBytes_AS_STRING(s1);
  14847. ps2 = PyBytes_AS_STRING(s2);
  14848. if (ps1[0] != ps2[0]) {
  14849. return (equals == Py_NE);
  14850. } else if (length == 1) {
  14851. return (equals == Py_EQ);
  14852. } else {
  14853. int result = memcmp(ps1, ps2, (size_t)length);
  14854. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  14855. }
  14856. } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
  14857. return (equals == Py_NE);
  14858. } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
  14859. return (equals == Py_NE);
  14860. } else {
  14861. int result;
  14862. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  14863. if (!py_result)
  14864. return -1;
  14865. result = __Pyx_PyObject_IsTrue(py_result);
  14866. Py_DECREF(py_result);
  14867. return result;
  14868. }
  14869. #endif
  14870. }
  14871. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
  14872. #if CYTHON_COMPILING_IN_PYPY
  14873. return PyObject_RichCompareBool(s1, s2, equals);
  14874. #else
  14875. #if PY_MAJOR_VERSION < 3
  14876. PyObject* owned_ref = NULL;
  14877. #endif
  14878. int s1_is_unicode, s2_is_unicode;
  14879. if (s1 == s2) {
  14880. goto return_eq;
  14881. }
  14882. s1_is_unicode = PyUnicode_CheckExact(s1);
  14883. s2_is_unicode = PyUnicode_CheckExact(s2);
  14884. #if PY_MAJOR_VERSION < 3
  14885. if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
  14886. owned_ref = PyUnicode_FromObject(s2);
  14887. if (unlikely(!owned_ref))
  14888. return -1;
  14889. s2 = owned_ref;
  14890. s2_is_unicode = 1;
  14891. } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
  14892. owned_ref = PyUnicode_FromObject(s1);
  14893. if (unlikely(!owned_ref))
  14894. return -1;
  14895. s1 = owned_ref;
  14896. s1_is_unicode = 1;
  14897. } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
  14898. return __Pyx_PyBytes_Equals(s1, s2, equals);
  14899. }
  14900. #endif
  14901. if (s1_is_unicode & s2_is_unicode) {
  14902. Py_ssize_t length;
  14903. int kind;
  14904. void *data1, *data2;
  14905. #if CYTHON_PEP393_ENABLED
  14906. if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
  14907. return -1;
  14908. #endif
  14909. length = __Pyx_PyUnicode_GET_LENGTH(s1);
  14910. if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
  14911. goto return_ne;
  14912. }
  14913. kind = __Pyx_PyUnicode_KIND(s1);
  14914. if (kind != __Pyx_PyUnicode_KIND(s2)) {
  14915. goto return_ne;
  14916. }
  14917. data1 = __Pyx_PyUnicode_DATA(s1);
  14918. data2 = __Pyx_PyUnicode_DATA(s2);
  14919. if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
  14920. goto return_ne;
  14921. } else if (length == 1) {
  14922. goto return_eq;
  14923. } else {
  14924. int result = memcmp(data1, data2, length * kind);
  14925. #if PY_MAJOR_VERSION < 3
  14926. Py_XDECREF(owned_ref);
  14927. #endif
  14928. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  14929. }
  14930. } else if ((s1 == Py_None) & s2_is_unicode) {
  14931. goto return_ne;
  14932. } else if ((s2 == Py_None) & s1_is_unicode) {
  14933. goto return_ne;
  14934. } else {
  14935. int result;
  14936. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  14937. if (!py_result)
  14938. return -1;
  14939. result = __Pyx_PyObject_IsTrue(py_result);
  14940. Py_DECREF(py_result);
  14941. return result;
  14942. }
  14943. return_eq:
  14944. #if PY_MAJOR_VERSION < 3
  14945. Py_XDECREF(owned_ref);
  14946. #endif
  14947. return (equals == Py_EQ);
  14948. return_ne:
  14949. #if PY_MAJOR_VERSION < 3
  14950. Py_XDECREF(owned_ref);
  14951. #endif
  14952. return (equals == Py_NE);
  14953. #endif
  14954. }
  14955. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  14956. PyObject *empty_list = 0;
  14957. PyObject *module = 0;
  14958. PyObject *global_dict = 0;
  14959. PyObject *empty_dict = 0;
  14960. PyObject *list;
  14961. #if PY_VERSION_HEX < 0x03030000
  14962. PyObject *py_import;
  14963. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  14964. if (!py_import)
  14965. goto bad;
  14966. #endif
  14967. if (from_list)
  14968. list = from_list;
  14969. else {
  14970. empty_list = PyList_New(0);
  14971. if (!empty_list)
  14972. goto bad;
  14973. list = empty_list;
  14974. }
  14975. global_dict = PyModule_GetDict(__pyx_m);
  14976. if (!global_dict)
  14977. goto bad;
  14978. empty_dict = PyDict_New();
  14979. if (!empty_dict)
  14980. goto bad;
  14981. #if PY_VERSION_HEX >= 0x02050000
  14982. {
  14983. #if PY_MAJOR_VERSION >= 3
  14984. if (level == -1) {
  14985. if (strchr(__Pyx_MODULE_NAME, '.')) {
  14986. #if PY_VERSION_HEX < 0x03030000
  14987. PyObject *py_level = PyInt_FromLong(1);
  14988. if (!py_level)
  14989. goto bad;
  14990. module = PyObject_CallFunctionObjArgs(py_import,
  14991. name, global_dict, empty_dict, list, py_level, NULL);
  14992. Py_DECREF(py_level);
  14993. #else
  14994. module = PyImport_ImportModuleLevelObject(
  14995. name, global_dict, empty_dict, list, 1);
  14996. #endif
  14997. if (!module) {
  14998. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  14999. goto bad;
  15000. PyErr_Clear();
  15001. }
  15002. }
  15003. level = 0; /* try absolute import on failure */
  15004. }
  15005. #endif
  15006. if (!module) {
  15007. #if PY_VERSION_HEX < 0x03030000
  15008. PyObject *py_level = PyInt_FromLong(level);
  15009. if (!py_level)
  15010. goto bad;
  15011. module = PyObject_CallFunctionObjArgs(py_import,
  15012. name, global_dict, empty_dict, list, py_level, NULL);
  15013. Py_DECREF(py_level);
  15014. #else
  15015. module = PyImport_ImportModuleLevelObject(
  15016. name, global_dict, empty_dict, list, level);
  15017. #endif
  15018. }
  15019. }
  15020. #else
  15021. if (level>0) {
  15022. PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
  15023. goto bad;
  15024. }
  15025. module = PyObject_CallFunctionObjArgs(py_import,
  15026. name, global_dict, empty_dict, list, NULL);
  15027. #endif
  15028. bad:
  15029. #if PY_VERSION_HEX < 0x03030000
  15030. Py_XDECREF(py_import);
  15031. #endif
  15032. Py_XDECREF(empty_list);
  15033. Py_XDECREF(empty_dict);
  15034. return module;
  15035. }
  15036. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  15037. static PyObject *__Pyx_GetStdout(void) {
  15038. PyObject *f = PySys_GetObject((char *)"stdout");
  15039. if (!f) {
  15040. PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
  15041. }
  15042. return f;
  15043. }
  15044. static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
  15045. int i;
  15046. if (!f) {
  15047. if (!(f = __Pyx_GetStdout()))
  15048. return -1;
  15049. }
  15050. Py_INCREF(f);
  15051. for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
  15052. PyObject* v;
  15053. if (PyFile_SoftSpace(f, 1)) {
  15054. if (PyFile_WriteString(" ", f) < 0)
  15055. goto error;
  15056. }
  15057. v = PyTuple_GET_ITEM(arg_tuple, i);
  15058. if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
  15059. goto error;
  15060. if (PyString_Check(v)) {
  15061. char *s = PyString_AsString(v);
  15062. Py_ssize_t len = PyString_Size(v);
  15063. if (len > 0) {
  15064. switch (s[len-1]) {
  15065. case ' ': break;
  15066. case '\f': case '\r': case '\n': case '\t': case '\v':
  15067. PyFile_SoftSpace(f, 0);
  15068. break;
  15069. default: break;
  15070. }
  15071. }
  15072. }
  15073. }
  15074. if (newline) {
  15075. if (PyFile_WriteString("\n", f) < 0)
  15076. goto error;
  15077. PyFile_SoftSpace(f, 0);
  15078. }
  15079. Py_DECREF(f);
  15080. return 0;
  15081. error:
  15082. Py_DECREF(f);
  15083. return -1;
  15084. }
  15085. #else /* Python 3 has a print function */
  15086. static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
  15087. PyObject* kwargs = 0;
  15088. PyObject* result = 0;
  15089. PyObject* end_string;
  15090. if (unlikely(!__pyx_print)) {
  15091. __pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
  15092. if (!__pyx_print)
  15093. return -1;
  15094. }
  15095. if (stream) {
  15096. kwargs = PyDict_New();
  15097. if (unlikely(!kwargs))
  15098. return -1;
  15099. if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
  15100. goto bad;
  15101. if (!newline) {
  15102. end_string = PyUnicode_FromStringAndSize(" ", 1);
  15103. if (unlikely(!end_string))
  15104. goto bad;
  15105. if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
  15106. Py_DECREF(end_string);
  15107. goto bad;
  15108. }
  15109. Py_DECREF(end_string);
  15110. }
  15111. } else if (!newline) {
  15112. if (unlikely(!__pyx_print_kwargs)) {
  15113. __pyx_print_kwargs = PyDict_New();
  15114. if (unlikely(!__pyx_print_kwargs))
  15115. return -1;
  15116. end_string = PyUnicode_FromStringAndSize(" ", 1);
  15117. if (unlikely(!end_string))
  15118. return -1;
  15119. if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
  15120. Py_DECREF(end_string);
  15121. return -1;
  15122. }
  15123. Py_DECREF(end_string);
  15124. }
  15125. kwargs = __pyx_print_kwargs;
  15126. }
  15127. result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
  15128. if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
  15129. Py_DECREF(kwargs);
  15130. if (!result)
  15131. return -1;
  15132. Py_DECREF(result);
  15133. return 0;
  15134. bad:
  15135. if (kwargs != __pyx_print_kwargs)
  15136. Py_XDECREF(kwargs);
  15137. return -1;
  15138. }
  15139. #endif
  15140. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
  15141. static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
  15142. if (!f) {
  15143. if (!(f = __Pyx_GetStdout()))
  15144. return -1;
  15145. }
  15146. Py_INCREF(f);
  15147. if (PyFile_SoftSpace(f, 0)) {
  15148. if (PyFile_WriteString(" ", f) < 0)
  15149. goto error;
  15150. }
  15151. if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
  15152. goto error;
  15153. if (PyFile_WriteString("\n", f) < 0)
  15154. goto error;
  15155. Py_DECREF(f);
  15156. return 0;
  15157. error:
  15158. Py_DECREF(f);
  15159. return -1;
  15160. /* the line below is just to avoid C compiler
  15161. * warnings about unused functions */
  15162. return __Pyx_Print(f, NULL, 0);
  15163. }
  15164. #else /* Python 3 has a print function */
  15165. static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
  15166. int res;
  15167. PyObject* arg_tuple = PyTuple_Pack(1, o);
  15168. if (unlikely(!arg_tuple))
  15169. return -1;
  15170. res = __Pyx_Print(stream, arg_tuple, 1);
  15171. Py_DECREF(arg_tuple);
  15172. return res;
  15173. }
  15174. #endif
  15175. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
  15176. { \
  15177. func_type value = func(x); \
  15178. if (sizeof(target_type) < sizeof(func_type)) { \
  15179. if (unlikely(value != (func_type) (target_type) value)) { \
  15180. func_type zero = 0; \
  15181. PyErr_SetString(PyExc_OverflowError, \
  15182. (is_unsigned && unlikely(value < zero)) ? \
  15183. "can't convert negative value to " #target_type : \
  15184. "value too large to convert to " #target_type); \
  15185. return (target_type) -1; \
  15186. } \
  15187. } \
  15188. return (target_type) value; \
  15189. }
  15190. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15191. #if CYTHON_USE_PYLONG_INTERNALS
  15192. #include "longintrepr.h"
  15193. #endif
  15194. #endif
  15195. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  15196. const long neg_one = (long) -1, const_zero = 0;
  15197. const int is_unsigned = neg_one > const_zero;
  15198. #if PY_MAJOR_VERSION < 3
  15199. if (likely(PyInt_Check(x))) {
  15200. if (sizeof(long) < sizeof(long)) {
  15201. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
  15202. } else {
  15203. long val = PyInt_AS_LONG(x);
  15204. if (is_unsigned && unlikely(val < 0)) {
  15205. PyErr_SetString(PyExc_OverflowError,
  15206. "can't convert negative value to long");
  15207. return (long) -1;
  15208. }
  15209. return (long) val;
  15210. }
  15211. } else
  15212. #endif
  15213. if (likely(PyLong_Check(x))) {
  15214. if (is_unsigned) {
  15215. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15216. #if CYTHON_USE_PYLONG_INTERNALS
  15217. if (sizeof(digit) <= sizeof(long)) {
  15218. switch (Py_SIZE(x)) {
  15219. case 0: return 0;
  15220. case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
  15221. }
  15222. }
  15223. #endif
  15224. #endif
  15225. if (unlikely(Py_SIZE(x) < 0)) {
  15226. PyErr_SetString(PyExc_OverflowError,
  15227. "can't convert negative value to long");
  15228. return (long) -1;
  15229. }
  15230. if (sizeof(long) <= sizeof(unsigned long)) {
  15231. __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
  15232. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  15233. __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
  15234. }
  15235. } else {
  15236. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15237. #if CYTHON_USE_PYLONG_INTERNALS
  15238. if (sizeof(digit) <= sizeof(long)) {
  15239. switch (Py_SIZE(x)) {
  15240. case 0: return 0;
  15241. case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
  15242. case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
  15243. }
  15244. }
  15245. #endif
  15246. #endif
  15247. if (sizeof(long) <= sizeof(long)) {
  15248. __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
  15249. } else if (sizeof(long) <= sizeof(long long)) {
  15250. __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
  15251. }
  15252. }
  15253. {
  15254. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  15255. PyErr_SetString(PyExc_RuntimeError,
  15256. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  15257. #else
  15258. long val;
  15259. PyObject *v = __Pyx_PyNumber_Int(x);
  15260. #if PY_MAJOR_VERSION < 3
  15261. if (likely(v) && !PyLong_Check(v)) {
  15262. PyObject *tmp = v;
  15263. v = PyNumber_Long(tmp);
  15264. Py_DECREF(tmp);
  15265. }
  15266. #endif
  15267. if (likely(v)) {
  15268. int one = 1; int is_little = (int)*(unsigned char *)&one;
  15269. unsigned char *bytes = (unsigned char *)&val;
  15270. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  15271. bytes, sizeof(val),
  15272. is_little, !is_unsigned);
  15273. Py_DECREF(v);
  15274. if (likely(!ret))
  15275. return val;
  15276. }
  15277. #endif
  15278. return (long) -1;
  15279. }
  15280. } else {
  15281. long val;
  15282. PyObject *tmp = __Pyx_PyNumber_Int(x);
  15283. if (!tmp) return (long) -1;
  15284. val = __Pyx_PyInt_As_long(tmp);
  15285. Py_DECREF(tmp);
  15286. return val;
  15287. }
  15288. }
  15289. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  15290. const long neg_one = (long) -1, const_zero = 0;
  15291. const int is_unsigned = neg_one > const_zero;
  15292. if (is_unsigned) {
  15293. if (sizeof(long) < sizeof(long)) {
  15294. return PyInt_FromLong((long) value);
  15295. } else if (sizeof(long) <= sizeof(unsigned long)) {
  15296. return PyLong_FromUnsignedLong((unsigned long) value);
  15297. } else if (sizeof(long) <= sizeof(unsigned long long)) {
  15298. return PyLong_FromUnsignedLongLong((unsigned long long) value);
  15299. }
  15300. } else {
  15301. if (sizeof(long) <= sizeof(long)) {
  15302. return PyInt_FromLong((long) value);
  15303. } else if (sizeof(long) <= sizeof(long long)) {
  15304. return PyLong_FromLongLong((long long) value);
  15305. }
  15306. }
  15307. {
  15308. int one = 1; int little = (int)*(unsigned char *)&one;
  15309. unsigned char *bytes = (unsigned char *)&value;
  15310. return _PyLong_FromByteArray(bytes, sizeof(long),
  15311. little, !is_unsigned);
  15312. }
  15313. }
  15314. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15315. #if CYTHON_USE_PYLONG_INTERNALS
  15316. #include "longintrepr.h"
  15317. #endif
  15318. #endif
  15319. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  15320. const int neg_one = (int) -1, const_zero = 0;
  15321. const int is_unsigned = neg_one > const_zero;
  15322. #if PY_MAJOR_VERSION < 3
  15323. if (likely(PyInt_Check(x))) {
  15324. if (sizeof(int) < sizeof(long)) {
  15325. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
  15326. } else {
  15327. long val = PyInt_AS_LONG(x);
  15328. if (is_unsigned && unlikely(val < 0)) {
  15329. PyErr_SetString(PyExc_OverflowError,
  15330. "can't convert negative value to int");
  15331. return (int) -1;
  15332. }
  15333. return (int) val;
  15334. }
  15335. } else
  15336. #endif
  15337. if (likely(PyLong_Check(x))) {
  15338. if (is_unsigned) {
  15339. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15340. #if CYTHON_USE_PYLONG_INTERNALS
  15341. if (sizeof(digit) <= sizeof(int)) {
  15342. switch (Py_SIZE(x)) {
  15343. case 0: return 0;
  15344. case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
  15345. }
  15346. }
  15347. #endif
  15348. #endif
  15349. if (unlikely(Py_SIZE(x) < 0)) {
  15350. PyErr_SetString(PyExc_OverflowError,
  15351. "can't convert negative value to int");
  15352. return (int) -1;
  15353. }
  15354. if (sizeof(int) <= sizeof(unsigned long)) {
  15355. __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
  15356. } else if (sizeof(int) <= sizeof(unsigned long long)) {
  15357. __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
  15358. }
  15359. } else {
  15360. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15361. #if CYTHON_USE_PYLONG_INTERNALS
  15362. if (sizeof(digit) <= sizeof(int)) {
  15363. switch (Py_SIZE(x)) {
  15364. case 0: return 0;
  15365. case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
  15366. case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
  15367. }
  15368. }
  15369. #endif
  15370. #endif
  15371. if (sizeof(int) <= sizeof(long)) {
  15372. __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
  15373. } else if (sizeof(int) <= sizeof(long long)) {
  15374. __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
  15375. }
  15376. }
  15377. {
  15378. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  15379. PyErr_SetString(PyExc_RuntimeError,
  15380. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  15381. #else
  15382. int val;
  15383. PyObject *v = __Pyx_PyNumber_Int(x);
  15384. #if PY_MAJOR_VERSION < 3
  15385. if (likely(v) && !PyLong_Check(v)) {
  15386. PyObject *tmp = v;
  15387. v = PyNumber_Long(tmp);
  15388. Py_DECREF(tmp);
  15389. }
  15390. #endif
  15391. if (likely(v)) {
  15392. int one = 1; int is_little = (int)*(unsigned char *)&one;
  15393. unsigned char *bytes = (unsigned char *)&val;
  15394. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  15395. bytes, sizeof(val),
  15396. is_little, !is_unsigned);
  15397. Py_DECREF(v);
  15398. if (likely(!ret))
  15399. return val;
  15400. }
  15401. #endif
  15402. return (int) -1;
  15403. }
  15404. } else {
  15405. int val;
  15406. PyObject *tmp = __Pyx_PyNumber_Int(x);
  15407. if (!tmp) return (int) -1;
  15408. val = __Pyx_PyInt_As_int(tmp);
  15409. Py_DECREF(tmp);
  15410. return val;
  15411. }
  15412. }
  15413. static int __Pyx_check_binary_version(void) {
  15414. char ctversion[4], rtversion[4];
  15415. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  15416. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  15417. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  15418. char message[200];
  15419. PyOS_snprintf(message, sizeof(message),
  15420. "compiletime version %s of module '%.100s' "
  15421. "does not match runtime version %s",
  15422. ctversion, __Pyx_MODULE_NAME, rtversion);
  15423. #if PY_VERSION_HEX < 0x02050000
  15424. return PyErr_Warn(NULL, message);
  15425. #else
  15426. return PyErr_WarnEx(NULL, message, 1);
  15427. #endif
  15428. }
  15429. return 0;
  15430. }
  15431. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  15432. int start = 0, mid = 0, end = count - 1;
  15433. if (end >= 0 && code_line > entries[end].code_line) {
  15434. return count;
  15435. }
  15436. while (start < end) {
  15437. mid = (start + end) / 2;
  15438. if (code_line < entries[mid].code_line) {
  15439. end = mid;
  15440. } else if (code_line > entries[mid].code_line) {
  15441. start = mid + 1;
  15442. } else {
  15443. return mid;
  15444. }
  15445. }
  15446. if (code_line <= entries[mid].code_line) {
  15447. return mid;
  15448. } else {
  15449. return mid + 1;
  15450. }
  15451. }
  15452. static PyCodeObject *__pyx_find_code_object(int code_line) {
  15453. PyCodeObject* code_object;
  15454. int pos;
  15455. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  15456. return NULL;
  15457. }
  15458. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  15459. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  15460. return NULL;
  15461. }
  15462. code_object = __pyx_code_cache.entries[pos].code_object;
  15463. Py_INCREF(code_object);
  15464. return code_object;
  15465. }
  15466. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  15467. int pos, i;
  15468. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  15469. if (unlikely(!code_line)) {
  15470. return;
  15471. }
  15472. if (unlikely(!entries)) {
  15473. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  15474. if (likely(entries)) {
  15475. __pyx_code_cache.entries = entries;
  15476. __pyx_code_cache.max_count = 64;
  15477. __pyx_code_cache.count = 1;
  15478. entries[0].code_line = code_line;
  15479. entries[0].code_object = code_object;
  15480. Py_INCREF(code_object);
  15481. }
  15482. return;
  15483. }
  15484. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  15485. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  15486. PyCodeObject* tmp = entries[pos].code_object;
  15487. entries[pos].code_object = code_object;
  15488. Py_DECREF(tmp);
  15489. return;
  15490. }
  15491. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  15492. int new_max = __pyx_code_cache.max_count + 64;
  15493. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  15494. __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  15495. if (unlikely(!entries)) {
  15496. return;
  15497. }
  15498. __pyx_code_cache.entries = entries;
  15499. __pyx_code_cache.max_count = new_max;
  15500. }
  15501. for (i=__pyx_code_cache.count; i>pos; i--) {
  15502. entries[i] = entries[i-1];
  15503. }
  15504. entries[pos].code_line = code_line;
  15505. entries[pos].code_object = code_object;
  15506. __pyx_code_cache.count++;
  15507. Py_INCREF(code_object);
  15508. }
  15509. #include "compile.h"
  15510. #include "frameobject.h"
  15511. #include "traceback.h"
  15512. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  15513. const char *funcname, int c_line,
  15514. int py_line, const char *filename) {
  15515. PyCodeObject *py_code = 0;
  15516. PyObject *py_srcfile = 0;
  15517. PyObject *py_funcname = 0;
  15518. #if PY_MAJOR_VERSION < 3
  15519. py_srcfile = PyString_FromString(filename);
  15520. #else
  15521. py_srcfile = PyUnicode_FromString(filename);
  15522. #endif
  15523. if (!py_srcfile) goto bad;
  15524. if (c_line) {
  15525. #if PY_MAJOR_VERSION < 3
  15526. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  15527. #else
  15528. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  15529. #endif
  15530. }
  15531. else {
  15532. #if PY_MAJOR_VERSION < 3
  15533. py_funcname = PyString_FromString(funcname);
  15534. #else
  15535. py_funcname = PyUnicode_FromString(funcname);
  15536. #endif
  15537. }
  15538. if (!py_funcname) goto bad;
  15539. py_code = __Pyx_PyCode_New(
  15540. 0, /*int argcount,*/
  15541. 0, /*int kwonlyargcount,*/
  15542. 0, /*int nlocals,*/
  15543. 0, /*int stacksize,*/
  15544. 0, /*int flags,*/
  15545. __pyx_empty_bytes, /*PyObject *code,*/
  15546. __pyx_empty_tuple, /*PyObject *consts,*/
  15547. __pyx_empty_tuple, /*PyObject *names,*/
  15548. __pyx_empty_tuple, /*PyObject *varnames,*/
  15549. __pyx_empty_tuple, /*PyObject *freevars,*/
  15550. __pyx_empty_tuple, /*PyObject *cellvars,*/
  15551. py_srcfile, /*PyObject *filename,*/
  15552. py_funcname, /*PyObject *name,*/
  15553. py_line, /*int firstlineno,*/
  15554. __pyx_empty_bytes /*PyObject *lnotab*/
  15555. );
  15556. Py_DECREF(py_srcfile);
  15557. Py_DECREF(py_funcname);
  15558. return py_code;
  15559. bad:
  15560. Py_XDECREF(py_srcfile);
  15561. Py_XDECREF(py_funcname);
  15562. return NULL;
  15563. }
  15564. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  15565. int py_line, const char *filename) {
  15566. PyCodeObject *py_code = 0;
  15567. PyObject *py_globals = 0;
  15568. PyFrameObject *py_frame = 0;
  15569. py_code = __pyx_find_code_object(c_line ? c_line : py_line);
  15570. if (!py_code) {
  15571. py_code = __Pyx_CreateCodeObjectForTraceback(
  15572. funcname, c_line, py_line, filename);
  15573. if (!py_code) goto bad;
  15574. __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
  15575. }
  15576. py_globals = PyModule_GetDict(__pyx_m);
  15577. if (!py_globals) goto bad;
  15578. py_frame = PyFrame_New(
  15579. PyThreadState_GET(), /*PyThreadState *tstate,*/
  15580. py_code, /*PyCodeObject *code,*/
  15581. py_globals, /*PyObject *globals,*/
  15582. 0 /*PyObject *locals*/
  15583. );
  15584. if (!py_frame) goto bad;
  15585. py_frame->f_lineno = py_line;
  15586. PyTraceBack_Here(py_frame);
  15587. bad:
  15588. Py_XDECREF(py_code);
  15589. Py_XDECREF(py_frame);
  15590. }
  15591. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  15592. while (t->p) {
  15593. #if PY_MAJOR_VERSION < 3
  15594. if (t->is_unicode) {
  15595. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  15596. } else if (t->intern) {
  15597. *t->p = PyString_InternFromString(t->s);
  15598. } else {
  15599. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  15600. }
  15601. #else /* Python 3+ has unicode identifiers */
  15602. if (t->is_unicode | t->is_str) {
  15603. if (t->intern) {
  15604. *t->p = PyUnicode_InternFromString(t->s);
  15605. } else if (t->encoding) {
  15606. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  15607. } else {
  15608. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  15609. }
  15610. } else {
  15611. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  15612. }
  15613. #endif
  15614. if (!*t->p)
  15615. return -1;
  15616. ++t;
  15617. }
  15618. return 0;
  15619. }
  15620. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
  15621. return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
  15622. }
  15623. static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
  15624. Py_ssize_t ignore;
  15625. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  15626. }
  15627. static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  15628. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  15629. if (
  15630. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  15631. __Pyx_sys_getdefaultencoding_not_ascii &&
  15632. #endif
  15633. PyUnicode_Check(o)) {
  15634. #if PY_VERSION_HEX < 0x03030000
  15635. char* defenc_c;
  15636. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  15637. if (!defenc) return NULL;
  15638. defenc_c = PyBytes_AS_STRING(defenc);
  15639. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  15640. {
  15641. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  15642. char* c;
  15643. for (c = defenc_c; c < end; c++) {
  15644. if ((unsigned char) (*c) >= 128) {
  15645. PyUnicode_AsASCIIString(o);
  15646. return NULL;
  15647. }
  15648. }
  15649. }
  15650. #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
  15651. *length = PyBytes_GET_SIZE(defenc);
  15652. return defenc_c;
  15653. #else /* PY_VERSION_HEX < 0x03030000 */
  15654. if (PyUnicode_READY(o) == -1) return NULL;
  15655. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  15656. if (PyUnicode_IS_ASCII(o)) {
  15657. *length = PyUnicode_GET_DATA_SIZE(o);
  15658. return PyUnicode_AsUTF8(o);
  15659. } else {
  15660. PyUnicode_AsASCIIString(o);
  15661. return NULL;
  15662. }
  15663. #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  15664. return PyUnicode_AsUTF8AndSize(o, length);
  15665. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
  15666. #endif /* PY_VERSION_HEX < 0x03030000 */
  15667. } else
  15668. #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
  15669. #if !CYTHON_COMPILING_IN_PYPY
  15670. #if PY_VERSION_HEX >= 0x02060000
  15671. if (PyByteArray_Check(o)) {
  15672. *length = PyByteArray_GET_SIZE(o);
  15673. return PyByteArray_AS_STRING(o);
  15674. } else
  15675. #endif
  15676. #endif
  15677. {
  15678. char* result;
  15679. int r = PyBytes_AsStringAndSize(o, &result, length);
  15680. if (unlikely(r < 0)) {
  15681. return NULL;
  15682. } else {
  15683. return result;
  15684. }
  15685. }
  15686. }
  15687. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  15688. int is_true = x == Py_True;
  15689. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  15690. else return PyObject_IsTrue(x);
  15691. }
  15692. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  15693. PyNumberMethods *m;
  15694. const char *name = NULL;
  15695. PyObject *res = NULL;
  15696. #if PY_MAJOR_VERSION < 3
  15697. if (PyInt_Check(x) || PyLong_Check(x))
  15698. #else
  15699. if (PyLong_Check(x))
  15700. #endif
  15701. return Py_INCREF(x), x;
  15702. m = Py_TYPE(x)->tp_as_number;
  15703. #if PY_MAJOR_VERSION < 3
  15704. if (m && m->nb_int) {
  15705. name = "int";
  15706. res = PyNumber_Int(x);
  15707. }
  15708. else if (m && m->nb_long) {
  15709. name = "long";
  15710. res = PyNumber_Long(x);
  15711. }
  15712. #else
  15713. if (m && m->nb_int) {
  15714. name = "int";
  15715. res = PyNumber_Long(x);
  15716. }
  15717. #endif
  15718. if (res) {
  15719. #if PY_MAJOR_VERSION < 3
  15720. if (!PyInt_Check(res) && !PyLong_Check(res)) {
  15721. #else
  15722. if (!PyLong_Check(res)) {
  15723. #endif
  15724. PyErr_Format(PyExc_TypeError,
  15725. "__%.4s__ returned non-%.4s (type %.200s)",
  15726. name, name, Py_TYPE(res)->tp_name);
  15727. Py_DECREF(res);
  15728. return NULL;
  15729. }
  15730. }
  15731. else if (!PyErr_Occurred()) {
  15732. PyErr_SetString(PyExc_TypeError,
  15733. "an integer is required");
  15734. }
  15735. return res;
  15736. }
  15737. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15738. #if CYTHON_USE_PYLONG_INTERNALS
  15739. #include "longintrepr.h"
  15740. #endif
  15741. #endif
  15742. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  15743. Py_ssize_t ival;
  15744. PyObject *x;
  15745. #if PY_MAJOR_VERSION < 3
  15746. if (likely(PyInt_CheckExact(b)))
  15747. return PyInt_AS_LONG(b);
  15748. #endif
  15749. if (likely(PyLong_CheckExact(b))) {
  15750. #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
  15751. #if CYTHON_USE_PYLONG_INTERNALS
  15752. switch (Py_SIZE(b)) {
  15753. case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
  15754. case 0: return 0;
  15755. case 1: return ((PyLongObject*)b)->ob_digit[0];
  15756. }
  15757. #endif
  15758. #endif
  15759. #if PY_VERSION_HEX < 0x02060000
  15760. return PyInt_AsSsize_t(b);
  15761. #else
  15762. return PyLong_AsSsize_t(b);
  15763. #endif
  15764. }
  15765. x = PyNumber_Index(b);
  15766. if (!x) return -1;
  15767. ival = PyInt_AsSsize_t(x);
  15768. Py_DECREF(x);
  15769. return ival;
  15770. }
  15771. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  15772. #if PY_VERSION_HEX < 0x02050000
  15773. if (ival <= LONG_MAX)
  15774. return PyInt_FromLong((long)ival);
  15775. else {
  15776. unsigned char *bytes = (unsigned char *) &ival;
  15777. int one = 1; int little = (int)*(unsigned char*)&one;
  15778. return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
  15779. }
  15780. #else
  15781. return PyInt_FromSize_t(ival);
  15782. #endif
  15783. }
  15784. #endif /* Py_PYTHON_H */