momentsPen.c 555 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408
  1. /* Generated by Cython 3.2.4 */
  2. /* BEGIN: Cython Metadata
  3. {
  4. "distutils": {
  5. "name": "fontTools.pens.momentsPen",
  6. "sources": [
  7. "Lib/fontTools/pens/momentsPen.py"
  8. ]
  9. },
  10. "module_name": "fontTools.pens.momentsPen"
  11. }
  12. END: Cython Metadata */
  13. #ifndef PY_SSIZE_T_CLEAN
  14. #define PY_SSIZE_T_CLEAN
  15. #endif /* PY_SSIZE_T_CLEAN */
  16. /* InitLimitedAPI */
  17. #if defined(Py_LIMITED_API)
  18. #if !defined(CYTHON_LIMITED_API)
  19. #define CYTHON_LIMITED_API 1
  20. #endif
  21. #elif defined(CYTHON_LIMITED_API)
  22. #ifdef _MSC_VER
  23. #pragma message ("Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.")
  24. #else
  25. #warning Limited API usage is enabled with 'CYTHON_LIMITED_API' but 'Py_LIMITED_API' does not define a Python target version. Consider setting 'Py_LIMITED_API' instead.
  26. #endif
  27. #endif
  28. #include "Python.h"
  29. #ifndef Py_PYTHON_H
  30. #error Python headers needed to compile C extensions, please install development version of Python.
  31. #elif PY_VERSION_HEX < 0x03080000
  32. #error Cython requires Python 3.8+.
  33. #else
  34. #define __PYX_ABI_VERSION "3_2_4"
  35. #define CYTHON_HEX_VERSION 0x030204F0
  36. #define CYTHON_FUTURE_DIVISION 1
  37. /* CModulePreamble */
  38. #include <stddef.h>
  39. #ifndef offsetof
  40. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  41. #endif
  42. #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  43. #ifndef __stdcall
  44. #define __stdcall
  45. #endif
  46. #ifndef __cdecl
  47. #define __cdecl
  48. #endif
  49. #ifndef __fastcall
  50. #define __fastcall
  51. #endif
  52. #endif
  53. #ifndef DL_IMPORT
  54. #define DL_IMPORT(t) t
  55. #endif
  56. #ifndef DL_EXPORT
  57. #define DL_EXPORT(t) t
  58. #endif
  59. #define __PYX_COMMA ,
  60. #ifndef PY_LONG_LONG
  61. #define PY_LONG_LONG LONG_LONG
  62. #endif
  63. #ifndef Py_HUGE_VAL
  64. #define Py_HUGE_VAL HUGE_VAL
  65. #endif
  66. #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
  67. #if defined(GRAALVM_PYTHON)
  68. /* For very preliminary testing purposes. Most variables are set the same as PyPy.
  69. The existence of this section does not imply that anything works or is even tested */
  70. #define CYTHON_COMPILING_IN_PYPY 0
  71. #define CYTHON_COMPILING_IN_CPYTHON 0
  72. #define CYTHON_COMPILING_IN_LIMITED_API 0
  73. #define CYTHON_COMPILING_IN_GRAAL 1
  74. #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  75. #undef CYTHON_USE_TYPE_SLOTS
  76. #define CYTHON_USE_TYPE_SLOTS 0
  77. #undef CYTHON_USE_TYPE_SPECS
  78. #define CYTHON_USE_TYPE_SPECS 0
  79. #undef CYTHON_USE_PYTYPE_LOOKUP
  80. #define CYTHON_USE_PYTYPE_LOOKUP 0
  81. #undef CYTHON_USE_PYLIST_INTERNALS
  82. #define CYTHON_USE_PYLIST_INTERNALS 0
  83. #undef CYTHON_USE_UNICODE_INTERNALS
  84. #define CYTHON_USE_UNICODE_INTERNALS 0
  85. #undef CYTHON_USE_UNICODE_WRITER
  86. #define CYTHON_USE_UNICODE_WRITER 0
  87. #undef CYTHON_USE_PYLONG_INTERNALS
  88. #define CYTHON_USE_PYLONG_INTERNALS 0
  89. #undef CYTHON_AVOID_BORROWED_REFS
  90. #define CYTHON_AVOID_BORROWED_REFS 1
  91. #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  92. #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  93. #undef CYTHON_ASSUME_SAFE_MACROS
  94. #define CYTHON_ASSUME_SAFE_MACROS 0
  95. #undef CYTHON_ASSUME_SAFE_SIZE
  96. #define CYTHON_ASSUME_SAFE_SIZE 0
  97. #undef CYTHON_UNPACK_METHODS
  98. #define CYTHON_UNPACK_METHODS 0
  99. #undef CYTHON_FAST_THREAD_STATE
  100. #define CYTHON_FAST_THREAD_STATE 0
  101. #undef CYTHON_FAST_GIL
  102. #define CYTHON_FAST_GIL 0
  103. #undef CYTHON_METH_FASTCALL
  104. #define CYTHON_METH_FASTCALL 0
  105. #undef CYTHON_FAST_PYCALL
  106. #define CYTHON_FAST_PYCALL 0
  107. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  108. #define CYTHON_PEP487_INIT_SUBCLASS 1
  109. #endif
  110. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  111. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  112. #undef CYTHON_USE_MODULE_STATE
  113. #define CYTHON_USE_MODULE_STATE 0
  114. #undef CYTHON_USE_SYS_MONITORING
  115. #define CYTHON_USE_SYS_MONITORING 0
  116. #undef CYTHON_USE_TP_FINALIZE
  117. #define CYTHON_USE_TP_FINALIZE 0
  118. #undef CYTHON_USE_AM_SEND
  119. #define CYTHON_USE_AM_SEND 0
  120. #undef CYTHON_USE_DICT_VERSIONS
  121. #define CYTHON_USE_DICT_VERSIONS 0
  122. #undef CYTHON_USE_EXC_INFO_STACK
  123. #define CYTHON_USE_EXC_INFO_STACK 1
  124. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  125. #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  126. #endif
  127. #undef CYTHON_USE_FREELISTS
  128. #define CYTHON_USE_FREELISTS 0
  129. #undef CYTHON_IMMORTAL_CONSTANTS
  130. #define CYTHON_IMMORTAL_CONSTANTS 0
  131. #elif defined(PYPY_VERSION)
  132. #define CYTHON_COMPILING_IN_PYPY 1
  133. #define CYTHON_COMPILING_IN_CPYTHON 0
  134. #define CYTHON_COMPILING_IN_LIMITED_API 0
  135. #define CYTHON_COMPILING_IN_GRAAL 0
  136. #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  137. #undef CYTHON_USE_TYPE_SLOTS
  138. #define CYTHON_USE_TYPE_SLOTS 1
  139. #ifndef CYTHON_USE_TYPE_SPECS
  140. #define CYTHON_USE_TYPE_SPECS 0
  141. #endif
  142. #undef CYTHON_USE_PYTYPE_LOOKUP
  143. #define CYTHON_USE_PYTYPE_LOOKUP 0
  144. #undef CYTHON_USE_PYLIST_INTERNALS
  145. #define CYTHON_USE_PYLIST_INTERNALS 0
  146. #undef CYTHON_USE_UNICODE_INTERNALS
  147. #define CYTHON_USE_UNICODE_INTERNALS 0
  148. #undef CYTHON_USE_UNICODE_WRITER
  149. #define CYTHON_USE_UNICODE_WRITER 0
  150. #undef CYTHON_USE_PYLONG_INTERNALS
  151. #define CYTHON_USE_PYLONG_INTERNALS 0
  152. #undef CYTHON_AVOID_BORROWED_REFS
  153. #define CYTHON_AVOID_BORROWED_REFS 1
  154. #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  155. #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  156. #undef CYTHON_ASSUME_SAFE_MACROS
  157. #define CYTHON_ASSUME_SAFE_MACROS 0
  158. #ifndef CYTHON_ASSUME_SAFE_SIZE
  159. #define CYTHON_ASSUME_SAFE_SIZE 1
  160. #endif
  161. #undef CYTHON_UNPACK_METHODS
  162. #define CYTHON_UNPACK_METHODS 0
  163. #undef CYTHON_FAST_THREAD_STATE
  164. #define CYTHON_FAST_THREAD_STATE 0
  165. #undef CYTHON_FAST_GIL
  166. #define CYTHON_FAST_GIL 0
  167. #undef CYTHON_METH_FASTCALL
  168. #define CYTHON_METH_FASTCALL 0
  169. #undef CYTHON_FAST_PYCALL
  170. #define CYTHON_FAST_PYCALL 0
  171. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  172. #define CYTHON_PEP487_INIT_SUBCLASS 1
  173. #endif
  174. #if PY_VERSION_HEX < 0x03090000
  175. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  176. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  177. #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
  178. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  179. #endif
  180. #undef CYTHON_USE_MODULE_STATE
  181. #define CYTHON_USE_MODULE_STATE 0
  182. #undef CYTHON_USE_SYS_MONITORING
  183. #define CYTHON_USE_SYS_MONITORING 0
  184. #ifndef CYTHON_USE_TP_FINALIZE
  185. #define CYTHON_USE_TP_FINALIZE (PYPY_VERSION_NUM >= 0x07030C00)
  186. #endif
  187. #undef CYTHON_USE_AM_SEND
  188. #define CYTHON_USE_AM_SEND 0
  189. #undef CYTHON_USE_DICT_VERSIONS
  190. #define CYTHON_USE_DICT_VERSIONS 0
  191. #undef CYTHON_USE_EXC_INFO_STACK
  192. #define CYTHON_USE_EXC_INFO_STACK 0
  193. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  194. #define CYTHON_UPDATE_DESCRIPTOR_DOC (PYPY_VERSION_NUM >= 0x07031100)
  195. #endif
  196. #undef CYTHON_USE_FREELISTS
  197. #define CYTHON_USE_FREELISTS 0
  198. #undef CYTHON_IMMORTAL_CONSTANTS
  199. #define CYTHON_IMMORTAL_CONSTANTS 0
  200. #elif defined(CYTHON_LIMITED_API)
  201. #ifdef Py_LIMITED_API
  202. #undef __PYX_LIMITED_VERSION_HEX
  203. #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  204. #endif
  205. #define CYTHON_COMPILING_IN_PYPY 0
  206. #define CYTHON_COMPILING_IN_CPYTHON 0
  207. #define CYTHON_COMPILING_IN_LIMITED_API 1
  208. #define CYTHON_COMPILING_IN_GRAAL 0
  209. #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  210. #undef CYTHON_USE_TYPE_SLOTS
  211. #define CYTHON_USE_TYPE_SLOTS 0
  212. #undef CYTHON_USE_TYPE_SPECS
  213. #define CYTHON_USE_TYPE_SPECS 1
  214. #undef CYTHON_USE_PYTYPE_LOOKUP
  215. #define CYTHON_USE_PYTYPE_LOOKUP 0
  216. #undef CYTHON_USE_PYLIST_INTERNALS
  217. #define CYTHON_USE_PYLIST_INTERNALS 0
  218. #undef CYTHON_USE_UNICODE_INTERNALS
  219. #define CYTHON_USE_UNICODE_INTERNALS 0
  220. #ifndef CYTHON_USE_UNICODE_WRITER
  221. #define CYTHON_USE_UNICODE_WRITER 0
  222. #endif
  223. #undef CYTHON_USE_PYLONG_INTERNALS
  224. #define CYTHON_USE_PYLONG_INTERNALS 0
  225. #ifndef CYTHON_AVOID_BORROWED_REFS
  226. #define CYTHON_AVOID_BORROWED_REFS 0
  227. #endif
  228. #ifndef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  229. #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  230. #endif
  231. #undef CYTHON_ASSUME_SAFE_MACROS
  232. #define CYTHON_ASSUME_SAFE_MACROS 0
  233. #undef CYTHON_ASSUME_SAFE_SIZE
  234. #define CYTHON_ASSUME_SAFE_SIZE 0
  235. #undef CYTHON_UNPACK_METHODS
  236. #define CYTHON_UNPACK_METHODS 0
  237. #undef CYTHON_FAST_THREAD_STATE
  238. #define CYTHON_FAST_THREAD_STATE 0
  239. #undef CYTHON_FAST_GIL
  240. #define CYTHON_FAST_GIL 0
  241. #undef CYTHON_METH_FASTCALL
  242. #define CYTHON_METH_FASTCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  243. #undef CYTHON_FAST_PYCALL
  244. #define CYTHON_FAST_PYCALL 0
  245. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  246. #define CYTHON_PEP487_INIT_SUBCLASS 1
  247. #endif
  248. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  249. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  250. #endif
  251. #ifndef CYTHON_USE_MODULE_STATE
  252. #define CYTHON_USE_MODULE_STATE 0
  253. #endif
  254. #undef CYTHON_USE_SYS_MONITORING
  255. #define CYTHON_USE_SYS_MONITORING 0
  256. #ifndef CYTHON_USE_TP_FINALIZE
  257. #define CYTHON_USE_TP_FINALIZE 0
  258. #endif
  259. #ifndef CYTHON_USE_AM_SEND
  260. #define CYTHON_USE_AM_SEND (__PYX_LIMITED_VERSION_HEX >= 0x030A0000)
  261. #endif
  262. #undef CYTHON_USE_DICT_VERSIONS
  263. #define CYTHON_USE_DICT_VERSIONS 0
  264. #undef CYTHON_USE_EXC_INFO_STACK
  265. #define CYTHON_USE_EXC_INFO_STACK 0
  266. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  267. #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  268. #endif
  269. #ifndef CYTHON_USE_FREELISTS
  270. #define CYTHON_USE_FREELISTS 1
  271. #endif
  272. #undef CYTHON_IMMORTAL_CONSTANTS
  273. #define CYTHON_IMMORTAL_CONSTANTS 0
  274. #else
  275. #define CYTHON_COMPILING_IN_PYPY 0
  276. #define CYTHON_COMPILING_IN_CPYTHON 1
  277. #define CYTHON_COMPILING_IN_LIMITED_API 0
  278. #define CYTHON_COMPILING_IN_GRAAL 0
  279. #ifdef Py_GIL_DISABLED
  280. #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 1
  281. #else
  282. #define CYTHON_COMPILING_IN_CPYTHON_FREETHREADING 0
  283. #endif
  284. #if PY_VERSION_HEX < 0x030A0000
  285. #undef CYTHON_USE_TYPE_SLOTS
  286. #define CYTHON_USE_TYPE_SLOTS 1
  287. #elif !defined(CYTHON_USE_TYPE_SLOTS)
  288. #define CYTHON_USE_TYPE_SLOTS 1
  289. #endif
  290. #ifndef CYTHON_USE_TYPE_SPECS
  291. #define CYTHON_USE_TYPE_SPECS 0
  292. #endif
  293. #ifndef CYTHON_USE_PYTYPE_LOOKUP
  294. #define CYTHON_USE_PYTYPE_LOOKUP 1
  295. #endif
  296. #ifndef CYTHON_USE_PYLONG_INTERNALS
  297. #define CYTHON_USE_PYLONG_INTERNALS 1
  298. #endif
  299. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  300. #undef CYTHON_USE_PYLIST_INTERNALS
  301. #define CYTHON_USE_PYLIST_INTERNALS 0
  302. #elif !defined(CYTHON_USE_PYLIST_INTERNALS)
  303. #define CYTHON_USE_PYLIST_INTERNALS 1
  304. #endif
  305. #ifndef CYTHON_USE_UNICODE_INTERNALS
  306. #define CYTHON_USE_UNICODE_INTERNALS 1
  307. #endif
  308. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING || PY_VERSION_HEX >= 0x030B00A2
  309. #undef CYTHON_USE_UNICODE_WRITER
  310. #define CYTHON_USE_UNICODE_WRITER 0
  311. #elif !defined(CYTHON_USE_UNICODE_WRITER)
  312. #define CYTHON_USE_UNICODE_WRITER 1
  313. #endif
  314. #ifndef CYTHON_AVOID_BORROWED_REFS
  315. #define CYTHON_AVOID_BORROWED_REFS 0
  316. #endif
  317. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  318. #undef CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  319. #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 1
  320. #elif !defined(CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS)
  321. #define CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS 0
  322. #endif
  323. #ifndef CYTHON_ASSUME_SAFE_MACROS
  324. #define CYTHON_ASSUME_SAFE_MACROS 1
  325. #endif
  326. #ifndef CYTHON_ASSUME_SAFE_SIZE
  327. #define CYTHON_ASSUME_SAFE_SIZE 1
  328. #endif
  329. #ifndef CYTHON_UNPACK_METHODS
  330. #define CYTHON_UNPACK_METHODS 1
  331. #endif
  332. #ifndef CYTHON_FAST_THREAD_STATE
  333. #define CYTHON_FAST_THREAD_STATE 1
  334. #endif
  335. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  336. #undef CYTHON_FAST_GIL
  337. #define CYTHON_FAST_GIL 0
  338. #elif !defined(CYTHON_FAST_GIL)
  339. #define CYTHON_FAST_GIL (PY_VERSION_HEX < 0x030C00A6)
  340. #endif
  341. #ifndef CYTHON_METH_FASTCALL
  342. #define CYTHON_METH_FASTCALL 1
  343. #endif
  344. #ifndef CYTHON_FAST_PYCALL
  345. #define CYTHON_FAST_PYCALL 1
  346. #endif
  347. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  348. #define CYTHON_PEP487_INIT_SUBCLASS 1
  349. #endif
  350. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  351. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  352. #endif
  353. #ifndef CYTHON_USE_MODULE_STATE
  354. #define CYTHON_USE_MODULE_STATE 0
  355. #endif
  356. #ifndef CYTHON_USE_SYS_MONITORING
  357. #define CYTHON_USE_SYS_MONITORING (PY_VERSION_HEX >= 0x030d00B1)
  358. #endif
  359. #ifndef CYTHON_USE_TP_FINALIZE
  360. #define CYTHON_USE_TP_FINALIZE 1
  361. #endif
  362. #ifndef CYTHON_USE_AM_SEND
  363. #define CYTHON_USE_AM_SEND 1
  364. #endif
  365. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  366. #undef CYTHON_USE_DICT_VERSIONS
  367. #define CYTHON_USE_DICT_VERSIONS 0
  368. #elif !defined(CYTHON_USE_DICT_VERSIONS)
  369. #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5 && !CYTHON_USE_MODULE_STATE)
  370. #endif
  371. #ifndef CYTHON_USE_EXC_INFO_STACK
  372. #define CYTHON_USE_EXC_INFO_STACK 1
  373. #endif
  374. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  375. #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  376. #endif
  377. #ifndef CYTHON_USE_FREELISTS
  378. #define CYTHON_USE_FREELISTS (!CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  379. #endif
  380. #if defined(CYTHON_IMMORTAL_CONSTANTS) && PY_VERSION_HEX < 0x030C0000
  381. #undef CYTHON_IMMORTAL_CONSTANTS
  382. #define CYTHON_IMMORTAL_CONSTANTS 0 // definitely won't work
  383. #elif !defined(CYTHON_IMMORTAL_CONSTANTS)
  384. #define CYTHON_IMMORTAL_CONSTANTS (PY_VERSION_HEX >= 0x030C0000 && !CYTHON_USE_MODULE_STATE && CYTHON_COMPILING_IN_CPYTHON_FREETHREADING)
  385. #endif
  386. #endif
  387. #ifndef CYTHON_COMPRESS_STRINGS
  388. #define CYTHON_COMPRESS_STRINGS 1
  389. #endif
  390. #ifndef CYTHON_FAST_PYCCALL
  391. #define CYTHON_FAST_PYCCALL CYTHON_FAST_PYCALL
  392. #endif
  393. #ifndef CYTHON_VECTORCALL
  394. #if CYTHON_COMPILING_IN_LIMITED_API
  395. #define CYTHON_VECTORCALL (__PYX_LIMITED_VERSION_HEX >= 0x030C0000)
  396. #else
  397. #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL)
  398. #endif
  399. #endif
  400. #if CYTHON_USE_PYLONG_INTERNALS
  401. #undef SHIFT
  402. #undef BASE
  403. #undef MASK
  404. #ifdef SIZEOF_VOID_P
  405. enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  406. #endif
  407. #endif
  408. #ifndef __has_attribute
  409. #define __has_attribute(x) 0
  410. #endif
  411. #ifndef __has_cpp_attribute
  412. #define __has_cpp_attribute(x) 0
  413. #endif
  414. #ifndef CYTHON_RESTRICT
  415. #if defined(__GNUC__)
  416. #define CYTHON_RESTRICT __restrict__
  417. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  418. #define CYTHON_RESTRICT __restrict
  419. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  420. #define CYTHON_RESTRICT restrict
  421. #else
  422. #define CYTHON_RESTRICT
  423. #endif
  424. #endif
  425. #ifndef CYTHON_UNUSED
  426. #if defined(__cplusplus)
  427. /* for clang __has_cpp_attribute(maybe_unused) is true even before C++17
  428. * but leads to warnings with -pedantic, since it is a C++17 feature */
  429. #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
  430. #if __has_cpp_attribute(maybe_unused)
  431. #define CYTHON_UNUSED [[maybe_unused]]
  432. #endif
  433. #endif
  434. #endif
  435. #endif
  436. #ifndef CYTHON_UNUSED
  437. # if defined(__GNUC__)
  438. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  439. # define CYTHON_UNUSED __attribute__ ((__unused__))
  440. # else
  441. # define CYTHON_UNUSED
  442. # endif
  443. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  444. # define CYTHON_UNUSED __attribute__ ((__unused__))
  445. # else
  446. # define CYTHON_UNUSED
  447. # endif
  448. #endif
  449. #ifndef CYTHON_UNUSED_VAR
  450. # if defined(__cplusplus)
  451. template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
  452. # else
  453. # define CYTHON_UNUSED_VAR(x) (void)(x)
  454. # endif
  455. #endif
  456. #ifndef CYTHON_MAYBE_UNUSED_VAR
  457. #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
  458. #endif
  459. #ifndef CYTHON_NCP_UNUSED
  460. # if CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  461. # define CYTHON_NCP_UNUSED
  462. # else
  463. # define CYTHON_NCP_UNUSED CYTHON_UNUSED
  464. # endif
  465. #endif
  466. #ifndef CYTHON_USE_CPP_STD_MOVE
  467. #if defined(__cplusplus) && (\
  468. __cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1600))
  469. #define CYTHON_USE_CPP_STD_MOVE 1
  470. #else
  471. #define CYTHON_USE_CPP_STD_MOVE 0
  472. #endif
  473. #endif
  474. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  475. #include <stdint.h>
  476. typedef uintptr_t __pyx_uintptr_t;
  477. #ifndef CYTHON_FALLTHROUGH
  478. #if defined(__cplusplus)
  479. /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
  480. * but leads to warnings with -pedantic, since it is a C++17 feature */
  481. #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
  482. #if __has_cpp_attribute(fallthrough)
  483. #define CYTHON_FALLTHROUGH [[fallthrough]]
  484. #endif
  485. #endif
  486. #ifndef CYTHON_FALLTHROUGH
  487. #if __has_cpp_attribute(clang::fallthrough)
  488. #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
  489. #elif __has_cpp_attribute(gnu::fallthrough)
  490. #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
  491. #endif
  492. #endif
  493. #endif
  494. #ifndef CYTHON_FALLTHROUGH
  495. #if __has_attribute(fallthrough)
  496. #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
  497. #else
  498. #define CYTHON_FALLTHROUGH
  499. #endif
  500. #endif
  501. #if defined(__clang__) && defined(__apple_build_version__)
  502. #if __apple_build_version__ < 7000000
  503. #undef CYTHON_FALLTHROUGH
  504. #define CYTHON_FALLTHROUGH
  505. #endif
  506. #endif
  507. #endif
  508. #ifndef Py_UNREACHABLE
  509. #define Py_UNREACHABLE() assert(0); abort()
  510. #endif
  511. #ifdef __cplusplus
  512. template <typename T>
  513. struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  514. #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
  515. #else
  516. #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
  517. #endif
  518. #if CYTHON_COMPILING_IN_PYPY == 1
  519. #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x030A0000)
  520. #else
  521. #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX < 0x03090000)
  522. #endif
  523. #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
  524. /* CInitCode */
  525. #ifndef CYTHON_INLINE
  526. #if defined(__clang__)
  527. #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  528. #elif defined(__GNUC__)
  529. #define CYTHON_INLINE __inline__
  530. #elif defined(_MSC_VER)
  531. #define CYTHON_INLINE __inline
  532. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  533. #define CYTHON_INLINE inline
  534. #else
  535. #define CYTHON_INLINE
  536. #endif
  537. #endif
  538. /* PythonCompatibility */
  539. #define __PYX_BUILD_PY_SSIZE_T "n"
  540. #define CYTHON_FORMAT_SSIZE_T "z"
  541. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  542. #define __Pyx_DefaultClassType PyType_Type
  543. #if CYTHON_COMPILING_IN_LIMITED_API
  544. #ifndef CO_OPTIMIZED
  545. static int CO_OPTIMIZED;
  546. #endif
  547. #ifndef CO_NEWLOCALS
  548. static int CO_NEWLOCALS;
  549. #endif
  550. #ifndef CO_VARARGS
  551. static int CO_VARARGS;
  552. #endif
  553. #ifndef CO_VARKEYWORDS
  554. static int CO_VARKEYWORDS;
  555. #endif
  556. #ifndef CO_ASYNC_GENERATOR
  557. static int CO_ASYNC_GENERATOR;
  558. #endif
  559. #ifndef CO_GENERATOR
  560. static int CO_GENERATOR;
  561. #endif
  562. #ifndef CO_COROUTINE
  563. static int CO_COROUTINE;
  564. #endif
  565. #else
  566. #ifndef CO_COROUTINE
  567. #define CO_COROUTINE 0x80
  568. #endif
  569. #ifndef CO_ASYNC_GENERATOR
  570. #define CO_ASYNC_GENERATOR 0x200
  571. #endif
  572. #endif
  573. static int __Pyx_init_co_variables(void);
  574. #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  575. #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
  576. #else
  577. #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
  578. #endif
  579. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  580. #define __Pyx_Py_Is(x, y) Py_Is(x, y)
  581. #else
  582. #define __Pyx_Py_Is(x, y) ((x) == (y))
  583. #endif
  584. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  585. #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
  586. #else
  587. #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
  588. #endif
  589. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  590. #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
  591. #else
  592. #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
  593. #endif
  594. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  595. #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
  596. #else
  597. #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
  598. #endif
  599. #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
  600. #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  601. #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
  602. #else
  603. #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
  604. #endif
  605. #ifndef Py_TPFLAGS_CHECKTYPES
  606. #define Py_TPFLAGS_CHECKTYPES 0
  607. #endif
  608. #ifndef Py_TPFLAGS_HAVE_INDEX
  609. #define Py_TPFLAGS_HAVE_INDEX 0
  610. #endif
  611. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  612. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  613. #endif
  614. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  615. #define Py_TPFLAGS_HAVE_FINALIZE 0
  616. #endif
  617. #ifndef Py_TPFLAGS_SEQUENCE
  618. #define Py_TPFLAGS_SEQUENCE 0
  619. #endif
  620. #ifndef Py_TPFLAGS_MAPPING
  621. #define Py_TPFLAGS_MAPPING 0
  622. #endif
  623. #ifndef Py_TPFLAGS_IMMUTABLETYPE
  624. #define Py_TPFLAGS_IMMUTABLETYPE (1UL << 8)
  625. #endif
  626. #ifndef Py_TPFLAGS_DISALLOW_INSTANTIATION
  627. #define Py_TPFLAGS_DISALLOW_INSTANTIATION (1UL << 7)
  628. #endif
  629. #ifndef METH_STACKLESS
  630. #define METH_STACKLESS 0
  631. #endif
  632. #ifndef METH_FASTCALL
  633. #ifndef METH_FASTCALL
  634. #define METH_FASTCALL 0x80
  635. #endif
  636. typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  637. typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
  638. Py_ssize_t nargs, PyObject *kwnames);
  639. #else
  640. #if PY_VERSION_HEX >= 0x030d00A4
  641. # define __Pyx_PyCFunctionFast PyCFunctionFast
  642. # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords
  643. #else
  644. # define __Pyx_PyCFunctionFast _PyCFunctionFast
  645. # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  646. #endif
  647. #endif
  648. #if CYTHON_METH_FASTCALL
  649. #define __Pyx_METH_FASTCALL METH_FASTCALL
  650. #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  651. #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
  652. #else
  653. #define __Pyx_METH_FASTCALL METH_VARARGS
  654. #define __Pyx_PyCFunction_FastCall PyCFunction
  655. #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
  656. #endif
  657. #if CYTHON_VECTORCALL
  658. #define __pyx_vectorcallfunc vectorcallfunc
  659. #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
  660. #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
  661. #else
  662. #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
  663. #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
  664. #endif
  665. #if PY_VERSION_HEX >= 0x030900B1
  666. #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
  667. #else
  668. #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
  669. #endif
  670. #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
  671. #if CYTHON_COMPILING_IN_CPYTHON
  672. #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
  673. #elif !CYTHON_COMPILING_IN_LIMITED_API
  674. #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
  675. #endif
  676. #if CYTHON_COMPILING_IN_CPYTHON
  677. #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
  678. static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
  679. return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
  680. }
  681. #endif
  682. static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void (*cfunc)(void)) {
  683. #if CYTHON_COMPILING_IN_LIMITED_API
  684. return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
  685. #else
  686. return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
  687. #endif
  688. }
  689. #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
  690. #if PY_VERSION_HEX < 0x03090000 || (CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000)
  691. #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
  692. typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
  693. #else
  694. #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
  695. #define __Pyx_PyCMethod PyCMethod
  696. #endif
  697. #ifndef METH_METHOD
  698. #define METH_METHOD 0x200
  699. #endif
  700. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  701. #define PyObject_Malloc(s) PyMem_Malloc(s)
  702. #define PyObject_Free(p) PyMem_Free(p)
  703. #define PyObject_Realloc(p) PyMem_Realloc(p)
  704. #endif
  705. #if CYTHON_COMPILING_IN_LIMITED_API
  706. #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
  707. #elif CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  708. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  709. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) GraalPyFrame_SetLineNumber((frame), (lineno))
  710. #elif CYTHON_COMPILING_IN_GRAAL
  711. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  712. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) _PyFrame_SetLineNumber((frame), (lineno))
  713. #else
  714. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  715. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
  716. #endif
  717. #if CYTHON_COMPILING_IN_LIMITED_API
  718. #define __Pyx_PyThreadState_Current PyThreadState_Get()
  719. #elif !CYTHON_FAST_THREAD_STATE
  720. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  721. #elif PY_VERSION_HEX >= 0x030d00A1
  722. #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
  723. #else
  724. #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
  725. #endif
  726. #if CYTHON_USE_MODULE_STATE
  727. static CYTHON_INLINE void *__Pyx__PyModule_GetState(PyObject *op)
  728. {
  729. void *result;
  730. result = PyModule_GetState(op);
  731. if (!result)
  732. Py_FatalError("Couldn't find the module state");
  733. return result;
  734. }
  735. #define __Pyx_PyModule_GetState(o) (__pyx_mstatetype *)__Pyx__PyModule_GetState(o)
  736. #else
  737. #define __Pyx_PyModule_GetState(op) ((void)op,__pyx_mstate_global)
  738. #endif
  739. #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE((PyObject *) obj), name, func_ctype)
  740. #define __Pyx_PyObject_TryGetSlot(obj, name, func_ctype) __Pyx_PyType_TryGetSlot(Py_TYPE(obj), name, func_ctype)
  741. #define __Pyx_PyObject_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
  742. #define __Pyx_PyObject_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSubSlot(Py_TYPE(obj), sub, name, func_ctype)
  743. #if CYTHON_USE_TYPE_SLOTS
  744. #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
  745. #define __Pyx_PyType_TryGetSlot(type, name, func_ctype) __Pyx_PyType_GetSlot(type, name, func_ctype)
  746. #define __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype) (((type)->sub) ? ((type)->sub->name) : NULL)
  747. #define __Pyx_PyType_TryGetSubSlot(type, sub, name, func_ctype) __Pyx_PyType_GetSubSlot(type, sub, name, func_ctype)
  748. #else
  749. #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
  750. #define __Pyx_PyType_TryGetSlot(type, name, func_ctype)\
  751. ((__PYX_LIMITED_VERSION_HEX >= 0x030A0000 ||\
  752. (PyType_GetFlags(type) & Py_TPFLAGS_HEAPTYPE) || __Pyx_get_runtime_version() >= 0x030A0000) ?\
  753. __Pyx_PyType_GetSlot(type, name, func_ctype) : NULL)
  754. #define __Pyx_PyType_GetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_GetSlot(obj, name, func_ctype)
  755. #define __Pyx_PyType_TryGetSubSlot(obj, sub, name, func_ctype) __Pyx_PyType_TryGetSlot(obj, name, func_ctype)
  756. #endif
  757. #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
  758. #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
  759. #else
  760. #define __Pyx_PyDict_NewPresized(n) PyDict_New()
  761. #endif
  762. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  763. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  764. #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_UNICODE_INTERNALS
  765. #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
  766. static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
  767. PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
  768. if (res == NULL) PyErr_Clear();
  769. return res;
  770. }
  771. #elif !CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000
  772. #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
  773. #define __Pyx_PyDict_GetItemStr PyDict_GetItem
  774. #else
  775. static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
  776. #if CYTHON_COMPILING_IN_PYPY
  777. return PyDict_GetItem(dict, name);
  778. #else
  779. PyDictEntry *ep;
  780. PyDictObject *mp = (PyDictObject*) dict;
  781. long hash = ((PyStringObject *) name)->ob_shash;
  782. assert(hash != -1);
  783. ep = (mp->ma_lookup)(mp, name, hash);
  784. if (ep == NULL) {
  785. return NULL;
  786. }
  787. return ep->me_value;
  788. #endif
  789. }
  790. #define __Pyx_PyDict_GetItemStr PyDict_GetItem
  791. #endif
  792. #if CYTHON_USE_TYPE_SLOTS
  793. #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
  794. #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  795. #else
  796. #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
  797. #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
  798. #endif
  799. #define __Pyx_PyObject_GetIterNextFunc(iterator) __Pyx_PyObject_GetSlot(iterator, tp_iternext, iternextfunc)
  800. #if CYTHON_USE_TYPE_SPECS
  801. #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
  802. PyTypeObject *type = Py_TYPE((PyObject*)obj);\
  803. assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
  804. PyObject_GC_Del(obj);\
  805. Py_DECREF(type);\
  806. }
  807. #else
  808. #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
  809. #endif
  810. #if CYTHON_COMPILING_IN_LIMITED_API
  811. #define __Pyx_PyUnicode_READY(op) (0)
  812. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  813. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
  814. #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
  815. #define __Pyx_PyUnicode_DATA(u) ((void*)u)
  816. #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  817. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
  818. #else
  819. #if PY_VERSION_HEX >= 0x030C0000
  820. #define __Pyx_PyUnicode_READY(op) (0)
  821. #else
  822. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
  823. 0 : _PyUnicode_Ready((PyObject *)(op)))
  824. #endif
  825. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  826. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
  827. #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
  828. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  829. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  830. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  831. #if PY_VERSION_HEX >= 0x030C0000
  832. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
  833. #else
  834. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  835. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  836. #else
  837. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  838. #endif
  839. #endif
  840. #endif
  841. #if CYTHON_COMPILING_IN_PYPY
  842. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  843. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  844. #else
  845. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  846. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  847. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  848. #endif
  849. #if CYTHON_COMPILING_IN_PYPY
  850. #if !defined(PyUnicode_DecodeUnicodeEscape)
  851. #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
  852. #endif
  853. #if !defined(PyUnicode_Contains)
  854. #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
  855. #endif
  856. #if !defined(PyByteArray_Check)
  857. #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
  858. #endif
  859. #if !defined(PyObject_Format)
  860. #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
  861. #endif
  862. #endif
  863. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  864. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  865. #define __Pyx_PySequence_ListKeepNew(obj)\
  866. (likely(PyList_CheckExact(obj) && PyUnstable_Object_IsUniquelyReferenced(obj)) ? __Pyx_NewRef(obj) : PySequence_List(obj))
  867. #elif CYTHON_COMPILING_IN_CPYTHON
  868. #define __Pyx_PySequence_ListKeepNew(obj)\
  869. (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
  870. #else
  871. #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
  872. #endif
  873. #ifndef PySet_CheckExact
  874. #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
  875. #endif
  876. #if PY_VERSION_HEX >= 0x030900A4
  877. #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  878. #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
  879. #else
  880. #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  881. #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
  882. #endif
  883. enum __Pyx_ReferenceSharing {
  884. __Pyx_ReferenceSharing_DefinitelyUnique, // We created it so we know it's unshared - no need to check
  885. __Pyx_ReferenceSharing_OwnStrongReference,
  886. __Pyx_ReferenceSharing_FunctionArgument,
  887. __Pyx_ReferenceSharing_SharedReference, // Never trust it to be unshared because it's a global or similar
  888. };
  889. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && PY_VERSION_HEX >= 0x030E0000
  890. #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing)\
  891. (sharing == __Pyx_ReferenceSharing_DefinitelyUnique ? 1 :\
  892. (sharing == __Pyx_ReferenceSharing_FunctionArgument ? PyUnstable_Object_IsUniqueReferencedTemporary(o) :\
  893. (sharing == __Pyx_ReferenceSharing_OwnStrongReference ? PyUnstable_Object_IsUniquelyReferenced(o) : 0)))
  894. #elif (CYTHON_COMPILING_IN_CPYTHON && !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING) || CYTHON_COMPILING_IN_LIMITED_API
  895. #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)sharing), Py_REFCNT(o) == 1)
  896. #else
  897. #define __Pyx_IS_UNIQUELY_REFERENCED(o, sharing) (((void)o), ((void)sharing), 0)
  898. #endif
  899. #if CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  900. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  901. #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  902. #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  903. #define __Pyx_PyList_GetItemRef(o, i) (likely((i) >= 0) ? PySequence_GetItem(o, i) : (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  904. #else
  905. #define __Pyx_PyList_GetItemRef(o, i) PySequence_ITEM(o, i)
  906. #endif
  907. #elif CYTHON_COMPILING_IN_LIMITED_API || !CYTHON_ASSUME_SAFE_MACROS
  908. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  909. #define __Pyx_PyList_GetItemRef(o, i) PyList_GetItemRef(o, i)
  910. #else
  911. #define __Pyx_PyList_GetItemRef(o, i) __Pyx_XNewRef(PyList_GetItem(o, i))
  912. #endif
  913. #else
  914. #define __Pyx_PyList_GetItemRef(o, i) __Pyx_NewRef(PyList_GET_ITEM(o, i))
  915. #endif
  916. #if CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS && !CYTHON_COMPILING_IN_LIMITED_API && CYTHON_ASSUME_SAFE_MACROS
  917. #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) (__Pyx_IS_UNIQUELY_REFERENCED(o, unsafe_shared) ?\
  918. __Pyx_NewRef(PyList_GET_ITEM(o, i)) : __Pyx_PyList_GetItemRef(o, i))
  919. #else
  920. #define __Pyx_PyList_GetItemRefFast(o, i, unsafe_shared) __Pyx_PyList_GetItemRef(o, i)
  921. #endif
  922. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  923. #define __Pyx_PyDict_GetItemRef(dict, key, result) PyDict_GetItemRef(dict, key, result)
  924. #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  925. static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  926. *result = PyObject_GetItem(dict, key);
  927. if (*result == NULL) {
  928. if (PyErr_ExceptionMatches(PyExc_KeyError)) {
  929. PyErr_Clear();
  930. return 0;
  931. }
  932. return -1;
  933. }
  934. return 1;
  935. }
  936. #else
  937. static CYTHON_INLINE int __Pyx_PyDict_GetItemRef(PyObject *dict, PyObject *key, PyObject **result) {
  938. *result = PyDict_GetItemWithError(dict, key);
  939. if (*result == NULL) {
  940. return PyErr_Occurred() ? -1 : 0;
  941. }
  942. Py_INCREF(*result);
  943. return 1;
  944. }
  945. #endif
  946. #if defined(CYTHON_DEBUG_VISIT_CONST) && CYTHON_DEBUG_VISIT_CONST
  947. #define __Pyx_VISIT_CONST(obj) Py_VISIT(obj)
  948. #else
  949. #define __Pyx_VISIT_CONST(obj)
  950. #endif
  951. #if CYTHON_ASSUME_SAFE_MACROS
  952. #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  953. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  954. #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  955. #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GET_ITEM(o, i)
  956. #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  957. #define __Pyx_PyList_GET_ITEM(o, i) PyList_GET_ITEM(o, i)
  958. #else
  959. #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  960. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  961. #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  962. #define __Pyx_PyTuple_GET_ITEM(o, i) PyTuple_GetItem(o, i)
  963. #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  964. #define __Pyx_PyList_GET_ITEM(o, i) PyList_GetItem(o, i)
  965. #endif
  966. #if CYTHON_ASSUME_SAFE_SIZE
  967. #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  968. #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  969. #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  970. #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  971. #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  972. #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GET_LENGTH(o)
  973. #else
  974. #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  975. #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  976. #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  977. #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  978. #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  979. #define __Pyx_PyUnicode_GET_LENGTH(o) PyUnicode_GetLength(o)
  980. #endif
  981. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_InternFromString)
  982. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  983. #endif
  984. #define __Pyx_PyLong_FromHash_t PyLong_FromSsize_t
  985. #define __Pyx_PyLong_AsHash_t __Pyx_PyIndex_AsSsize_t
  986. #if __PYX_LIMITED_VERSION_HEX >= 0x030A0000
  987. #define __Pyx_PySendResult PySendResult
  988. #else
  989. typedef enum {
  990. PYGEN_RETURN = 0,
  991. PYGEN_ERROR = -1,
  992. PYGEN_NEXT = 1,
  993. } __Pyx_PySendResult;
  994. #endif
  995. #if CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX < 0x030A00A3
  996. typedef __Pyx_PySendResult (*__Pyx_pyiter_sendfunc)(PyObject *iter, PyObject *value, PyObject **result);
  997. #else
  998. #define __Pyx_pyiter_sendfunc sendfunc
  999. #endif
  1000. #if !CYTHON_USE_AM_SEND
  1001. #define __PYX_HAS_PY_AM_SEND 0
  1002. #elif __PYX_LIMITED_VERSION_HEX >= 0x030A0000
  1003. #define __PYX_HAS_PY_AM_SEND 1
  1004. #else
  1005. #define __PYX_HAS_PY_AM_SEND 2 // our own backported implementation
  1006. #endif
  1007. #if __PYX_HAS_PY_AM_SEND < 2
  1008. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  1009. #else
  1010. typedef struct {
  1011. unaryfunc am_await;
  1012. unaryfunc am_aiter;
  1013. unaryfunc am_anext;
  1014. __Pyx_pyiter_sendfunc am_send;
  1015. } __Pyx_PyAsyncMethodsStruct;
  1016. #define __Pyx_SlotTpAsAsync(s) ((PyAsyncMethods*)(s))
  1017. #endif
  1018. #if CYTHON_USE_AM_SEND && PY_VERSION_HEX < 0x030A00F0
  1019. #define __Pyx_TPFLAGS_HAVE_AM_SEND (1UL << 21)
  1020. #else
  1021. #define __Pyx_TPFLAGS_HAVE_AM_SEND (0)
  1022. #endif
  1023. #if PY_VERSION_HEX >= 0x03090000
  1024. #define __Pyx_PyInterpreterState_Get() PyInterpreterState_Get()
  1025. #else
  1026. #define __Pyx_PyInterpreterState_Get() PyThreadState_Get()->interp
  1027. #endif
  1028. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030A0000
  1029. #ifdef __cplusplus
  1030. extern "C"
  1031. #endif
  1032. PyAPI_FUNC(void *) PyMem_Calloc(size_t nelem, size_t elsize);
  1033. #endif
  1034. #if CYTHON_COMPILING_IN_LIMITED_API
  1035. static int __Pyx_init_co_variable(PyObject *inspect, const char* name, int *write_to) {
  1036. int value;
  1037. PyObject *py_value = PyObject_GetAttrString(inspect, name);
  1038. if (!py_value) return 0;
  1039. value = (int) PyLong_AsLong(py_value);
  1040. Py_DECREF(py_value);
  1041. *write_to = value;
  1042. return value != -1 || !PyErr_Occurred();
  1043. }
  1044. static int __Pyx_init_co_variables(void) {
  1045. PyObject *inspect;
  1046. int result;
  1047. inspect = PyImport_ImportModule("inspect");
  1048. result =
  1049. #if !defined(CO_OPTIMIZED)
  1050. __Pyx_init_co_variable(inspect, "CO_OPTIMIZED", &CO_OPTIMIZED) &&
  1051. #endif
  1052. #if !defined(CO_NEWLOCALS)
  1053. __Pyx_init_co_variable(inspect, "CO_NEWLOCALS", &CO_NEWLOCALS) &&
  1054. #endif
  1055. #if !defined(CO_VARARGS)
  1056. __Pyx_init_co_variable(inspect, "CO_VARARGS", &CO_VARARGS) &&
  1057. #endif
  1058. #if !defined(CO_VARKEYWORDS)
  1059. __Pyx_init_co_variable(inspect, "CO_VARKEYWORDS", &CO_VARKEYWORDS) &&
  1060. #endif
  1061. #if !defined(CO_ASYNC_GENERATOR)
  1062. __Pyx_init_co_variable(inspect, "CO_ASYNC_GENERATOR", &CO_ASYNC_GENERATOR) &&
  1063. #endif
  1064. #if !defined(CO_GENERATOR)
  1065. __Pyx_init_co_variable(inspect, "CO_GENERATOR", &CO_GENERATOR) &&
  1066. #endif
  1067. #if !defined(CO_COROUTINE)
  1068. __Pyx_init_co_variable(inspect, "CO_COROUTINE", &CO_COROUTINE) &&
  1069. #endif
  1070. 1;
  1071. Py_DECREF(inspect);
  1072. return result ? 0 : -1;
  1073. }
  1074. #else
  1075. static int __Pyx_init_co_variables(void) {
  1076. return 0; // It's a limited API-only feature
  1077. }
  1078. #endif
  1079. /* MathInitCode */
  1080. #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  1081. #ifndef _USE_MATH_DEFINES
  1082. #define _USE_MATH_DEFINES
  1083. #endif
  1084. #endif
  1085. #include <math.h>
  1086. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  1087. #define __Pyx_truncl trunc
  1088. #else
  1089. #define __Pyx_truncl truncl
  1090. #endif
  1091. #ifndef CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  1092. #define CYTHON_CLINE_IN_TRACEBACK_RUNTIME 0
  1093. #endif
  1094. #ifndef CYTHON_CLINE_IN_TRACEBACK
  1095. #define CYTHON_CLINE_IN_TRACEBACK CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  1096. #endif
  1097. #if CYTHON_CLINE_IN_TRACEBACK
  1098. #define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; __pyx_clineno = __LINE__; (void) __pyx_clineno; }
  1099. #else
  1100. #define __PYX_MARK_ERR_POS(f_index, lineno) { __pyx_filename = __pyx_f[f_index]; (void) __pyx_filename; __pyx_lineno = lineno; (void) __pyx_lineno; (void) __pyx_clineno; }
  1101. #endif
  1102. #define __PYX_ERR(f_index, lineno, Ln_error) \
  1103. { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
  1104. #ifdef CYTHON_EXTERN_C
  1105. #undef __PYX_EXTERN_C
  1106. #define __PYX_EXTERN_C CYTHON_EXTERN_C
  1107. #elif defined(__PYX_EXTERN_C)
  1108. #ifdef _MSC_VER
  1109. #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
  1110. #else
  1111. #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
  1112. #endif
  1113. #else
  1114. #ifdef __cplusplus
  1115. #define __PYX_EXTERN_C extern "C"
  1116. #else
  1117. #define __PYX_EXTERN_C extern
  1118. #endif
  1119. #endif
  1120. #define __PYX_HAVE__fontTools__pens__momentsPen
  1121. #define __PYX_HAVE_API__fontTools__pens__momentsPen
  1122. /* Early includes */
  1123. #ifdef _OPENMP
  1124. #include <omp.h>
  1125. #endif /* _OPENMP */
  1126. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  1127. #define CYTHON_WITHOUT_ASSERTIONS
  1128. #endif
  1129. #ifdef CYTHON_FREETHREADING_COMPATIBLE
  1130. #if CYTHON_FREETHREADING_COMPATIBLE
  1131. #define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_NOT_USED
  1132. #else
  1133. #define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
  1134. #endif
  1135. #else
  1136. #define __Pyx_FREETHREADING_COMPATIBLE Py_MOD_GIL_USED
  1137. #endif
  1138. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  1139. #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
  1140. #define __PYX_DEFAULT_STRING_ENCODING ""
  1141. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  1142. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  1143. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  1144. #define __Pyx_long_cast(x) ((long)x)
  1145. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  1146. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  1147. (sizeof(type) > sizeof(Py_ssize_t) &&\
  1148. likely(v < (type)PY_SSIZE_T_MAX ||\
  1149. v == (type)PY_SSIZE_T_MAX) &&\
  1150. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  1151. v == (type)PY_SSIZE_T_MIN))) ||\
  1152. (sizeof(type) == sizeof(Py_ssize_t) &&\
  1153. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  1154. v == (type)PY_SSIZE_T_MAX))) )
  1155. static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
  1156. return (size_t) i < (size_t) limit;
  1157. }
  1158. #if defined (__cplusplus) && __cplusplus >= 201103L
  1159. #include <cstdlib>
  1160. #define __Pyx_sst_abs(value) std::abs(value)
  1161. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  1162. #define __Pyx_sst_abs(value) abs(value)
  1163. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  1164. #define __Pyx_sst_abs(value) labs(value)
  1165. #elif defined (_MSC_VER)
  1166. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  1167. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  1168. #define __Pyx_sst_abs(value) llabs(value)
  1169. #elif defined (__GNUC__)
  1170. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  1171. #else
  1172. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  1173. #endif
  1174. static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
  1175. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  1176. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  1177. static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
  1178. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  1179. #define __Pyx_PyBytes_FromString PyBytes_FromString
  1180. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  1181. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  1182. #if CYTHON_ASSUME_SAFE_MACROS
  1183. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  1184. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  1185. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  1186. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  1187. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  1188. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  1189. #define __Pyx_PyByteArray_AsString(s) PyByteArray_AS_STRING(s)
  1190. #else
  1191. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AsString(s))
  1192. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AsString(s))
  1193. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AsString(s))
  1194. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AsString(s))
  1195. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AsString(s))
  1196. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AsString(s))
  1197. #define __Pyx_PyByteArray_AsString(s) PyByteArray_AsString(s)
  1198. #endif
  1199. #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1200. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1201. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1202. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  1203. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  1204. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  1205. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  1206. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  1207. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  1208. #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
  1209. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  1210. static CYTHON_INLINE PyObject *__Pyx_NewRef(PyObject *obj) {
  1211. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_NewRef)
  1212. return Py_NewRef(obj);
  1213. #else
  1214. Py_INCREF(obj);
  1215. return obj;
  1216. #endif
  1217. }
  1218. static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
  1219. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030a0000 || defined(Py_XNewRef)
  1220. return Py_XNewRef(obj);
  1221. #else
  1222. Py_XINCREF(obj);
  1223. return obj;
  1224. #endif
  1225. }
  1226. static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
  1227. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  1228. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  1229. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
  1230. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x);
  1231. #define __Pyx_PySequence_Tuple(obj)\
  1232. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  1233. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  1234. static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t);
  1235. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
  1236. #if CYTHON_ASSUME_SAFE_MACROS
  1237. #define __Pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  1238. #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AS_DOUBLE(x)
  1239. #else
  1240. #define __Pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  1241. #define __Pyx_PyFloat_AS_DOUBLE(x) PyFloat_AsDouble(x)
  1242. #endif
  1243. #define __Pyx_PyFloat_AsFloat(x) ((float) __Pyx_PyFloat_AsDouble(x))
  1244. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  1245. #if CYTHON_USE_PYLONG_INTERNALS
  1246. #if PY_VERSION_HEX >= 0x030C00A7
  1247. #ifndef _PyLong_SIGN_MASK
  1248. #define _PyLong_SIGN_MASK 3
  1249. #endif
  1250. #ifndef _PyLong_NON_SIZE_BITS
  1251. #define _PyLong_NON_SIZE_BITS 3
  1252. #endif
  1253. #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  1254. #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
  1255. #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
  1256. #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
  1257. #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
  1258. #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
  1259. #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  1260. #define __Pyx_PyLong_SignedDigitCount(x)\
  1261. ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  1262. #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
  1263. #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
  1264. #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
  1265. #else
  1266. #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
  1267. #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  1268. #endif
  1269. typedef Py_ssize_t __Pyx_compact_pylong;
  1270. typedef size_t __Pyx_compact_upylong;
  1271. #else
  1272. #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
  1273. #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
  1274. #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
  1275. #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
  1276. #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  1277. #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
  1278. #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
  1279. #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  1280. #define __Pyx_PyLong_CompactValue(x)\
  1281. ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  1282. typedef sdigit __Pyx_compact_pylong;
  1283. typedef digit __Pyx_compact_upylong;
  1284. #endif
  1285. #if PY_VERSION_HEX >= 0x030C00A5
  1286. #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
  1287. #else
  1288. #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
  1289. #endif
  1290. #endif
  1291. #if __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  1292. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  1293. #elif __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  1294. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeASCII(c_str, size, NULL)
  1295. #else
  1296. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  1297. #endif
  1298. /* Test for GCC > 2.95 */
  1299. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  1300. #define likely(x) __builtin_expect(!!(x), 1)
  1301. #define unlikely(x) __builtin_expect(!!(x), 0)
  1302. #else /* !__GNUC__ or GCC < 2.95 */
  1303. #define likely(x) (x)
  1304. #define unlikely(x) (x)
  1305. #endif /* __GNUC__ */
  1306. /* PretendToInitialize */
  1307. #ifdef __cplusplus
  1308. #if __cplusplus > 201103L
  1309. #include <type_traits>
  1310. #endif
  1311. template <typename T>
  1312. static void __Pyx_pretend_to_initialize(T* ptr) {
  1313. #if __cplusplus > 201103L
  1314. if ((std::is_trivially_default_constructible<T>::value))
  1315. #endif
  1316. *ptr = T();
  1317. (void)ptr;
  1318. }
  1319. #else
  1320. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  1321. #endif
  1322. #if !CYTHON_USE_MODULE_STATE
  1323. static PyObject *__pyx_m = NULL;
  1324. #endif
  1325. static int __pyx_lineno;
  1326. static int __pyx_clineno = 0;
  1327. static const char * const __pyx_cfilenm = __FILE__;
  1328. static const char *__pyx_filename;
  1329. /* #### Code section: filename_table ### */
  1330. static const char* const __pyx_f[] = {
  1331. "Lib/fontTools/pens/momentsPen.py",
  1332. };
  1333. /* #### Code section: utility_code_proto_before_types ### */
  1334. /* Atomics.proto (used by UnpackUnboundCMethod) */
  1335. #include <pythread.h>
  1336. #ifndef CYTHON_ATOMICS
  1337. #define CYTHON_ATOMICS 1
  1338. #endif
  1339. #define __PYX_CYTHON_ATOMICS_ENABLED() CYTHON_ATOMICS
  1340. #define __PYX_GET_CYTHON_COMPILING_IN_CPYTHON_FREETHREADING() CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  1341. #define __pyx_atomic_int_type int
  1342. #define __pyx_nonatomic_int_type int
  1343. #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
  1344. (__STDC_VERSION__ >= 201112L) &&\
  1345. !defined(__STDC_NO_ATOMICS__))
  1346. #include <stdatomic.h>
  1347. #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
  1348. (__cplusplus >= 201103L) ||\
  1349. (defined(_MSC_VER) && _MSC_VER >= 1700)))
  1350. #include <atomic>
  1351. #endif
  1352. #if CYTHON_ATOMICS && (defined(__STDC_VERSION__) &&\
  1353. (__STDC_VERSION__ >= 201112L) &&\
  1354. !defined(__STDC_NO_ATOMICS__) &&\
  1355. ATOMIC_INT_LOCK_FREE == 2)
  1356. #undef __pyx_atomic_int_type
  1357. #define __pyx_atomic_int_type atomic_int
  1358. #define __pyx_atomic_ptr_type atomic_uintptr_t
  1359. #define __pyx_nonatomic_ptr_type uintptr_t
  1360. #define __pyx_atomic_incr_relaxed(value) atomic_fetch_add_explicit(value, 1, memory_order_relaxed)
  1361. #define __pyx_atomic_incr_acq_rel(value) atomic_fetch_add_explicit(value, 1, memory_order_acq_rel)
  1362. #define __pyx_atomic_decr_acq_rel(value) atomic_fetch_sub_explicit(value, 1, memory_order_acq_rel)
  1363. #define __pyx_atomic_sub(value, arg) atomic_fetch_sub(value, arg)
  1364. #define __pyx_atomic_int_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
  1365. #define __pyx_atomic_load(value) atomic_load(value)
  1366. #define __pyx_atomic_store(value, new_value) atomic_store(value, new_value)
  1367. #define __pyx_atomic_pointer_load_relaxed(value) atomic_load_explicit(value, memory_order_relaxed)
  1368. #define __pyx_atomic_pointer_load_acquire(value) atomic_load_explicit(value, memory_order_acquire)
  1369. #define __pyx_atomic_pointer_exchange(value, new_value) atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
  1370. #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) atomic_compare_exchange_strong(value, expected, desired)
  1371. #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
  1372. #pragma message ("Using standard C atomics")
  1373. #elif defined(__PYX_DEBUG_ATOMICS)
  1374. #warning "Using standard C atomics"
  1375. #endif
  1376. #elif CYTHON_ATOMICS && (defined(__cplusplus) && (\
  1377. (__cplusplus >= 201103L) ||\
  1378. \
  1379. (defined(_MSC_VER) && _MSC_VER >= 1700)) &&\
  1380. ATOMIC_INT_LOCK_FREE == 2)
  1381. #undef __pyx_atomic_int_type
  1382. #define __pyx_atomic_int_type std::atomic_int
  1383. #define __pyx_atomic_ptr_type std::atomic_uintptr_t
  1384. #define __pyx_nonatomic_ptr_type uintptr_t
  1385. #define __pyx_atomic_incr_relaxed(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_relaxed)
  1386. #define __pyx_atomic_incr_acq_rel(value) std::atomic_fetch_add_explicit(value, 1, std::memory_order_acq_rel)
  1387. #define __pyx_atomic_decr_acq_rel(value) std::atomic_fetch_sub_explicit(value, 1, std::memory_order_acq_rel)
  1388. #define __pyx_atomic_sub(value, arg) std::atomic_fetch_sub(value, arg)
  1389. #define __pyx_atomic_int_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
  1390. #define __pyx_atomic_load(value) std::atomic_load(value)
  1391. #define __pyx_atomic_store(value, new_value) std::atomic_store(value, new_value)
  1392. #define __pyx_atomic_pointer_load_relaxed(value) std::atomic_load_explicit(value, std::memory_order_relaxed)
  1393. #define __pyx_atomic_pointer_load_acquire(value) std::atomic_load_explicit(value, std::memory_order_acquire)
  1394. #define __pyx_atomic_pointer_exchange(value, new_value) std::atomic_exchange(value, (__pyx_nonatomic_ptr_type)new_value)
  1395. #define __pyx_atomic_pointer_cmp_exchange(value, expected, desired) std::atomic_compare_exchange_strong(value, expected, desired)
  1396. #if defined(__PYX_DEBUG_ATOMICS) && defined(_MSC_VER)
  1397. #pragma message ("Using standard C++ atomics")
  1398. #elif defined(__PYX_DEBUG_ATOMICS)
  1399. #warning "Using standard C++ atomics"
  1400. #endif
  1401. #elif CYTHON_ATOMICS && (__GNUC__ >= 5 || (__GNUC__ == 4 &&\
  1402. (__GNUC_MINOR__ > 1 ||\
  1403. (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ >= 2))))
  1404. #define __pyx_atomic_ptr_type void*
  1405. #define __pyx_nonatomic_ptr_type void*
  1406. #define __pyx_atomic_incr_relaxed(value) __sync_fetch_and_add(value, 1)
  1407. #define __pyx_atomic_incr_acq_rel(value) __sync_fetch_and_add(value, 1)
  1408. #define __pyx_atomic_decr_acq_rel(value) __sync_fetch_and_sub(value, 1)
  1409. #define __pyx_atomic_sub(value, arg) __sync_fetch_and_sub(value, arg)
  1410. static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
  1411. __pyx_nonatomic_int_type old = __sync_val_compare_and_swap(value, *expected, desired);
  1412. int result = old == *expected;
  1413. *expected = old;
  1414. return result;
  1415. }
  1416. #define __pyx_atomic_load(value) __sync_fetch_and_add(value, 0)
  1417. #define __pyx_atomic_store(value, new_value) __sync_lock_test_and_set(value, new_value)
  1418. #define __pyx_atomic_pointer_load_relaxed(value) __sync_fetch_and_add(value, 0)
  1419. #define __pyx_atomic_pointer_load_acquire(value) __sync_fetch_and_add(value, 0)
  1420. #define __pyx_atomic_pointer_exchange(value, new_value) __sync_lock_test_and_set(value, (__pyx_atomic_ptr_type)new_value)
  1421. static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
  1422. __pyx_nonatomic_ptr_type old = __sync_val_compare_and_swap(value, *expected, desired);
  1423. int result = old == *expected;
  1424. *expected = old;
  1425. return result;
  1426. }
  1427. #ifdef __PYX_DEBUG_ATOMICS
  1428. #warning "Using GNU atomics"
  1429. #endif
  1430. #elif CYTHON_ATOMICS && defined(_MSC_VER)
  1431. #include <intrin.h>
  1432. #undef __pyx_atomic_int_type
  1433. #define __pyx_atomic_int_type long
  1434. #define __pyx_atomic_ptr_type void*
  1435. #undef __pyx_nonatomic_int_type
  1436. #define __pyx_nonatomic_int_type long
  1437. #define __pyx_nonatomic_ptr_type void*
  1438. #pragma intrinsic (_InterlockedExchangeAdd, _InterlockedExchange, _InterlockedCompareExchange, _InterlockedCompareExchangePointer, _InterlockedExchangePointer)
  1439. #define __pyx_atomic_incr_relaxed(value) _InterlockedExchangeAdd(value, 1)
  1440. #define __pyx_atomic_incr_acq_rel(value) _InterlockedExchangeAdd(value, 1)
  1441. #define __pyx_atomic_decr_acq_rel(value) _InterlockedExchangeAdd(value, -1)
  1442. #define __pyx_atomic_sub(value, arg) _InterlockedExchangeAdd(value, -arg)
  1443. static CYTHON_INLINE int __pyx_atomic_int_cmp_exchange(__pyx_atomic_int_type* value, __pyx_nonatomic_int_type* expected, __pyx_nonatomic_int_type desired) {
  1444. __pyx_nonatomic_int_type old = _InterlockedCompareExchange(value, desired, *expected);
  1445. int result = old == *expected;
  1446. *expected = old;
  1447. return result;
  1448. }
  1449. #define __pyx_atomic_load(value) _InterlockedExchangeAdd(value, 0)
  1450. #define __pyx_atomic_store(value, new_value) _InterlockedExchange(value, new_value)
  1451. #define __pyx_atomic_pointer_load_relaxed(value) *(void * volatile *)value
  1452. #define __pyx_atomic_pointer_load_acquire(value) _InterlockedCompareExchangePointer(value, 0, 0)
  1453. #define __pyx_atomic_pointer_exchange(value, new_value) _InterlockedExchangePointer(value, (__pyx_atomic_ptr_type)new_value)
  1454. static CYTHON_INLINE int __pyx_atomic_pointer_cmp_exchange(__pyx_atomic_ptr_type* value, __pyx_nonatomic_ptr_type* expected, __pyx_nonatomic_ptr_type desired) {
  1455. __pyx_atomic_ptr_type old = _InterlockedCompareExchangePointer(value, desired, *expected);
  1456. int result = old == *expected;
  1457. *expected = old;
  1458. return result;
  1459. }
  1460. #ifdef __PYX_DEBUG_ATOMICS
  1461. #pragma message ("Using MSVC atomics")
  1462. #endif
  1463. #else
  1464. #undef CYTHON_ATOMICS
  1465. #define CYTHON_ATOMICS 0
  1466. #ifdef __PYX_DEBUG_ATOMICS
  1467. #warning "Not using atomics"
  1468. #endif
  1469. #endif
  1470. /* CriticalSectionsDefinition.proto (used by CriticalSections) */
  1471. #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  1472. #define __Pyx_PyCriticalSection void*
  1473. #define __Pyx_PyCriticalSection2 void*
  1474. #define __Pyx_PyCriticalSection_End(cs)
  1475. #define __Pyx_PyCriticalSection2_End(cs)
  1476. #else
  1477. #define __Pyx_PyCriticalSection PyCriticalSection
  1478. #define __Pyx_PyCriticalSection2 PyCriticalSection2
  1479. #define __Pyx_PyCriticalSection_End PyCriticalSection_End
  1480. #define __Pyx_PyCriticalSection2_End PyCriticalSection2_End
  1481. #endif
  1482. /* CriticalSections.proto (used by ParseKeywordsImpl) */
  1483. #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  1484. #define __Pyx_PyCriticalSection_Begin(cs, arg) (void)(cs)
  1485. #define __Pyx_PyCriticalSection2_Begin(cs, arg1, arg2) (void)(cs)
  1486. #else
  1487. #define __Pyx_PyCriticalSection_Begin PyCriticalSection_Begin
  1488. #define __Pyx_PyCriticalSection2_Begin PyCriticalSection2_Begin
  1489. #endif
  1490. #if PY_VERSION_HEX < 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
  1491. #define __Pyx_BEGIN_CRITICAL_SECTION(o) {
  1492. #define __Pyx_END_CRITICAL_SECTION() }
  1493. #else
  1494. #define __Pyx_BEGIN_CRITICAL_SECTION Py_BEGIN_CRITICAL_SECTION
  1495. #define __Pyx_END_CRITICAL_SECTION Py_END_CRITICAL_SECTION
  1496. #endif
  1497. /* IncludeStructmemberH.proto (used by FixUpExtensionType) */
  1498. #include <structmember.h>
  1499. /* #### Code section: numeric_typedefs ### */
  1500. /* #### Code section: complex_type_declarations ### */
  1501. /* #### Code section: type_declarations ### */
  1502. /*--- Type declarations ---*/
  1503. /* #### Code section: utility_code_proto ### */
  1504. /* --- Runtime support code (head) --- */
  1505. /* Refnanny.proto */
  1506. #ifndef CYTHON_REFNANNY
  1507. #define CYTHON_REFNANNY 0
  1508. #endif
  1509. #if CYTHON_REFNANNY
  1510. typedef struct {
  1511. void (*INCREF)(void*, PyObject*, Py_ssize_t);
  1512. void (*DECREF)(void*, PyObject*, Py_ssize_t);
  1513. void (*GOTREF)(void*, PyObject*, Py_ssize_t);
  1514. void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
  1515. void* (*SetupContext)(const char*, Py_ssize_t, const char*);
  1516. void (*FinishContext)(void**);
  1517. } __Pyx_RefNannyAPIStruct;
  1518. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  1519. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  1520. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  1521. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1522. if (acquire_gil) {\
  1523. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1524. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
  1525. PyGILState_Release(__pyx_gilstate_save);\
  1526. } else {\
  1527. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
  1528. }
  1529. #define __Pyx_RefNannyFinishContextNogil() {\
  1530. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1531. __Pyx_RefNannyFinishContext();\
  1532. PyGILState_Release(__pyx_gilstate_save);\
  1533. }
  1534. #define __Pyx_RefNannyFinishContextNogil() {\
  1535. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1536. __Pyx_RefNannyFinishContext();\
  1537. PyGILState_Release(__pyx_gilstate_save);\
  1538. }
  1539. #define __Pyx_RefNannyFinishContext()\
  1540. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  1541. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1542. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1543. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1544. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1545. #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  1546. #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  1547. #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  1548. #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
  1549. #else
  1550. #define __Pyx_RefNannyDeclarations
  1551. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  1552. #define __Pyx_RefNannyFinishContextNogil()
  1553. #define __Pyx_RefNannyFinishContext()
  1554. #define __Pyx_INCREF(r) Py_INCREF(r)
  1555. #define __Pyx_DECREF(r) Py_DECREF(r)
  1556. #define __Pyx_GOTREF(r)
  1557. #define __Pyx_GIVEREF(r)
  1558. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  1559. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  1560. #define __Pyx_XGOTREF(r)
  1561. #define __Pyx_XGIVEREF(r)
  1562. #endif
  1563. #define __Pyx_Py_XDECREF_SET(r, v) do {\
  1564. PyObject *tmp = (PyObject *) r;\
  1565. r = v; Py_XDECREF(tmp);\
  1566. } while (0)
  1567. #define __Pyx_XDECREF_SET(r, v) do {\
  1568. PyObject *tmp = (PyObject *) r;\
  1569. r = v; __Pyx_XDECREF(tmp);\
  1570. } while (0)
  1571. #define __Pyx_DECREF_SET(r, v) do {\
  1572. PyObject *tmp = (PyObject *) r;\
  1573. r = v; __Pyx_DECREF(tmp);\
  1574. } while (0)
  1575. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  1576. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  1577. /* TupleAndListFromArray.proto (used by fastcall) */
  1578. #if CYTHON_COMPILING_IN_CPYTHON
  1579. static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
  1580. #endif
  1581. #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_METH_FASTCALL
  1582. static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
  1583. #endif
  1584. /* IncludeStringH.proto (used by BytesEquals) */
  1585. #include <string.h>
  1586. /* BytesEquals.proto (used by UnicodeEquals) */
  1587. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
  1588. /* UnicodeEquals.proto (used by fastcall) */
  1589. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
  1590. /* fastcall.proto */
  1591. #if CYTHON_AVOID_BORROWED_REFS
  1592. #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_PySequence_ITEM(args, i)
  1593. #elif CYTHON_ASSUME_SAFE_MACROS
  1594. #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_NewRef(__Pyx_PyTuple_GET_ITEM(args, i))
  1595. #else
  1596. #define __Pyx_ArgRef_VARARGS(args, i) __Pyx_XNewRef(PyTuple_GetItem(args, i))
  1597. #endif
  1598. #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
  1599. #define __Pyx_KwValues_VARARGS(args, nargs) NULL
  1600. #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
  1601. #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
  1602. #if CYTHON_METH_FASTCALL
  1603. #define __Pyx_ArgRef_FASTCALL(args, i) __Pyx_NewRef(args[i])
  1604. #define __Pyx_NumKwargs_FASTCALL(kwds) __Pyx_PyTuple_GET_SIZE(kwds)
  1605. #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
  1606. static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  1607. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
  1608. CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  1609. #else
  1610. #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  1611. #endif
  1612. #else
  1613. #define __Pyx_ArgRef_FASTCALL __Pyx_ArgRef_VARARGS
  1614. #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
  1615. #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
  1616. #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
  1617. #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
  1618. #endif
  1619. #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
  1620. #if CYTHON_METH_FASTCALL || (CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  1621. #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(args + start, stop - start)
  1622. #else
  1623. #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
  1624. #endif
  1625. /* py_dict_items.proto (used by OwnedDictNext) */
  1626. static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d);
  1627. /* CallCFunction.proto (used by CallUnboundCMethod0) */
  1628. #define __Pyx_CallCFunction(cfunc, self, args)\
  1629. ((PyCFunction)(void(*)(void))(cfunc)->func)(self, args)
  1630. #define __Pyx_CallCFunctionWithKeywords(cfunc, self, args, kwargs)\
  1631. ((PyCFunctionWithKeywords)(void(*)(void))(cfunc)->func)(self, args, kwargs)
  1632. #define __Pyx_CallCFunctionFast(cfunc, self, args, nargs)\
  1633. ((__Pyx_PyCFunctionFast)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs)
  1634. #define __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, nargs, kwnames)\
  1635. ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))(PyCFunction)(cfunc)->func)(self, args, nargs, kwnames)
  1636. /* PyObjectCall.proto (used by PyObjectFastCall) */
  1637. #if CYTHON_COMPILING_IN_CPYTHON
  1638. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  1639. #else
  1640. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  1641. #endif
  1642. /* PyObjectCallMethO.proto (used by PyObjectFastCall) */
  1643. #if CYTHON_COMPILING_IN_CPYTHON
  1644. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  1645. #endif
  1646. /* PyObjectFastCall.proto (used by PyObjectCallOneArg) */
  1647. #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
  1648. static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs);
  1649. /* PyObjectCallOneArg.proto (used by CallUnboundCMethod0) */
  1650. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  1651. /* PyObjectGetAttrStr.proto (used by UnpackUnboundCMethod) */
  1652. #if CYTHON_USE_TYPE_SLOTS
  1653. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  1654. #else
  1655. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  1656. #endif
  1657. /* UnpackUnboundCMethod.proto (used by CallUnboundCMethod0) */
  1658. typedef struct {
  1659. PyObject *type;
  1660. PyObject **method_name;
  1661. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && CYTHON_ATOMICS
  1662. __pyx_atomic_int_type initialized;
  1663. #endif
  1664. PyCFunction func;
  1665. PyObject *method;
  1666. int flag;
  1667. } __Pyx_CachedCFunction;
  1668. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  1669. static CYTHON_INLINE int __Pyx_CachedCFunction_GetAndSetInitializing(__Pyx_CachedCFunction *cfunc) {
  1670. #if !CYTHON_ATOMICS
  1671. return 1;
  1672. #else
  1673. __pyx_nonatomic_int_type expected = 0;
  1674. if (__pyx_atomic_int_cmp_exchange(&cfunc->initialized, &expected, 1)) {
  1675. return 0;
  1676. }
  1677. return expected;
  1678. #endif
  1679. }
  1680. static CYTHON_INLINE void __Pyx_CachedCFunction_SetFinishedInitializing(__Pyx_CachedCFunction *cfunc) {
  1681. #if CYTHON_ATOMICS
  1682. __pyx_atomic_store(&cfunc->initialized, 2);
  1683. #endif
  1684. }
  1685. #else
  1686. #define __Pyx_CachedCFunction_GetAndSetInitializing(cfunc) 2
  1687. #define __Pyx_CachedCFunction_SetFinishedInitializing(cfunc)
  1688. #endif
  1689. /* CallUnboundCMethod0.proto */
  1690. CYTHON_UNUSED
  1691. static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
  1692. #if CYTHON_COMPILING_IN_CPYTHON
  1693. static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
  1694. #else
  1695. #define __Pyx_CallUnboundCMethod0(cfunc, self) __Pyx__CallUnboundCMethod0(cfunc, self)
  1696. #endif
  1697. /* py_dict_values.proto (used by OwnedDictNext) */
  1698. static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d);
  1699. /* OwnedDictNext.proto (used by ParseKeywordsImpl) */
  1700. #if CYTHON_AVOID_BORROWED_REFS
  1701. static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue);
  1702. #else
  1703. CYTHON_INLINE
  1704. static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue);
  1705. #endif
  1706. /* RaiseDoubleKeywords.proto (used by ParseKeywordsImpl) */
  1707. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  1708. /* ParseKeywordsImpl.export */
  1709. static int __Pyx_ParseKeywordsTuple(
  1710. PyObject *kwds,
  1711. PyObject * const *kwvalues,
  1712. PyObject ** const argnames[],
  1713. PyObject *kwds2,
  1714. PyObject *values[],
  1715. Py_ssize_t num_pos_args,
  1716. Py_ssize_t num_kwargs,
  1717. const char* function_name,
  1718. int ignore_unknown_kwargs
  1719. );
  1720. static int __Pyx_ParseKeywordDictToDict(
  1721. PyObject *kwds,
  1722. PyObject ** const argnames[],
  1723. PyObject *kwds2,
  1724. PyObject *values[],
  1725. Py_ssize_t num_pos_args,
  1726. const char* function_name
  1727. );
  1728. static int __Pyx_ParseKeywordDict(
  1729. PyObject *kwds,
  1730. PyObject ** const argnames[],
  1731. PyObject *values[],
  1732. Py_ssize_t num_pos_args,
  1733. Py_ssize_t num_kwargs,
  1734. const char* function_name,
  1735. int ignore_unknown_kwargs
  1736. );
  1737. /* CallUnboundCMethod2.proto */
  1738. CYTHON_UNUSED
  1739. static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
  1740. #if CYTHON_COMPILING_IN_CPYTHON
  1741. static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
  1742. #else
  1743. #define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2) __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
  1744. #endif
  1745. /* ParseKeywords.proto */
  1746. static CYTHON_INLINE int __Pyx_ParseKeywords(
  1747. PyObject *kwds, PyObject *const *kwvalues, PyObject ** const argnames[],
  1748. PyObject *kwds2, PyObject *values[],
  1749. Py_ssize_t num_pos_args, Py_ssize_t num_kwargs,
  1750. const char* function_name,
  1751. int ignore_unknown_kwargs
  1752. );
  1753. /* RaiseArgTupleInvalid.proto */
  1754. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  1755. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  1756. /* PyErrExceptionMatches.proto (used by PyObjectGetAttrStrNoError) */
  1757. #if CYTHON_FAST_THREAD_STATE
  1758. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1759. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1760. #else
  1761. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1762. #endif
  1763. /* PyThreadStateGet.proto (used by PyErrFetchRestore) */
  1764. #if CYTHON_FAST_THREAD_STATE
  1765. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  1766. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  1767. #if PY_VERSION_HEX >= 0x030C00A6
  1768. #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
  1769. #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
  1770. #else
  1771. #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
  1772. #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
  1773. #endif
  1774. #else
  1775. #define __Pyx_PyThreadState_declare
  1776. #define __Pyx_PyThreadState_assign
  1777. #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
  1778. #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
  1779. #endif
  1780. /* PyErrFetchRestore.proto (used by PyObjectGetAttrStrNoError) */
  1781. #if CYTHON_FAST_THREAD_STATE
  1782. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  1783. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  1784. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  1785. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  1786. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  1787. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1788. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1789. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
  1790. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  1791. #else
  1792. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1793. #endif
  1794. #else
  1795. #define __Pyx_PyErr_Clear() PyErr_Clear()
  1796. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1797. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  1798. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  1799. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  1800. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  1801. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  1802. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  1803. #endif
  1804. /* PyObjectGetAttrStrNoError.proto (used by GetBuiltinName) */
  1805. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
  1806. /* GetBuiltinName.proto (used by GetModuleGlobalName) */
  1807. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  1808. /* PyDictVersioning.proto (used by GetModuleGlobalName) */
  1809. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  1810. #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
  1811. #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
  1812. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
  1813. (version_var) = __PYX_GET_DICT_VERSION(dict);\
  1814. (cache_var) = (value);
  1815. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
  1816. static PY_UINT64_T __pyx_dict_version = 0;\
  1817. static PyObject *__pyx_dict_cached_value = NULL;\
  1818. if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
  1819. (VAR) = __Pyx_XNewRef(__pyx_dict_cached_value);\
  1820. } else {\
  1821. (VAR) = __pyx_dict_cached_value = (LOOKUP);\
  1822. __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
  1823. }\
  1824. }
  1825. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
  1826. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
  1827. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
  1828. #else
  1829. #define __PYX_GET_DICT_VERSION(dict) (0)
  1830. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
  1831. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
  1832. #endif
  1833. /* GetModuleGlobalName.proto */
  1834. #if CYTHON_USE_DICT_VERSIONS
  1835. #define __Pyx_GetModuleGlobalName(var, name) do {\
  1836. static PY_UINT64_T __pyx_dict_version = 0;\
  1837. static PyObject *__pyx_dict_cached_value = NULL;\
  1838. (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_mstate_global->__pyx_d))) ?\
  1839. (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
  1840. __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1841. } while(0)
  1842. #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
  1843. PY_UINT64_T __pyx_dict_version;\
  1844. PyObject *__pyx_dict_cached_value;\
  1845. (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1846. } while(0)
  1847. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
  1848. #else
  1849. #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1850. #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1851. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
  1852. #endif
  1853. /* PyObjectDelAttr.proto (used by PyObjectSetAttrStr) */
  1854. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  1855. #define __Pyx_PyObject_DelAttr(o, n) PyObject_SetAttr(o, n, NULL)
  1856. #else
  1857. #define __Pyx_PyObject_DelAttr(o, n) PyObject_DelAttr(o, n)
  1858. #endif
  1859. /* PyObjectSetAttrStr.proto */
  1860. #if CYTHON_USE_TYPE_SLOTS
  1861. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
  1862. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
  1863. #else
  1864. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_DelAttr(o,n)
  1865. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  1866. #endif
  1867. /* PyObjectFastCallMethod.proto */
  1868. #if CYTHON_VECTORCALL && PY_VERSION_HEX >= 0x03090000
  1869. #define __Pyx_PyObject_FastCallMethod(name, args, nargsf) PyObject_VectorcallMethod(name, args, nargsf, NULL)
  1870. #else
  1871. static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf);
  1872. #endif
  1873. /* RaiseException.export */
  1874. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  1875. /* RaiseTooManyValuesToUnpack.proto */
  1876. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  1877. /* RaiseNeedMoreValuesToUnpack.proto */
  1878. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  1879. /* IterFinish.proto */
  1880. static CYTHON_INLINE int __Pyx_IterFinish(void);
  1881. /* UnpackItemEndCheck.proto */
  1882. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
  1883. /* HasAttr.proto (used by ImportImpl) */
  1884. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  1885. #define __Pyx_HasAttr(o, n) PyObject_HasAttrWithError(o, n)
  1886. #else
  1887. static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
  1888. #endif
  1889. /* ImportImpl.export */
  1890. static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level);
  1891. /* Import.proto */
  1892. static CYTHON_INLINE PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level);
  1893. /* ImportFrom.proto */
  1894. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  1895. /* ListPack.proto */
  1896. static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...);
  1897. /* Py3UpdateBases.proto */
  1898. static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
  1899. /* CalculateMetaclass.proto */
  1900. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  1901. /* dict_setdefault.proto (used by FetchCommonType) */
  1902. static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value);
  1903. /* LimitedApiGetTypeDict.proto (used by SetItemOnTypeDict) */
  1904. #if CYTHON_COMPILING_IN_LIMITED_API
  1905. static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp);
  1906. #endif
  1907. /* SetItemOnTypeDict.proto (used by FixUpExtensionType) */
  1908. static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v);
  1909. #define __Pyx_SetItemOnTypeDict(tp, k, v) __Pyx__SetItemOnTypeDict((PyTypeObject*)tp, k, v)
  1910. /* FixUpExtensionType.proto (used by FetchCommonType) */
  1911. static CYTHON_INLINE int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
  1912. /* AddModuleRef.proto (used by FetchSharedCythonModule) */
  1913. #if ((CYTHON_COMPILING_IN_CPYTHON_FREETHREADING ) ||\
  1914. __PYX_LIMITED_VERSION_HEX < 0x030d0000)
  1915. static PyObject *__Pyx_PyImport_AddModuleRef(const char *name);
  1916. #else
  1917. #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
  1918. #endif
  1919. /* FetchSharedCythonModule.proto (used by FetchCommonType) */
  1920. static PyObject *__Pyx_FetchSharedCythonABIModule(void);
  1921. /* FetchCommonType.proto (used by CommonTypesMetaclass) */
  1922. static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases);
  1923. /* CommonTypesMetaclass.proto (used by CythonFunctionShared) */
  1924. static int __pyx_CommonTypesMetaclass_init(PyObject *module);
  1925. #define __Pyx_CommonTypesMetaclass_USED
  1926. /* CallTypeTraverse.proto (used by CythonFunctionShared) */
  1927. #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
  1928. #define __Pyx_call_type_traverse(o, always_call, visit, arg) 0
  1929. #else
  1930. static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg);
  1931. #endif
  1932. /* PyMethodNew.proto (used by CythonFunctionShared) */
  1933. static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ);
  1934. /* PyVectorcallFastCallDict.proto (used by CythonFunctionShared) */
  1935. #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  1936. static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
  1937. #endif
  1938. /* CythonFunctionShared.proto (used by CythonFunction) */
  1939. #define __Pyx_CyFunction_USED
  1940. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  1941. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  1942. #define __Pyx_CYFUNCTION_CCLASS 0x04
  1943. #define __Pyx_CYFUNCTION_COROUTINE 0x08
  1944. #define __Pyx_CyFunction_GetClosure(f)\
  1945. (((__pyx_CyFunctionObject *) (f))->func_closure)
  1946. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  1947. #define __Pyx_CyFunction_GetClassObj(f)\
  1948. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  1949. #else
  1950. #define __Pyx_CyFunction_GetClassObj(f)\
  1951. ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
  1952. #endif
  1953. #define __Pyx_CyFunction_SetClassObj(f, classobj)\
  1954. __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
  1955. #define __Pyx_CyFunction_Defaults(type, f)\
  1956. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  1957. #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
  1958. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  1959. typedef struct {
  1960. #if CYTHON_COMPILING_IN_LIMITED_API
  1961. PyObject_HEAD
  1962. PyObject *func;
  1963. #elif PY_VERSION_HEX < 0x030900B1
  1964. PyCFunctionObject func;
  1965. #else
  1966. PyCMethodObject func;
  1967. #endif
  1968. #if CYTHON_COMPILING_IN_LIMITED_API && CYTHON_METH_FASTCALL
  1969. __pyx_vectorcallfunc func_vectorcall;
  1970. #endif
  1971. #if CYTHON_COMPILING_IN_LIMITED_API
  1972. PyObject *func_weakreflist;
  1973. #endif
  1974. #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
  1975. PyObject *func_dict;
  1976. #endif
  1977. PyObject *func_name;
  1978. PyObject *func_qualname;
  1979. PyObject *func_doc;
  1980. PyObject *func_globals;
  1981. PyObject *func_code;
  1982. PyObject *func_closure;
  1983. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  1984. PyObject *func_classobj;
  1985. #endif
  1986. PyObject *defaults;
  1987. int flags;
  1988. PyObject *defaults_tuple;
  1989. PyObject *defaults_kwdict;
  1990. PyObject *(*defaults_getter)(PyObject *);
  1991. PyObject *func_annotations;
  1992. PyObject *func_is_coroutine;
  1993. } __pyx_CyFunctionObject;
  1994. #undef __Pyx_CyOrPyCFunction_Check
  1995. #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_mstate_global->__pyx_CyFunctionType)
  1996. #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_mstate_global->__pyx_CyFunctionType, &PyCFunction_Type)
  1997. #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_mstate_global->__pyx_CyFunctionType)
  1998. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void));
  1999. #undef __Pyx_IsSameCFunction
  2000. #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
  2001. static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
  2002. int flags, PyObject* qualname,
  2003. PyObject *closure,
  2004. PyObject *module, PyObject *globals,
  2005. PyObject* code);
  2006. static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
  2007. static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func,
  2008. PyTypeObject *defaults_type);
  2009. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  2010. PyObject *tuple);
  2011. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  2012. PyObject *dict);
  2013. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  2014. PyObject *dict);
  2015. static int __pyx_CyFunction_init(PyObject *module);
  2016. #if CYTHON_METH_FASTCALL
  2017. static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  2018. static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  2019. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  2020. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  2021. #if CYTHON_COMPILING_IN_LIMITED_API
  2022. #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
  2023. #else
  2024. #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
  2025. #endif
  2026. #endif
  2027. /* CythonFunction.proto */
  2028. static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
  2029. int flags, PyObject* qualname,
  2030. PyObject *closure,
  2031. PyObject *module, PyObject *globals,
  2032. PyObject* code);
  2033. /* SetNameInClass.proto */
  2034. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000
  2035. #define __Pyx_SetNameInClass(ns, name, value)\
  2036. (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
  2037. #elif CYTHON_COMPILING_IN_CPYTHON
  2038. #define __Pyx_SetNameInClass(ns, name, value)\
  2039. (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
  2040. #else
  2041. #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
  2042. #endif
  2043. /* PyObjectCall2Args.proto (used by Py3ClassCreate) */
  2044. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
  2045. /* PyObjectLookupSpecial.proto (used by Py3ClassCreate) */
  2046. #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  2047. #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
  2048. #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
  2049. static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
  2050. #else
  2051. #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
  2052. #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
  2053. #endif
  2054. /* Py3ClassCreate.proto */
  2055. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  2056. PyObject *mkw, PyObject *modname, PyObject *doc);
  2057. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  2058. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
  2059. /* CLineInTraceback.proto (used by AddTraceback) */
  2060. #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  2061. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  2062. #else
  2063. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  2064. #endif
  2065. /* CodeObjectCache.proto (used by AddTraceback) */
  2066. #if CYTHON_COMPILING_IN_LIMITED_API
  2067. typedef PyObject __Pyx_CachedCodeObjectType;
  2068. #else
  2069. typedef PyCodeObject __Pyx_CachedCodeObjectType;
  2070. #endif
  2071. typedef struct {
  2072. __Pyx_CachedCodeObjectType* code_object;
  2073. int code_line;
  2074. } __Pyx_CodeObjectCacheEntry;
  2075. struct __Pyx_CodeObjectCache {
  2076. int count;
  2077. int max_count;
  2078. __Pyx_CodeObjectCacheEntry* entries;
  2079. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  2080. __pyx_atomic_int_type accessor_count;
  2081. #endif
  2082. };
  2083. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  2084. static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line);
  2085. static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object);
  2086. /* AddTraceback.proto */
  2087. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  2088. int py_line, const char *filename);
  2089. /* FormatTypeName.proto */
  2090. #if CYTHON_COMPILING_IN_LIMITED_API
  2091. typedef PyObject *__Pyx_TypeName;
  2092. #define __Pyx_FMT_TYPENAME "%U"
  2093. #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
  2094. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  2095. #define __Pyx_PyType_GetFullyQualifiedName PyType_GetFullyQualifiedName
  2096. #else
  2097. static __Pyx_TypeName __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp);
  2098. #endif
  2099. #else // !LIMITED_API
  2100. typedef const char *__Pyx_TypeName;
  2101. #define __Pyx_FMT_TYPENAME "%.200s"
  2102. #define __Pyx_PyType_GetFullyQualifiedName(tp) ((tp)->tp_name)
  2103. #define __Pyx_DECREF_TypeName(obj)
  2104. #endif
  2105. /* GCCDiagnostics.proto (used by CIntToPy) */
  2106. #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  2107. #define __Pyx_HAS_GCC_DIAGNOSTIC
  2108. #endif
  2109. /* PyObjectVectorCallKwBuilder.proto (used by CIntToPy) */
  2110. CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
  2111. #if CYTHON_VECTORCALL
  2112. #if PY_VERSION_HEX >= 0x03090000
  2113. #define __Pyx_Object_Vectorcall_CallFromBuilder PyObject_Vectorcall
  2114. #else
  2115. #define __Pyx_Object_Vectorcall_CallFromBuilder _PyObject_Vectorcall
  2116. #endif
  2117. #define __Pyx_MakeVectorcallBuilderKwds(n) PyTuple_New(n)
  2118. static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n);
  2119. static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n);
  2120. #else
  2121. #define __Pyx_Object_Vectorcall_CallFromBuilder __Pyx_PyObject_FastCallDict
  2122. #define __Pyx_MakeVectorcallBuilderKwds(n) __Pyx_PyDict_NewPresized(n)
  2123. #define __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n) PyDict_SetItem(builder, key, value)
  2124. #define __Pyx_VectorcallBuilder_AddArgStr(key, value, builder, args, n) PyDict_SetItemString(builder, key, value)
  2125. #endif
  2126. /* CIntToPy.proto */
  2127. static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value);
  2128. /* CIntFromPy.proto */
  2129. static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *);
  2130. /* CIntFromPy.proto */
  2131. static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *);
  2132. /* FastTypeChecks.proto */
  2133. #if CYTHON_COMPILING_IN_CPYTHON
  2134. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  2135. #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
  2136. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  2137. static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
  2138. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  2139. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  2140. #else
  2141. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  2142. #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
  2143. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  2144. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2) {
  2145. return PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2);
  2146. }
  2147. #endif
  2148. #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
  2149. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  2150. #ifdef PyExceptionInstance_Check
  2151. #define __Pyx_PyBaseException_Check(obj) PyExceptionInstance_Check(obj)
  2152. #else
  2153. #define __Pyx_PyBaseException_Check(obj) __Pyx_TypeCheck(obj, PyExc_BaseException)
  2154. #endif
  2155. /* GetRuntimeVersion.proto */
  2156. #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  2157. static unsigned long __Pyx_cached_runtime_version = 0;
  2158. static void __Pyx_init_runtime_version(void);
  2159. #else
  2160. #define __Pyx_init_runtime_version()
  2161. #endif
  2162. static unsigned long __Pyx_get_runtime_version(void);
  2163. /* CheckBinaryVersion.proto */
  2164. static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
  2165. /* DecompressString.proto */
  2166. static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo);
  2167. /* MultiPhaseInitModuleState.proto */
  2168. #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
  2169. static PyObject *__Pyx_State_FindModule(void*);
  2170. static int __Pyx_State_AddModule(PyObject* module, void*);
  2171. static int __Pyx_State_RemoveModule(void*);
  2172. #elif CYTHON_USE_MODULE_STATE
  2173. #define __Pyx_State_FindModule PyState_FindModule
  2174. #define __Pyx_State_AddModule PyState_AddModule
  2175. #define __Pyx_State_RemoveModule PyState_RemoveModule
  2176. #endif
  2177. /* #### Code section: module_declarations ### */
  2178. /* CythonABIVersion.proto */
  2179. #if CYTHON_COMPILING_IN_LIMITED_API
  2180. #if CYTHON_METH_FASTCALL
  2181. #define __PYX_FASTCALL_ABI_SUFFIX "_fastcall"
  2182. #else
  2183. #define __PYX_FASTCALL_ABI_SUFFIX
  2184. #endif
  2185. #define __PYX_LIMITED_ABI_SUFFIX "limited" __PYX_FASTCALL_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
  2186. #else
  2187. #define __PYX_LIMITED_ABI_SUFFIX
  2188. #endif
  2189. #if __PYX_HAS_PY_AM_SEND == 1
  2190. #define __PYX_AM_SEND_ABI_SUFFIX
  2191. #elif __PYX_HAS_PY_AM_SEND == 2
  2192. #define __PYX_AM_SEND_ABI_SUFFIX "amsendbackport"
  2193. #else
  2194. #define __PYX_AM_SEND_ABI_SUFFIX "noamsend"
  2195. #endif
  2196. #ifndef __PYX_MONITORING_ABI_SUFFIX
  2197. #define __PYX_MONITORING_ABI_SUFFIX
  2198. #endif
  2199. #if CYTHON_USE_TP_FINALIZE
  2200. #define __PYX_TP_FINALIZE_ABI_SUFFIX
  2201. #else
  2202. #define __PYX_TP_FINALIZE_ABI_SUFFIX "nofinalize"
  2203. #endif
  2204. #if CYTHON_USE_FREELISTS || !defined(__Pyx_AsyncGen_USED)
  2205. #define __PYX_FREELISTS_ABI_SUFFIX
  2206. #else
  2207. #define __PYX_FREELISTS_ABI_SUFFIX "nofreelists"
  2208. #endif
  2209. #define CYTHON_ABI __PYX_ABI_VERSION __PYX_LIMITED_ABI_SUFFIX __PYX_MONITORING_ABI_SUFFIX __PYX_TP_FINALIZE_ABI_SUFFIX __PYX_FREELISTS_ABI_SUFFIX __PYX_AM_SEND_ABI_SUFFIX
  2210. #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
  2211. #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
  2212. /* Module declarations from "cython" */
  2213. /* Module declarations from "fontTools.pens.momentsPen" */
  2214. /* #### Code section: typeinfo ### */
  2215. /* #### Code section: before_global_var ### */
  2216. #define __Pyx_MODULE_NAME "fontTools.pens.momentsPen"
  2217. extern int __pyx_module_is_main_fontTools__pens__momentsPen;
  2218. int __pyx_module_is_main_fontTools__pens__momentsPen = 0;
  2219. /* Implementation of "fontTools.pens.momentsPen" */
  2220. /* #### Code section: global_var ### */
  2221. /* #### Code section: string_decls ### */
  2222. /* #### Code section: decls ### */
  2223. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_glyphset); /* proto */
  2224. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p0); /* proto */
  2225. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
  2226. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
  2227. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1); /* proto */
  2228. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2); /* proto */
  2229. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3); /* proto */
  2230. /* #### Code section: late_includes ### */
  2231. /* #### Code section: module_state ### */
  2232. /* SmallCodeConfig */
  2233. #ifndef CYTHON_SMALL_CODE
  2234. #if defined(__clang__)
  2235. #define CYTHON_SMALL_CODE
  2236. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  2237. #define CYTHON_SMALL_CODE __attribute__((cold))
  2238. #else
  2239. #define CYTHON_SMALL_CODE
  2240. #endif
  2241. #endif
  2242. typedef struct {
  2243. PyObject *__pyx_d;
  2244. PyObject *__pyx_b;
  2245. PyObject *__pyx_cython_runtime;
  2246. PyObject *__pyx_empty_tuple;
  2247. PyObject *__pyx_empty_bytes;
  2248. PyObject *__pyx_empty_unicode;
  2249. __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_items;
  2250. __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_pop;
  2251. __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_values;
  2252. PyObject *__pyx_tuple[2];
  2253. PyObject *__pyx_codeobj_tab[7];
  2254. PyObject *__pyx_string_tab[210];
  2255. PyObject *__pyx_number_tab[3];
  2256. /* #### Code section: module_state_contents ### */
  2257. /* CommonTypesMetaclass.module_state_decls */
  2258. PyTypeObject *__pyx_CommonTypesMetaclassType;
  2259. /* CachedMethodType.module_state_decls */
  2260. #if CYTHON_COMPILING_IN_LIMITED_API
  2261. PyObject *__Pyx_CachedMethodType;
  2262. #endif
  2263. /* CythonFunctionShared.module_state_decls */
  2264. PyTypeObject *__pyx_CyFunctionType;
  2265. /* CodeObjectCache.module_state_decls */
  2266. struct __Pyx_CodeObjectCache __pyx_code_cache;
  2267. /* #### Code section: module_state_end ### */
  2268. } __pyx_mstatetype;
  2269. #if CYTHON_USE_MODULE_STATE
  2270. #ifdef __cplusplus
  2271. namespace {
  2272. extern struct PyModuleDef __pyx_moduledef;
  2273. } /* anonymous namespace */
  2274. #else
  2275. static struct PyModuleDef __pyx_moduledef;
  2276. #endif
  2277. #define __pyx_mstate_global (__Pyx_PyModule_GetState(__Pyx_State_FindModule(&__pyx_moduledef)))
  2278. #define __pyx_m (__Pyx_State_FindModule(&__pyx_moduledef))
  2279. #else
  2280. static __pyx_mstatetype __pyx_mstate_global_static =
  2281. #ifdef __cplusplus
  2282. {};
  2283. #else
  2284. {0};
  2285. #endif
  2286. static __pyx_mstatetype * const __pyx_mstate_global = &__pyx_mstate_global_static;
  2287. #endif
  2288. /* #### Code section: constant_name_defines ### */
  2289. #define __pyx_kp_u_ __pyx_string_tab[0]
  2290. #define __pyx_kp_u_Glyph_statistics_is_not_defined __pyx_string_tab[1]
  2291. #define __pyx_kp_u_Lib_fontTools_pens_momentsPen_py __pyx_string_tab[2]
  2292. #define __pyx_kp_u__2 __pyx_string_tab[3]
  2293. #define __pyx_n_u_BasePen __pyx_string_tab[4]
  2294. #define __pyx_n_u_COMPILED __pyx_string_tab[5]
  2295. #define __pyx_n_u_MomentsPen __pyx_string_tab[6]
  2296. #define __pyx_n_u_MomentsPen___init __pyx_string_tab[7]
  2297. #define __pyx_n_u_MomentsPen__closePath __pyx_string_tab[8]
  2298. #define __pyx_n_u_MomentsPen__curveToOne __pyx_string_tab[9]
  2299. #define __pyx_n_u_MomentsPen__endPath __pyx_string_tab[10]
  2300. #define __pyx_n_u_MomentsPen__lineTo __pyx_string_tab[11]
  2301. #define __pyx_n_u_MomentsPen__moveTo __pyx_string_tab[12]
  2302. #define __pyx_n_u_MomentsPen__qCurveToOne __pyx_string_tab[13]
  2303. #define __pyx_n_u_OpenContourError __pyx_string_tab[14]
  2304. #define __pyx_n_u_Pyx_PyDict_NextRef __pyx_string_tab[15]
  2305. #define __pyx_n_u_all __pyx_string_tab[16]
  2306. #define __pyx_n_u_area __pyx_string_tab[17]
  2307. #define __pyx_n_u_asyncio_coroutines __pyx_string_tab[18]
  2308. #define __pyx_n_u_cline_in_traceback __pyx_string_tab[19]
  2309. #define __pyx_n_u_closePath __pyx_string_tab[20]
  2310. #define __pyx_n_u_curveToOne __pyx_string_tab[21]
  2311. #define __pyx_n_u_doc __pyx_string_tab[22]
  2312. #define __pyx_n_u_endPath __pyx_string_tab[23]
  2313. #define __pyx_n_u_fontTools_misc_symfont __pyx_string_tab[24]
  2314. #define __pyx_n_u_fontTools_pens_basePen __pyx_string_tab[25]
  2315. #define __pyx_n_u_fontTools_pens_momentsPen __pyx_string_tab[26]
  2316. #define __pyx_n_u_func __pyx_string_tab[27]
  2317. #define __pyx_n_u_getCurrentPoint __pyx_string_tab[28]
  2318. #define __pyx_n_u_glyphset __pyx_string_tab[29]
  2319. #define __pyx_n_u_init __pyx_string_tab[30]
  2320. #define __pyx_n_u_is_coroutine __pyx_string_tab[31]
  2321. #define __pyx_n_u_items __pyx_string_tab[32]
  2322. #define __pyx_n_u_lineTo __pyx_string_tab[33]
  2323. #define __pyx_n_u_main __pyx_string_tab[34]
  2324. #define __pyx_n_u_metaclass __pyx_string_tab[35]
  2325. #define __pyx_n_u_module __pyx_string_tab[36]
  2326. #define __pyx_n_u_momentX __pyx_string_tab[37]
  2327. #define __pyx_n_u_momentXX __pyx_string_tab[38]
  2328. #define __pyx_n_u_momentXY __pyx_string_tab[39]
  2329. #define __pyx_n_u_momentY __pyx_string_tab[40]
  2330. #define __pyx_n_u_momentYY __pyx_string_tab[41]
  2331. #define __pyx_n_u_moveTo __pyx_string_tab[42]
  2332. #define __pyx_n_u_mro_entries __pyx_string_tab[43]
  2333. #define __pyx_n_u_name __pyx_string_tab[44]
  2334. #define __pyx_n_u_p0 __pyx_string_tab[45]
  2335. #define __pyx_n_u_p1 __pyx_string_tab[46]
  2336. #define __pyx_n_u_p2 __pyx_string_tab[47]
  2337. #define __pyx_n_u_p3 __pyx_string_tab[48]
  2338. #define __pyx_n_u_pop __pyx_string_tab[49]
  2339. #define __pyx_n_u_prepare __pyx_string_tab[50]
  2340. #define __pyx_n_u_printGreenPen __pyx_string_tab[51]
  2341. #define __pyx_n_u_qCurveToOne __pyx_string_tab[52]
  2342. #define __pyx_n_u_qualname __pyx_string_tab[53]
  2343. #define __pyx_n_u_r0 __pyx_string_tab[54]
  2344. #define __pyx_n_u_r1 __pyx_string_tab[55]
  2345. #define __pyx_n_u_r10 __pyx_string_tab[56]
  2346. #define __pyx_n_u_r100 __pyx_string_tab[57]
  2347. #define __pyx_n_u_r101 __pyx_string_tab[58]
  2348. #define __pyx_n_u_r102 __pyx_string_tab[59]
  2349. #define __pyx_n_u_r103 __pyx_string_tab[60]
  2350. #define __pyx_n_u_r104 __pyx_string_tab[61]
  2351. #define __pyx_n_u_r105 __pyx_string_tab[62]
  2352. #define __pyx_n_u_r106 __pyx_string_tab[63]
  2353. #define __pyx_n_u_r107 __pyx_string_tab[64]
  2354. #define __pyx_n_u_r108 __pyx_string_tab[65]
  2355. #define __pyx_n_u_r109 __pyx_string_tab[66]
  2356. #define __pyx_n_u_r11 __pyx_string_tab[67]
  2357. #define __pyx_n_u_r110 __pyx_string_tab[68]
  2358. #define __pyx_n_u_r111 __pyx_string_tab[69]
  2359. #define __pyx_n_u_r112 __pyx_string_tab[70]
  2360. #define __pyx_n_u_r113 __pyx_string_tab[71]
  2361. #define __pyx_n_u_r114 __pyx_string_tab[72]
  2362. #define __pyx_n_u_r115 __pyx_string_tab[73]
  2363. #define __pyx_n_u_r116 __pyx_string_tab[74]
  2364. #define __pyx_n_u_r117 __pyx_string_tab[75]
  2365. #define __pyx_n_u_r118 __pyx_string_tab[76]
  2366. #define __pyx_n_u_r119 __pyx_string_tab[77]
  2367. #define __pyx_n_u_r12 __pyx_string_tab[78]
  2368. #define __pyx_n_u_r120 __pyx_string_tab[79]
  2369. #define __pyx_n_u_r121 __pyx_string_tab[80]
  2370. #define __pyx_n_u_r122 __pyx_string_tab[81]
  2371. #define __pyx_n_u_r123 __pyx_string_tab[82]
  2372. #define __pyx_n_u_r124 __pyx_string_tab[83]
  2373. #define __pyx_n_u_r125 __pyx_string_tab[84]
  2374. #define __pyx_n_u_r126 __pyx_string_tab[85]
  2375. #define __pyx_n_u_r127 __pyx_string_tab[86]
  2376. #define __pyx_n_u_r128 __pyx_string_tab[87]
  2377. #define __pyx_n_u_r129 __pyx_string_tab[88]
  2378. #define __pyx_n_u_r13 __pyx_string_tab[89]
  2379. #define __pyx_n_u_r130 __pyx_string_tab[90]
  2380. #define __pyx_n_u_r131 __pyx_string_tab[91]
  2381. #define __pyx_n_u_r132 __pyx_string_tab[92]
  2382. #define __pyx_n_u_r14 __pyx_string_tab[93]
  2383. #define __pyx_n_u_r15 __pyx_string_tab[94]
  2384. #define __pyx_n_u_r16 __pyx_string_tab[95]
  2385. #define __pyx_n_u_r17 __pyx_string_tab[96]
  2386. #define __pyx_n_u_r18 __pyx_string_tab[97]
  2387. #define __pyx_n_u_r19 __pyx_string_tab[98]
  2388. #define __pyx_n_u_r2 __pyx_string_tab[99]
  2389. #define __pyx_n_u_r20 __pyx_string_tab[100]
  2390. #define __pyx_n_u_r21 __pyx_string_tab[101]
  2391. #define __pyx_n_u_r22 __pyx_string_tab[102]
  2392. #define __pyx_n_u_r23 __pyx_string_tab[103]
  2393. #define __pyx_n_u_r24 __pyx_string_tab[104]
  2394. #define __pyx_n_u_r25 __pyx_string_tab[105]
  2395. #define __pyx_n_u_r26 __pyx_string_tab[106]
  2396. #define __pyx_n_u_r27 __pyx_string_tab[107]
  2397. #define __pyx_n_u_r28 __pyx_string_tab[108]
  2398. #define __pyx_n_u_r29 __pyx_string_tab[109]
  2399. #define __pyx_n_u_r3 __pyx_string_tab[110]
  2400. #define __pyx_n_u_r30 __pyx_string_tab[111]
  2401. #define __pyx_n_u_r31 __pyx_string_tab[112]
  2402. #define __pyx_n_u_r32 __pyx_string_tab[113]
  2403. #define __pyx_n_u_r33 __pyx_string_tab[114]
  2404. #define __pyx_n_u_r34 __pyx_string_tab[115]
  2405. #define __pyx_n_u_r35 __pyx_string_tab[116]
  2406. #define __pyx_n_u_r36 __pyx_string_tab[117]
  2407. #define __pyx_n_u_r37 __pyx_string_tab[118]
  2408. #define __pyx_n_u_r38 __pyx_string_tab[119]
  2409. #define __pyx_n_u_r39 __pyx_string_tab[120]
  2410. #define __pyx_n_u_r4 __pyx_string_tab[121]
  2411. #define __pyx_n_u_r40 __pyx_string_tab[122]
  2412. #define __pyx_n_u_r41 __pyx_string_tab[123]
  2413. #define __pyx_n_u_r42 __pyx_string_tab[124]
  2414. #define __pyx_n_u_r43 __pyx_string_tab[125]
  2415. #define __pyx_n_u_r44 __pyx_string_tab[126]
  2416. #define __pyx_n_u_r45 __pyx_string_tab[127]
  2417. #define __pyx_n_u_r46 __pyx_string_tab[128]
  2418. #define __pyx_n_u_r47 __pyx_string_tab[129]
  2419. #define __pyx_n_u_r48 __pyx_string_tab[130]
  2420. #define __pyx_n_u_r49 __pyx_string_tab[131]
  2421. #define __pyx_n_u_r5 __pyx_string_tab[132]
  2422. #define __pyx_n_u_r50 __pyx_string_tab[133]
  2423. #define __pyx_n_u_r51 __pyx_string_tab[134]
  2424. #define __pyx_n_u_r52 __pyx_string_tab[135]
  2425. #define __pyx_n_u_r53 __pyx_string_tab[136]
  2426. #define __pyx_n_u_r54 __pyx_string_tab[137]
  2427. #define __pyx_n_u_r55 __pyx_string_tab[138]
  2428. #define __pyx_n_u_r56 __pyx_string_tab[139]
  2429. #define __pyx_n_u_r57 __pyx_string_tab[140]
  2430. #define __pyx_n_u_r58 __pyx_string_tab[141]
  2431. #define __pyx_n_u_r59 __pyx_string_tab[142]
  2432. #define __pyx_n_u_r6 __pyx_string_tab[143]
  2433. #define __pyx_n_u_r60 __pyx_string_tab[144]
  2434. #define __pyx_n_u_r61 __pyx_string_tab[145]
  2435. #define __pyx_n_u_r62 __pyx_string_tab[146]
  2436. #define __pyx_n_u_r63 __pyx_string_tab[147]
  2437. #define __pyx_n_u_r64 __pyx_string_tab[148]
  2438. #define __pyx_n_u_r65 __pyx_string_tab[149]
  2439. #define __pyx_n_u_r66 __pyx_string_tab[150]
  2440. #define __pyx_n_u_r67 __pyx_string_tab[151]
  2441. #define __pyx_n_u_r68 __pyx_string_tab[152]
  2442. #define __pyx_n_u_r69 __pyx_string_tab[153]
  2443. #define __pyx_n_u_r7 __pyx_string_tab[154]
  2444. #define __pyx_n_u_r70 __pyx_string_tab[155]
  2445. #define __pyx_n_u_r71 __pyx_string_tab[156]
  2446. #define __pyx_n_u_r72 __pyx_string_tab[157]
  2447. #define __pyx_n_u_r73 __pyx_string_tab[158]
  2448. #define __pyx_n_u_r74 __pyx_string_tab[159]
  2449. #define __pyx_n_u_r75 __pyx_string_tab[160]
  2450. #define __pyx_n_u_r76 __pyx_string_tab[161]
  2451. #define __pyx_n_u_r77 __pyx_string_tab[162]
  2452. #define __pyx_n_u_r78 __pyx_string_tab[163]
  2453. #define __pyx_n_u_r79 __pyx_string_tab[164]
  2454. #define __pyx_n_u_r8 __pyx_string_tab[165]
  2455. #define __pyx_n_u_r80 __pyx_string_tab[166]
  2456. #define __pyx_n_u_r81 __pyx_string_tab[167]
  2457. #define __pyx_n_u_r82 __pyx_string_tab[168]
  2458. #define __pyx_n_u_r83 __pyx_string_tab[169]
  2459. #define __pyx_n_u_r84 __pyx_string_tab[170]
  2460. #define __pyx_n_u_r85 __pyx_string_tab[171]
  2461. #define __pyx_n_u_r86 __pyx_string_tab[172]
  2462. #define __pyx_n_u_r87 __pyx_string_tab[173]
  2463. #define __pyx_n_u_r88 __pyx_string_tab[174]
  2464. #define __pyx_n_u_r89 __pyx_string_tab[175]
  2465. #define __pyx_n_u_r9 __pyx_string_tab[176]
  2466. #define __pyx_n_u_r90 __pyx_string_tab[177]
  2467. #define __pyx_n_u_r91 __pyx_string_tab[178]
  2468. #define __pyx_n_u_r92 __pyx_string_tab[179]
  2469. #define __pyx_n_u_r93 __pyx_string_tab[180]
  2470. #define __pyx_n_u_r94 __pyx_string_tab[181]
  2471. #define __pyx_n_u_r95 __pyx_string_tab[182]
  2472. #define __pyx_n_u_r96 __pyx_string_tab[183]
  2473. #define __pyx_n_u_r97 __pyx_string_tab[184]
  2474. #define __pyx_n_u_r98 __pyx_string_tab[185]
  2475. #define __pyx_n_u_r99 __pyx_string_tab[186]
  2476. #define __pyx_n_u_self __pyx_string_tab[187]
  2477. #define __pyx_n_u_set_name __pyx_string_tab[188]
  2478. #define __pyx_n_u_setdefault __pyx_string_tab[189]
  2479. #define __pyx_n_u_startPoint __pyx_string_tab[190]
  2480. #define __pyx_n_u_test __pyx_string_tab[191]
  2481. #define __pyx_n_u_values __pyx_string_tab[192]
  2482. #define __pyx_n_u_x __pyx_string_tab[193]
  2483. #define __pyx_n_u_x0 __pyx_string_tab[194]
  2484. #define __pyx_n_u_x1 __pyx_string_tab[195]
  2485. #define __pyx_n_u_x2 __pyx_string_tab[196]
  2486. #define __pyx_n_u_x3 __pyx_string_tab[197]
  2487. #define __pyx_n_u_y __pyx_string_tab[198]
  2488. #define __pyx_n_u_y0 __pyx_string_tab[199]
  2489. #define __pyx_n_u_y1 __pyx_string_tab[200]
  2490. #define __pyx_n_u_y2 __pyx_string_tab[201]
  2491. #define __pyx_n_u_y3 __pyx_string_tab[202]
  2492. #define __pyx_kp_b_iso88591_AT_E_a_E_E_E_Rr_S_S_S_Rr_Rr_Rr_R __pyx_string_tab[203]
  2493. #define __pyx_kp_b_iso88591_A_E_a_E_S_S_Rr_S_S_S_Rr_Rr_Rr_Rr __pyx_string_tab[204]
  2494. #define __pyx_kp_b_iso88591_A_O1 __pyx_string_tab[205]
  2495. #define __pyx_kp_b_iso88591_A_T_3c_Q_1 __pyx_string_tab[206]
  2496. #define __pyx_kp_b_iso88591_A_T_3c_Q_Q __pyx_string_tab[207]
  2497. #define __pyx_kp_b_iso88591_At_E_a_E_E_Rr_S_S_Rr_Rr_Rr_Rr_Rr __pyx_string_tab[208]
  2498. #define __pyx_kp_b_iso88591_q_y_q_HA_Kq_Kq_L_L_L __pyx_string_tab[209]
  2499. #define __pyx_int_0 __pyx_number_tab[0]
  2500. #define __pyx_int_1 __pyx_number_tab[1]
  2501. #define __pyx_int_2 __pyx_number_tab[2]
  2502. /* #### Code section: module_state_clear ### */
  2503. #if CYTHON_USE_MODULE_STATE
  2504. static CYTHON_SMALL_CODE int __pyx_m_clear(PyObject *m) {
  2505. __pyx_mstatetype *clear_module_state = __Pyx_PyModule_GetState(m);
  2506. if (!clear_module_state) return 0;
  2507. Py_CLEAR(clear_module_state->__pyx_d);
  2508. Py_CLEAR(clear_module_state->__pyx_b);
  2509. Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  2510. Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  2511. Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  2512. Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  2513. #if CYTHON_PEP489_MULTI_PHASE_INIT
  2514. __Pyx_State_RemoveModule(NULL);
  2515. #endif
  2516. for (int i=0; i<2; ++i) { Py_CLEAR(clear_module_state->__pyx_tuple[i]); }
  2517. for (int i=0; i<7; ++i) { Py_CLEAR(clear_module_state->__pyx_codeobj_tab[i]); }
  2518. for (int i=0; i<210; ++i) { Py_CLEAR(clear_module_state->__pyx_string_tab[i]); }
  2519. for (int i=0; i<3; ++i) { Py_CLEAR(clear_module_state->__pyx_number_tab[i]); }
  2520. /* #### Code section: module_state_clear_contents ### */
  2521. /* CommonTypesMetaclass.module_state_clear */
  2522. Py_CLEAR(clear_module_state->__pyx_CommonTypesMetaclassType);
  2523. /* CythonFunctionShared.module_state_clear */
  2524. Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  2525. /* #### Code section: module_state_clear_end ### */
  2526. return 0;
  2527. }
  2528. #endif
  2529. /* #### Code section: module_state_traverse ### */
  2530. #if CYTHON_USE_MODULE_STATE
  2531. static CYTHON_SMALL_CODE int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  2532. __pyx_mstatetype *traverse_module_state = __Pyx_PyModule_GetState(m);
  2533. if (!traverse_module_state) return 0;
  2534. Py_VISIT(traverse_module_state->__pyx_d);
  2535. Py_VISIT(traverse_module_state->__pyx_b);
  2536. Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  2537. __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_tuple);
  2538. __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_bytes);
  2539. __Pyx_VISIT_CONST(traverse_module_state->__pyx_empty_unicode);
  2540. for (int i=0; i<2; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_tuple[i]); }
  2541. for (int i=0; i<7; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_codeobj_tab[i]); }
  2542. for (int i=0; i<210; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_string_tab[i]); }
  2543. for (int i=0; i<3; ++i) { __Pyx_VISIT_CONST(traverse_module_state->__pyx_number_tab[i]); }
  2544. /* #### Code section: module_state_traverse_contents ### */
  2545. /* CommonTypesMetaclass.module_state_traverse */
  2546. Py_VISIT(traverse_module_state->__pyx_CommonTypesMetaclassType);
  2547. /* CythonFunctionShared.module_state_traverse */
  2548. Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  2549. /* #### Code section: module_state_traverse_end ### */
  2550. return 0;
  2551. }
  2552. #endif
  2553. /* #### Code section: module_code ### */
  2554. /* "fontTools/pens/momentsPen.py":16
  2555. * class MomentsPen(BasePen):
  2556. *
  2557. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  2558. * BasePen.__init__(self, glyphset)
  2559. *
  2560. */
  2561. /* Python wrapper */
  2562. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__(PyObject *__pyx_self,
  2563. #if CYTHON_METH_FASTCALL
  2564. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2565. #else
  2566. PyObject *__pyx_args, PyObject *__pyx_kwds
  2567. #endif
  2568. ); /*proto*/
  2569. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen___init__, "MomentsPen.__init__(self, glyphset=None)");
  2570. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__ = {"__init__", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen___init__};
  2571. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__(PyObject *__pyx_self,
  2572. #if CYTHON_METH_FASTCALL
  2573. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2574. #else
  2575. PyObject *__pyx_args, PyObject *__pyx_kwds
  2576. #endif
  2577. ) {
  2578. PyObject *__pyx_v_self = 0;
  2579. PyObject *__pyx_v_glyphset = 0;
  2580. #if !CYTHON_METH_FASTCALL
  2581. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  2582. #endif
  2583. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  2584. PyObject* values[2] = {0,0};
  2585. int __pyx_lineno = 0;
  2586. const char *__pyx_filename = NULL;
  2587. int __pyx_clineno = 0;
  2588. PyObject *__pyx_r = 0;
  2589. __Pyx_RefNannyDeclarations
  2590. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  2591. #if !CYTHON_METH_FASTCALL
  2592. #if CYTHON_ASSUME_SAFE_SIZE
  2593. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  2594. #else
  2595. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  2596. #endif
  2597. #endif
  2598. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  2599. {
  2600. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_glyphset,0};
  2601. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  2602. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 16, __pyx_L3_error)
  2603. if (__pyx_kwds_len > 0) {
  2604. switch (__pyx_nargs) {
  2605. case 2:
  2606. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  2607. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 16, __pyx_L3_error)
  2608. CYTHON_FALLTHROUGH;
  2609. case 1:
  2610. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2611. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 16, __pyx_L3_error)
  2612. CYTHON_FALLTHROUGH;
  2613. case 0: break;
  2614. default: goto __pyx_L5_argtuple_error;
  2615. }
  2616. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  2617. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "__init__", 0) < (0)) __PYX_ERR(0, 16, __pyx_L3_error)
  2618. if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
  2619. for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
  2620. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, i); __PYX_ERR(0, 16, __pyx_L3_error) }
  2621. }
  2622. } else {
  2623. switch (__pyx_nargs) {
  2624. case 2:
  2625. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  2626. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 16, __pyx_L3_error)
  2627. CYTHON_FALLTHROUGH;
  2628. case 1:
  2629. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2630. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 16, __pyx_L3_error)
  2631. break;
  2632. default: goto __pyx_L5_argtuple_error;
  2633. }
  2634. if (!values[1]) values[1] = __Pyx_NewRef(((PyObject *)Py_None));
  2635. }
  2636. __pyx_v_self = values[0];
  2637. __pyx_v_glyphset = values[1];
  2638. }
  2639. goto __pyx_L6_skip;
  2640. __pyx_L5_argtuple_error:;
  2641. __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 16, __pyx_L3_error)
  2642. __pyx_L6_skip:;
  2643. goto __pyx_L4_argument_unpacking_done;
  2644. __pyx_L3_error:;
  2645. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2646. Py_XDECREF(values[__pyx_temp]);
  2647. }
  2648. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2649. __Pyx_RefNannyFinishContext();
  2650. return NULL;
  2651. __pyx_L4_argument_unpacking_done:;
  2652. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(__pyx_self, __pyx_v_self, __pyx_v_glyphset);
  2653. /* function exit code */
  2654. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2655. Py_XDECREF(values[__pyx_temp]);
  2656. }
  2657. __Pyx_RefNannyFinishContext();
  2658. return __pyx_r;
  2659. }
  2660. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_glyphset) {
  2661. PyObject *__pyx_r = NULL;
  2662. __Pyx_RefNannyDeclarations
  2663. PyObject *__pyx_t_1 = NULL;
  2664. PyObject *__pyx_t_2 = NULL;
  2665. PyObject *__pyx_t_3 = NULL;
  2666. PyObject *__pyx_t_4 = NULL;
  2667. size_t __pyx_t_5;
  2668. int __pyx_lineno = 0;
  2669. const char *__pyx_filename = NULL;
  2670. int __pyx_clineno = 0;
  2671. __Pyx_RefNannySetupContext("__init__", 0);
  2672. /* "fontTools/pens/momentsPen.py":17
  2673. *
  2674. * def __init__(self, glyphset=None):
  2675. * BasePen.__init__(self, glyphset) # <<<<<<<<<<<<<<
  2676. *
  2677. * self.area = 0
  2678. */
  2679. __pyx_t_2 = NULL;
  2680. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_BasePen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
  2681. __Pyx_GOTREF(__pyx_t_3);
  2682. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_mstate_global->__pyx_n_u_init); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
  2683. __Pyx_GOTREF(__pyx_t_4);
  2684. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  2685. __pyx_t_5 = 1;
  2686. #if CYTHON_UNPACK_METHODS
  2687. if (unlikely(PyMethod_Check(__pyx_t_4))) {
  2688. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
  2689. assert(__pyx_t_2);
  2690. PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_4);
  2691. __Pyx_INCREF(__pyx_t_2);
  2692. __Pyx_INCREF(__pyx__function);
  2693. __Pyx_DECREF_SET(__pyx_t_4, __pyx__function);
  2694. __pyx_t_5 = 0;
  2695. }
  2696. #endif
  2697. {
  2698. PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_glyphset};
  2699. __pyx_t_1 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_4, __pyx_callargs+__pyx_t_5, (3-__pyx_t_5) | (__pyx_t_5*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  2700. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  2701. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  2702. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 17, __pyx_L1_error)
  2703. __Pyx_GOTREF(__pyx_t_1);
  2704. }
  2705. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  2706. /* "fontTools/pens/momentsPen.py":19
  2707. * BasePen.__init__(self, glyphset)
  2708. *
  2709. * self.area = 0 # <<<<<<<<<<<<<<
  2710. * self.momentX = 0
  2711. * self.momentY = 0
  2712. */
  2713. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 19, __pyx_L1_error)
  2714. /* "fontTools/pens/momentsPen.py":20
  2715. *
  2716. * self.area = 0
  2717. * self.momentX = 0 # <<<<<<<<<<<<<<
  2718. * self.momentY = 0
  2719. * self.momentXX = 0
  2720. */
  2721. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 20, __pyx_L1_error)
  2722. /* "fontTools/pens/momentsPen.py":21
  2723. * self.area = 0
  2724. * self.momentX = 0
  2725. * self.momentY = 0 # <<<<<<<<<<<<<<
  2726. * self.momentXX = 0
  2727. * self.momentXY = 0
  2728. */
  2729. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 21, __pyx_L1_error)
  2730. /* "fontTools/pens/momentsPen.py":22
  2731. * self.momentX = 0
  2732. * self.momentY = 0
  2733. * self.momentXX = 0 # <<<<<<<<<<<<<<
  2734. * self.momentXY = 0
  2735. * self.momentYY = 0
  2736. */
  2737. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 22, __pyx_L1_error)
  2738. /* "fontTools/pens/momentsPen.py":23
  2739. * self.momentY = 0
  2740. * self.momentXX = 0
  2741. * self.momentXY = 0 # <<<<<<<<<<<<<<
  2742. * self.momentYY = 0
  2743. *
  2744. */
  2745. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 23, __pyx_L1_error)
  2746. /* "fontTools/pens/momentsPen.py":24
  2747. * self.momentXX = 0
  2748. * self.momentXY = 0
  2749. * self.momentYY = 0 # <<<<<<<<<<<<<<
  2750. *
  2751. * def _moveTo(self, p0):
  2752. */
  2753. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY, __pyx_mstate_global->__pyx_int_0) < (0)) __PYX_ERR(0, 24, __pyx_L1_error)
  2754. /* "fontTools/pens/momentsPen.py":16
  2755. * class MomentsPen(BasePen):
  2756. *
  2757. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  2758. * BasePen.__init__(self, glyphset)
  2759. *
  2760. */
  2761. /* function exit code */
  2762. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  2763. goto __pyx_L0;
  2764. __pyx_L1_error:;
  2765. __Pyx_XDECREF(__pyx_t_1);
  2766. __Pyx_XDECREF(__pyx_t_2);
  2767. __Pyx_XDECREF(__pyx_t_3);
  2768. __Pyx_XDECREF(__pyx_t_4);
  2769. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2770. __pyx_r = NULL;
  2771. __pyx_L0:;
  2772. __Pyx_XGIVEREF(__pyx_r);
  2773. __Pyx_RefNannyFinishContext();
  2774. return __pyx_r;
  2775. }
  2776. /* "fontTools/pens/momentsPen.py":26
  2777. * self.momentYY = 0
  2778. *
  2779. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  2780. * self._startPoint = p0
  2781. *
  2782. */
  2783. /* Python wrapper */
  2784. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo(PyObject *__pyx_self,
  2785. #if CYTHON_METH_FASTCALL
  2786. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2787. #else
  2788. PyObject *__pyx_args, PyObject *__pyx_kwds
  2789. #endif
  2790. ); /*proto*/
  2791. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo, "MomentsPen._moveTo(self, p0)");
  2792. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo = {"_moveTo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo};
  2793. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo(PyObject *__pyx_self,
  2794. #if CYTHON_METH_FASTCALL
  2795. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2796. #else
  2797. PyObject *__pyx_args, PyObject *__pyx_kwds
  2798. #endif
  2799. ) {
  2800. PyObject *__pyx_v_self = 0;
  2801. PyObject *__pyx_v_p0 = 0;
  2802. #if !CYTHON_METH_FASTCALL
  2803. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  2804. #endif
  2805. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  2806. PyObject* values[2] = {0,0};
  2807. int __pyx_lineno = 0;
  2808. const char *__pyx_filename = NULL;
  2809. int __pyx_clineno = 0;
  2810. PyObject *__pyx_r = 0;
  2811. __Pyx_RefNannyDeclarations
  2812. __Pyx_RefNannySetupContext("_moveTo (wrapper)", 0);
  2813. #if !CYTHON_METH_FASTCALL
  2814. #if CYTHON_ASSUME_SAFE_SIZE
  2815. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  2816. #else
  2817. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  2818. #endif
  2819. #endif
  2820. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  2821. {
  2822. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_p0,0};
  2823. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  2824. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 26, __pyx_L3_error)
  2825. if (__pyx_kwds_len > 0) {
  2826. switch (__pyx_nargs) {
  2827. case 2:
  2828. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  2829. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 26, __pyx_L3_error)
  2830. CYTHON_FALLTHROUGH;
  2831. case 1:
  2832. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2833. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 26, __pyx_L3_error)
  2834. CYTHON_FALLTHROUGH;
  2835. case 0: break;
  2836. default: goto __pyx_L5_argtuple_error;
  2837. }
  2838. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  2839. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_moveTo", 0) < (0)) __PYX_ERR(0, 26, __pyx_L3_error)
  2840. for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
  2841. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_moveTo", 1, 2, 2, i); __PYX_ERR(0, 26, __pyx_L3_error) }
  2842. }
  2843. } else if (unlikely(__pyx_nargs != 2)) {
  2844. goto __pyx_L5_argtuple_error;
  2845. } else {
  2846. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2847. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 26, __pyx_L3_error)
  2848. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  2849. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 26, __pyx_L3_error)
  2850. }
  2851. __pyx_v_self = values[0];
  2852. __pyx_v_p0 = values[1];
  2853. }
  2854. goto __pyx_L6_skip;
  2855. __pyx_L5_argtuple_error:;
  2856. __Pyx_RaiseArgtupleInvalid("_moveTo", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 26, __pyx_L3_error)
  2857. __pyx_L6_skip:;
  2858. goto __pyx_L4_argument_unpacking_done;
  2859. __pyx_L3_error:;
  2860. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2861. Py_XDECREF(values[__pyx_temp]);
  2862. }
  2863. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._moveTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2864. __Pyx_RefNannyFinishContext();
  2865. return NULL;
  2866. __pyx_L4_argument_unpacking_done:;
  2867. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(__pyx_self, __pyx_v_self, __pyx_v_p0);
  2868. /* function exit code */
  2869. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2870. Py_XDECREF(values[__pyx_temp]);
  2871. }
  2872. __Pyx_RefNannyFinishContext();
  2873. return __pyx_r;
  2874. }
  2875. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p0) {
  2876. PyObject *__pyx_r = NULL;
  2877. __Pyx_RefNannyDeclarations
  2878. int __pyx_lineno = 0;
  2879. const char *__pyx_filename = NULL;
  2880. int __pyx_clineno = 0;
  2881. __Pyx_RefNannySetupContext("_moveTo", 0);
  2882. /* "fontTools/pens/momentsPen.py":27
  2883. *
  2884. * def _moveTo(self, p0):
  2885. * self._startPoint = p0 # <<<<<<<<<<<<<<
  2886. *
  2887. * def _closePath(self):
  2888. */
  2889. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_startPoint, __pyx_v_p0) < (0)) __PYX_ERR(0, 27, __pyx_L1_error)
  2890. /* "fontTools/pens/momentsPen.py":26
  2891. * self.momentYY = 0
  2892. *
  2893. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  2894. * self._startPoint = p0
  2895. *
  2896. */
  2897. /* function exit code */
  2898. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  2899. goto __pyx_L0;
  2900. __pyx_L1_error:;
  2901. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._moveTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2902. __pyx_r = NULL;
  2903. __pyx_L0:;
  2904. __Pyx_XGIVEREF(__pyx_r);
  2905. __Pyx_RefNannyFinishContext();
  2906. return __pyx_r;
  2907. }
  2908. /* "fontTools/pens/momentsPen.py":29
  2909. * self._startPoint = p0
  2910. *
  2911. * def _closePath(self): # <<<<<<<<<<<<<<
  2912. * p0 = self._getCurrentPoint()
  2913. * if p0 != self._startPoint:
  2914. */
  2915. /* Python wrapper */
  2916. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath(PyObject *__pyx_self,
  2917. #if CYTHON_METH_FASTCALL
  2918. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2919. #else
  2920. PyObject *__pyx_args, PyObject *__pyx_kwds
  2921. #endif
  2922. ); /*proto*/
  2923. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath, "MomentsPen._closePath(self)");
  2924. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath = {"_closePath", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath};
  2925. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath(PyObject *__pyx_self,
  2926. #if CYTHON_METH_FASTCALL
  2927. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  2928. #else
  2929. PyObject *__pyx_args, PyObject *__pyx_kwds
  2930. #endif
  2931. ) {
  2932. PyObject *__pyx_v_self = 0;
  2933. #if !CYTHON_METH_FASTCALL
  2934. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  2935. #endif
  2936. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  2937. PyObject* values[1] = {0};
  2938. int __pyx_lineno = 0;
  2939. const char *__pyx_filename = NULL;
  2940. int __pyx_clineno = 0;
  2941. PyObject *__pyx_r = 0;
  2942. __Pyx_RefNannyDeclarations
  2943. __Pyx_RefNannySetupContext("_closePath (wrapper)", 0);
  2944. #if !CYTHON_METH_FASTCALL
  2945. #if CYTHON_ASSUME_SAFE_SIZE
  2946. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  2947. #else
  2948. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  2949. #endif
  2950. #endif
  2951. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  2952. {
  2953. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
  2954. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  2955. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 29, __pyx_L3_error)
  2956. if (__pyx_kwds_len > 0) {
  2957. switch (__pyx_nargs) {
  2958. case 1:
  2959. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2960. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __pyx_L3_error)
  2961. CYTHON_FALLTHROUGH;
  2962. case 0: break;
  2963. default: goto __pyx_L5_argtuple_error;
  2964. }
  2965. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  2966. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_closePath", 0) < (0)) __PYX_ERR(0, 29, __pyx_L3_error)
  2967. for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
  2968. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_closePath", 1, 1, 1, i); __PYX_ERR(0, 29, __pyx_L3_error) }
  2969. }
  2970. } else if (unlikely(__pyx_nargs != 1)) {
  2971. goto __pyx_L5_argtuple_error;
  2972. } else {
  2973. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  2974. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 29, __pyx_L3_error)
  2975. }
  2976. __pyx_v_self = values[0];
  2977. }
  2978. goto __pyx_L6_skip;
  2979. __pyx_L5_argtuple_error:;
  2980. __Pyx_RaiseArgtupleInvalid("_closePath", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 29, __pyx_L3_error)
  2981. __pyx_L6_skip:;
  2982. goto __pyx_L4_argument_unpacking_done;
  2983. __pyx_L3_error:;
  2984. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2985. Py_XDECREF(values[__pyx_temp]);
  2986. }
  2987. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._closePath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2988. __Pyx_RefNannyFinishContext();
  2989. return NULL;
  2990. __pyx_L4_argument_unpacking_done:;
  2991. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(__pyx_self, __pyx_v_self);
  2992. /* function exit code */
  2993. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  2994. Py_XDECREF(values[__pyx_temp]);
  2995. }
  2996. __Pyx_RefNannyFinishContext();
  2997. return __pyx_r;
  2998. }
  2999. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  3000. PyObject *__pyx_v_p0 = NULL;
  3001. PyObject *__pyx_r = NULL;
  3002. __Pyx_RefNannyDeclarations
  3003. PyObject *__pyx_t_1 = NULL;
  3004. PyObject *__pyx_t_2 = NULL;
  3005. size_t __pyx_t_3;
  3006. int __pyx_t_4;
  3007. PyObject *__pyx_t_5 = NULL;
  3008. int __pyx_lineno = 0;
  3009. const char *__pyx_filename = NULL;
  3010. int __pyx_clineno = 0;
  3011. __Pyx_RefNannySetupContext("_closePath", 0);
  3012. /* "fontTools/pens/momentsPen.py":30
  3013. *
  3014. * def _closePath(self):
  3015. * p0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  3016. * if p0 != self._startPoint:
  3017. * self._lineTo(self._startPoint)
  3018. */
  3019. __pyx_t_2 = __pyx_v_self;
  3020. __Pyx_INCREF(__pyx_t_2);
  3021. __pyx_t_3 = 0;
  3022. {
  3023. PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
  3024. __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrentPoint, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  3025. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3026. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
  3027. __Pyx_GOTREF(__pyx_t_1);
  3028. }
  3029. __pyx_v_p0 = __pyx_t_1;
  3030. __pyx_t_1 = 0;
  3031. /* "fontTools/pens/momentsPen.py":31
  3032. * def _closePath(self):
  3033. * p0 = self._getCurrentPoint()
  3034. * if p0 != self._startPoint: # <<<<<<<<<<<<<<
  3035. * self._lineTo(self._startPoint)
  3036. *
  3037. */
  3038. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_startPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
  3039. __Pyx_GOTREF(__pyx_t_1);
  3040. __pyx_t_2 = PyObject_RichCompare(__pyx_v_p0, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  3041. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3042. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 31, __pyx_L1_error)
  3043. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3044. if (__pyx_t_4) {
  3045. /* "fontTools/pens/momentsPen.py":32
  3046. * p0 = self._getCurrentPoint()
  3047. * if p0 != self._startPoint:
  3048. * self._lineTo(self._startPoint) # <<<<<<<<<<<<<<
  3049. *
  3050. * def _endPath(self):
  3051. */
  3052. __pyx_t_1 = __pyx_v_self;
  3053. __Pyx_INCREF(__pyx_t_1);
  3054. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_startPoint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 32, __pyx_L1_error)
  3055. __Pyx_GOTREF(__pyx_t_5);
  3056. __pyx_t_3 = 0;
  3057. {
  3058. PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
  3059. __pyx_t_2 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_lineTo, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  3060. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3061. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3062. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  3063. __Pyx_GOTREF(__pyx_t_2);
  3064. }
  3065. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3066. /* "fontTools/pens/momentsPen.py":31
  3067. * def _closePath(self):
  3068. * p0 = self._getCurrentPoint()
  3069. * if p0 != self._startPoint: # <<<<<<<<<<<<<<
  3070. * self._lineTo(self._startPoint)
  3071. *
  3072. */
  3073. }
  3074. /* "fontTools/pens/momentsPen.py":29
  3075. * self._startPoint = p0
  3076. *
  3077. * def _closePath(self): # <<<<<<<<<<<<<<
  3078. * p0 = self._getCurrentPoint()
  3079. * if p0 != self._startPoint:
  3080. */
  3081. /* function exit code */
  3082. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3083. goto __pyx_L0;
  3084. __pyx_L1_error:;
  3085. __Pyx_XDECREF(__pyx_t_1);
  3086. __Pyx_XDECREF(__pyx_t_2);
  3087. __Pyx_XDECREF(__pyx_t_5);
  3088. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._closePath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3089. __pyx_r = NULL;
  3090. __pyx_L0:;
  3091. __Pyx_XDECREF(__pyx_v_p0);
  3092. __Pyx_XGIVEREF(__pyx_r);
  3093. __Pyx_RefNannyFinishContext();
  3094. return __pyx_r;
  3095. }
  3096. /* "fontTools/pens/momentsPen.py":34
  3097. * self._lineTo(self._startPoint)
  3098. *
  3099. * def _endPath(self): # <<<<<<<<<<<<<<
  3100. * p0 = self._getCurrentPoint()
  3101. * if p0 != self._startPoint:
  3102. */
  3103. /* Python wrapper */
  3104. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath(PyObject *__pyx_self,
  3105. #if CYTHON_METH_FASTCALL
  3106. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3107. #else
  3108. PyObject *__pyx_args, PyObject *__pyx_kwds
  3109. #endif
  3110. ); /*proto*/
  3111. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath, "MomentsPen._endPath(self)");
  3112. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath = {"_endPath", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath};
  3113. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath(PyObject *__pyx_self,
  3114. #if CYTHON_METH_FASTCALL
  3115. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3116. #else
  3117. PyObject *__pyx_args, PyObject *__pyx_kwds
  3118. #endif
  3119. ) {
  3120. PyObject *__pyx_v_self = 0;
  3121. #if !CYTHON_METH_FASTCALL
  3122. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3123. #endif
  3124. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3125. PyObject* values[1] = {0};
  3126. int __pyx_lineno = 0;
  3127. const char *__pyx_filename = NULL;
  3128. int __pyx_clineno = 0;
  3129. PyObject *__pyx_r = 0;
  3130. __Pyx_RefNannyDeclarations
  3131. __Pyx_RefNannySetupContext("_endPath (wrapper)", 0);
  3132. #if !CYTHON_METH_FASTCALL
  3133. #if CYTHON_ASSUME_SAFE_SIZE
  3134. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3135. #else
  3136. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3137. #endif
  3138. #endif
  3139. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3140. {
  3141. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,0};
  3142. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  3143. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 34, __pyx_L3_error)
  3144. if (__pyx_kwds_len > 0) {
  3145. switch (__pyx_nargs) {
  3146. case 1:
  3147. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3148. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 34, __pyx_L3_error)
  3149. CYTHON_FALLTHROUGH;
  3150. case 0: break;
  3151. default: goto __pyx_L5_argtuple_error;
  3152. }
  3153. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3154. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_endPath", 0) < (0)) __PYX_ERR(0, 34, __pyx_L3_error)
  3155. for (Py_ssize_t i = __pyx_nargs; i < 1; i++) {
  3156. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_endPath", 1, 1, 1, i); __PYX_ERR(0, 34, __pyx_L3_error) }
  3157. }
  3158. } else if (unlikely(__pyx_nargs != 1)) {
  3159. goto __pyx_L5_argtuple_error;
  3160. } else {
  3161. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3162. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 34, __pyx_L3_error)
  3163. }
  3164. __pyx_v_self = values[0];
  3165. }
  3166. goto __pyx_L6_skip;
  3167. __pyx_L5_argtuple_error:;
  3168. __Pyx_RaiseArgtupleInvalid("_endPath", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 34, __pyx_L3_error)
  3169. __pyx_L6_skip:;
  3170. goto __pyx_L4_argument_unpacking_done;
  3171. __pyx_L3_error:;
  3172. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3173. Py_XDECREF(values[__pyx_temp]);
  3174. }
  3175. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._endPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3176. __Pyx_RefNannyFinishContext();
  3177. return NULL;
  3178. __pyx_L4_argument_unpacking_done:;
  3179. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(__pyx_self, __pyx_v_self);
  3180. /* function exit code */
  3181. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3182. Py_XDECREF(values[__pyx_temp]);
  3183. }
  3184. __Pyx_RefNannyFinishContext();
  3185. return __pyx_r;
  3186. }
  3187. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  3188. PyObject *__pyx_v_p0 = NULL;
  3189. PyObject *__pyx_r = NULL;
  3190. __Pyx_RefNannyDeclarations
  3191. PyObject *__pyx_t_1 = NULL;
  3192. PyObject *__pyx_t_2 = NULL;
  3193. size_t __pyx_t_3;
  3194. int __pyx_t_4;
  3195. PyObject *__pyx_t_5 = NULL;
  3196. int __pyx_lineno = 0;
  3197. const char *__pyx_filename = NULL;
  3198. int __pyx_clineno = 0;
  3199. __Pyx_RefNannySetupContext("_endPath", 0);
  3200. /* "fontTools/pens/momentsPen.py":35
  3201. *
  3202. * def _endPath(self):
  3203. * p0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  3204. * if p0 != self._startPoint:
  3205. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  3206. */
  3207. __pyx_t_2 = __pyx_v_self;
  3208. __Pyx_INCREF(__pyx_t_2);
  3209. __pyx_t_3 = 0;
  3210. {
  3211. PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
  3212. __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrentPoint, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  3213. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3214. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
  3215. __Pyx_GOTREF(__pyx_t_1);
  3216. }
  3217. __pyx_v_p0 = __pyx_t_1;
  3218. __pyx_t_1 = 0;
  3219. /* "fontTools/pens/momentsPen.py":36
  3220. * def _endPath(self):
  3221. * p0 = self._getCurrentPoint()
  3222. * if p0 != self._startPoint: # <<<<<<<<<<<<<<
  3223. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  3224. *
  3225. */
  3226. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_startPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 36, __pyx_L1_error)
  3227. __Pyx_GOTREF(__pyx_t_1);
  3228. __pyx_t_2 = PyObject_RichCompare(__pyx_v_p0, __pyx_t_1, Py_NE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  3229. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3230. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 36, __pyx_L1_error)
  3231. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3232. if (unlikely(__pyx_t_4)) {
  3233. /* "fontTools/pens/momentsPen.py":37
  3234. * p0 = self._getCurrentPoint()
  3235. * if p0 != self._startPoint:
  3236. * raise OpenContourError("Glyph statistics is not defined on open contours.") # <<<<<<<<<<<<<<
  3237. *
  3238. * @cython.locals(r0=cython.double)
  3239. */
  3240. __pyx_t_1 = NULL;
  3241. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_mstate_global->__pyx_n_u_OpenContourError); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 37, __pyx_L1_error)
  3242. __Pyx_GOTREF(__pyx_t_5);
  3243. __pyx_t_3 = 1;
  3244. #if CYTHON_UNPACK_METHODS
  3245. if (unlikely(PyMethod_Check(__pyx_t_5))) {
  3246. __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
  3247. assert(__pyx_t_1);
  3248. PyObject* __pyx__function = PyMethod_GET_FUNCTION(__pyx_t_5);
  3249. __Pyx_INCREF(__pyx_t_1);
  3250. __Pyx_INCREF(__pyx__function);
  3251. __Pyx_DECREF_SET(__pyx_t_5, __pyx__function);
  3252. __pyx_t_3 = 0;
  3253. }
  3254. #endif
  3255. {
  3256. PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_mstate_global->__pyx_kp_u_Glyph_statistics_is_not_defined};
  3257. __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_5, __pyx_callargs+__pyx_t_3, (2-__pyx_t_3) | (__pyx_t_3*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  3258. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  3259. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3260. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
  3261. __Pyx_GOTREF(__pyx_t_2);
  3262. }
  3263. __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  3264. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3265. __PYX_ERR(0, 37, __pyx_L1_error)
  3266. /* "fontTools/pens/momentsPen.py":36
  3267. * def _endPath(self):
  3268. * p0 = self._getCurrentPoint()
  3269. * if p0 != self._startPoint: # <<<<<<<<<<<<<<
  3270. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  3271. *
  3272. */
  3273. }
  3274. /* "fontTools/pens/momentsPen.py":34
  3275. * self._lineTo(self._startPoint)
  3276. *
  3277. * def _endPath(self): # <<<<<<<<<<<<<<
  3278. * p0 = self._getCurrentPoint()
  3279. * if p0 != self._startPoint:
  3280. */
  3281. /* function exit code */
  3282. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3283. goto __pyx_L0;
  3284. __pyx_L1_error:;
  3285. __Pyx_XDECREF(__pyx_t_1);
  3286. __Pyx_XDECREF(__pyx_t_2);
  3287. __Pyx_XDECREF(__pyx_t_5);
  3288. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._endPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3289. __pyx_r = NULL;
  3290. __pyx_L0:;
  3291. __Pyx_XDECREF(__pyx_v_p0);
  3292. __Pyx_XGIVEREF(__pyx_r);
  3293. __Pyx_RefNannyFinishContext();
  3294. return __pyx_r;
  3295. }
  3296. /* "fontTools/pens/momentsPen.py":39
  3297. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  3298. *
  3299. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  3300. * @cython.locals(r1=cython.double)
  3301. * @cython.locals(r2=cython.double)
  3302. */
  3303. /* Python wrapper */
  3304. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo(PyObject *__pyx_self,
  3305. #if CYTHON_METH_FASTCALL
  3306. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3307. #else
  3308. PyObject *__pyx_args, PyObject *__pyx_kwds
  3309. #endif
  3310. ); /*proto*/
  3311. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo, "MomentsPen._lineTo(self, p1)");
  3312. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo = {"_lineTo", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo};
  3313. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo(PyObject *__pyx_self,
  3314. #if CYTHON_METH_FASTCALL
  3315. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3316. #else
  3317. PyObject *__pyx_args, PyObject *__pyx_kwds
  3318. #endif
  3319. ) {
  3320. PyObject *__pyx_v_self = 0;
  3321. PyObject *__pyx_v_p1 = 0;
  3322. #if !CYTHON_METH_FASTCALL
  3323. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3324. #endif
  3325. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3326. PyObject* values[2] = {0,0};
  3327. int __pyx_lineno = 0;
  3328. const char *__pyx_filename = NULL;
  3329. int __pyx_clineno = 0;
  3330. PyObject *__pyx_r = 0;
  3331. __Pyx_RefNannyDeclarations
  3332. __Pyx_RefNannySetupContext("_lineTo (wrapper)", 0);
  3333. #if !CYTHON_METH_FASTCALL
  3334. #if CYTHON_ASSUME_SAFE_SIZE
  3335. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3336. #else
  3337. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3338. #endif
  3339. #endif
  3340. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3341. {
  3342. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_p1,0};
  3343. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  3344. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 39, __pyx_L3_error)
  3345. if (__pyx_kwds_len > 0) {
  3346. switch (__pyx_nargs) {
  3347. case 2:
  3348. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  3349. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 39, __pyx_L3_error)
  3350. CYTHON_FALLTHROUGH;
  3351. case 1:
  3352. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3353. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 39, __pyx_L3_error)
  3354. CYTHON_FALLTHROUGH;
  3355. case 0: break;
  3356. default: goto __pyx_L5_argtuple_error;
  3357. }
  3358. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3359. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_lineTo", 0) < (0)) __PYX_ERR(0, 39, __pyx_L3_error)
  3360. for (Py_ssize_t i = __pyx_nargs; i < 2; i++) {
  3361. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_lineTo", 1, 2, 2, i); __PYX_ERR(0, 39, __pyx_L3_error) }
  3362. }
  3363. } else if (unlikely(__pyx_nargs != 2)) {
  3364. goto __pyx_L5_argtuple_error;
  3365. } else {
  3366. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3367. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 39, __pyx_L3_error)
  3368. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  3369. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 39, __pyx_L3_error)
  3370. }
  3371. __pyx_v_self = values[0];
  3372. __pyx_v_p1 = values[1];
  3373. }
  3374. goto __pyx_L6_skip;
  3375. __pyx_L5_argtuple_error:;
  3376. __Pyx_RaiseArgtupleInvalid("_lineTo", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 39, __pyx_L3_error)
  3377. __pyx_L6_skip:;
  3378. goto __pyx_L4_argument_unpacking_done;
  3379. __pyx_L3_error:;
  3380. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3381. Py_XDECREF(values[__pyx_temp]);
  3382. }
  3383. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._lineTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3384. __Pyx_RefNannyFinishContext();
  3385. return NULL;
  3386. __pyx_L4_argument_unpacking_done:;
  3387. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(__pyx_self, __pyx_v_self, __pyx_v_p1);
  3388. /* function exit code */
  3389. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3390. Py_XDECREF(values[__pyx_temp]);
  3391. }
  3392. __Pyx_RefNannyFinishContext();
  3393. return __pyx_r;
  3394. }
  3395. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1) {
  3396. double __pyx_v_x1;
  3397. double __pyx_v_y1;
  3398. double __pyx_v_x0;
  3399. double __pyx_v_y0;
  3400. double __pyx_v_r12;
  3401. double __pyx_v_r11;
  3402. double __pyx_v_r10;
  3403. double __pyx_v_r9;
  3404. double __pyx_v_r8;
  3405. double __pyx_v_r7;
  3406. double __pyx_v_r6;
  3407. double __pyx_v_r5;
  3408. double __pyx_v_r4;
  3409. double __pyx_v_r3;
  3410. double __pyx_v_r2;
  3411. double __pyx_v_r1;
  3412. double __pyx_v_r0;
  3413. PyObject *__pyx_r = NULL;
  3414. __Pyx_RefNannyDeclarations
  3415. PyObject *__pyx_t_1 = NULL;
  3416. PyObject *__pyx_t_2 = NULL;
  3417. size_t __pyx_t_3;
  3418. PyObject *__pyx_t_4 = NULL;
  3419. PyObject *__pyx_t_5 = NULL;
  3420. PyObject *(*__pyx_t_6)(PyObject *);
  3421. double __pyx_t_7;
  3422. double __pyx_t_8;
  3423. int __pyx_lineno = 0;
  3424. const char *__pyx_filename = NULL;
  3425. int __pyx_clineno = 0;
  3426. __Pyx_RefNannySetupContext("_lineTo", 0);
  3427. /* "fontTools/pens/momentsPen.py":55
  3428. * @cython.locals(x1=cython.double, y1=cython.double)
  3429. * def _lineTo(self, p1):
  3430. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  3431. * x1, y1 = p1
  3432. *
  3433. */
  3434. __pyx_t_2 = __pyx_v_self;
  3435. __Pyx_INCREF(__pyx_t_2);
  3436. __pyx_t_3 = 0;
  3437. {
  3438. PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
  3439. __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrentPoint, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  3440. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3441. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
  3442. __Pyx_GOTREF(__pyx_t_1);
  3443. }
  3444. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  3445. PyObject* sequence = __pyx_t_1;
  3446. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  3447. if (unlikely(size != 2)) {
  3448. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  3449. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  3450. __PYX_ERR(0, 55, __pyx_L1_error)
  3451. }
  3452. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  3453. if (likely(PyTuple_CheckExact(sequence))) {
  3454. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  3455. __Pyx_INCREF(__pyx_t_2);
  3456. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  3457. __Pyx_INCREF(__pyx_t_4);
  3458. } else {
  3459. __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  3460. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  3461. __Pyx_XGOTREF(__pyx_t_2);
  3462. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  3463. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  3464. __Pyx_XGOTREF(__pyx_t_4);
  3465. }
  3466. #else
  3467. __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
  3468. __Pyx_GOTREF(__pyx_t_2);
  3469. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 55, __pyx_L1_error)
  3470. __Pyx_GOTREF(__pyx_t_4);
  3471. #endif
  3472. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3473. } else {
  3474. Py_ssize_t index = -1;
  3475. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 55, __pyx_L1_error)
  3476. __Pyx_GOTREF(__pyx_t_5);
  3477. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3478. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  3479. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  3480. __Pyx_GOTREF(__pyx_t_2);
  3481. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
  3482. __Pyx_GOTREF(__pyx_t_4);
  3483. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 55, __pyx_L1_error)
  3484. __pyx_t_6 = NULL;
  3485. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3486. goto __pyx_L4_unpacking_done;
  3487. __pyx_L3_unpacking_failed:;
  3488. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  3489. __pyx_t_6 = NULL;
  3490. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  3491. __PYX_ERR(0, 55, __pyx_L1_error)
  3492. __pyx_L4_unpacking_done:;
  3493. }
  3494. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
  3495. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3496. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L1_error)
  3497. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3498. __pyx_v_x0 = __pyx_t_7;
  3499. __pyx_v_y0 = __pyx_t_8;
  3500. /* "fontTools/pens/momentsPen.py":56
  3501. * def _lineTo(self, p1):
  3502. * x0, y0 = self._getCurrentPoint()
  3503. * x1, y1 = p1 # <<<<<<<<<<<<<<
  3504. *
  3505. * r0 = x1 * y0
  3506. */
  3507. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  3508. PyObject* sequence = __pyx_v_p1;
  3509. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  3510. if (unlikely(size != 2)) {
  3511. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  3512. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  3513. __PYX_ERR(0, 56, __pyx_L1_error)
  3514. }
  3515. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  3516. if (likely(PyTuple_CheckExact(sequence))) {
  3517. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  3518. __Pyx_INCREF(__pyx_t_1);
  3519. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  3520. __Pyx_INCREF(__pyx_t_4);
  3521. } else {
  3522. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  3523. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  3524. __Pyx_XGOTREF(__pyx_t_1);
  3525. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  3526. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
  3527. __Pyx_XGOTREF(__pyx_t_4);
  3528. }
  3529. #else
  3530. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  3531. __Pyx_GOTREF(__pyx_t_1);
  3532. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
  3533. __Pyx_GOTREF(__pyx_t_4);
  3534. #endif
  3535. } else {
  3536. Py_ssize_t index = -1;
  3537. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  3538. __Pyx_GOTREF(__pyx_t_2);
  3539. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  3540. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  3541. __Pyx_GOTREF(__pyx_t_1);
  3542. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
  3543. __Pyx_GOTREF(__pyx_t_4);
  3544. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 56, __pyx_L1_error)
  3545. __pyx_t_6 = NULL;
  3546. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3547. goto __pyx_L6_unpacking_done;
  3548. __pyx_L5_unpacking_failed:;
  3549. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3550. __pyx_t_6 = NULL;
  3551. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  3552. __PYX_ERR(0, 56, __pyx_L1_error)
  3553. __pyx_L6_unpacking_done:;
  3554. }
  3555. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
  3556. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3557. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
  3558. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3559. __pyx_v_x1 = __pyx_t_8;
  3560. __pyx_v_y1 = __pyx_t_7;
  3561. /* "fontTools/pens/momentsPen.py":58
  3562. * x1, y1 = p1
  3563. *
  3564. * r0 = x1 * y0 # <<<<<<<<<<<<<<
  3565. * r1 = x1 * y1
  3566. * r2 = x1**2
  3567. */
  3568. __pyx_v_r0 = (__pyx_v_x1 * __pyx_v_y0);
  3569. /* "fontTools/pens/momentsPen.py":59
  3570. *
  3571. * r0 = x1 * y0
  3572. * r1 = x1 * y1 # <<<<<<<<<<<<<<
  3573. * r2 = x1**2
  3574. * r3 = r2 * y1
  3575. */
  3576. __pyx_v_r1 = (__pyx_v_x1 * __pyx_v_y1);
  3577. /* "fontTools/pens/momentsPen.py":60
  3578. * r0 = x1 * y0
  3579. * r1 = x1 * y1
  3580. * r2 = x1**2 # <<<<<<<<<<<<<<
  3581. * r3 = r2 * y1
  3582. * r4 = y0 - y1
  3583. */
  3584. __pyx_v_r2 = pow(__pyx_v_x1, 2.0);
  3585. /* "fontTools/pens/momentsPen.py":61
  3586. * r1 = x1 * y1
  3587. * r2 = x1**2
  3588. * r3 = r2 * y1 # <<<<<<<<<<<<<<
  3589. * r4 = y0 - y1
  3590. * r5 = r4 * x0
  3591. */
  3592. __pyx_v_r3 = (__pyx_v_r2 * __pyx_v_y1);
  3593. /* "fontTools/pens/momentsPen.py":62
  3594. * r2 = x1**2
  3595. * r3 = r2 * y1
  3596. * r4 = y0 - y1 # <<<<<<<<<<<<<<
  3597. * r5 = r4 * x0
  3598. * r6 = x0**2
  3599. */
  3600. __pyx_v_r4 = (__pyx_v_y0 - __pyx_v_y1);
  3601. /* "fontTools/pens/momentsPen.py":63
  3602. * r3 = r2 * y1
  3603. * r4 = y0 - y1
  3604. * r5 = r4 * x0 # <<<<<<<<<<<<<<
  3605. * r6 = x0**2
  3606. * r7 = 2 * y0
  3607. */
  3608. __pyx_v_r5 = (__pyx_v_r4 * __pyx_v_x0);
  3609. /* "fontTools/pens/momentsPen.py":64
  3610. * r4 = y0 - y1
  3611. * r5 = r4 * x0
  3612. * r6 = x0**2 # <<<<<<<<<<<<<<
  3613. * r7 = 2 * y0
  3614. * r8 = y0**2
  3615. */
  3616. __pyx_v_r6 = pow(__pyx_v_x0, 2.0);
  3617. /* "fontTools/pens/momentsPen.py":65
  3618. * r5 = r4 * x0
  3619. * r6 = x0**2
  3620. * r7 = 2 * y0 # <<<<<<<<<<<<<<
  3621. * r8 = y0**2
  3622. * r9 = y1**2
  3623. */
  3624. __pyx_v_r7 = (2.0 * __pyx_v_y0);
  3625. /* "fontTools/pens/momentsPen.py":66
  3626. * r6 = x0**2
  3627. * r7 = 2 * y0
  3628. * r8 = y0**2 # <<<<<<<<<<<<<<
  3629. * r9 = y1**2
  3630. * r10 = x1**3
  3631. */
  3632. __pyx_v_r8 = pow(__pyx_v_y0, 2.0);
  3633. /* "fontTools/pens/momentsPen.py":67
  3634. * r7 = 2 * y0
  3635. * r8 = y0**2
  3636. * r9 = y1**2 # <<<<<<<<<<<<<<
  3637. * r10 = x1**3
  3638. * r11 = y0**3
  3639. */
  3640. __pyx_v_r9 = pow(__pyx_v_y1, 2.0);
  3641. /* "fontTools/pens/momentsPen.py":68
  3642. * r8 = y0**2
  3643. * r9 = y1**2
  3644. * r10 = x1**3 # <<<<<<<<<<<<<<
  3645. * r11 = y0**3
  3646. * r12 = y1**3
  3647. */
  3648. __pyx_v_r10 = pow(__pyx_v_x1, 3.0);
  3649. /* "fontTools/pens/momentsPen.py":69
  3650. * r9 = y1**2
  3651. * r10 = x1**3
  3652. * r11 = y0**3 # <<<<<<<<<<<<<<
  3653. * r12 = y1**3
  3654. *
  3655. */
  3656. __pyx_v_r11 = pow(__pyx_v_y0, 3.0);
  3657. /* "fontTools/pens/momentsPen.py":70
  3658. * r10 = x1**3
  3659. * r11 = y0**3
  3660. * r12 = y1**3 # <<<<<<<<<<<<<<
  3661. *
  3662. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  3663. */
  3664. __pyx_v_r12 = pow(__pyx_v_y1, 3.0);
  3665. /* "fontTools/pens/momentsPen.py":72
  3666. * r12 = y1**3
  3667. *
  3668. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2 # <<<<<<<<<<<<<<
  3669. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  3670. * self.momentY += (
  3671. */
  3672. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 72, __pyx_L1_error)
  3673. __Pyx_GOTREF(__pyx_t_4);
  3674. __pyx_t_1 = PyFloat_FromDouble(((((-__pyx_v_r0) / 2.0) - (__pyx_v_r1 / 2.0)) + ((__pyx_v_x0 * (__pyx_v_y0 + __pyx_v_y1)) / 2.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 72, __pyx_L1_error)
  3675. __Pyx_GOTREF(__pyx_t_1);
  3676. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 72, __pyx_L1_error)
  3677. __Pyx_GOTREF(__pyx_t_2);
  3678. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3679. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3680. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area, __pyx_t_2) < (0)) __PYX_ERR(0, 72, __pyx_L1_error)
  3681. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3682. /* "fontTools/pens/momentsPen.py":73
  3683. *
  3684. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  3685. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6 # <<<<<<<<<<<<<<
  3686. * self.momentY += (
  3687. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  3688. */
  3689. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
  3690. __Pyx_GOTREF(__pyx_t_2);
  3691. __pyx_t_1 = PyFloat_FromDouble(((((((-__pyx_v_r2) * __pyx_v_y0) / 6.0) - (__pyx_v_r3 / 3.0)) - ((__pyx_v_r5 * __pyx_v_x1) / 6.0)) + ((__pyx_v_r6 * (__pyx_v_r7 + __pyx_v_y1)) / 6.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
  3692. __Pyx_GOTREF(__pyx_t_1);
  3693. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
  3694. __Pyx_GOTREF(__pyx_t_4);
  3695. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3696. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3697. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX, __pyx_t_4) < (0)) __PYX_ERR(0, 73, __pyx_L1_error)
  3698. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3699. /* "fontTools/pens/momentsPen.py":74
  3700. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  3701. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  3702. * self.momentY += ( # <<<<<<<<<<<<<<
  3703. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  3704. * )
  3705. */
  3706. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 74, __pyx_L1_error)
  3707. __Pyx_GOTREF(__pyx_t_4);
  3708. /* "fontTools/pens/momentsPen.py":75
  3709. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  3710. * self.momentY += (
  3711. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6 # <<<<<<<<<<<<<<
  3712. * )
  3713. * self.momentXX += (
  3714. */
  3715. __pyx_t_1 = PyFloat_FromDouble(((((((-__pyx_v_r0) * __pyx_v_y1) / 6.0) - ((__pyx_v_r8 * __pyx_v_x1) / 6.0)) - ((__pyx_v_r9 * __pyx_v_x1) / 6.0)) + ((__pyx_v_x0 * ((__pyx_v_r8 + __pyx_v_r9) + (__pyx_v_y0 * __pyx_v_y1))) / 6.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 75, __pyx_L1_error)
  3716. __Pyx_GOTREF(__pyx_t_1);
  3717. /* "fontTools/pens/momentsPen.py":74
  3718. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  3719. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  3720. * self.momentY += ( # <<<<<<<<<<<<<<
  3721. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  3722. * )
  3723. */
  3724. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
  3725. __Pyx_GOTREF(__pyx_t_2);
  3726. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3727. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3728. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY, __pyx_t_2) < (0)) __PYX_ERR(0, 74, __pyx_L1_error)
  3729. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3730. /* "fontTools/pens/momentsPen.py":77
  3731. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  3732. * )
  3733. * self.momentXX += ( # <<<<<<<<<<<<<<
  3734. * -r10 * y0 / 12
  3735. * - r10 * y1 / 4
  3736. */
  3737. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 77, __pyx_L1_error)
  3738. __Pyx_GOTREF(__pyx_t_2);
  3739. /* "fontTools/pens/momentsPen.py":82
  3740. * - r2 * r5 / 12
  3741. * - r4 * r6 * x1 / 12
  3742. * + x0**3 * (3 * y0 + y1) / 12 # <<<<<<<<<<<<<<
  3743. * )
  3744. * self.momentXY += (
  3745. */
  3746. __pyx_t_1 = PyFloat_FromDouble((((((((-__pyx_v_r10) * __pyx_v_y0) / 12.0) - ((__pyx_v_r10 * __pyx_v_y1) / 4.0)) - ((__pyx_v_r2 * __pyx_v_r5) / 12.0)) - (((__pyx_v_r4 * __pyx_v_r6) * __pyx_v_x1) / 12.0)) + ((pow(__pyx_v_x0, 3.0) * ((3.0 * __pyx_v_y0) + __pyx_v_y1)) / 12.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
  3747. __Pyx_GOTREF(__pyx_t_1);
  3748. /* "fontTools/pens/momentsPen.py":77
  3749. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  3750. * )
  3751. * self.momentXX += ( # <<<<<<<<<<<<<<
  3752. * -r10 * y0 / 12
  3753. * - r10 * y1 / 4
  3754. */
  3755. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 77, __pyx_L1_error)
  3756. __Pyx_GOTREF(__pyx_t_4);
  3757. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3758. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3759. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX, __pyx_t_4) < (0)) __PYX_ERR(0, 77, __pyx_L1_error)
  3760. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3761. /* "fontTools/pens/momentsPen.py":84
  3762. * + x0**3 * (3 * y0 + y1) / 12
  3763. * )
  3764. * self.momentXY += ( # <<<<<<<<<<<<<<
  3765. * -r2 * r8 / 24
  3766. * - r2 * r9 / 8
  3767. */
  3768. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 84, __pyx_L1_error)
  3769. __Pyx_GOTREF(__pyx_t_4);
  3770. /* "fontTools/pens/momentsPen.py":89
  3771. * - r3 * r7 / 24
  3772. * + r6 * (r7 * y1 + 3 * r8 + r9) / 24
  3773. * - x0 * x1 * (r8 - r9) / 12 # <<<<<<<<<<<<<<
  3774. * )
  3775. * self.momentYY += (
  3776. */
  3777. __pyx_t_1 = PyFloat_FromDouble((((((((-__pyx_v_r2) * __pyx_v_r8) / 24.0) - ((__pyx_v_r2 * __pyx_v_r9) / 8.0)) - ((__pyx_v_r3 * __pyx_v_r7) / 24.0)) + ((__pyx_v_r6 * (((__pyx_v_r7 * __pyx_v_y1) + (3.0 * __pyx_v_r8)) + __pyx_v_r9)) / 24.0)) - (((__pyx_v_x0 * __pyx_v_x1) * (__pyx_v_r8 - __pyx_v_r9)) / 12.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  3778. __Pyx_GOTREF(__pyx_t_1);
  3779. /* "fontTools/pens/momentsPen.py":84
  3780. * + x0**3 * (3 * y0 + y1) / 12
  3781. * )
  3782. * self.momentXY += ( # <<<<<<<<<<<<<<
  3783. * -r2 * r8 / 24
  3784. * - r2 * r9 / 8
  3785. */
  3786. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 84, __pyx_L1_error)
  3787. __Pyx_GOTREF(__pyx_t_2);
  3788. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3789. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3790. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY, __pyx_t_2) < (0)) __PYX_ERR(0, 84, __pyx_L1_error)
  3791. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3792. /* "fontTools/pens/momentsPen.py":91
  3793. * - x0 * x1 * (r8 - r9) / 12
  3794. * )
  3795. * self.momentYY += ( # <<<<<<<<<<<<<<
  3796. * -r0 * r9 / 12
  3797. * - r1 * r8 / 12
  3798. */
  3799. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
  3800. __Pyx_GOTREF(__pyx_t_2);
  3801. /* "fontTools/pens/momentsPen.py":96
  3802. * - r11 * x1 / 12
  3803. * - r12 * x1 / 12
  3804. * + x0 * (r11 + r12 + r8 * y1 + r9 * y0) / 12 # <<<<<<<<<<<<<<
  3805. * )
  3806. *
  3807. */
  3808. __pyx_t_1 = PyFloat_FromDouble((((((((-__pyx_v_r0) * __pyx_v_r9) / 12.0) - ((__pyx_v_r1 * __pyx_v_r8) / 12.0)) - ((__pyx_v_r11 * __pyx_v_x1) / 12.0)) - ((__pyx_v_r12 * __pyx_v_x1) / 12.0)) + ((__pyx_v_x0 * (((__pyx_v_r11 + __pyx_v_r12) + (__pyx_v_r8 * __pyx_v_y1)) + (__pyx_v_r9 * __pyx_v_y0))) / 12.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
  3809. __Pyx_GOTREF(__pyx_t_1);
  3810. /* "fontTools/pens/momentsPen.py":91
  3811. * - x0 * x1 * (r8 - r9) / 12
  3812. * )
  3813. * self.momentYY += ( # <<<<<<<<<<<<<<
  3814. * -r0 * r9 / 12
  3815. * - r1 * r8 / 12
  3816. */
  3817. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
  3818. __Pyx_GOTREF(__pyx_t_4);
  3819. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3820. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3821. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY, __pyx_t_4) < (0)) __PYX_ERR(0, 91, __pyx_L1_error)
  3822. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  3823. /* "fontTools/pens/momentsPen.py":39
  3824. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  3825. *
  3826. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  3827. * @cython.locals(r1=cython.double)
  3828. * @cython.locals(r2=cython.double)
  3829. */
  3830. /* function exit code */
  3831. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3832. goto __pyx_L0;
  3833. __pyx_L1_error:;
  3834. __Pyx_XDECREF(__pyx_t_1);
  3835. __Pyx_XDECREF(__pyx_t_2);
  3836. __Pyx_XDECREF(__pyx_t_4);
  3837. __Pyx_XDECREF(__pyx_t_5);
  3838. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._lineTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3839. __pyx_r = NULL;
  3840. __pyx_L0:;
  3841. __Pyx_XGIVEREF(__pyx_r);
  3842. __Pyx_RefNannyFinishContext();
  3843. return __pyx_r;
  3844. }
  3845. /* "fontTools/pens/momentsPen.py":99
  3846. * )
  3847. *
  3848. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  3849. * @cython.locals(r1=cython.double)
  3850. * @cython.locals(r2=cython.double)
  3851. */
  3852. /* Python wrapper */
  3853. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne(PyObject *__pyx_self,
  3854. #if CYTHON_METH_FASTCALL
  3855. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3856. #else
  3857. PyObject *__pyx_args, PyObject *__pyx_kwds
  3858. #endif
  3859. ); /*proto*/
  3860. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne, "MomentsPen._qCurveToOne(self, p1, p2)");
  3861. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne = {"_qCurveToOne", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne};
  3862. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne(PyObject *__pyx_self,
  3863. #if CYTHON_METH_FASTCALL
  3864. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3865. #else
  3866. PyObject *__pyx_args, PyObject *__pyx_kwds
  3867. #endif
  3868. ) {
  3869. PyObject *__pyx_v_self = 0;
  3870. PyObject *__pyx_v_p1 = 0;
  3871. PyObject *__pyx_v_p2 = 0;
  3872. #if !CYTHON_METH_FASTCALL
  3873. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3874. #endif
  3875. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3876. PyObject* values[3] = {0,0,0};
  3877. int __pyx_lineno = 0;
  3878. const char *__pyx_filename = NULL;
  3879. int __pyx_clineno = 0;
  3880. PyObject *__pyx_r = 0;
  3881. __Pyx_RefNannyDeclarations
  3882. __Pyx_RefNannySetupContext("_qCurveToOne (wrapper)", 0);
  3883. #if !CYTHON_METH_FASTCALL
  3884. #if CYTHON_ASSUME_SAFE_SIZE
  3885. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3886. #else
  3887. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3888. #endif
  3889. #endif
  3890. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3891. {
  3892. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_p1,&__pyx_mstate_global->__pyx_n_u_p2,0};
  3893. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  3894. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 99, __pyx_L3_error)
  3895. if (__pyx_kwds_len > 0) {
  3896. switch (__pyx_nargs) {
  3897. case 3:
  3898. values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
  3899. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 99, __pyx_L3_error)
  3900. CYTHON_FALLTHROUGH;
  3901. case 2:
  3902. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  3903. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 99, __pyx_L3_error)
  3904. CYTHON_FALLTHROUGH;
  3905. case 1:
  3906. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3907. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 99, __pyx_L3_error)
  3908. CYTHON_FALLTHROUGH;
  3909. case 0: break;
  3910. default: goto __pyx_L5_argtuple_error;
  3911. }
  3912. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3913. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_qCurveToOne", 0) < (0)) __PYX_ERR(0, 99, __pyx_L3_error)
  3914. for (Py_ssize_t i = __pyx_nargs; i < 3; i++) {
  3915. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_qCurveToOne", 1, 3, 3, i); __PYX_ERR(0, 99, __pyx_L3_error) }
  3916. }
  3917. } else if (unlikely(__pyx_nargs != 3)) {
  3918. goto __pyx_L5_argtuple_error;
  3919. } else {
  3920. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  3921. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 99, __pyx_L3_error)
  3922. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  3923. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 99, __pyx_L3_error)
  3924. values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
  3925. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 99, __pyx_L3_error)
  3926. }
  3927. __pyx_v_self = values[0];
  3928. __pyx_v_p1 = values[1];
  3929. __pyx_v_p2 = values[2];
  3930. }
  3931. goto __pyx_L6_skip;
  3932. __pyx_L5_argtuple_error:;
  3933. __Pyx_RaiseArgtupleInvalid("_qCurveToOne", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 99, __pyx_L3_error)
  3934. __pyx_L6_skip:;
  3935. goto __pyx_L4_argument_unpacking_done;
  3936. __pyx_L3_error:;
  3937. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3938. Py_XDECREF(values[__pyx_temp]);
  3939. }
  3940. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._qCurveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3941. __Pyx_RefNannyFinishContext();
  3942. return NULL;
  3943. __pyx_L4_argument_unpacking_done:;
  3944. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2);
  3945. /* function exit code */
  3946. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3947. Py_XDECREF(values[__pyx_temp]);
  3948. }
  3949. __Pyx_RefNannyFinishContext();
  3950. return __pyx_r;
  3951. }
  3952. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2) {
  3953. double __pyx_v_x2;
  3954. double __pyx_v_y2;
  3955. double __pyx_v_x1;
  3956. double __pyx_v_y1;
  3957. double __pyx_v_x0;
  3958. double __pyx_v_y0;
  3959. double __pyx_v_r53;
  3960. double __pyx_v_r52;
  3961. double __pyx_v_r51;
  3962. double __pyx_v_r50;
  3963. double __pyx_v_r49;
  3964. double __pyx_v_r48;
  3965. double __pyx_v_r47;
  3966. double __pyx_v_r46;
  3967. double __pyx_v_r45;
  3968. double __pyx_v_r44;
  3969. double __pyx_v_r43;
  3970. double __pyx_v_r42;
  3971. double __pyx_v_r41;
  3972. double __pyx_v_r40;
  3973. double __pyx_v_r39;
  3974. double __pyx_v_r38;
  3975. double __pyx_v_r37;
  3976. double __pyx_v_r36;
  3977. double __pyx_v_r35;
  3978. double __pyx_v_r34;
  3979. double __pyx_v_r33;
  3980. double __pyx_v_r32;
  3981. double __pyx_v_r31;
  3982. double __pyx_v_r30;
  3983. double __pyx_v_r29;
  3984. double __pyx_v_r28;
  3985. double __pyx_v_r27;
  3986. double __pyx_v_r26;
  3987. double __pyx_v_r25;
  3988. double __pyx_v_r24;
  3989. double __pyx_v_r23;
  3990. double __pyx_v_r22;
  3991. double __pyx_v_r21;
  3992. double __pyx_v_r20;
  3993. double __pyx_v_r19;
  3994. double __pyx_v_r18;
  3995. double __pyx_v_r17;
  3996. double __pyx_v_r16;
  3997. double __pyx_v_r15;
  3998. double __pyx_v_r14;
  3999. double __pyx_v_r13;
  4000. double __pyx_v_r12;
  4001. double __pyx_v_r11;
  4002. double __pyx_v_r10;
  4003. double __pyx_v_r9;
  4004. double __pyx_v_r8;
  4005. double __pyx_v_r7;
  4006. double __pyx_v_r6;
  4007. double __pyx_v_r5;
  4008. double __pyx_v_r4;
  4009. double __pyx_v_r3;
  4010. double __pyx_v_r2;
  4011. double __pyx_v_r1;
  4012. double __pyx_v_r0;
  4013. PyObject *__pyx_r = NULL;
  4014. __Pyx_RefNannyDeclarations
  4015. PyObject *__pyx_t_1 = NULL;
  4016. PyObject *__pyx_t_2 = NULL;
  4017. size_t __pyx_t_3;
  4018. PyObject *__pyx_t_4 = NULL;
  4019. PyObject *__pyx_t_5 = NULL;
  4020. PyObject *(*__pyx_t_6)(PyObject *);
  4021. double __pyx_t_7;
  4022. double __pyx_t_8;
  4023. int __pyx_lineno = 0;
  4024. const char *__pyx_filename = NULL;
  4025. int __pyx_clineno = 0;
  4026. __Pyx_RefNannySetupContext("_qCurveToOne", 0);
  4027. /* "fontTools/pens/momentsPen.py":157
  4028. * @cython.locals(x2=cython.double, y2=cython.double)
  4029. * def _qCurveToOne(self, p1, p2):
  4030. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  4031. * x1, y1 = p1
  4032. * x2, y2 = p2
  4033. */
  4034. __pyx_t_2 = __pyx_v_self;
  4035. __Pyx_INCREF(__pyx_t_2);
  4036. __pyx_t_3 = 0;
  4037. {
  4038. PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
  4039. __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrentPoint, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  4040. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  4041. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
  4042. __Pyx_GOTREF(__pyx_t_1);
  4043. }
  4044. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  4045. PyObject* sequence = __pyx_t_1;
  4046. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4047. if (unlikely(size != 2)) {
  4048. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4049. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4050. __PYX_ERR(0, 157, __pyx_L1_error)
  4051. }
  4052. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4053. if (likely(PyTuple_CheckExact(sequence))) {
  4054. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  4055. __Pyx_INCREF(__pyx_t_2);
  4056. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  4057. __Pyx_INCREF(__pyx_t_4);
  4058. } else {
  4059. __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  4060. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  4061. __Pyx_XGOTREF(__pyx_t_2);
  4062. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  4063. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  4064. __Pyx_XGOTREF(__pyx_t_4);
  4065. }
  4066. #else
  4067. __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 157, __pyx_L1_error)
  4068. __Pyx_GOTREF(__pyx_t_2);
  4069. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
  4070. __Pyx_GOTREF(__pyx_t_4);
  4071. #endif
  4072. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4073. } else {
  4074. Py_ssize_t index = -1;
  4075. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 157, __pyx_L1_error)
  4076. __Pyx_GOTREF(__pyx_t_5);
  4077. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4078. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  4079. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  4080. __Pyx_GOTREF(__pyx_t_2);
  4081. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
  4082. __Pyx_GOTREF(__pyx_t_4);
  4083. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 157, __pyx_L1_error)
  4084. __pyx_t_6 = NULL;
  4085. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4086. goto __pyx_L4_unpacking_done;
  4087. __pyx_L3_unpacking_failed:;
  4088. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4089. __pyx_t_6 = NULL;
  4090. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4091. __PYX_ERR(0, 157, __pyx_L1_error)
  4092. __pyx_L4_unpacking_done:;
  4093. }
  4094. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
  4095. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4096. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
  4097. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4098. __pyx_v_x0 = __pyx_t_7;
  4099. __pyx_v_y0 = __pyx_t_8;
  4100. /* "fontTools/pens/momentsPen.py":158
  4101. * def _qCurveToOne(self, p1, p2):
  4102. * x0, y0 = self._getCurrentPoint()
  4103. * x1, y1 = p1 # <<<<<<<<<<<<<<
  4104. * x2, y2 = p2
  4105. *
  4106. */
  4107. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  4108. PyObject* sequence = __pyx_v_p1;
  4109. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4110. if (unlikely(size != 2)) {
  4111. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4112. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4113. __PYX_ERR(0, 158, __pyx_L1_error)
  4114. }
  4115. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4116. if (likely(PyTuple_CheckExact(sequence))) {
  4117. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  4118. __Pyx_INCREF(__pyx_t_1);
  4119. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  4120. __Pyx_INCREF(__pyx_t_4);
  4121. } else {
  4122. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  4123. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  4124. __Pyx_XGOTREF(__pyx_t_1);
  4125. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  4126. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  4127. __Pyx_XGOTREF(__pyx_t_4);
  4128. }
  4129. #else
  4130. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
  4131. __Pyx_GOTREF(__pyx_t_1);
  4132. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
  4133. __Pyx_GOTREF(__pyx_t_4);
  4134. #endif
  4135. } else {
  4136. Py_ssize_t index = -1;
  4137. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
  4138. __Pyx_GOTREF(__pyx_t_2);
  4139. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  4140. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  4141. __Pyx_GOTREF(__pyx_t_1);
  4142. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
  4143. __Pyx_GOTREF(__pyx_t_4);
  4144. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 158, __pyx_L1_error)
  4145. __pyx_t_6 = NULL;
  4146. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4147. goto __pyx_L6_unpacking_done;
  4148. __pyx_L5_unpacking_failed:;
  4149. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4150. __pyx_t_6 = NULL;
  4151. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4152. __PYX_ERR(0, 158, __pyx_L1_error)
  4153. __pyx_L6_unpacking_done:;
  4154. }
  4155. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
  4156. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4157. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
  4158. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4159. __pyx_v_x1 = __pyx_t_8;
  4160. __pyx_v_y1 = __pyx_t_7;
  4161. /* "fontTools/pens/momentsPen.py":159
  4162. * x0, y0 = self._getCurrentPoint()
  4163. * x1, y1 = p1
  4164. * x2, y2 = p2 # <<<<<<<<<<<<<<
  4165. *
  4166. * r0 = 2 * y1
  4167. */
  4168. if ((likely(PyTuple_CheckExact(__pyx_v_p2))) || (PyList_CheckExact(__pyx_v_p2))) {
  4169. PyObject* sequence = __pyx_v_p2;
  4170. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4171. if (unlikely(size != 2)) {
  4172. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4173. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4174. __PYX_ERR(0, 159, __pyx_L1_error)
  4175. }
  4176. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4177. if (likely(PyTuple_CheckExact(sequence))) {
  4178. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
  4179. __Pyx_INCREF(__pyx_t_4);
  4180. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
  4181. __Pyx_INCREF(__pyx_t_1);
  4182. } else {
  4183. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  4184. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
  4185. __Pyx_XGOTREF(__pyx_t_4);
  4186. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  4187. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  4188. __Pyx_XGOTREF(__pyx_t_1);
  4189. }
  4190. #else
  4191. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
  4192. __Pyx_GOTREF(__pyx_t_4);
  4193. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  4194. __Pyx_GOTREF(__pyx_t_1);
  4195. #endif
  4196. } else {
  4197. Py_ssize_t index = -1;
  4198. __pyx_t_2 = PyObject_GetIter(__pyx_v_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  4199. __Pyx_GOTREF(__pyx_t_2);
  4200. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  4201. index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
  4202. __Pyx_GOTREF(__pyx_t_4);
  4203. index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
  4204. __Pyx_GOTREF(__pyx_t_1);
  4205. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 159, __pyx_L1_error)
  4206. __pyx_t_6 = NULL;
  4207. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4208. goto __pyx_L8_unpacking_done;
  4209. __pyx_L7_unpacking_failed:;
  4210. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4211. __pyx_t_6 = NULL;
  4212. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4213. __PYX_ERR(0, 159, __pyx_L1_error)
  4214. __pyx_L8_unpacking_done:;
  4215. }
  4216. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  4217. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4218. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  4219. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4220. __pyx_v_x2 = __pyx_t_7;
  4221. __pyx_v_y2 = __pyx_t_8;
  4222. /* "fontTools/pens/momentsPen.py":161
  4223. * x2, y2 = p2
  4224. *
  4225. * r0 = 2 * y1 # <<<<<<<<<<<<<<
  4226. * r1 = r0 * x2
  4227. * r2 = x2 * y2
  4228. */
  4229. __pyx_v_r0 = (2.0 * __pyx_v_y1);
  4230. /* "fontTools/pens/momentsPen.py":162
  4231. *
  4232. * r0 = 2 * y1
  4233. * r1 = r0 * x2 # <<<<<<<<<<<<<<
  4234. * r2 = x2 * y2
  4235. * r3 = 3 * r2
  4236. */
  4237. __pyx_v_r1 = (__pyx_v_r0 * __pyx_v_x2);
  4238. /* "fontTools/pens/momentsPen.py":163
  4239. * r0 = 2 * y1
  4240. * r1 = r0 * x2
  4241. * r2 = x2 * y2 # <<<<<<<<<<<<<<
  4242. * r3 = 3 * r2
  4243. * r4 = 2 * x1
  4244. */
  4245. __pyx_v_r2 = (__pyx_v_x2 * __pyx_v_y2);
  4246. /* "fontTools/pens/momentsPen.py":164
  4247. * r1 = r0 * x2
  4248. * r2 = x2 * y2
  4249. * r3 = 3 * r2 # <<<<<<<<<<<<<<
  4250. * r4 = 2 * x1
  4251. * r5 = 3 * y0
  4252. */
  4253. __pyx_v_r3 = (3.0 * __pyx_v_r2);
  4254. /* "fontTools/pens/momentsPen.py":165
  4255. * r2 = x2 * y2
  4256. * r3 = 3 * r2
  4257. * r4 = 2 * x1 # <<<<<<<<<<<<<<
  4258. * r5 = 3 * y0
  4259. * r6 = x1**2
  4260. */
  4261. __pyx_v_r4 = (2.0 * __pyx_v_x1);
  4262. /* "fontTools/pens/momentsPen.py":166
  4263. * r3 = 3 * r2
  4264. * r4 = 2 * x1
  4265. * r5 = 3 * y0 # <<<<<<<<<<<<<<
  4266. * r6 = x1**2
  4267. * r7 = x2**2
  4268. */
  4269. __pyx_v_r5 = (3.0 * __pyx_v_y0);
  4270. /* "fontTools/pens/momentsPen.py":167
  4271. * r4 = 2 * x1
  4272. * r5 = 3 * y0
  4273. * r6 = x1**2 # <<<<<<<<<<<<<<
  4274. * r7 = x2**2
  4275. * r8 = 4 * y1
  4276. */
  4277. __pyx_v_r6 = pow(__pyx_v_x1, 2.0);
  4278. /* "fontTools/pens/momentsPen.py":168
  4279. * r5 = 3 * y0
  4280. * r6 = x1**2
  4281. * r7 = x2**2 # <<<<<<<<<<<<<<
  4282. * r8 = 4 * y1
  4283. * r9 = 10 * y2
  4284. */
  4285. __pyx_v_r7 = pow(__pyx_v_x2, 2.0);
  4286. /* "fontTools/pens/momentsPen.py":169
  4287. * r6 = x1**2
  4288. * r7 = x2**2
  4289. * r8 = 4 * y1 # <<<<<<<<<<<<<<
  4290. * r9 = 10 * y2
  4291. * r10 = 2 * y2
  4292. */
  4293. __pyx_v_r8 = (4.0 * __pyx_v_y1);
  4294. /* "fontTools/pens/momentsPen.py":170
  4295. * r7 = x2**2
  4296. * r8 = 4 * y1
  4297. * r9 = 10 * y2 # <<<<<<<<<<<<<<
  4298. * r10 = 2 * y2
  4299. * r11 = r4 * x2
  4300. */
  4301. __pyx_v_r9 = (10.0 * __pyx_v_y2);
  4302. /* "fontTools/pens/momentsPen.py":171
  4303. * r8 = 4 * y1
  4304. * r9 = 10 * y2
  4305. * r10 = 2 * y2 # <<<<<<<<<<<<<<
  4306. * r11 = r4 * x2
  4307. * r12 = x0**2
  4308. */
  4309. __pyx_v_r10 = (2.0 * __pyx_v_y2);
  4310. /* "fontTools/pens/momentsPen.py":172
  4311. * r9 = 10 * y2
  4312. * r10 = 2 * y2
  4313. * r11 = r4 * x2 # <<<<<<<<<<<<<<
  4314. * r12 = x0**2
  4315. * r13 = 10 * y0
  4316. */
  4317. __pyx_v_r11 = (__pyx_v_r4 * __pyx_v_x2);
  4318. /* "fontTools/pens/momentsPen.py":173
  4319. * r10 = 2 * y2
  4320. * r11 = r4 * x2
  4321. * r12 = x0**2 # <<<<<<<<<<<<<<
  4322. * r13 = 10 * y0
  4323. * r14 = r4 * y2
  4324. */
  4325. __pyx_v_r12 = pow(__pyx_v_x0, 2.0);
  4326. /* "fontTools/pens/momentsPen.py":174
  4327. * r11 = r4 * x2
  4328. * r12 = x0**2
  4329. * r13 = 10 * y0 # <<<<<<<<<<<<<<
  4330. * r14 = r4 * y2
  4331. * r15 = x2 * y0
  4332. */
  4333. __pyx_v_r13 = (10.0 * __pyx_v_y0);
  4334. /* "fontTools/pens/momentsPen.py":175
  4335. * r12 = x0**2
  4336. * r13 = 10 * y0
  4337. * r14 = r4 * y2 # <<<<<<<<<<<<<<
  4338. * r15 = x2 * y0
  4339. * r16 = 4 * x1
  4340. */
  4341. __pyx_v_r14 = (__pyx_v_r4 * __pyx_v_y2);
  4342. /* "fontTools/pens/momentsPen.py":176
  4343. * r13 = 10 * y0
  4344. * r14 = r4 * y2
  4345. * r15 = x2 * y0 # <<<<<<<<<<<<<<
  4346. * r16 = 4 * x1
  4347. * r17 = r0 * x1 + r2
  4348. */
  4349. __pyx_v_r15 = (__pyx_v_x2 * __pyx_v_y0);
  4350. /* "fontTools/pens/momentsPen.py":177
  4351. * r14 = r4 * y2
  4352. * r15 = x2 * y0
  4353. * r16 = 4 * x1 # <<<<<<<<<<<<<<
  4354. * r17 = r0 * x1 + r2
  4355. * r18 = r2 * r8
  4356. */
  4357. __pyx_v_r16 = (4.0 * __pyx_v_x1);
  4358. /* "fontTools/pens/momentsPen.py":178
  4359. * r15 = x2 * y0
  4360. * r16 = 4 * x1
  4361. * r17 = r0 * x1 + r2 # <<<<<<<<<<<<<<
  4362. * r18 = r2 * r8
  4363. * r19 = y1**2
  4364. */
  4365. __pyx_v_r17 = ((__pyx_v_r0 * __pyx_v_x1) + __pyx_v_r2);
  4366. /* "fontTools/pens/momentsPen.py":179
  4367. * r16 = 4 * x1
  4368. * r17 = r0 * x1 + r2
  4369. * r18 = r2 * r8 # <<<<<<<<<<<<<<
  4370. * r19 = y1**2
  4371. * r20 = 2 * r19
  4372. */
  4373. __pyx_v_r18 = (__pyx_v_r2 * __pyx_v_r8);
  4374. /* "fontTools/pens/momentsPen.py":180
  4375. * r17 = r0 * x1 + r2
  4376. * r18 = r2 * r8
  4377. * r19 = y1**2 # <<<<<<<<<<<<<<
  4378. * r20 = 2 * r19
  4379. * r21 = y2**2
  4380. */
  4381. __pyx_v_r19 = pow(__pyx_v_y1, 2.0);
  4382. /* "fontTools/pens/momentsPen.py":181
  4383. * r18 = r2 * r8
  4384. * r19 = y1**2
  4385. * r20 = 2 * r19 # <<<<<<<<<<<<<<
  4386. * r21 = y2**2
  4387. * r22 = r21 * x2
  4388. */
  4389. __pyx_v_r20 = (2.0 * __pyx_v_r19);
  4390. /* "fontTools/pens/momentsPen.py":182
  4391. * r19 = y1**2
  4392. * r20 = 2 * r19
  4393. * r21 = y2**2 # <<<<<<<<<<<<<<
  4394. * r22 = r21 * x2
  4395. * r23 = 5 * r22
  4396. */
  4397. __pyx_v_r21 = pow(__pyx_v_y2, 2.0);
  4398. /* "fontTools/pens/momentsPen.py":183
  4399. * r20 = 2 * r19
  4400. * r21 = y2**2
  4401. * r22 = r21 * x2 # <<<<<<<<<<<<<<
  4402. * r23 = 5 * r22
  4403. * r24 = y0**2
  4404. */
  4405. __pyx_v_r22 = (__pyx_v_r21 * __pyx_v_x2);
  4406. /* "fontTools/pens/momentsPen.py":184
  4407. * r21 = y2**2
  4408. * r22 = r21 * x2
  4409. * r23 = 5 * r22 # <<<<<<<<<<<<<<
  4410. * r24 = y0**2
  4411. * r25 = y0 * y2
  4412. */
  4413. __pyx_v_r23 = (5.0 * __pyx_v_r22);
  4414. /* "fontTools/pens/momentsPen.py":185
  4415. * r22 = r21 * x2
  4416. * r23 = 5 * r22
  4417. * r24 = y0**2 # <<<<<<<<<<<<<<
  4418. * r25 = y0 * y2
  4419. * r26 = 5 * r24
  4420. */
  4421. __pyx_v_r24 = pow(__pyx_v_y0, 2.0);
  4422. /* "fontTools/pens/momentsPen.py":186
  4423. * r23 = 5 * r22
  4424. * r24 = y0**2
  4425. * r25 = y0 * y2 # <<<<<<<<<<<<<<
  4426. * r26 = 5 * r24
  4427. * r27 = x1**3
  4428. */
  4429. __pyx_v_r25 = (__pyx_v_y0 * __pyx_v_y2);
  4430. /* "fontTools/pens/momentsPen.py":187
  4431. * r24 = y0**2
  4432. * r25 = y0 * y2
  4433. * r26 = 5 * r24 # <<<<<<<<<<<<<<
  4434. * r27 = x1**3
  4435. * r28 = x2**3
  4436. */
  4437. __pyx_v_r26 = (5.0 * __pyx_v_r24);
  4438. /* "fontTools/pens/momentsPen.py":188
  4439. * r25 = y0 * y2
  4440. * r26 = 5 * r24
  4441. * r27 = x1**3 # <<<<<<<<<<<<<<
  4442. * r28 = x2**3
  4443. * r29 = 30 * y1
  4444. */
  4445. __pyx_v_r27 = pow(__pyx_v_x1, 3.0);
  4446. /* "fontTools/pens/momentsPen.py":189
  4447. * r26 = 5 * r24
  4448. * r27 = x1**3
  4449. * r28 = x2**3 # <<<<<<<<<<<<<<
  4450. * r29 = 30 * y1
  4451. * r30 = 6 * y1
  4452. */
  4453. __pyx_v_r28 = pow(__pyx_v_x2, 3.0);
  4454. /* "fontTools/pens/momentsPen.py":190
  4455. * r27 = x1**3
  4456. * r28 = x2**3
  4457. * r29 = 30 * y1 # <<<<<<<<<<<<<<
  4458. * r30 = 6 * y1
  4459. * r31 = 10 * r7 * x1
  4460. */
  4461. __pyx_v_r29 = (30.0 * __pyx_v_y1);
  4462. /* "fontTools/pens/momentsPen.py":191
  4463. * r28 = x2**3
  4464. * r29 = 30 * y1
  4465. * r30 = 6 * y1 # <<<<<<<<<<<<<<
  4466. * r31 = 10 * r7 * x1
  4467. * r32 = 5 * y2
  4468. */
  4469. __pyx_v_r30 = (6.0 * __pyx_v_y1);
  4470. /* "fontTools/pens/momentsPen.py":192
  4471. * r29 = 30 * y1
  4472. * r30 = 6 * y1
  4473. * r31 = 10 * r7 * x1 # <<<<<<<<<<<<<<
  4474. * r32 = 5 * y2
  4475. * r33 = 12 * r6
  4476. */
  4477. __pyx_v_r31 = ((10.0 * __pyx_v_r7) * __pyx_v_x1);
  4478. /* "fontTools/pens/momentsPen.py":193
  4479. * r30 = 6 * y1
  4480. * r31 = 10 * r7 * x1
  4481. * r32 = 5 * y2 # <<<<<<<<<<<<<<
  4482. * r33 = 12 * r6
  4483. * r34 = 30 * x1
  4484. */
  4485. __pyx_v_r32 = (5.0 * __pyx_v_y2);
  4486. /* "fontTools/pens/momentsPen.py":194
  4487. * r31 = 10 * r7 * x1
  4488. * r32 = 5 * y2
  4489. * r33 = 12 * r6 # <<<<<<<<<<<<<<
  4490. * r34 = 30 * x1
  4491. * r35 = x1 * y1
  4492. */
  4493. __pyx_v_r33 = (12.0 * __pyx_v_r6);
  4494. /* "fontTools/pens/momentsPen.py":195
  4495. * r32 = 5 * y2
  4496. * r33 = 12 * r6
  4497. * r34 = 30 * x1 # <<<<<<<<<<<<<<
  4498. * r35 = x1 * y1
  4499. * r36 = r3 + 20 * r35
  4500. */
  4501. __pyx_v_r34 = (30.0 * __pyx_v_x1);
  4502. /* "fontTools/pens/momentsPen.py":196
  4503. * r33 = 12 * r6
  4504. * r34 = 30 * x1
  4505. * r35 = x1 * y1 # <<<<<<<<<<<<<<
  4506. * r36 = r3 + 20 * r35
  4507. * r37 = 12 * x1
  4508. */
  4509. __pyx_v_r35 = (__pyx_v_x1 * __pyx_v_y1);
  4510. /* "fontTools/pens/momentsPen.py":197
  4511. * r34 = 30 * x1
  4512. * r35 = x1 * y1
  4513. * r36 = r3 + 20 * r35 # <<<<<<<<<<<<<<
  4514. * r37 = 12 * x1
  4515. * r38 = 20 * r6
  4516. */
  4517. __pyx_v_r36 = (__pyx_v_r3 + (20.0 * __pyx_v_r35));
  4518. /* "fontTools/pens/momentsPen.py":198
  4519. * r35 = x1 * y1
  4520. * r36 = r3 + 20 * r35
  4521. * r37 = 12 * x1 # <<<<<<<<<<<<<<
  4522. * r38 = 20 * r6
  4523. * r39 = 8 * r6 * y1
  4524. */
  4525. __pyx_v_r37 = (12.0 * __pyx_v_x1);
  4526. /* "fontTools/pens/momentsPen.py":199
  4527. * r36 = r3 + 20 * r35
  4528. * r37 = 12 * x1
  4529. * r38 = 20 * r6 # <<<<<<<<<<<<<<
  4530. * r39 = 8 * r6 * y1
  4531. * r40 = r32 * r7
  4532. */
  4533. __pyx_v_r38 = (20.0 * __pyx_v_r6);
  4534. /* "fontTools/pens/momentsPen.py":200
  4535. * r37 = 12 * x1
  4536. * r38 = 20 * r6
  4537. * r39 = 8 * r6 * y1 # <<<<<<<<<<<<<<
  4538. * r40 = r32 * r7
  4539. * r41 = 60 * y1
  4540. */
  4541. __pyx_v_r39 = ((8.0 * __pyx_v_r6) * __pyx_v_y1);
  4542. /* "fontTools/pens/momentsPen.py":201
  4543. * r38 = 20 * r6
  4544. * r39 = 8 * r6 * y1
  4545. * r40 = r32 * r7 # <<<<<<<<<<<<<<
  4546. * r41 = 60 * y1
  4547. * r42 = 20 * r19
  4548. */
  4549. __pyx_v_r40 = (__pyx_v_r32 * __pyx_v_r7);
  4550. /* "fontTools/pens/momentsPen.py":202
  4551. * r39 = 8 * r6 * y1
  4552. * r40 = r32 * r7
  4553. * r41 = 60 * y1 # <<<<<<<<<<<<<<
  4554. * r42 = 20 * r19
  4555. * r43 = 4 * r19
  4556. */
  4557. __pyx_v_r41 = (60.0 * __pyx_v_y1);
  4558. /* "fontTools/pens/momentsPen.py":203
  4559. * r40 = r32 * r7
  4560. * r41 = 60 * y1
  4561. * r42 = 20 * r19 # <<<<<<<<<<<<<<
  4562. * r43 = 4 * r19
  4563. * r44 = 15 * r21
  4564. */
  4565. __pyx_v_r42 = (20.0 * __pyx_v_r19);
  4566. /* "fontTools/pens/momentsPen.py":204
  4567. * r41 = 60 * y1
  4568. * r42 = 20 * r19
  4569. * r43 = 4 * r19 # <<<<<<<<<<<<<<
  4570. * r44 = 15 * r21
  4571. * r45 = 12 * x2
  4572. */
  4573. __pyx_v_r43 = (4.0 * __pyx_v_r19);
  4574. /* "fontTools/pens/momentsPen.py":205
  4575. * r42 = 20 * r19
  4576. * r43 = 4 * r19
  4577. * r44 = 15 * r21 # <<<<<<<<<<<<<<
  4578. * r45 = 12 * x2
  4579. * r46 = 12 * y2
  4580. */
  4581. __pyx_v_r44 = (15.0 * __pyx_v_r21);
  4582. /* "fontTools/pens/momentsPen.py":206
  4583. * r43 = 4 * r19
  4584. * r44 = 15 * r21
  4585. * r45 = 12 * x2 # <<<<<<<<<<<<<<
  4586. * r46 = 12 * y2
  4587. * r47 = 6 * x1
  4588. */
  4589. __pyx_v_r45 = (12.0 * __pyx_v_x2);
  4590. /* "fontTools/pens/momentsPen.py":207
  4591. * r44 = 15 * r21
  4592. * r45 = 12 * x2
  4593. * r46 = 12 * y2 # <<<<<<<<<<<<<<
  4594. * r47 = 6 * x1
  4595. * r48 = 8 * r19 * x1 + r23
  4596. */
  4597. __pyx_v_r46 = (12.0 * __pyx_v_y2);
  4598. /* "fontTools/pens/momentsPen.py":208
  4599. * r45 = 12 * x2
  4600. * r46 = 12 * y2
  4601. * r47 = 6 * x1 # <<<<<<<<<<<<<<
  4602. * r48 = 8 * r19 * x1 + r23
  4603. * r49 = 8 * y1**3
  4604. */
  4605. __pyx_v_r47 = (6.0 * __pyx_v_x1);
  4606. /* "fontTools/pens/momentsPen.py":209
  4607. * r46 = 12 * y2
  4608. * r47 = 6 * x1
  4609. * r48 = 8 * r19 * x1 + r23 # <<<<<<<<<<<<<<
  4610. * r49 = 8 * y1**3
  4611. * r50 = y2**3
  4612. */
  4613. __pyx_v_r48 = (((8.0 * __pyx_v_r19) * __pyx_v_x1) + __pyx_v_r23);
  4614. /* "fontTools/pens/momentsPen.py":210
  4615. * r47 = 6 * x1
  4616. * r48 = 8 * r19 * x1 + r23
  4617. * r49 = 8 * y1**3 # <<<<<<<<<<<<<<
  4618. * r50 = y2**3
  4619. * r51 = y0**3
  4620. */
  4621. __pyx_v_r49 = (8.0 * pow(__pyx_v_y1, 3.0));
  4622. /* "fontTools/pens/momentsPen.py":211
  4623. * r48 = 8 * r19 * x1 + r23
  4624. * r49 = 8 * y1**3
  4625. * r50 = y2**3 # <<<<<<<<<<<<<<
  4626. * r51 = y0**3
  4627. * r52 = 10 * y1
  4628. */
  4629. __pyx_v_r50 = pow(__pyx_v_y2, 3.0);
  4630. /* "fontTools/pens/momentsPen.py":212
  4631. * r49 = 8 * y1**3
  4632. * r50 = y2**3
  4633. * r51 = y0**3 # <<<<<<<<<<<<<<
  4634. * r52 = 10 * y1
  4635. * r53 = 12 * y1
  4636. */
  4637. __pyx_v_r51 = pow(__pyx_v_y0, 3.0);
  4638. /* "fontTools/pens/momentsPen.py":213
  4639. * r50 = y2**3
  4640. * r51 = y0**3
  4641. * r52 = 10 * y1 # <<<<<<<<<<<<<<
  4642. * r53 = 12 * y1
  4643. *
  4644. */
  4645. __pyx_v_r52 = (10.0 * __pyx_v_y1);
  4646. /* "fontTools/pens/momentsPen.py":214
  4647. * r51 = y0**3
  4648. * r52 = 10 * y1
  4649. * r53 = 12 * y1 # <<<<<<<<<<<<<<
  4650. *
  4651. * self.area += (
  4652. */
  4653. __pyx_v_r53 = (12.0 * __pyx_v_y1);
  4654. /* "fontTools/pens/momentsPen.py":216
  4655. * r53 = 12 * y1
  4656. *
  4657. * self.area += ( # <<<<<<<<<<<<<<
  4658. * -r1 / 6
  4659. * - r3 / 6
  4660. */
  4661. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 216, __pyx_L1_error)
  4662. __Pyx_GOTREF(__pyx_t_1);
  4663. /* "fontTools/pens/momentsPen.py":221
  4664. * + x0 * (r0 + r5 + y2) / 6
  4665. * + x1 * y2 / 3
  4666. * - y0 * (r4 + x2) / 6 # <<<<<<<<<<<<<<
  4667. * )
  4668. * self.momentX += (
  4669. */
  4670. __pyx_t_4 = PyFloat_FromDouble(((((((-__pyx_v_r1) / 6.0) - (__pyx_v_r3 / 6.0)) + ((__pyx_v_x0 * ((__pyx_v_r0 + __pyx_v_r5) + __pyx_v_y2)) / 6.0)) + ((__pyx_v_x1 * __pyx_v_y2) / 3.0)) - ((__pyx_v_y0 * (__pyx_v_r4 + __pyx_v_x2)) / 6.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 221, __pyx_L1_error)
  4671. __Pyx_GOTREF(__pyx_t_4);
  4672. /* "fontTools/pens/momentsPen.py":216
  4673. * r53 = 12 * y1
  4674. *
  4675. * self.area += ( # <<<<<<<<<<<<<<
  4676. * -r1 / 6
  4677. * - r3 / 6
  4678. */
  4679. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
  4680. __Pyx_GOTREF(__pyx_t_2);
  4681. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4682. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4683. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area, __pyx_t_2) < (0)) __PYX_ERR(0, 216, __pyx_L1_error)
  4684. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4685. /* "fontTools/pens/momentsPen.py":223
  4686. * - y0 * (r4 + x2) / 6
  4687. * )
  4688. * self.momentX += ( # <<<<<<<<<<<<<<
  4689. * -r11 * (-r10 + y1) / 30
  4690. * + r12 * (r13 + r8 + y2) / 30
  4691. */
  4692. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 223, __pyx_L1_error)
  4693. __Pyx_GOTREF(__pyx_t_2);
  4694. /* "fontTools/pens/momentsPen.py":230
  4695. * - r7 * r9 / 30
  4696. * + x0 * (r14 - r15 - r16 * y0 + r17) / 30
  4697. * - y0 * (r11 + 2 * r6 + r7) / 30 # <<<<<<<<<<<<<<
  4698. * )
  4699. * self.momentY += (
  4700. */
  4701. __pyx_t_4 = PyFloat_FromDouble((((((((((-__pyx_v_r11) * ((-__pyx_v_r10) + __pyx_v_y1)) / 30.0) + ((__pyx_v_r12 * ((__pyx_v_r13 + __pyx_v_r8) + __pyx_v_y2)) / 30.0)) + ((__pyx_v_r6 * __pyx_v_y2) / 15.0)) - ((__pyx_v_r7 * __pyx_v_r8) / 30.0)) - ((__pyx_v_r7 * __pyx_v_r9) / 30.0)) + ((__pyx_v_x0 * (((__pyx_v_r14 - __pyx_v_r15) - (__pyx_v_r16 * __pyx_v_y0)) + __pyx_v_r17)) / 30.0)) - ((__pyx_v_y0 * ((__pyx_v_r11 + (2.0 * __pyx_v_r6)) + __pyx_v_r7)) / 30.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 230, __pyx_L1_error)
  4702. __Pyx_GOTREF(__pyx_t_4);
  4703. /* "fontTools/pens/momentsPen.py":223
  4704. * - y0 * (r4 + x2) / 6
  4705. * )
  4706. * self.momentX += ( # <<<<<<<<<<<<<<
  4707. * -r11 * (-r10 + y1) / 30
  4708. * + r12 * (r13 + r8 + y2) / 30
  4709. */
  4710. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 223, __pyx_L1_error)
  4711. __Pyx_GOTREF(__pyx_t_1);
  4712. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4713. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4714. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX, __pyx_t_1) < (0)) __PYX_ERR(0, 223, __pyx_L1_error)
  4715. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4716. /* "fontTools/pens/momentsPen.py":232
  4717. * - y0 * (r11 + 2 * r6 + r7) / 30
  4718. * )
  4719. * self.momentY += ( # <<<<<<<<<<<<<<
  4720. * -r18 / 30
  4721. * - r20 * x2 / 30
  4722. */
  4723. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
  4724. __Pyx_GOTREF(__pyx_t_1);
  4725. /* "fontTools/pens/momentsPen.py":239
  4726. * + x0 * (r0 * y2 + r20 + r21 + r25 + r26 + r8 * y0) / 30
  4727. * + x1 * y2 * (r10 + y1) / 15
  4728. * - y0 * (r1 + r17) / 30 # <<<<<<<<<<<<<<
  4729. * )
  4730. * self.momentXX += (
  4731. */
  4732. __pyx_t_4 = PyFloat_FromDouble(((((((((-__pyx_v_r18) / 30.0) - ((__pyx_v_r20 * __pyx_v_x2) / 30.0)) - (__pyx_v_r23 / 30.0)) - ((__pyx_v_r24 * (__pyx_v_r16 + __pyx_v_x2)) / 30.0)) + ((__pyx_v_x0 * ((((((__pyx_v_r0 * __pyx_v_y2) + __pyx_v_r20) + __pyx_v_r21) + __pyx_v_r25) + __pyx_v_r26) + (__pyx_v_r8 * __pyx_v_y0))) / 30.0)) + (((__pyx_v_x1 * __pyx_v_y2) * (__pyx_v_r10 + __pyx_v_y1)) / 15.0)) - ((__pyx_v_y0 * (__pyx_v_r1 + __pyx_v_r17)) / 30.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
  4733. __Pyx_GOTREF(__pyx_t_4);
  4734. /* "fontTools/pens/momentsPen.py":232
  4735. * - y0 * (r11 + 2 * r6 + r7) / 30
  4736. * )
  4737. * self.momentY += ( # <<<<<<<<<<<<<<
  4738. * -r18 / 30
  4739. * - r20 * x2 / 30
  4740. */
  4741. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
  4742. __Pyx_GOTREF(__pyx_t_2);
  4743. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4744. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4745. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY, __pyx_t_2) < (0)) __PYX_ERR(0, 232, __pyx_L1_error)
  4746. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4747. /* "fontTools/pens/momentsPen.py":241
  4748. * - y0 * (r1 + r17) / 30
  4749. * )
  4750. * self.momentXX += ( # <<<<<<<<<<<<<<
  4751. * r12 * (r1 - 5 * r15 - r34 * y0 + r36 + r9 * x1) / 420
  4752. * + 2 * r27 * y2 / 105
  4753. */
  4754. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  4755. __Pyx_GOTREF(__pyx_t_2);
  4756. /* "fontTools/pens/momentsPen.py":261
  4757. * )
  4758. * / 420
  4759. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420 # <<<<<<<<<<<<<<
  4760. * )
  4761. * self.momentXY += (
  4762. */
  4763. __pyx_t_4 = PyFloat_FromDouble(((((((((((__pyx_v_r12 * ((((__pyx_v_r1 - (5.0 * __pyx_v_r15)) - (__pyx_v_r34 * __pyx_v_y0)) + __pyx_v_r36) + (__pyx_v_r9 * __pyx_v_x1))) / 420.0) + (((2.0 * __pyx_v_r27) * __pyx_v_y2) / 105.0)) - ((__pyx_v_r28 * __pyx_v_r29) / 420.0)) - ((__pyx_v_r28 * __pyx_v_y2) / 4.0)) - ((__pyx_v_r31 * (__pyx_v_r0 - (3.0 * __pyx_v_y2))) / 420.0)) - (((__pyx_v_r6 * __pyx_v_x2) * (__pyx_v_r0 - __pyx_v_r32)) / 105.0)) + ((pow(__pyx_v_x0, 3.0) * ((__pyx_v_r30 + (21.0 * __pyx_v_y0)) + __pyx_v_y2)) / 84.0)) - ((__pyx_v_x0 * ((((((((__pyx_v_r0 * __pyx_v_r7) + (__pyx_v_r15 * __pyx_v_r37)) - (__pyx_v_r2 * __pyx_v_r37)) - (__pyx_v_r33 * __pyx_v_y2)) + (__pyx_v_r38 * __pyx_v_y0)) - __pyx_v_r39) - __pyx_v_r40) + (__pyx_v_r5 * __pyx_v_r7))) / 420.0)) - ((__pyx_v_y0 * ((((8.0 * __pyx_v_r27) + (5.0 * __pyx_v_r28)) + __pyx_v_r31) + (__pyx_v_r33 * __pyx_v_x2))) / 420.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 261, __pyx_L1_error)
  4764. __Pyx_GOTREF(__pyx_t_4);
  4765. /* "fontTools/pens/momentsPen.py":241
  4766. * - y0 * (r1 + r17) / 30
  4767. * )
  4768. * self.momentXX += ( # <<<<<<<<<<<<<<
  4769. * r12 * (r1 - 5 * r15 - r34 * y0 + r36 + r9 * x1) / 420
  4770. * + 2 * r27 * y2 / 105
  4771. */
  4772. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  4773. __Pyx_GOTREF(__pyx_t_1);
  4774. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4775. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4776. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX, __pyx_t_1) < (0)) __PYX_ERR(0, 241, __pyx_L1_error)
  4777. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4778. /* "fontTools/pens/momentsPen.py":263
  4779. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420
  4780. * )
  4781. * self.momentXY += ( # <<<<<<<<<<<<<<
  4782. * r12 * (r13 * y2 + 3 * r21 + 105 * r24 + r41 * y0 + r42 + r46 * y1) / 840
  4783. * - r16 * x2 * (r43 - r44) / 840
  4784. */
  4785. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
  4786. __Pyx_GOTREF(__pyx_t_1);
  4787. /* "fontTools/pens/momentsPen.py":283
  4788. * )
  4789. * / 420
  4790. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420 # <<<<<<<<<<<<<<
  4791. * )
  4792. * self.momentYY += (
  4793. */
  4794. __pyx_t_4 = PyFloat_FromDouble(((((((((((__pyx_v_r12 * ((((((__pyx_v_r13 * __pyx_v_y2) + (3.0 * __pyx_v_r21)) + (105.0 * __pyx_v_r24)) + (__pyx_v_r41 * __pyx_v_y0)) + __pyx_v_r42) + (__pyx_v_r46 * __pyx_v_y1))) / 840.0) - (((__pyx_v_r16 * __pyx_v_x2) * (__pyx_v_r43 - __pyx_v_r44)) / 840.0)) - ((__pyx_v_r21 * __pyx_v_r7) / 8.0)) - ((__pyx_v_r24 * ((__pyx_v_r38 + (__pyx_v_r45 * __pyx_v_x1)) + (3.0 * __pyx_v_r7))) / 840.0)) - (((__pyx_v_r41 * __pyx_v_r7) * __pyx_v_y2) / 840.0)) - ((__pyx_v_r42 * __pyx_v_r7) / 840.0)) + (((__pyx_v_r6 * __pyx_v_y2) * (__pyx_v_r32 + __pyx_v_r8)) / 210.0)) + ((__pyx_v_x0 * (((((((((-__pyx_v_r15) * __pyx_v_r8) + (__pyx_v_r16 * __pyx_v_r25)) + __pyx_v_r18) + (__pyx_v_r21 * __pyx_v_r47)) - (__pyx_v_r24 * __pyx_v_r34)) - (__pyx_v_r26 * __pyx_v_x2)) + (__pyx_v_r35 * __pyx_v_r46)) + __pyx_v_r48)) / 420.0)) - ((__pyx_v_y0 * (((((__pyx_v_r16 * __pyx_v_r2) + (__pyx_v_r30 * __pyx_v_r7)) + (__pyx_v_r35 * __pyx_v_r45)) + __pyx_v_r39) + __pyx_v_r40)) / 420.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 283, __pyx_L1_error)
  4795. __Pyx_GOTREF(__pyx_t_4);
  4796. /* "fontTools/pens/momentsPen.py":263
  4797. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420
  4798. * )
  4799. * self.momentXY += ( # <<<<<<<<<<<<<<
  4800. * r12 * (r13 * y2 + 3 * r21 + 105 * r24 + r41 * y0 + r42 + r46 * y1) / 840
  4801. * - r16 * x2 * (r43 - r44) / 840
  4802. */
  4803. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 263, __pyx_L1_error)
  4804. __Pyx_GOTREF(__pyx_t_2);
  4805. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4806. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4807. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY, __pyx_t_2) < (0)) __PYX_ERR(0, 263, __pyx_L1_error)
  4808. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4809. /* "fontTools/pens/momentsPen.py":285
  4810. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420
  4811. * )
  4812. * self.momentYY += ( # <<<<<<<<<<<<<<
  4813. * -r2 * r42 / 420
  4814. * - r22 * r29 / 420
  4815. */
  4816. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 285, __pyx_L1_error)
  4817. __Pyx_GOTREF(__pyx_t_2);
  4818. /* "fontTools/pens/momentsPen.py":307
  4819. * / 420
  4820. * + x1 * y2 * (r43 + r44 + r9 * y1) / 210
  4821. * - y0 * (r19 * r45 + r2 * r53 - r21 * r4 + r48) / 420 # <<<<<<<<<<<<<<
  4822. * )
  4823. *
  4824. */
  4825. __pyx_t_4 = PyFloat_FromDouble((((((((((((-__pyx_v_r2) * __pyx_v_r42) / 420.0) - ((__pyx_v_r22 * __pyx_v_r29) / 420.0)) - ((__pyx_v_r24 * ((__pyx_v_r14 + __pyx_v_r36) + (__pyx_v_r52 * __pyx_v_x2))) / 420.0)) - ((__pyx_v_r49 * __pyx_v_x2) / 420.0)) - ((__pyx_v_r50 * __pyx_v_x2) / 12.0)) - ((__pyx_v_r51 * (__pyx_v_r47 + __pyx_v_x2)) / 84.0)) + ((__pyx_v_x0 * ((((((((((__pyx_v_r19 * __pyx_v_r46) + (__pyx_v_r21 * __pyx_v_r5)) + (__pyx_v_r21 * __pyx_v_r52)) + (__pyx_v_r24 * __pyx_v_r29)) + (__pyx_v_r25 * __pyx_v_r53)) + (__pyx_v_r26 * __pyx_v_y2)) + (__pyx_v_r42 * __pyx_v_y0)) + __pyx_v_r49) + (5.0 * __pyx_v_r50)) + (35.0 * __pyx_v_r51))) / 420.0)) + (((__pyx_v_x1 * __pyx_v_y2) * ((__pyx_v_r43 + __pyx_v_r44) + (__pyx_v_r9 * __pyx_v_y1))) / 210.0)) - ((__pyx_v_y0 * ((((__pyx_v_r19 * __pyx_v_r45) + (__pyx_v_r2 * __pyx_v_r53)) - (__pyx_v_r21 * __pyx_v_r4)) + __pyx_v_r48)) / 420.0))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 307, __pyx_L1_error)
  4826. __Pyx_GOTREF(__pyx_t_4);
  4827. /* "fontTools/pens/momentsPen.py":285
  4828. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420
  4829. * )
  4830. * self.momentYY += ( # <<<<<<<<<<<<<<
  4831. * -r2 * r42 / 420
  4832. * - r22 * r29 / 420
  4833. */
  4834. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
  4835. __Pyx_GOTREF(__pyx_t_1);
  4836. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4837. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4838. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY, __pyx_t_1) < (0)) __PYX_ERR(0, 285, __pyx_L1_error)
  4839. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4840. /* "fontTools/pens/momentsPen.py":99
  4841. * )
  4842. *
  4843. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  4844. * @cython.locals(r1=cython.double)
  4845. * @cython.locals(r2=cython.double)
  4846. */
  4847. /* function exit code */
  4848. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4849. goto __pyx_L0;
  4850. __pyx_L1_error:;
  4851. __Pyx_XDECREF(__pyx_t_1);
  4852. __Pyx_XDECREF(__pyx_t_2);
  4853. __Pyx_XDECREF(__pyx_t_4);
  4854. __Pyx_XDECREF(__pyx_t_5);
  4855. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._qCurveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4856. __pyx_r = NULL;
  4857. __pyx_L0:;
  4858. __Pyx_XGIVEREF(__pyx_r);
  4859. __Pyx_RefNannyFinishContext();
  4860. return __pyx_r;
  4861. }
  4862. /* "fontTools/pens/momentsPen.py":310
  4863. * )
  4864. *
  4865. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  4866. * @cython.locals(r1=cython.double)
  4867. * @cython.locals(r2=cython.double)
  4868. */
  4869. /* Python wrapper */
  4870. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne(PyObject *__pyx_self,
  4871. #if CYTHON_METH_FASTCALL
  4872. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4873. #else
  4874. PyObject *__pyx_args, PyObject *__pyx_kwds
  4875. #endif
  4876. ); /*proto*/
  4877. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne, "MomentsPen._curveToOne(self, p1, p2, p3)");
  4878. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne = {"_curveToOne", (PyCFunction)(void(*)(void))(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne};
  4879. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne(PyObject *__pyx_self,
  4880. #if CYTHON_METH_FASTCALL
  4881. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4882. #else
  4883. PyObject *__pyx_args, PyObject *__pyx_kwds
  4884. #endif
  4885. ) {
  4886. PyObject *__pyx_v_self = 0;
  4887. PyObject *__pyx_v_p1 = 0;
  4888. PyObject *__pyx_v_p2 = 0;
  4889. PyObject *__pyx_v_p3 = 0;
  4890. #if !CYTHON_METH_FASTCALL
  4891. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  4892. #endif
  4893. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  4894. PyObject* values[4] = {0,0,0,0};
  4895. int __pyx_lineno = 0;
  4896. const char *__pyx_filename = NULL;
  4897. int __pyx_clineno = 0;
  4898. PyObject *__pyx_r = 0;
  4899. __Pyx_RefNannyDeclarations
  4900. __Pyx_RefNannySetupContext("_curveToOne (wrapper)", 0);
  4901. #if !CYTHON_METH_FASTCALL
  4902. #if CYTHON_ASSUME_SAFE_SIZE
  4903. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  4904. #else
  4905. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  4906. #endif
  4907. #endif
  4908. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  4909. {
  4910. PyObject ** const __pyx_pyargnames[] = {&__pyx_mstate_global->__pyx_n_u_self,&__pyx_mstate_global->__pyx_n_u_p1,&__pyx_mstate_global->__pyx_n_u_p2,&__pyx_mstate_global->__pyx_n_u_p3,0};
  4911. const Py_ssize_t __pyx_kwds_len = (__pyx_kwds) ? __Pyx_NumKwargs_FASTCALL(__pyx_kwds) : 0;
  4912. if (unlikely(__pyx_kwds_len) < 0) __PYX_ERR(0, 310, __pyx_L3_error)
  4913. if (__pyx_kwds_len > 0) {
  4914. switch (__pyx_nargs) {
  4915. case 4:
  4916. values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
  4917. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 310, __pyx_L3_error)
  4918. CYTHON_FALLTHROUGH;
  4919. case 3:
  4920. values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
  4921. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 310, __pyx_L3_error)
  4922. CYTHON_FALLTHROUGH;
  4923. case 2:
  4924. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  4925. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 310, __pyx_L3_error)
  4926. CYTHON_FALLTHROUGH;
  4927. case 1:
  4928. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  4929. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 310, __pyx_L3_error)
  4930. CYTHON_FALLTHROUGH;
  4931. case 0: break;
  4932. default: goto __pyx_L5_argtuple_error;
  4933. }
  4934. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  4935. if (__Pyx_ParseKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values, kwd_pos_args, __pyx_kwds_len, "_curveToOne", 0) < (0)) __PYX_ERR(0, 310, __pyx_L3_error)
  4936. for (Py_ssize_t i = __pyx_nargs; i < 4; i++) {
  4937. if (unlikely(!values[i])) { __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, i); __PYX_ERR(0, 310, __pyx_L3_error) }
  4938. }
  4939. } else if (unlikely(__pyx_nargs != 4)) {
  4940. goto __pyx_L5_argtuple_error;
  4941. } else {
  4942. values[0] = __Pyx_ArgRef_FASTCALL(__pyx_args, 0);
  4943. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[0])) __PYX_ERR(0, 310, __pyx_L3_error)
  4944. values[1] = __Pyx_ArgRef_FASTCALL(__pyx_args, 1);
  4945. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[1])) __PYX_ERR(0, 310, __pyx_L3_error)
  4946. values[2] = __Pyx_ArgRef_FASTCALL(__pyx_args, 2);
  4947. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[2])) __PYX_ERR(0, 310, __pyx_L3_error)
  4948. values[3] = __Pyx_ArgRef_FASTCALL(__pyx_args, 3);
  4949. if (!CYTHON_ASSUME_SAFE_MACROS && unlikely(!values[3])) __PYX_ERR(0, 310, __pyx_L3_error)
  4950. }
  4951. __pyx_v_self = values[0];
  4952. __pyx_v_p1 = values[1];
  4953. __pyx_v_p2 = values[2];
  4954. __pyx_v_p3 = values[3];
  4955. }
  4956. goto __pyx_L6_skip;
  4957. __pyx_L5_argtuple_error:;
  4958. __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 310, __pyx_L3_error)
  4959. __pyx_L6_skip:;
  4960. goto __pyx_L4_argument_unpacking_done;
  4961. __pyx_L3_error:;
  4962. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4963. Py_XDECREF(values[__pyx_temp]);
  4964. }
  4965. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._curveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4966. __Pyx_RefNannyFinishContext();
  4967. return NULL;
  4968. __pyx_L4_argument_unpacking_done:;
  4969. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
  4970. /* function exit code */
  4971. for (Py_ssize_t __pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4972. Py_XDECREF(values[__pyx_temp]);
  4973. }
  4974. __Pyx_RefNannyFinishContext();
  4975. return __pyx_r;
  4976. }
  4977. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1, PyObject *__pyx_v_p2, PyObject *__pyx_v_p3) {
  4978. double __pyx_v_x3;
  4979. double __pyx_v_y3;
  4980. double __pyx_v_x2;
  4981. double __pyx_v_y2;
  4982. double __pyx_v_x1;
  4983. double __pyx_v_y1;
  4984. double __pyx_v_x0;
  4985. double __pyx_v_y0;
  4986. double __pyx_v_r132;
  4987. double __pyx_v_r131;
  4988. double __pyx_v_r130;
  4989. double __pyx_v_r129;
  4990. double __pyx_v_r128;
  4991. double __pyx_v_r127;
  4992. double __pyx_v_r126;
  4993. double __pyx_v_r125;
  4994. double __pyx_v_r124;
  4995. double __pyx_v_r123;
  4996. double __pyx_v_r122;
  4997. double __pyx_v_r121;
  4998. double __pyx_v_r120;
  4999. double __pyx_v_r119;
  5000. double __pyx_v_r118;
  5001. double __pyx_v_r117;
  5002. double __pyx_v_r116;
  5003. double __pyx_v_r115;
  5004. double __pyx_v_r114;
  5005. double __pyx_v_r113;
  5006. double __pyx_v_r112;
  5007. double __pyx_v_r111;
  5008. double __pyx_v_r110;
  5009. double __pyx_v_r109;
  5010. double __pyx_v_r108;
  5011. double __pyx_v_r107;
  5012. double __pyx_v_r106;
  5013. double __pyx_v_r105;
  5014. double __pyx_v_r104;
  5015. double __pyx_v_r103;
  5016. double __pyx_v_r102;
  5017. double __pyx_v_r101;
  5018. double __pyx_v_r100;
  5019. double __pyx_v_r99;
  5020. double __pyx_v_r98;
  5021. double __pyx_v_r97;
  5022. double __pyx_v_r96;
  5023. double __pyx_v_r95;
  5024. double __pyx_v_r94;
  5025. double __pyx_v_r93;
  5026. double __pyx_v_r92;
  5027. double __pyx_v_r91;
  5028. double __pyx_v_r90;
  5029. double __pyx_v_r89;
  5030. double __pyx_v_r88;
  5031. double __pyx_v_r87;
  5032. double __pyx_v_r86;
  5033. double __pyx_v_r85;
  5034. double __pyx_v_r84;
  5035. double __pyx_v_r83;
  5036. double __pyx_v_r82;
  5037. double __pyx_v_r81;
  5038. double __pyx_v_r80;
  5039. double __pyx_v_r79;
  5040. double __pyx_v_r78;
  5041. double __pyx_v_r77;
  5042. double __pyx_v_r76;
  5043. double __pyx_v_r75;
  5044. double __pyx_v_r74;
  5045. double __pyx_v_r73;
  5046. double __pyx_v_r72;
  5047. double __pyx_v_r71;
  5048. double __pyx_v_r70;
  5049. double __pyx_v_r69;
  5050. double __pyx_v_r68;
  5051. double __pyx_v_r67;
  5052. double __pyx_v_r66;
  5053. double __pyx_v_r65;
  5054. double __pyx_v_r64;
  5055. double __pyx_v_r63;
  5056. double __pyx_v_r62;
  5057. double __pyx_v_r61;
  5058. double __pyx_v_r60;
  5059. double __pyx_v_r59;
  5060. double __pyx_v_r58;
  5061. double __pyx_v_r57;
  5062. double __pyx_v_r56;
  5063. double __pyx_v_r55;
  5064. double __pyx_v_r54;
  5065. double __pyx_v_r53;
  5066. double __pyx_v_r52;
  5067. double __pyx_v_r51;
  5068. double __pyx_v_r50;
  5069. double __pyx_v_r49;
  5070. double __pyx_v_r48;
  5071. double __pyx_v_r47;
  5072. double __pyx_v_r46;
  5073. double __pyx_v_r45;
  5074. double __pyx_v_r44;
  5075. double __pyx_v_r43;
  5076. double __pyx_v_r42;
  5077. double __pyx_v_r41;
  5078. double __pyx_v_r40;
  5079. double __pyx_v_r39;
  5080. double __pyx_v_r38;
  5081. double __pyx_v_r37;
  5082. double __pyx_v_r36;
  5083. double __pyx_v_r35;
  5084. double __pyx_v_r34;
  5085. double __pyx_v_r33;
  5086. double __pyx_v_r32;
  5087. double __pyx_v_r31;
  5088. double __pyx_v_r30;
  5089. double __pyx_v_r29;
  5090. double __pyx_v_r28;
  5091. double __pyx_v_r27;
  5092. double __pyx_v_r26;
  5093. double __pyx_v_r25;
  5094. double __pyx_v_r24;
  5095. double __pyx_v_r23;
  5096. double __pyx_v_r22;
  5097. double __pyx_v_r21;
  5098. double __pyx_v_r20;
  5099. double __pyx_v_r19;
  5100. double __pyx_v_r18;
  5101. double __pyx_v_r17;
  5102. double __pyx_v_r16;
  5103. double __pyx_v_r15;
  5104. double __pyx_v_r14;
  5105. double __pyx_v_r13;
  5106. double __pyx_v_r12;
  5107. double __pyx_v_r11;
  5108. double __pyx_v_r10;
  5109. double __pyx_v_r9;
  5110. double __pyx_v_r8;
  5111. double __pyx_v_r7;
  5112. double __pyx_v_r6;
  5113. double __pyx_v_r5;
  5114. double __pyx_v_r4;
  5115. double __pyx_v_r3;
  5116. double __pyx_v_r2;
  5117. double __pyx_v_r1;
  5118. double __pyx_v_r0;
  5119. PyObject *__pyx_r = NULL;
  5120. __Pyx_RefNannyDeclarations
  5121. PyObject *__pyx_t_1 = NULL;
  5122. PyObject *__pyx_t_2 = NULL;
  5123. size_t __pyx_t_3;
  5124. PyObject *__pyx_t_4 = NULL;
  5125. PyObject *__pyx_t_5 = NULL;
  5126. PyObject *(*__pyx_t_6)(PyObject *);
  5127. double __pyx_t_7;
  5128. double __pyx_t_8;
  5129. int __pyx_lineno = 0;
  5130. const char *__pyx_filename = NULL;
  5131. int __pyx_clineno = 0;
  5132. __Pyx_RefNannySetupContext("_curveToOne", 0);
  5133. /* "fontTools/pens/momentsPen.py":448
  5134. * @cython.locals(x3=cython.double, y3=cython.double)
  5135. * def _curveToOne(self, p1, p2, p3):
  5136. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  5137. * x1, y1 = p1
  5138. * x2, y2 = p2
  5139. */
  5140. __pyx_t_2 = __pyx_v_self;
  5141. __Pyx_INCREF(__pyx_t_2);
  5142. __pyx_t_3 = 0;
  5143. {
  5144. PyObject *__pyx_callargs[2] = {__pyx_t_2, NULL};
  5145. __pyx_t_1 = __Pyx_PyObject_FastCallMethod((PyObject*)__pyx_mstate_global->__pyx_n_u_getCurrentPoint, __pyx_callargs+__pyx_t_3, (1-__pyx_t_3) | (1*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  5146. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  5147. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  5148. __Pyx_GOTREF(__pyx_t_1);
  5149. }
  5150. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  5151. PyObject* sequence = __pyx_t_1;
  5152. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5153. if (unlikely(size != 2)) {
  5154. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5155. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5156. __PYX_ERR(0, 448, __pyx_L1_error)
  5157. }
  5158. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5159. if (likely(PyTuple_CheckExact(sequence))) {
  5160. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  5161. __Pyx_INCREF(__pyx_t_2);
  5162. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  5163. __Pyx_INCREF(__pyx_t_4);
  5164. } else {
  5165. __pyx_t_2 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  5166. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  5167. __Pyx_XGOTREF(__pyx_t_2);
  5168. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  5169. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
  5170. __Pyx_XGOTREF(__pyx_t_4);
  5171. }
  5172. #else
  5173. __pyx_t_2 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  5174. __Pyx_GOTREF(__pyx_t_2);
  5175. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 448, __pyx_L1_error)
  5176. __Pyx_GOTREF(__pyx_t_4);
  5177. #endif
  5178. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5179. } else {
  5180. Py_ssize_t index = -1;
  5181. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 448, __pyx_L1_error)
  5182. __Pyx_GOTREF(__pyx_t_5);
  5183. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5184. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  5185. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  5186. __Pyx_GOTREF(__pyx_t_2);
  5187. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
  5188. __Pyx_GOTREF(__pyx_t_4);
  5189. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < (0)) __PYX_ERR(0, 448, __pyx_L1_error)
  5190. __pyx_t_6 = NULL;
  5191. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5192. goto __pyx_L4_unpacking_done;
  5193. __pyx_L3_unpacking_failed:;
  5194. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  5195. __pyx_t_6 = NULL;
  5196. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5197. __PYX_ERR(0, 448, __pyx_L1_error)
  5198. __pyx_L4_unpacking_done:;
  5199. }
  5200. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error)
  5201. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5202. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 448, __pyx_L1_error)
  5203. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5204. __pyx_v_x0 = __pyx_t_7;
  5205. __pyx_v_y0 = __pyx_t_8;
  5206. /* "fontTools/pens/momentsPen.py":449
  5207. * def _curveToOne(self, p1, p2, p3):
  5208. * x0, y0 = self._getCurrentPoint()
  5209. * x1, y1 = p1 # <<<<<<<<<<<<<<
  5210. * x2, y2 = p2
  5211. * x3, y3 = p3
  5212. */
  5213. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  5214. PyObject* sequence = __pyx_v_p1;
  5215. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5216. if (unlikely(size != 2)) {
  5217. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5218. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5219. __PYX_ERR(0, 449, __pyx_L1_error)
  5220. }
  5221. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5222. if (likely(PyTuple_CheckExact(sequence))) {
  5223. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  5224. __Pyx_INCREF(__pyx_t_1);
  5225. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  5226. __Pyx_INCREF(__pyx_t_4);
  5227. } else {
  5228. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  5229. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
  5230. __Pyx_XGOTREF(__pyx_t_1);
  5231. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  5232. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
  5233. __Pyx_XGOTREF(__pyx_t_4);
  5234. }
  5235. #else
  5236. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
  5237. __Pyx_GOTREF(__pyx_t_1);
  5238. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
  5239. __Pyx_GOTREF(__pyx_t_4);
  5240. #endif
  5241. } else {
  5242. Py_ssize_t index = -1;
  5243. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
  5244. __Pyx_GOTREF(__pyx_t_2);
  5245. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  5246. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  5247. __Pyx_GOTREF(__pyx_t_1);
  5248. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
  5249. __Pyx_GOTREF(__pyx_t_4);
  5250. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 449, __pyx_L1_error)
  5251. __pyx_t_6 = NULL;
  5252. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5253. goto __pyx_L6_unpacking_done;
  5254. __pyx_L5_unpacking_failed:;
  5255. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5256. __pyx_t_6 = NULL;
  5257. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5258. __PYX_ERR(0, 449, __pyx_L1_error)
  5259. __pyx_L6_unpacking_done:;
  5260. }
  5261. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error)
  5262. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5263. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 449, __pyx_L1_error)
  5264. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5265. __pyx_v_x1 = __pyx_t_8;
  5266. __pyx_v_y1 = __pyx_t_7;
  5267. /* "fontTools/pens/momentsPen.py":450
  5268. * x0, y0 = self._getCurrentPoint()
  5269. * x1, y1 = p1
  5270. * x2, y2 = p2 # <<<<<<<<<<<<<<
  5271. * x3, y3 = p3
  5272. *
  5273. */
  5274. if ((likely(PyTuple_CheckExact(__pyx_v_p2))) || (PyList_CheckExact(__pyx_v_p2))) {
  5275. PyObject* sequence = __pyx_v_p2;
  5276. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5277. if (unlikely(size != 2)) {
  5278. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5279. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5280. __PYX_ERR(0, 450, __pyx_L1_error)
  5281. }
  5282. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5283. if (likely(PyTuple_CheckExact(sequence))) {
  5284. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
  5285. __Pyx_INCREF(__pyx_t_4);
  5286. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
  5287. __Pyx_INCREF(__pyx_t_1);
  5288. } else {
  5289. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  5290. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
  5291. __Pyx_XGOTREF(__pyx_t_4);
  5292. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  5293. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  5294. __Pyx_XGOTREF(__pyx_t_1);
  5295. }
  5296. #else
  5297. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
  5298. __Pyx_GOTREF(__pyx_t_4);
  5299. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  5300. __Pyx_GOTREF(__pyx_t_1);
  5301. #endif
  5302. } else {
  5303. Py_ssize_t index = -1;
  5304. __pyx_t_2 = PyObject_GetIter(__pyx_v_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
  5305. __Pyx_GOTREF(__pyx_t_2);
  5306. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  5307. index = 0; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L7_unpacking_failed;
  5308. __Pyx_GOTREF(__pyx_t_4);
  5309. index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
  5310. __Pyx_GOTREF(__pyx_t_1);
  5311. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 450, __pyx_L1_error)
  5312. __pyx_t_6 = NULL;
  5313. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5314. goto __pyx_L8_unpacking_done;
  5315. __pyx_L7_unpacking_failed:;
  5316. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5317. __pyx_t_6 = NULL;
  5318. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5319. __PYX_ERR(0, 450, __pyx_L1_error)
  5320. __pyx_L8_unpacking_done:;
  5321. }
  5322. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error)
  5323. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5324. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error)
  5325. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5326. __pyx_v_x2 = __pyx_t_7;
  5327. __pyx_v_y2 = __pyx_t_8;
  5328. /* "fontTools/pens/momentsPen.py":451
  5329. * x1, y1 = p1
  5330. * x2, y2 = p2
  5331. * x3, y3 = p3 # <<<<<<<<<<<<<<
  5332. *
  5333. * r0 = 6 * y2
  5334. */
  5335. if ((likely(PyTuple_CheckExact(__pyx_v_p3))) || (PyList_CheckExact(__pyx_v_p3))) {
  5336. PyObject* sequence = __pyx_v_p3;
  5337. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5338. if (unlikely(size != 2)) {
  5339. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5340. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5341. __PYX_ERR(0, 451, __pyx_L1_error)
  5342. }
  5343. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5344. if (likely(PyTuple_CheckExact(sequence))) {
  5345. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  5346. __Pyx_INCREF(__pyx_t_1);
  5347. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  5348. __Pyx_INCREF(__pyx_t_4);
  5349. } else {
  5350. __pyx_t_1 = __Pyx_PyList_GetItemRefFast(sequence, 0, __Pyx_ReferenceSharing_SharedReference);
  5351. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  5352. __Pyx_XGOTREF(__pyx_t_1);
  5353. __pyx_t_4 = __Pyx_PyList_GetItemRefFast(sequence, 1, __Pyx_ReferenceSharing_SharedReference);
  5354. if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
  5355. __Pyx_XGOTREF(__pyx_t_4);
  5356. }
  5357. #else
  5358. __pyx_t_1 = __Pyx_PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  5359. __Pyx_GOTREF(__pyx_t_1);
  5360. __pyx_t_4 = __Pyx_PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 451, __pyx_L1_error)
  5361. __Pyx_GOTREF(__pyx_t_4);
  5362. #endif
  5363. } else {
  5364. Py_ssize_t index = -1;
  5365. __pyx_t_2 = PyObject_GetIter(__pyx_v_p3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
  5366. __Pyx_GOTREF(__pyx_t_2);
  5367. __pyx_t_6 = (CYTHON_COMPILING_IN_LIMITED_API) ? PyIter_Next : __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  5368. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
  5369. __Pyx_GOTREF(__pyx_t_1);
  5370. index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_4)) goto __pyx_L9_unpacking_failed;
  5371. __Pyx_GOTREF(__pyx_t_4);
  5372. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < (0)) __PYX_ERR(0, 451, __pyx_L1_error)
  5373. __pyx_t_6 = NULL;
  5374. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5375. goto __pyx_L10_unpacking_done;
  5376. __pyx_L9_unpacking_failed:;
  5377. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5378. __pyx_t_6 = NULL;
  5379. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5380. __PYX_ERR(0, 451, __pyx_L1_error)
  5381. __pyx_L10_unpacking_done:;
  5382. }
  5383. __pyx_t_8 = __Pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error)
  5384. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5385. __pyx_t_7 = __Pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error)
  5386. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5387. __pyx_v_x3 = __pyx_t_8;
  5388. __pyx_v_y3 = __pyx_t_7;
  5389. /* "fontTools/pens/momentsPen.py":453
  5390. * x3, y3 = p3
  5391. *
  5392. * r0 = 6 * y2 # <<<<<<<<<<<<<<
  5393. * r1 = r0 * x3
  5394. * r2 = 10 * y3
  5395. */
  5396. __pyx_v_r0 = (6.0 * __pyx_v_y2);
  5397. /* "fontTools/pens/momentsPen.py":454
  5398. *
  5399. * r0 = 6 * y2
  5400. * r1 = r0 * x3 # <<<<<<<<<<<<<<
  5401. * r2 = 10 * y3
  5402. * r3 = r2 * x3
  5403. */
  5404. __pyx_v_r1 = (__pyx_v_r0 * __pyx_v_x3);
  5405. /* "fontTools/pens/momentsPen.py":455
  5406. * r0 = 6 * y2
  5407. * r1 = r0 * x3
  5408. * r2 = 10 * y3 # <<<<<<<<<<<<<<
  5409. * r3 = r2 * x3
  5410. * r4 = 3 * y1
  5411. */
  5412. __pyx_v_r2 = (10.0 * __pyx_v_y3);
  5413. /* "fontTools/pens/momentsPen.py":456
  5414. * r1 = r0 * x3
  5415. * r2 = 10 * y3
  5416. * r3 = r2 * x3 # <<<<<<<<<<<<<<
  5417. * r4 = 3 * y1
  5418. * r5 = 6 * x1
  5419. */
  5420. __pyx_v_r3 = (__pyx_v_r2 * __pyx_v_x3);
  5421. /* "fontTools/pens/momentsPen.py":457
  5422. * r2 = 10 * y3
  5423. * r3 = r2 * x3
  5424. * r4 = 3 * y1 # <<<<<<<<<<<<<<
  5425. * r5 = 6 * x1
  5426. * r6 = 3 * x2
  5427. */
  5428. __pyx_v_r4 = (3.0 * __pyx_v_y1);
  5429. /* "fontTools/pens/momentsPen.py":458
  5430. * r3 = r2 * x3
  5431. * r4 = 3 * y1
  5432. * r5 = 6 * x1 # <<<<<<<<<<<<<<
  5433. * r6 = 3 * x2
  5434. * r7 = 6 * y1
  5435. */
  5436. __pyx_v_r5 = (6.0 * __pyx_v_x1);
  5437. /* "fontTools/pens/momentsPen.py":459
  5438. * r4 = 3 * y1
  5439. * r5 = 6 * x1
  5440. * r6 = 3 * x2 # <<<<<<<<<<<<<<
  5441. * r7 = 6 * y1
  5442. * r8 = 3 * y2
  5443. */
  5444. __pyx_v_r6 = (3.0 * __pyx_v_x2);
  5445. /* "fontTools/pens/momentsPen.py":460
  5446. * r5 = 6 * x1
  5447. * r6 = 3 * x2
  5448. * r7 = 6 * y1 # <<<<<<<<<<<<<<
  5449. * r8 = 3 * y2
  5450. * r9 = x2**2
  5451. */
  5452. __pyx_v_r7 = (6.0 * __pyx_v_y1);
  5453. /* "fontTools/pens/momentsPen.py":461
  5454. * r6 = 3 * x2
  5455. * r7 = 6 * y1
  5456. * r8 = 3 * y2 # <<<<<<<<<<<<<<
  5457. * r9 = x2**2
  5458. * r10 = 45 * r9
  5459. */
  5460. __pyx_v_r8 = (3.0 * __pyx_v_y2);
  5461. /* "fontTools/pens/momentsPen.py":462
  5462. * r7 = 6 * y1
  5463. * r8 = 3 * y2
  5464. * r9 = x2**2 # <<<<<<<<<<<<<<
  5465. * r10 = 45 * r9
  5466. * r11 = r10 * y3
  5467. */
  5468. __pyx_v_r9 = pow(__pyx_v_x2, 2.0);
  5469. /* "fontTools/pens/momentsPen.py":463
  5470. * r8 = 3 * y2
  5471. * r9 = x2**2
  5472. * r10 = 45 * r9 # <<<<<<<<<<<<<<
  5473. * r11 = r10 * y3
  5474. * r12 = x3**2
  5475. */
  5476. __pyx_v_r10 = (45.0 * __pyx_v_r9);
  5477. /* "fontTools/pens/momentsPen.py":464
  5478. * r9 = x2**2
  5479. * r10 = 45 * r9
  5480. * r11 = r10 * y3 # <<<<<<<<<<<<<<
  5481. * r12 = x3**2
  5482. * r13 = r12 * y2
  5483. */
  5484. __pyx_v_r11 = (__pyx_v_r10 * __pyx_v_y3);
  5485. /* "fontTools/pens/momentsPen.py":465
  5486. * r10 = 45 * r9
  5487. * r11 = r10 * y3
  5488. * r12 = x3**2 # <<<<<<<<<<<<<<
  5489. * r13 = r12 * y2
  5490. * r14 = r12 * y3
  5491. */
  5492. __pyx_v_r12 = pow(__pyx_v_x3, 2.0);
  5493. /* "fontTools/pens/momentsPen.py":466
  5494. * r11 = r10 * y3
  5495. * r12 = x3**2
  5496. * r13 = r12 * y2 # <<<<<<<<<<<<<<
  5497. * r14 = r12 * y3
  5498. * r15 = 7 * y3
  5499. */
  5500. __pyx_v_r13 = (__pyx_v_r12 * __pyx_v_y2);
  5501. /* "fontTools/pens/momentsPen.py":467
  5502. * r12 = x3**2
  5503. * r13 = r12 * y2
  5504. * r14 = r12 * y3 # <<<<<<<<<<<<<<
  5505. * r15 = 7 * y3
  5506. * r16 = 15 * x3
  5507. */
  5508. __pyx_v_r14 = (__pyx_v_r12 * __pyx_v_y3);
  5509. /* "fontTools/pens/momentsPen.py":468
  5510. * r13 = r12 * y2
  5511. * r14 = r12 * y3
  5512. * r15 = 7 * y3 # <<<<<<<<<<<<<<
  5513. * r16 = 15 * x3
  5514. * r17 = r16 * x2
  5515. */
  5516. __pyx_v_r15 = (7.0 * __pyx_v_y3);
  5517. /* "fontTools/pens/momentsPen.py":469
  5518. * r14 = r12 * y3
  5519. * r15 = 7 * y3
  5520. * r16 = 15 * x3 # <<<<<<<<<<<<<<
  5521. * r17 = r16 * x2
  5522. * r18 = x1**2
  5523. */
  5524. __pyx_v_r16 = (15.0 * __pyx_v_x3);
  5525. /* "fontTools/pens/momentsPen.py":470
  5526. * r15 = 7 * y3
  5527. * r16 = 15 * x3
  5528. * r17 = r16 * x2 # <<<<<<<<<<<<<<
  5529. * r18 = x1**2
  5530. * r19 = 9 * r18
  5531. */
  5532. __pyx_v_r17 = (__pyx_v_r16 * __pyx_v_x2);
  5533. /* "fontTools/pens/momentsPen.py":471
  5534. * r16 = 15 * x3
  5535. * r17 = r16 * x2
  5536. * r18 = x1**2 # <<<<<<<<<<<<<<
  5537. * r19 = 9 * r18
  5538. * r20 = x0**2
  5539. */
  5540. __pyx_v_r18 = pow(__pyx_v_x1, 2.0);
  5541. /* "fontTools/pens/momentsPen.py":472
  5542. * r17 = r16 * x2
  5543. * r18 = x1**2
  5544. * r19 = 9 * r18 # <<<<<<<<<<<<<<
  5545. * r20 = x0**2
  5546. * r21 = 21 * y1
  5547. */
  5548. __pyx_v_r19 = (9.0 * __pyx_v_r18);
  5549. /* "fontTools/pens/momentsPen.py":473
  5550. * r18 = x1**2
  5551. * r19 = 9 * r18
  5552. * r20 = x0**2 # <<<<<<<<<<<<<<
  5553. * r21 = 21 * y1
  5554. * r22 = 9 * r9
  5555. */
  5556. __pyx_v_r20 = pow(__pyx_v_x0, 2.0);
  5557. /* "fontTools/pens/momentsPen.py":474
  5558. * r19 = 9 * r18
  5559. * r20 = x0**2
  5560. * r21 = 21 * y1 # <<<<<<<<<<<<<<
  5561. * r22 = 9 * r9
  5562. * r23 = r7 * x3
  5563. */
  5564. __pyx_v_r21 = (21.0 * __pyx_v_y1);
  5565. /* "fontTools/pens/momentsPen.py":475
  5566. * r20 = x0**2
  5567. * r21 = 21 * y1
  5568. * r22 = 9 * r9 # <<<<<<<<<<<<<<
  5569. * r23 = r7 * x3
  5570. * r24 = 9 * y2
  5571. */
  5572. __pyx_v_r22 = (9.0 * __pyx_v_r9);
  5573. /* "fontTools/pens/momentsPen.py":476
  5574. * r21 = 21 * y1
  5575. * r22 = 9 * r9
  5576. * r23 = r7 * x3 # <<<<<<<<<<<<<<
  5577. * r24 = 9 * y2
  5578. * r25 = r24 * x2 + r3
  5579. */
  5580. __pyx_v_r23 = (__pyx_v_r7 * __pyx_v_x3);
  5581. /* "fontTools/pens/momentsPen.py":477
  5582. * r22 = 9 * r9
  5583. * r23 = r7 * x3
  5584. * r24 = 9 * y2 # <<<<<<<<<<<<<<
  5585. * r25 = r24 * x2 + r3
  5586. * r26 = 9 * x2
  5587. */
  5588. __pyx_v_r24 = (9.0 * __pyx_v_y2);
  5589. /* "fontTools/pens/momentsPen.py":478
  5590. * r23 = r7 * x3
  5591. * r24 = 9 * y2
  5592. * r25 = r24 * x2 + r3 # <<<<<<<<<<<<<<
  5593. * r26 = 9 * x2
  5594. * r27 = x2 * y3
  5595. */
  5596. __pyx_v_r25 = ((__pyx_v_r24 * __pyx_v_x2) + __pyx_v_r3);
  5597. /* "fontTools/pens/momentsPen.py":479
  5598. * r24 = 9 * y2
  5599. * r25 = r24 * x2 + r3
  5600. * r26 = 9 * x2 # <<<<<<<<<<<<<<
  5601. * r27 = x2 * y3
  5602. * r28 = -r26 * y1 + 15 * r27
  5603. */
  5604. __pyx_v_r26 = (9.0 * __pyx_v_x2);
  5605. /* "fontTools/pens/momentsPen.py":480
  5606. * r25 = r24 * x2 + r3
  5607. * r26 = 9 * x2
  5608. * r27 = x2 * y3 # <<<<<<<<<<<<<<
  5609. * r28 = -r26 * y1 + 15 * r27
  5610. * r29 = 3 * x1
  5611. */
  5612. __pyx_v_r27 = (__pyx_v_x2 * __pyx_v_y3);
  5613. /* "fontTools/pens/momentsPen.py":481
  5614. * r26 = 9 * x2
  5615. * r27 = x2 * y3
  5616. * r28 = -r26 * y1 + 15 * r27 # <<<<<<<<<<<<<<
  5617. * r29 = 3 * x1
  5618. * r30 = 45 * x1
  5619. */
  5620. __pyx_v_r28 = (((-__pyx_v_r26) * __pyx_v_y1) + (15.0 * __pyx_v_r27));
  5621. /* "fontTools/pens/momentsPen.py":482
  5622. * r27 = x2 * y3
  5623. * r28 = -r26 * y1 + 15 * r27
  5624. * r29 = 3 * x1 # <<<<<<<<<<<<<<
  5625. * r30 = 45 * x1
  5626. * r31 = 12 * x3
  5627. */
  5628. __pyx_v_r29 = (3.0 * __pyx_v_x1);
  5629. /* "fontTools/pens/momentsPen.py":483
  5630. * r28 = -r26 * y1 + 15 * r27
  5631. * r29 = 3 * x1
  5632. * r30 = 45 * x1 # <<<<<<<<<<<<<<
  5633. * r31 = 12 * x3
  5634. * r32 = 45 * r18
  5635. */
  5636. __pyx_v_r30 = (45.0 * __pyx_v_x1);
  5637. /* "fontTools/pens/momentsPen.py":484
  5638. * r29 = 3 * x1
  5639. * r30 = 45 * x1
  5640. * r31 = 12 * x3 # <<<<<<<<<<<<<<
  5641. * r32 = 45 * r18
  5642. * r33 = 5 * r12
  5643. */
  5644. __pyx_v_r31 = (12.0 * __pyx_v_x3);
  5645. /* "fontTools/pens/momentsPen.py":485
  5646. * r30 = 45 * x1
  5647. * r31 = 12 * x3
  5648. * r32 = 45 * r18 # <<<<<<<<<<<<<<
  5649. * r33 = 5 * r12
  5650. * r34 = r8 * x3
  5651. */
  5652. __pyx_v_r32 = (45.0 * __pyx_v_r18);
  5653. /* "fontTools/pens/momentsPen.py":486
  5654. * r31 = 12 * x3
  5655. * r32 = 45 * r18
  5656. * r33 = 5 * r12 # <<<<<<<<<<<<<<
  5657. * r34 = r8 * x3
  5658. * r35 = 105 * y0
  5659. */
  5660. __pyx_v_r33 = (5.0 * __pyx_v_r12);
  5661. /* "fontTools/pens/momentsPen.py":487
  5662. * r32 = 45 * r18
  5663. * r33 = 5 * r12
  5664. * r34 = r8 * x3 # <<<<<<<<<<<<<<
  5665. * r35 = 105 * y0
  5666. * r36 = 30 * y0
  5667. */
  5668. __pyx_v_r34 = (__pyx_v_r8 * __pyx_v_x3);
  5669. /* "fontTools/pens/momentsPen.py":488
  5670. * r33 = 5 * r12
  5671. * r34 = r8 * x3
  5672. * r35 = 105 * y0 # <<<<<<<<<<<<<<
  5673. * r36 = 30 * y0
  5674. * r37 = r36 * x2
  5675. */
  5676. __pyx_v_r35 = (105.0 * __pyx_v_y0);
  5677. /* "fontTools/pens/momentsPen.py":489
  5678. * r34 = r8 * x3
  5679. * r35 = 105 * y0
  5680. * r36 = 30 * y0 # <<<<<<<<<<<<<<
  5681. * r37 = r36 * x2
  5682. * r38 = 5 * x3
  5683. */
  5684. __pyx_v_r36 = (30.0 * __pyx_v_y0);
  5685. /* "fontTools/pens/momentsPen.py":490
  5686. * r35 = 105 * y0
  5687. * r36 = 30 * y0
  5688. * r37 = r36 * x2 # <<<<<<<<<<<<<<
  5689. * r38 = 5 * x3
  5690. * r39 = 15 * y3
  5691. */
  5692. __pyx_v_r37 = (__pyx_v_r36 * __pyx_v_x2);
  5693. /* "fontTools/pens/momentsPen.py":491
  5694. * r36 = 30 * y0
  5695. * r37 = r36 * x2
  5696. * r38 = 5 * x3 # <<<<<<<<<<<<<<
  5697. * r39 = 15 * y3
  5698. * r40 = 5 * y3
  5699. */
  5700. __pyx_v_r38 = (5.0 * __pyx_v_x3);
  5701. /* "fontTools/pens/momentsPen.py":492
  5702. * r37 = r36 * x2
  5703. * r38 = 5 * x3
  5704. * r39 = 15 * y3 # <<<<<<<<<<<<<<
  5705. * r40 = 5 * y3
  5706. * r41 = r40 * x3
  5707. */
  5708. __pyx_v_r39 = (15.0 * __pyx_v_y3);
  5709. /* "fontTools/pens/momentsPen.py":493
  5710. * r38 = 5 * x3
  5711. * r39 = 15 * y3
  5712. * r40 = 5 * y3 # <<<<<<<<<<<<<<
  5713. * r41 = r40 * x3
  5714. * r42 = x2 * y2
  5715. */
  5716. __pyx_v_r40 = (5.0 * __pyx_v_y3);
  5717. /* "fontTools/pens/momentsPen.py":494
  5718. * r39 = 15 * y3
  5719. * r40 = 5 * y3
  5720. * r41 = r40 * x3 # <<<<<<<<<<<<<<
  5721. * r42 = x2 * y2
  5722. * r43 = 18 * r42
  5723. */
  5724. __pyx_v_r41 = (__pyx_v_r40 * __pyx_v_x3);
  5725. /* "fontTools/pens/momentsPen.py":495
  5726. * r40 = 5 * y3
  5727. * r41 = r40 * x3
  5728. * r42 = x2 * y2 # <<<<<<<<<<<<<<
  5729. * r43 = 18 * r42
  5730. * r44 = 45 * y1
  5731. */
  5732. __pyx_v_r42 = (__pyx_v_x2 * __pyx_v_y2);
  5733. /* "fontTools/pens/momentsPen.py":496
  5734. * r41 = r40 * x3
  5735. * r42 = x2 * y2
  5736. * r43 = 18 * r42 # <<<<<<<<<<<<<<
  5737. * r44 = 45 * y1
  5738. * r45 = r41 + r43 + r44 * x1
  5739. */
  5740. __pyx_v_r43 = (18.0 * __pyx_v_r42);
  5741. /* "fontTools/pens/momentsPen.py":497
  5742. * r42 = x2 * y2
  5743. * r43 = 18 * r42
  5744. * r44 = 45 * y1 # <<<<<<<<<<<<<<
  5745. * r45 = r41 + r43 + r44 * x1
  5746. * r46 = y2 * y3
  5747. */
  5748. __pyx_v_r44 = (45.0 * __pyx_v_y1);
  5749. /* "fontTools/pens/momentsPen.py":498
  5750. * r43 = 18 * r42
  5751. * r44 = 45 * y1
  5752. * r45 = r41 + r43 + r44 * x1 # <<<<<<<<<<<<<<
  5753. * r46 = y2 * y3
  5754. * r47 = r46 * x3
  5755. */
  5756. __pyx_v_r45 = ((__pyx_v_r41 + __pyx_v_r43) + (__pyx_v_r44 * __pyx_v_x1));
  5757. /* "fontTools/pens/momentsPen.py":499
  5758. * r44 = 45 * y1
  5759. * r45 = r41 + r43 + r44 * x1
  5760. * r46 = y2 * y3 # <<<<<<<<<<<<<<
  5761. * r47 = r46 * x3
  5762. * r48 = y2**2
  5763. */
  5764. __pyx_v_r46 = (__pyx_v_y2 * __pyx_v_y3);
  5765. /* "fontTools/pens/momentsPen.py":500
  5766. * r45 = r41 + r43 + r44 * x1
  5767. * r46 = y2 * y3
  5768. * r47 = r46 * x3 # <<<<<<<<<<<<<<
  5769. * r48 = y2**2
  5770. * r49 = 45 * r48
  5771. */
  5772. __pyx_v_r47 = (__pyx_v_r46 * __pyx_v_x3);
  5773. /* "fontTools/pens/momentsPen.py":501
  5774. * r46 = y2 * y3
  5775. * r47 = r46 * x3
  5776. * r48 = y2**2 # <<<<<<<<<<<<<<
  5777. * r49 = 45 * r48
  5778. * r50 = r49 * x3
  5779. */
  5780. __pyx_v_r48 = pow(__pyx_v_y2, 2.0);
  5781. /* "fontTools/pens/momentsPen.py":502
  5782. * r47 = r46 * x3
  5783. * r48 = y2**2
  5784. * r49 = 45 * r48 # <<<<<<<<<<<<<<
  5785. * r50 = r49 * x3
  5786. * r51 = y3**2
  5787. */
  5788. __pyx_v_r49 = (45.0 * __pyx_v_r48);
  5789. /* "fontTools/pens/momentsPen.py":503
  5790. * r48 = y2**2
  5791. * r49 = 45 * r48
  5792. * r50 = r49 * x3 # <<<<<<<<<<<<<<
  5793. * r51 = y3**2
  5794. * r52 = r51 * x3
  5795. */
  5796. __pyx_v_r50 = (__pyx_v_r49 * __pyx_v_x3);
  5797. /* "fontTools/pens/momentsPen.py":504
  5798. * r49 = 45 * r48
  5799. * r50 = r49 * x3
  5800. * r51 = y3**2 # <<<<<<<<<<<<<<
  5801. * r52 = r51 * x3
  5802. * r53 = y1**2
  5803. */
  5804. __pyx_v_r51 = pow(__pyx_v_y3, 2.0);
  5805. /* "fontTools/pens/momentsPen.py":505
  5806. * r50 = r49 * x3
  5807. * r51 = y3**2
  5808. * r52 = r51 * x3 # <<<<<<<<<<<<<<
  5809. * r53 = y1**2
  5810. * r54 = 9 * r53
  5811. */
  5812. __pyx_v_r52 = (__pyx_v_r51 * __pyx_v_x3);
  5813. /* "fontTools/pens/momentsPen.py":506
  5814. * r51 = y3**2
  5815. * r52 = r51 * x3
  5816. * r53 = y1**2 # <<<<<<<<<<<<<<
  5817. * r54 = 9 * r53
  5818. * r55 = y0**2
  5819. */
  5820. __pyx_v_r53 = pow(__pyx_v_y1, 2.0);
  5821. /* "fontTools/pens/momentsPen.py":507
  5822. * r52 = r51 * x3
  5823. * r53 = y1**2
  5824. * r54 = 9 * r53 # <<<<<<<<<<<<<<
  5825. * r55 = y0**2
  5826. * r56 = 21 * x1
  5827. */
  5828. __pyx_v_r54 = (9.0 * __pyx_v_r53);
  5829. /* "fontTools/pens/momentsPen.py":508
  5830. * r53 = y1**2
  5831. * r54 = 9 * r53
  5832. * r55 = y0**2 # <<<<<<<<<<<<<<
  5833. * r56 = 21 * x1
  5834. * r57 = 6 * x2
  5835. */
  5836. __pyx_v_r55 = pow(__pyx_v_y0, 2.0);
  5837. /* "fontTools/pens/momentsPen.py":509
  5838. * r54 = 9 * r53
  5839. * r55 = y0**2
  5840. * r56 = 21 * x1 # <<<<<<<<<<<<<<
  5841. * r57 = 6 * x2
  5842. * r58 = r16 * y2
  5843. */
  5844. __pyx_v_r56 = (21.0 * __pyx_v_x1);
  5845. /* "fontTools/pens/momentsPen.py":510
  5846. * r55 = y0**2
  5847. * r56 = 21 * x1
  5848. * r57 = 6 * x2 # <<<<<<<<<<<<<<
  5849. * r58 = r16 * y2
  5850. * r59 = r39 * y2
  5851. */
  5852. __pyx_v_r57 = (6.0 * __pyx_v_x2);
  5853. /* "fontTools/pens/momentsPen.py":511
  5854. * r56 = 21 * x1
  5855. * r57 = 6 * x2
  5856. * r58 = r16 * y2 # <<<<<<<<<<<<<<
  5857. * r59 = r39 * y2
  5858. * r60 = 9 * r48
  5859. */
  5860. __pyx_v_r58 = (__pyx_v_r16 * __pyx_v_y2);
  5861. /* "fontTools/pens/momentsPen.py":512
  5862. * r57 = 6 * x2
  5863. * r58 = r16 * y2
  5864. * r59 = r39 * y2 # <<<<<<<<<<<<<<
  5865. * r60 = 9 * r48
  5866. * r61 = r6 * y3
  5867. */
  5868. __pyx_v_r59 = (__pyx_v_r39 * __pyx_v_y2);
  5869. /* "fontTools/pens/momentsPen.py":513
  5870. * r58 = r16 * y2
  5871. * r59 = r39 * y2
  5872. * r60 = 9 * r48 # <<<<<<<<<<<<<<
  5873. * r61 = r6 * y3
  5874. * r62 = 3 * y3
  5875. */
  5876. __pyx_v_r60 = (9.0 * __pyx_v_r48);
  5877. /* "fontTools/pens/momentsPen.py":514
  5878. * r59 = r39 * y2
  5879. * r60 = 9 * r48
  5880. * r61 = r6 * y3 # <<<<<<<<<<<<<<
  5881. * r62 = 3 * y3
  5882. * r63 = r36 * y2
  5883. */
  5884. __pyx_v_r61 = (__pyx_v_r6 * __pyx_v_y3);
  5885. /* "fontTools/pens/momentsPen.py":515
  5886. * r60 = 9 * r48
  5887. * r61 = r6 * y3
  5888. * r62 = 3 * y3 # <<<<<<<<<<<<<<
  5889. * r63 = r36 * y2
  5890. * r64 = y1 * y3
  5891. */
  5892. __pyx_v_r62 = (3.0 * __pyx_v_y3);
  5893. /* "fontTools/pens/momentsPen.py":516
  5894. * r61 = r6 * y3
  5895. * r62 = 3 * y3
  5896. * r63 = r36 * y2 # <<<<<<<<<<<<<<
  5897. * r64 = y1 * y3
  5898. * r65 = 45 * r53
  5899. */
  5900. __pyx_v_r63 = (__pyx_v_r36 * __pyx_v_y2);
  5901. /* "fontTools/pens/momentsPen.py":517
  5902. * r62 = 3 * y3
  5903. * r63 = r36 * y2
  5904. * r64 = y1 * y3 # <<<<<<<<<<<<<<
  5905. * r65 = 45 * r53
  5906. * r66 = 5 * r51
  5907. */
  5908. __pyx_v_r64 = (__pyx_v_y1 * __pyx_v_y3);
  5909. /* "fontTools/pens/momentsPen.py":518
  5910. * r63 = r36 * y2
  5911. * r64 = y1 * y3
  5912. * r65 = 45 * r53 # <<<<<<<<<<<<<<
  5913. * r66 = 5 * r51
  5914. * r67 = x2**3
  5915. */
  5916. __pyx_v_r65 = (45.0 * __pyx_v_r53);
  5917. /* "fontTools/pens/momentsPen.py":519
  5918. * r64 = y1 * y3
  5919. * r65 = 45 * r53
  5920. * r66 = 5 * r51 # <<<<<<<<<<<<<<
  5921. * r67 = x2**3
  5922. * r68 = x3**3
  5923. */
  5924. __pyx_v_r66 = (5.0 * __pyx_v_r51);
  5925. /* "fontTools/pens/momentsPen.py":520
  5926. * r65 = 45 * r53
  5927. * r66 = 5 * r51
  5928. * r67 = x2**3 # <<<<<<<<<<<<<<
  5929. * r68 = x3**3
  5930. * r69 = 630 * y2
  5931. */
  5932. __pyx_v_r67 = pow(__pyx_v_x2, 3.0);
  5933. /* "fontTools/pens/momentsPen.py":521
  5934. * r66 = 5 * r51
  5935. * r67 = x2**3
  5936. * r68 = x3**3 # <<<<<<<<<<<<<<
  5937. * r69 = 630 * y2
  5938. * r70 = 126 * x3
  5939. */
  5940. __pyx_v_r68 = pow(__pyx_v_x3, 3.0);
  5941. /* "fontTools/pens/momentsPen.py":522
  5942. * r67 = x2**3
  5943. * r68 = x3**3
  5944. * r69 = 630 * y2 # <<<<<<<<<<<<<<
  5945. * r70 = 126 * x3
  5946. * r71 = x1**3
  5947. */
  5948. __pyx_v_r69 = (630.0 * __pyx_v_y2);
  5949. /* "fontTools/pens/momentsPen.py":523
  5950. * r68 = x3**3
  5951. * r69 = 630 * y2
  5952. * r70 = 126 * x3 # <<<<<<<<<<<<<<
  5953. * r71 = x1**3
  5954. * r72 = 126 * x2
  5955. */
  5956. __pyx_v_r70 = (126.0 * __pyx_v_x3);
  5957. /* "fontTools/pens/momentsPen.py":524
  5958. * r69 = 630 * y2
  5959. * r70 = 126 * x3
  5960. * r71 = x1**3 # <<<<<<<<<<<<<<
  5961. * r72 = 126 * x2
  5962. * r73 = 63 * r9
  5963. */
  5964. __pyx_v_r71 = pow(__pyx_v_x1, 3.0);
  5965. /* "fontTools/pens/momentsPen.py":525
  5966. * r70 = 126 * x3
  5967. * r71 = x1**3
  5968. * r72 = 126 * x2 # <<<<<<<<<<<<<<
  5969. * r73 = 63 * r9
  5970. * r74 = r73 * x3
  5971. */
  5972. __pyx_v_r72 = (126.0 * __pyx_v_x2);
  5973. /* "fontTools/pens/momentsPen.py":526
  5974. * r71 = x1**3
  5975. * r72 = 126 * x2
  5976. * r73 = 63 * r9 # <<<<<<<<<<<<<<
  5977. * r74 = r73 * x3
  5978. * r75 = r15 * x3 + 15 * r42
  5979. */
  5980. __pyx_v_r73 = (63.0 * __pyx_v_r9);
  5981. /* "fontTools/pens/momentsPen.py":527
  5982. * r72 = 126 * x2
  5983. * r73 = 63 * r9
  5984. * r74 = r73 * x3 # <<<<<<<<<<<<<<
  5985. * r75 = r15 * x3 + 15 * r42
  5986. * r76 = 630 * x1
  5987. */
  5988. __pyx_v_r74 = (__pyx_v_r73 * __pyx_v_x3);
  5989. /* "fontTools/pens/momentsPen.py":528
  5990. * r73 = 63 * r9
  5991. * r74 = r73 * x3
  5992. * r75 = r15 * x3 + 15 * r42 # <<<<<<<<<<<<<<
  5993. * r76 = 630 * x1
  5994. * r77 = 14 * x3
  5995. */
  5996. __pyx_v_r75 = ((__pyx_v_r15 * __pyx_v_x3) + (15.0 * __pyx_v_r42));
  5997. /* "fontTools/pens/momentsPen.py":529
  5998. * r74 = r73 * x3
  5999. * r75 = r15 * x3 + 15 * r42
  6000. * r76 = 630 * x1 # <<<<<<<<<<<<<<
  6001. * r77 = 14 * x3
  6002. * r78 = 21 * r27
  6003. */
  6004. __pyx_v_r76 = (630.0 * __pyx_v_x1);
  6005. /* "fontTools/pens/momentsPen.py":530
  6006. * r75 = r15 * x3 + 15 * r42
  6007. * r76 = 630 * x1
  6008. * r77 = 14 * x3 # <<<<<<<<<<<<<<
  6009. * r78 = 21 * r27
  6010. * r79 = 42 * x1
  6011. */
  6012. __pyx_v_r77 = (14.0 * __pyx_v_x3);
  6013. /* "fontTools/pens/momentsPen.py":531
  6014. * r76 = 630 * x1
  6015. * r77 = 14 * x3
  6016. * r78 = 21 * r27 # <<<<<<<<<<<<<<
  6017. * r79 = 42 * x1
  6018. * r80 = 42 * x2
  6019. */
  6020. __pyx_v_r78 = (21.0 * __pyx_v_r27);
  6021. /* "fontTools/pens/momentsPen.py":532
  6022. * r77 = 14 * x3
  6023. * r78 = 21 * r27
  6024. * r79 = 42 * x1 # <<<<<<<<<<<<<<
  6025. * r80 = 42 * x2
  6026. * r81 = x1 * y2
  6027. */
  6028. __pyx_v_r79 = (42.0 * __pyx_v_x1);
  6029. /* "fontTools/pens/momentsPen.py":533
  6030. * r78 = 21 * r27
  6031. * r79 = 42 * x1
  6032. * r80 = 42 * x2 # <<<<<<<<<<<<<<
  6033. * r81 = x1 * y2
  6034. * r82 = 63 * r42
  6035. */
  6036. __pyx_v_r80 = (42.0 * __pyx_v_x2);
  6037. /* "fontTools/pens/momentsPen.py":534
  6038. * r79 = 42 * x1
  6039. * r80 = 42 * x2
  6040. * r81 = x1 * y2 # <<<<<<<<<<<<<<
  6041. * r82 = 63 * r42
  6042. * r83 = x1 * y1
  6043. */
  6044. __pyx_v_r81 = (__pyx_v_x1 * __pyx_v_y2);
  6045. /* "fontTools/pens/momentsPen.py":535
  6046. * r80 = 42 * x2
  6047. * r81 = x1 * y2
  6048. * r82 = 63 * r42 # <<<<<<<<<<<<<<
  6049. * r83 = x1 * y1
  6050. * r84 = r41 + r82 + 378 * r83
  6051. */
  6052. __pyx_v_r82 = (63.0 * __pyx_v_r42);
  6053. /* "fontTools/pens/momentsPen.py":536
  6054. * r81 = x1 * y2
  6055. * r82 = 63 * r42
  6056. * r83 = x1 * y1 # <<<<<<<<<<<<<<
  6057. * r84 = r41 + r82 + 378 * r83
  6058. * r85 = x2 * x3
  6059. */
  6060. __pyx_v_r83 = (__pyx_v_x1 * __pyx_v_y1);
  6061. /* "fontTools/pens/momentsPen.py":537
  6062. * r82 = 63 * r42
  6063. * r83 = x1 * y1
  6064. * r84 = r41 + r82 + 378 * r83 # <<<<<<<<<<<<<<
  6065. * r85 = x2 * x3
  6066. * r86 = r85 * y1
  6067. */
  6068. __pyx_v_r84 = ((__pyx_v_r41 + __pyx_v_r82) + (378.0 * __pyx_v_r83));
  6069. /* "fontTools/pens/momentsPen.py":538
  6070. * r83 = x1 * y1
  6071. * r84 = r41 + r82 + 378 * r83
  6072. * r85 = x2 * x3 # <<<<<<<<<<<<<<
  6073. * r86 = r85 * y1
  6074. * r87 = r27 * x3
  6075. */
  6076. __pyx_v_r85 = (__pyx_v_x2 * __pyx_v_x3);
  6077. /* "fontTools/pens/momentsPen.py":539
  6078. * r84 = r41 + r82 + 378 * r83
  6079. * r85 = x2 * x3
  6080. * r86 = r85 * y1 # <<<<<<<<<<<<<<
  6081. * r87 = r27 * x3
  6082. * r88 = 27 * r9
  6083. */
  6084. __pyx_v_r86 = (__pyx_v_r85 * __pyx_v_y1);
  6085. /* "fontTools/pens/momentsPen.py":540
  6086. * r85 = x2 * x3
  6087. * r86 = r85 * y1
  6088. * r87 = r27 * x3 # <<<<<<<<<<<<<<
  6089. * r88 = 27 * r9
  6090. * r89 = r88 * y2
  6091. */
  6092. __pyx_v_r87 = (__pyx_v_r27 * __pyx_v_x3);
  6093. /* "fontTools/pens/momentsPen.py":541
  6094. * r86 = r85 * y1
  6095. * r87 = r27 * x3
  6096. * r88 = 27 * r9 # <<<<<<<<<<<<<<
  6097. * r89 = r88 * y2
  6098. * r90 = 42 * r14
  6099. */
  6100. __pyx_v_r88 = (27.0 * __pyx_v_r9);
  6101. /* "fontTools/pens/momentsPen.py":542
  6102. * r87 = r27 * x3
  6103. * r88 = 27 * r9
  6104. * r89 = r88 * y2 # <<<<<<<<<<<<<<
  6105. * r90 = 42 * r14
  6106. * r91 = 90 * x1
  6107. */
  6108. __pyx_v_r89 = (__pyx_v_r88 * __pyx_v_y2);
  6109. /* "fontTools/pens/momentsPen.py":543
  6110. * r88 = 27 * r9
  6111. * r89 = r88 * y2
  6112. * r90 = 42 * r14 # <<<<<<<<<<<<<<
  6113. * r91 = 90 * x1
  6114. * r92 = 189 * r18
  6115. */
  6116. __pyx_v_r90 = (42.0 * __pyx_v_r14);
  6117. /* "fontTools/pens/momentsPen.py":544
  6118. * r89 = r88 * y2
  6119. * r90 = 42 * r14
  6120. * r91 = 90 * x1 # <<<<<<<<<<<<<<
  6121. * r92 = 189 * r18
  6122. * r93 = 378 * r18
  6123. */
  6124. __pyx_v_r91 = (90.0 * __pyx_v_x1);
  6125. /* "fontTools/pens/momentsPen.py":545
  6126. * r90 = 42 * r14
  6127. * r91 = 90 * x1
  6128. * r92 = 189 * r18 # <<<<<<<<<<<<<<
  6129. * r93 = 378 * r18
  6130. * r94 = r12 * y1
  6131. */
  6132. __pyx_v_r92 = (189.0 * __pyx_v_r18);
  6133. /* "fontTools/pens/momentsPen.py":546
  6134. * r91 = 90 * x1
  6135. * r92 = 189 * r18
  6136. * r93 = 378 * r18 # <<<<<<<<<<<<<<
  6137. * r94 = r12 * y1
  6138. * r95 = 252 * x1 * x2
  6139. */
  6140. __pyx_v_r93 = (378.0 * __pyx_v_r18);
  6141. /* "fontTools/pens/momentsPen.py":547
  6142. * r92 = 189 * r18
  6143. * r93 = 378 * r18
  6144. * r94 = r12 * y1 # <<<<<<<<<<<<<<
  6145. * r95 = 252 * x1 * x2
  6146. * r96 = r79 * x3
  6147. */
  6148. __pyx_v_r94 = (__pyx_v_r12 * __pyx_v_y1);
  6149. /* "fontTools/pens/momentsPen.py":548
  6150. * r93 = 378 * r18
  6151. * r94 = r12 * y1
  6152. * r95 = 252 * x1 * x2 # <<<<<<<<<<<<<<
  6153. * r96 = r79 * x3
  6154. * r97 = 30 * r85
  6155. */
  6156. __pyx_v_r95 = ((252.0 * __pyx_v_x1) * __pyx_v_x2);
  6157. /* "fontTools/pens/momentsPen.py":549
  6158. * r94 = r12 * y1
  6159. * r95 = 252 * x1 * x2
  6160. * r96 = r79 * x3 # <<<<<<<<<<<<<<
  6161. * r97 = 30 * r85
  6162. * r98 = r83 * x3
  6163. */
  6164. __pyx_v_r96 = (__pyx_v_r79 * __pyx_v_x3);
  6165. /* "fontTools/pens/momentsPen.py":550
  6166. * r95 = 252 * x1 * x2
  6167. * r96 = r79 * x3
  6168. * r97 = 30 * r85 # <<<<<<<<<<<<<<
  6169. * r98 = r83 * x3
  6170. * r99 = 30 * x3
  6171. */
  6172. __pyx_v_r97 = (30.0 * __pyx_v_r85);
  6173. /* "fontTools/pens/momentsPen.py":551
  6174. * r96 = r79 * x3
  6175. * r97 = 30 * r85
  6176. * r98 = r83 * x3 # <<<<<<<<<<<<<<
  6177. * r99 = 30 * x3
  6178. * r100 = 42 * x3
  6179. */
  6180. __pyx_v_r98 = (__pyx_v_r83 * __pyx_v_x3);
  6181. /* "fontTools/pens/momentsPen.py":552
  6182. * r97 = 30 * r85
  6183. * r98 = r83 * x3
  6184. * r99 = 30 * x3 # <<<<<<<<<<<<<<
  6185. * r100 = 42 * x3
  6186. * r101 = r42 * x1
  6187. */
  6188. __pyx_v_r99 = (30.0 * __pyx_v_x3);
  6189. /* "fontTools/pens/momentsPen.py":553
  6190. * r98 = r83 * x3
  6191. * r99 = 30 * x3
  6192. * r100 = 42 * x3 # <<<<<<<<<<<<<<
  6193. * r101 = r42 * x1
  6194. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  6195. */
  6196. __pyx_v_r100 = (42.0 * __pyx_v_x3);
  6197. /* "fontTools/pens/momentsPen.py":554
  6198. * r99 = 30 * x3
  6199. * r100 = 42 * x3
  6200. * r101 = r42 * x1 # <<<<<<<<<<<<<<
  6201. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  6202. * r103 = 378 * r48
  6203. */
  6204. __pyx_v_r101 = (__pyx_v_r42 * __pyx_v_x1);
  6205. /* "fontTools/pens/momentsPen.py":555
  6206. * r100 = 42 * x3
  6207. * r101 = r42 * x1
  6208. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99 # <<<<<<<<<<<<<<
  6209. * r103 = 378 * r48
  6210. * r104 = 18 * y1
  6211. */
  6212. __pyx_v_r102 = ((((__pyx_v_r10 * __pyx_v_y2) + (14.0 * __pyx_v_r14)) + ((126.0 * __pyx_v_r18) * __pyx_v_y1)) + (__pyx_v_r81 * __pyx_v_r99));
  6213. /* "fontTools/pens/momentsPen.py":556
  6214. * r101 = r42 * x1
  6215. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  6216. * r103 = 378 * r48 # <<<<<<<<<<<<<<
  6217. * r104 = 18 * y1
  6218. * r105 = r104 * y2
  6219. */
  6220. __pyx_v_r103 = (378.0 * __pyx_v_r48);
  6221. /* "fontTools/pens/momentsPen.py":557
  6222. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  6223. * r103 = 378 * r48
  6224. * r104 = 18 * y1 # <<<<<<<<<<<<<<
  6225. * r105 = r104 * y2
  6226. * r106 = y0 * y1
  6227. */
  6228. __pyx_v_r104 = (18.0 * __pyx_v_y1);
  6229. /* "fontTools/pens/momentsPen.py":558
  6230. * r103 = 378 * r48
  6231. * r104 = 18 * y1
  6232. * r105 = r104 * y2 # <<<<<<<<<<<<<<
  6233. * r106 = y0 * y1
  6234. * r107 = 252 * y2
  6235. */
  6236. __pyx_v_r105 = (__pyx_v_r104 * __pyx_v_y2);
  6237. /* "fontTools/pens/momentsPen.py":559
  6238. * r104 = 18 * y1
  6239. * r105 = r104 * y2
  6240. * r106 = y0 * y1 # <<<<<<<<<<<<<<
  6241. * r107 = 252 * y2
  6242. * r108 = r107 * y0
  6243. */
  6244. __pyx_v_r106 = (__pyx_v_y0 * __pyx_v_y1);
  6245. /* "fontTools/pens/momentsPen.py":560
  6246. * r105 = r104 * y2
  6247. * r106 = y0 * y1
  6248. * r107 = 252 * y2 # <<<<<<<<<<<<<<
  6249. * r108 = r107 * y0
  6250. * r109 = y0 * y3
  6251. */
  6252. __pyx_v_r107 = (252.0 * __pyx_v_y2);
  6253. /* "fontTools/pens/momentsPen.py":561
  6254. * r106 = y0 * y1
  6255. * r107 = 252 * y2
  6256. * r108 = r107 * y0 # <<<<<<<<<<<<<<
  6257. * r109 = y0 * y3
  6258. * r110 = 42 * r64
  6259. */
  6260. __pyx_v_r108 = (__pyx_v_r107 * __pyx_v_y0);
  6261. /* "fontTools/pens/momentsPen.py":562
  6262. * r107 = 252 * y2
  6263. * r108 = r107 * y0
  6264. * r109 = y0 * y3 # <<<<<<<<<<<<<<
  6265. * r110 = 42 * r64
  6266. * r111 = 378 * r53
  6267. */
  6268. __pyx_v_r109 = (__pyx_v_y0 * __pyx_v_y3);
  6269. /* "fontTools/pens/momentsPen.py":563
  6270. * r108 = r107 * y0
  6271. * r109 = y0 * y3
  6272. * r110 = 42 * r64 # <<<<<<<<<<<<<<
  6273. * r111 = 378 * r53
  6274. * r112 = 63 * r48
  6275. */
  6276. __pyx_v_r110 = (42.0 * __pyx_v_r64);
  6277. /* "fontTools/pens/momentsPen.py":564
  6278. * r109 = y0 * y3
  6279. * r110 = 42 * r64
  6280. * r111 = 378 * r53 # <<<<<<<<<<<<<<
  6281. * r112 = 63 * r48
  6282. * r113 = 27 * x2
  6283. */
  6284. __pyx_v_r111 = (378.0 * __pyx_v_r53);
  6285. /* "fontTools/pens/momentsPen.py":565
  6286. * r110 = 42 * r64
  6287. * r111 = 378 * r53
  6288. * r112 = 63 * r48 # <<<<<<<<<<<<<<
  6289. * r113 = 27 * x2
  6290. * r114 = r27 * y2
  6291. */
  6292. __pyx_v_r112 = (63.0 * __pyx_v_r48);
  6293. /* "fontTools/pens/momentsPen.py":566
  6294. * r111 = 378 * r53
  6295. * r112 = 63 * r48
  6296. * r113 = 27 * x2 # <<<<<<<<<<<<<<
  6297. * r114 = r27 * y2
  6298. * r115 = r113 * r48 + 42 * r52
  6299. */
  6300. __pyx_v_r113 = (27.0 * __pyx_v_x2);
  6301. /* "fontTools/pens/momentsPen.py":567
  6302. * r112 = 63 * r48
  6303. * r113 = 27 * x2
  6304. * r114 = r27 * y2 # <<<<<<<<<<<<<<
  6305. * r115 = r113 * r48 + 42 * r52
  6306. * r116 = x3 * y3
  6307. */
  6308. __pyx_v_r114 = (__pyx_v_r27 * __pyx_v_y2);
  6309. /* "fontTools/pens/momentsPen.py":568
  6310. * r113 = 27 * x2
  6311. * r114 = r27 * y2
  6312. * r115 = r113 * r48 + 42 * r52 # <<<<<<<<<<<<<<
  6313. * r116 = x3 * y3
  6314. * r117 = 54 * r42
  6315. */
  6316. __pyx_v_r115 = ((__pyx_v_r113 * __pyx_v_r48) + (42.0 * __pyx_v_r52));
  6317. /* "fontTools/pens/momentsPen.py":569
  6318. * r114 = r27 * y2
  6319. * r115 = r113 * r48 + 42 * r52
  6320. * r116 = x3 * y3 # <<<<<<<<<<<<<<
  6321. * r117 = 54 * r42
  6322. * r118 = r51 * x1
  6323. */
  6324. __pyx_v_r116 = (__pyx_v_x3 * __pyx_v_y3);
  6325. /* "fontTools/pens/momentsPen.py":570
  6326. * r115 = r113 * r48 + 42 * r52
  6327. * r116 = x3 * y3
  6328. * r117 = 54 * r42 # <<<<<<<<<<<<<<
  6329. * r118 = r51 * x1
  6330. * r119 = r51 * x2
  6331. */
  6332. __pyx_v_r117 = (54.0 * __pyx_v_r42);
  6333. /* "fontTools/pens/momentsPen.py":571
  6334. * r116 = x3 * y3
  6335. * r117 = 54 * r42
  6336. * r118 = r51 * x1 # <<<<<<<<<<<<<<
  6337. * r119 = r51 * x2
  6338. * r120 = r48 * x1
  6339. */
  6340. __pyx_v_r118 = (__pyx_v_r51 * __pyx_v_x1);
  6341. /* "fontTools/pens/momentsPen.py":572
  6342. * r117 = 54 * r42
  6343. * r118 = r51 * x1
  6344. * r119 = r51 * x2 # <<<<<<<<<<<<<<
  6345. * r120 = r48 * x1
  6346. * r121 = 21 * x3
  6347. */
  6348. __pyx_v_r119 = (__pyx_v_r51 * __pyx_v_x2);
  6349. /* "fontTools/pens/momentsPen.py":573
  6350. * r118 = r51 * x1
  6351. * r119 = r51 * x2
  6352. * r120 = r48 * x1 # <<<<<<<<<<<<<<
  6353. * r121 = 21 * x3
  6354. * r122 = r64 * x1
  6355. */
  6356. __pyx_v_r120 = (__pyx_v_r48 * __pyx_v_x1);
  6357. /* "fontTools/pens/momentsPen.py":574
  6358. * r119 = r51 * x2
  6359. * r120 = r48 * x1
  6360. * r121 = 21 * x3 # <<<<<<<<<<<<<<
  6361. * r122 = r64 * x1
  6362. * r123 = r81 * y3
  6363. */
  6364. __pyx_v_r121 = (21.0 * __pyx_v_x3);
  6365. /* "fontTools/pens/momentsPen.py":575
  6366. * r120 = r48 * x1
  6367. * r121 = 21 * x3
  6368. * r122 = r64 * x1 # <<<<<<<<<<<<<<
  6369. * r123 = r81 * y3
  6370. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  6371. */
  6372. __pyx_v_r122 = (__pyx_v_r64 * __pyx_v_x1);
  6373. /* "fontTools/pens/momentsPen.py":576
  6374. * r121 = 21 * x3
  6375. * r122 = r64 * x1
  6376. * r123 = r81 * y3 # <<<<<<<<<<<<<<
  6377. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  6378. * r125 = y2**3
  6379. */
  6380. __pyx_v_r123 = (__pyx_v_r81 * __pyx_v_y3);
  6381. /* "fontTools/pens/momentsPen.py":577
  6382. * r122 = r64 * x1
  6383. * r123 = r81 * y3
  6384. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1 # <<<<<<<<<<<<<<
  6385. * r125 = y2**3
  6386. * r126 = y3**3
  6387. */
  6388. __pyx_v_r124 = (((((30.0 * __pyx_v_r27) * __pyx_v_y1) + (__pyx_v_r49 * __pyx_v_x2)) + (14.0 * __pyx_v_r52)) + ((126.0 * __pyx_v_r53) * __pyx_v_x1));
  6389. /* "fontTools/pens/momentsPen.py":578
  6390. * r123 = r81 * y3
  6391. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  6392. * r125 = y2**3 # <<<<<<<<<<<<<<
  6393. * r126 = y3**3
  6394. * r127 = y1**3
  6395. */
  6396. __pyx_v_r125 = pow(__pyx_v_y2, 3.0);
  6397. /* "fontTools/pens/momentsPen.py":579
  6398. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  6399. * r125 = y2**3
  6400. * r126 = y3**3 # <<<<<<<<<<<<<<
  6401. * r127 = y1**3
  6402. * r128 = y0**3
  6403. */
  6404. __pyx_v_r126 = pow(__pyx_v_y3, 3.0);
  6405. /* "fontTools/pens/momentsPen.py":580
  6406. * r125 = y2**3
  6407. * r126 = y3**3
  6408. * r127 = y1**3 # <<<<<<<<<<<<<<
  6409. * r128 = y0**3
  6410. * r129 = r51 * y2
  6411. */
  6412. __pyx_v_r127 = pow(__pyx_v_y1, 3.0);
  6413. /* "fontTools/pens/momentsPen.py":581
  6414. * r126 = y3**3
  6415. * r127 = y1**3
  6416. * r128 = y0**3 # <<<<<<<<<<<<<<
  6417. * r129 = r51 * y2
  6418. * r130 = r112 * y3 + r21 * r51
  6419. */
  6420. __pyx_v_r128 = pow(__pyx_v_y0, 3.0);
  6421. /* "fontTools/pens/momentsPen.py":582
  6422. * r127 = y1**3
  6423. * r128 = y0**3
  6424. * r129 = r51 * y2 # <<<<<<<<<<<<<<
  6425. * r130 = r112 * y3 + r21 * r51
  6426. * r131 = 189 * r53
  6427. */
  6428. __pyx_v_r129 = (__pyx_v_r51 * __pyx_v_y2);
  6429. /* "fontTools/pens/momentsPen.py":583
  6430. * r128 = y0**3
  6431. * r129 = r51 * y2
  6432. * r130 = r112 * y3 + r21 * r51 # <<<<<<<<<<<<<<
  6433. * r131 = 189 * r53
  6434. * r132 = 90 * y2
  6435. */
  6436. __pyx_v_r130 = ((__pyx_v_r112 * __pyx_v_y3) + (__pyx_v_r21 * __pyx_v_r51));
  6437. /* "fontTools/pens/momentsPen.py":584
  6438. * r129 = r51 * y2
  6439. * r130 = r112 * y3 + r21 * r51
  6440. * r131 = 189 * r53 # <<<<<<<<<<<<<<
  6441. * r132 = 90 * y2
  6442. *
  6443. */
  6444. __pyx_v_r131 = (189.0 * __pyx_v_r53);
  6445. /* "fontTools/pens/momentsPen.py":585
  6446. * r130 = r112 * y3 + r21 * r51
  6447. * r131 = 189 * r53
  6448. * r132 = 90 * y2 # <<<<<<<<<<<<<<
  6449. *
  6450. * self.area += (
  6451. */
  6452. __pyx_v_r132 = (90.0 * __pyx_v_y2);
  6453. /* "fontTools/pens/momentsPen.py":587
  6454. * r132 = 90 * y2
  6455. *
  6456. * self.area += ( # <<<<<<<<<<<<<<
  6457. * -r1 / 20
  6458. * - r3 / 20
  6459. */
  6460. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 587, __pyx_L1_error)
  6461. __Pyx_GOTREF(__pyx_t_4);
  6462. /* "fontTools/pens/momentsPen.py":594
  6463. * + 3 * x1 * (y2 + y3) / 20
  6464. * + 3 * x2 * y3 / 10
  6465. * - y0 * (r5 + r6 + x3) / 20 # <<<<<<<<<<<<<<
  6466. * )
  6467. * self.momentX += (
  6468. */
  6469. __pyx_t_1 = PyFloat_FromDouble(((((((((-__pyx_v_r1) / 20.0) - (__pyx_v_r3 / 20.0)) - ((__pyx_v_r4 * (__pyx_v_x2 + __pyx_v_x3)) / 20.0)) + ((__pyx_v_x0 * (((__pyx_v_r7 + __pyx_v_r8) + (10.0 * __pyx_v_y0)) + __pyx_v_y3)) / 20.0)) + (((3.0 * __pyx_v_x1) * (__pyx_v_y2 + __pyx_v_y3)) / 20.0)) + (((3.0 * __pyx_v_x2) * __pyx_v_y3) / 10.0)) - ((__pyx_v_y0 * ((__pyx_v_r5 + __pyx_v_r6) + __pyx_v_x3)) / 20.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
  6470. __Pyx_GOTREF(__pyx_t_1);
  6471. /* "fontTools/pens/momentsPen.py":587
  6472. * r132 = 90 * y2
  6473. *
  6474. * self.area += ( # <<<<<<<<<<<<<<
  6475. * -r1 / 20
  6476. * - r3 / 20
  6477. */
  6478. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 587, __pyx_L1_error)
  6479. __Pyx_GOTREF(__pyx_t_2);
  6480. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6481. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6482. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_area, __pyx_t_2) < (0)) __PYX_ERR(0, 587, __pyx_L1_error)
  6483. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6484. /* "fontTools/pens/momentsPen.py":596
  6485. * - y0 * (r5 + r6 + x3) / 20
  6486. * )
  6487. * self.momentX += ( # <<<<<<<<<<<<<<
  6488. * r11 / 840
  6489. * - r13 / 8
  6490. */
  6491. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
  6492. __Pyx_GOTREF(__pyx_t_2);
  6493. /* "fontTools/pens/momentsPen.py":618
  6494. * )
  6495. * / 840
  6496. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840 # <<<<<<<<<<<<<<
  6497. * )
  6498. * self.momentY += (
  6499. */
  6500. __pyx_t_1 = PyFloat_FromDouble(((((((((((__pyx_v_r11 / 840.0) - (__pyx_v_r13 / 8.0)) - (__pyx_v_r14 / 3.0)) - ((__pyx_v_r17 * ((-__pyx_v_r15) + __pyx_v_r8)) / 840.0)) + ((__pyx_v_r19 * (__pyx_v_r8 + (2.0 * __pyx_v_y3))) / 840.0)) + ((__pyx_v_r20 * (((__pyx_v_r0 + __pyx_v_r21) + (56.0 * __pyx_v_y0)) + __pyx_v_y3)) / 168.0)) + ((__pyx_v_r29 * (((-__pyx_v_r23) + __pyx_v_r25) + __pyx_v_r28)) / 840.0)) - ((__pyx_v_r4 * (((10.0 * __pyx_v_r12) + __pyx_v_r17) + __pyx_v_r22)) / 840.0)) + ((__pyx_v_x0 * (((((((((12.0 * __pyx_v_r27) + (__pyx_v_r30 * __pyx_v_y2)) + __pyx_v_r34) - (__pyx_v_r35 * __pyx_v_x1)) - __pyx_v_r37) - (__pyx_v_r38 * __pyx_v_y0)) + (__pyx_v_r39 * __pyx_v_x1)) - (__pyx_v_r4 * __pyx_v_x3)) + __pyx_v_r45)) / 840.0)) - ((__pyx_v_y0 * (((((__pyx_v_r17 + (__pyx_v_r30 * __pyx_v_x2)) + (__pyx_v_r31 * __pyx_v_x1)) + __pyx_v_r32) + __pyx_v_r33) + (18.0 * __pyx_v_r9))) / 840.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
  6501. __Pyx_GOTREF(__pyx_t_1);
  6502. /* "fontTools/pens/momentsPen.py":596
  6503. * - y0 * (r5 + r6 + x3) / 20
  6504. * )
  6505. * self.momentX += ( # <<<<<<<<<<<<<<
  6506. * r11 / 840
  6507. * - r13 / 8
  6508. */
  6509. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 596, __pyx_L1_error)
  6510. __Pyx_GOTREF(__pyx_t_4);
  6511. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6512. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6513. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentX, __pyx_t_4) < (0)) __PYX_ERR(0, 596, __pyx_L1_error)
  6514. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6515. /* "fontTools/pens/momentsPen.py":620
  6516. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840
  6517. * )
  6518. * self.momentY += ( # <<<<<<<<<<<<<<
  6519. * -r4 * (r25 + r58) / 840
  6520. * - r47 / 8
  6521. */
  6522. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error)
  6523. __Pyx_GOTREF(__pyx_t_4);
  6524. /* "fontTools/pens/momentsPen.py":643
  6525. * + x1 * (r24 * y1 + 10 * r51 + r59 + r60 + r7 * y3) / 280
  6526. * + x2 * y3 * (r15 + r8) / 56
  6527. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840 # <<<<<<<<<<<<<<
  6528. * )
  6529. * self.momentXX += (
  6530. */
  6531. __pyx_t_1 = PyFloat_FromDouble(((((((((((((-__pyx_v_r4) * (__pyx_v_r25 + __pyx_v_r58)) / 840.0) - (__pyx_v_r47 / 8.0)) - (__pyx_v_r50 / 840.0)) - (__pyx_v_r52 / 6.0)) - ((__pyx_v_r54 * (__pyx_v_r6 + (2.0 * __pyx_v_x3))) / 840.0)) - ((__pyx_v_r55 * ((__pyx_v_r56 + __pyx_v_r57) + __pyx_v_x3)) / 168.0)) + ((__pyx_v_x0 * ((((((((((__pyx_v_r35 * __pyx_v_y1) + (__pyx_v_r40 * __pyx_v_y0)) + (__pyx_v_r44 * __pyx_v_y2)) + (18.0 * __pyx_v_r48)) + (140.0 * __pyx_v_r55)) + __pyx_v_r59) + __pyx_v_r63) + (12.0 * __pyx_v_r64)) + __pyx_v_r65) + __pyx_v_r66)) / 840.0)) + ((__pyx_v_x1 * (((((__pyx_v_r24 * __pyx_v_y1) + (10.0 * __pyx_v_r51)) + __pyx_v_r59) + __pyx_v_r60) + (__pyx_v_r7 * __pyx_v_y3))) / 280.0)) + (((__pyx_v_x2 * __pyx_v_y3) * (__pyx_v_r15 + __pyx_v_r8)) / 56.0)) - ((__pyx_v_y0 * ((((((__pyx_v_r16 * __pyx_v_y1) + (__pyx_v_r31 * __pyx_v_y2)) + (__pyx_v_r44 * __pyx_v_x2)) + __pyx_v_r45) + __pyx_v_r61) - (__pyx_v_r62 * __pyx_v_x1))) / 840.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
  6532. __Pyx_GOTREF(__pyx_t_1);
  6533. /* "fontTools/pens/momentsPen.py":620
  6534. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840
  6535. * )
  6536. * self.momentY += ( # <<<<<<<<<<<<<<
  6537. * -r4 * (r25 + r58) / 840
  6538. * - r47 / 8
  6539. */
  6540. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 620, __pyx_L1_error)
  6541. __Pyx_GOTREF(__pyx_t_2);
  6542. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6543. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6544. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentY, __pyx_t_2) < (0)) __PYX_ERR(0, 620, __pyx_L1_error)
  6545. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6546. /* "fontTools/pens/momentsPen.py":645
  6547. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840
  6548. * )
  6549. * self.momentXX += ( # <<<<<<<<<<<<<<
  6550. * -r12 * r72 * (-r40 + r8) / 9240
  6551. * + 3 * r18 * (r28 + r34 - r38 * y1 + r75) / 3080
  6552. */
  6553. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 645, __pyx_L1_error)
  6554. __Pyx_GOTREF(__pyx_t_2);
  6555. /* "fontTools/pens/momentsPen.py":703
  6556. * )
  6557. * / 9240
  6558. * - y0 # <<<<<<<<<<<<<<
  6559. * * (
  6560. * r12 * r56
  6561. */
  6562. __pyx_t_1 = PyFloat_FromDouble(((((((((((((((((-__pyx_v_r12) * __pyx_v_r72) * ((-__pyx_v_r40) + __pyx_v_r8)) / 9240.0) + (((3.0 * __pyx_v_r18) * (((__pyx_v_r28 + __pyx_v_r34) - (__pyx_v_r38 * __pyx_v_y1)) + __pyx_v_r75)) / 3080.0)) + ((__pyx_v_r20 * (((((((((__pyx_v_r24 * __pyx_v_x3) - (__pyx_v_r72 * __pyx_v_y0)) - (__pyx_v_r76 * __pyx_v_y0)) - (__pyx_v_r77 * __pyx_v_y0)) + __pyx_v_r78) + (__pyx_v_r79 * __pyx_v_y3)) + (__pyx_v_r80 * __pyx_v_y1)) + (210.0 * __pyx_v_r81)) + __pyx_v_r84)) / 9240.0)) - ((__pyx_v_r29 * ((((((((__pyx_v_r12 * __pyx_v_r21) + (14.0 * __pyx_v_r13)) + (__pyx_v_r44 * __pyx_v_r9)) - (__pyx_v_r73 * __pyx_v_y3)) + (54.0 * __pyx_v_r86)) - (84.0 * __pyx_v_r87)) - __pyx_v_r89) - __pyx_v_r90)) / 9240.0)) - ((__pyx_v_r4 * (((((70.0 * __pyx_v_r12) * __pyx_v_x2) + (27.0 * __pyx_v_r67)) + (42.0 * __pyx_v_r68)) + __pyx_v_r74)) / 9240.0)) + (((3.0 * __pyx_v_r67) * __pyx_v_y3) / 220.0)) - ((__pyx_v_r68 * __pyx_v_r69) / 9240.0)) - ((__pyx_v_r68 * __pyx_v_y3) / 4.0)) - (((__pyx_v_r70 * __pyx_v_r9) * ((-__pyx_v_r62) + __pyx_v_y2)) / 9240.0)) + (((3.0 * __pyx_v_r71) * (__pyx_v_r24 + __pyx_v_r40)) / 3080.0)) + ((pow(__pyx_v_x0, 3.0) * (((__pyx_v_r24 + __pyx_v_r44) + (165.0 * __pyx_v_y0)) + __pyx_v_y3)) / 660.0)) + ((__pyx_v_x0 * (((((((((((((((((((__pyx_v_r100 * __pyx_v_r27) + (162.0 * __pyx_v_r101)) + __pyx_v_r102) + __pyx_v_r11) + ((63.0 * __pyx_v_r18) * __pyx_v_y3)) + (__pyx_v_r27 * __pyx_v_r91)) - (__pyx_v_r33 * __pyx_v_y0)) - (__pyx_v_r37 * __pyx_v_x3)) + (__pyx_v_r43 * __pyx_v_x3)) - (__pyx_v_r73 * __pyx_v_y0)) - (__pyx_v_r88 * __pyx_v_y1)) + (__pyx_v_r92 * __pyx_v_y2)) - (__pyx_v_r93 * __pyx_v_y0)) - (9.0 * __pyx_v_r94)) - (__pyx_v_r95 * __pyx_v_y0)) - (__pyx_v_r96 * __pyx_v_y0)) - (__pyx_v_r97 * __pyx_v_y1)) - (18.0 * __pyx_v_r98)) + ((__pyx_v_r99 * __pyx_v_x1) * __pyx_v_y3))) / 9240.0)) - ((__pyx_v_y0 * ((((((((((__pyx_v_r12 * __pyx_v_r56) + (__pyx_v_r12 * __pyx_v_r80)) + (__pyx_v_r32 * __pyx_v_x3)) + (45.0 * __pyx_v_r67)) + (14.0 * __pyx_v_r68)) + (126.0 * __pyx_v_r71)) + __pyx_v_r74) + (__pyx_v_r85 * __pyx_v_r91)) + ((135.0 * __pyx_v_r9) * __pyx_v_x1)) + (__pyx_v_r92 * __pyx_v_x2))) / 9240.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 703, __pyx_L1_error)
  6563. __Pyx_GOTREF(__pyx_t_1);
  6564. /* "fontTools/pens/momentsPen.py":645
  6565. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840
  6566. * )
  6567. * self.momentXX += ( # <<<<<<<<<<<<<<
  6568. * -r12 * r72 * (-r40 + r8) / 9240
  6569. * + 3 * r18 * (r28 + r34 - r38 * y1 + r75) / 3080
  6570. */
  6571. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
  6572. __Pyx_GOTREF(__pyx_t_4);
  6573. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6574. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6575. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXX, __pyx_t_4) < (0)) __PYX_ERR(0, 645, __pyx_L1_error)
  6576. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6577. /* "fontTools/pens/momentsPen.py":718
  6578. * / 9240
  6579. * )
  6580. * self.momentXY += ( # <<<<<<<<<<<<<<
  6581. * -r103 * r12 / 18480
  6582. * - r12 * r51 / 8
  6583. */
  6584. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 718, __pyx_L1_error)
  6585. __Pyx_GOTREF(__pyx_t_4);
  6586. /* "fontTools/pens/momentsPen.py":780
  6587. * )
  6588. * / 3080
  6589. * - y0 # <<<<<<<<<<<<<<
  6590. * * (
  6591. * 54 * r101
  6592. */
  6593. __pyx_t_1 = PyFloat_FromDouble((((((((((((((((-__pyx_v_r103) * __pyx_v_r12) / 18480.0) - ((__pyx_v_r12 * __pyx_v_r51) / 8.0)) - (((3.0 * __pyx_v_r14) * __pyx_v_y2) / 44.0)) + (((3.0 * __pyx_v_r18) * ((((__pyx_v_r105 + (__pyx_v_r2 * __pyx_v_y1)) + (18.0 * __pyx_v_r46)) + (15.0 * __pyx_v_r48)) + (7.0 * __pyx_v_r51))) / 6160.0)) + ((__pyx_v_r20 * ((((((((((1260.0 * __pyx_v_r106) + (__pyx_v_r107 * __pyx_v_y1)) + __pyx_v_r108) + (28.0 * __pyx_v_r109)) + __pyx_v_r110) + __pyx_v_r111) + __pyx_v_r112) + (30.0 * __pyx_v_r46)) + (2310.0 * __pyx_v_r55)) + __pyx_v_r66)) / 18480.0)) - ((__pyx_v_r54 * (((7.0 * __pyx_v_r12) + (18.0 * __pyx_v_r85)) + (15.0 * __pyx_v_r9))) / 18480.0)) - ((__pyx_v_r55 * (((((__pyx_v_r33 + __pyx_v_r73) + __pyx_v_r93) + __pyx_v_r95) + __pyx_v_r96) + __pyx_v_r97)) / 18480.0)) - ((__pyx_v_r7 * (((((42.0 * __pyx_v_r13) + (__pyx_v_r82 * __pyx_v_x3)) + (28.0 * __pyx_v_r87)) + __pyx_v_r89) + __pyx_v_r90)) / 18480.0)) - (((3.0 * __pyx_v_r85) * (__pyx_v_r48 - __pyx_v_r66)) / 220.0)) + ((((3.0 * __pyx_v_r9) * __pyx_v_y3) * (__pyx_v_r62 + (2.0 * __pyx_v_y2))) / 440.0)) + ((__pyx_v_x0 * (((((((((((((((((((((((-__pyx_v_r1) * __pyx_v_y0) - ((84.0 * __pyx_v_r106) * __pyx_v_x2)) + (__pyx_v_r109 * __pyx_v_r56)) + (54.0 * __pyx_v_r114)) + (__pyx_v_r117 * __pyx_v_y1)) + (15.0 * __pyx_v_r118)) + (21.0 * __pyx_v_r119)) + (81.0 * __pyx_v_r120)) + (__pyx_v_r121 * __pyx_v_r46)) + (54.0 * __pyx_v_r122)) + (60.0 * __pyx_v_r123)) + __pyx_v_r124) - ((__pyx_v_r21 * __pyx_v_x3) * __pyx_v_y0)) + (__pyx_v_r23 * __pyx_v_y3)) - (__pyx_v_r54 * __pyx_v_x3)) - (__pyx_v_r55 * __pyx_v_r72)) - (__pyx_v_r55 * __pyx_v_r76)) - (__pyx_v_r55 * __pyx_v_r77)) + ((__pyx_v_r57 * __pyx_v_y0) * __pyx_v_y3)) + (__pyx_v_r60 * __pyx_v_x3)) + ((84.0 * __pyx_v_r81) * __pyx_v_y0)) + ((189.0 * __pyx_v_r81) * __pyx_v_y1))) / 9240.0)) + ((__pyx_v_x1 * ((((((((__pyx_v_r104 * __pyx_v_r27) - (__pyx_v_r105 * __pyx_v_x3)) - (__pyx_v_r113 * __pyx_v_r53)) + (63.0 * __pyx_v_r114)) + __pyx_v_r115) - (__pyx_v_r16 * __pyx_v_r53)) + (28.0 * __pyx_v_r47)) + (__pyx_v_r51 * __pyx_v_r80))) / 3080.0)) - ((__pyx_v_y0 * (((((((((((((54.0 * __pyx_v_r101) + __pyx_v_r102) + (__pyx_v_r116 * __pyx_v_r5)) + (__pyx_v_r117 * __pyx_v_x3)) + (21.0 * __pyx_v_r13)) - (__pyx_v_r19 * __pyx_v_y3)) + (__pyx_v_r22 * __pyx_v_y3)) + (__pyx_v_r78 * __pyx_v_x3)) + ((189.0 * __pyx_v_r83) * __pyx_v_x2)) + (60.0 * __pyx_v_r86)) + ((81.0 * __pyx_v_r9) * __pyx_v_y1)) + (15.0 * __pyx_v_r94)) + (54.0 * __pyx_v_r98))) / 9240.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 780, __pyx_L1_error)
  6594. __Pyx_GOTREF(__pyx_t_1);
  6595. /* "fontTools/pens/momentsPen.py":718
  6596. * / 9240
  6597. * )
  6598. * self.momentXY += ( # <<<<<<<<<<<<<<
  6599. * -r103 * r12 / 18480
  6600. * - r12 * r51 / 8
  6601. */
  6602. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  6603. __Pyx_GOTREF(__pyx_t_2);
  6604. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6605. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6606. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentXY, __pyx_t_2) < (0)) __PYX_ERR(0, 718, __pyx_L1_error)
  6607. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6608. /* "fontTools/pens/momentsPen.py":798
  6609. * / 9240
  6610. * )
  6611. * self.momentYY += ( # <<<<<<<<<<<<<<
  6612. * -r103 * r116 / 9240
  6613. * - r125 * r70 / 9240
  6614. */
  6615. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 798, __pyx_L1_error)
  6616. __Pyx_GOTREF(__pyx_t_2);
  6617. /* "fontTools/pens/momentsPen.py":846
  6618. * / 3080
  6619. * + 3 * x2 * y3 * (r48 + r66 + r8 * y3) / 220
  6620. * - y0 # <<<<<<<<<<<<<<
  6621. * * (
  6622. * r100 * r46
  6623. */
  6624. __pyx_t_1 = PyFloat_FromDouble((((((((((((((((-__pyx_v_r103) * __pyx_v_r116) / 9240.0) - ((__pyx_v_r125 * __pyx_v_r70) / 9240.0)) - ((__pyx_v_r126 * __pyx_v_x3) / 12.0)) - (((3.0 * __pyx_v_r127) * (__pyx_v_r26 + __pyx_v_r38)) / 3080.0)) - ((__pyx_v_r128 * ((__pyx_v_r26 + __pyx_v_r30) + __pyx_v_x3)) / 660.0)) - ((__pyx_v_r4 * ((((__pyx_v_r112 * __pyx_v_x3) + __pyx_v_r115) - (14.0 * __pyx_v_r119)) + (84.0 * __pyx_v_r47))) / 9240.0)) - ((__pyx_v_r52 * __pyx_v_r69) / 9240.0)) - ((__pyx_v_r54 * ((__pyx_v_r58 + __pyx_v_r61) + __pyx_v_r75)) / 9240.0)) - ((__pyx_v_r55 * ((((((__pyx_v_r100 * __pyx_v_y1) + (__pyx_v_r121 * __pyx_v_y2)) + (__pyx_v_r26 * __pyx_v_y3)) + (__pyx_v_r79 * __pyx_v_y2)) + __pyx_v_r84) + ((210.0 * __pyx_v_x2) * __pyx_v_y1))) / 9240.0)) + ((__pyx_v_x0 * (((((((((((((((((((__pyx_v_r108 * __pyx_v_y1) + (__pyx_v_r110 * __pyx_v_y0)) + (__pyx_v_r111 * __pyx_v_y0)) + (__pyx_v_r112 * __pyx_v_y0)) + (45.0 * __pyx_v_r125)) + (14.0 * __pyx_v_r126)) + (126.0 * __pyx_v_r127)) + (770.0 * __pyx_v_r128)) + (42.0 * __pyx_v_r129)) + __pyx_v_r130) + (__pyx_v_r131 * __pyx_v_y2)) + (__pyx_v_r132 * __pyx_v_r64)) + ((135.0 * __pyx_v_r48) * __pyx_v_y1)) + ((630.0 * __pyx_v_r55) * __pyx_v_y1)) + ((126.0 * __pyx_v_r55) * __pyx_v_y2)) + ((14.0 * __pyx_v_r55) * __pyx_v_y3)) + (__pyx_v_r63 * __pyx_v_y3)) + (__pyx_v_r65 * __pyx_v_y3)) + (__pyx_v_r66 * __pyx_v_y0))) / 9240.0)) + ((__pyx_v_x1 * ((((((((27.0 * __pyx_v_r125) + (42.0 * __pyx_v_r126)) + (70.0 * __pyx_v_r129)) + __pyx_v_r130) + (__pyx_v_r39 * __pyx_v_r53)) + (__pyx_v_r44 * __pyx_v_r48)) + ((27.0 * __pyx_v_r53) * __pyx_v_y2)) + ((54.0 * __pyx_v_r64) * __pyx_v_y2))) / 3080.0)) + ((((3.0 * __pyx_v_x2) * __pyx_v_y3) * ((__pyx_v_r48 + __pyx_v_r66) + (__pyx_v_r8 * __pyx_v_y3))) / 220.0)) - ((__pyx_v_y0 * (((((((((((((__pyx_v_r100 * __pyx_v_r46) + (18.0 * __pyx_v_r114)) - (9.0 * __pyx_v_r118)) - (27.0 * __pyx_v_r120)) - (18.0 * __pyx_v_r122)) - (30.0 * __pyx_v_r123)) + __pyx_v_r124) + (__pyx_v_r131 * __pyx_v_x2)) + ((__pyx_v_r132 * __pyx_v_x3) * __pyx_v_y1)) + ((162.0 * __pyx_v_r42) * __pyx_v_y1)) + __pyx_v_r50) + ((63.0 * __pyx_v_r53) * __pyx_v_x3)) + (__pyx_v_r64 * __pyx_v_r99))) / 9240.0))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 846, __pyx_L1_error)
  6625. __Pyx_GOTREF(__pyx_t_1);
  6626. /* "fontTools/pens/momentsPen.py":798
  6627. * / 9240
  6628. * )
  6629. * self.momentYY += ( # <<<<<<<<<<<<<<
  6630. * -r103 * r116 / 9240
  6631. * - r125 * r70 / 9240
  6632. */
  6633. __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 798, __pyx_L1_error)
  6634. __Pyx_GOTREF(__pyx_t_4);
  6635. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6636. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6637. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_mstate_global->__pyx_n_u_momentYY, __pyx_t_4) < (0)) __PYX_ERR(0, 798, __pyx_L1_error)
  6638. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  6639. /* "fontTools/pens/momentsPen.py":310
  6640. * )
  6641. *
  6642. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  6643. * @cython.locals(r1=cython.double)
  6644. * @cython.locals(r2=cython.double)
  6645. */
  6646. /* function exit code */
  6647. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  6648. goto __pyx_L0;
  6649. __pyx_L1_error:;
  6650. __Pyx_XDECREF(__pyx_t_1);
  6651. __Pyx_XDECREF(__pyx_t_2);
  6652. __Pyx_XDECREF(__pyx_t_4);
  6653. __Pyx_XDECREF(__pyx_t_5);
  6654. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._curveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6655. __pyx_r = NULL;
  6656. __pyx_L0:;
  6657. __Pyx_XGIVEREF(__pyx_r);
  6658. __Pyx_RefNannyFinishContext();
  6659. return __pyx_r;
  6660. }
  6661. /* #### Code section: module_exttypes ### */
  6662. static PyMethodDef __pyx_methods[] = {
  6663. {0, 0, 0, 0}
  6664. };
  6665. /* #### Code section: initfunc_declarations ### */
  6666. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6667. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6668. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void); /*proto*/
  6669. static CYTHON_SMALL_CODE int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6670. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6671. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6672. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6673. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6674. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6675. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6676. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6677. static CYTHON_SMALL_CODE int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate); /*proto*/
  6678. /* #### Code section: init_module ### */
  6679. static int __Pyx_modinit_global_init_code(__pyx_mstatetype *__pyx_mstate) {
  6680. __Pyx_RefNannyDeclarations
  6681. CYTHON_UNUSED_VAR(__pyx_mstate);
  6682. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  6683. /*--- Global init code ---*/
  6684. __Pyx_RefNannyFinishContext();
  6685. return 0;
  6686. }
  6687. static int __Pyx_modinit_variable_export_code(__pyx_mstatetype *__pyx_mstate) {
  6688. __Pyx_RefNannyDeclarations
  6689. CYTHON_UNUSED_VAR(__pyx_mstate);
  6690. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  6691. /*--- Variable export code ---*/
  6692. __Pyx_RefNannyFinishContext();
  6693. return 0;
  6694. }
  6695. static int __Pyx_modinit_function_export_code(__pyx_mstatetype *__pyx_mstate) {
  6696. __Pyx_RefNannyDeclarations
  6697. CYTHON_UNUSED_VAR(__pyx_mstate);
  6698. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  6699. /*--- Function export code ---*/
  6700. __Pyx_RefNannyFinishContext();
  6701. return 0;
  6702. }
  6703. static int __Pyx_modinit_type_init_code(__pyx_mstatetype *__pyx_mstate) {
  6704. __Pyx_RefNannyDeclarations
  6705. CYTHON_UNUSED_VAR(__pyx_mstate);
  6706. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  6707. /*--- Type init code ---*/
  6708. __Pyx_RefNannyFinishContext();
  6709. return 0;
  6710. }
  6711. static int __Pyx_modinit_type_import_code(__pyx_mstatetype *__pyx_mstate) {
  6712. __Pyx_RefNannyDeclarations
  6713. CYTHON_UNUSED_VAR(__pyx_mstate);
  6714. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  6715. /*--- Type import code ---*/
  6716. __Pyx_RefNannyFinishContext();
  6717. return 0;
  6718. }
  6719. static int __Pyx_modinit_variable_import_code(__pyx_mstatetype *__pyx_mstate) {
  6720. __Pyx_RefNannyDeclarations
  6721. CYTHON_UNUSED_VAR(__pyx_mstate);
  6722. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  6723. /*--- Variable import code ---*/
  6724. __Pyx_RefNannyFinishContext();
  6725. return 0;
  6726. }
  6727. static int __Pyx_modinit_function_import_code(__pyx_mstatetype *__pyx_mstate) {
  6728. __Pyx_RefNannyDeclarations
  6729. CYTHON_UNUSED_VAR(__pyx_mstate);
  6730. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  6731. /*--- Function import code ---*/
  6732. __Pyx_RefNannyFinishContext();
  6733. return 0;
  6734. }
  6735. #if CYTHON_PEP489_MULTI_PHASE_INIT
  6736. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  6737. static int __pyx_pymod_exec_momentsPen(PyObject* module); /*proto*/
  6738. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  6739. {Py_mod_create, (void*)__pyx_pymod_create},
  6740. {Py_mod_exec, (void*)__pyx_pymod_exec_momentsPen},
  6741. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  6742. {Py_mod_gil, __Pyx_FREETHREADING_COMPATIBLE},
  6743. #endif
  6744. #if PY_VERSION_HEX >= 0x030C0000 && CYTHON_USE_MODULE_STATE
  6745. {Py_mod_multiple_interpreters, Py_MOD_MULTIPLE_INTERPRETERS_NOT_SUPPORTED},
  6746. #endif
  6747. {0, NULL}
  6748. };
  6749. #endif
  6750. #ifdef __cplusplus
  6751. namespace {
  6752. struct PyModuleDef __pyx_moduledef =
  6753. #else
  6754. static struct PyModuleDef __pyx_moduledef =
  6755. #endif
  6756. {
  6757. PyModuleDef_HEAD_INIT,
  6758. "momentsPen",
  6759. 0, /* m_doc */
  6760. #if CYTHON_USE_MODULE_STATE
  6761. sizeof(__pyx_mstatetype), /* m_size */
  6762. #else
  6763. (CYTHON_PEP489_MULTI_PHASE_INIT) ? 0 : -1, /* m_size */
  6764. #endif
  6765. __pyx_methods /* m_methods */,
  6766. #if CYTHON_PEP489_MULTI_PHASE_INIT
  6767. __pyx_moduledef_slots, /* m_slots */
  6768. #else
  6769. NULL, /* m_reload */
  6770. #endif
  6771. #if CYTHON_USE_MODULE_STATE
  6772. __pyx_m_traverse, /* m_traverse */
  6773. __pyx_m_clear, /* m_clear */
  6774. NULL /* m_free */
  6775. #else
  6776. NULL, /* m_traverse */
  6777. NULL, /* m_clear */
  6778. NULL /* m_free */
  6779. #endif
  6780. };
  6781. #ifdef __cplusplus
  6782. } /* anonymous namespace */
  6783. #endif
  6784. /* PyModInitFuncType */
  6785. #ifndef CYTHON_NO_PYINIT_EXPORT
  6786. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  6787. #else
  6788. #ifdef __cplusplus
  6789. #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  6790. #else
  6791. #define __Pyx_PyMODINIT_FUNC PyObject *
  6792. #endif
  6793. #endif
  6794. __Pyx_PyMODINIT_FUNC PyInit_momentsPen(void) CYTHON_SMALL_CODE; /*proto*/
  6795. __Pyx_PyMODINIT_FUNC PyInit_momentsPen(void)
  6796. #if CYTHON_PEP489_MULTI_PHASE_INIT
  6797. {
  6798. return PyModuleDef_Init(&__pyx_moduledef);
  6799. }
  6800. /* ModuleCreationPEP489 */
  6801. #if CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
  6802. || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
  6803. static PY_INT64_T __Pyx_GetCurrentInterpreterId(void) {
  6804. {
  6805. PyObject *module = PyImport_ImportModule("_interpreters"); // 3.13+ I think
  6806. if (!module) {
  6807. PyErr_Clear(); // just try the 3.8-3.12 version
  6808. module = PyImport_ImportModule("_xxsubinterpreters");
  6809. if (!module) goto bad;
  6810. }
  6811. PyObject *current = PyObject_CallMethod(module, "get_current", NULL);
  6812. Py_DECREF(module);
  6813. if (!current) goto bad;
  6814. if (PyTuple_Check(current)) {
  6815. PyObject *new_current = PySequence_GetItem(current, 0);
  6816. Py_DECREF(current);
  6817. current = new_current;
  6818. if (!new_current) goto bad;
  6819. }
  6820. long long as_c_int = PyLong_AsLongLong(current);
  6821. Py_DECREF(current);
  6822. return as_c_int;
  6823. }
  6824. bad:
  6825. PySys_WriteStderr("__Pyx_GetCurrentInterpreterId failed. Try setting the C define CYTHON_PEP489_MULTI_PHASE_INIT=0\n");
  6826. return -1;
  6827. }
  6828. #endif
  6829. #if !CYTHON_USE_MODULE_STATE
  6830. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  6831. static PY_INT64_T main_interpreter_id = -1;
  6832. #if CYTHON_COMPILING_IN_GRAAL && defined(GRAALPY_VERSION_NUM) && GRAALPY_VERSION_NUM > 0x19000000
  6833. PY_INT64_T current_id = GraalPyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
  6834. #elif CYTHON_COMPILING_IN_GRAAL
  6835. PY_INT64_T current_id = PyInterpreterState_GetIDFromThreadState(PyThreadState_Get());
  6836. #elif CYTHON_COMPILING_IN_LIMITED_API && (__PYX_LIMITED_VERSION_HEX < 0x03090000\
  6837. || ((defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)) && __PYX_LIMITED_VERSION_HEX < 0x030A0000))
  6838. PY_INT64_T current_id = __Pyx_GetCurrentInterpreterId();
  6839. #elif CYTHON_COMPILING_IN_LIMITED_API
  6840. PY_INT64_T current_id = PyInterpreterState_GetID(PyInterpreterState_Get());
  6841. #else
  6842. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  6843. #endif
  6844. if (unlikely(current_id == -1)) {
  6845. return -1;
  6846. }
  6847. if (main_interpreter_id == -1) {
  6848. main_interpreter_id = current_id;
  6849. return 0;
  6850. } else if (unlikely(main_interpreter_id != current_id)) {
  6851. PyErr_SetString(
  6852. PyExc_ImportError,
  6853. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  6854. return -1;
  6855. }
  6856. return 0;
  6857. }
  6858. #endif
  6859. static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
  6860. {
  6861. PyObject *value = PyObject_GetAttrString(spec, from_name);
  6862. int result = 0;
  6863. if (likely(value)) {
  6864. if (allow_none || value != Py_None) {
  6865. result = PyDict_SetItemString(moddict, to_name, value);
  6866. }
  6867. Py_DECREF(value);
  6868. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  6869. PyErr_Clear();
  6870. } else {
  6871. result = -1;
  6872. }
  6873. return result;
  6874. }
  6875. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
  6876. PyObject *module = NULL, *moddict, *modname;
  6877. CYTHON_UNUSED_VAR(def);
  6878. #if !CYTHON_USE_MODULE_STATE
  6879. if (__Pyx_check_single_interpreter())
  6880. return NULL;
  6881. #endif
  6882. if (__pyx_m)
  6883. return __Pyx_NewRef(__pyx_m);
  6884. modname = PyObject_GetAttrString(spec, "name");
  6885. if (unlikely(!modname)) goto bad;
  6886. module = PyModule_NewObject(modname);
  6887. Py_DECREF(modname);
  6888. if (unlikely(!module)) goto bad;
  6889. moddict = PyModule_GetDict(module);
  6890. if (unlikely(!moddict)) goto bad;
  6891. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  6892. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  6893. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  6894. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  6895. return module;
  6896. bad:
  6897. Py_XDECREF(module);
  6898. return NULL;
  6899. }
  6900. static CYTHON_SMALL_CODE int __pyx_pymod_exec_momentsPen(PyObject *__pyx_pyinit_module)
  6901. #endif
  6902. {
  6903. int stringtab_initialized = 0;
  6904. #if CYTHON_USE_MODULE_STATE
  6905. int pystate_addmodule_run = 0;
  6906. #endif
  6907. __pyx_mstatetype *__pyx_mstate = NULL;
  6908. PyObject *__pyx_t_1 = NULL;
  6909. PyObject *__pyx_t_2 = NULL;
  6910. Py_ssize_t __pyx_t_3;
  6911. PyObject *__pyx_t_4 = NULL;
  6912. PyObject *__pyx_t_5 = NULL;
  6913. PyObject *__pyx_t_6 = NULL;
  6914. PyObject *__pyx_t_7 = NULL;
  6915. PyObject *__pyx_t_8 = NULL;
  6916. int __pyx_t_9;
  6917. PyObject *__pyx_t_10 = NULL;
  6918. PyObject *__pyx_t_11 = NULL;
  6919. PyObject *__pyx_t_12 = NULL;
  6920. PyObject *__pyx_t_13 = NULL;
  6921. PyObject *__pyx_t_14 = NULL;
  6922. size_t __pyx_t_15;
  6923. int __pyx_lineno = 0;
  6924. const char *__pyx_filename = NULL;
  6925. int __pyx_clineno = 0;
  6926. __Pyx_RefNannyDeclarations
  6927. #if CYTHON_PEP489_MULTI_PHASE_INIT
  6928. if (__pyx_m) {
  6929. if (__pyx_m == __pyx_pyinit_module) return 0;
  6930. PyErr_SetString(PyExc_RuntimeError, "Module 'momentsPen' has already been imported. Re-initialisation is not supported.");
  6931. return -1;
  6932. }
  6933. #else
  6934. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  6935. #endif
  6936. /*--- Module creation code ---*/
  6937. #if CYTHON_PEP489_MULTI_PHASE_INIT
  6938. __pyx_t_1 = __pyx_pyinit_module;
  6939. Py_INCREF(__pyx_t_1);
  6940. #else
  6941. __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  6942. #endif
  6943. #if CYTHON_USE_MODULE_STATE
  6944. {
  6945. int add_module_result = __Pyx_State_AddModule(__pyx_t_1, &__pyx_moduledef);
  6946. __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "momentsPen" pseudovariable */
  6947. if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  6948. pystate_addmodule_run = 1;
  6949. }
  6950. #else
  6951. __pyx_m = __pyx_t_1;
  6952. #endif
  6953. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  6954. PyUnstable_Module_SetGIL(__pyx_m, Py_MOD_GIL_USED);
  6955. #endif
  6956. __pyx_mstate = __pyx_mstate_global;
  6957. CYTHON_UNUSED_VAR(__pyx_t_1);
  6958. __pyx_mstate->__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_mstate->__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  6959. Py_INCREF(__pyx_mstate->__pyx_d);
  6960. __pyx_mstate->__pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_mstate->__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  6961. __pyx_mstate->__pyx_cython_runtime = __Pyx_PyImport_AddModuleRef("cython_runtime"); if (unlikely(!__pyx_mstate->__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  6962. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_mstate->__pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  6963. /* ImportRefnannyAPI */
  6964. #if CYTHON_REFNANNY
  6965. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  6966. if (!__Pyx_RefNanny) {
  6967. PyErr_Clear();
  6968. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  6969. if (!__Pyx_RefNanny)
  6970. Py_FatalError("failed to import 'refnanny' module");
  6971. }
  6972. #endif
  6973. __Pyx_RefNannySetupContext("PyInit_momentsPen", 0);
  6974. __Pyx_init_runtime_version();
  6975. if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6976. __pyx_mstate->__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_mstate->__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  6977. __pyx_mstate->__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  6978. __pyx_mstate->__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_mstate->__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  6979. /*--- Library function declarations ---*/
  6980. /*--- Initialize various global constants etc. ---*/
  6981. if (__Pyx_InitConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6982. stringtab_initialized = 1;
  6983. if (__Pyx_InitGlobals() < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6984. if (__pyx_module_is_main_fontTools__pens__momentsPen) {
  6985. if (PyObject_SetAttr(__pyx_m, __pyx_mstate_global->__pyx_n_u_name, __pyx_mstate_global->__pyx_n_u_main) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6986. }
  6987. {
  6988. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  6989. if (!PyDict_GetItemString(modules, "fontTools.pens.momentsPen")) {
  6990. if (unlikely((PyDict_SetItemString(modules, "fontTools.pens.momentsPen", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  6991. }
  6992. }
  6993. /*--- Builtin init code ---*/
  6994. if (__Pyx_InitCachedBuiltins(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6995. /*--- Constants init code ---*/
  6996. if (__Pyx_InitCachedConstants(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6997. if (__Pyx_CreateCodeObjects(__pyx_mstate) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  6998. /*--- Global type/function init code ---*/
  6999. (void)__Pyx_modinit_global_init_code(__pyx_mstate);
  7000. (void)__Pyx_modinit_variable_export_code(__pyx_mstate);
  7001. (void)__Pyx_modinit_function_export_code(__pyx_mstate);
  7002. (void)__Pyx_modinit_type_init_code(__pyx_mstate);
  7003. (void)__Pyx_modinit_type_import_code(__pyx_mstate);
  7004. (void)__Pyx_modinit_variable_import_code(__pyx_mstate);
  7005. (void)__Pyx_modinit_function_import_code(__pyx_mstate);
  7006. /*--- Execution code ---*/
  7007. /* "fontTools/pens/momentsPen.py":1
  7008. * from fontTools.pens.basePen import BasePen, OpenContourError # <<<<<<<<<<<<<<
  7009. *
  7010. * try:
  7011. */
  7012. {
  7013. PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BasePen,__pyx_mstate_global->__pyx_n_u_OpenContourError};
  7014. __pyx_t_1 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_fontTools_pens_basePen, __pyx_imported_names, 2, NULL, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  7015. }
  7016. __pyx_t_2 = __pyx_t_1;
  7017. __Pyx_GOTREF(__pyx_t_2);
  7018. {
  7019. PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_BasePen,__pyx_mstate_global->__pyx_n_u_OpenContourError};
  7020. for (__pyx_t_3=0; __pyx_t_3 < 2; __pyx_t_3++) {
  7021. __pyx_t_4 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  7022. __Pyx_GOTREF(__pyx_t_4);
  7023. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_4) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  7024. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7025. }
  7026. }
  7027. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7028. /* "fontTools/pens/momentsPen.py":3
  7029. * from fontTools.pens.basePen import BasePen, OpenContourError
  7030. *
  7031. * try: # <<<<<<<<<<<<<<
  7032. * import cython
  7033. * except (AttributeError, ImportError):
  7034. */
  7035. {
  7036. (void)__pyx_t_1; (void)__pyx_t_5; (void)__pyx_t_6; /* mark used */
  7037. /*try:*/ {
  7038. /* "fontTools/pens/momentsPen.py":4
  7039. *
  7040. * try:
  7041. * import cython # <<<<<<<<<<<<<<
  7042. * except (AttributeError, ImportError):
  7043. * # if cython not installed, use mock module with no-op decorators and types
  7044. */
  7045. }
  7046. }
  7047. /* "fontTools/pens/momentsPen.py":8
  7048. * # if cython not installed, use mock module with no-op decorators and types
  7049. * from fontTools.misc import cython
  7050. * COMPILED = cython.compiled # <<<<<<<<<<<<<<
  7051. *
  7052. *
  7053. */
  7054. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_COMPILED, Py_True) < (0)) __PYX_ERR(0, 8, __pyx_L1_error)
  7055. /* "fontTools/pens/momentsPen.py":11
  7056. *
  7057. *
  7058. * __all__ = ["MomentsPen"] # <<<<<<<<<<<<<<
  7059. *
  7060. *
  7061. */
  7062. __pyx_t_2 = __Pyx_PyList_Pack(1, __pyx_mstate_global->__pyx_n_u_MomentsPen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  7063. __Pyx_GOTREF(__pyx_t_2);
  7064. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_all, __pyx_t_2) < (0)) __PYX_ERR(0, 11, __pyx_L1_error)
  7065. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7066. /* "fontTools/pens/momentsPen.py":14
  7067. *
  7068. *
  7069. * class MomentsPen(BasePen): # <<<<<<<<<<<<<<
  7070. *
  7071. * def __init__(self, glyphset=None):
  7072. */
  7073. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_BasePen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  7074. __Pyx_GOTREF(__pyx_t_2);
  7075. __pyx_t_4 = PyTuple_Pack(1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error)
  7076. __Pyx_GOTREF(__pyx_t_4);
  7077. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7078. __pyx_t_2 = __Pyx_PEP560_update_bases(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 14, __pyx_L1_error)
  7079. __Pyx_GOTREF(__pyx_t_2);
  7080. __pyx_t_7 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error)
  7081. __Pyx_GOTREF(__pyx_t_7);
  7082. __pyx_t_8 = __Pyx_Py3MetaclassPrepare(__pyx_t_7, __pyx_t_2, __pyx_mstate_global->__pyx_n_u_MomentsPen, __pyx_mstate_global->__pyx_n_u_MomentsPen, (PyObject *) NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, (PyObject *) NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 14, __pyx_L1_error)
  7083. __Pyx_GOTREF(__pyx_t_8);
  7084. if (__pyx_t_2 != __pyx_t_4) {
  7085. if (unlikely((PyDict_SetItemString(__pyx_t_8, "__orig_bases__", __pyx_t_4) < 0))) __PYX_ERR(0, 14, __pyx_L1_error)
  7086. }
  7087. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7088. /* "fontTools/pens/momentsPen.py":16
  7089. * class MomentsPen(BasePen):
  7090. *
  7091. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  7092. * BasePen.__init__(self, glyphset)
  7093. *
  7094. */
  7095. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen___init, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 16, __pyx_L1_error)
  7096. __Pyx_GOTREF(__pyx_t_4);
  7097. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7098. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7099. #endif
  7100. __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_4, __pyx_mstate_global->__pyx_tuple[0]);
  7101. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_init, __pyx_t_4) < (0)) __PYX_ERR(0, 16, __pyx_L1_error)
  7102. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7103. /* "fontTools/pens/momentsPen.py":26
  7104. * self.momentYY = 0
  7105. *
  7106. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  7107. * self._startPoint = p0
  7108. *
  7109. */
  7110. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__moveTo, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[1])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
  7111. __Pyx_GOTREF(__pyx_t_4);
  7112. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7113. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7114. #endif
  7115. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_moveTo, __pyx_t_4) < (0)) __PYX_ERR(0, 26, __pyx_L1_error)
  7116. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7117. /* "fontTools/pens/momentsPen.py":29
  7118. * self._startPoint = p0
  7119. *
  7120. * def _closePath(self): # <<<<<<<<<<<<<<
  7121. * p0 = self._getCurrentPoint()
  7122. * if p0 != self._startPoint:
  7123. */
  7124. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__closePath, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[2])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 29, __pyx_L1_error)
  7125. __Pyx_GOTREF(__pyx_t_4);
  7126. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7127. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7128. #endif
  7129. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_closePath, __pyx_t_4) < (0)) __PYX_ERR(0, 29, __pyx_L1_error)
  7130. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7131. /* "fontTools/pens/momentsPen.py":34
  7132. * self._lineTo(self._startPoint)
  7133. *
  7134. * def _endPath(self): # <<<<<<<<<<<<<<
  7135. * p0 = self._getCurrentPoint()
  7136. * if p0 != self._startPoint:
  7137. */
  7138. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__endPath, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[3])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 34, __pyx_L1_error)
  7139. __Pyx_GOTREF(__pyx_t_4);
  7140. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7141. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7142. #endif
  7143. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_endPath, __pyx_t_4) < (0)) __PYX_ERR(0, 34, __pyx_L1_error)
  7144. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7145. /* "fontTools/pens/momentsPen.py":39
  7146. * raise OpenContourError("Glyph statistics is not defined on open contours.")
  7147. *
  7148. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7149. * @cython.locals(r1=cython.double)
  7150. * @cython.locals(r2=cython.double)
  7151. */
  7152. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__lineTo, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[4])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
  7153. __Pyx_GOTREF(__pyx_t_4);
  7154. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7155. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7156. #endif
  7157. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_lineTo, __pyx_t_4) < (0)) __PYX_ERR(0, 39, __pyx_L1_error)
  7158. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7159. /* "fontTools/pens/momentsPen.py":99
  7160. * )
  7161. *
  7162. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7163. * @cython.locals(r1=cython.double)
  7164. * @cython.locals(r2=cython.double)
  7165. */
  7166. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__qCurveToOne, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[5])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 99, __pyx_L1_error)
  7167. __Pyx_GOTREF(__pyx_t_4);
  7168. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7169. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7170. #endif
  7171. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_qCurveToOne, __pyx_t_4) < (0)) __PYX_ERR(0, 99, __pyx_L1_error)
  7172. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7173. /* "fontTools/pens/momentsPen.py":310
  7174. * )
  7175. *
  7176. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7177. * @cython.locals(r1=cython.double)
  7178. * @cython.locals(r2=cython.double)
  7179. */
  7180. __pyx_t_4 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne, 0, __pyx_mstate_global->__pyx_n_u_MomentsPen__curveToOne, NULL, __pyx_mstate_global->__pyx_n_u_fontTools_pens_momentsPen, __pyx_mstate_global->__pyx_d, ((PyObject *)__pyx_mstate_global->__pyx_codeobj_tab[6])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 310, __pyx_L1_error)
  7181. __Pyx_GOTREF(__pyx_t_4);
  7182. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7183. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7184. #endif
  7185. if (__Pyx_SetNameInClass(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_curveToOne, __pyx_t_4) < (0)) __PYX_ERR(0, 310, __pyx_L1_error)
  7186. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7187. /* "fontTools/pens/momentsPen.py":14
  7188. *
  7189. *
  7190. * class MomentsPen(BasePen): # <<<<<<<<<<<<<<
  7191. *
  7192. * def __init__(self, glyphset=None):
  7193. */
  7194. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MomentsPen, __pyx_t_2, __pyx_t_8, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 14, __pyx_L1_error)
  7195. __Pyx_GOTREF(__pyx_t_4);
  7196. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030E0000
  7197. PyUnstable_Object_EnableDeferredRefcount(__pyx_t_4);
  7198. #endif
  7199. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_MomentsPen, __pyx_t_4) < (0)) __PYX_ERR(0, 14, __pyx_L1_error)
  7200. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7201. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7202. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7203. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7204. /* "fontTools/pens/momentsPen.py":866
  7205. *
  7206. *
  7207. * if __name__ == "__main__": # <<<<<<<<<<<<<<
  7208. * from fontTools.misc.symfont import x, y, printGreenPen
  7209. *
  7210. */
  7211. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_name); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 866, __pyx_L1_error)
  7212. __Pyx_GOTREF(__pyx_t_2);
  7213. __pyx_t_9 = (__Pyx_PyUnicode_Equals(__pyx_t_2, __pyx_mstate_global->__pyx_n_u_main, Py_EQ)); if (unlikely((__pyx_t_9 < 0))) __PYX_ERR(0, 866, __pyx_L1_error)
  7214. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7215. if (__pyx_t_9) {
  7216. /* "fontTools/pens/momentsPen.py":867
  7217. *
  7218. * if __name__ == "__main__":
  7219. * from fontTools.misc.symfont import x, y, printGreenPen # <<<<<<<<<<<<<<
  7220. *
  7221. * printGreenPen(
  7222. */
  7223. {
  7224. PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_x,__pyx_mstate_global->__pyx_n_u_y,__pyx_mstate_global->__pyx_n_u_printGreenPen};
  7225. __pyx_t_6 = __Pyx_Import(__pyx_mstate_global->__pyx_n_u_fontTools_misc_symfont, __pyx_imported_names, 3, NULL, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 867, __pyx_L1_error)
  7226. }
  7227. __pyx_t_2 = __pyx_t_6;
  7228. __Pyx_GOTREF(__pyx_t_2);
  7229. {
  7230. PyObject* const __pyx_imported_names[] = {__pyx_mstate_global->__pyx_n_u_x,__pyx_mstate_global->__pyx_n_u_y,__pyx_mstate_global->__pyx_n_u_printGreenPen};
  7231. for (__pyx_t_3=0; __pyx_t_3 < 3; __pyx_t_3++) {
  7232. __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_2, __pyx_imported_names[__pyx_t_3]); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 867, __pyx_L1_error)
  7233. __Pyx_GOTREF(__pyx_t_7);
  7234. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_imported_names[__pyx_t_3], __pyx_t_7) < (0)) __PYX_ERR(0, 867, __pyx_L1_error)
  7235. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  7236. }
  7237. }
  7238. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7239. /* "fontTools/pens/momentsPen.py":869
  7240. * from fontTools.misc.symfont import x, y, printGreenPen
  7241. *
  7242. * printGreenPen( # <<<<<<<<<<<<<<
  7243. * "MomentsPen",
  7244. * [
  7245. */
  7246. __pyx_t_7 = NULL;
  7247. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_mstate_global->__pyx_n_u_printGreenPen); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 869, __pyx_L1_error)
  7248. __Pyx_GOTREF(__pyx_t_8);
  7249. /* "fontTools/pens/momentsPen.py":873
  7250. * [
  7251. * ("area", 1),
  7252. * ("momentX", x), # <<<<<<<<<<<<<<
  7253. * ("momentY", y),
  7254. * ("momentXX", x**2),
  7255. */
  7256. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 873, __pyx_L1_error)
  7257. __Pyx_GOTREF(__pyx_t_4);
  7258. __pyx_t_10 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_momentX, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 873, __pyx_L1_error)
  7259. __Pyx_GOTREF(__pyx_t_10);
  7260. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7261. /* "fontTools/pens/momentsPen.py":874
  7262. * ("area", 1),
  7263. * ("momentX", x),
  7264. * ("momentY", y), # <<<<<<<<<<<<<<
  7265. * ("momentXX", x**2),
  7266. * ("momentXY", x * y),
  7267. */
  7268. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 874, __pyx_L1_error)
  7269. __Pyx_GOTREF(__pyx_t_4);
  7270. __pyx_t_11 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_momentY, __pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 874, __pyx_L1_error)
  7271. __Pyx_GOTREF(__pyx_t_11);
  7272. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7273. /* "fontTools/pens/momentsPen.py":875
  7274. * ("momentX", x),
  7275. * ("momentY", y),
  7276. * ("momentXX", x**2), # <<<<<<<<<<<<<<
  7277. * ("momentXY", x * y),
  7278. * ("momentYY", y**2),
  7279. */
  7280. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
  7281. __Pyx_GOTREF(__pyx_t_4);
  7282. __pyx_t_12 = PyNumber_Power(__pyx_t_4, __pyx_mstate_global->__pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 875, __pyx_L1_error)
  7283. __Pyx_GOTREF(__pyx_t_12);
  7284. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7285. __pyx_t_4 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_momentXX, __pyx_t_12); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 875, __pyx_L1_error)
  7286. __Pyx_GOTREF(__pyx_t_4);
  7287. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7288. /* "fontTools/pens/momentsPen.py":876
  7289. * ("momentY", y),
  7290. * ("momentXX", x**2),
  7291. * ("momentXY", x * y), # <<<<<<<<<<<<<<
  7292. * ("momentYY", y**2),
  7293. * ],
  7294. */
  7295. __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_mstate_global->__pyx_n_u_x); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 876, __pyx_L1_error)
  7296. __Pyx_GOTREF(__pyx_t_12);
  7297. __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 876, __pyx_L1_error)
  7298. __Pyx_GOTREF(__pyx_t_13);
  7299. __pyx_t_14 = PyNumber_Multiply(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 876, __pyx_L1_error)
  7300. __Pyx_GOTREF(__pyx_t_14);
  7301. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7302. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  7303. __pyx_t_13 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_momentXY, __pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 876, __pyx_L1_error)
  7304. __Pyx_GOTREF(__pyx_t_13);
  7305. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  7306. /* "fontTools/pens/momentsPen.py":877
  7307. * ("momentXX", x**2),
  7308. * ("momentXY", x * y),
  7309. * ("momentYY", y**2), # <<<<<<<<<<<<<<
  7310. * ],
  7311. * )
  7312. */
  7313. __Pyx_GetModuleGlobalName(__pyx_t_14, __pyx_mstate_global->__pyx_n_u_y); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 877, __pyx_L1_error)
  7314. __Pyx_GOTREF(__pyx_t_14);
  7315. __pyx_t_12 = PyNumber_Power(__pyx_t_14, __pyx_mstate_global->__pyx_int_2, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 877, __pyx_L1_error)
  7316. __Pyx_GOTREF(__pyx_t_12);
  7317. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  7318. __pyx_t_14 = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_momentYY, __pyx_t_12); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 877, __pyx_L1_error)
  7319. __Pyx_GOTREF(__pyx_t_14);
  7320. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7321. /* "fontTools/pens/momentsPen.py":871
  7322. * printGreenPen(
  7323. * "MomentsPen",
  7324. * [ # <<<<<<<<<<<<<<
  7325. * ("area", 1),
  7326. * ("momentX", x),
  7327. */
  7328. __pyx_t_12 = __Pyx_PyList_Pack(6, __pyx_mstate_global->__pyx_tuple[1], __pyx_t_10, __pyx_t_11, __pyx_t_4, __pyx_t_13, __pyx_t_14); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 871, __pyx_L1_error)
  7329. __Pyx_GOTREF(__pyx_t_12);
  7330. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7331. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  7332. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7333. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  7334. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  7335. __pyx_t_15 = 1;
  7336. {
  7337. PyObject *__pyx_callargs[3] = {__pyx_t_7, __pyx_mstate_global->__pyx_n_u_MomentsPen, __pyx_t_12};
  7338. __pyx_t_2 = __Pyx_PyObject_FastCall((PyObject*)__pyx_t_8, __pyx_callargs+__pyx_t_15, (3-__pyx_t_15) | (__pyx_t_15*__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET));
  7339. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  7340. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  7341. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7342. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
  7343. __Pyx_GOTREF(__pyx_t_2);
  7344. }
  7345. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7346. /* "fontTools/pens/momentsPen.py":866
  7347. *
  7348. *
  7349. * if __name__ == "__main__": # <<<<<<<<<<<<<<
  7350. * from fontTools.misc.symfont import x, y, printGreenPen
  7351. *
  7352. */
  7353. }
  7354. /* "fontTools/pens/momentsPen.py":1
  7355. * from fontTools.pens.basePen import BasePen, OpenContourError # <<<<<<<<<<<<<<
  7356. *
  7357. * try:
  7358. */
  7359. __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  7360. __Pyx_GOTREF(__pyx_t_2);
  7361. if (PyDict_SetItem(__pyx_mstate_global->__pyx_d, __pyx_mstate_global->__pyx_n_u_test, __pyx_t_2) < (0)) __PYX_ERR(0, 1, __pyx_L1_error)
  7362. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7363. /*--- Wrapped vars code ---*/
  7364. goto __pyx_L0;
  7365. __pyx_L1_error:;
  7366. __Pyx_XDECREF(__pyx_t_2);
  7367. __Pyx_XDECREF(__pyx_t_4);
  7368. __Pyx_XDECREF(__pyx_t_7);
  7369. __Pyx_XDECREF(__pyx_t_8);
  7370. __Pyx_XDECREF(__pyx_t_10);
  7371. __Pyx_XDECREF(__pyx_t_11);
  7372. __Pyx_XDECREF(__pyx_t_12);
  7373. __Pyx_XDECREF(__pyx_t_13);
  7374. __Pyx_XDECREF(__pyx_t_14);
  7375. if (__pyx_m) {
  7376. if (__pyx_mstate->__pyx_d && stringtab_initialized) {
  7377. __Pyx_AddTraceback("init fontTools.pens.momentsPen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7378. }
  7379. #if !CYTHON_USE_MODULE_STATE
  7380. Py_CLEAR(__pyx_m);
  7381. #else
  7382. Py_DECREF(__pyx_m);
  7383. if (pystate_addmodule_run) {
  7384. PyObject *tp, *value, *tb;
  7385. PyErr_Fetch(&tp, &value, &tb);
  7386. PyState_RemoveModule(&__pyx_moduledef);
  7387. PyErr_Restore(tp, value, tb);
  7388. }
  7389. #endif
  7390. } else if (!PyErr_Occurred()) {
  7391. PyErr_SetString(PyExc_ImportError, "init fontTools.pens.momentsPen");
  7392. }
  7393. __pyx_L0:;
  7394. __Pyx_RefNannyFinishContext();
  7395. #if CYTHON_PEP489_MULTI_PHASE_INIT
  7396. return (__pyx_m != NULL) ? 0 : -1;
  7397. #else
  7398. return __pyx_m;
  7399. #endif
  7400. }
  7401. /* #### Code section: pystring_table ### */
  7402. /* #### Code section: cached_builtins ### */
  7403. static int __Pyx_InitCachedBuiltins(__pyx_mstatetype *__pyx_mstate) {
  7404. CYTHON_UNUSED_VAR(__pyx_mstate);
  7405. /* Cached unbound methods */
  7406. __pyx_mstate->__pyx_umethod_PyDict_Type_items.type = (PyObject*)&PyDict_Type;
  7407. __pyx_mstate->__pyx_umethod_PyDict_Type_items.method_name = &__pyx_mstate->__pyx_n_u_items;
  7408. __pyx_mstate->__pyx_umethod_PyDict_Type_pop.type = (PyObject*)&PyDict_Type;
  7409. __pyx_mstate->__pyx_umethod_PyDict_Type_pop.method_name = &__pyx_mstate->__pyx_n_u_pop;
  7410. __pyx_mstate->__pyx_umethod_PyDict_Type_values.type = (PyObject*)&PyDict_Type;
  7411. __pyx_mstate->__pyx_umethod_PyDict_Type_values.method_name = &__pyx_mstate->__pyx_n_u_values;
  7412. return 0;
  7413. }
  7414. /* #### Code section: cached_constants ### */
  7415. static int __Pyx_InitCachedConstants(__pyx_mstatetype *__pyx_mstate) {
  7416. __Pyx_RefNannyDeclarations
  7417. CYTHON_UNUSED_VAR(__pyx_mstate);
  7418. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  7419. /* "fontTools/pens/momentsPen.py":16
  7420. * class MomentsPen(BasePen):
  7421. *
  7422. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  7423. * BasePen.__init__(self, glyphset)
  7424. *
  7425. */
  7426. __pyx_mstate_global->__pyx_tuple[0] = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_mstate_global->__pyx_tuple[0])) __PYX_ERR(0, 16, __pyx_L1_error)
  7427. __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[0]);
  7428. __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[0]);
  7429. /* "fontTools/pens/momentsPen.py":872
  7430. * "MomentsPen",
  7431. * [
  7432. * ("area", 1), # <<<<<<<<<<<<<<
  7433. * ("momentX", x),
  7434. * ("momentY", y),
  7435. */
  7436. __pyx_mstate_global->__pyx_tuple[1] = PyTuple_Pack(2, __pyx_mstate_global->__pyx_n_u_area, __pyx_mstate_global->__pyx_int_1); if (unlikely(!__pyx_mstate_global->__pyx_tuple[1])) __PYX_ERR(0, 872, __pyx_L1_error)
  7437. __Pyx_GOTREF(__pyx_mstate_global->__pyx_tuple[1]);
  7438. __Pyx_GIVEREF(__pyx_mstate_global->__pyx_tuple[1]);
  7439. #if CYTHON_IMMORTAL_CONSTANTS
  7440. {
  7441. PyObject **table = __pyx_mstate->__pyx_tuple;
  7442. for (Py_ssize_t i=0; i<2; ++i) {
  7443. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  7444. #if PY_VERSION_HEX < 0x030E0000
  7445. if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
  7446. #else
  7447. if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
  7448. #endif
  7449. {
  7450. Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
  7451. }
  7452. #else
  7453. Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
  7454. #endif
  7455. }
  7456. }
  7457. #endif
  7458. __Pyx_RefNannyFinishContext();
  7459. return 0;
  7460. __pyx_L1_error:;
  7461. __Pyx_RefNannyFinishContext();
  7462. return -1;
  7463. }
  7464. /* #### Code section: init_constants ### */
  7465. static int __Pyx_InitConstants(__pyx_mstatetype *__pyx_mstate) {
  7466. CYTHON_UNUSED_VAR(__pyx_mstate);
  7467. {
  7468. const struct { const unsigned int length: 13; } index[] = {{1},{49},{32},{1},{7},{8},{10},{19},{21},{22},{19},{18},{18},{23},{16},{20},{7},{4},{18},{18},{10},{11},{7},{8},{22},{22},{25},{8},{16},{8},{8},{13},{5},{7},{8},{13},{10},{7},{8},{8},{7},{8},{7},{15},{8},{2},{2},{2},{2},{3},{11},{13},{12},{12},{2},{2},{3},{4},{4},{4},{4},{4},{4},{4},{4},{4},{4},{3},{4},{4},{4},{4},{4},{4},{4},{4},{4},{4},{3},{4},{4},{4},{4},{4},{4},{4},{4},{4},{4},{3},{4},{4},{4},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{2},{3},{3},{3},{3},{3},{3},{3},{3},{3},{3},{4},{12},{10},{11},{8},{6},{1},{2},{2},{2},{2},{1},{2},{2},{2},{2},{4139},{568},{9},{33},{34},{1710},{58}};
  7469. #if (CYTHON_COMPRESS_STRINGS) == 2 /* compression: bz2 (1942 bytes) */
  7470. const char* const cstring = "BZh91AY&SYn\312\265%\000\004@\177\377\376o\377\200\177\001\377\340\276\357\376`\277\357\377`@@@@@@@@@@@@@\000@\000`\010\377\017O\251\235\343\326\333\346n\2631/\270\372\212*x\367\017\205\004\246\222I\2652\203\310\374$\311\023C\322d\006\203@4\017\325\000\006\200\000\000%\024\232i\277J'\242\237\244jC@h\003\324\000\000\000\00044\000\000\032\236!\024\246CM\r\000\r\000\006\201\240\311\240\014\200\000\r\r2\002M%)\251\003\375T\311\376\252\001\352y \366\232\240\000\031\000\000\000h\000\006\236\240IE\036\236\246\244\000\310\000\000\000\000\003@\000\006\236\240\006\200\010\222Bi#\023Q\340M\232Jx\247\250\000\310\031\006\200\001\246\203\020i\265\r\351K\253{\274\376\277\322\036C\373\241\362\312\265\026\222\"\265\003\312\000\221\006\220\270\033\216\221\377\034\034\004\300p00\372\177\354\027\007\007\000\302\315W\230\326\022)\006\020\022\021I\000\024\317\330wK\"\335\000\"H\004\204D\032U\336`\257\002\220\212\022 \021\024\212\202\200\204\" \204\004$H\211\005\001\022\004\000$,\002\245\007\\\3431s\301\r\2316\366YD+j\303Q\002\256sf\001\022\200\022\344\013\326\364\332LS\023Y\261\234\"\222\"\n1Q%\225\220\311\204\231\r!$\025\004\310d\316\245\375\351F\251R\336<\306/XQ\255\231F\347b\254\337\nA\272\"%)\315\314^\247\234\231\014\022\331\304@\021\001\223\"BH\002\021\004\020\010$\322A\001=\370\252\362\302\275'{8\0374\323\215A\036\356\325v\266\275W\277gkor\236\357\337\345\004\212\307$)\005\005UUU\327[\206\272\256\272\353\256\272\353\257}\307\340\001'&Y\203\311\323\352*\252\252\252\256\333a\266\334V\355\266\333m\266\333t\302\035F`\312\014gf\316\006r2\325\325I %(I*\245)JR\224\245\376&\303\030\2068\266%\303\023\234\335\347L\3479\316w5\314\305\315qv!\2162\030\234\346\3579\345\234\3479\353_}\350bR\223\274\245*\245)J\221\210\210w\210\210\315\021\031\006\"!\336\"\"+\210\240b\"\035\342\"\"\270\215\030\037\346p\002N6\226\035\315\303x\363\357J\222\366\326\261\231\372\254\001p\r\313\231s\016&\366\203\237\314g\031\231,\333\237=\3250\025\005McY\265\206\263\006b\353m\361\335V\333\266\3254\006\336\035M_e\266o""\325\277\000\301_\273v\035\004\271`:1\276C\021\245e\263i;\203N\325\007N\344\242\373\202\241\027\263\014\331\366\324/An\004\304\\G\0239\302\354p\370\340`\200\"\000\210#\343\321\274\t\004\004\014@@A\r\022\314\031qo\301\327+4\005\240\200\\em\356p\353\211\375l\356\357s\310\245\304\222{\006\3302$V\316R\317\204r\021sg(,\305\203g\224\200e\032\334h\316\324\377\177\330\266dV\2763v\263\300\277w\210\342uj\205\2059\256+\223U\2548Ba! \300\265\212\352\337\340\270U\301U/P\300\014D\364\034\375\236=\375\311\013o\037|\331\333(\332\000\0310\322iH\221+\244O=\227\332\003\005\241k5\201c\"\340}\303\016\357\246\333\240\342~#\276\215\242\025\345\326\271\201(\243TPm<lT\206\036\232u\353\377\261\230W\363\026\323\242\354\034\331\262\337\305\227\224\3538?6\216^\033\372\255m\232\214\206]\341\272\336\323mR/\252\037^\331\213u\310l\005\366\377xp\263z\275\377s\236\275c\017P\340\276\316\311\214\007(Lv\357\332\353`v\314\304 T7i\251\234\"UHR\225\371\001\277\313\301\312f\nN\2132KN\326:Y\261\006\276\014u\032\205\331\312\214Do\276\374\221R\314[a~\"\244\333\234\323i\033\233hr\017\270\2403\006\355C\266\034\246\\\274\013\357\276\373\360\225\252\353\256\272\353\256\374)P\222I*\222\310\222IWS\327B\256\272\353\255T\222\310\222IeI*RIR\222K*IdI$\252IP\222I,\311:I$\225hI$\222K\213\257\261\250\345o6i}\356J\214\335\307\255\303\236\314\306\221\231\214A\267\003u\013\256\032\343>\216g\017F\312BQ\030\351\3624\244\236DK7x\3440>\336\030l\340\260\032\300,\013\013,\246\366Lr\232\336L\026d0BobqU\034\006\240`\270x\025&c\001\233\0000f0\033\00660\356\335\316\267\231\247\230\372(w\240\223\022\221}8\203\343\253V\254\273\233\207\302\020\304\320\220\242?2\306\234\245)\363\252\035\002Gzr\007!\"d\222H\201\024C\274\241\342\005\306.\261>\200$P!\340\241\246\004\210QS\264\361(G%\006\231!\360\305$\002\035\372T\227>\024\027\300\203 \363\202\360\211\006Z\315\201\250\020\217T.\205C&\222\000\326\243%\n\200\330\000 \220A\000`+\357\003\374\007%\022\300\376\361j\212\273_H\251\332'\222]MJ\263\222K \220E\021\005\354\177g8M\302\026\001\371 9d\254D""\003\030\210\263\241\207\334\023\303\t\331 \002\254%\336\230L\013\230\377\307\213\331d!\351\204\350\222[+\3642bUh9CD\360\235=\272:\005C\305\351A\215J\t\031\032B\242\364(\360\337\3031\314\300\034\207\360\225\033B\305\024F\3607\310\210s\305IFD\354s\033\341\301TU\255i\016\201\r\346\363\372\212pj\314X\203\016}\362NjT\254Q\025\224\243\343\020\346=\022\236{Z4FYL\235|\234\252Y\003@e\225~\326(\220\035)\325\352\250\226M\247')9b\3208\370\374/)9pK\024Qhv\203\244\322i\265@\343\r.\262\2112-%#\324\350\rZ\252MTV\204\350\312\241\252\200\320j\312\005B\211I\240\322\031P{\031\031\003\306\232&\202\243f\265\\\316=\201\232\326\035\247FI\254I\322\n\023\032-\2617f\224\364;\320\227\024(\364'G\022p\2212\210N\3225\320\323\2311\2455;h\222\243FS\021\022i\nh\330\244\330\214\323FY\207\214\324e\254\215e\nJ\223\013\247\257\220\322\330l>\306\215\336\207\321u\372\324\022\226ssnw\317\236\313tY\237\221h\252m\336|\333'\177\236sY\363\263\311\321\271\304i\026E\210(\312u\325Krnf\232P\320p\342wf\206F\322\255\256\266\315)UT\035\0253&d\266\212U\271wesJ\213\202%\252-\335\322\270i\2731\211\203iLf\227\245\242\351\245\310\256\224\241\243E7XN \014\020\222\014L\t\213^\202f\327\245p\344\331\272\223r\3158\264\210\233\314\250\233\305\323E\230\002*\320\341S\252\021xX\211\0218X\275@@\222\250\340^\246\3224Db\344 p\300\273\202M\215\020\240\025%\262\213A\222L7*\013\274C%C\025\016\033\020\231T\341\222\3410@\017)r\301\307C1\266\225\254\251\240\232Z\0327-q\315*&`\"\010e\031\010\253\213[\030\242\252xXt+&H7\263\262\2522\035\204*\267\374]\311\024\341BA\273*\324\224";
  7471. PyObject *data = __Pyx_DecompressString(cstring, 1942, 2);
  7472. if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
  7473. const char* const bytes = __Pyx_PyBytes_AsString(data);
  7474. #if !CYTHON_ASSUME_SAFE_MACROS
  7475. if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
  7476. #endif
  7477. #elif (CYTHON_COMPRESS_STRINGS) != 0 /* compression: zlib (2182 bytes) */
  7478. const char* const cstring = "x\332\245X;s\333H\022>\211r\225\256\326>\233\017\335\245\"%_(\023/>\242-\221R\355m\235\367,>\266\3526B\201 \274\313:\222 \033\240K\314\0342D\210\220!C\206\014\0312T\350P?\301?\341z\000\0148x\020\204\356\244\0021\230\351\351\351\376\3721=s\363\323p>\371\343\3220\025s`\230\003\325\270\034\030\227c\335\274\354k\237\007c\255\177\251\217/\365\2116\276T\365\261\251\317\300\270\3718\350}\370\214\037]]\037\032\037p\310\3700\322G\332\3304\036\264\361\315d\376cC14l6?\375\362\360\363\307\373\273_\374\301}\353F\226\007\343\201)\313l\227:\324q\242b\376\021\350\234\301\027\255\253\177\032kl\2576\356\207\t\207(mWg{F\372\227P\317\264\351s\373\204\2027]\225\356\001t\220\345\207\371#>w\003\325\224\377\245=\232m\355\263,+\303!\376\200\246(\306|\254\016\364\033U\007}f\342R\206J\026D-d\023\024U\353)\352\177\366\n0R\313r_We\231J\354\003w3\032\030\352\2151\037\221\236}/\201\363\246\347\002\030\352\335\203,\313\237gc\302\364w\315D\215\000\273\037\364\301\330\374\235\230\322\320L\n\256<0d_\340\201\251\215\014\017%Y\036)(9\376\2154SQ\207\212a8\037z\1776\324\310\233\254\364o\357E\337\277\271o\372\372\315\303\027\311AG\365L\030h\016\227\2612B\036\223\362\204\233\360\023a\242O\360\003\264\t\242H\032(\346O\240ic\242\006c\016Y\236\316\224\241;\025\312\300\001\207?e\362\220&\217\217\200\217\210\217\204O\005\237*>5|\352\300!\t!w\336H\312!)\207\244\034\222rH\312!)\207\244\034\222\3420\217\244<\222\362\244\215\244<\222\362H\312#)\217\244<\222\362H\212C\002\222\nH* )R!\021\322 \tR\324\201\007\344\204\214\220\017\262A.\310\004y \013\344\200\014\004\300\3518\033'\013\330\026A\220@\250\200P\005\241\006B\035D\020\313 r \362 \n \342\247\004b\005\304*\2105\020\353 \201T\006\211\003\211\007I\000I\004\t{* UA\252\201T\207\nT\312P\341\240\302CE\200\212\010\025\t*\330Y\205J\r*u\250B\265\014U\016\252<T\005\250\212P\225\240Z\201*\366\327\240Z\207\032\324\312P\343\240\306CM\200\232\0105\tj\025\250U\241\206Cu\300\3772\3249\250\363P\027\240.B]\202z\005\352U\250\327\240^7\264!\006\010\3616\327j\330\302\224\241\314""\206\246\214\311\004\\\217\224eS3\360\367\2132\234i\306\343c\371\221{\344\037\205\371\274<\347\346\374\\\370z\373\275{\366\247?\277Y\334[\205\247\213\277/\225o\347\257\261\235\r\276\236\317\337,\332\013 \337o\026\035\353\324*\3067|\232\0274\376\262P\255\234\305\221F\337*Y\267\244\321s\0312=\321\241\204Y\321\206O\234\320C\3704-\260\263\361t\312\302\264x\253c\237\332Wv\333\236\306\023E\033\t\362&h\020/\335\355\221\265\010\315\035\nxm\367\226'iWH\000\375E\200\2461U\032m\022\026MX\"\001Tj\327\274\335\260\225\264P\246i\244\200;A\254x~\267\207\033\276o\036g\372va\270=o\035\247m\321\006\365^s\311/\273\253\334J\\\301:\277n\254\373\233\322&H\355\317\237Y\rK\211\347\030\035\212\322$\014\221\351}\273d7mXf\217\320F\033\t4\206g\027\252igu\272\272Z\265W\346\232_w7\271\215\270\201\255\263 P\264\022\032\001qU;g\213T\334\240(\317\230)o\277\275\246\311\3605\265\205\323\310;\306+8y\203\351 \036\251.sKa\331[\235\255\032+\205\014\022\227\276BKel\336\356\342 \267\357l[\006\342u\033f\321_\226\226t\375wtu\327%\202\215+\253\345 ~\267<]\026i\027\361\211\022\345\302v\022\267\316x\360]\257z\353\223(\223\367KXe\303*\022\310\177]\225V\0163T\351\315\267wy\007\252w9\353\332\352\331'\244QL\370\362\033D\343\2513\376\354\262r\027\272c\204#^,\240pg\236\0277\321\266\205m{;e\354\221\261D\024\355\302\211\322\003\3100\020\305\342\321\365\014_X\266\227\323\275^\005'\002\222e\017*Y\014\352\025\257\034q\\\003\227\277\363\220'\312\251\276\343z\256%\2407R\270[\341\331&c\267\014\343\366\004\032s\307\357Z><]d%\242_\025\203\372\021\207\273fV\2408\277Z\267\327\351\0008f\334\375\270\257\177\210g\024\302(\272IPR\207$P6\321S\013\230\003\214ui}\2679\335\274\247P\272\212\366\234pkQg 0\372Q\344\346]\377#\021\252\331\262\261\364\243\230P\233^\024\213\270~\036C\274\217\3533\201qq\304KLG\252d\374^\324(\2450X\000w\007\227C\026Jc\230\004?\310\004\264s\026\361\375\362\327\260\031\374\217\210\305\250\001.\230\204E\363}\007m}\275\351mO\267\245\355\375.\267\343b\260\177\357\030\370@pF\373\367\344>,}gt\357mw\214\004\255\270\034b""\256\370Uw\235[K(^1.\201\206\367,\t5(&z\233\273=\\9\336\306{K\264\366\332fq\001&\256fN1\304j\023\325/j\31344\305x\353\276\244\021\235\031\211\2053\"\177\310-\243\006\215\212YLH\322!v\376\246U<\302\363\2106g\024\352\000V\356N\036A0\032\004\367\3506\216\327j(O\227\375\350\260\021\361\0369\222M\361\025MK\032\356\020t\237\276\306\002\343\204\272\031a(x\224\006\356\323\367\350\207\302\272\267y\265io\2461\031p\357\271\027\224\r\002\264/\210$\\\340\312s\270\316\372t}\215\2742\033~\323\335\346\266\342\026v\371]cGaMa\252\004\327J\252\020\342y\004\360?\374\221&\325\036\362\216\204\01089\354\303\376\207\3176\034\303\307v\014\177\271Rd\277< R\000\236|,\020\0076\036G\310\257\267\337/cn\n\236\223o\002\376\257\333\202\203\247A\022!?c!J\374\217\367\222n\003\2753\203E\212\212\376,\256a\343\\^|\264O\3742\233\367\034\276\341\025Edo(m\032\033u\233\3376\321Q\013\273\366n\372\215\255\343\335\254\356\206K\306\231\357\332\204,\301c%dl\2566\035\314\314WXV\031\273\322\356\356\351\241\375\324\356\004\212+\301\261\177\270\226P\331\021\372\021\330\321\\bw\3553\222\350\237\303\222M\0172:\t\037\021zL\214\266\330\n2|~H\342\036S\014\371\332\004\253rv\367j}\275%\230~\2629\322@L\236\262%<}\234\377\260\020p^\001\203\350u\356)\207]\313\303\004\357\254s\264c\301F^\337\315\223\303\327UG\356\251\376\227\353)\177z\272\333\244#\027@.\226/\275\356Hs\375\222\366\316\313\227 \215\354\361\"\007\030\273\256\222\362J'\rL\301\362\356\234\006\203s\325\220\250\246\323Hq\014\317\263\207\273\330\210q\016\352L\020\347\255[\177\017\314\262\233\242\037\233\307\"1\264\010\215\0252W\305\223\225\204\333f\221\035,y)\213l\002\331@:\341b#1rP\315\306i\374\362\363d\223\036\234\375\353\205\214\243\311)SXd\274Z\226\324\020g\230N\225\027\037\253b\016\335l~\322\250D\354\241\252\023\316h\207n\032\022\252\207Pq\0378<6\274m\261\347iy\346m\305\344\360Xd\320\020\231\014\033\246\273\302\212\312\334\362\333.\036<\304\035<\265\332\35412P\255E\020\241\206\314;\373Z\340\006\206\275\316\214\337WB\226\244'\200B\2123\331\321C\372\241k\006z\003s""\217e_0\014\257\331\r$\266\260,\260\206<\274\315D\034<\375%\304\261\373\211`\021\305(\033\2043p\027\026w\027EoT5,\200[Og\177#\271\361\355b\216\273\327_\335\224\362\017\313\331\016\377iM\231\327G\222a\331\327\177\001<\245]\242";
  7479. PyObject *data = __Pyx_DecompressString(cstring, 2182, 1);
  7480. if (unlikely(!data)) __PYX_ERR(0, 1, __pyx_L1_error)
  7481. const char* const bytes = __Pyx_PyBytes_AsString(data);
  7482. #if !CYTHON_ASSUME_SAFE_MACROS
  7483. if (likely(bytes)); else { Py_DECREF(data); __PYX_ERR(0, 1, __pyx_L1_error) }
  7484. #endif
  7485. #else /* compression: none (7701 bytes) */
  7486. const char* const bytes = ".Glyph statistics is not defined on open contours.Lib/fontTools/pens/momentsPen.py?BasePenCOMPILEDMomentsPenMomentsPen.__init__MomentsPen._closePathMomentsPen._curveToOneMomentsPen._endPathMomentsPen._lineToMomentsPen._moveToMomentsPen._qCurveToOneOpenContourError__Pyx_PyDict_NextRef__all__areaasyncio.coroutinescline_in_traceback_closePath_curveToOne__doc___endPathfontTools.misc.symfontfontTools.pens.basePenfontTools.pens.momentsPen__func___getCurrentPointglyphset__init___is_coroutineitems_lineTo__main____metaclass____module__momentXmomentXXmomentXYmomentYmomentYY_moveTo__mro_entries____name__p0p1p2p3pop__prepare__printGreenPen_qCurveToOne__qualname__r0r1r10r100r101r102r103r104r105r106r107r108r109r11r110r111r112r113r114r115r116r117r118r119r12r120r121r122r123r124r125r126r127r128r129r13r130r131r132r14r15r16r17r18r19r2r20r21r22r23r24r25r26r27r28r29r3r30r31r32r33r34r35r36r37r38r39r4r40r41r42r43r44r45r46r47r48r49r5r50r51r52r53r54r55r56r57r58r59r6r60r61r62r63r64r65r66r67r68r69r7r70r71r72r73r74r75r76r77r78r79r8r80r81r82r83r84r85r86r87r88r89r9r90r91r92r93r94r95r96r97r98r99self__set_name__setdefault_startPoint__test__valuesxx0x1x2x3yy0y1y2y3\200A\360T\004\000\t\r\210E\220\024\320\025&\240a\330\010\014\210E\220\021\330\010\014\210E\220\021\330\010\014\210E\220\021\340\010\r\210R\210r\220\021\330\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!""\330\010\016\210d\220\"\220C\220r\230\021\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210a\210t\2202\220S\230\002\230#\230R\230q\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220D\230\002\230$\230b\240\001\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220C\220r\230\023\230B\230a\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220D\230\002\230$\230b\240\001\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330""\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220A\330\010\016\210d\220\"\220C\220r\230\021\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210t\2202\220S\230\002\230#\230R\230t\2402\240T\250\022\2504\250r\260\023\260B\260d\270\"\270A\330\010\017\210t\2202\220Q\330\010\017\210s\220\"\220A\330\010\017\210u\220B\220a\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210u\220B\220a\330\010\017\210s\220\"\220A\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210s\220\"\220A\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210u\220B\220d\230\"\230C\230r\240\021\330\010\017\210s\220\"\220A\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210t\2202\220Q\330\010\017\210t\2202\220Q\330\010\017\210s\220\"\220A\330\010\017\210t\2202\220Q\330\010\017\210t\2202\220Q\330\010\017\210s\220\"\220D\230\002\230#\230R\230t\2402\240S\250\002\250#\250R\250t\2602\260T\270\022\2704\270r\300\021\330\010\017\210r\220\022\2201\330\010\017\210r\220\022\2201\330\010\017\210r\220\022\2201\330\010\017\210r\220\022\2201\330\010\017\210t\2202\220Q\330\010\017\210u\220B\220c\230\022\2304\230r\240\021\330\010\017\210t\2202\220Q\330\010\017\210s\220\"\220A\340\010\014\210A\330\014\r\210S\220\002\220!\330\014\016\210c\220\022\2201\330\014\016\210c\220\023\220C\220r\230\024\230R\230q\330\014\016\210c\220\023\220C\220r\230\023\230B\230c\240\022\2403\240b\250\004\250B\250a\330\014\016\210b\220\002\220#\220S\230\003\2302\230T\240\022\2401\330\014\016\210b\220\002\220#\220R\220s\230\"\230A\330\014\016\210c\220\023\220C\220r\230\023\230B\230d\240\"\240A\340\010\014\210A\330\014\020\220\002\220!\330\014\016\210d\220\"\220A\330\014\016\210d\220\"\220A\330\014\016\210d\220#\220Q\220d\230\"""\230D\240\002\240!\330\014\016\210d\220#\220S\230\002\230\"\230B\230d\240\"\240A\330\014\016\210d\220#\220S\230\002\230$\230b\240\003\2402\240S\250\002\250$\250b\260\001\330\014\016\210d\220#\220Q\220d\230\"\230D\240\002\240%\240r\250\021\330\014\016\210c\220\023\220C\220r\230\024\230R\230t\2402\240U\250\"\250A\330\014\016\210a\330\014\r\330\020\023\2202\220Q\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220!\340\014\016\210a\330\014\016\210c\220\023\220D\230\002\230$\230b\240\003\2402\240T\250\022\2503\250b\260\004\260B\260d\270\"\270C\270r\300\024\300R\300q\340\010\014\210A\330\014\r\210S\220\003\2204\220r\230\025\230b\240\001\330\014\016\210d\220\"\220A\330\014\016\210d\220\"\220A\330\014\016\210d\220\"\220A\330\014\016\210d\220#\220S\230\002\230\"\230B\230d\240\"\240A\330\014\016\210d\220#\220T\230\022\2304\230r\240\024\240R\240q\330\014\016\210a\330\014\r\330\020\024\220B\220a\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220!\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220!\340\014\016\210a\330\014\016\210c\220\023\220D\230\002\230#\230R\230s\240\"\240D\250\002\250$\250b\260\004\260B\260c\270\022\2704\270r\300\021\330\014\016\210c\220\022\2203\220c\230\024\230R\230t\2402\240Q\330\014\016\210c\220\023\220D\230\002\230#\230R\230t\2402\240S\250\002\250$\250b\260\003\2602\260T\270\022\2704\270r\300\024\300R\300t\3102\310Q\340\010\014\210A\330\014\r\210T\220\022\2204\220s\230!\2304\230r\240\024\240R\240q\330\014\016\210b\220\002\220$\220c\230\024\230R\230t\2402\240T\250\022\2503\250b\260\005\260R\260q\330\014\016\210a\330\014\r\330\020\024\220B\220a\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230""\001\330\020\022\220$\220b\230\001\330\020\022\220!\340\014\016\210a\330\014\016\210a\330\014\r\330\020\024\220B\220a\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220!\340\014\016\210a\330\014\016\210c\220\023\220C\220r\230\024\230R\230s\240\"\240C\240r\250\024\250R\250s\260\"\260D\270\002\270%\270r\300\021\330\014\016\210b\220\002\220$\220b\230\003\2302\230Q\330\014\016\210d\220\"\220D\230\002\230!\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220\"\220C\220s\230!\2304\230r\240\024\240R\240q\330\014\016\210b\220\002\220$\220c\230\024\230R\230u\240B\240a\330\014\016\210b\220\002\220\"\220C\220t\2302\230T\240\022\2404\240r\250\023\250B\250d\260\"\260A\330\014\016\210a\330\014\r\330\020\025\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220!\330\020\022\220#\220R\220t\2302\230Q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220\"\220B\220a\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\003\2302\230Q\340\014\016\210a\330\014\016\210a\330\014\r\330\020\024\220B\220a\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\003\2302\230Q\330\020\022\220$\220b\230\001\340\014\016\210a\340\010\014\210A\330\014\r\210U\220\"\220D\230\002\230!\330\014\016\210d\220\"\220D\230\002\230!\330\014\016\210b\220\002\220$\220b\230\003\2302\230Q\330\014\016\210b\220\002\220$\220c\230\025\230b\240\003\2402\240S\250\002\250#\250R\250t\2602\260S\270\002\270$\270b\300\002\300\"\300E""\310\022\3101\330\014\016\210a\330\014\r\330\020\025\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220!\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220!\330\020\022\220!\330\020\022\220#\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220!\340\014\016\210a\330\014\016\210d\220#\220R\220r\230\024\230R\230s\240\"\240D\250\002\250#\250R\250t\2602\260Q\330\014\016\210d\220#\220T\230\022\2304\230r\240\024\240R\240t\2502\250T\260\022\2605\270\002\270!\330\014\016\210c\220\023\220C\220r\230\024\230R\230t\2402\240S\250\002\250#\250R\250t\2602\260T\270\022\2705\300\002\300!\330\014\016\210b\220\002\220$\220c\230\024\230R\230u\240B\240a\330\014\016\210b\220\002\220#\220R\220s\230#\230T\240\022\2402\240R\240t\2502\250Q\330\014\016\210a\330\014\r\330\020\021\220\023\220B\220a\330\020\022\220#\220R\220u\230B\230a\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220$\220b\230\003\2302\230Q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\003\2302\230Q\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220t\2302\230Q\330\020\022\220$\220b\230\004\230B\230a\340\014\016\210a\330\014\016\210a\330\014\r\330\020\025\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\340\014\016\210a\330\014\016\210a\330\014\r\330\020\023\2202\220Q\330\020\022\220!\330\020\022\220%\220r\230\021\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\004\230B\230a""\330\020\022\220#\220R\220q\330\020\022\220#\220R\220s\230\"\230A\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\340\014\016\210a\340\010\014\210A\330\014\r\210U\220\"\220E\230\022\2301\330\014\016\210e\2202\220T\230\022\2301\330\014\016\210e\2202\220S\230\002\230!\330\014\016\210b\220\002\220%\220s\230$\230b\240\005\240R\240q\330\014\016\210e\2203\220d\230\"\230D\240\002\240$\240b\250\001\330\014\016\210c\220\023\220E\230\022\2303\230b\240\005\240R\240s\250\"\250E\260\022\2603\260b\270\005\270R\270q\330\014\016\210d\220\"\220D\230\002\230!\330\014\016\210d\220#\220T\230\022\2304\230r\240\025\240b\250\001\330\014\016\210a\330\014\017\210u\220B\220c\230\022\2305\240\002\240#\240R\240t\2502\250S\260\002\260$\260b\270\003\2702\270T\300\022\3004\300r\310\023\310B\310a\330\014\016\210a\330\014\016\210a\330\014\r\330\020\025\220R\220q\330\020\022\220%\220r\230\021\330\020\022\220%\220r\230\021\330\020\022\220%\220r\230\021\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220%\220r\230\021\330\020\022\220%\220r\230\021\330\020\022\220$\220b\230\004\230B\230a\330\020\022\220$\220b\230\004\230B\230a\330\020\022\220$\220b\230\004\230B\230a\330\020\022\220#\220R\220t\2302\230Q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\340\014\016\210a\330\014\016\210a\330\014\r\330\020\023\2202\220Q\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220t\2302\230Q\330\020\022\220#\220R\220t\2302\230Q\340\014\016\210a\330\014\016\210b\220\002\220#\220R\220s\230#\230T\240\022\2404\240r\250\023\250B\250d\260\"\260A\330\014\016\210a\330\014\r\330\020\025\220R\220q\330\020\022\220#\220R\220q\330\020\022\220\"\220B\220a\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220#\220R\220q\330\020\022\220!\330\020""\022\220%\220r\230\021\330\020\022\220%\220r\230\023\230B\230a\330\020\022\220$\220b\230\004\230B\230a\330\020\022\220!\330\020\022\220#\220R\220t\2302\230Q\330\020\022\220$\220b\230\001\340\014\016\210a\200A\360 \000\t\r\210E\220\024\320\025&\240a\330\010\014\210E\220\021\340\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210R\210r\220\021\330\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\340\010\014\210I\220Q\220c\230\022\2302\230R\230s\240\"\240B\240b\250\003\2503\250c\260\022\2604\260r\270\021\330\010\014\210L\230\001\230\023\230B\230c\240\022\2402\240R\240s\250\"\250B\250b\260\003\2602\260S\270\002\270\"\270B\270c\300\023\300C\300r\310\024\310R\310q\330\010\014\210A\330\014\r\210S\220\002\220#\220R\220r\230\022\2303\230b\240\003\2402\240R\240r\250\023\250B\250c\260\022\2602\260R\260s\270#\270S\300\002\300#\300R\300s\310\"\310D\320PR\320RS\340\010\014\210A\330\014\r\210T\220\022\2203\220b\230\001\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\022\2203\220b\230\003\2302\230Q\330\014\016\210b\220\002\220\"\220C\220r\230\022\2303\230b\240\004\240B\240a\340\010\014\210A\330\014\r\210S\220\002\220#\220R\220q\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\023\220C\220r\230\023\230B\230b\240\002\240#\240R\240t\2502\250Q\330\014\016\210c\220\022\2203\220c\230\023\230B\230d\240\"\240A\340\010\014\210A\330\014\r\210S\220\002\220#\220R\220q\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210c\220\023\220D\230\002\230$\230b\240\003\2402\240S\250\002\250#\250R\250t\2602\260Q\200A\330\010\014\210O\2301\200A\330\010\r\210T\320""\021\"\240!\330\010\013\2103\210c\220\024\220Q\330\014\022\320\022\"\240!\2401\200A\330\010\r\210T\320\021\"\240!\330\010\013\2103\210c\220\024\220Q\330\014\020\220\010\230\001\230\024\230Q\200A\360t\001\000\t\r\210E\220\024\320\025&\240a\330\010\014\210E\220\021\330\010\014\210E\220\021\340\010\r\210R\210r\220\021\330\010\r\210S\220\002\220!\330\010\r\210S\220\002\220!\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210R\210r\220\021\330\010\r\210S\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2203\220b\230\001\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210d\220\"\220A\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2203\220b\230\001\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2203\220b\230\001\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220#\220R\220q\330\010\016\210d\220\"\220A\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220$\220b\230\003\2302\230Q\330\010\016\210b\220\002\220\"\220B\220a\330\010\016\210b\220\002\220!\330\010\016\210b\220\002\220!\330\010\016\210c\220\022\2201\330\010\016\210c\220\022\2201\340\010\014\210A\330\014\r\210S""\220\002\220!\330\014\016\210c\220\022\2201\330\014\016\210c\220\023\220C\220r\230\023\230B\230d\240\"\240A\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\023\220C\220r\230\024\230R\230q\340\010\014\210A\330\014\r\210T\220\023\220A\220T\230\022\2304\230r\240\021\330\014\016\210d\220#\220T\230\022\2303\230b\240\004\240B\240a\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\022\2203\220b\230\001\330\014\016\210c\220\023\220D\230\002\230$\230b\240\004\240B\240c\250\022\2505\260\002\260!\330\014\016\210c\220\023\220D\230\002\230\"\230B\230c\240\022\2404\240r\250\021\340\010\014\210A\330\014\r\210T\220\022\2201\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220\"\220A\330\014\016\210d\220#\220T\230\022\2304\230r\240\021\330\014\016\210c\220\023\220C\220r\230\023\230B\230d\240\"\240D\250\002\250$\250b\260\004\260B\260c\270\022\2704\270r\300\021\330\014\016\210c\220\022\2203\220c\230\024\230R\230t\2402\240Q\330\014\016\210c\220\023\220C\220r\230\025\230b\240\001\340\010\014\210A\330\014\020\220\003\2203\220b\230\002\230\"\230D\240\002\240$\240b\250\003\2502\250T\260\022\2603\260b\270\004\270B\270a\330\014\016\210b\220\002\220$\220b\230\003\2302\230Q\330\014\016\210d\220\"\220D\230\002\230!\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220#\220S\230\002\230\"\230B\230d\240\"\240A\330\014\016\210c\220\022\2203\220c\230\023\230B\230e\2402\240Q\330\014\016\210b\220\002\220\"\220C\220t\2302\230S\240\002\240#\240R\240t\2502\250Q\330\014\016\210a\330\014\r\330\020\023\2202\220Q\330\020\022\220$\220b\230\001\330\020\022\220#\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220!\330\020\022\220#\220R\220q\340\014\016\210a\330\014\016\210c\220\023\220B\220b\230\004\230B\230b\240\002\240$\240b\250\004\250B\250d\260\"\260D\270\002\270!\340\010\014\210A\330\014\020\220\003\2204\220r\230\023\230B\230b\240\002\240$\240b\250\004\250B\250d\260""\"\260D\270\002\270#\270R\270t\3002\300T\310\022\3104\310r\320QR\330\014\016\210d\220\"\220C\220s\230$\230b\240\005\240R\240q\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220#\220T\230\022\2304\230r\240\023\240B\240b\250\002\250$\250b\260\001\330\014\016\210d\220\"\220C\220r\230\023\230B\230a\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210c\220\022\2203\220c\230\024\230R\230t\2402\240Q\330\014\016\210a\330\014\r\330\020\021\220\024\220R\220q\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220!\340\014\016\210a\330\014\016\210c\220\023\220D\230\002\230#\230R\230t\2402\240S\250\002\250$\250b\260\004\260B\260d\270\"\270E\300\022\3001\340\010\014\210A\330\014\r\210S\220\002\220$\220b\230\001\330\014\016\210d\220\"\220D\230\002\230!\330\014\016\210d\220#\220T\230\022\2304\230r\240\024\240R\240t\2502\250Q\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220\"\220C\220r\230\021\330\014\016\210d\220#\220T\230\022\2304\230r\240\021\330\014\016\210a\330\014\r\330\020\024\220B\220a\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220$\220b\230\001\330\020\022\220!\330\020\022\220\"\220B\220a\330\020\022\220#\220R\220q\340\014\016\210a\330\014\016\210c\220\022\2203\220c\230\024\230R\230t\2402\240S\250\002\250$\250b\260\001\330\014\016\210c\220\023\220D\230\002\230$\230b\240\003\2402\240T\250\022\2504\250r\260\023\260B\260e\2702\270Q\320\004\027\220q\330\010\017\210y\230\001\230\026\230q\340\010\014\210H\220A\330\010\014\210K\220q\330\010\014\210K\220q\330\010\014\210L\230\001\330\010\014\210L\230\001\330\010\014\210L\230\001";
  7487. PyObject *data = NULL;
  7488. CYTHON_UNUSED_VAR(__Pyx_DecompressString);
  7489. #endif
  7490. PyObject **stringtab = __pyx_mstate->__pyx_string_tab;
  7491. Py_ssize_t pos = 0;
  7492. for (int i = 0; i < 203; i++) {
  7493. Py_ssize_t bytes_length = index[i].length;
  7494. PyObject *string = PyUnicode_DecodeUTF8(bytes + pos, bytes_length, NULL);
  7495. if (likely(string) && i >= 4) PyUnicode_InternInPlace(&string);
  7496. if (unlikely(!string)) {
  7497. Py_XDECREF(data);
  7498. __PYX_ERR(0, 1, __pyx_L1_error)
  7499. }
  7500. stringtab[i] = string;
  7501. pos += bytes_length;
  7502. }
  7503. for (int i = 203; i < 210; i++) {
  7504. Py_ssize_t bytes_length = index[i].length;
  7505. PyObject *string = PyBytes_FromStringAndSize(bytes + pos, bytes_length);
  7506. stringtab[i] = string;
  7507. pos += bytes_length;
  7508. if (unlikely(!string)) {
  7509. Py_XDECREF(data);
  7510. __PYX_ERR(0, 1, __pyx_L1_error)
  7511. }
  7512. }
  7513. Py_XDECREF(data);
  7514. for (Py_ssize_t i = 0; i < 210; i++) {
  7515. if (unlikely(PyObject_Hash(stringtab[i]) == -1)) {
  7516. __PYX_ERR(0, 1, __pyx_L1_error)
  7517. }
  7518. }
  7519. #if CYTHON_IMMORTAL_CONSTANTS
  7520. {
  7521. PyObject **table = stringtab + 203;
  7522. for (Py_ssize_t i=0; i<7; ++i) {
  7523. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  7524. #if PY_VERSION_HEX < 0x030E0000
  7525. if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
  7526. #else
  7527. if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
  7528. #endif
  7529. {
  7530. Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
  7531. }
  7532. #else
  7533. Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
  7534. #endif
  7535. }
  7536. }
  7537. #endif
  7538. }
  7539. {
  7540. PyObject **numbertab = __pyx_mstate->__pyx_number_tab + 0;
  7541. int8_t const cint_constants_1[] = {0,1,2};
  7542. for (int i = 0; i < 3; i++) {
  7543. numbertab[i] = PyLong_FromLong(cint_constants_1[i - 0]);
  7544. if (unlikely(!numbertab[i])) __PYX_ERR(0, 1, __pyx_L1_error)
  7545. }
  7546. }
  7547. #if CYTHON_IMMORTAL_CONSTANTS
  7548. {
  7549. PyObject **table = __pyx_mstate->__pyx_number_tab;
  7550. for (Py_ssize_t i=0; i<3; ++i) {
  7551. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  7552. #if PY_VERSION_HEX < 0x030E0000
  7553. if (_Py_IsOwnedByCurrentThread(table[i]) && Py_REFCNT(table[i]) == 1)
  7554. #else
  7555. if (PyUnstable_Object_IsUniquelyReferenced(table[i]))
  7556. #endif
  7557. {
  7558. Py_SET_REFCNT(table[i], _Py_IMMORTAL_REFCNT_LOCAL);
  7559. }
  7560. #else
  7561. Py_SET_REFCNT(table[i], _Py_IMMORTAL_INITIAL_REFCNT);
  7562. #endif
  7563. }
  7564. }
  7565. #endif
  7566. return 0;
  7567. __pyx_L1_error:;
  7568. return -1;
  7569. }
  7570. /* #### Code section: init_codeobjects ### */
  7571. typedef struct {
  7572. unsigned int argcount : 3;
  7573. unsigned int num_posonly_args : 1;
  7574. unsigned int num_kwonly_args : 1;
  7575. unsigned int nlocals : 8;
  7576. unsigned int flags : 10;
  7577. unsigned int first_line : 9;
  7578. } __Pyx_PyCode_New_function_description;
  7579. /* NewCodeObj.proto */
  7580. static PyObject* __Pyx_PyCode_New(
  7581. const __Pyx_PyCode_New_function_description descr,
  7582. PyObject * const *varnames,
  7583. PyObject *filename,
  7584. PyObject *funcname,
  7585. PyObject *line_table,
  7586. PyObject *tuple_dedup_map
  7587. );
  7588. static int __Pyx_CreateCodeObjects(__pyx_mstatetype *__pyx_mstate) {
  7589. PyObject* tuple_dedup_map = PyDict_New();
  7590. if (unlikely(!tuple_dedup_map)) return -1;
  7591. {
  7592. const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 16};
  7593. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_glyphset};
  7594. __pyx_mstate_global->__pyx_codeobj_tab[0] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_init, __pyx_mstate->__pyx_kp_b_iso88591_q_y_q_HA_Kq_Kq_L_L_L, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[0])) goto bad;
  7595. }
  7596. {
  7597. const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 26};
  7598. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
  7599. __pyx_mstate_global->__pyx_codeobj_tab[1] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_moveTo, __pyx_mstate->__pyx_kp_b_iso88591_A_O1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[1])) goto bad;
  7600. }
  7601. {
  7602. const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 29};
  7603. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
  7604. __pyx_mstate_global->__pyx_codeobj_tab[2] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_closePath, __pyx_mstate->__pyx_kp_b_iso88591_A_T_3c_Q_Q, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[2])) goto bad;
  7605. }
  7606. {
  7607. const __Pyx_PyCode_New_function_description descr = {1, 0, 0, 2, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 34};
  7608. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p0};
  7609. __pyx_mstate_global->__pyx_codeobj_tab[3] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_endPath, __pyx_mstate->__pyx_kp_b_iso88591_A_T_3c_Q_1, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[3])) goto bad;
  7610. }
  7611. {
  7612. const __Pyx_PyCode_New_function_description descr = {2, 0, 0, 19, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 39};
  7613. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
  7614. __pyx_mstate_global->__pyx_codeobj_tab[4] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_lineTo, __pyx_mstate->__pyx_kp_b_iso88591_A_E_a_E_S_S_Rr_S_S_S_Rr_Rr_Rr_Rr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[4])) goto bad;
  7615. }
  7616. {
  7617. const __Pyx_PyCode_New_function_description descr = {3, 0, 0, 63, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 99};
  7618. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
  7619. __pyx_mstate_global->__pyx_codeobj_tab[5] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_qCurveToOne, __pyx_mstate->__pyx_kp_b_iso88591_At_E_a_E_E_Rr_S_S_Rr_Rr_Rr_Rr_Rr, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[5])) goto bad;
  7620. }
  7621. {
  7622. const __Pyx_PyCode_New_function_description descr = {4, 0, 0, 145, (unsigned int)(CO_OPTIMIZED|CO_NEWLOCALS), 310};
  7623. PyObject* const varnames[] = {__pyx_mstate->__pyx_n_u_self, __pyx_mstate->__pyx_n_u_p1, __pyx_mstate->__pyx_n_u_p2, __pyx_mstate->__pyx_n_u_p3, __pyx_mstate->__pyx_n_u_x3, __pyx_mstate->__pyx_n_u_y3, __pyx_mstate->__pyx_n_u_x2, __pyx_mstate->__pyx_n_u_y2, __pyx_mstate->__pyx_n_u_x1, __pyx_mstate->__pyx_n_u_y1, __pyx_mstate->__pyx_n_u_x0, __pyx_mstate->__pyx_n_u_y0, __pyx_mstate->__pyx_n_u_r132, __pyx_mstate->__pyx_n_u_r131, __pyx_mstate->__pyx_n_u_r130, __pyx_mstate->__pyx_n_u_r129, __pyx_mstate->__pyx_n_u_r128, __pyx_mstate->__pyx_n_u_r127, __pyx_mstate->__pyx_n_u_r126, __pyx_mstate->__pyx_n_u_r125, __pyx_mstate->__pyx_n_u_r124, __pyx_mstate->__pyx_n_u_r123, __pyx_mstate->__pyx_n_u_r122, __pyx_mstate->__pyx_n_u_r121, __pyx_mstate->__pyx_n_u_r120, __pyx_mstate->__pyx_n_u_r119, __pyx_mstate->__pyx_n_u_r118, __pyx_mstate->__pyx_n_u_r117, __pyx_mstate->__pyx_n_u_r116, __pyx_mstate->__pyx_n_u_r115, __pyx_mstate->__pyx_n_u_r114, __pyx_mstate->__pyx_n_u_r113, __pyx_mstate->__pyx_n_u_r112, __pyx_mstate->__pyx_n_u_r111, __pyx_mstate->__pyx_n_u_r110, __pyx_mstate->__pyx_n_u_r109, __pyx_mstate->__pyx_n_u_r108, __pyx_mstate->__pyx_n_u_r107, __pyx_mstate->__pyx_n_u_r106, __pyx_mstate->__pyx_n_u_r105, __pyx_mstate->__pyx_n_u_r104, __pyx_mstate->__pyx_n_u_r103, __pyx_mstate->__pyx_n_u_r102, __pyx_mstate->__pyx_n_u_r101, __pyx_mstate->__pyx_n_u_r100, __pyx_mstate->__pyx_n_u_r99, __pyx_mstate->__pyx_n_u_r98, __pyx_mstate->__pyx_n_u_r97, __pyx_mstate->__pyx_n_u_r96, __pyx_mstate->__pyx_n_u_r95, __pyx_mstate->__pyx_n_u_r94, __pyx_mstate->__pyx_n_u_r93, __pyx_mstate->__pyx_n_u_r92, __pyx_mstate->__pyx_n_u_r91, __pyx_mstate->__pyx_n_u_r90, __pyx_mstate->__pyx_n_u_r89, __pyx_mstate->__pyx_n_u_r88, __pyx_mstate->__pyx_n_u_r87, __pyx_mstate->__pyx_n_u_r86, __pyx_mstate->__pyx_n_u_r85, __pyx_mstate->__pyx_n_u_r84, __pyx_mstate->__pyx_n_u_r83, __pyx_mstate->__pyx_n_u_r82, __pyx_mstate->__pyx_n_u_r81, __pyx_mstate->__pyx_n_u_r80, __pyx_mstate->__pyx_n_u_r79, __pyx_mstate->__pyx_n_u_r78, __pyx_mstate->__pyx_n_u_r77, __pyx_mstate->__pyx_n_u_r76, __pyx_mstate->__pyx_n_u_r75, __pyx_mstate->__pyx_n_u_r74, __pyx_mstate->__pyx_n_u_r73, __pyx_mstate->__pyx_n_u_r72, __pyx_mstate->__pyx_n_u_r71, __pyx_mstate->__pyx_n_u_r70, __pyx_mstate->__pyx_n_u_r69, __pyx_mstate->__pyx_n_u_r68, __pyx_mstate->__pyx_n_u_r67, __pyx_mstate->__pyx_n_u_r66, __pyx_mstate->__pyx_n_u_r65, __pyx_mstate->__pyx_n_u_r64, __pyx_mstate->__pyx_n_u_r63, __pyx_mstate->__pyx_n_u_r62, __pyx_mstate->__pyx_n_u_r61, __pyx_mstate->__pyx_n_u_r60, __pyx_mstate->__pyx_n_u_r59, __pyx_mstate->__pyx_n_u_r58, __pyx_mstate->__pyx_n_u_r57, __pyx_mstate->__pyx_n_u_r56, __pyx_mstate->__pyx_n_u_r55, __pyx_mstate->__pyx_n_u_r54, __pyx_mstate->__pyx_n_u_r53, __pyx_mstate->__pyx_n_u_r52, __pyx_mstate->__pyx_n_u_r51, __pyx_mstate->__pyx_n_u_r50, __pyx_mstate->__pyx_n_u_r49, __pyx_mstate->__pyx_n_u_r48, __pyx_mstate->__pyx_n_u_r47, __pyx_mstate->__pyx_n_u_r46, __pyx_mstate->__pyx_n_u_r45, __pyx_mstate->__pyx_n_u_r44, __pyx_mstate->__pyx_n_u_r43, __pyx_mstate->__pyx_n_u_r42, __pyx_mstate->__pyx_n_u_r41, __pyx_mstate->__pyx_n_u_r40, __pyx_mstate->__pyx_n_u_r39, __pyx_mstate->__pyx_n_u_r38, __pyx_mstate->__pyx_n_u_r37, __pyx_mstate->__pyx_n_u_r36, __pyx_mstate->__pyx_n_u_r35, __pyx_mstate->__pyx_n_u_r34, __pyx_mstate->__pyx_n_u_r33, __pyx_mstate->__pyx_n_u_r32, __pyx_mstate->__pyx_n_u_r31, __pyx_mstate->__pyx_n_u_r30, __pyx_mstate->__pyx_n_u_r29, __pyx_mstate->__pyx_n_u_r28, __pyx_mstate->__pyx_n_u_r27, __pyx_mstate->__pyx_n_u_r26, __pyx_mstate->__pyx_n_u_r25, __pyx_mstate->__pyx_n_u_r24, __pyx_mstate->__pyx_n_u_r23, __pyx_mstate->__pyx_n_u_r22, __pyx_mstate->__pyx_n_u_r21, __pyx_mstate->__pyx_n_u_r20, __pyx_mstate->__pyx_n_u_r19, __pyx_mstate->__pyx_n_u_r18, __pyx_mstate->__pyx_n_u_r17, __pyx_mstate->__pyx_n_u_r16, __pyx_mstate->__pyx_n_u_r15, __pyx_mstate->__pyx_n_u_r14, __pyx_mstate->__pyx_n_u_r13, __pyx_mstate->__pyx_n_u_r12, __pyx_mstate->__pyx_n_u_r11, __pyx_mstate->__pyx_n_u_r10, __pyx_mstate->__pyx_n_u_r9, __pyx_mstate->__pyx_n_u_r8, __pyx_mstate->__pyx_n_u_r7, __pyx_mstate->__pyx_n_u_r6, __pyx_mstate->__pyx_n_u_r5, __pyx_mstate->__pyx_n_u_r4, __pyx_mstate->__pyx_n_u_r3, __pyx_mstate->__pyx_n_u_r2, __pyx_mstate->__pyx_n_u_r1, __pyx_mstate->__pyx_n_u_r0};
  7624. __pyx_mstate_global->__pyx_codeobj_tab[6] = __Pyx_PyCode_New(descr, varnames, __pyx_mstate->__pyx_kp_u_Lib_fontTools_pens_momentsPen_py, __pyx_mstate->__pyx_n_u_curveToOne, __pyx_mstate->__pyx_kp_b_iso88591_AT_E_a_E_E_E_Rr_S_S_S_Rr_Rr_Rr_R, tuple_dedup_map); if (unlikely(!__pyx_mstate_global->__pyx_codeobj_tab[6])) goto bad;
  7625. }
  7626. Py_DECREF(tuple_dedup_map);
  7627. return 0;
  7628. bad:
  7629. Py_DECREF(tuple_dedup_map);
  7630. return -1;
  7631. }
  7632. /* #### Code section: init_globals ### */
  7633. static int __Pyx_InitGlobals(void) {
  7634. /* PythonCompatibility.init */
  7635. if (likely(__Pyx_init_co_variables() == 0)); else
  7636. if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
  7637. /* CommonTypesMetaclass.init */
  7638. if (likely(__pyx_CommonTypesMetaclass_init(__pyx_m) == 0)); else
  7639. if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
  7640. /* CachedMethodType.init */
  7641. #if CYTHON_COMPILING_IN_LIMITED_API
  7642. {
  7643. PyObject *typesModule=NULL;
  7644. typesModule = PyImport_ImportModule("types");
  7645. if (typesModule) {
  7646. __pyx_mstate_global->__Pyx_CachedMethodType = PyObject_GetAttrString(typesModule, "MethodType");
  7647. Py_DECREF(typesModule);
  7648. }
  7649. } // error handling follows
  7650. #endif
  7651. if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
  7652. /* CythonFunctionShared.init */
  7653. if (likely(__pyx_CyFunction_init(__pyx_m) == 0)); else
  7654. if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L1_error)
  7655. return 0;
  7656. __pyx_L1_error:;
  7657. return -1;
  7658. }
  7659. /* #### Code section: cleanup_globals ### */
  7660. /* #### Code section: cleanup_module ### */
  7661. /* #### Code section: main_method ### */
  7662. /* #### Code section: utility_code_pragmas ### */
  7663. #ifdef _MSC_VER
  7664. #pragma warning( push )
  7665. /* Warning 4127: conditional expression is constant
  7666. * Cython uses constant conditional expressions to allow in inline functions to be optimized at
  7667. * compile-time, so this warning is not useful
  7668. */
  7669. #pragma warning( disable : 4127 )
  7670. #endif
  7671. /* #### Code section: utility_code_def ### */
  7672. /* --- Runtime support code --- */
  7673. /* Refnanny */
  7674. #if CYTHON_REFNANNY
  7675. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  7676. PyObject *m = NULL, *p = NULL;
  7677. void *r = NULL;
  7678. m = PyImport_ImportModule(modname);
  7679. if (!m) goto end;
  7680. p = PyObject_GetAttrString(m, "RefNannyAPI");
  7681. if (!p) goto end;
  7682. r = PyLong_AsVoidPtr(p);
  7683. end:
  7684. Py_XDECREF(p);
  7685. Py_XDECREF(m);
  7686. return (__Pyx_RefNannyAPIStruct *)r;
  7687. }
  7688. #endif
  7689. /* TupleAndListFromArray (used by fastcall) */
  7690. #if !CYTHON_COMPILING_IN_CPYTHON && CYTHON_METH_FASTCALL
  7691. static CYTHON_INLINE PyObject *
  7692. __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
  7693. {
  7694. PyObject *res;
  7695. Py_ssize_t i;
  7696. if (n <= 0) {
  7697. return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
  7698. }
  7699. res = PyTuple_New(n);
  7700. if (unlikely(res == NULL)) return NULL;
  7701. for (i = 0; i < n; i++) {
  7702. if (unlikely(__Pyx_PyTuple_SET_ITEM(res, i, src[i]) < (0))) {
  7703. Py_DECREF(res);
  7704. return NULL;
  7705. }
  7706. Py_INCREF(src[i]);
  7707. }
  7708. return res;
  7709. }
  7710. #elif CYTHON_COMPILING_IN_CPYTHON
  7711. static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
  7712. PyObject *v;
  7713. Py_ssize_t i;
  7714. for (i = 0; i < length; i++) {
  7715. v = dest[i] = src[i];
  7716. Py_INCREF(v);
  7717. }
  7718. }
  7719. static CYTHON_INLINE PyObject *
  7720. __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
  7721. {
  7722. PyObject *res;
  7723. if (n <= 0) {
  7724. return __Pyx_NewRef(__pyx_mstate_global->__pyx_empty_tuple);
  7725. }
  7726. res = PyTuple_New(n);
  7727. if (unlikely(res == NULL)) return NULL;
  7728. __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
  7729. return res;
  7730. }
  7731. static CYTHON_INLINE PyObject *
  7732. __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
  7733. {
  7734. PyObject *res;
  7735. if (n <= 0) {
  7736. return PyList_New(0);
  7737. }
  7738. res = PyList_New(n);
  7739. if (unlikely(res == NULL)) return NULL;
  7740. __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
  7741. return res;
  7742. }
  7743. #endif
  7744. /* BytesEquals (used by UnicodeEquals) */
  7745. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
  7746. #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL ||\
  7747. !(CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS)
  7748. return PyObject_RichCompareBool(s1, s2, equals);
  7749. #else
  7750. if (s1 == s2) {
  7751. return (equals == Py_EQ);
  7752. } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
  7753. const char *ps1, *ps2;
  7754. Py_ssize_t length = PyBytes_GET_SIZE(s1);
  7755. if (length != PyBytes_GET_SIZE(s2))
  7756. return (equals == Py_NE);
  7757. ps1 = PyBytes_AS_STRING(s1);
  7758. ps2 = PyBytes_AS_STRING(s2);
  7759. if (ps1[0] != ps2[0]) {
  7760. return (equals == Py_NE);
  7761. } else if (length == 1) {
  7762. return (equals == Py_EQ);
  7763. } else {
  7764. int result;
  7765. #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
  7766. Py_hash_t hash1, hash2;
  7767. hash1 = ((PyBytesObject*)s1)->ob_shash;
  7768. hash2 = ((PyBytesObject*)s2)->ob_shash;
  7769. if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
  7770. return (equals == Py_NE);
  7771. }
  7772. #endif
  7773. result = memcmp(ps1, ps2, (size_t)length);
  7774. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  7775. }
  7776. } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
  7777. return (equals == Py_NE);
  7778. } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
  7779. return (equals == Py_NE);
  7780. } else {
  7781. int result;
  7782. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  7783. if (!py_result)
  7784. return -1;
  7785. result = __Pyx_PyObject_IsTrue(py_result);
  7786. Py_DECREF(py_result);
  7787. return result;
  7788. }
  7789. #endif
  7790. }
  7791. /* UnicodeEquals (used by fastcall) */
  7792. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
  7793. #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_GRAAL
  7794. return PyObject_RichCompareBool(s1, s2, equals);
  7795. #else
  7796. int s1_is_unicode, s2_is_unicode;
  7797. if (s1 == s2) {
  7798. goto return_eq;
  7799. }
  7800. s1_is_unicode = PyUnicode_CheckExact(s1);
  7801. s2_is_unicode = PyUnicode_CheckExact(s2);
  7802. if (s1_is_unicode & s2_is_unicode) {
  7803. Py_ssize_t length, length2;
  7804. int kind;
  7805. void *data1, *data2;
  7806. #if !CYTHON_COMPILING_IN_LIMITED_API
  7807. if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
  7808. return -1;
  7809. #endif
  7810. length = __Pyx_PyUnicode_GET_LENGTH(s1);
  7811. #if !CYTHON_ASSUME_SAFE_SIZE
  7812. if (unlikely(length < 0)) return -1;
  7813. #endif
  7814. length2 = __Pyx_PyUnicode_GET_LENGTH(s2);
  7815. #if !CYTHON_ASSUME_SAFE_SIZE
  7816. if (unlikely(length2 < 0)) return -1;
  7817. #endif
  7818. if (length != length2) {
  7819. goto return_ne;
  7820. }
  7821. #if CYTHON_USE_UNICODE_INTERNALS
  7822. {
  7823. Py_hash_t hash1, hash2;
  7824. hash1 = ((PyASCIIObject*)s1)->hash;
  7825. hash2 = ((PyASCIIObject*)s2)->hash;
  7826. if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
  7827. goto return_ne;
  7828. }
  7829. }
  7830. #endif
  7831. kind = __Pyx_PyUnicode_KIND(s1);
  7832. if (kind != __Pyx_PyUnicode_KIND(s2)) {
  7833. goto return_ne;
  7834. }
  7835. data1 = __Pyx_PyUnicode_DATA(s1);
  7836. data2 = __Pyx_PyUnicode_DATA(s2);
  7837. if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
  7838. goto return_ne;
  7839. } else if (length == 1) {
  7840. goto return_eq;
  7841. } else {
  7842. int result = memcmp(data1, data2, (size_t)(length * kind));
  7843. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  7844. }
  7845. } else if ((s1 == Py_None) & s2_is_unicode) {
  7846. goto return_ne;
  7847. } else if ((s2 == Py_None) & s1_is_unicode) {
  7848. goto return_ne;
  7849. } else {
  7850. int result;
  7851. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  7852. if (!py_result)
  7853. return -1;
  7854. result = __Pyx_PyObject_IsTrue(py_result);
  7855. Py_DECREF(py_result);
  7856. return result;
  7857. }
  7858. return_eq:
  7859. return (equals == Py_EQ);
  7860. return_ne:
  7861. return (equals == Py_NE);
  7862. #endif
  7863. }
  7864. /* fastcall */
  7865. #if CYTHON_METH_FASTCALL
  7866. static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
  7867. {
  7868. Py_ssize_t i, n = __Pyx_PyTuple_GET_SIZE(kwnames);
  7869. #if !CYTHON_ASSUME_SAFE_SIZE
  7870. if (unlikely(n == -1)) return NULL;
  7871. #endif
  7872. for (i = 0; i < n; i++)
  7873. {
  7874. PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
  7875. #if !CYTHON_ASSUME_SAFE_MACROS
  7876. if (unlikely(!namei)) return NULL;
  7877. #endif
  7878. if (s == namei) return kwvalues[i];
  7879. }
  7880. for (i = 0; i < n; i++)
  7881. {
  7882. PyObject *namei = __Pyx_PyTuple_GET_ITEM(kwnames, i);
  7883. #if !CYTHON_ASSUME_SAFE_MACROS
  7884. if (unlikely(!namei)) return NULL;
  7885. #endif
  7886. int eq = __Pyx_PyUnicode_Equals(s, namei, Py_EQ);
  7887. if (unlikely(eq != 0)) {
  7888. if (unlikely(eq < 0)) return NULL;
  7889. return kwvalues[i];
  7890. }
  7891. }
  7892. return NULL;
  7893. }
  7894. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000 || CYTHON_COMPILING_IN_LIMITED_API
  7895. CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
  7896. Py_ssize_t i, nkwargs;
  7897. PyObject *dict;
  7898. #if !CYTHON_ASSUME_SAFE_SIZE
  7899. nkwargs = PyTuple_Size(kwnames);
  7900. if (unlikely(nkwargs < 0)) return NULL;
  7901. #else
  7902. nkwargs = PyTuple_GET_SIZE(kwnames);
  7903. #endif
  7904. dict = PyDict_New();
  7905. if (unlikely(!dict))
  7906. return NULL;
  7907. for (i=0; i<nkwargs; i++) {
  7908. #if !CYTHON_ASSUME_SAFE_MACROS
  7909. PyObject *key = PyTuple_GetItem(kwnames, i);
  7910. if (!key) goto bad;
  7911. #else
  7912. PyObject *key = PyTuple_GET_ITEM(kwnames, i);
  7913. #endif
  7914. if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
  7915. goto bad;
  7916. }
  7917. return dict;
  7918. bad:
  7919. Py_DECREF(dict);
  7920. return NULL;
  7921. }
  7922. #endif
  7923. #endif
  7924. /* PyObjectCall (used by PyObjectFastCall) */
  7925. #if CYTHON_COMPILING_IN_CPYTHON
  7926. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  7927. PyObject *result;
  7928. ternaryfunc call = Py_TYPE(func)->tp_call;
  7929. if (unlikely(!call))
  7930. return PyObject_Call(func, arg, kw);
  7931. if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
  7932. return NULL;
  7933. result = (*call)(func, arg, kw);
  7934. Py_LeaveRecursiveCall();
  7935. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  7936. PyErr_SetString(
  7937. PyExc_SystemError,
  7938. "NULL result without error in PyObject_Call");
  7939. }
  7940. return result;
  7941. }
  7942. #endif
  7943. /* PyObjectCallMethO (used by PyObjectFastCall) */
  7944. #if CYTHON_COMPILING_IN_CPYTHON
  7945. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  7946. PyObject *self, *result;
  7947. PyCFunction cfunc;
  7948. cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
  7949. self = __Pyx_CyOrPyCFunction_GET_SELF(func);
  7950. if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
  7951. return NULL;
  7952. result = cfunc(self, arg);
  7953. Py_LeaveRecursiveCall();
  7954. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  7955. PyErr_SetString(
  7956. PyExc_SystemError,
  7957. "NULL result without error in PyObject_Call");
  7958. }
  7959. return result;
  7960. }
  7961. #endif
  7962. /* PyObjectFastCall (used by PyObjectCallOneArg) */
  7963. #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
  7964. static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject * const*args, size_t nargs, PyObject *kwargs) {
  7965. PyObject *argstuple;
  7966. PyObject *result = 0;
  7967. size_t i;
  7968. argstuple = PyTuple_New((Py_ssize_t)nargs);
  7969. if (unlikely(!argstuple)) return NULL;
  7970. for (i = 0; i < nargs; i++) {
  7971. Py_INCREF(args[i]);
  7972. if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) != (0)) goto bad;
  7973. }
  7974. result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  7975. bad:
  7976. Py_DECREF(argstuple);
  7977. return result;
  7978. }
  7979. #endif
  7980. #if CYTHON_VECTORCALL && !CYTHON_COMPILING_IN_LIMITED_API
  7981. #if PY_VERSION_HEX < 0x03090000
  7982. #define __Pyx_PyVectorcall_Function(callable) _PyVectorcall_Function(callable)
  7983. #elif CYTHON_COMPILING_IN_CPYTHON
  7984. static CYTHON_INLINE vectorcallfunc __Pyx_PyVectorcall_Function(PyObject *callable) {
  7985. PyTypeObject *tp = Py_TYPE(callable);
  7986. #if defined(__Pyx_CyFunction_USED)
  7987. if (__Pyx_CyFunction_CheckExact(callable)) {
  7988. return __Pyx_CyFunction_func_vectorcall(callable);
  7989. }
  7990. #endif
  7991. if (!PyType_HasFeature(tp, Py_TPFLAGS_HAVE_VECTORCALL)) {
  7992. return NULL;
  7993. }
  7994. assert(PyCallable_Check(callable));
  7995. Py_ssize_t offset = tp->tp_vectorcall_offset;
  7996. assert(offset > 0);
  7997. vectorcallfunc ptr;
  7998. memcpy(&ptr, (char *) callable + offset, sizeof(ptr));
  7999. return ptr;
  8000. }
  8001. #else
  8002. #define __Pyx_PyVectorcall_Function(callable) PyVectorcall_Function(callable)
  8003. #endif
  8004. #endif
  8005. static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject *const *args, size_t _nargs, PyObject *kwargs) {
  8006. Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
  8007. #if CYTHON_COMPILING_IN_CPYTHON
  8008. if (nargs == 0 && kwargs == NULL) {
  8009. if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
  8010. return __Pyx_PyObject_CallMethO(func, NULL);
  8011. }
  8012. else if (nargs == 1 && kwargs == NULL) {
  8013. if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
  8014. return __Pyx_PyObject_CallMethO(func, args[0]);
  8015. }
  8016. #endif
  8017. if (kwargs == NULL) {
  8018. #if CYTHON_VECTORCALL
  8019. #if CYTHON_COMPILING_IN_LIMITED_API
  8020. return PyObject_Vectorcall(func, args, _nargs, NULL);
  8021. #else
  8022. vectorcallfunc f = __Pyx_PyVectorcall_Function(func);
  8023. if (f) {
  8024. return f(func, args, _nargs, NULL);
  8025. }
  8026. #endif
  8027. #endif
  8028. }
  8029. if (nargs == 0) {
  8030. return __Pyx_PyObject_Call(func, __pyx_mstate_global->__pyx_empty_tuple, kwargs);
  8031. }
  8032. #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
  8033. return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
  8034. #else
  8035. return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
  8036. #endif
  8037. }
  8038. /* PyObjectCallOneArg (used by CallUnboundCMethod0) */
  8039. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  8040. PyObject *args[2] = {NULL, arg};
  8041. return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
  8042. }
  8043. /* PyObjectGetAttrStr (used by UnpackUnboundCMethod) */
  8044. #if CYTHON_USE_TYPE_SLOTS
  8045. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  8046. PyTypeObject* tp = Py_TYPE(obj);
  8047. if (likely(tp->tp_getattro))
  8048. return tp->tp_getattro(obj, attr_name);
  8049. return PyObject_GetAttr(obj, attr_name);
  8050. }
  8051. #endif
  8052. /* UnpackUnboundCMethod (used by CallUnboundCMethod0) */
  8053. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
  8054. static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *args, PyObject *kwargs) {
  8055. PyObject *result;
  8056. PyObject *selfless_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
  8057. if (unlikely(!selfless_args)) return NULL;
  8058. result = PyObject_Call(method, selfless_args, kwargs);
  8059. Py_DECREF(selfless_args);
  8060. return result;
  8061. }
  8062. #elif CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03090000
  8063. static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject **args, Py_ssize_t nargs, PyObject *kwnames) {
  8064. return _PyObject_Vectorcall
  8065. (method, args ? args+1 : NULL, nargs ? nargs-1 : 0, kwnames);
  8066. }
  8067. #else
  8068. static PyObject *__Pyx_SelflessCall(PyObject *method, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames) {
  8069. return
  8070. #if PY_VERSION_HEX < 0x03090000
  8071. _PyObject_Vectorcall
  8072. #else
  8073. PyObject_Vectorcall
  8074. #endif
  8075. (method, args ? args+1 : NULL, nargs ? (size_t) nargs-1 : 0, kwnames);
  8076. }
  8077. #endif
  8078. static PyMethodDef __Pyx_UnboundCMethod_Def = {
  8079. "CythonUnboundCMethod",
  8080. __PYX_REINTERPRET_FUNCION(PyCFunction, __Pyx_SelflessCall),
  8081. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030C0000
  8082. METH_VARARGS | METH_KEYWORDS,
  8083. #else
  8084. METH_FASTCALL | METH_KEYWORDS,
  8085. #endif
  8086. NULL
  8087. };
  8088. static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
  8089. PyObject *method, *result=NULL;
  8090. method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
  8091. if (unlikely(!method))
  8092. return -1;
  8093. result = method;
  8094. #if CYTHON_COMPILING_IN_CPYTHON
  8095. if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
  8096. {
  8097. PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
  8098. target->func = descr->d_method->ml_meth;
  8099. target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
  8100. } else
  8101. #endif
  8102. #if CYTHON_COMPILING_IN_PYPY
  8103. #else
  8104. if (PyCFunction_Check(method))
  8105. #endif
  8106. {
  8107. PyObject *self;
  8108. int self_found;
  8109. #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
  8110. self = PyObject_GetAttrString(method, "__self__");
  8111. if (!self) {
  8112. PyErr_Clear();
  8113. }
  8114. #else
  8115. self = PyCFunction_GET_SELF(method);
  8116. #endif
  8117. self_found = (self && self != Py_None);
  8118. #if CYTHON_COMPILING_IN_LIMITED_API || CYTHON_COMPILING_IN_PYPY
  8119. Py_XDECREF(self);
  8120. #endif
  8121. if (self_found) {
  8122. PyObject *unbound_method = PyCFunction_New(&__Pyx_UnboundCMethod_Def, method);
  8123. if (unlikely(!unbound_method)) return -1;
  8124. Py_DECREF(method);
  8125. result = unbound_method;
  8126. }
  8127. }
  8128. #if !CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  8129. if (unlikely(target->method)) {
  8130. Py_DECREF(result);
  8131. } else
  8132. #endif
  8133. target->method = result;
  8134. return 0;
  8135. }
  8136. /* CallUnboundCMethod0 */
  8137. #if CYTHON_COMPILING_IN_CPYTHON
  8138. static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
  8139. int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
  8140. if (likely(was_initialized == 2 && cfunc->func)) {
  8141. if (likely(cfunc->flag == METH_NOARGS))
  8142. return __Pyx_CallCFunction(cfunc, self, NULL);
  8143. if (likely(cfunc->flag == METH_FASTCALL))
  8144. return __Pyx_CallCFunctionFast(cfunc, self, NULL, 0);
  8145. if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
  8146. return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, NULL, 0, NULL);
  8147. if (likely(cfunc->flag == (METH_VARARGS | METH_KEYWORDS)))
  8148. return __Pyx_CallCFunctionWithKeywords(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple, NULL);
  8149. if (cfunc->flag == METH_VARARGS)
  8150. return __Pyx_CallCFunction(cfunc, self, __pyx_mstate_global->__pyx_empty_tuple);
  8151. return __Pyx__CallUnboundCMethod0(cfunc, self);
  8152. }
  8153. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  8154. else if (unlikely(was_initialized == 1)) {
  8155. __Pyx_CachedCFunction tmp_cfunc = {
  8156. #ifndef __cplusplus
  8157. 0
  8158. #endif
  8159. };
  8160. tmp_cfunc.type = cfunc->type;
  8161. tmp_cfunc.method_name = cfunc->method_name;
  8162. return __Pyx__CallUnboundCMethod0(&tmp_cfunc, self);
  8163. }
  8164. #endif
  8165. PyObject *result = __Pyx__CallUnboundCMethod0(cfunc, self);
  8166. __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
  8167. return result;
  8168. }
  8169. #endif
  8170. static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
  8171. PyObject *result;
  8172. if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
  8173. result = __Pyx_PyObject_CallOneArg(cfunc->method, self);
  8174. return result;
  8175. }
  8176. /* py_dict_items (used by OwnedDictNext) */
  8177. static CYTHON_INLINE PyObject* __Pyx_PyDict_Items(PyObject* d) {
  8178. return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_items, d);
  8179. }
  8180. /* py_dict_values (used by OwnedDictNext) */
  8181. static CYTHON_INLINE PyObject* __Pyx_PyDict_Values(PyObject* d) {
  8182. return __Pyx_CallUnboundCMethod0(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_values, d);
  8183. }
  8184. /* OwnedDictNext (used by ParseKeywordsImpl) */
  8185. #if CYTHON_AVOID_BORROWED_REFS
  8186. static int __Pyx_PyDict_NextRef(PyObject *p, PyObject **ppos, PyObject **pkey, PyObject **pvalue) {
  8187. PyObject *next = NULL;
  8188. if (!*ppos) {
  8189. if (pvalue) {
  8190. PyObject *dictview = pkey ? __Pyx_PyDict_Items(p) : __Pyx_PyDict_Values(p);
  8191. if (unlikely(!dictview)) goto bad;
  8192. *ppos = PyObject_GetIter(dictview);
  8193. Py_DECREF(dictview);
  8194. } else {
  8195. *ppos = PyObject_GetIter(p);
  8196. }
  8197. if (unlikely(!*ppos)) goto bad;
  8198. }
  8199. next = PyIter_Next(*ppos);
  8200. if (!next) {
  8201. if (PyErr_Occurred()) goto bad;
  8202. return 0;
  8203. }
  8204. if (pkey && pvalue) {
  8205. *pkey = __Pyx_PySequence_ITEM(next, 0);
  8206. if (unlikely(*pkey)) goto bad;
  8207. *pvalue = __Pyx_PySequence_ITEM(next, 1);
  8208. if (unlikely(*pvalue)) goto bad;
  8209. Py_DECREF(next);
  8210. } else if (pkey) {
  8211. *pkey = next;
  8212. } else {
  8213. assert(pvalue);
  8214. *pvalue = next;
  8215. }
  8216. return 1;
  8217. bad:
  8218. Py_XDECREF(next);
  8219. #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
  8220. PyErr_FormatUnraisable("Exception ignored in __Pyx_PyDict_NextRef");
  8221. #else
  8222. PyErr_WriteUnraisable(__pyx_mstate_global->__pyx_n_u_Pyx_PyDict_NextRef);
  8223. #endif
  8224. if (pkey) *pkey = NULL;
  8225. if (pvalue) *pvalue = NULL;
  8226. return 0;
  8227. }
  8228. #else // !CYTHON_AVOID_BORROWED_REFS
  8229. static int __Pyx_PyDict_NextRef(PyObject *p, Py_ssize_t *ppos, PyObject **pkey, PyObject **pvalue) {
  8230. int result = PyDict_Next(p, ppos, pkey, pvalue);
  8231. if (likely(result == 1)) {
  8232. if (pkey) Py_INCREF(*pkey);
  8233. if (pvalue) Py_INCREF(*pvalue);
  8234. }
  8235. return result;
  8236. }
  8237. #endif
  8238. /* RaiseDoubleKeywords (used by ParseKeywordsImpl) */
  8239. static void __Pyx_RaiseDoubleKeywordsError(
  8240. const char* func_name,
  8241. PyObject* kw_name)
  8242. {
  8243. PyErr_Format(PyExc_TypeError,
  8244. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  8245. }
  8246. /* CallUnboundCMethod2 */
  8247. #if CYTHON_COMPILING_IN_CPYTHON
  8248. static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
  8249. int was_initialized = __Pyx_CachedCFunction_GetAndSetInitializing(cfunc);
  8250. if (likely(was_initialized == 2 && cfunc->func)) {
  8251. PyObject *args[2] = {arg1, arg2};
  8252. if (cfunc->flag == METH_FASTCALL) {
  8253. return __Pyx_CallCFunctionFast(cfunc, self, args, 2);
  8254. }
  8255. if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
  8256. return __Pyx_CallCFunctionFastWithKeywords(cfunc, self, args, 2, NULL);
  8257. }
  8258. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  8259. else if (unlikely(was_initialized == 1)) {
  8260. __Pyx_CachedCFunction tmp_cfunc = {
  8261. #ifndef __cplusplus
  8262. 0
  8263. #endif
  8264. };
  8265. tmp_cfunc.type = cfunc->type;
  8266. tmp_cfunc.method_name = cfunc->method_name;
  8267. return __Pyx__CallUnboundCMethod2(&tmp_cfunc, self, arg1, arg2);
  8268. }
  8269. #endif
  8270. PyObject *result = __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
  8271. __Pyx_CachedCFunction_SetFinishedInitializing(cfunc);
  8272. return result;
  8273. }
  8274. #endif
  8275. static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
  8276. if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
  8277. #if CYTHON_COMPILING_IN_CPYTHON
  8278. if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
  8279. PyObject *result = NULL;
  8280. PyObject *args = PyTuple_New(2);
  8281. if (unlikely(!args)) return NULL;
  8282. Py_INCREF(arg1);
  8283. PyTuple_SET_ITEM(args, 0, arg1);
  8284. Py_INCREF(arg2);
  8285. PyTuple_SET_ITEM(args, 1, arg2);
  8286. if (cfunc->flag & METH_KEYWORDS)
  8287. result = __Pyx_CallCFunctionWithKeywords(cfunc, self, args, NULL);
  8288. else
  8289. result = __Pyx_CallCFunction(cfunc, self, args);
  8290. Py_DECREF(args);
  8291. return result;
  8292. }
  8293. #endif
  8294. {
  8295. PyObject *args[4] = {NULL, self, arg1, arg2};
  8296. return __Pyx_PyObject_FastCall(cfunc->method, args+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
  8297. }
  8298. }
  8299. /* ParseKeywordsImpl (used by ParseKeywords) */
  8300. static int __Pyx_ValidateDuplicatePosArgs(
  8301. PyObject *kwds,
  8302. PyObject ** const argnames[],
  8303. PyObject ** const *first_kw_arg,
  8304. const char* function_name)
  8305. {
  8306. PyObject ** const *name = argnames;
  8307. while (name != first_kw_arg) {
  8308. PyObject *key = **name;
  8309. int found = PyDict_Contains(kwds, key);
  8310. if (unlikely(found)) {
  8311. if (found == 1) __Pyx_RaiseDoubleKeywordsError(function_name, key);
  8312. goto bad;
  8313. }
  8314. name++;
  8315. }
  8316. return 0;
  8317. bad:
  8318. return -1;
  8319. }
  8320. #if CYTHON_USE_UNICODE_INTERNALS
  8321. static CYTHON_INLINE int __Pyx_UnicodeKeywordsEqual(PyObject *s1, PyObject *s2) {
  8322. int kind;
  8323. Py_ssize_t len = PyUnicode_GET_LENGTH(s1);
  8324. if (len != PyUnicode_GET_LENGTH(s2)) return 0;
  8325. kind = PyUnicode_KIND(s1);
  8326. if (kind != PyUnicode_KIND(s2)) return 0;
  8327. const void *data1 = PyUnicode_DATA(s1);
  8328. const void *data2 = PyUnicode_DATA(s2);
  8329. return (memcmp(data1, data2, (size_t) len * (size_t) kind) == 0);
  8330. }
  8331. #endif
  8332. static int __Pyx_MatchKeywordArg_str(
  8333. PyObject *key,
  8334. PyObject ** const argnames[],
  8335. PyObject ** const *first_kw_arg,
  8336. size_t *index_found,
  8337. const char *function_name)
  8338. {
  8339. PyObject ** const *name;
  8340. #if CYTHON_USE_UNICODE_INTERNALS
  8341. Py_hash_t key_hash = ((PyASCIIObject*)key)->hash;
  8342. if (unlikely(key_hash == -1)) {
  8343. key_hash = PyObject_Hash(key);
  8344. if (unlikely(key_hash == -1))
  8345. goto bad;
  8346. }
  8347. #endif
  8348. name = first_kw_arg;
  8349. while (*name) {
  8350. PyObject *name_str = **name;
  8351. #if CYTHON_USE_UNICODE_INTERNALS
  8352. if (key_hash == ((PyASCIIObject*)name_str)->hash && __Pyx_UnicodeKeywordsEqual(name_str, key)) {
  8353. *index_found = (size_t) (name - argnames);
  8354. return 1;
  8355. }
  8356. #else
  8357. #if CYTHON_ASSUME_SAFE_SIZE
  8358. if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
  8359. #endif
  8360. {
  8361. int cmp = PyUnicode_Compare(name_str, key);
  8362. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  8363. if (cmp == 0) {
  8364. *index_found = (size_t) (name - argnames);
  8365. return 1;
  8366. }
  8367. }
  8368. #endif
  8369. name++;
  8370. }
  8371. name = argnames;
  8372. while (name != first_kw_arg) {
  8373. PyObject *name_str = **name;
  8374. #if CYTHON_USE_UNICODE_INTERNALS
  8375. if (unlikely(key_hash == ((PyASCIIObject*)name_str)->hash)) {
  8376. if (__Pyx_UnicodeKeywordsEqual(name_str, key))
  8377. goto arg_passed_twice;
  8378. }
  8379. #else
  8380. #if CYTHON_ASSUME_SAFE_SIZE
  8381. if (PyUnicode_GET_LENGTH(name_str) == PyUnicode_GET_LENGTH(key))
  8382. #endif
  8383. {
  8384. if (unlikely(name_str == key)) goto arg_passed_twice;
  8385. int cmp = PyUnicode_Compare(name_str, key);
  8386. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  8387. if (cmp == 0) goto arg_passed_twice;
  8388. }
  8389. #endif
  8390. name++;
  8391. }
  8392. return 0;
  8393. arg_passed_twice:
  8394. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  8395. goto bad;
  8396. bad:
  8397. return -1;
  8398. }
  8399. static int __Pyx_MatchKeywordArg_nostr(
  8400. PyObject *key,
  8401. PyObject ** const argnames[],
  8402. PyObject ** const *first_kw_arg,
  8403. size_t *index_found,
  8404. const char *function_name)
  8405. {
  8406. PyObject ** const *name;
  8407. if (unlikely(!PyUnicode_Check(key))) goto invalid_keyword_type;
  8408. name = first_kw_arg;
  8409. while (*name) {
  8410. int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
  8411. if (cmp == 1) {
  8412. *index_found = (size_t) (name - argnames);
  8413. return 1;
  8414. }
  8415. if (unlikely(cmp == -1)) goto bad;
  8416. name++;
  8417. }
  8418. name = argnames;
  8419. while (name != first_kw_arg) {
  8420. int cmp = PyObject_RichCompareBool(**name, key, Py_EQ);
  8421. if (unlikely(cmp != 0)) {
  8422. if (cmp == 1) goto arg_passed_twice;
  8423. else goto bad;
  8424. }
  8425. name++;
  8426. }
  8427. return 0;
  8428. arg_passed_twice:
  8429. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  8430. goto bad;
  8431. invalid_keyword_type:
  8432. PyErr_Format(PyExc_TypeError,
  8433. "%.200s() keywords must be strings", function_name);
  8434. goto bad;
  8435. bad:
  8436. return -1;
  8437. }
  8438. static CYTHON_INLINE int __Pyx_MatchKeywordArg(
  8439. PyObject *key,
  8440. PyObject ** const argnames[],
  8441. PyObject ** const *first_kw_arg,
  8442. size_t *index_found,
  8443. const char *function_name)
  8444. {
  8445. return likely(PyUnicode_CheckExact(key)) ?
  8446. __Pyx_MatchKeywordArg_str(key, argnames, first_kw_arg, index_found, function_name) :
  8447. __Pyx_MatchKeywordArg_nostr(key, argnames, first_kw_arg, index_found, function_name);
  8448. }
  8449. static void __Pyx_RejectUnknownKeyword(
  8450. PyObject *kwds,
  8451. PyObject ** const argnames[],
  8452. PyObject ** const *first_kw_arg,
  8453. const char *function_name)
  8454. {
  8455. #if CYTHON_AVOID_BORROWED_REFS
  8456. PyObject *pos = NULL;
  8457. #else
  8458. Py_ssize_t pos = 0;
  8459. #endif
  8460. PyObject *key = NULL;
  8461. __Pyx_BEGIN_CRITICAL_SECTION(kwds);
  8462. while (
  8463. #if CYTHON_AVOID_BORROWED_REFS
  8464. __Pyx_PyDict_NextRef(kwds, &pos, &key, NULL)
  8465. #else
  8466. PyDict_Next(kwds, &pos, &key, NULL)
  8467. #endif
  8468. ) {
  8469. PyObject** const *name = first_kw_arg;
  8470. while (*name && (**name != key)) name++;
  8471. if (!*name) {
  8472. size_t index_found = 0;
  8473. int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
  8474. if (cmp != 1) {
  8475. if (cmp == 0) {
  8476. PyErr_Format(PyExc_TypeError,
  8477. "%s() got an unexpected keyword argument '%U'",
  8478. function_name, key);
  8479. }
  8480. #if CYTHON_AVOID_BORROWED_REFS
  8481. Py_DECREF(key);
  8482. #endif
  8483. break;
  8484. }
  8485. }
  8486. #if CYTHON_AVOID_BORROWED_REFS
  8487. Py_DECREF(key);
  8488. #endif
  8489. }
  8490. __Pyx_END_CRITICAL_SECTION();
  8491. #if CYTHON_AVOID_BORROWED_REFS
  8492. Py_XDECREF(pos);
  8493. #endif
  8494. assert(PyErr_Occurred());
  8495. }
  8496. static int __Pyx_ParseKeywordDict(
  8497. PyObject *kwds,
  8498. PyObject ** const argnames[],
  8499. PyObject *values[],
  8500. Py_ssize_t num_pos_args,
  8501. Py_ssize_t num_kwargs,
  8502. const char* function_name,
  8503. int ignore_unknown_kwargs)
  8504. {
  8505. PyObject** const *name;
  8506. PyObject** const *first_kw_arg = argnames + num_pos_args;
  8507. Py_ssize_t extracted = 0;
  8508. #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
  8509. if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
  8510. #endif
  8511. name = first_kw_arg;
  8512. while (*name && num_kwargs > extracted) {
  8513. PyObject * key = **name;
  8514. PyObject *value;
  8515. int found = 0;
  8516. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  8517. found = PyDict_GetItemRef(kwds, key, &value);
  8518. #else
  8519. value = PyDict_GetItemWithError(kwds, key);
  8520. if (value) {
  8521. Py_INCREF(value);
  8522. found = 1;
  8523. } else {
  8524. if (unlikely(PyErr_Occurred())) goto bad;
  8525. }
  8526. #endif
  8527. if (found) {
  8528. if (unlikely(found < 0)) goto bad;
  8529. values[name-argnames] = value;
  8530. extracted++;
  8531. }
  8532. name++;
  8533. }
  8534. if (num_kwargs > extracted) {
  8535. if (ignore_unknown_kwargs) {
  8536. if (unlikely(__Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name) == -1))
  8537. goto bad;
  8538. } else {
  8539. __Pyx_RejectUnknownKeyword(kwds, argnames, first_kw_arg, function_name);
  8540. goto bad;
  8541. }
  8542. }
  8543. return 0;
  8544. bad:
  8545. return -1;
  8546. }
  8547. static int __Pyx_ParseKeywordDictToDict(
  8548. PyObject *kwds,
  8549. PyObject ** const argnames[],
  8550. PyObject *kwds2,
  8551. PyObject *values[],
  8552. Py_ssize_t num_pos_args,
  8553. const char* function_name)
  8554. {
  8555. PyObject** const *name;
  8556. PyObject** const *first_kw_arg = argnames + num_pos_args;
  8557. Py_ssize_t len;
  8558. #if !CYTHON_COMPILING_IN_PYPY || defined(PyArg_ValidateKeywordArguments)
  8559. if (unlikely(!PyArg_ValidateKeywordArguments(kwds))) return -1;
  8560. #endif
  8561. if (PyDict_Update(kwds2, kwds) < 0) goto bad;
  8562. name = first_kw_arg;
  8563. while (*name) {
  8564. PyObject *key = **name;
  8565. PyObject *value;
  8566. #if !CYTHON_COMPILING_IN_LIMITED_API && (PY_VERSION_HEX >= 0x030d00A2 || defined(PyDict_Pop))
  8567. int found = PyDict_Pop(kwds2, key, &value);
  8568. if (found) {
  8569. if (unlikely(found < 0)) goto bad;
  8570. values[name-argnames] = value;
  8571. }
  8572. #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  8573. int found = PyDict_GetItemRef(kwds2, key, &value);
  8574. if (found) {
  8575. if (unlikely(found < 0)) goto bad;
  8576. values[name-argnames] = value;
  8577. if (unlikely(PyDict_DelItem(kwds2, key) < 0)) goto bad;
  8578. }
  8579. #else
  8580. #if CYTHON_COMPILING_IN_CPYTHON
  8581. value = _PyDict_Pop(kwds2, key, kwds2);
  8582. #else
  8583. value = __Pyx_CallUnboundCMethod2(&__pyx_mstate_global->__pyx_umethod_PyDict_Type_pop, kwds2, key, kwds2);
  8584. #endif
  8585. if (value == kwds2) {
  8586. Py_DECREF(value);
  8587. } else {
  8588. if (unlikely(!value)) goto bad;
  8589. values[name-argnames] = value;
  8590. }
  8591. #endif
  8592. name++;
  8593. }
  8594. len = PyDict_Size(kwds2);
  8595. if (len > 0) {
  8596. return __Pyx_ValidateDuplicatePosArgs(kwds, argnames, first_kw_arg, function_name);
  8597. } else if (unlikely(len == -1)) {
  8598. goto bad;
  8599. }
  8600. return 0;
  8601. bad:
  8602. return -1;
  8603. }
  8604. static int __Pyx_ParseKeywordsTuple(
  8605. PyObject *kwds,
  8606. PyObject * const *kwvalues,
  8607. PyObject ** const argnames[],
  8608. PyObject *kwds2,
  8609. PyObject *values[],
  8610. Py_ssize_t num_pos_args,
  8611. Py_ssize_t num_kwargs,
  8612. const char* function_name,
  8613. int ignore_unknown_kwargs)
  8614. {
  8615. PyObject *key = NULL;
  8616. PyObject** const * name;
  8617. PyObject** const *first_kw_arg = argnames + num_pos_args;
  8618. for (Py_ssize_t pos = 0; pos < num_kwargs; pos++) {
  8619. #if CYTHON_AVOID_BORROWED_REFS
  8620. key = __Pyx_PySequence_ITEM(kwds, pos);
  8621. #else
  8622. key = __Pyx_PyTuple_GET_ITEM(kwds, pos);
  8623. #endif
  8624. #if !CYTHON_ASSUME_SAFE_MACROS
  8625. if (unlikely(!key)) goto bad;
  8626. #endif
  8627. name = first_kw_arg;
  8628. while (*name && (**name != key)) name++;
  8629. if (*name) {
  8630. PyObject *value = kwvalues[pos];
  8631. values[name-argnames] = __Pyx_NewRef(value);
  8632. } else {
  8633. size_t index_found = 0;
  8634. int cmp = __Pyx_MatchKeywordArg(key, argnames, first_kw_arg, &index_found, function_name);
  8635. if (cmp == 1) {
  8636. PyObject *value = kwvalues[pos];
  8637. values[index_found] = __Pyx_NewRef(value);
  8638. } else {
  8639. if (unlikely(cmp == -1)) goto bad;
  8640. if (kwds2) {
  8641. PyObject *value = kwvalues[pos];
  8642. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  8643. } else if (!ignore_unknown_kwargs) {
  8644. goto invalid_keyword;
  8645. }
  8646. }
  8647. }
  8648. #if CYTHON_AVOID_BORROWED_REFS
  8649. Py_DECREF(key);
  8650. key = NULL;
  8651. #endif
  8652. }
  8653. return 0;
  8654. invalid_keyword:
  8655. PyErr_Format(PyExc_TypeError,
  8656. "%s() got an unexpected keyword argument '%U'",
  8657. function_name, key);
  8658. goto bad;
  8659. bad:
  8660. #if CYTHON_AVOID_BORROWED_REFS
  8661. Py_XDECREF(key);
  8662. #endif
  8663. return -1;
  8664. }
  8665. /* ParseKeywords */
  8666. static int __Pyx_ParseKeywords(
  8667. PyObject *kwds,
  8668. PyObject * const *kwvalues,
  8669. PyObject ** const argnames[],
  8670. PyObject *kwds2,
  8671. PyObject *values[],
  8672. Py_ssize_t num_pos_args,
  8673. Py_ssize_t num_kwargs,
  8674. const char* function_name,
  8675. int ignore_unknown_kwargs)
  8676. {
  8677. if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds)))
  8678. return __Pyx_ParseKeywordsTuple(kwds, kwvalues, argnames, kwds2, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
  8679. else if (kwds2)
  8680. return __Pyx_ParseKeywordDictToDict(kwds, argnames, kwds2, values, num_pos_args, function_name);
  8681. else
  8682. return __Pyx_ParseKeywordDict(kwds, argnames, values, num_pos_args, num_kwargs, function_name, ignore_unknown_kwargs);
  8683. }
  8684. /* RaiseArgTupleInvalid */
  8685. static void __Pyx_RaiseArgtupleInvalid(
  8686. const char* func_name,
  8687. int exact,
  8688. Py_ssize_t num_min,
  8689. Py_ssize_t num_max,
  8690. Py_ssize_t num_found)
  8691. {
  8692. Py_ssize_t num_expected;
  8693. const char *more_or_less;
  8694. if (num_found < num_min) {
  8695. num_expected = num_min;
  8696. more_or_less = "at least";
  8697. } else {
  8698. num_expected = num_max;
  8699. more_or_less = "at most";
  8700. }
  8701. if (exact) {
  8702. more_or_less = "exactly";
  8703. }
  8704. PyErr_Format(PyExc_TypeError,
  8705. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  8706. func_name, more_or_less, num_expected,
  8707. (num_expected == 1) ? "" : "s", num_found);
  8708. }
  8709. /* PyErrExceptionMatches (used by PyObjectGetAttrStrNoError) */
  8710. #if CYTHON_FAST_THREAD_STATE
  8711. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  8712. Py_ssize_t i, n;
  8713. n = PyTuple_GET_SIZE(tuple);
  8714. for (i=0; i<n; i++) {
  8715. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  8716. }
  8717. for (i=0; i<n; i++) {
  8718. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  8719. }
  8720. return 0;
  8721. }
  8722. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  8723. int result;
  8724. PyObject *exc_type;
  8725. #if PY_VERSION_HEX >= 0x030C00A6
  8726. PyObject *current_exception = tstate->current_exception;
  8727. if (unlikely(!current_exception)) return 0;
  8728. exc_type = (PyObject*) Py_TYPE(current_exception);
  8729. if (exc_type == err) return 1;
  8730. #else
  8731. exc_type = tstate->curexc_type;
  8732. if (exc_type == err) return 1;
  8733. if (unlikely(!exc_type)) return 0;
  8734. #endif
  8735. #if CYTHON_AVOID_BORROWED_REFS
  8736. Py_INCREF(exc_type);
  8737. #endif
  8738. if (unlikely(PyTuple_Check(err))) {
  8739. result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  8740. } else {
  8741. result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  8742. }
  8743. #if CYTHON_AVOID_BORROWED_REFS
  8744. Py_DECREF(exc_type);
  8745. #endif
  8746. return result;
  8747. }
  8748. #endif
  8749. /* PyErrFetchRestore (used by PyObjectGetAttrStrNoError) */
  8750. #if CYTHON_FAST_THREAD_STATE
  8751. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  8752. #if PY_VERSION_HEX >= 0x030C00A6
  8753. PyObject *tmp_value;
  8754. assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
  8755. if (value) {
  8756. #if CYTHON_COMPILING_IN_CPYTHON
  8757. if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
  8758. #endif
  8759. PyException_SetTraceback(value, tb);
  8760. }
  8761. tmp_value = tstate->current_exception;
  8762. tstate->current_exception = value;
  8763. Py_XDECREF(tmp_value);
  8764. Py_XDECREF(type);
  8765. Py_XDECREF(tb);
  8766. #else
  8767. PyObject *tmp_type, *tmp_value, *tmp_tb;
  8768. tmp_type = tstate->curexc_type;
  8769. tmp_value = tstate->curexc_value;
  8770. tmp_tb = tstate->curexc_traceback;
  8771. tstate->curexc_type = type;
  8772. tstate->curexc_value = value;
  8773. tstate->curexc_traceback = tb;
  8774. Py_XDECREF(tmp_type);
  8775. Py_XDECREF(tmp_value);
  8776. Py_XDECREF(tmp_tb);
  8777. #endif
  8778. }
  8779. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  8780. #if PY_VERSION_HEX >= 0x030C00A6
  8781. PyObject* exc_value;
  8782. exc_value = tstate->current_exception;
  8783. tstate->current_exception = 0;
  8784. *value = exc_value;
  8785. *type = NULL;
  8786. *tb = NULL;
  8787. if (exc_value) {
  8788. *type = (PyObject*) Py_TYPE(exc_value);
  8789. Py_INCREF(*type);
  8790. #if CYTHON_COMPILING_IN_CPYTHON
  8791. *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
  8792. Py_XINCREF(*tb);
  8793. #else
  8794. *tb = PyException_GetTraceback(exc_value);
  8795. #endif
  8796. }
  8797. #else
  8798. *type = tstate->curexc_type;
  8799. *value = tstate->curexc_value;
  8800. *tb = tstate->curexc_traceback;
  8801. tstate->curexc_type = 0;
  8802. tstate->curexc_value = 0;
  8803. tstate->curexc_traceback = 0;
  8804. #endif
  8805. }
  8806. #endif
  8807. /* PyObjectGetAttrStrNoError (used by GetBuiltinName) */
  8808. #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
  8809. static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
  8810. __Pyx_PyThreadState_declare
  8811. __Pyx_PyThreadState_assign
  8812. if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
  8813. __Pyx_PyErr_Clear();
  8814. }
  8815. #endif
  8816. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
  8817. PyObject *result;
  8818. #if __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  8819. (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
  8820. return result;
  8821. #else
  8822. #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS
  8823. PyTypeObject* tp = Py_TYPE(obj);
  8824. if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
  8825. return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
  8826. }
  8827. #endif
  8828. result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
  8829. if (unlikely(!result)) {
  8830. __Pyx_PyObject_GetAttrStr_ClearAttributeError();
  8831. }
  8832. return result;
  8833. #endif
  8834. }
  8835. /* GetBuiltinName (used by GetModuleGlobalName) */
  8836. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  8837. PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_mstate_global->__pyx_b, name);
  8838. if (unlikely(!result) && !PyErr_Occurred()) {
  8839. PyErr_Format(PyExc_NameError,
  8840. "name '%U' is not defined", name);
  8841. }
  8842. return result;
  8843. }
  8844. /* PyDictVersioning (used by GetModuleGlobalName) */
  8845. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  8846. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  8847. PyObject *dict = Py_TYPE(obj)->tp_dict;
  8848. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  8849. }
  8850. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  8851. PyObject **dictptr = NULL;
  8852. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  8853. if (offset) {
  8854. #if CYTHON_COMPILING_IN_CPYTHON
  8855. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  8856. #else
  8857. dictptr = _PyObject_GetDictPtr(obj);
  8858. #endif
  8859. }
  8860. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  8861. }
  8862. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  8863. PyObject *dict = Py_TYPE(obj)->tp_dict;
  8864. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  8865. return 0;
  8866. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  8867. }
  8868. #endif
  8869. /* GetModuleGlobalName */
  8870. #if CYTHON_USE_DICT_VERSIONS
  8871. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  8872. #else
  8873. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  8874. #endif
  8875. {
  8876. PyObject *result;
  8877. #if CYTHON_COMPILING_IN_LIMITED_API
  8878. if (unlikely(!__pyx_m)) {
  8879. if (!PyErr_Occurred())
  8880. PyErr_SetNone(PyExc_NameError);
  8881. return NULL;
  8882. }
  8883. result = PyObject_GetAttr(__pyx_m, name);
  8884. if (likely(result)) {
  8885. return result;
  8886. }
  8887. PyErr_Clear();
  8888. #elif CYTHON_AVOID_BORROWED_REFS || CYTHON_AVOID_THREAD_UNSAFE_BORROWED_REFS
  8889. if (unlikely(__Pyx_PyDict_GetItemRef(__pyx_mstate_global->__pyx_d, name, &result) == -1)) PyErr_Clear();
  8890. __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
  8891. if (likely(result)) {
  8892. return result;
  8893. }
  8894. #else
  8895. result = _PyDict_GetItem_KnownHash(__pyx_mstate_global->__pyx_d, name, ((PyASCIIObject *) name)->hash);
  8896. __PYX_UPDATE_DICT_CACHE(__pyx_mstate_global->__pyx_d, result, *dict_cached_value, *dict_version)
  8897. if (likely(result)) {
  8898. return __Pyx_NewRef(result);
  8899. }
  8900. PyErr_Clear();
  8901. #endif
  8902. return __Pyx_GetBuiltinName(name);
  8903. }
  8904. /* PyObjectSetAttrStr */
  8905. #if CYTHON_USE_TYPE_SLOTS
  8906. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  8907. PyTypeObject* tp = Py_TYPE(obj);
  8908. if (likely(tp->tp_setattro))
  8909. return tp->tp_setattro(obj, attr_name, value);
  8910. return PyObject_SetAttr(obj, attr_name, value);
  8911. }
  8912. #endif
  8913. /* PyObjectFastCallMethod */
  8914. #if !CYTHON_VECTORCALL || PY_VERSION_HEX < 0x03090000
  8915. static PyObject *__Pyx_PyObject_FastCallMethod(PyObject *name, PyObject *const *args, size_t nargsf) {
  8916. PyObject *result;
  8917. PyObject *attr = PyObject_GetAttr(args[0], name);
  8918. if (unlikely(!attr))
  8919. return NULL;
  8920. result = __Pyx_PyObject_FastCall(attr, args+1, nargsf - 1);
  8921. Py_DECREF(attr);
  8922. return result;
  8923. }
  8924. #endif
  8925. /* RaiseException */
  8926. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  8927. PyObject* owned_instance = NULL;
  8928. if (tb == Py_None) {
  8929. tb = 0;
  8930. } else if (tb && !PyTraceBack_Check(tb)) {
  8931. PyErr_SetString(PyExc_TypeError,
  8932. "raise: arg 3 must be a traceback or None");
  8933. goto bad;
  8934. }
  8935. if (value == Py_None)
  8936. value = 0;
  8937. if (PyExceptionInstance_Check(type)) {
  8938. if (value) {
  8939. PyErr_SetString(PyExc_TypeError,
  8940. "instance exception may not have a separate value");
  8941. goto bad;
  8942. }
  8943. value = type;
  8944. type = (PyObject*) Py_TYPE(value);
  8945. } else if (PyExceptionClass_Check(type)) {
  8946. PyObject *instance_class = NULL;
  8947. if (value && PyExceptionInstance_Check(value)) {
  8948. instance_class = (PyObject*) Py_TYPE(value);
  8949. if (instance_class != type) {
  8950. int is_subclass = PyObject_IsSubclass(instance_class, type);
  8951. if (!is_subclass) {
  8952. instance_class = NULL;
  8953. } else if (unlikely(is_subclass == -1)) {
  8954. goto bad;
  8955. } else {
  8956. type = instance_class;
  8957. }
  8958. }
  8959. }
  8960. if (!instance_class) {
  8961. PyObject *args;
  8962. if (!value)
  8963. args = PyTuple_New(0);
  8964. else if (PyTuple_Check(value)) {
  8965. Py_INCREF(value);
  8966. args = value;
  8967. } else
  8968. args = PyTuple_Pack(1, value);
  8969. if (!args)
  8970. goto bad;
  8971. owned_instance = PyObject_Call(type, args, NULL);
  8972. Py_DECREF(args);
  8973. if (!owned_instance)
  8974. goto bad;
  8975. value = owned_instance;
  8976. if (!PyExceptionInstance_Check(value)) {
  8977. PyErr_Format(PyExc_TypeError,
  8978. "calling %R should have returned an instance of "
  8979. "BaseException, not %R",
  8980. type, Py_TYPE(value));
  8981. goto bad;
  8982. }
  8983. }
  8984. } else {
  8985. PyErr_SetString(PyExc_TypeError,
  8986. "raise: exception class must be a subclass of BaseException");
  8987. goto bad;
  8988. }
  8989. if (cause) {
  8990. PyObject *fixed_cause;
  8991. if (cause == Py_None) {
  8992. fixed_cause = NULL;
  8993. } else if (PyExceptionClass_Check(cause)) {
  8994. fixed_cause = PyObject_CallObject(cause, NULL);
  8995. if (fixed_cause == NULL)
  8996. goto bad;
  8997. } else if (PyExceptionInstance_Check(cause)) {
  8998. fixed_cause = cause;
  8999. Py_INCREF(fixed_cause);
  9000. } else {
  9001. PyErr_SetString(PyExc_TypeError,
  9002. "exception causes must derive from "
  9003. "BaseException");
  9004. goto bad;
  9005. }
  9006. PyException_SetCause(value, fixed_cause);
  9007. }
  9008. PyErr_SetObject(type, value);
  9009. if (tb) {
  9010. #if PY_VERSION_HEX >= 0x030C00A6
  9011. PyException_SetTraceback(value, tb);
  9012. #elif CYTHON_FAST_THREAD_STATE
  9013. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  9014. PyObject* tmp_tb = tstate->curexc_traceback;
  9015. if (tb != tmp_tb) {
  9016. Py_INCREF(tb);
  9017. tstate->curexc_traceback = tb;
  9018. Py_XDECREF(tmp_tb);
  9019. }
  9020. #else
  9021. PyObject *tmp_type, *tmp_value, *tmp_tb;
  9022. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  9023. Py_INCREF(tb);
  9024. PyErr_Restore(tmp_type, tmp_value, tb);
  9025. Py_XDECREF(tmp_tb);
  9026. #endif
  9027. }
  9028. bad:
  9029. Py_XDECREF(owned_instance);
  9030. return;
  9031. }
  9032. /* RaiseTooManyValuesToUnpack */
  9033. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  9034. PyErr_Format(PyExc_ValueError,
  9035. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  9036. }
  9037. /* RaiseNeedMoreValuesToUnpack */
  9038. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  9039. PyErr_Format(PyExc_ValueError,
  9040. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  9041. index, (index == 1) ? "" : "s");
  9042. }
  9043. /* IterFinish */
  9044. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  9045. PyObject* exc_type;
  9046. __Pyx_PyThreadState_declare
  9047. __Pyx_PyThreadState_assign
  9048. exc_type = __Pyx_PyErr_CurrentExceptionType();
  9049. if (unlikely(exc_type)) {
  9050. if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
  9051. return -1;
  9052. __Pyx_PyErr_Clear();
  9053. return 0;
  9054. }
  9055. return 0;
  9056. }
  9057. /* UnpackItemEndCheck */
  9058. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  9059. if (unlikely(retval)) {
  9060. Py_DECREF(retval);
  9061. __Pyx_RaiseTooManyValuesError(expected);
  9062. return -1;
  9063. }
  9064. return __Pyx_IterFinish();
  9065. }
  9066. /* HasAttr (used by ImportImpl) */
  9067. #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
  9068. static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
  9069. PyObject *r;
  9070. if (unlikely(!PyUnicode_Check(n))) {
  9071. PyErr_SetString(PyExc_TypeError,
  9072. "hasattr(): attribute name must be string");
  9073. return -1;
  9074. }
  9075. r = __Pyx_PyObject_GetAttrStrNoError(o, n);
  9076. if (!r) {
  9077. return (unlikely(PyErr_Occurred())) ? -1 : 0;
  9078. } else {
  9079. Py_DECREF(r);
  9080. return 1;
  9081. }
  9082. }
  9083. #endif
  9084. /* ImportImpl (used by Import) */
  9085. static int __Pyx__Import_GetModule(PyObject *qualname, PyObject **module) {
  9086. PyObject *imported_module = PyImport_GetModule(qualname);
  9087. if (unlikely(!imported_module)) {
  9088. *module = NULL;
  9089. if (PyErr_Occurred()) {
  9090. return -1;
  9091. }
  9092. return 0;
  9093. }
  9094. *module = imported_module;
  9095. return 1;
  9096. }
  9097. static int __Pyx__Import_Lookup(PyObject *qualname, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject **module) {
  9098. PyObject *imported_module;
  9099. PyObject *top_level_package_name;
  9100. Py_ssize_t i;
  9101. int status, module_found;
  9102. Py_ssize_t dot_index;
  9103. module_found = __Pyx__Import_GetModule(qualname, &imported_module);
  9104. if (unlikely(!module_found || module_found == -1)) {
  9105. *module = NULL;
  9106. return module_found;
  9107. }
  9108. if (imported_names) {
  9109. for (i = 0; i < len_imported_names; i++) {
  9110. PyObject *imported_name = imported_names[i];
  9111. #if __PYX_LIMITED_VERSION_HEX < 0x030d0000
  9112. int has_imported_attribute = PyObject_HasAttr(imported_module, imported_name);
  9113. #else
  9114. int has_imported_attribute = PyObject_HasAttrWithError(imported_module, imported_name);
  9115. if (unlikely(has_imported_attribute == -1)) goto error;
  9116. #endif
  9117. if (!has_imported_attribute) {
  9118. goto not_found;
  9119. }
  9120. }
  9121. *module = imported_module;
  9122. return 1;
  9123. }
  9124. dot_index = PyUnicode_FindChar(qualname, '.', 0, PY_SSIZE_T_MAX, 1);
  9125. if (dot_index == -1) {
  9126. *module = imported_module;
  9127. return 1;
  9128. }
  9129. if (unlikely(dot_index == -2)) goto error;
  9130. top_level_package_name = PyUnicode_Substring(qualname, 0, dot_index);
  9131. if (unlikely(!top_level_package_name)) goto error;
  9132. Py_DECREF(imported_module);
  9133. status = __Pyx__Import_GetModule(top_level_package_name, module);
  9134. Py_DECREF(top_level_package_name);
  9135. return status;
  9136. error:
  9137. Py_DECREF(imported_module);
  9138. *module = NULL;
  9139. return -1;
  9140. not_found:
  9141. Py_DECREF(imported_module);
  9142. *module = NULL;
  9143. return 0;
  9144. }
  9145. static PyObject *__Pyx__Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, PyObject *moddict, int level) {
  9146. PyObject *module = 0;
  9147. PyObject *empty_dict = 0;
  9148. PyObject *from_list = 0;
  9149. int module_found;
  9150. if (!qualname) {
  9151. qualname = name;
  9152. }
  9153. module_found = __Pyx__Import_Lookup(qualname, imported_names, len_imported_names, &module);
  9154. if (likely(module_found == 1)) {
  9155. return module;
  9156. } else if (unlikely(module_found == -1)) {
  9157. return NULL;
  9158. }
  9159. empty_dict = PyDict_New();
  9160. if (unlikely(!empty_dict))
  9161. goto bad;
  9162. if (imported_names) {
  9163. #if CYTHON_COMPILING_IN_CPYTHON
  9164. from_list = __Pyx_PyList_FromArray(imported_names, len_imported_names);
  9165. if (unlikely(!from_list))
  9166. goto bad;
  9167. #else
  9168. from_list = PyList_New(len_imported_names);
  9169. if (unlikely(!from_list)) goto bad;
  9170. for (Py_ssize_t i=0; i<len_imported_names; ++i) {
  9171. if (PyList_SetItem(from_list, i, __Pyx_NewRef(imported_names[i])) < 0) goto bad;
  9172. }
  9173. #endif
  9174. }
  9175. if (level == -1) {
  9176. const char* package_sep = strchr(__Pyx_MODULE_NAME, '.');
  9177. if (package_sep != (0)) {
  9178. module = PyImport_ImportModuleLevelObject(
  9179. name, moddict, empty_dict, from_list, 1);
  9180. if (unlikely(!module)) {
  9181. if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
  9182. goto bad;
  9183. PyErr_Clear();
  9184. }
  9185. }
  9186. level = 0;
  9187. }
  9188. if (!module) {
  9189. module = PyImport_ImportModuleLevelObject(
  9190. name, moddict, empty_dict, from_list, level);
  9191. }
  9192. bad:
  9193. Py_XDECREF(from_list);
  9194. Py_XDECREF(empty_dict);
  9195. return module;
  9196. }
  9197. /* Import */
  9198. static PyObject *__Pyx_Import(PyObject *name, PyObject *const *imported_names, Py_ssize_t len_imported_names, PyObject *qualname, int level) {
  9199. return __Pyx__Import(name, imported_names, len_imported_names, qualname, __pyx_mstate_global->__pyx_d, level);
  9200. }
  9201. /* ImportFrom */
  9202. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  9203. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  9204. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  9205. const char* module_name_str = 0;
  9206. PyObject* module_name = 0;
  9207. PyObject* module_dot = 0;
  9208. PyObject* full_name = 0;
  9209. PyErr_Clear();
  9210. module_name_str = PyModule_GetName(module);
  9211. if (unlikely(!module_name_str)) { goto modbad; }
  9212. module_name = PyUnicode_FromString(module_name_str);
  9213. if (unlikely(!module_name)) { goto modbad; }
  9214. module_dot = PyUnicode_Concat(module_name, __pyx_mstate_global->__pyx_kp_u_);
  9215. if (unlikely(!module_dot)) { goto modbad; }
  9216. full_name = PyUnicode_Concat(module_dot, name);
  9217. if (unlikely(!full_name)) { goto modbad; }
  9218. #if (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400) ||\
  9219. CYTHON_COMPILING_IN_GRAAL
  9220. {
  9221. PyObject *modules = PyImport_GetModuleDict();
  9222. if (unlikely(!modules))
  9223. goto modbad;
  9224. value = PyObject_GetItem(modules, full_name);
  9225. }
  9226. #else
  9227. value = PyImport_GetModule(full_name);
  9228. #endif
  9229. modbad:
  9230. Py_XDECREF(full_name);
  9231. Py_XDECREF(module_dot);
  9232. Py_XDECREF(module_name);
  9233. }
  9234. if (unlikely(!value)) {
  9235. PyErr_Format(PyExc_ImportError, "cannot import name %S", name);
  9236. }
  9237. return value;
  9238. }
  9239. /* ListPack */
  9240. static PyObject *__Pyx_PyList_Pack(Py_ssize_t n, ...) {
  9241. va_list va;
  9242. PyObject *l = PyList_New(n);
  9243. va_start(va, n);
  9244. if (unlikely(!l)) goto end;
  9245. for (Py_ssize_t i=0; i<n; ++i) {
  9246. PyObject *arg = va_arg(va, PyObject*);
  9247. Py_INCREF(arg);
  9248. if (__Pyx_PyList_SET_ITEM(l, i, arg) != (0)) {
  9249. Py_CLEAR(l);
  9250. goto end;
  9251. }
  9252. }
  9253. end:
  9254. va_end(va);
  9255. return l;
  9256. }
  9257. /* Py3UpdateBases */
  9258. static PyObject*
  9259. __Pyx_PEP560_update_bases(PyObject *bases)
  9260. {
  9261. Py_ssize_t i, j, size_bases;
  9262. PyObject *base = NULL, *meth, *new_base, *result, *new_bases = NULL;
  9263. #if CYTHON_ASSUME_SAFE_SIZE
  9264. size_bases = PyTuple_GET_SIZE(bases);
  9265. #else
  9266. size_bases = PyTuple_Size(bases);
  9267. if (size_bases < 0) return NULL;
  9268. #endif
  9269. for (i = 0; i < size_bases; i++) {
  9270. #if CYTHON_AVOID_BORROWED_REFS
  9271. Py_CLEAR(base);
  9272. #endif
  9273. #if CYTHON_ASSUME_SAFE_MACROS
  9274. base = PyTuple_GET_ITEM(bases, i);
  9275. #else
  9276. base = PyTuple_GetItem(bases, i);
  9277. if (!base) goto error;
  9278. #endif
  9279. #if CYTHON_AVOID_BORROWED_REFS
  9280. Py_INCREF(base);
  9281. #endif
  9282. if (PyType_Check(base)) {
  9283. if (new_bases) {
  9284. if (PyList_Append(new_bases, base) < 0) {
  9285. goto error;
  9286. }
  9287. }
  9288. continue;
  9289. }
  9290. meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_mstate_global->__pyx_n_u_mro_entries);
  9291. if (!meth && PyErr_Occurred()) {
  9292. goto error;
  9293. }
  9294. if (!meth) {
  9295. if (new_bases) {
  9296. if (PyList_Append(new_bases, base) < 0) {
  9297. goto error;
  9298. }
  9299. }
  9300. continue;
  9301. }
  9302. new_base = __Pyx_PyObject_CallOneArg(meth, bases);
  9303. Py_DECREF(meth);
  9304. if (!new_base) {
  9305. goto error;
  9306. }
  9307. if (!PyTuple_Check(new_base)) {
  9308. PyErr_SetString(PyExc_TypeError,
  9309. "__mro_entries__ must return a tuple");
  9310. Py_DECREF(new_base);
  9311. goto error;
  9312. }
  9313. if (!new_bases) {
  9314. if (!(new_bases = PyList_New(i))) {
  9315. goto error;
  9316. }
  9317. for (j = 0; j < i; j++) {
  9318. PyObject *base_from_list;
  9319. #if CYTHON_ASSUME_SAFE_MACROS
  9320. base_from_list = PyTuple_GET_ITEM(bases, j);
  9321. PyList_SET_ITEM(new_bases, j, base_from_list);
  9322. Py_INCREF(base_from_list);
  9323. #else
  9324. base_from_list = PyTuple_GetItem(bases, j);
  9325. if (!base_from_list) goto error;
  9326. Py_INCREF(base_from_list);
  9327. if (PyList_SetItem(new_bases, j, base_from_list) < 0) goto error;
  9328. #endif
  9329. }
  9330. }
  9331. #if CYTHON_ASSUME_SAFE_SIZE
  9332. j = PyList_GET_SIZE(new_bases);
  9333. #else
  9334. j = PyList_Size(new_bases);
  9335. if (j < 0) goto error;
  9336. #endif
  9337. if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
  9338. goto error;
  9339. }
  9340. Py_DECREF(new_base);
  9341. }
  9342. if (!new_bases) {
  9343. Py_INCREF(bases);
  9344. return bases;
  9345. }
  9346. result = PyList_AsTuple(new_bases);
  9347. Py_DECREF(new_bases);
  9348. #if CYTHON_AVOID_BORROWED_REFS
  9349. Py_XDECREF(base);
  9350. #endif
  9351. return result;
  9352. error:
  9353. Py_XDECREF(new_bases);
  9354. #if CYTHON_AVOID_BORROWED_REFS
  9355. Py_XDECREF(base);
  9356. #endif
  9357. return NULL;
  9358. }
  9359. /* CalculateMetaclass */
  9360. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  9361. Py_ssize_t i, nbases;
  9362. #if CYTHON_ASSUME_SAFE_SIZE
  9363. nbases = PyTuple_GET_SIZE(bases);
  9364. #else
  9365. nbases = PyTuple_Size(bases);
  9366. if (nbases < 0) return NULL;
  9367. #endif
  9368. for (i=0; i < nbases; i++) {
  9369. PyTypeObject *tmptype;
  9370. #if CYTHON_ASSUME_SAFE_MACROS
  9371. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  9372. #else
  9373. PyObject *tmp = PyTuple_GetItem(bases, i);
  9374. if (!tmp) return NULL;
  9375. #endif
  9376. tmptype = Py_TYPE(tmp);
  9377. if (!metaclass) {
  9378. metaclass = tmptype;
  9379. continue;
  9380. }
  9381. if (PyType_IsSubtype(metaclass, tmptype))
  9382. continue;
  9383. if (PyType_IsSubtype(tmptype, metaclass)) {
  9384. metaclass = tmptype;
  9385. continue;
  9386. }
  9387. PyErr_SetString(PyExc_TypeError,
  9388. "metaclass conflict: "
  9389. "the metaclass of a derived class "
  9390. "must be a (non-strict) subclass "
  9391. "of the metaclasses of all its bases");
  9392. return NULL;
  9393. }
  9394. if (!metaclass) {
  9395. metaclass = &PyType_Type;
  9396. }
  9397. Py_INCREF((PyObject*) metaclass);
  9398. return (PyObject*) metaclass;
  9399. }
  9400. /* dict_setdefault (used by FetchCommonType) */
  9401. static CYTHON_INLINE PyObject *__Pyx_PyDict_SetDefault(PyObject *d, PyObject *key, PyObject *default_value) {
  9402. PyObject* value;
  9403. #if __PYX_LIMITED_VERSION_HEX >= 0x030F0000 || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4)
  9404. PyDict_SetDefaultRef(d, key, default_value, &value);
  9405. #elif CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX >= 0x030C0000
  9406. PyObject *args[] = {d, key, default_value};
  9407. value = PyObject_VectorcallMethod(__pyx_mstate_global->__pyx_n_u_setdefault, args, 3 | PY_VECTORCALL_ARGUMENTS_OFFSET, NULL);
  9408. #elif CYTHON_COMPILING_IN_LIMITED_API
  9409. value = PyObject_CallMethodObjArgs(d, __pyx_mstate_global->__pyx_n_u_setdefault, key, default_value, NULL);
  9410. #else
  9411. value = PyDict_SetDefault(d, key, default_value);
  9412. if (unlikely(!value)) return NULL;
  9413. Py_INCREF(value);
  9414. #endif
  9415. return value;
  9416. }
  9417. /* LimitedApiGetTypeDict (used by SetItemOnTypeDict) */
  9418. #if CYTHON_COMPILING_IN_LIMITED_API
  9419. static Py_ssize_t __Pyx_GetTypeDictOffset(void) {
  9420. PyObject *tp_dictoffset_o;
  9421. Py_ssize_t tp_dictoffset;
  9422. tp_dictoffset_o = PyObject_GetAttrString((PyObject*)(&PyType_Type), "__dictoffset__");
  9423. if (unlikely(!tp_dictoffset_o)) return -1;
  9424. tp_dictoffset = PyLong_AsSsize_t(tp_dictoffset_o);
  9425. Py_DECREF(tp_dictoffset_o);
  9426. if (unlikely(tp_dictoffset == 0)) {
  9427. PyErr_SetString(
  9428. PyExc_TypeError,
  9429. "'type' doesn't have a dictoffset");
  9430. return -1;
  9431. } else if (unlikely(tp_dictoffset < 0)) {
  9432. PyErr_SetString(
  9433. PyExc_TypeError,
  9434. "'type' has an unexpected negative dictoffset. "
  9435. "Please report this as Cython bug");
  9436. return -1;
  9437. }
  9438. return tp_dictoffset;
  9439. }
  9440. static PyObject *__Pyx_GetTypeDict(PyTypeObject *tp) {
  9441. static Py_ssize_t tp_dictoffset = 0;
  9442. if (unlikely(tp_dictoffset == 0)) {
  9443. tp_dictoffset = __Pyx_GetTypeDictOffset();
  9444. if (unlikely(tp_dictoffset == -1 && PyErr_Occurred())) {
  9445. tp_dictoffset = 0; // try again next time?
  9446. return NULL;
  9447. }
  9448. }
  9449. return *(PyObject**)((char*)tp + tp_dictoffset);
  9450. }
  9451. #endif
  9452. /* SetItemOnTypeDict (used by FixUpExtensionType) */
  9453. static int __Pyx__SetItemOnTypeDict(PyTypeObject *tp, PyObject *k, PyObject *v) {
  9454. int result;
  9455. PyObject *tp_dict;
  9456. #if CYTHON_COMPILING_IN_LIMITED_API
  9457. tp_dict = __Pyx_GetTypeDict(tp);
  9458. if (unlikely(!tp_dict)) return -1;
  9459. #else
  9460. tp_dict = tp->tp_dict;
  9461. #endif
  9462. result = PyDict_SetItem(tp_dict, k, v);
  9463. if (likely(!result)) {
  9464. PyType_Modified(tp);
  9465. if (unlikely(PyObject_HasAttr(v, __pyx_mstate_global->__pyx_n_u_set_name))) {
  9466. PyObject *setNameResult = PyObject_CallMethodObjArgs(v, __pyx_mstate_global->__pyx_n_u_set_name, (PyObject *) tp, k, NULL);
  9467. if (!setNameResult) return -1;
  9468. Py_DECREF(setNameResult);
  9469. }
  9470. }
  9471. return result;
  9472. }
  9473. /* FixUpExtensionType (used by FetchCommonType) */
  9474. static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
  9475. #if __PYX_LIMITED_VERSION_HEX > 0x030900B1
  9476. CYTHON_UNUSED_VAR(spec);
  9477. CYTHON_UNUSED_VAR(type);
  9478. CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
  9479. #else
  9480. const PyType_Slot *slot = spec->slots;
  9481. int changed = 0;
  9482. #if !CYTHON_COMPILING_IN_LIMITED_API
  9483. while (slot && slot->slot && slot->slot != Py_tp_members)
  9484. slot++;
  9485. if (slot && slot->slot == Py_tp_members) {
  9486. #if !CYTHON_COMPILING_IN_CPYTHON
  9487. const
  9488. #endif // !CYTHON_COMPILING_IN_CPYTHON)
  9489. PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
  9490. while (memb && memb->name) {
  9491. if (memb->name[0] == '_' && memb->name[1] == '_') {
  9492. if (strcmp(memb->name, "__weaklistoffset__") == 0) {
  9493. assert(memb->type == T_PYSSIZET);
  9494. assert(memb->flags == READONLY);
  9495. type->tp_weaklistoffset = memb->offset;
  9496. changed = 1;
  9497. }
  9498. else if (strcmp(memb->name, "__dictoffset__") == 0) {
  9499. assert(memb->type == T_PYSSIZET);
  9500. assert(memb->flags == READONLY);
  9501. type->tp_dictoffset = memb->offset;
  9502. changed = 1;
  9503. }
  9504. #if CYTHON_METH_FASTCALL
  9505. else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
  9506. assert(memb->type == T_PYSSIZET);
  9507. assert(memb->flags == READONLY);
  9508. type->tp_vectorcall_offset = memb->offset;
  9509. changed = 1;
  9510. }
  9511. #endif // CYTHON_METH_FASTCALL
  9512. #if !CYTHON_COMPILING_IN_PYPY
  9513. else if (strcmp(memb->name, "__module__") == 0) {
  9514. PyObject *descr;
  9515. assert(memb->type == T_OBJECT);
  9516. assert(memb->flags == 0 || memb->flags == READONLY);
  9517. descr = PyDescr_NewMember(type, memb);
  9518. if (unlikely(!descr))
  9519. return -1;
  9520. int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
  9521. Py_DECREF(descr);
  9522. if (unlikely(set_item_result < 0)) {
  9523. return -1;
  9524. }
  9525. changed = 1;
  9526. }
  9527. #endif // !CYTHON_COMPILING_IN_PYPY
  9528. }
  9529. memb++;
  9530. }
  9531. }
  9532. #endif // !CYTHON_COMPILING_IN_LIMITED_API
  9533. #if !CYTHON_COMPILING_IN_PYPY
  9534. slot = spec->slots;
  9535. while (slot && slot->slot && slot->slot != Py_tp_getset)
  9536. slot++;
  9537. if (slot && slot->slot == Py_tp_getset) {
  9538. PyGetSetDef *getset = (PyGetSetDef*) slot->pfunc;
  9539. while (getset && getset->name) {
  9540. if (getset->name[0] == '_' && getset->name[1] == '_' && strcmp(getset->name, "__module__") == 0) {
  9541. PyObject *descr = PyDescr_NewGetSet(type, getset);
  9542. if (unlikely(!descr))
  9543. return -1;
  9544. #if CYTHON_COMPILING_IN_LIMITED_API
  9545. PyObject *pyname = PyUnicode_FromString(getset->name);
  9546. if (unlikely(!pyname)) {
  9547. Py_DECREF(descr);
  9548. return -1;
  9549. }
  9550. int set_item_result = __Pyx_SetItemOnTypeDict(type, pyname, descr);
  9551. Py_DECREF(pyname);
  9552. #else
  9553. CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
  9554. int set_item_result = PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr);
  9555. #endif
  9556. Py_DECREF(descr);
  9557. if (unlikely(set_item_result < 0)) {
  9558. return -1;
  9559. }
  9560. changed = 1;
  9561. }
  9562. ++getset;
  9563. }
  9564. }
  9565. #else
  9566. CYTHON_UNUSED_VAR(__Pyx__SetItemOnTypeDict);
  9567. #endif // !CYTHON_COMPILING_IN_PYPY
  9568. if (changed)
  9569. PyType_Modified(type);
  9570. #endif // PY_VERSION_HEX > 0x030900B1
  9571. return 0;
  9572. }
  9573. /* AddModuleRef (used by FetchSharedCythonModule) */
  9574. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  9575. static PyObject *__Pyx_PyImport_AddModuleObjectRef(PyObject *name) {
  9576. PyObject *module_dict = PyImport_GetModuleDict();
  9577. PyObject *m;
  9578. if (PyMapping_GetOptionalItem(module_dict, name, &m) < 0) {
  9579. return NULL;
  9580. }
  9581. if (m != NULL && PyModule_Check(m)) {
  9582. return m;
  9583. }
  9584. Py_XDECREF(m);
  9585. m = PyModule_NewObject(name);
  9586. if (m == NULL)
  9587. return NULL;
  9588. if (PyDict_CheckExact(module_dict)) {
  9589. PyObject *new_m;
  9590. (void)PyDict_SetDefaultRef(module_dict, name, m, &new_m);
  9591. Py_DECREF(m);
  9592. return new_m;
  9593. } else {
  9594. if (PyObject_SetItem(module_dict, name, m) != 0) {
  9595. Py_DECREF(m);
  9596. return NULL;
  9597. }
  9598. return m;
  9599. }
  9600. }
  9601. static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
  9602. PyObject *py_name = PyUnicode_FromString(name);
  9603. if (!py_name) return NULL;
  9604. PyObject *module = __Pyx_PyImport_AddModuleObjectRef(py_name);
  9605. Py_DECREF(py_name);
  9606. return module;
  9607. }
  9608. #elif __PYX_LIMITED_VERSION_HEX >= 0x030d0000
  9609. #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
  9610. #else
  9611. static PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
  9612. PyObject *module = PyImport_AddModule(name);
  9613. Py_XINCREF(module);
  9614. return module;
  9615. }
  9616. #endif
  9617. /* FetchSharedCythonModule (used by FetchCommonType) */
  9618. static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
  9619. return __Pyx_PyImport_AddModuleRef(__PYX_ABI_MODULE_NAME);
  9620. }
  9621. /* FetchCommonType (used by CommonTypesMetaclass) */
  9622. #if __PYX_LIMITED_VERSION_HEX < 0x030C0000
  9623. static PyObject* __Pyx_PyType_FromMetaclass(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
  9624. PyObject *result = __Pyx_PyType_FromModuleAndSpec(module, spec, bases);
  9625. if (result && metaclass) {
  9626. PyObject *old_tp = (PyObject*)Py_TYPE(result);
  9627. Py_INCREF((PyObject*)metaclass);
  9628. #if __PYX_LIMITED_VERSION_HEX >= 0x03090000
  9629. Py_SET_TYPE(result, metaclass);
  9630. #else
  9631. result->ob_type = metaclass;
  9632. #endif
  9633. Py_DECREF(old_tp);
  9634. }
  9635. return result;
  9636. }
  9637. #else
  9638. #define __Pyx_PyType_FromMetaclass(me, mo, s, b) PyType_FromMetaclass(me, mo, s, b)
  9639. #endif
  9640. static int __Pyx_VerifyCachedType(PyObject *cached_type,
  9641. const char *name,
  9642. Py_ssize_t expected_basicsize) {
  9643. Py_ssize_t basicsize;
  9644. if (!PyType_Check(cached_type)) {
  9645. PyErr_Format(PyExc_TypeError,
  9646. "Shared Cython type %.200s is not a type object", name);
  9647. return -1;
  9648. }
  9649. if (expected_basicsize == 0) {
  9650. return 0; // size is inherited, nothing useful to check
  9651. }
  9652. #if CYTHON_COMPILING_IN_LIMITED_API
  9653. PyObject *py_basicsize;
  9654. py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
  9655. if (unlikely(!py_basicsize)) return -1;
  9656. basicsize = PyLong_AsSsize_t(py_basicsize);
  9657. Py_DECREF(py_basicsize);
  9658. py_basicsize = NULL;
  9659. if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) return -1;
  9660. #else
  9661. basicsize = ((PyTypeObject*) cached_type)->tp_basicsize;
  9662. #endif
  9663. if (basicsize != expected_basicsize) {
  9664. PyErr_Format(PyExc_TypeError,
  9665. "Shared Cython type %.200s has the wrong size, try recompiling",
  9666. name);
  9667. return -1;
  9668. }
  9669. return 0;
  9670. }
  9671. static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyTypeObject *metaclass, PyObject *module, PyType_Spec *spec, PyObject *bases) {
  9672. PyObject *abi_module = NULL, *cached_type = NULL, *abi_module_dict, *new_cached_type, *py_object_name;
  9673. int get_item_ref_result;
  9674. const char* object_name = strrchr(spec->name, '.');
  9675. object_name = object_name ? object_name+1 : spec->name;
  9676. py_object_name = PyUnicode_FromString(object_name);
  9677. if (!py_object_name) return NULL;
  9678. abi_module = __Pyx_FetchSharedCythonABIModule();
  9679. if (!abi_module) goto done;
  9680. abi_module_dict = PyModule_GetDict(abi_module);
  9681. if (!abi_module_dict) goto done;
  9682. get_item_ref_result = __Pyx_PyDict_GetItemRef(abi_module_dict, py_object_name, &cached_type);
  9683. if (get_item_ref_result == 1) {
  9684. if (__Pyx_VerifyCachedType(
  9685. cached_type,
  9686. object_name,
  9687. spec->basicsize) < 0) {
  9688. goto bad;
  9689. }
  9690. goto done;
  9691. } else if (unlikely(get_item_ref_result == -1)) {
  9692. goto bad;
  9693. }
  9694. cached_type = __Pyx_PyType_FromMetaclass(
  9695. metaclass,
  9696. CYTHON_USE_MODULE_STATE ? module : abi_module,
  9697. spec, bases);
  9698. if (unlikely(!cached_type)) goto bad;
  9699. if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
  9700. new_cached_type = __Pyx_PyDict_SetDefault(abi_module_dict, py_object_name, cached_type);
  9701. if (unlikely(new_cached_type != cached_type)) {
  9702. if (unlikely(!new_cached_type)) goto bad;
  9703. Py_DECREF(cached_type);
  9704. cached_type = new_cached_type;
  9705. if (__Pyx_VerifyCachedType(
  9706. cached_type,
  9707. object_name,
  9708. spec->basicsize) < 0) {
  9709. goto bad;
  9710. }
  9711. goto done;
  9712. } else {
  9713. Py_DECREF(new_cached_type);
  9714. }
  9715. done:
  9716. Py_XDECREF(abi_module);
  9717. Py_DECREF(py_object_name);
  9718. assert(cached_type == NULL || PyType_Check(cached_type));
  9719. return (PyTypeObject *) cached_type;
  9720. bad:
  9721. Py_XDECREF(cached_type);
  9722. cached_type = NULL;
  9723. goto done;
  9724. }
  9725. /* CommonTypesMetaclass (used by CythonFunctionShared) */
  9726. static PyObject* __pyx_CommonTypesMetaclass_get_module(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED void* context) {
  9727. return PyUnicode_FromString(__PYX_ABI_MODULE_NAME);
  9728. }
  9729. #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
  9730. static PyObject* __pyx_CommonTypesMetaclass_call(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *args, CYTHON_UNUSED PyObject *kwds) {
  9731. PyErr_SetString(PyExc_TypeError, "Cannot instantiate Cython internal types");
  9732. return NULL;
  9733. }
  9734. static int __pyx_CommonTypesMetaclass_setattr(CYTHON_UNUSED PyObject *self, CYTHON_UNUSED PyObject *attr, CYTHON_UNUSED PyObject *value) {
  9735. PyErr_SetString(PyExc_TypeError, "Cython internal types are immutable");
  9736. return -1;
  9737. }
  9738. #endif
  9739. static PyGetSetDef __pyx_CommonTypesMetaclass_getset[] = {
  9740. {"__module__", __pyx_CommonTypesMetaclass_get_module, NULL, NULL, NULL},
  9741. {0, 0, 0, 0, 0}
  9742. };
  9743. static PyType_Slot __pyx_CommonTypesMetaclass_slots[] = {
  9744. {Py_tp_getset, (void *)__pyx_CommonTypesMetaclass_getset},
  9745. #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
  9746. {Py_tp_call, (void*)__pyx_CommonTypesMetaclass_call},
  9747. {Py_tp_new, (void*)__pyx_CommonTypesMetaclass_call},
  9748. {Py_tp_setattro, (void*)__pyx_CommonTypesMetaclass_setattr},
  9749. #endif
  9750. {0, 0}
  9751. };
  9752. static PyType_Spec __pyx_CommonTypesMetaclass_spec = {
  9753. __PYX_TYPE_MODULE_PREFIX "_common_types_metatype",
  9754. 0,
  9755. 0,
  9756. Py_TPFLAGS_IMMUTABLETYPE |
  9757. Py_TPFLAGS_DISALLOW_INSTANTIATION |
  9758. Py_TPFLAGS_DEFAULT,
  9759. __pyx_CommonTypesMetaclass_slots
  9760. };
  9761. static int __pyx_CommonTypesMetaclass_init(PyObject *module) {
  9762. __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
  9763. PyObject *bases = PyTuple_Pack(1, &PyType_Type);
  9764. if (unlikely(!bases)) {
  9765. return -1;
  9766. }
  9767. mstate->__pyx_CommonTypesMetaclassType = __Pyx_FetchCommonTypeFromSpec(NULL, module, &__pyx_CommonTypesMetaclass_spec, bases);
  9768. Py_DECREF(bases);
  9769. if (unlikely(mstate->__pyx_CommonTypesMetaclassType == NULL)) {
  9770. return -1;
  9771. }
  9772. return 0;
  9773. }
  9774. /* CallTypeTraverse (used by CythonFunctionShared) */
  9775. #if !CYTHON_USE_TYPE_SPECS || (!CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x03090000)
  9776. #else
  9777. static int __Pyx_call_type_traverse(PyObject *o, int always_call, visitproc visit, void *arg) {
  9778. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x03090000
  9779. if (__Pyx_get_runtime_version() < 0x03090000) return 0;
  9780. #endif
  9781. if (!always_call) {
  9782. PyTypeObject *base = __Pyx_PyObject_GetSlot(o, tp_base, PyTypeObject*);
  9783. unsigned long flags = PyType_GetFlags(base);
  9784. if (flags & Py_TPFLAGS_HEAPTYPE) {
  9785. return 0;
  9786. }
  9787. }
  9788. Py_VISIT((PyObject*)Py_TYPE(o));
  9789. return 0;
  9790. }
  9791. #endif
  9792. /* PyMethodNew (used by CythonFunctionShared) */
  9793. #if CYTHON_COMPILING_IN_LIMITED_API
  9794. static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
  9795. PyObject *result;
  9796. CYTHON_UNUSED_VAR(typ);
  9797. if (!self)
  9798. return __Pyx_NewRef(func);
  9799. #if __PYX_LIMITED_VERSION_HEX >= 0x030C0000
  9800. {
  9801. PyObject *args[] = {func, self};
  9802. result = PyObject_Vectorcall(__pyx_mstate_global->__Pyx_CachedMethodType, args, 2, NULL);
  9803. }
  9804. #else
  9805. result = PyObject_CallFunctionObjArgs(__pyx_mstate_global->__Pyx_CachedMethodType, func, self, NULL);
  9806. #endif
  9807. return result;
  9808. }
  9809. #else
  9810. static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
  9811. CYTHON_UNUSED_VAR(typ);
  9812. if (!self)
  9813. return __Pyx_NewRef(func);
  9814. return PyMethod_New(func, self);
  9815. }
  9816. #endif
  9817. /* PyVectorcallFastCallDict (used by CythonFunctionShared) */
  9818. #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  9819. static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  9820. {
  9821. PyObject *res = NULL;
  9822. PyObject *kwnames;
  9823. PyObject **newargs;
  9824. PyObject **kwvalues;
  9825. Py_ssize_t i;
  9826. #if CYTHON_AVOID_BORROWED_REFS
  9827. PyObject *pos;
  9828. #else
  9829. Py_ssize_t pos;
  9830. #endif
  9831. size_t j;
  9832. PyObject *key, *value;
  9833. unsigned long keys_are_strings;
  9834. #if !CYTHON_ASSUME_SAFE_SIZE
  9835. Py_ssize_t nkw = PyDict_Size(kw);
  9836. if (unlikely(nkw == -1)) return NULL;
  9837. #else
  9838. Py_ssize_t nkw = PyDict_GET_SIZE(kw);
  9839. #endif
  9840. newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
  9841. if (unlikely(newargs == NULL)) {
  9842. PyErr_NoMemory();
  9843. return NULL;
  9844. }
  9845. for (j = 0; j < nargs; j++) newargs[j] = args[j];
  9846. kwnames = PyTuple_New(nkw);
  9847. if (unlikely(kwnames == NULL)) {
  9848. PyMem_Free(newargs);
  9849. return NULL;
  9850. }
  9851. kwvalues = newargs + nargs;
  9852. pos = 0;
  9853. i = 0;
  9854. keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
  9855. while (__Pyx_PyDict_NextRef(kw, &pos, &key, &value)) {
  9856. keys_are_strings &=
  9857. #if CYTHON_COMPILING_IN_LIMITED_API
  9858. PyType_GetFlags(Py_TYPE(key));
  9859. #else
  9860. Py_TYPE(key)->tp_flags;
  9861. #endif
  9862. #if !CYTHON_ASSUME_SAFE_MACROS
  9863. if (unlikely(PyTuple_SetItem(kwnames, i, key) < 0)) goto cleanup;
  9864. #else
  9865. PyTuple_SET_ITEM(kwnames, i, key);
  9866. #endif
  9867. kwvalues[i] = value;
  9868. i++;
  9869. }
  9870. if (unlikely(!keys_are_strings)) {
  9871. PyErr_SetString(PyExc_TypeError, "keywords must be strings");
  9872. goto cleanup;
  9873. }
  9874. res = vc(func, newargs, nargs, kwnames);
  9875. cleanup:
  9876. #if CYTHON_AVOID_BORROWED_REFS
  9877. Py_DECREF(pos);
  9878. #endif
  9879. Py_DECREF(kwnames);
  9880. for (i = 0; i < nkw; i++)
  9881. Py_DECREF(kwvalues[i]);
  9882. PyMem_Free(newargs);
  9883. return res;
  9884. }
  9885. static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  9886. {
  9887. Py_ssize_t kw_size =
  9888. likely(kw == NULL) ?
  9889. 0 :
  9890. #if !CYTHON_ASSUME_SAFE_SIZE
  9891. PyDict_Size(kw);
  9892. #else
  9893. PyDict_GET_SIZE(kw);
  9894. #endif
  9895. if (kw_size == 0) {
  9896. return vc(func, args, nargs, NULL);
  9897. }
  9898. #if !CYTHON_ASSUME_SAFE_SIZE
  9899. else if (unlikely(kw_size == -1)) {
  9900. return NULL;
  9901. }
  9902. #endif
  9903. return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
  9904. }
  9905. #endif
  9906. /* CythonFunctionShared (used by CythonFunction) */
  9907. #if CYTHON_COMPILING_IN_LIMITED_API
  9908. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunctionNoMethod(PyObject *func, void (*cfunc)(void)) {
  9909. if (__Pyx_CyFunction_Check(func)) {
  9910. return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
  9911. } else if (PyCFunction_Check(func)) {
  9912. return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
  9913. }
  9914. return 0;
  9915. }
  9916. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
  9917. if ((PyObject*)Py_TYPE(func) == __pyx_mstate_global->__Pyx_CachedMethodType) {
  9918. int result;
  9919. PyObject *newFunc = PyObject_GetAttr(func, __pyx_mstate_global->__pyx_n_u_func);
  9920. if (unlikely(!newFunc)) {
  9921. PyErr_Clear(); // It's only an optimization, so don't throw an error
  9922. return 0;
  9923. }
  9924. result = __Pyx__IsSameCyOrCFunctionNoMethod(newFunc, cfunc);
  9925. Py_DECREF(newFunc);
  9926. return result;
  9927. }
  9928. return __Pyx__IsSameCyOrCFunctionNoMethod(func, cfunc);
  9929. }
  9930. #else
  9931. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void (*cfunc)(void)) {
  9932. if (PyMethod_Check(func)) {
  9933. func = PyMethod_GET_FUNCTION(func);
  9934. }
  9935. return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
  9936. }
  9937. #endif
  9938. static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
  9939. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  9940. __Pyx_Py_XDECREF_SET(
  9941. __Pyx_CyFunction_GetClassObj(f),
  9942. ((classobj) ? __Pyx_NewRef(classobj) : NULL));
  9943. #else
  9944. __Pyx_Py_XDECREF_SET(
  9945. ((PyCMethodObject *) (f))->mm_class,
  9946. (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
  9947. #endif
  9948. }
  9949. static PyObject *
  9950. __Pyx_CyFunction_get_doc_locked(__pyx_CyFunctionObject *op)
  9951. {
  9952. if (unlikely(op->func_doc == NULL)) {
  9953. #if CYTHON_COMPILING_IN_LIMITED_API
  9954. op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
  9955. if (unlikely(!op->func_doc)) return NULL;
  9956. #else
  9957. if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
  9958. op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
  9959. if (unlikely(op->func_doc == NULL))
  9960. return NULL;
  9961. } else {
  9962. Py_INCREF(Py_None);
  9963. return Py_None;
  9964. }
  9965. #endif
  9966. }
  9967. Py_INCREF(op->func_doc);
  9968. return op->func_doc;
  9969. }
  9970. static PyObject *
  9971. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure) {
  9972. PyObject *result;
  9973. CYTHON_UNUSED_VAR(closure);
  9974. __Pyx_BEGIN_CRITICAL_SECTION(op);
  9975. result = __Pyx_CyFunction_get_doc_locked(op);
  9976. __Pyx_END_CRITICAL_SECTION();
  9977. return result;
  9978. }
  9979. static int
  9980. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  9981. {
  9982. CYTHON_UNUSED_VAR(context);
  9983. if (value == NULL) {
  9984. value = Py_None;
  9985. }
  9986. Py_INCREF(value);
  9987. __Pyx_BEGIN_CRITICAL_SECTION(op);
  9988. __Pyx_Py_XDECREF_SET(op->func_doc, value);
  9989. __Pyx_END_CRITICAL_SECTION();
  9990. return 0;
  9991. }
  9992. static PyObject *
  9993. __Pyx_CyFunction_get_name_locked(__pyx_CyFunctionObject *op)
  9994. {
  9995. if (unlikely(op->func_name == NULL)) {
  9996. #if CYTHON_COMPILING_IN_LIMITED_API
  9997. op->func_name = PyObject_GetAttrString(op->func, "__name__");
  9998. #else
  9999. op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
  10000. #endif
  10001. if (unlikely(op->func_name == NULL))
  10002. return NULL;
  10003. }
  10004. Py_INCREF(op->func_name);
  10005. return op->func_name;
  10006. }
  10007. static PyObject *
  10008. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
  10009. {
  10010. PyObject *result = NULL;
  10011. CYTHON_UNUSED_VAR(context);
  10012. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10013. result = __Pyx_CyFunction_get_name_locked(op);
  10014. __Pyx_END_CRITICAL_SECTION();
  10015. return result;
  10016. }
  10017. static int
  10018. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10019. {
  10020. CYTHON_UNUSED_VAR(context);
  10021. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  10022. PyErr_SetString(PyExc_TypeError,
  10023. "__name__ must be set to a string object");
  10024. return -1;
  10025. }
  10026. Py_INCREF(value);
  10027. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10028. __Pyx_Py_XDECREF_SET(op->func_name, value);
  10029. __Pyx_END_CRITICAL_SECTION();
  10030. return 0;
  10031. }
  10032. static PyObject *
  10033. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
  10034. {
  10035. CYTHON_UNUSED_VAR(context);
  10036. PyObject *result;
  10037. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10038. Py_INCREF(op->func_qualname);
  10039. result = op->func_qualname;
  10040. __Pyx_END_CRITICAL_SECTION();
  10041. return result;
  10042. }
  10043. static int
  10044. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10045. {
  10046. CYTHON_UNUSED_VAR(context);
  10047. if (unlikely(value == NULL || !PyUnicode_Check(value))) {
  10048. PyErr_SetString(PyExc_TypeError,
  10049. "__qualname__ must be set to a string object");
  10050. return -1;
  10051. }
  10052. Py_INCREF(value);
  10053. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10054. __Pyx_Py_XDECREF_SET(op->func_qualname, value);
  10055. __Pyx_END_CRITICAL_SECTION();
  10056. return 0;
  10057. }
  10058. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  10059. static PyObject *
  10060. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
  10061. {
  10062. CYTHON_UNUSED_VAR(context);
  10063. if (unlikely(op->func_dict == NULL)) {
  10064. op->func_dict = PyDict_New();
  10065. if (unlikely(op->func_dict == NULL))
  10066. return NULL;
  10067. }
  10068. Py_INCREF(op->func_dict);
  10069. return op->func_dict;
  10070. }
  10071. #endif
  10072. static PyObject *
  10073. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
  10074. {
  10075. CYTHON_UNUSED_VAR(context);
  10076. Py_INCREF(op->func_globals);
  10077. return op->func_globals;
  10078. }
  10079. static PyObject *
  10080. __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
  10081. {
  10082. CYTHON_UNUSED_VAR(op);
  10083. CYTHON_UNUSED_VAR(context);
  10084. Py_INCREF(Py_None);
  10085. return Py_None;
  10086. }
  10087. static PyObject *
  10088. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
  10089. {
  10090. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  10091. CYTHON_UNUSED_VAR(context);
  10092. Py_INCREF(result);
  10093. return result;
  10094. }
  10095. static int
  10096. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  10097. int result = 0;
  10098. PyObject *res = op->defaults_getter((PyObject *) op);
  10099. if (unlikely(!res))
  10100. return -1;
  10101. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10102. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  10103. Py_INCREF(op->defaults_tuple);
  10104. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  10105. Py_INCREF(op->defaults_kwdict);
  10106. #else
  10107. op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
  10108. if (unlikely(!op->defaults_tuple)) result = -1;
  10109. else {
  10110. op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
  10111. if (unlikely(!op->defaults_kwdict)) result = -1;
  10112. }
  10113. #endif
  10114. Py_DECREF(res);
  10115. return result;
  10116. }
  10117. static int
  10118. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10119. CYTHON_UNUSED_VAR(context);
  10120. if (!value) {
  10121. value = Py_None;
  10122. } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
  10123. PyErr_SetString(PyExc_TypeError,
  10124. "__defaults__ must be set to a tuple object");
  10125. return -1;
  10126. }
  10127. PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
  10128. "currently affect the values used in function calls", 1);
  10129. Py_INCREF(value);
  10130. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10131. __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
  10132. __Pyx_END_CRITICAL_SECTION();
  10133. return 0;
  10134. }
  10135. static PyObject *
  10136. __Pyx_CyFunction_get_defaults_locked(__pyx_CyFunctionObject *op) {
  10137. PyObject* result = op->defaults_tuple;
  10138. if (unlikely(!result)) {
  10139. if (op->defaults_getter) {
  10140. if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
  10141. result = op->defaults_tuple;
  10142. } else {
  10143. result = Py_None;
  10144. }
  10145. }
  10146. Py_INCREF(result);
  10147. return result;
  10148. }
  10149. static PyObject *
  10150. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
  10151. PyObject* result = NULL;
  10152. CYTHON_UNUSED_VAR(context);
  10153. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10154. result = __Pyx_CyFunction_get_defaults_locked(op);
  10155. __Pyx_END_CRITICAL_SECTION();
  10156. return result;
  10157. }
  10158. static int
  10159. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10160. CYTHON_UNUSED_VAR(context);
  10161. if (!value) {
  10162. value = Py_None;
  10163. } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
  10164. PyErr_SetString(PyExc_TypeError,
  10165. "__kwdefaults__ must be set to a dict object");
  10166. return -1;
  10167. }
  10168. PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
  10169. "currently affect the values used in function calls", 1);
  10170. Py_INCREF(value);
  10171. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10172. __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
  10173. __Pyx_END_CRITICAL_SECTION();
  10174. return 0;
  10175. }
  10176. static PyObject *
  10177. __Pyx_CyFunction_get_kwdefaults_locked(__pyx_CyFunctionObject *op) {
  10178. PyObject* result = op->defaults_kwdict;
  10179. if (unlikely(!result)) {
  10180. if (op->defaults_getter) {
  10181. if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
  10182. result = op->defaults_kwdict;
  10183. } else {
  10184. result = Py_None;
  10185. }
  10186. }
  10187. Py_INCREF(result);
  10188. return result;
  10189. }
  10190. static PyObject *
  10191. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
  10192. PyObject* result;
  10193. CYTHON_UNUSED_VAR(context);
  10194. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10195. result = __Pyx_CyFunction_get_kwdefaults_locked(op);
  10196. __Pyx_END_CRITICAL_SECTION();
  10197. return result;
  10198. }
  10199. static int
  10200. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10201. CYTHON_UNUSED_VAR(context);
  10202. if (!value || value == Py_None) {
  10203. value = NULL;
  10204. } else if (unlikely(!PyDict_Check(value))) {
  10205. PyErr_SetString(PyExc_TypeError,
  10206. "__annotations__ must be set to a dict object");
  10207. return -1;
  10208. }
  10209. Py_XINCREF(value);
  10210. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10211. __Pyx_Py_XDECREF_SET(op->func_annotations, value);
  10212. __Pyx_END_CRITICAL_SECTION();
  10213. return 0;
  10214. }
  10215. static PyObject *
  10216. __Pyx_CyFunction_get_annotations_locked(__pyx_CyFunctionObject *op) {
  10217. PyObject* result = op->func_annotations;
  10218. if (unlikely(!result)) {
  10219. result = PyDict_New();
  10220. if (unlikely(!result)) return NULL;
  10221. op->func_annotations = result;
  10222. }
  10223. Py_INCREF(result);
  10224. return result;
  10225. }
  10226. static PyObject *
  10227. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
  10228. PyObject *result;
  10229. CYTHON_UNUSED_VAR(context);
  10230. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10231. result = __Pyx_CyFunction_get_annotations_locked(op);
  10232. __Pyx_END_CRITICAL_SECTION();
  10233. return result;
  10234. }
  10235. static PyObject *
  10236. __Pyx_CyFunction_get_is_coroutine_value(__pyx_CyFunctionObject *op) {
  10237. int is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
  10238. if (is_coroutine) {
  10239. PyObject *is_coroutine_value, *module, *fromlist, *marker = __pyx_mstate_global->__pyx_n_u_is_coroutine;
  10240. fromlist = PyList_New(1);
  10241. if (unlikely(!fromlist)) return NULL;
  10242. Py_INCREF(marker);
  10243. #if CYTHON_ASSUME_SAFE_MACROS
  10244. PyList_SET_ITEM(fromlist, 0, marker);
  10245. #else
  10246. if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
  10247. Py_DECREF(marker);
  10248. Py_DECREF(fromlist);
  10249. return NULL;
  10250. }
  10251. #endif
  10252. module = PyImport_ImportModuleLevelObject(__pyx_mstate_global->__pyx_n_u_asyncio_coroutines, NULL, NULL, fromlist, 0);
  10253. Py_DECREF(fromlist);
  10254. if (unlikely(!module)) goto ignore;
  10255. is_coroutine_value = __Pyx_PyObject_GetAttrStr(module, marker);
  10256. Py_DECREF(module);
  10257. if (likely(is_coroutine_value)) {
  10258. return is_coroutine_value;
  10259. }
  10260. ignore:
  10261. PyErr_Clear();
  10262. }
  10263. return __Pyx_PyBool_FromLong(is_coroutine);
  10264. }
  10265. static PyObject *
  10266. __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
  10267. PyObject *result;
  10268. CYTHON_UNUSED_VAR(context);
  10269. if (op->func_is_coroutine) {
  10270. return __Pyx_NewRef(op->func_is_coroutine);
  10271. }
  10272. result = __Pyx_CyFunction_get_is_coroutine_value(op);
  10273. if (unlikely(!result))
  10274. return NULL;
  10275. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10276. if (op->func_is_coroutine) {
  10277. Py_DECREF(result);
  10278. result = __Pyx_NewRef(op->func_is_coroutine);
  10279. } else {
  10280. op->func_is_coroutine = __Pyx_NewRef(result);
  10281. }
  10282. __Pyx_END_CRITICAL_SECTION();
  10283. return result;
  10284. }
  10285. static void __Pyx_CyFunction_raise_argument_count_error(__pyx_CyFunctionObject *func, const char* message, Py_ssize_t size) {
  10286. #if CYTHON_COMPILING_IN_LIMITED_API
  10287. PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
  10288. if (!py_name) return;
  10289. PyErr_Format(PyExc_TypeError,
  10290. "%.200S() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  10291. py_name, message, size);
  10292. Py_DECREF(py_name);
  10293. #else
  10294. const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
  10295. PyErr_Format(PyExc_TypeError,
  10296. "%.200s() %s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  10297. name, message, size);
  10298. #endif
  10299. }
  10300. static void __Pyx_CyFunction_raise_type_error(__pyx_CyFunctionObject *func, const char* message) {
  10301. #if CYTHON_COMPILING_IN_LIMITED_API
  10302. PyObject *py_name = __Pyx_CyFunction_get_name(func, NULL);
  10303. if (!py_name) return;
  10304. PyErr_Format(PyExc_TypeError,
  10305. "%.200S() %s",
  10306. py_name, message);
  10307. Py_DECREF(py_name);
  10308. #else
  10309. const char* name = ((PyCFunctionObject*)func)->m_ml->ml_name;
  10310. PyErr_Format(PyExc_TypeError,
  10311. "%.200s() %s",
  10312. name, message);
  10313. #endif
  10314. }
  10315. #if CYTHON_COMPILING_IN_LIMITED_API
  10316. static PyObject *
  10317. __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
  10318. CYTHON_UNUSED_VAR(context);
  10319. return PyObject_GetAttrString(op->func, "__module__");
  10320. }
  10321. static int
  10322. __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10323. CYTHON_UNUSED_VAR(context);
  10324. return PyObject_SetAttrString(op->func, "__module__", value);
  10325. }
  10326. #endif
  10327. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  10328. {"func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  10329. {"__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  10330. {"func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  10331. {"__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  10332. {"__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  10333. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  10334. {"func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
  10335. {"__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)PyObject_GenericSetDict, 0, 0},
  10336. #else
  10337. {"func_dict", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
  10338. {"__dict__", (getter)PyObject_GenericGetDict, (setter)PyObject_GenericSetDict, 0, 0},
  10339. #endif
  10340. {"func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  10341. {"__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  10342. {"func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  10343. {"__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  10344. {"func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  10345. {"__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  10346. {"func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  10347. {"__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  10348. {"__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  10349. {"__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  10350. {"_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
  10351. #if CYTHON_COMPILING_IN_LIMITED_API
  10352. {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
  10353. #endif
  10354. {0, 0, 0, 0, 0}
  10355. };
  10356. static PyMemberDef __pyx_CyFunction_members[] = {
  10357. #if !CYTHON_COMPILING_IN_LIMITED_API
  10358. {"__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
  10359. #endif
  10360. #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
  10361. {"__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
  10362. #endif
  10363. #if CYTHON_METH_FASTCALL
  10364. #if CYTHON_COMPILING_IN_LIMITED_API
  10365. {"__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
  10366. #else
  10367. {"__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
  10368. #endif
  10369. #if CYTHON_COMPILING_IN_LIMITED_API
  10370. {"__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
  10371. #else
  10372. {"__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
  10373. #endif
  10374. #endif
  10375. {0, 0, 0, 0, 0}
  10376. };
  10377. static PyObject *
  10378. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
  10379. {
  10380. PyObject *result = NULL;
  10381. CYTHON_UNUSED_VAR(args);
  10382. __Pyx_BEGIN_CRITICAL_SECTION(m);
  10383. Py_INCREF(m->func_qualname);
  10384. result = m->func_qualname;
  10385. __Pyx_END_CRITICAL_SECTION();
  10386. return result;
  10387. }
  10388. static PyMethodDef __pyx_CyFunction_methods[] = {
  10389. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  10390. {0, 0, 0, 0}
  10391. };
  10392. #if CYTHON_COMPILING_IN_LIMITED_API
  10393. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  10394. #else
  10395. #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
  10396. #endif
  10397. static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
  10398. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  10399. #if !CYTHON_COMPILING_IN_LIMITED_API
  10400. PyCFunctionObject *cf = (PyCFunctionObject*) op;
  10401. #endif
  10402. if (unlikely(op == NULL))
  10403. return NULL;
  10404. #if CYTHON_COMPILING_IN_LIMITED_API
  10405. op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
  10406. if (unlikely(!op->func)) return NULL;
  10407. #endif
  10408. op->flags = flags;
  10409. __Pyx_CyFunction_weakreflist(op) = NULL;
  10410. #if !CYTHON_COMPILING_IN_LIMITED_API
  10411. cf->m_ml = ml;
  10412. cf->m_self = (PyObject *) op;
  10413. #endif
  10414. Py_XINCREF(closure);
  10415. op->func_closure = closure;
  10416. #if !CYTHON_COMPILING_IN_LIMITED_API
  10417. Py_XINCREF(module);
  10418. cf->m_module = module;
  10419. #endif
  10420. #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
  10421. op->func_dict = NULL;
  10422. #endif
  10423. op->func_name = NULL;
  10424. Py_INCREF(qualname);
  10425. op->func_qualname = qualname;
  10426. op->func_doc = NULL;
  10427. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  10428. op->func_classobj = NULL;
  10429. #else
  10430. ((PyCMethodObject*)op)->mm_class = NULL;
  10431. #endif
  10432. op->func_globals = globals;
  10433. Py_INCREF(op->func_globals);
  10434. Py_XINCREF(code);
  10435. op->func_code = code;
  10436. op->defaults = NULL;
  10437. op->defaults_tuple = NULL;
  10438. op->defaults_kwdict = NULL;
  10439. op->defaults_getter = NULL;
  10440. op->func_annotations = NULL;
  10441. op->func_is_coroutine = NULL;
  10442. #if CYTHON_METH_FASTCALL
  10443. switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
  10444. case METH_NOARGS:
  10445. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
  10446. break;
  10447. case METH_O:
  10448. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
  10449. break;
  10450. case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
  10451. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
  10452. break;
  10453. case METH_FASTCALL | METH_KEYWORDS:
  10454. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
  10455. break;
  10456. case METH_VARARGS | METH_KEYWORDS:
  10457. __Pyx_CyFunction_func_vectorcall(op) = NULL;
  10458. break;
  10459. default:
  10460. PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
  10461. Py_DECREF(op);
  10462. return NULL;
  10463. }
  10464. #endif
  10465. return (PyObject *) op;
  10466. }
  10467. static int
  10468. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  10469. {
  10470. Py_CLEAR(m->func_closure);
  10471. #if CYTHON_COMPILING_IN_LIMITED_API
  10472. Py_CLEAR(m->func);
  10473. #else
  10474. Py_CLEAR(((PyCFunctionObject*)m)->m_module);
  10475. #endif
  10476. #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
  10477. Py_CLEAR(m->func_dict);
  10478. #elif PY_VERSION_HEX < 0x030d0000
  10479. _PyObject_ClearManagedDict((PyObject*)m);
  10480. #else
  10481. PyObject_ClearManagedDict((PyObject*)m);
  10482. #endif
  10483. Py_CLEAR(m->func_name);
  10484. Py_CLEAR(m->func_qualname);
  10485. Py_CLEAR(m->func_doc);
  10486. Py_CLEAR(m->func_globals);
  10487. Py_CLEAR(m->func_code);
  10488. #if !CYTHON_COMPILING_IN_LIMITED_API
  10489. #if PY_VERSION_HEX < 0x030900B1
  10490. Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
  10491. #else
  10492. {
  10493. PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
  10494. ((PyCMethodObject *) (m))->mm_class = NULL;
  10495. Py_XDECREF(cls);
  10496. }
  10497. #endif
  10498. #endif
  10499. Py_CLEAR(m->defaults_tuple);
  10500. Py_CLEAR(m->defaults_kwdict);
  10501. Py_CLEAR(m->func_annotations);
  10502. Py_CLEAR(m->func_is_coroutine);
  10503. Py_CLEAR(m->defaults);
  10504. return 0;
  10505. }
  10506. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  10507. {
  10508. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  10509. PyObject_ClearWeakRefs((PyObject *) m);
  10510. __Pyx_CyFunction_clear(m);
  10511. __Pyx_PyHeapTypeObject_GC_Del(m);
  10512. }
  10513. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  10514. {
  10515. PyObject_GC_UnTrack(m);
  10516. __Pyx__CyFunction_dealloc(m);
  10517. }
  10518. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  10519. {
  10520. {
  10521. int e = __Pyx_call_type_traverse((PyObject*)m, 1, visit, arg);
  10522. if (e) return e;
  10523. }
  10524. Py_VISIT(m->func_closure);
  10525. #if CYTHON_COMPILING_IN_LIMITED_API
  10526. Py_VISIT(m->func);
  10527. #else
  10528. Py_VISIT(((PyCFunctionObject*)m)->m_module);
  10529. #endif
  10530. #if PY_VERSION_HEX < 0x030C0000 || CYTHON_COMPILING_IN_LIMITED_API
  10531. Py_VISIT(m->func_dict);
  10532. #else
  10533. {
  10534. int e =
  10535. #if PY_VERSION_HEX < 0x030d0000
  10536. _PyObject_VisitManagedDict
  10537. #else
  10538. PyObject_VisitManagedDict
  10539. #endif
  10540. ((PyObject*)m, visit, arg);
  10541. if (e != 0) return e;
  10542. }
  10543. #endif
  10544. __Pyx_VISIT_CONST(m->func_name);
  10545. __Pyx_VISIT_CONST(m->func_qualname);
  10546. Py_VISIT(m->func_doc);
  10547. Py_VISIT(m->func_globals);
  10548. __Pyx_VISIT_CONST(m->func_code);
  10549. #if !CYTHON_COMPILING_IN_LIMITED_API
  10550. Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
  10551. #endif
  10552. Py_VISIT(m->defaults_tuple);
  10553. Py_VISIT(m->defaults_kwdict);
  10554. Py_VISIT(m->func_is_coroutine);
  10555. Py_VISIT(m->defaults);
  10556. return 0;
  10557. }
  10558. static PyObject*
  10559. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  10560. {
  10561. PyObject *repr;
  10562. __Pyx_BEGIN_CRITICAL_SECTION(op);
  10563. repr = PyUnicode_FromFormat("<cyfunction %U at %p>",
  10564. op->func_qualname, (void *)op);
  10565. __Pyx_END_CRITICAL_SECTION();
  10566. return repr;
  10567. }
  10568. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  10569. #if CYTHON_COMPILING_IN_LIMITED_API
  10570. PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
  10571. PyCFunction meth;
  10572. int flags;
  10573. meth = PyCFunction_GetFunction(f);
  10574. if (unlikely(!meth)) return NULL;
  10575. flags = PyCFunction_GetFlags(f);
  10576. if (unlikely(flags < 0)) return NULL;
  10577. #else
  10578. PyCFunctionObject* f = (PyCFunctionObject*)func;
  10579. PyCFunction meth = f->m_ml->ml_meth;
  10580. int flags = f->m_ml->ml_flags;
  10581. #endif
  10582. Py_ssize_t size;
  10583. switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  10584. case METH_VARARGS:
  10585. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  10586. return (*meth)(self, arg);
  10587. break;
  10588. case METH_VARARGS | METH_KEYWORDS:
  10589. return (*(PyCFunctionWithKeywords)(void(*)(void))meth)(self, arg, kw);
  10590. case METH_NOARGS:
  10591. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  10592. #if CYTHON_ASSUME_SAFE_SIZE
  10593. size = PyTuple_GET_SIZE(arg);
  10594. #else
  10595. size = PyTuple_Size(arg);
  10596. if (unlikely(size < 0)) return NULL;
  10597. #endif
  10598. if (likely(size == 0))
  10599. return (*meth)(self, NULL);
  10600. __Pyx_CyFunction_raise_argument_count_error(
  10601. (__pyx_CyFunctionObject*)func,
  10602. "takes no arguments", size);
  10603. return NULL;
  10604. }
  10605. break;
  10606. case METH_O:
  10607. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  10608. #if CYTHON_ASSUME_SAFE_SIZE
  10609. size = PyTuple_GET_SIZE(arg);
  10610. #else
  10611. size = PyTuple_Size(arg);
  10612. if (unlikely(size < 0)) return NULL;
  10613. #endif
  10614. if (likely(size == 1)) {
  10615. PyObject *result, *arg0;
  10616. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10617. arg0 = PyTuple_GET_ITEM(arg, 0);
  10618. #else
  10619. arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  10620. #endif
  10621. result = (*meth)(self, arg0);
  10622. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  10623. Py_DECREF(arg0);
  10624. #endif
  10625. return result;
  10626. }
  10627. __Pyx_CyFunction_raise_argument_count_error(
  10628. (__pyx_CyFunctionObject*)func,
  10629. "takes exactly one argument", size);
  10630. return NULL;
  10631. }
  10632. break;
  10633. default:
  10634. PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
  10635. return NULL;
  10636. }
  10637. __Pyx_CyFunction_raise_type_error(
  10638. (__pyx_CyFunctionObject*)func, "takes no keyword arguments");
  10639. return NULL;
  10640. }
  10641. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  10642. PyObject *self, *result;
  10643. #if CYTHON_COMPILING_IN_LIMITED_API
  10644. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
  10645. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  10646. #else
  10647. self = ((PyCFunctionObject*)func)->m_self;
  10648. #endif
  10649. result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
  10650. return result;
  10651. }
  10652. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  10653. PyObject *result;
  10654. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  10655. #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  10656. __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
  10657. if (vc) {
  10658. #if CYTHON_ASSUME_SAFE_MACROS && CYTHON_ASSUME_SAFE_SIZE
  10659. return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
  10660. #else
  10661. (void) &__Pyx_PyVectorcall_FastCallDict;
  10662. return PyVectorcall_Call(func, args, kw);
  10663. #endif
  10664. }
  10665. #endif
  10666. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  10667. Py_ssize_t argc;
  10668. PyObject *new_args;
  10669. PyObject *self;
  10670. #if CYTHON_ASSUME_SAFE_SIZE
  10671. argc = PyTuple_GET_SIZE(args);
  10672. #else
  10673. argc = PyTuple_Size(args);
  10674. if (unlikely(argc < 0)) return NULL;
  10675. #endif
  10676. new_args = PyTuple_GetSlice(args, 1, argc);
  10677. if (unlikely(!new_args))
  10678. return NULL;
  10679. self = PyTuple_GetItem(args, 0);
  10680. if (unlikely(!self)) {
  10681. Py_DECREF(new_args);
  10682. PyErr_Format(PyExc_TypeError,
  10683. "unbound method %.200S() needs an argument",
  10684. cyfunc->func_qualname);
  10685. return NULL;
  10686. }
  10687. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  10688. Py_DECREF(new_args);
  10689. } else {
  10690. result = __Pyx_CyFunction_Call(func, args, kw);
  10691. }
  10692. return result;
  10693. }
  10694. #if CYTHON_METH_FASTCALL && CYTHON_VECTORCALL
  10695. static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
  10696. {
  10697. int ret = 0;
  10698. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  10699. if (unlikely(nargs < 1)) {
  10700. __Pyx_CyFunction_raise_type_error(
  10701. cyfunc, "needs an argument");
  10702. return -1;
  10703. }
  10704. ret = 1;
  10705. }
  10706. if (unlikely(kwnames) && unlikely(__Pyx_PyTuple_GET_SIZE(kwnames))) {
  10707. __Pyx_CyFunction_raise_type_error(
  10708. cyfunc, "takes no keyword arguments");
  10709. return -1;
  10710. }
  10711. return ret;
  10712. }
  10713. static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  10714. {
  10715. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  10716. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  10717. PyObject *self;
  10718. #if CYTHON_COMPILING_IN_LIMITED_API
  10719. PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
  10720. if (unlikely(!meth)) return NULL;
  10721. #else
  10722. PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  10723. #endif
  10724. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
  10725. case 1:
  10726. self = args[0];
  10727. args += 1;
  10728. nargs -= 1;
  10729. break;
  10730. case 0:
  10731. #if CYTHON_COMPILING_IN_LIMITED_API
  10732. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
  10733. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  10734. #else
  10735. self = ((PyCFunctionObject*)cyfunc)->m_self;
  10736. #endif
  10737. break;
  10738. default:
  10739. return NULL;
  10740. }
  10741. if (unlikely(nargs != 0)) {
  10742. __Pyx_CyFunction_raise_argument_count_error(
  10743. cyfunc, "takes no arguments", nargs);
  10744. return NULL;
  10745. }
  10746. return meth(self, NULL);
  10747. }
  10748. static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  10749. {
  10750. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  10751. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  10752. PyObject *self;
  10753. #if CYTHON_COMPILING_IN_LIMITED_API
  10754. PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
  10755. if (unlikely(!meth)) return NULL;
  10756. #else
  10757. PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  10758. #endif
  10759. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
  10760. case 1:
  10761. self = args[0];
  10762. args += 1;
  10763. nargs -= 1;
  10764. break;
  10765. case 0:
  10766. #if CYTHON_COMPILING_IN_LIMITED_API
  10767. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
  10768. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  10769. #else
  10770. self = ((PyCFunctionObject*)cyfunc)->m_self;
  10771. #endif
  10772. break;
  10773. default:
  10774. return NULL;
  10775. }
  10776. if (unlikely(nargs != 1)) {
  10777. __Pyx_CyFunction_raise_argument_count_error(
  10778. cyfunc, "takes exactly one argument", nargs);
  10779. return NULL;
  10780. }
  10781. return meth(self, args[0]);
  10782. }
  10783. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  10784. {
  10785. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  10786. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  10787. PyObject *self;
  10788. #if CYTHON_COMPILING_IN_LIMITED_API
  10789. PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
  10790. if (unlikely(!meth)) return NULL;
  10791. #else
  10792. PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  10793. #endif
  10794. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
  10795. case 1:
  10796. self = args[0];
  10797. args += 1;
  10798. nargs -= 1;
  10799. break;
  10800. case 0:
  10801. #if CYTHON_COMPILING_IN_LIMITED_API
  10802. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
  10803. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  10804. #else
  10805. self = ((PyCFunctionObject*)cyfunc)->m_self;
  10806. #endif
  10807. break;
  10808. default:
  10809. return NULL;
  10810. }
  10811. return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))meth)(self, args, nargs, kwnames);
  10812. }
  10813. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  10814. {
  10815. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  10816. PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
  10817. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  10818. PyObject *self;
  10819. #if CYTHON_COMPILING_IN_LIMITED_API
  10820. PyCFunction meth = PyCFunction_GetFunction(cyfunc->func);
  10821. if (unlikely(!meth)) return NULL;
  10822. #else
  10823. PyCFunction meth = ((PyCFunctionObject*)cyfunc)->m_ml->ml_meth;
  10824. #endif
  10825. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
  10826. case 1:
  10827. self = args[0];
  10828. args += 1;
  10829. nargs -= 1;
  10830. break;
  10831. case 0:
  10832. #if CYTHON_COMPILING_IN_LIMITED_API
  10833. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)cyfunc)->func);
  10834. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  10835. #else
  10836. self = ((PyCFunctionObject*)cyfunc)->m_self;
  10837. #endif
  10838. break;
  10839. default:
  10840. return NULL;
  10841. }
  10842. #if PY_VERSION_HEX < 0x030e00A6
  10843. size_t nargs_value = (size_t) nargs;
  10844. #else
  10845. Py_ssize_t nargs_value = nargs;
  10846. #endif
  10847. return ((__Pyx_PyCMethod)(void(*)(void))meth)(self, cls, args, nargs_value, kwnames);
  10848. }
  10849. #endif
  10850. static PyType_Slot __pyx_CyFunctionType_slots[] = {
  10851. {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
  10852. {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
  10853. {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
  10854. {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
  10855. {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
  10856. {Py_tp_methods, (void *)__pyx_CyFunction_methods},
  10857. {Py_tp_members, (void *)__pyx_CyFunction_members},
  10858. {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
  10859. {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
  10860. {0, 0},
  10861. };
  10862. static PyType_Spec __pyx_CyFunctionType_spec = {
  10863. __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
  10864. sizeof(__pyx_CyFunctionObject),
  10865. 0,
  10866. #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
  10867. Py_TPFLAGS_METHOD_DESCRIPTOR |
  10868. #endif
  10869. #if CYTHON_METH_FASTCALL
  10870. #if defined(Py_TPFLAGS_HAVE_VECTORCALL)
  10871. Py_TPFLAGS_HAVE_VECTORCALL |
  10872. #elif defined(_Py_TPFLAGS_HAVE_VECTORCALL)
  10873. _Py_TPFLAGS_HAVE_VECTORCALL |
  10874. #endif
  10875. #endif // CYTHON_METH_FASTCALL
  10876. #if PY_VERSION_HEX >= 0x030C0000 && !CYTHON_COMPILING_IN_LIMITED_API
  10877. Py_TPFLAGS_MANAGED_DICT |
  10878. #endif
  10879. Py_TPFLAGS_IMMUTABLETYPE | Py_TPFLAGS_DISALLOW_INSTANTIATION |
  10880. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
  10881. __pyx_CyFunctionType_slots
  10882. };
  10883. static int __pyx_CyFunction_init(PyObject *module) {
  10884. __pyx_mstatetype *mstate = __Pyx_PyModule_GetState(module);
  10885. mstate->__pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(
  10886. mstate->__pyx_CommonTypesMetaclassType, module, &__pyx_CyFunctionType_spec, NULL);
  10887. if (unlikely(mstate->__pyx_CyFunctionType == NULL)) {
  10888. return -1;
  10889. }
  10890. return 0;
  10891. }
  10892. static CYTHON_INLINE PyObject *__Pyx_CyFunction_InitDefaults(PyObject *func, PyTypeObject *defaults_type) {
  10893. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  10894. m->defaults = PyObject_CallObject((PyObject*)defaults_type, NULL); // _PyObject_New(defaults_type);
  10895. if (unlikely(!m->defaults))
  10896. return NULL;
  10897. return m->defaults;
  10898. }
  10899. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  10900. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  10901. m->defaults_tuple = tuple;
  10902. Py_INCREF(tuple);
  10903. }
  10904. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  10905. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  10906. m->defaults_kwdict = dict;
  10907. Py_INCREF(dict);
  10908. }
  10909. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  10910. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  10911. m->func_annotations = dict;
  10912. Py_INCREF(dict);
  10913. }
  10914. /* CythonFunction */
  10915. static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
  10916. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  10917. PyObject *op = __Pyx_CyFunction_Init(
  10918. PyObject_GC_New(__pyx_CyFunctionObject, __pyx_mstate_global->__pyx_CyFunctionType),
  10919. ml, flags, qualname, closure, module, globals, code
  10920. );
  10921. if (likely(op)) {
  10922. PyObject_GC_Track(op);
  10923. }
  10924. return op;
  10925. }
  10926. /* PyObjectCall2Args (used by Py3ClassCreate) */
  10927. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  10928. PyObject *args[3] = {NULL, arg1, arg2};
  10929. return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
  10930. }
  10931. /* PyObjectLookupSpecial (used by Py3ClassCreate) */
  10932. #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  10933. static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
  10934. PyObject *res;
  10935. PyTypeObject *tp = Py_TYPE(obj);
  10936. res = _PyType_Lookup(tp, attr_name);
  10937. if (likely(res)) {
  10938. descrgetfunc f = Py_TYPE(res)->tp_descr_get;
  10939. if (!f) {
  10940. Py_INCREF(res);
  10941. } else {
  10942. res = f(res, obj, (PyObject *)tp);
  10943. }
  10944. } else if (with_error) {
  10945. PyErr_SetObject(PyExc_AttributeError, attr_name);
  10946. }
  10947. return res;
  10948. }
  10949. #endif
  10950. /* Py3ClassCreate */
  10951. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  10952. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  10953. PyObject *ns;
  10954. if (metaclass) {
  10955. PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_mstate_global->__pyx_n_u_prepare);
  10956. if (prep) {
  10957. PyObject *pargs[3] = {NULL, name, bases};
  10958. ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
  10959. Py_DECREF(prep);
  10960. } else {
  10961. if (unlikely(PyErr_Occurred()))
  10962. return NULL;
  10963. ns = PyDict_New();
  10964. }
  10965. } else {
  10966. ns = PyDict_New();
  10967. }
  10968. if (unlikely(!ns))
  10969. return NULL;
  10970. if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_module, modname) < 0)) goto bad;
  10971. if (unlikely(PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_qualname, qualname) < 0)) goto bad;
  10972. if (unlikely(doc && PyObject_SetItem(ns, __pyx_mstate_global->__pyx_n_u_doc, doc) < 0)) goto bad;
  10973. return ns;
  10974. bad:
  10975. Py_DECREF(ns);
  10976. return NULL;
  10977. }
  10978. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  10979. PyObject *dict, PyObject *mkw,
  10980. int calculate_metaclass, int allow_py2_metaclass) {
  10981. PyObject *result;
  10982. PyObject *owned_metaclass = NULL;
  10983. PyObject *margs[4] = {NULL, name, bases, dict};
  10984. if (allow_py2_metaclass) {
  10985. owned_metaclass = PyObject_GetItem(dict, __pyx_mstate_global->__pyx_n_u_metaclass);
  10986. if (owned_metaclass) {
  10987. metaclass = owned_metaclass;
  10988. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  10989. PyErr_Clear();
  10990. } else {
  10991. return NULL;
  10992. }
  10993. }
  10994. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  10995. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  10996. Py_XDECREF(owned_metaclass);
  10997. if (unlikely(!metaclass))
  10998. return NULL;
  10999. owned_metaclass = metaclass;
  11000. }
  11001. result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
  11002. Py_XDECREF(owned_metaclass);
  11003. return result;
  11004. }
  11005. /* CLineInTraceback (used by AddTraceback) */
  11006. #if CYTHON_CLINE_IN_TRACEBACK && CYTHON_CLINE_IN_TRACEBACK_RUNTIME
  11007. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030A0000
  11008. #define __Pyx_PyProbablyModule_GetDict(o) __Pyx_XNewRef(PyModule_GetDict(o))
  11009. #elif !CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  11010. #define __Pyx_PyProbablyModule_GetDict(o) PyObject_GenericGetDict(o, NULL);
  11011. #else
  11012. PyObject* __Pyx_PyProbablyModule_GetDict(PyObject *o) {
  11013. PyObject **dict_ptr = _PyObject_GetDictPtr(o);
  11014. return dict_ptr ? __Pyx_XNewRef(*dict_ptr) : NULL;
  11015. }
  11016. #endif
  11017. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
  11018. PyObject *use_cline = NULL;
  11019. PyObject *ptype, *pvalue, *ptraceback;
  11020. PyObject *cython_runtime_dict;
  11021. CYTHON_MAYBE_UNUSED_VAR(tstate);
  11022. if (unlikely(!__pyx_mstate_global->__pyx_cython_runtime)) {
  11023. return c_line;
  11024. }
  11025. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  11026. cython_runtime_dict = __Pyx_PyProbablyModule_GetDict(__pyx_mstate_global->__pyx_cython_runtime);
  11027. if (likely(cython_runtime_dict)) {
  11028. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  11029. use_cline, cython_runtime_dict,
  11030. __Pyx_PyDict_SetDefault(cython_runtime_dict, __pyx_mstate_global->__pyx_n_u_cline_in_traceback, Py_False))
  11031. }
  11032. if (use_cline == NULL || use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  11033. c_line = 0;
  11034. }
  11035. Py_XDECREF(use_cline);
  11036. Py_XDECREF(cython_runtime_dict);
  11037. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  11038. return c_line;
  11039. }
  11040. #endif
  11041. /* CodeObjectCache (used by AddTraceback) */
  11042. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  11043. int start = 0, mid = 0, end = count - 1;
  11044. if (end >= 0 && code_line > entries[end].code_line) {
  11045. return count;
  11046. }
  11047. while (start < end) {
  11048. mid = start + (end - start) / 2;
  11049. if (code_line < entries[mid].code_line) {
  11050. end = mid;
  11051. } else if (code_line > entries[mid].code_line) {
  11052. start = mid + 1;
  11053. } else {
  11054. return mid;
  11055. }
  11056. }
  11057. if (code_line <= entries[mid].code_line) {
  11058. return mid;
  11059. } else {
  11060. return mid + 1;
  11061. }
  11062. }
  11063. static __Pyx_CachedCodeObjectType *__pyx__find_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line) {
  11064. __Pyx_CachedCodeObjectType* code_object;
  11065. int pos;
  11066. if (unlikely(!code_line) || unlikely(!code_cache->entries)) {
  11067. return NULL;
  11068. }
  11069. pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
  11070. if (unlikely(pos >= code_cache->count) || unlikely(code_cache->entries[pos].code_line != code_line)) {
  11071. return NULL;
  11072. }
  11073. code_object = code_cache->entries[pos].code_object;
  11074. Py_INCREF(code_object);
  11075. return code_object;
  11076. }
  11077. static __Pyx_CachedCodeObjectType *__pyx_find_code_object(int code_line) {
  11078. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
  11079. (void)__pyx__find_code_object;
  11080. return NULL; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just miss.
  11081. #else
  11082. struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
  11083. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  11084. __pyx_nonatomic_int_type old_count = __pyx_atomic_incr_acq_rel(&code_cache->accessor_count);
  11085. if (old_count < 0) {
  11086. __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
  11087. return NULL;
  11088. }
  11089. #endif
  11090. __Pyx_CachedCodeObjectType *result = __pyx__find_code_object(code_cache, code_line);
  11091. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  11092. __pyx_atomic_decr_acq_rel(&code_cache->accessor_count);
  11093. #endif
  11094. return result;
  11095. #endif
  11096. }
  11097. static void __pyx__insert_code_object(struct __Pyx_CodeObjectCache *code_cache, int code_line, __Pyx_CachedCodeObjectType* code_object)
  11098. {
  11099. int pos, i;
  11100. __Pyx_CodeObjectCacheEntry* entries = code_cache->entries;
  11101. if (unlikely(!code_line)) {
  11102. return;
  11103. }
  11104. if (unlikely(!entries)) {
  11105. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  11106. if (likely(entries)) {
  11107. code_cache->entries = entries;
  11108. code_cache->max_count = 64;
  11109. code_cache->count = 1;
  11110. entries[0].code_line = code_line;
  11111. entries[0].code_object = code_object;
  11112. Py_INCREF(code_object);
  11113. }
  11114. return;
  11115. }
  11116. pos = __pyx_bisect_code_objects(code_cache->entries, code_cache->count, code_line);
  11117. if ((pos < code_cache->count) && unlikely(code_cache->entries[pos].code_line == code_line)) {
  11118. __Pyx_CachedCodeObjectType* tmp = entries[pos].code_object;
  11119. entries[pos].code_object = code_object;
  11120. Py_INCREF(code_object);
  11121. Py_DECREF(tmp);
  11122. return;
  11123. }
  11124. if (code_cache->count == code_cache->max_count) {
  11125. int new_max = code_cache->max_count + 64;
  11126. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  11127. code_cache->entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  11128. if (unlikely(!entries)) {
  11129. return;
  11130. }
  11131. code_cache->entries = entries;
  11132. code_cache->max_count = new_max;
  11133. }
  11134. for (i=code_cache->count; i>pos; i--) {
  11135. entries[i] = entries[i-1];
  11136. }
  11137. entries[pos].code_line = code_line;
  11138. entries[pos].code_object = code_object;
  11139. code_cache->count++;
  11140. Py_INCREF(code_object);
  11141. }
  11142. static void __pyx_insert_code_object(int code_line, __Pyx_CachedCodeObjectType* code_object) {
  11143. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING && !CYTHON_ATOMICS
  11144. (void)__pyx__insert_code_object;
  11145. return; // Most implementation should have atomics. But otherwise, don't make it thread-safe, just fail.
  11146. #else
  11147. struct __Pyx_CodeObjectCache *code_cache = &__pyx_mstate_global->__pyx_code_cache;
  11148. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  11149. __pyx_nonatomic_int_type expected = 0;
  11150. if (!__pyx_atomic_int_cmp_exchange(&code_cache->accessor_count, &expected, INT_MIN)) {
  11151. return;
  11152. }
  11153. #endif
  11154. __pyx__insert_code_object(code_cache, code_line, code_object);
  11155. #if CYTHON_COMPILING_IN_CPYTHON_FREETHREADING
  11156. __pyx_atomic_sub(&code_cache->accessor_count, INT_MIN);
  11157. #endif
  11158. #endif
  11159. }
  11160. /* AddTraceback */
  11161. #include "compile.h"
  11162. #include "frameobject.h"
  11163. #include "traceback.h"
  11164. #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API && !defined(PYPY_VERSION)
  11165. #ifndef Py_BUILD_CORE
  11166. #define Py_BUILD_CORE 1
  11167. #endif
  11168. #include "internal/pycore_frame.h"
  11169. #endif
  11170. #if CYTHON_COMPILING_IN_LIMITED_API
  11171. static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
  11172. PyObject *firstlineno, PyObject *name) {
  11173. PyObject *replace = NULL;
  11174. if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
  11175. if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
  11176. replace = PyObject_GetAttrString(code, "replace");
  11177. if (likely(replace)) {
  11178. PyObject *result = PyObject_Call(replace, __pyx_mstate_global->__pyx_empty_tuple, scratch_dict);
  11179. Py_DECREF(replace);
  11180. return result;
  11181. }
  11182. PyErr_Clear();
  11183. return NULL;
  11184. }
  11185. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  11186. int py_line, const char *filename) {
  11187. PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
  11188. PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
  11189. PyObject *exc_type, *exc_value, *exc_traceback;
  11190. int success = 0;
  11191. if (c_line) {
  11192. c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
  11193. }
  11194. PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
  11195. code_object = __pyx_find_code_object(c_line ? -c_line : py_line);
  11196. if (!code_object) {
  11197. code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
  11198. if (unlikely(!code_object)) goto bad;
  11199. py_py_line = PyLong_FromLong(py_line);
  11200. if (unlikely(!py_py_line)) goto bad;
  11201. if (c_line) {
  11202. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  11203. } else {
  11204. py_funcname = PyUnicode_FromString(funcname);
  11205. }
  11206. if (unlikely(!py_funcname)) goto bad;
  11207. dict = PyDict_New();
  11208. if (unlikely(!dict)) goto bad;
  11209. {
  11210. PyObject *old_code_object = code_object;
  11211. code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
  11212. Py_DECREF(old_code_object);
  11213. }
  11214. if (unlikely(!code_object)) goto bad;
  11215. __pyx_insert_code_object(c_line ? -c_line : py_line, code_object);
  11216. } else {
  11217. dict = PyDict_New();
  11218. }
  11219. getframe = PySys_GetObject("_getframe");
  11220. if (unlikely(!getframe)) goto bad;
  11221. if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
  11222. frame = PyEval_EvalCode(code_object, dict, dict);
  11223. if (unlikely(!frame) || frame == Py_None) goto bad;
  11224. success = 1;
  11225. bad:
  11226. PyErr_Restore(exc_type, exc_value, exc_traceback);
  11227. Py_XDECREF(code_object);
  11228. Py_XDECREF(py_py_line);
  11229. Py_XDECREF(py_funcname);
  11230. Py_XDECREF(dict);
  11231. Py_XDECREF(replace);
  11232. if (success) {
  11233. PyTraceBack_Here(
  11234. (struct _frame*)frame);
  11235. }
  11236. Py_XDECREF(frame);
  11237. }
  11238. #else
  11239. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  11240. const char *funcname, int c_line,
  11241. int py_line, const char *filename) {
  11242. PyCodeObject *py_code = NULL;
  11243. PyObject *py_funcname = NULL;
  11244. if (c_line) {
  11245. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  11246. if (!py_funcname) goto bad;
  11247. funcname = PyUnicode_AsUTF8(py_funcname);
  11248. if (!funcname) goto bad;
  11249. }
  11250. py_code = PyCode_NewEmpty(filename, funcname, py_line);
  11251. Py_XDECREF(py_funcname);
  11252. return py_code;
  11253. bad:
  11254. Py_XDECREF(py_funcname);
  11255. return NULL;
  11256. }
  11257. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  11258. int py_line, const char *filename) {
  11259. PyCodeObject *py_code = 0;
  11260. PyFrameObject *py_frame = 0;
  11261. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  11262. PyObject *ptype, *pvalue, *ptraceback;
  11263. if (c_line) {
  11264. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  11265. }
  11266. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  11267. if (!py_code) {
  11268. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  11269. py_code = __Pyx_CreateCodeObjectForTraceback(
  11270. funcname, c_line, py_line, filename);
  11271. if (!py_code) {
  11272. /* If the code object creation fails, then we should clear the
  11273. fetched exception references and propagate the new exception */
  11274. Py_XDECREF(ptype);
  11275. Py_XDECREF(pvalue);
  11276. Py_XDECREF(ptraceback);
  11277. goto bad;
  11278. }
  11279. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  11280. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  11281. }
  11282. py_frame = PyFrame_New(
  11283. tstate, /*PyThreadState *tstate,*/
  11284. py_code, /*PyCodeObject *code,*/
  11285. __pyx_mstate_global->__pyx_d, /*PyObject *globals,*/
  11286. 0 /*PyObject *locals*/
  11287. );
  11288. if (!py_frame) goto bad;
  11289. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  11290. PyTraceBack_Here(py_frame);
  11291. bad:
  11292. Py_XDECREF(py_code);
  11293. Py_XDECREF(py_frame);
  11294. }
  11295. #endif
  11296. /* FormatTypeName */
  11297. #if CYTHON_COMPILING_IN_LIMITED_API && __PYX_LIMITED_VERSION_HEX < 0x030d0000
  11298. static __Pyx_TypeName
  11299. __Pyx_PyType_GetFullyQualifiedName(PyTypeObject* tp)
  11300. {
  11301. PyObject *module = NULL, *name = NULL, *result = NULL;
  11302. #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  11303. name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
  11304. __pyx_mstate_global->__pyx_n_u_qualname);
  11305. #else
  11306. name = PyType_GetQualName(tp);
  11307. #endif
  11308. if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) goto bad;
  11309. module = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
  11310. __pyx_mstate_global->__pyx_n_u_module);
  11311. if (unlikely(module == NULL) || unlikely(!PyUnicode_Check(module))) goto bad;
  11312. if (PyUnicode_CompareWithASCIIString(module, "builtins") == 0) {
  11313. result = name;
  11314. name = NULL;
  11315. goto done;
  11316. }
  11317. result = PyUnicode_FromFormat("%U.%U", module, name);
  11318. if (unlikely(result == NULL)) goto bad;
  11319. done:
  11320. Py_XDECREF(name);
  11321. Py_XDECREF(module);
  11322. return result;
  11323. bad:
  11324. PyErr_Clear();
  11325. if (name) {
  11326. result = name;
  11327. name = NULL;
  11328. } else {
  11329. result = __Pyx_NewRef(__pyx_mstate_global->__pyx_kp_u__2);
  11330. }
  11331. goto done;
  11332. }
  11333. #endif
  11334. /* PyObjectVectorCallKwBuilder (used by CIntToPy) */
  11335. #if CYTHON_VECTORCALL
  11336. static int __Pyx_VectorcallBuilder_AddArg(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
  11337. (void)__Pyx_PyObject_FastCallDict;
  11338. if (__Pyx_PyTuple_SET_ITEM(builder, n, key) != (0)) return -1;
  11339. Py_INCREF(key);
  11340. args[n] = value;
  11341. return 0;
  11342. }
  11343. CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
  11344. (void)__Pyx_VectorcallBuilder_AddArgStr;
  11345. if (unlikely(!PyUnicode_Check(key))) {
  11346. PyErr_SetString(PyExc_TypeError, "keywords must be strings");
  11347. return -1;
  11348. }
  11349. return __Pyx_VectorcallBuilder_AddArg(key, value, builder, args, n);
  11350. }
  11351. static int __Pyx_VectorcallBuilder_AddArgStr(const char *key, PyObject *value, PyObject *builder, PyObject **args, int n) {
  11352. PyObject *pyKey = PyUnicode_FromString(key);
  11353. if (!pyKey) return -1;
  11354. return __Pyx_VectorcallBuilder_AddArg(pyKey, value, builder, args, n);
  11355. }
  11356. #else // CYTHON_VECTORCALL
  11357. CYTHON_UNUSED static int __Pyx_VectorcallBuilder_AddArg_Check(PyObject *key, PyObject *value, PyObject *builder, CYTHON_UNUSED PyObject **args, CYTHON_UNUSED int n) {
  11358. if (unlikely(!PyUnicode_Check(key))) {
  11359. PyErr_SetString(PyExc_TypeError, "keywords must be strings");
  11360. return -1;
  11361. }
  11362. return PyDict_SetItem(builder, key, value);
  11363. }
  11364. #endif
  11365. /* CIntToPy */
  11366. static CYTHON_INLINE PyObject* __Pyx_PyLong_From_long(long value) {
  11367. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11368. #pragma GCC diagnostic push
  11369. #pragma GCC diagnostic ignored "-Wconversion"
  11370. #endif
  11371. const long neg_one = (long) -1, const_zero = (long) 0;
  11372. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11373. #pragma GCC diagnostic pop
  11374. #endif
  11375. const int is_unsigned = neg_one > const_zero;
  11376. if (is_unsigned) {
  11377. if (sizeof(long) < sizeof(long)) {
  11378. return PyLong_FromLong((long) value);
  11379. } else if (sizeof(long) <= sizeof(unsigned long)) {
  11380. return PyLong_FromUnsignedLong((unsigned long) value);
  11381. #if !CYTHON_COMPILING_IN_PYPY
  11382. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  11383. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  11384. #endif
  11385. }
  11386. } else {
  11387. if (sizeof(long) <= sizeof(long)) {
  11388. return PyLong_FromLong((long) value);
  11389. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  11390. return PyLong_FromLongLong((PY_LONG_LONG) value);
  11391. }
  11392. }
  11393. {
  11394. unsigned char *bytes = (unsigned char *)&value;
  11395. #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
  11396. if (is_unsigned) {
  11397. return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
  11398. } else {
  11399. return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
  11400. }
  11401. #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
  11402. int one = 1; int little = (int)*(unsigned char *)&one;
  11403. return _PyLong_FromByteArray(bytes, sizeof(long),
  11404. little, !is_unsigned);
  11405. #else
  11406. int one = 1; int little = (int)*(unsigned char *)&one;
  11407. PyObject *from_bytes, *result = NULL, *kwds = NULL;
  11408. PyObject *py_bytes = NULL, *order_str = NULL;
  11409. from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
  11410. if (!from_bytes) return NULL;
  11411. py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
  11412. if (!py_bytes) goto limited_bad;
  11413. order_str = PyUnicode_FromString(little ? "little" : "big");
  11414. if (!order_str) goto limited_bad;
  11415. {
  11416. PyObject *args[3+(CYTHON_VECTORCALL ? 1 : 0)] = { NULL, py_bytes, order_str };
  11417. if (!is_unsigned) {
  11418. kwds = __Pyx_MakeVectorcallBuilderKwds(1);
  11419. if (!kwds) goto limited_bad;
  11420. if (__Pyx_VectorcallBuilder_AddArgStr("signed", __Pyx_NewRef(Py_True), kwds, args+3, 0) < 0) goto limited_bad;
  11421. }
  11422. result = __Pyx_Object_Vectorcall_CallFromBuilder(from_bytes, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, kwds);
  11423. }
  11424. limited_bad:
  11425. Py_XDECREF(kwds);
  11426. Py_XDECREF(order_str);
  11427. Py_XDECREF(py_bytes);
  11428. Py_XDECREF(from_bytes);
  11429. return result;
  11430. #endif
  11431. }
  11432. }
  11433. /* CIntFromPyVerify (used by CIntFromPy) */
  11434. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  11435. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  11436. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  11437. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  11438. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  11439. {\
  11440. func_type value = func_value;\
  11441. if (sizeof(target_type) < sizeof(func_type)) {\
  11442. if (unlikely(value != (func_type) (target_type) value)) {\
  11443. func_type zero = 0;\
  11444. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  11445. return (target_type) -1;\
  11446. if (is_unsigned && unlikely(value < zero))\
  11447. goto raise_neg_overflow;\
  11448. else\
  11449. goto raise_overflow;\
  11450. }\
  11451. }\
  11452. return (target_type) value;\
  11453. }
  11454. /* CIntFromPy */
  11455. static CYTHON_INLINE long __Pyx_PyLong_As_long(PyObject *x) {
  11456. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11457. #pragma GCC diagnostic push
  11458. #pragma GCC diagnostic ignored "-Wconversion"
  11459. #endif
  11460. const long neg_one = (long) -1, const_zero = (long) 0;
  11461. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11462. #pragma GCC diagnostic pop
  11463. #endif
  11464. const int is_unsigned = neg_one > const_zero;
  11465. if (unlikely(!PyLong_Check(x))) {
  11466. long val;
  11467. PyObject *tmp = __Pyx_PyNumber_Long(x);
  11468. if (!tmp) return (long) -1;
  11469. val = __Pyx_PyLong_As_long(tmp);
  11470. Py_DECREF(tmp);
  11471. return val;
  11472. }
  11473. if (is_unsigned) {
  11474. #if CYTHON_USE_PYLONG_INTERNALS
  11475. if (unlikely(__Pyx_PyLong_IsNeg(x))) {
  11476. goto raise_neg_overflow;
  11477. } else if (__Pyx_PyLong_IsCompact(x)) {
  11478. __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
  11479. } else {
  11480. const digit* digits = __Pyx_PyLong_Digits(x);
  11481. assert(__Pyx_PyLong_DigitCount(x) > 1);
  11482. switch (__Pyx_PyLong_DigitCount(x)) {
  11483. case 2:
  11484. if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
  11485. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11486. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11487. } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
  11488. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  11489. }
  11490. }
  11491. break;
  11492. case 3:
  11493. if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
  11494. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11495. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11496. } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
  11497. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  11498. }
  11499. }
  11500. break;
  11501. case 4:
  11502. if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
  11503. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11504. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11505. } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
  11506. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  11507. }
  11508. }
  11509. break;
  11510. }
  11511. }
  11512. #endif
  11513. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
  11514. if (unlikely(Py_SIZE(x) < 0)) {
  11515. goto raise_neg_overflow;
  11516. }
  11517. #else
  11518. {
  11519. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  11520. if (unlikely(result < 0))
  11521. return (long) -1;
  11522. if (unlikely(result == 1))
  11523. goto raise_neg_overflow;
  11524. }
  11525. #endif
  11526. if ((sizeof(long) <= sizeof(unsigned long))) {
  11527. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  11528. } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
  11529. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  11530. }
  11531. } else {
  11532. #if CYTHON_USE_PYLONG_INTERNALS
  11533. if (__Pyx_PyLong_IsCompact(x)) {
  11534. __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
  11535. } else {
  11536. const digit* digits = __Pyx_PyLong_Digits(x);
  11537. assert(__Pyx_PyLong_DigitCount(x) > 1);
  11538. switch (__Pyx_PyLong_SignedDigitCount(x)) {
  11539. case -2:
  11540. if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
  11541. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11542. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11543. } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  11544. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11545. }
  11546. }
  11547. break;
  11548. case 2:
  11549. if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
  11550. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11551. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11552. } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  11553. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11554. }
  11555. }
  11556. break;
  11557. case -3:
  11558. if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  11559. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11560. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11561. } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  11562. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11563. }
  11564. }
  11565. break;
  11566. case 3:
  11567. if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
  11568. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11569. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11570. } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  11571. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11572. }
  11573. }
  11574. break;
  11575. case -4:
  11576. if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  11577. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11578. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11579. } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
  11580. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11581. }
  11582. }
  11583. break;
  11584. case 4:
  11585. if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
  11586. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11587. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11588. } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
  11589. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  11590. }
  11591. }
  11592. break;
  11593. }
  11594. }
  11595. #endif
  11596. if ((sizeof(long) <= sizeof(long))) {
  11597. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  11598. } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
  11599. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  11600. }
  11601. }
  11602. {
  11603. long val;
  11604. int ret = -1;
  11605. #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
  11606. Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
  11607. x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
  11608. if (unlikely(bytes_copied == -1)) {
  11609. } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
  11610. goto raise_overflow;
  11611. } else {
  11612. ret = 0;
  11613. }
  11614. #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
  11615. int one = 1; int is_little = (int)*(unsigned char *)&one;
  11616. unsigned char *bytes = (unsigned char *)&val;
  11617. ret = _PyLong_AsByteArray((PyLongObject *)x,
  11618. bytes, sizeof(val),
  11619. is_little, !is_unsigned);
  11620. #else
  11621. PyObject *v;
  11622. PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
  11623. int bits, remaining_bits, is_negative = 0;
  11624. int chunk_size = (sizeof(long) < 8) ? 30 : 62;
  11625. if (likely(PyLong_CheckExact(x))) {
  11626. v = __Pyx_NewRef(x);
  11627. } else {
  11628. v = PyNumber_Long(x);
  11629. if (unlikely(!v)) return (long) -1;
  11630. assert(PyLong_CheckExact(v));
  11631. }
  11632. {
  11633. int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
  11634. if (unlikely(result < 0)) {
  11635. Py_DECREF(v);
  11636. return (long) -1;
  11637. }
  11638. is_negative = result == 1;
  11639. }
  11640. if (is_unsigned && unlikely(is_negative)) {
  11641. Py_DECREF(v);
  11642. goto raise_neg_overflow;
  11643. } else if (is_negative) {
  11644. stepval = PyNumber_Invert(v);
  11645. Py_DECREF(v);
  11646. if (unlikely(!stepval))
  11647. return (long) -1;
  11648. } else {
  11649. stepval = v;
  11650. }
  11651. v = NULL;
  11652. val = (long) 0;
  11653. mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
  11654. shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
  11655. for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
  11656. PyObject *tmp, *digit;
  11657. long idigit;
  11658. digit = PyNumber_And(stepval, mask);
  11659. if (unlikely(!digit)) goto done;
  11660. idigit = PyLong_AsLong(digit);
  11661. Py_DECREF(digit);
  11662. if (unlikely(idigit < 0)) goto done;
  11663. val |= ((long) idigit) << bits;
  11664. tmp = PyNumber_Rshift(stepval, shift);
  11665. if (unlikely(!tmp)) goto done;
  11666. Py_DECREF(stepval); stepval = tmp;
  11667. }
  11668. Py_DECREF(shift); shift = NULL;
  11669. Py_DECREF(mask); mask = NULL;
  11670. {
  11671. long idigit = PyLong_AsLong(stepval);
  11672. if (unlikely(idigit < 0)) goto done;
  11673. remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
  11674. if (unlikely(idigit >= (1L << remaining_bits)))
  11675. goto raise_overflow;
  11676. val |= ((long) idigit) << bits;
  11677. }
  11678. if (!is_unsigned) {
  11679. if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
  11680. goto raise_overflow;
  11681. if (is_negative)
  11682. val = ~val;
  11683. }
  11684. ret = 0;
  11685. done:
  11686. Py_XDECREF(shift);
  11687. Py_XDECREF(mask);
  11688. Py_XDECREF(stepval);
  11689. #endif
  11690. if (unlikely(ret))
  11691. return (long) -1;
  11692. return val;
  11693. }
  11694. raise_overflow:
  11695. PyErr_SetString(PyExc_OverflowError,
  11696. "value too large to convert to long");
  11697. return (long) -1;
  11698. raise_neg_overflow:
  11699. PyErr_SetString(PyExc_OverflowError,
  11700. "can't convert negative value to long");
  11701. return (long) -1;
  11702. }
  11703. /* CIntFromPy */
  11704. static CYTHON_INLINE int __Pyx_PyLong_As_int(PyObject *x) {
  11705. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11706. #pragma GCC diagnostic push
  11707. #pragma GCC diagnostic ignored "-Wconversion"
  11708. #endif
  11709. const int neg_one = (int) -1, const_zero = (int) 0;
  11710. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  11711. #pragma GCC diagnostic pop
  11712. #endif
  11713. const int is_unsigned = neg_one > const_zero;
  11714. if (unlikely(!PyLong_Check(x))) {
  11715. int val;
  11716. PyObject *tmp = __Pyx_PyNumber_Long(x);
  11717. if (!tmp) return (int) -1;
  11718. val = __Pyx_PyLong_As_int(tmp);
  11719. Py_DECREF(tmp);
  11720. return val;
  11721. }
  11722. if (is_unsigned) {
  11723. #if CYTHON_USE_PYLONG_INTERNALS
  11724. if (unlikely(__Pyx_PyLong_IsNeg(x))) {
  11725. goto raise_neg_overflow;
  11726. } else if (__Pyx_PyLong_IsCompact(x)) {
  11727. __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
  11728. } else {
  11729. const digit* digits = __Pyx_PyLong_Digits(x);
  11730. assert(__Pyx_PyLong_DigitCount(x) > 1);
  11731. switch (__Pyx_PyLong_DigitCount(x)) {
  11732. case 2:
  11733. if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
  11734. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11735. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11736. } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
  11737. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  11738. }
  11739. }
  11740. break;
  11741. case 3:
  11742. if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
  11743. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11744. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11745. } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
  11746. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  11747. }
  11748. }
  11749. break;
  11750. case 4:
  11751. if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
  11752. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11753. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11754. } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
  11755. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  11756. }
  11757. }
  11758. break;
  11759. }
  11760. }
  11761. #endif
  11762. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
  11763. if (unlikely(Py_SIZE(x) < 0)) {
  11764. goto raise_neg_overflow;
  11765. }
  11766. #else
  11767. {
  11768. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  11769. if (unlikely(result < 0))
  11770. return (int) -1;
  11771. if (unlikely(result == 1))
  11772. goto raise_neg_overflow;
  11773. }
  11774. #endif
  11775. if ((sizeof(int) <= sizeof(unsigned long))) {
  11776. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  11777. } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
  11778. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  11779. }
  11780. } else {
  11781. #if CYTHON_USE_PYLONG_INTERNALS
  11782. if (__Pyx_PyLong_IsCompact(x)) {
  11783. __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
  11784. } else {
  11785. const digit* digits = __Pyx_PyLong_Digits(x);
  11786. assert(__Pyx_PyLong_DigitCount(x) > 1);
  11787. switch (__Pyx_PyLong_SignedDigitCount(x)) {
  11788. case -2:
  11789. if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
  11790. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11791. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11792. } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  11793. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11794. }
  11795. }
  11796. break;
  11797. case 2:
  11798. if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
  11799. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  11800. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11801. } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  11802. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11803. }
  11804. }
  11805. break;
  11806. case -3:
  11807. if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  11808. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11809. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11810. } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  11811. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11812. }
  11813. }
  11814. break;
  11815. case 3:
  11816. if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
  11817. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  11818. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11819. } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  11820. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11821. }
  11822. }
  11823. break;
  11824. case -4:
  11825. if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  11826. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11827. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11828. } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
  11829. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11830. }
  11831. }
  11832. break;
  11833. case 4:
  11834. if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
  11835. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  11836. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  11837. } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
  11838. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  11839. }
  11840. }
  11841. break;
  11842. }
  11843. }
  11844. #endif
  11845. if ((sizeof(int) <= sizeof(long))) {
  11846. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  11847. } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
  11848. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  11849. }
  11850. }
  11851. {
  11852. int val;
  11853. int ret = -1;
  11854. #if PY_VERSION_HEX >= 0x030d00A6 && !CYTHON_COMPILING_IN_LIMITED_API
  11855. Py_ssize_t bytes_copied = PyLong_AsNativeBytes(
  11856. x, &val, sizeof(val), Py_ASNATIVEBYTES_NATIVE_ENDIAN | (is_unsigned ? Py_ASNATIVEBYTES_UNSIGNED_BUFFER | Py_ASNATIVEBYTES_REJECT_NEGATIVE : 0));
  11857. if (unlikely(bytes_copied == -1)) {
  11858. } else if (unlikely(bytes_copied > (Py_ssize_t) sizeof(val))) {
  11859. goto raise_overflow;
  11860. } else {
  11861. ret = 0;
  11862. }
  11863. #elif PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
  11864. int one = 1; int is_little = (int)*(unsigned char *)&one;
  11865. unsigned char *bytes = (unsigned char *)&val;
  11866. ret = _PyLong_AsByteArray((PyLongObject *)x,
  11867. bytes, sizeof(val),
  11868. is_little, !is_unsigned);
  11869. #else
  11870. PyObject *v;
  11871. PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
  11872. int bits, remaining_bits, is_negative = 0;
  11873. int chunk_size = (sizeof(long) < 8) ? 30 : 62;
  11874. if (likely(PyLong_CheckExact(x))) {
  11875. v = __Pyx_NewRef(x);
  11876. } else {
  11877. v = PyNumber_Long(x);
  11878. if (unlikely(!v)) return (int) -1;
  11879. assert(PyLong_CheckExact(v));
  11880. }
  11881. {
  11882. int result = PyObject_RichCompareBool(v, Py_False, Py_LT);
  11883. if (unlikely(result < 0)) {
  11884. Py_DECREF(v);
  11885. return (int) -1;
  11886. }
  11887. is_negative = result == 1;
  11888. }
  11889. if (is_unsigned && unlikely(is_negative)) {
  11890. Py_DECREF(v);
  11891. goto raise_neg_overflow;
  11892. } else if (is_negative) {
  11893. stepval = PyNumber_Invert(v);
  11894. Py_DECREF(v);
  11895. if (unlikely(!stepval))
  11896. return (int) -1;
  11897. } else {
  11898. stepval = v;
  11899. }
  11900. v = NULL;
  11901. val = (int) 0;
  11902. mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
  11903. shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
  11904. for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
  11905. PyObject *tmp, *digit;
  11906. long idigit;
  11907. digit = PyNumber_And(stepval, mask);
  11908. if (unlikely(!digit)) goto done;
  11909. idigit = PyLong_AsLong(digit);
  11910. Py_DECREF(digit);
  11911. if (unlikely(idigit < 0)) goto done;
  11912. val |= ((int) idigit) << bits;
  11913. tmp = PyNumber_Rshift(stepval, shift);
  11914. if (unlikely(!tmp)) goto done;
  11915. Py_DECREF(stepval); stepval = tmp;
  11916. }
  11917. Py_DECREF(shift); shift = NULL;
  11918. Py_DECREF(mask); mask = NULL;
  11919. {
  11920. long idigit = PyLong_AsLong(stepval);
  11921. if (unlikely(idigit < 0)) goto done;
  11922. remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
  11923. if (unlikely(idigit >= (1L << remaining_bits)))
  11924. goto raise_overflow;
  11925. val |= ((int) idigit) << bits;
  11926. }
  11927. if (!is_unsigned) {
  11928. if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
  11929. goto raise_overflow;
  11930. if (is_negative)
  11931. val = ~val;
  11932. }
  11933. ret = 0;
  11934. done:
  11935. Py_XDECREF(shift);
  11936. Py_XDECREF(mask);
  11937. Py_XDECREF(stepval);
  11938. #endif
  11939. if (unlikely(ret))
  11940. return (int) -1;
  11941. return val;
  11942. }
  11943. raise_overflow:
  11944. PyErr_SetString(PyExc_OverflowError,
  11945. "value too large to convert to int");
  11946. return (int) -1;
  11947. raise_neg_overflow:
  11948. PyErr_SetString(PyExc_OverflowError,
  11949. "can't convert negative value to int");
  11950. return (int) -1;
  11951. }
  11952. /* FastTypeChecks */
  11953. #if CYTHON_COMPILING_IN_CPYTHON
  11954. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  11955. while (a) {
  11956. a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
  11957. if (a == b)
  11958. return 1;
  11959. }
  11960. return b == &PyBaseObject_Type;
  11961. }
  11962. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  11963. PyObject *mro;
  11964. if (a == b) return 1;
  11965. mro = a->tp_mro;
  11966. if (likely(mro)) {
  11967. Py_ssize_t i, n;
  11968. n = PyTuple_GET_SIZE(mro);
  11969. for (i = 0; i < n; i++) {
  11970. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  11971. return 1;
  11972. }
  11973. return 0;
  11974. }
  11975. return __Pyx_InBases(a, b);
  11976. }
  11977. static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
  11978. PyObject *mro;
  11979. if (cls == a || cls == b) return 1;
  11980. mro = cls->tp_mro;
  11981. if (likely(mro)) {
  11982. Py_ssize_t i, n;
  11983. n = PyTuple_GET_SIZE(mro);
  11984. for (i = 0; i < n; i++) {
  11985. PyObject *base = PyTuple_GET_ITEM(mro, i);
  11986. if (base == (PyObject *)a || base == (PyObject *)b)
  11987. return 1;
  11988. }
  11989. return 0;
  11990. }
  11991. return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
  11992. }
  11993. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  11994. if (exc_type1) {
  11995. return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
  11996. } else {
  11997. return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  11998. }
  11999. }
  12000. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  12001. Py_ssize_t i, n;
  12002. assert(PyExceptionClass_Check(exc_type));
  12003. n = PyTuple_GET_SIZE(tuple);
  12004. for (i=0; i<n; i++) {
  12005. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  12006. }
  12007. for (i=0; i<n; i++) {
  12008. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  12009. if (likely(PyExceptionClass_Check(t))) {
  12010. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  12011. } else {
  12012. }
  12013. }
  12014. return 0;
  12015. }
  12016. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  12017. if (likely(err == exc_type)) return 1;
  12018. if (likely(PyExceptionClass_Check(err))) {
  12019. if (likely(PyExceptionClass_Check(exc_type))) {
  12020. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  12021. } else if (likely(PyTuple_Check(exc_type))) {
  12022. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  12023. } else {
  12024. }
  12025. }
  12026. return PyErr_GivenExceptionMatches(err, exc_type);
  12027. }
  12028. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  12029. assert(PyExceptionClass_Check(exc_type1));
  12030. assert(PyExceptionClass_Check(exc_type2));
  12031. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  12032. if (likely(PyExceptionClass_Check(err))) {
  12033. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  12034. }
  12035. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  12036. }
  12037. #endif
  12038. /* GetRuntimeVersion */
  12039. #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  12040. void __Pyx_init_runtime_version(void) {
  12041. if (__Pyx_cached_runtime_version == 0) {
  12042. const char* rt_version = Py_GetVersion();
  12043. unsigned long version = 0;
  12044. unsigned long factor = 0x01000000UL;
  12045. unsigned int digit = 0;
  12046. int i = 0;
  12047. while (factor) {
  12048. while ('0' <= rt_version[i] && rt_version[i] <= '9') {
  12049. digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
  12050. ++i;
  12051. }
  12052. version += factor * digit;
  12053. if (rt_version[i] != '.')
  12054. break;
  12055. digit = 0;
  12056. factor >>= 8;
  12057. ++i;
  12058. }
  12059. __Pyx_cached_runtime_version = version;
  12060. }
  12061. }
  12062. #endif
  12063. static unsigned long __Pyx_get_runtime_version(void) {
  12064. #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
  12065. return Py_Version & ~0xFFUL;
  12066. #else
  12067. return __Pyx_cached_runtime_version;
  12068. #endif
  12069. }
  12070. /* CheckBinaryVersion */
  12071. static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
  12072. const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
  12073. if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
  12074. return 0;
  12075. if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
  12076. return 1;
  12077. {
  12078. char message[200];
  12079. PyOS_snprintf(message, sizeof(message),
  12080. "compile time Python version %d.%d "
  12081. "of module '%.100s' "
  12082. "%s "
  12083. "runtime version %d.%d",
  12084. (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
  12085. __Pyx_MODULE_NAME,
  12086. (allow_newer) ? "was newer than" : "does not match",
  12087. (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
  12088. );
  12089. return PyErr_WarnEx(NULL, message, 1);
  12090. }
  12091. }
  12092. /* NewCodeObj */
  12093. #if CYTHON_COMPILING_IN_LIMITED_API
  12094. static PyObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
  12095. PyObject *code, PyObject *c, PyObject* n, PyObject *v,
  12096. PyObject *fv, PyObject *cell, PyObject* fn,
  12097. PyObject *name, int fline, PyObject *lnos) {
  12098. PyObject *exception_table = NULL;
  12099. PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
  12100. #if __PYX_LIMITED_VERSION_HEX < 0x030b0000
  12101. PyObject *version_info;
  12102. PyObject *py_minor_version = NULL;
  12103. #endif
  12104. long minor_version = 0;
  12105. PyObject *type, *value, *traceback;
  12106. PyErr_Fetch(&type, &value, &traceback);
  12107. #if __PYX_LIMITED_VERSION_HEX >= 0x030b0000
  12108. minor_version = 11;
  12109. #else
  12110. if (!(version_info = PySys_GetObject("version_info"))) goto end;
  12111. if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
  12112. minor_version = PyLong_AsLong(py_minor_version);
  12113. Py_DECREF(py_minor_version);
  12114. if (minor_version == -1 && PyErr_Occurred()) goto end;
  12115. #endif
  12116. if (!(types_module = PyImport_ImportModule("types"))) goto end;
  12117. if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
  12118. if (minor_version <= 7) {
  12119. (void)p;
  12120. result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOOO", a, k, l, s, f, code,
  12121. c, n, v, fn, name, fline, lnos, fv, cell);
  12122. } else if (minor_version <= 10) {
  12123. result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOOO", a,p, k, l, s, f, code,
  12124. c, n, v, fn, name, fline, lnos, fv, cell);
  12125. } else {
  12126. if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
  12127. result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOOOO", a,p, k, l, s, f, code,
  12128. c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
  12129. }
  12130. end:
  12131. Py_XDECREF(code_type);
  12132. Py_XDECREF(exception_table);
  12133. Py_XDECREF(types_module);
  12134. if (type) {
  12135. PyErr_Restore(type, value, traceback);
  12136. }
  12137. return result;
  12138. }
  12139. #elif PY_VERSION_HEX >= 0x030B0000
  12140. static PyCodeObject* __Pyx__PyCode_New(int a, int p, int k, int l, int s, int f,
  12141. PyObject *code, PyObject *c, PyObject* n, PyObject *v,
  12142. PyObject *fv, PyObject *cell, PyObject* fn,
  12143. PyObject *name, int fline, PyObject *lnos) {
  12144. PyCodeObject *result;
  12145. result =
  12146. #if PY_VERSION_HEX >= 0x030C0000
  12147. PyUnstable_Code_NewWithPosOnlyArgs
  12148. #else
  12149. PyCode_NewWithPosOnlyArgs
  12150. #endif
  12151. (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, __pyx_mstate_global->__pyx_empty_bytes);
  12152. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030c00A1
  12153. if (likely(result))
  12154. result->_co_firsttraceable = 0;
  12155. #endif
  12156. return result;
  12157. }
  12158. #elif !CYTHON_COMPILING_IN_PYPY
  12159. #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  12160. PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  12161. #else
  12162. #define __Pyx__PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  12163. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  12164. #endif
  12165. static PyObject* __Pyx_PyCode_New(
  12166. const __Pyx_PyCode_New_function_description descr,
  12167. PyObject * const *varnames,
  12168. PyObject *filename,
  12169. PyObject *funcname,
  12170. PyObject *line_table,
  12171. PyObject *tuple_dedup_map
  12172. ) {
  12173. PyObject *code_obj = NULL, *varnames_tuple_dedup = NULL, *code_bytes = NULL;
  12174. Py_ssize_t var_count = (Py_ssize_t) descr.nlocals;
  12175. PyObject *varnames_tuple = PyTuple_New(var_count);
  12176. if (unlikely(!varnames_tuple)) return NULL;
  12177. for (Py_ssize_t i=0; i < var_count; i++) {
  12178. Py_INCREF(varnames[i]);
  12179. if (__Pyx_PyTuple_SET_ITEM(varnames_tuple, i, varnames[i]) != (0)) goto done;
  12180. }
  12181. #if CYTHON_COMPILING_IN_LIMITED_API
  12182. varnames_tuple_dedup = PyDict_GetItem(tuple_dedup_map, varnames_tuple);
  12183. if (!varnames_tuple_dedup) {
  12184. if (unlikely(PyDict_SetItem(tuple_dedup_map, varnames_tuple, varnames_tuple) < 0)) goto done;
  12185. varnames_tuple_dedup = varnames_tuple;
  12186. }
  12187. #else
  12188. varnames_tuple_dedup = PyDict_SetDefault(tuple_dedup_map, varnames_tuple, varnames_tuple);
  12189. if (unlikely(!varnames_tuple_dedup)) goto done;
  12190. #endif
  12191. #if CYTHON_AVOID_BORROWED_REFS
  12192. Py_INCREF(varnames_tuple_dedup);
  12193. #endif
  12194. if (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table != NULL && !CYTHON_COMPILING_IN_GRAAL) {
  12195. Py_ssize_t line_table_length = __Pyx_PyBytes_GET_SIZE(line_table);
  12196. #if !CYTHON_ASSUME_SAFE_SIZE
  12197. if (unlikely(line_table_length == -1)) goto done;
  12198. #endif
  12199. Py_ssize_t code_len = (line_table_length * 2 + 4) & ~3LL;
  12200. code_bytes = PyBytes_FromStringAndSize(NULL, code_len);
  12201. if (unlikely(!code_bytes)) goto done;
  12202. char* c_code_bytes = PyBytes_AsString(code_bytes);
  12203. if (unlikely(!c_code_bytes)) goto done;
  12204. memset(c_code_bytes, 0, (size_t) code_len);
  12205. }
  12206. code_obj = (PyObject*) __Pyx__PyCode_New(
  12207. (int) descr.argcount,
  12208. (int) descr.num_posonly_args,
  12209. (int) descr.num_kwonly_args,
  12210. (int) descr.nlocals,
  12211. 0,
  12212. (int) descr.flags,
  12213. code_bytes ? code_bytes : __pyx_mstate_global->__pyx_empty_bytes,
  12214. __pyx_mstate_global->__pyx_empty_tuple,
  12215. __pyx_mstate_global->__pyx_empty_tuple,
  12216. varnames_tuple_dedup,
  12217. __pyx_mstate_global->__pyx_empty_tuple,
  12218. __pyx_mstate_global->__pyx_empty_tuple,
  12219. filename,
  12220. funcname,
  12221. (int) descr.first_line,
  12222. (__PYX_LIMITED_VERSION_HEX >= (0x030b0000) && line_table) ? line_table : __pyx_mstate_global->__pyx_empty_bytes
  12223. );
  12224. done:
  12225. Py_XDECREF(code_bytes);
  12226. #if CYTHON_AVOID_BORROWED_REFS
  12227. Py_XDECREF(varnames_tuple_dedup);
  12228. #endif
  12229. Py_DECREF(varnames_tuple);
  12230. return code_obj;
  12231. }
  12232. /* DecompressString */
  12233. static PyObject *__Pyx_DecompressString(const char *s, Py_ssize_t length, int algo) {
  12234. PyObject *module = NULL, *decompress, *compressed_bytes, *decompressed;
  12235. const char* module_name = algo == 3 ? "compression.zstd" : algo == 2 ? "bz2" : "zlib";
  12236. PyObject *methodname = PyUnicode_FromString("decompress");
  12237. if (unlikely(!methodname)) return NULL;
  12238. #if __PYX_LIMITED_VERSION_HEX >= 0x030e0000
  12239. if (algo == 3) {
  12240. PyObject *fromlist = Py_BuildValue("[O]", methodname);
  12241. if (unlikely(!fromlist)) goto bad;
  12242. module = PyImport_ImportModuleLevel("compression.zstd", NULL, NULL, fromlist, 0);
  12243. Py_DECREF(fromlist);
  12244. } else
  12245. #endif
  12246. module = PyImport_ImportModule(module_name);
  12247. if (unlikely(!module)) goto import_failed;
  12248. decompress = PyObject_GetAttr(module, methodname);
  12249. if (unlikely(!decompress)) goto import_failed;
  12250. {
  12251. #ifdef __cplusplus
  12252. char *memview_bytes = const_cast<char*>(s);
  12253. #else
  12254. #if defined(__clang__)
  12255. #pragma clang diagnostic push
  12256. #pragma clang diagnostic ignored "-Wcast-qual"
  12257. #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
  12258. #pragma GCC diagnostic push
  12259. #pragma GCC diagnostic ignored "-Wcast-qual"
  12260. #endif
  12261. char *memview_bytes = (char*) s;
  12262. #if defined(__clang__)
  12263. #pragma clang diagnostic pop
  12264. #elif !defined(__INTEL_COMPILER) && defined(__GNUC__)
  12265. #pragma GCC diagnostic pop
  12266. #endif
  12267. #endif
  12268. #if CYTHON_COMPILING_IN_LIMITED_API && !defined(PyBUF_READ)
  12269. int memview_flags = 0x100;
  12270. #else
  12271. int memview_flags = PyBUF_READ;
  12272. #endif
  12273. compressed_bytes = PyMemoryView_FromMemory(memview_bytes, length, memview_flags);
  12274. }
  12275. if (unlikely(!compressed_bytes)) {
  12276. Py_DECREF(decompress);
  12277. goto bad;
  12278. }
  12279. decompressed = PyObject_CallFunctionObjArgs(decompress, compressed_bytes, NULL);
  12280. Py_DECREF(compressed_bytes);
  12281. Py_DECREF(decompress);
  12282. Py_DECREF(module);
  12283. Py_DECREF(methodname);
  12284. return decompressed;
  12285. import_failed:
  12286. PyErr_Format(PyExc_ImportError,
  12287. "Failed to import '%.20s.decompress' - cannot initialise module strings. "
  12288. "String compression was configured with the C macro 'CYTHON_COMPRESS_STRINGS=%d'.",
  12289. module_name, algo);
  12290. bad:
  12291. Py_XDECREF(module);
  12292. Py_DECREF(methodname);
  12293. return NULL;
  12294. }
  12295. #include <string.h>
  12296. static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
  12297. size_t len = strlen(s);
  12298. if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
  12299. PyErr_SetString(PyExc_OverflowError, "byte string is too long");
  12300. return -1;
  12301. }
  12302. return (Py_ssize_t) len;
  12303. }
  12304. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  12305. Py_ssize_t len = __Pyx_ssize_strlen(c_str);
  12306. if (unlikely(len < 0)) return NULL;
  12307. return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
  12308. }
  12309. static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
  12310. Py_ssize_t len = __Pyx_ssize_strlen(c_str);
  12311. if (unlikely(len < 0)) return NULL;
  12312. return PyByteArray_FromStringAndSize(c_str, len);
  12313. }
  12314. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  12315. Py_ssize_t ignore;
  12316. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  12317. }
  12318. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  12319. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  12320. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  12321. #if CYTHON_COMPILING_IN_LIMITED_API
  12322. {
  12323. const char* result;
  12324. Py_ssize_t unicode_length;
  12325. CYTHON_MAYBE_UNUSED_VAR(unicode_length); // only for __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12326. #if __PYX_LIMITED_VERSION_HEX < 0x030A0000
  12327. if (unlikely(PyArg_Parse(o, "s#", &result, length) < 0)) return NULL;
  12328. #else
  12329. result = PyUnicode_AsUTF8AndSize(o, length);
  12330. #endif
  12331. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12332. unicode_length = PyUnicode_GetLength(o);
  12333. if (unlikely(unicode_length < 0)) return NULL;
  12334. if (unlikely(unicode_length != *length)) {
  12335. PyUnicode_AsASCIIString(o);
  12336. return NULL;
  12337. }
  12338. #endif
  12339. return result;
  12340. }
  12341. #else
  12342. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12343. if (likely(PyUnicode_IS_ASCII(o))) {
  12344. *length = PyUnicode_GET_LENGTH(o);
  12345. return PyUnicode_AsUTF8(o);
  12346. } else {
  12347. PyUnicode_AsASCIIString(o);
  12348. return NULL;
  12349. }
  12350. #else
  12351. return PyUnicode_AsUTF8AndSize(o, length);
  12352. #endif
  12353. #endif
  12354. }
  12355. #endif
  12356. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  12357. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_UTF8
  12358. if (PyUnicode_Check(o)) {
  12359. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  12360. } else
  12361. #endif
  12362. if (PyByteArray_Check(o)) {
  12363. #if (CYTHON_ASSUME_SAFE_SIZE && CYTHON_ASSUME_SAFE_MACROS) || (CYTHON_COMPILING_IN_PYPY && (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE)))
  12364. *length = PyByteArray_GET_SIZE(o);
  12365. return PyByteArray_AS_STRING(o);
  12366. #else
  12367. *length = PyByteArray_Size(o);
  12368. if (*length == -1) return NULL;
  12369. return PyByteArray_AsString(o);
  12370. #endif
  12371. } else
  12372. {
  12373. char* result;
  12374. int r = PyBytes_AsStringAndSize(o, &result, length);
  12375. if (unlikely(r < 0)) {
  12376. return NULL;
  12377. } else {
  12378. return result;
  12379. }
  12380. }
  12381. }
  12382. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  12383. int is_true = x == Py_True;
  12384. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  12385. else return PyObject_IsTrue(x);
  12386. }
  12387. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  12388. int retval;
  12389. if (unlikely(!x)) return -1;
  12390. retval = __Pyx_PyObject_IsTrue(x);
  12391. Py_DECREF(x);
  12392. return retval;
  12393. }
  12394. static PyObject* __Pyx_PyNumber_LongWrongResultType(PyObject* result) {
  12395. __Pyx_TypeName result_type_name = __Pyx_PyType_GetFullyQualifiedName(Py_TYPE(result));
  12396. if (PyLong_Check(result)) {
  12397. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  12398. "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
  12399. "The ability to return an instance of a strict subclass of int is deprecated, "
  12400. "and may be removed in a future version of Python.",
  12401. result_type_name)) {
  12402. __Pyx_DECREF_TypeName(result_type_name);
  12403. Py_DECREF(result);
  12404. return NULL;
  12405. }
  12406. __Pyx_DECREF_TypeName(result_type_name);
  12407. return result;
  12408. }
  12409. PyErr_Format(PyExc_TypeError,
  12410. "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ")",
  12411. result_type_name);
  12412. __Pyx_DECREF_TypeName(result_type_name);
  12413. Py_DECREF(result);
  12414. return NULL;
  12415. }
  12416. static CYTHON_INLINE PyObject* __Pyx_PyNumber_Long(PyObject* x) {
  12417. #if CYTHON_USE_TYPE_SLOTS
  12418. PyNumberMethods *m;
  12419. #endif
  12420. PyObject *res = NULL;
  12421. if (likely(PyLong_Check(x)))
  12422. return __Pyx_NewRef(x);
  12423. #if CYTHON_USE_TYPE_SLOTS
  12424. m = Py_TYPE(x)->tp_as_number;
  12425. if (likely(m && m->nb_int)) {
  12426. res = m->nb_int(x);
  12427. }
  12428. #else
  12429. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  12430. res = PyNumber_Long(x);
  12431. }
  12432. #endif
  12433. if (likely(res)) {
  12434. if (unlikely(!PyLong_CheckExact(res))) {
  12435. return __Pyx_PyNumber_LongWrongResultType(res);
  12436. }
  12437. }
  12438. else if (!PyErr_Occurred()) {
  12439. PyErr_SetString(PyExc_TypeError,
  12440. "an integer is required");
  12441. }
  12442. return res;
  12443. }
  12444. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  12445. Py_ssize_t ival;
  12446. PyObject *x;
  12447. if (likely(PyLong_CheckExact(b))) {
  12448. #if CYTHON_USE_PYLONG_INTERNALS
  12449. if (likely(__Pyx_PyLong_IsCompact(b))) {
  12450. return __Pyx_PyLong_CompactValue(b);
  12451. } else {
  12452. const digit* digits = __Pyx_PyLong_Digits(b);
  12453. const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
  12454. switch (size) {
  12455. case 2:
  12456. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  12457. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12458. }
  12459. break;
  12460. case -2:
  12461. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  12462. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12463. }
  12464. break;
  12465. case 3:
  12466. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  12467. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12468. }
  12469. break;
  12470. case -3:
  12471. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  12472. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12473. }
  12474. break;
  12475. case 4:
  12476. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  12477. return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12478. }
  12479. break;
  12480. case -4:
  12481. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  12482. return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  12483. }
  12484. break;
  12485. }
  12486. }
  12487. #endif
  12488. return PyLong_AsSsize_t(b);
  12489. }
  12490. x = PyNumber_Index(b);
  12491. if (!x) return -1;
  12492. ival = PyLong_AsSsize_t(x);
  12493. Py_DECREF(x);
  12494. return ival;
  12495. }
  12496. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  12497. if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
  12498. return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  12499. } else {
  12500. Py_ssize_t ival;
  12501. PyObject *x;
  12502. x = PyNumber_Index(o);
  12503. if (!x) return -1;
  12504. ival = PyLong_AsLong(x);
  12505. Py_DECREF(x);
  12506. return ival;
  12507. }
  12508. }
  12509. static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
  12510. CYTHON_UNUSED_VAR(b);
  12511. return __Pyx_NewRef(Py_None);
  12512. }
  12513. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  12514. return __Pyx_NewRef(b ? Py_True: Py_False);
  12515. }
  12516. static CYTHON_INLINE PyObject * __Pyx_PyLong_FromSize_t(size_t ival) {
  12517. return PyLong_FromSize_t(ival);
  12518. }
  12519. /* MultiPhaseInitModuleState */
  12520. #if CYTHON_PEP489_MULTI_PHASE_INIT && CYTHON_USE_MODULE_STATE
  12521. #ifndef CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12522. #if (CYTHON_COMPILING_IN_LIMITED_API || PY_VERSION_HEX >= 0x030C0000)
  12523. #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 1
  12524. #else
  12525. #define CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE 0
  12526. #endif
  12527. #endif
  12528. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE && !CYTHON_ATOMICS
  12529. #error "Module state with PEP489 requires atomics. Currently that's one of\
  12530. C11, C++11, gcc atomic intrinsics or MSVC atomic intrinsics"
  12531. #endif
  12532. #if !CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12533. #define __Pyx_ModuleStateLookup_Lock()
  12534. #define __Pyx_ModuleStateLookup_Unlock()
  12535. #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d0000
  12536. static PyMutex __Pyx_ModuleStateLookup_mutex = {0};
  12537. #define __Pyx_ModuleStateLookup_Lock() PyMutex_Lock(&__Pyx_ModuleStateLookup_mutex)
  12538. #define __Pyx_ModuleStateLookup_Unlock() PyMutex_Unlock(&__Pyx_ModuleStateLookup_mutex)
  12539. #elif defined(__cplusplus) && __cplusplus >= 201103L
  12540. #include <mutex>
  12541. static std::mutex __Pyx_ModuleStateLookup_mutex;
  12542. #define __Pyx_ModuleStateLookup_Lock() __Pyx_ModuleStateLookup_mutex.lock()
  12543. #define __Pyx_ModuleStateLookup_Unlock() __Pyx_ModuleStateLookup_mutex.unlock()
  12544. #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ > 201112L) && !defined(__STDC_NO_THREADS__)
  12545. #include <threads.h>
  12546. static mtx_t __Pyx_ModuleStateLookup_mutex;
  12547. static once_flag __Pyx_ModuleStateLookup_mutex_once_flag = ONCE_FLAG_INIT;
  12548. static void __Pyx_ModuleStateLookup_initialize_mutex(void) {
  12549. mtx_init(&__Pyx_ModuleStateLookup_mutex, mtx_plain);
  12550. }
  12551. #define __Pyx_ModuleStateLookup_Lock()\
  12552. call_once(&__Pyx_ModuleStateLookup_mutex_once_flag, __Pyx_ModuleStateLookup_initialize_mutex);\
  12553. mtx_lock(&__Pyx_ModuleStateLookup_mutex)
  12554. #define __Pyx_ModuleStateLookup_Unlock() mtx_unlock(&__Pyx_ModuleStateLookup_mutex)
  12555. #elif defined(HAVE_PTHREAD_H)
  12556. #include <pthread.h>
  12557. static pthread_mutex_t __Pyx_ModuleStateLookup_mutex = PTHREAD_MUTEX_INITIALIZER;
  12558. #define __Pyx_ModuleStateLookup_Lock() pthread_mutex_lock(&__Pyx_ModuleStateLookup_mutex)
  12559. #define __Pyx_ModuleStateLookup_Unlock() pthread_mutex_unlock(&__Pyx_ModuleStateLookup_mutex)
  12560. #elif defined(_WIN32)
  12561. #include <Windows.h> // synchapi.h on its own doesn't work
  12562. static SRWLOCK __Pyx_ModuleStateLookup_mutex = SRWLOCK_INIT;
  12563. #define __Pyx_ModuleStateLookup_Lock() AcquireSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  12564. #define __Pyx_ModuleStateLookup_Unlock() ReleaseSRWLockExclusive(&__Pyx_ModuleStateLookup_mutex)
  12565. #else
  12566. #error "No suitable lock available for CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE.\
  12567. Requires C standard >= C11, or C++ standard >= C++11,\
  12568. or pthreads, or the Windows 32 API, or Python >= 3.13."
  12569. #endif
  12570. typedef struct {
  12571. int64_t id;
  12572. PyObject *module;
  12573. } __Pyx_InterpreterIdAndModule;
  12574. typedef struct {
  12575. char interpreter_id_as_index;
  12576. Py_ssize_t count;
  12577. Py_ssize_t allocated;
  12578. __Pyx_InterpreterIdAndModule table[1];
  12579. } __Pyx_ModuleStateLookupData;
  12580. #define __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE 32
  12581. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12582. static __pyx_atomic_int_type __Pyx_ModuleStateLookup_read_counter = 0;
  12583. #endif
  12584. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12585. static __pyx_atomic_ptr_type __Pyx_ModuleStateLookup_data = 0;
  12586. #else
  12587. static __Pyx_ModuleStateLookupData* __Pyx_ModuleStateLookup_data = NULL;
  12588. #endif
  12589. static __Pyx_InterpreterIdAndModule* __Pyx_State_FindModuleStateLookupTableLowerBound(
  12590. __Pyx_InterpreterIdAndModule* table,
  12591. Py_ssize_t count,
  12592. int64_t interpreterId) {
  12593. __Pyx_InterpreterIdAndModule* begin = table;
  12594. __Pyx_InterpreterIdAndModule* end = begin + count;
  12595. if (begin->id == interpreterId) {
  12596. return begin;
  12597. }
  12598. while ((end - begin) > __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
  12599. __Pyx_InterpreterIdAndModule* halfway = begin + (end - begin)/2;
  12600. if (halfway->id == interpreterId) {
  12601. return halfway;
  12602. }
  12603. if (halfway->id < interpreterId) {
  12604. begin = halfway;
  12605. } else {
  12606. end = halfway;
  12607. }
  12608. }
  12609. for (; begin < end; ++begin) {
  12610. if (begin->id >= interpreterId) return begin;
  12611. }
  12612. return begin;
  12613. }
  12614. static PyObject *__Pyx_State_FindModule(CYTHON_UNUSED void* dummy) {
  12615. int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
  12616. if (interpreter_id == -1) return NULL;
  12617. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12618. __Pyx_ModuleStateLookupData* data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
  12619. {
  12620. __pyx_atomic_incr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  12621. if (likely(data)) {
  12622. __Pyx_ModuleStateLookupData* new_data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_acquire(&__Pyx_ModuleStateLookup_data);
  12623. if (likely(data == new_data)) {
  12624. goto read_finished;
  12625. }
  12626. }
  12627. __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  12628. __Pyx_ModuleStateLookup_Lock();
  12629. __pyx_atomic_incr_relaxed(&__Pyx_ModuleStateLookup_read_counter);
  12630. data = (__Pyx_ModuleStateLookupData*)__pyx_atomic_pointer_load_relaxed(&__Pyx_ModuleStateLookup_data);
  12631. __Pyx_ModuleStateLookup_Unlock();
  12632. }
  12633. read_finished:;
  12634. #else
  12635. __Pyx_ModuleStateLookupData* data = __Pyx_ModuleStateLookup_data;
  12636. #endif
  12637. __Pyx_InterpreterIdAndModule* found = NULL;
  12638. if (unlikely(!data)) goto end;
  12639. if (data->interpreter_id_as_index) {
  12640. if (interpreter_id < data->count) {
  12641. found = data->table+interpreter_id;
  12642. }
  12643. } else {
  12644. found = __Pyx_State_FindModuleStateLookupTableLowerBound(
  12645. data->table, data->count, interpreter_id);
  12646. }
  12647. end:
  12648. {
  12649. PyObject *result=NULL;
  12650. if (found && found->id == interpreter_id) {
  12651. result = found->module;
  12652. }
  12653. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12654. __pyx_atomic_decr_acq_rel(&__Pyx_ModuleStateLookup_read_counter);
  12655. #endif
  12656. return result;
  12657. }
  12658. }
  12659. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12660. static void __Pyx_ModuleStateLookup_wait_until_no_readers(void) {
  12661. while (__pyx_atomic_load(&__Pyx_ModuleStateLookup_read_counter) != 0);
  12662. }
  12663. #else
  12664. #define __Pyx_ModuleStateLookup_wait_until_no_readers()
  12665. #endif
  12666. static int __Pyx_State_AddModuleInterpIdAsIndex(__Pyx_ModuleStateLookupData **old_data, PyObject* module, int64_t interpreter_id) {
  12667. Py_ssize_t to_allocate = (*old_data)->allocated;
  12668. while (to_allocate <= interpreter_id) {
  12669. if (to_allocate == 0) to_allocate = 1;
  12670. else to_allocate *= 2;
  12671. }
  12672. __Pyx_ModuleStateLookupData *new_data = *old_data;
  12673. if (to_allocate != (*old_data)->allocated) {
  12674. new_data = (__Pyx_ModuleStateLookupData *)realloc(
  12675. *old_data,
  12676. sizeof(__Pyx_ModuleStateLookupData)+(to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
  12677. if (!new_data) {
  12678. PyErr_NoMemory();
  12679. return -1;
  12680. }
  12681. for (Py_ssize_t i = new_data->allocated; i < to_allocate; ++i) {
  12682. new_data->table[i].id = i;
  12683. new_data->table[i].module = NULL;
  12684. }
  12685. new_data->allocated = to_allocate;
  12686. }
  12687. new_data->table[interpreter_id].module = module;
  12688. if (new_data->count < interpreter_id+1) {
  12689. new_data->count = interpreter_id+1;
  12690. }
  12691. *old_data = new_data;
  12692. return 0;
  12693. }
  12694. static void __Pyx_State_ConvertFromInterpIdAsIndex(__Pyx_ModuleStateLookupData *data) {
  12695. __Pyx_InterpreterIdAndModule *read = data->table;
  12696. __Pyx_InterpreterIdAndModule *write = data->table;
  12697. __Pyx_InterpreterIdAndModule *end = read + data->count;
  12698. for (; read<end; ++read) {
  12699. if (read->module) {
  12700. write->id = read->id;
  12701. write->module = read->module;
  12702. ++write;
  12703. }
  12704. }
  12705. data->count = write - data->table;
  12706. for (; write<end; ++write) {
  12707. write->id = 0;
  12708. write->module = NULL;
  12709. }
  12710. data->interpreter_id_as_index = 0;
  12711. }
  12712. static int __Pyx_State_AddModule(PyObject* module, CYTHON_UNUSED void* dummy) {
  12713. int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
  12714. if (interpreter_id == -1) return -1;
  12715. int result = 0;
  12716. __Pyx_ModuleStateLookup_Lock();
  12717. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12718. __Pyx_ModuleStateLookupData *old_data = (__Pyx_ModuleStateLookupData *)
  12719. __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  12720. #else
  12721. __Pyx_ModuleStateLookupData *old_data = __Pyx_ModuleStateLookup_data;
  12722. #endif
  12723. __Pyx_ModuleStateLookupData *new_data = old_data;
  12724. if (!new_data) {
  12725. new_data = (__Pyx_ModuleStateLookupData *)calloc(1, sizeof(__Pyx_ModuleStateLookupData));
  12726. if (!new_data) {
  12727. result = -1;
  12728. PyErr_NoMemory();
  12729. goto end;
  12730. }
  12731. new_data->allocated = 1;
  12732. new_data->interpreter_id_as_index = 1;
  12733. }
  12734. __Pyx_ModuleStateLookup_wait_until_no_readers();
  12735. if (new_data->interpreter_id_as_index) {
  12736. if (interpreter_id < __PYX_MODULE_STATE_LOOKUP_SMALL_SIZE) {
  12737. result = __Pyx_State_AddModuleInterpIdAsIndex(&new_data, module, interpreter_id);
  12738. goto end;
  12739. }
  12740. __Pyx_State_ConvertFromInterpIdAsIndex(new_data);
  12741. }
  12742. {
  12743. Py_ssize_t insert_at = 0;
  12744. {
  12745. __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
  12746. new_data->table, new_data->count, interpreter_id);
  12747. assert(lower_bound);
  12748. insert_at = lower_bound - new_data->table;
  12749. if (unlikely(insert_at < new_data->count && lower_bound->id == interpreter_id)) {
  12750. lower_bound->module = module;
  12751. goto end; // already in table, nothing more to do
  12752. }
  12753. }
  12754. if (new_data->count+1 >= new_data->allocated) {
  12755. Py_ssize_t to_allocate = (new_data->count+1)*2;
  12756. new_data =
  12757. (__Pyx_ModuleStateLookupData*)realloc(
  12758. new_data,
  12759. sizeof(__Pyx_ModuleStateLookupData) +
  12760. (to_allocate-1)*sizeof(__Pyx_InterpreterIdAndModule));
  12761. if (!new_data) {
  12762. result = -1;
  12763. new_data = old_data;
  12764. PyErr_NoMemory();
  12765. goto end;
  12766. }
  12767. new_data->allocated = to_allocate;
  12768. }
  12769. ++new_data->count;
  12770. int64_t last_id = interpreter_id;
  12771. PyObject *last_module = module;
  12772. for (Py_ssize_t i=insert_at; i<new_data->count; ++i) {
  12773. int64_t current_id = new_data->table[i].id;
  12774. new_data->table[i].id = last_id;
  12775. last_id = current_id;
  12776. PyObject *current_module = new_data->table[i].module;
  12777. new_data->table[i].module = last_module;
  12778. last_module = current_module;
  12779. }
  12780. }
  12781. end:
  12782. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12783. __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, new_data);
  12784. #else
  12785. __Pyx_ModuleStateLookup_data = new_data;
  12786. #endif
  12787. __Pyx_ModuleStateLookup_Unlock();
  12788. return result;
  12789. }
  12790. static int __Pyx_State_RemoveModule(CYTHON_UNUSED void* dummy) {
  12791. int64_t interpreter_id = PyInterpreterState_GetID(__Pyx_PyInterpreterState_Get());
  12792. if (interpreter_id == -1) return -1;
  12793. __Pyx_ModuleStateLookup_Lock();
  12794. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12795. __Pyx_ModuleStateLookupData *data = (__Pyx_ModuleStateLookupData *)
  12796. __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, 0);
  12797. #else
  12798. __Pyx_ModuleStateLookupData *data = __Pyx_ModuleStateLookup_data;
  12799. #endif
  12800. if (data->interpreter_id_as_index) {
  12801. if (interpreter_id < data->count) {
  12802. data->table[interpreter_id].module = NULL;
  12803. }
  12804. goto done;
  12805. }
  12806. {
  12807. __Pyx_ModuleStateLookup_wait_until_no_readers();
  12808. __Pyx_InterpreterIdAndModule* lower_bound = __Pyx_State_FindModuleStateLookupTableLowerBound(
  12809. data->table, data->count, interpreter_id);
  12810. if (!lower_bound) goto done;
  12811. if (lower_bound->id != interpreter_id) goto done;
  12812. __Pyx_InterpreterIdAndModule *end = data->table+data->count;
  12813. for (;lower_bound<end-1; ++lower_bound) {
  12814. lower_bound->id = (lower_bound+1)->id;
  12815. lower_bound->module = (lower_bound+1)->module;
  12816. }
  12817. }
  12818. --data->count;
  12819. if (data->count == 0) {
  12820. free(data);
  12821. data = NULL;
  12822. }
  12823. done:
  12824. #if CYTHON_MODULE_STATE_LOOKUP_THREAD_SAFE
  12825. __pyx_atomic_pointer_exchange(&__Pyx_ModuleStateLookup_data, data);
  12826. #else
  12827. __Pyx_ModuleStateLookup_data = data;
  12828. #endif
  12829. __Pyx_ModuleStateLookup_Unlock();
  12830. return 0;
  12831. }
  12832. #endif
  12833. /* #### Code section: utility_code_pragmas_end ### */
  12834. #ifdef _MSC_VER
  12835. #pragma warning( pop )
  12836. #endif
  12837. /* #### Code section: end ### */
  12838. #endif /* Py_PYTHON_H */