momentsPen.c 530 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727
  1. /* Generated by Cython 3.0.6 */
  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. #if defined(CYTHON_LIMITED_API) && 0
  17. #ifndef Py_LIMITED_API
  18. #if CYTHON_LIMITED_API+0 > 0x03030000
  19. #define Py_LIMITED_API CYTHON_LIMITED_API
  20. #else
  21. #define Py_LIMITED_API 0x03030000
  22. #endif
  23. #endif
  24. #endif
  25. #include "Python.h"
  26. #ifndef Py_PYTHON_H
  27. #error Python headers needed to compile C extensions, please install development version of Python.
  28. #elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
  29. #error Cython requires Python 2.7+ or Python 3.3+.
  30. #else
  31. #if defined(CYTHON_LIMITED_API) && CYTHON_LIMITED_API
  32. #define __PYX_EXTRA_ABI_MODULE_NAME "limited"
  33. #else
  34. #define __PYX_EXTRA_ABI_MODULE_NAME ""
  35. #endif
  36. #define CYTHON_ABI "3_0_6" __PYX_EXTRA_ABI_MODULE_NAME
  37. #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
  38. #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
  39. #define CYTHON_HEX_VERSION 0x030006F0
  40. #define CYTHON_FUTURE_DIVISION 1
  41. #include <stddef.h>
  42. #ifndef offsetof
  43. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  44. #endif
  45. #if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  46. #ifndef __stdcall
  47. #define __stdcall
  48. #endif
  49. #ifndef __cdecl
  50. #define __cdecl
  51. #endif
  52. #ifndef __fastcall
  53. #define __fastcall
  54. #endif
  55. #endif
  56. #ifndef DL_IMPORT
  57. #define DL_IMPORT(t) t
  58. #endif
  59. #ifndef DL_EXPORT
  60. #define DL_EXPORT(t) t
  61. #endif
  62. #define __PYX_COMMA ,
  63. #ifndef HAVE_LONG_LONG
  64. #define HAVE_LONG_LONG
  65. #endif
  66. #ifndef PY_LONG_LONG
  67. #define PY_LONG_LONG LONG_LONG
  68. #endif
  69. #ifndef Py_HUGE_VAL
  70. #define Py_HUGE_VAL HUGE_VAL
  71. #endif
  72. #define __PYX_LIMITED_VERSION_HEX PY_VERSION_HEX
  73. #if defined(GRAALVM_PYTHON)
  74. /* For very preliminary testing purposes. Most variables are set the same as PyPy.
  75. The existence of this section does not imply that anything works or is even tested */
  76. #define CYTHON_COMPILING_IN_PYPY 0
  77. #define CYTHON_COMPILING_IN_CPYTHON 0
  78. #define CYTHON_COMPILING_IN_LIMITED_API 0
  79. #define CYTHON_COMPILING_IN_GRAAL 1
  80. #define CYTHON_COMPILING_IN_NOGIL 0
  81. #undef CYTHON_USE_TYPE_SLOTS
  82. #define CYTHON_USE_TYPE_SLOTS 0
  83. #undef CYTHON_USE_TYPE_SPECS
  84. #define CYTHON_USE_TYPE_SPECS 0
  85. #undef CYTHON_USE_PYTYPE_LOOKUP
  86. #define CYTHON_USE_PYTYPE_LOOKUP 0
  87. #if PY_VERSION_HEX < 0x03050000
  88. #undef CYTHON_USE_ASYNC_SLOTS
  89. #define CYTHON_USE_ASYNC_SLOTS 0
  90. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  91. #define CYTHON_USE_ASYNC_SLOTS 1
  92. #endif
  93. #undef CYTHON_USE_PYLIST_INTERNALS
  94. #define CYTHON_USE_PYLIST_INTERNALS 0
  95. #undef CYTHON_USE_UNICODE_INTERNALS
  96. #define CYTHON_USE_UNICODE_INTERNALS 0
  97. #undef CYTHON_USE_UNICODE_WRITER
  98. #define CYTHON_USE_UNICODE_WRITER 0
  99. #undef CYTHON_USE_PYLONG_INTERNALS
  100. #define CYTHON_USE_PYLONG_INTERNALS 0
  101. #undef CYTHON_AVOID_BORROWED_REFS
  102. #define CYTHON_AVOID_BORROWED_REFS 1
  103. #undef CYTHON_ASSUME_SAFE_MACROS
  104. #define CYTHON_ASSUME_SAFE_MACROS 0
  105. #undef CYTHON_UNPACK_METHODS
  106. #define CYTHON_UNPACK_METHODS 0
  107. #undef CYTHON_FAST_THREAD_STATE
  108. #define CYTHON_FAST_THREAD_STATE 0
  109. #undef CYTHON_FAST_GIL
  110. #define CYTHON_FAST_GIL 0
  111. #undef CYTHON_METH_FASTCALL
  112. #define CYTHON_METH_FASTCALL 0
  113. #undef CYTHON_FAST_PYCALL
  114. #define CYTHON_FAST_PYCALL 0
  115. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  116. #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  117. #endif
  118. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  119. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  120. #undef CYTHON_USE_MODULE_STATE
  121. #define CYTHON_USE_MODULE_STATE 0
  122. #undef CYTHON_USE_TP_FINALIZE
  123. #define CYTHON_USE_TP_FINALIZE 0
  124. #undef CYTHON_USE_DICT_VERSIONS
  125. #define CYTHON_USE_DICT_VERSIONS 0
  126. #undef CYTHON_USE_EXC_INFO_STACK
  127. #define CYTHON_USE_EXC_INFO_STACK 0
  128. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  129. #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  130. #endif
  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_NOGIL 0
  137. #undef CYTHON_USE_TYPE_SLOTS
  138. #define CYTHON_USE_TYPE_SLOTS 0
  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. #if PY_VERSION_HEX < 0x03050000
  145. #undef CYTHON_USE_ASYNC_SLOTS
  146. #define CYTHON_USE_ASYNC_SLOTS 0
  147. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  148. #define CYTHON_USE_ASYNC_SLOTS 1
  149. #endif
  150. #undef CYTHON_USE_PYLIST_INTERNALS
  151. #define CYTHON_USE_PYLIST_INTERNALS 0
  152. #undef CYTHON_USE_UNICODE_INTERNALS
  153. #define CYTHON_USE_UNICODE_INTERNALS 0
  154. #undef CYTHON_USE_UNICODE_WRITER
  155. #define CYTHON_USE_UNICODE_WRITER 0
  156. #undef CYTHON_USE_PYLONG_INTERNALS
  157. #define CYTHON_USE_PYLONG_INTERNALS 0
  158. #undef CYTHON_AVOID_BORROWED_REFS
  159. #define CYTHON_AVOID_BORROWED_REFS 1
  160. #undef CYTHON_ASSUME_SAFE_MACROS
  161. #define CYTHON_ASSUME_SAFE_MACROS 0
  162. #undef CYTHON_UNPACK_METHODS
  163. #define CYTHON_UNPACK_METHODS 0
  164. #undef CYTHON_FAST_THREAD_STATE
  165. #define CYTHON_FAST_THREAD_STATE 0
  166. #undef CYTHON_FAST_GIL
  167. #define CYTHON_FAST_GIL 0
  168. #undef CYTHON_METH_FASTCALL
  169. #define CYTHON_METH_FASTCALL 0
  170. #undef CYTHON_FAST_PYCALL
  171. #define CYTHON_FAST_PYCALL 0
  172. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  173. #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  174. #endif
  175. #if PY_VERSION_HEX < 0x03090000
  176. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  177. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  178. #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
  179. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  180. #endif
  181. #undef CYTHON_USE_MODULE_STATE
  182. #define CYTHON_USE_MODULE_STATE 0
  183. #undef CYTHON_USE_TP_FINALIZE
  184. #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1 && PYPY_VERSION_NUM >= 0x07030C00)
  185. #undef CYTHON_USE_DICT_VERSIONS
  186. #define CYTHON_USE_DICT_VERSIONS 0
  187. #undef CYTHON_USE_EXC_INFO_STACK
  188. #define CYTHON_USE_EXC_INFO_STACK 0
  189. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  190. #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  191. #endif
  192. #elif defined(CYTHON_LIMITED_API)
  193. #ifdef Py_LIMITED_API
  194. #undef __PYX_LIMITED_VERSION_HEX
  195. #define __PYX_LIMITED_VERSION_HEX Py_LIMITED_API
  196. #endif
  197. #define CYTHON_COMPILING_IN_PYPY 0
  198. #define CYTHON_COMPILING_IN_CPYTHON 0
  199. #define CYTHON_COMPILING_IN_LIMITED_API 1
  200. #define CYTHON_COMPILING_IN_GRAAL 0
  201. #define CYTHON_COMPILING_IN_NOGIL 0
  202. #undef CYTHON_CLINE_IN_TRACEBACK
  203. #define CYTHON_CLINE_IN_TRACEBACK 0
  204. #undef CYTHON_USE_TYPE_SLOTS
  205. #define CYTHON_USE_TYPE_SLOTS 0
  206. #undef CYTHON_USE_TYPE_SPECS
  207. #define CYTHON_USE_TYPE_SPECS 1
  208. #undef CYTHON_USE_PYTYPE_LOOKUP
  209. #define CYTHON_USE_PYTYPE_LOOKUP 0
  210. #undef CYTHON_USE_ASYNC_SLOTS
  211. #define CYTHON_USE_ASYNC_SLOTS 0
  212. #undef CYTHON_USE_PYLIST_INTERNALS
  213. #define CYTHON_USE_PYLIST_INTERNALS 0
  214. #undef CYTHON_USE_UNICODE_INTERNALS
  215. #define CYTHON_USE_UNICODE_INTERNALS 0
  216. #ifndef CYTHON_USE_UNICODE_WRITER
  217. #define CYTHON_USE_UNICODE_WRITER 0
  218. #endif
  219. #undef CYTHON_USE_PYLONG_INTERNALS
  220. #define CYTHON_USE_PYLONG_INTERNALS 0
  221. #ifndef CYTHON_AVOID_BORROWED_REFS
  222. #define CYTHON_AVOID_BORROWED_REFS 0
  223. #endif
  224. #undef CYTHON_ASSUME_SAFE_MACROS
  225. #define CYTHON_ASSUME_SAFE_MACROS 0
  226. #undef CYTHON_UNPACK_METHODS
  227. #define CYTHON_UNPACK_METHODS 0
  228. #undef CYTHON_FAST_THREAD_STATE
  229. #define CYTHON_FAST_THREAD_STATE 0
  230. #undef CYTHON_FAST_GIL
  231. #define CYTHON_FAST_GIL 0
  232. #undef CYTHON_METH_FASTCALL
  233. #define CYTHON_METH_FASTCALL 0
  234. #undef CYTHON_FAST_PYCALL
  235. #define CYTHON_FAST_PYCALL 0
  236. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  237. #define CYTHON_PEP487_INIT_SUBCLASS 1
  238. #endif
  239. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  240. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  241. #undef CYTHON_USE_MODULE_STATE
  242. #define CYTHON_USE_MODULE_STATE 1
  243. #ifndef CYTHON_USE_TP_FINALIZE
  244. #define CYTHON_USE_TP_FINALIZE 0
  245. #endif
  246. #undef CYTHON_USE_DICT_VERSIONS
  247. #define CYTHON_USE_DICT_VERSIONS 0
  248. #undef CYTHON_USE_EXC_INFO_STACK
  249. #define CYTHON_USE_EXC_INFO_STACK 0
  250. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  251. #define CYTHON_UPDATE_DESCRIPTOR_DOC 0
  252. #endif
  253. #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL)
  254. #define CYTHON_COMPILING_IN_PYPY 0
  255. #define CYTHON_COMPILING_IN_CPYTHON 0
  256. #define CYTHON_COMPILING_IN_LIMITED_API 0
  257. #define CYTHON_COMPILING_IN_GRAAL 0
  258. #define CYTHON_COMPILING_IN_NOGIL 1
  259. #ifndef CYTHON_USE_TYPE_SLOTS
  260. #define CYTHON_USE_TYPE_SLOTS 1
  261. #endif
  262. #undef CYTHON_USE_PYTYPE_LOOKUP
  263. #define CYTHON_USE_PYTYPE_LOOKUP 0
  264. #ifndef CYTHON_USE_ASYNC_SLOTS
  265. #define CYTHON_USE_ASYNC_SLOTS 1
  266. #endif
  267. #undef CYTHON_USE_PYLIST_INTERNALS
  268. #define CYTHON_USE_PYLIST_INTERNALS 0
  269. #ifndef CYTHON_USE_UNICODE_INTERNALS
  270. #define CYTHON_USE_UNICODE_INTERNALS 1
  271. #endif
  272. #undef CYTHON_USE_UNICODE_WRITER
  273. #define CYTHON_USE_UNICODE_WRITER 0
  274. #undef CYTHON_USE_PYLONG_INTERNALS
  275. #define CYTHON_USE_PYLONG_INTERNALS 0
  276. #ifndef CYTHON_AVOID_BORROWED_REFS
  277. #define CYTHON_AVOID_BORROWED_REFS 0
  278. #endif
  279. #ifndef CYTHON_ASSUME_SAFE_MACROS
  280. #define CYTHON_ASSUME_SAFE_MACROS 1
  281. #endif
  282. #ifndef CYTHON_UNPACK_METHODS
  283. #define CYTHON_UNPACK_METHODS 1
  284. #endif
  285. #undef CYTHON_FAST_THREAD_STATE
  286. #define CYTHON_FAST_THREAD_STATE 0
  287. #undef CYTHON_FAST_PYCALL
  288. #define CYTHON_FAST_PYCALL 0
  289. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  290. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  291. #endif
  292. #ifndef CYTHON_USE_TP_FINALIZE
  293. #define CYTHON_USE_TP_FINALIZE 1
  294. #endif
  295. #undef CYTHON_USE_DICT_VERSIONS
  296. #define CYTHON_USE_DICT_VERSIONS 0
  297. #undef CYTHON_USE_EXC_INFO_STACK
  298. #define CYTHON_USE_EXC_INFO_STACK 0
  299. #else
  300. #define CYTHON_COMPILING_IN_PYPY 0
  301. #define CYTHON_COMPILING_IN_CPYTHON 1
  302. #define CYTHON_COMPILING_IN_LIMITED_API 0
  303. #define CYTHON_COMPILING_IN_GRAAL 0
  304. #define CYTHON_COMPILING_IN_NOGIL 0
  305. #ifndef CYTHON_USE_TYPE_SLOTS
  306. #define CYTHON_USE_TYPE_SLOTS 1
  307. #endif
  308. #ifndef CYTHON_USE_TYPE_SPECS
  309. #define CYTHON_USE_TYPE_SPECS 0
  310. #endif
  311. #ifndef CYTHON_USE_PYTYPE_LOOKUP
  312. #define CYTHON_USE_PYTYPE_LOOKUP 1
  313. #endif
  314. #if PY_MAJOR_VERSION < 3
  315. #undef CYTHON_USE_ASYNC_SLOTS
  316. #define CYTHON_USE_ASYNC_SLOTS 0
  317. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  318. #define CYTHON_USE_ASYNC_SLOTS 1
  319. #endif
  320. #ifndef CYTHON_USE_PYLONG_INTERNALS
  321. #define CYTHON_USE_PYLONG_INTERNALS 1
  322. #endif
  323. #ifndef CYTHON_USE_PYLIST_INTERNALS
  324. #define CYTHON_USE_PYLIST_INTERNALS 1
  325. #endif
  326. #ifndef CYTHON_USE_UNICODE_INTERNALS
  327. #define CYTHON_USE_UNICODE_INTERNALS 1
  328. #endif
  329. #if PY_VERSION_HEX < 0x030300F0 || PY_VERSION_HEX >= 0x030B00A2
  330. #undef CYTHON_USE_UNICODE_WRITER
  331. #define CYTHON_USE_UNICODE_WRITER 0
  332. #elif !defined(CYTHON_USE_UNICODE_WRITER)
  333. #define CYTHON_USE_UNICODE_WRITER 1
  334. #endif
  335. #ifndef CYTHON_AVOID_BORROWED_REFS
  336. #define CYTHON_AVOID_BORROWED_REFS 0
  337. #endif
  338. #ifndef CYTHON_ASSUME_SAFE_MACROS
  339. #define CYTHON_ASSUME_SAFE_MACROS 1
  340. #endif
  341. #ifndef CYTHON_UNPACK_METHODS
  342. #define CYTHON_UNPACK_METHODS 1
  343. #endif
  344. #ifndef CYTHON_FAST_THREAD_STATE
  345. #define CYTHON_FAST_THREAD_STATE 1
  346. #endif
  347. #ifndef CYTHON_FAST_GIL
  348. #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000 && PY_VERSION_HEX < 0x030C00A6)
  349. #endif
  350. #ifndef CYTHON_METH_FASTCALL
  351. #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  352. #endif
  353. #ifndef CYTHON_FAST_PYCALL
  354. #define CYTHON_FAST_PYCALL 1
  355. #endif
  356. #ifndef CYTHON_PEP487_INIT_SUBCLASS
  357. #define CYTHON_PEP487_INIT_SUBCLASS 1
  358. #endif
  359. #if PY_VERSION_HEX < 0x03050000
  360. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  361. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  362. #elif !defined(CYTHON_PEP489_MULTI_PHASE_INIT)
  363. #define CYTHON_PEP489_MULTI_PHASE_INIT 1
  364. #endif
  365. #ifndef CYTHON_USE_MODULE_STATE
  366. #define CYTHON_USE_MODULE_STATE 0
  367. #endif
  368. #if PY_VERSION_HEX < 0x030400a1
  369. #undef CYTHON_USE_TP_FINALIZE
  370. #define CYTHON_USE_TP_FINALIZE 0
  371. #elif !defined(CYTHON_USE_TP_FINALIZE)
  372. #define CYTHON_USE_TP_FINALIZE 1
  373. #endif
  374. #if PY_VERSION_HEX < 0x030600B1
  375. #undef CYTHON_USE_DICT_VERSIONS
  376. #define CYTHON_USE_DICT_VERSIONS 0
  377. #elif !defined(CYTHON_USE_DICT_VERSIONS)
  378. #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX < 0x030C00A5)
  379. #endif
  380. #if PY_VERSION_HEX < 0x030700A3
  381. #undef CYTHON_USE_EXC_INFO_STACK
  382. #define CYTHON_USE_EXC_INFO_STACK 0
  383. #elif !defined(CYTHON_USE_EXC_INFO_STACK)
  384. #define CYTHON_USE_EXC_INFO_STACK 1
  385. #endif
  386. #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC
  387. #define CYTHON_UPDATE_DESCRIPTOR_DOC 1
  388. #endif
  389. #endif
  390. #if !defined(CYTHON_FAST_PYCCALL)
  391. #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
  392. #endif
  393. #if !defined(CYTHON_VECTORCALL)
  394. #define CYTHON_VECTORCALL (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
  395. #endif
  396. #define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
  397. #if CYTHON_USE_PYLONG_INTERNALS
  398. #if PY_MAJOR_VERSION < 3
  399. #include "longintrepr.h"
  400. #endif
  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
  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. #ifdef _MSC_VER
  476. #ifndef _MSC_STDINT_H_
  477. #if _MSC_VER < 1300
  478. typedef unsigned char uint8_t;
  479. typedef unsigned short uint16_t;
  480. typedef unsigned int uint32_t;
  481. #else
  482. typedef unsigned __int8 uint8_t;
  483. typedef unsigned __int16 uint16_t;
  484. typedef unsigned __int32 uint32_t;
  485. #endif
  486. #endif
  487. #if _MSC_VER < 1300
  488. #ifdef _WIN64
  489. typedef unsigned long long __pyx_uintptr_t;
  490. #else
  491. typedef unsigned int __pyx_uintptr_t;
  492. #endif
  493. #else
  494. #ifdef _WIN64
  495. typedef unsigned __int64 __pyx_uintptr_t;
  496. #else
  497. typedef unsigned __int32 __pyx_uintptr_t;
  498. #endif
  499. #endif
  500. #else
  501. #include <stdint.h>
  502. typedef uintptr_t __pyx_uintptr_t;
  503. #endif
  504. #ifndef CYTHON_FALLTHROUGH
  505. #if defined(__cplusplus)
  506. /* for clang __has_cpp_attribute(fallthrough) is true even before C++17
  507. * but leads to warnings with -pedantic, since it is a C++17 feature */
  508. #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || __cplusplus >= 201703L)
  509. #if __has_cpp_attribute(fallthrough)
  510. #define CYTHON_FALLTHROUGH [[fallthrough]]
  511. #endif
  512. #endif
  513. #ifndef CYTHON_FALLTHROUGH
  514. #if __has_cpp_attribute(clang::fallthrough)
  515. #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
  516. #elif __has_cpp_attribute(gnu::fallthrough)
  517. #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
  518. #endif
  519. #endif
  520. #endif
  521. #ifndef CYTHON_FALLTHROUGH
  522. #if __has_attribute(fallthrough)
  523. #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
  524. #else
  525. #define CYTHON_FALLTHROUGH
  526. #endif
  527. #endif
  528. #if defined(__clang__) && defined(__apple_build_version__)
  529. #if __apple_build_version__ < 7000000
  530. #undef CYTHON_FALLTHROUGH
  531. #define CYTHON_FALLTHROUGH
  532. #endif
  533. #endif
  534. #endif
  535. #ifdef __cplusplus
  536. template <typename T>
  537. struct __PYX_IS_UNSIGNED_IMPL {static const bool value = T(0) < T(-1);};
  538. #define __PYX_IS_UNSIGNED(type) (__PYX_IS_UNSIGNED_IMPL<type>::value)
  539. #else
  540. #define __PYX_IS_UNSIGNED(type) (((type)-1) > 0)
  541. #endif
  542. #if CYTHON_COMPILING_IN_PYPY == 1
  543. #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x030A0000)
  544. #else
  545. #define __PYX_NEED_TP_PRINT_SLOT (PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000)
  546. #endif
  547. #define __PYX_REINTERPRET_FUNCION(func_pointer, other_pointer) ((func_pointer)(void(*)(void))(other_pointer))
  548. #ifndef CYTHON_INLINE
  549. #if defined(__clang__)
  550. #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  551. #elif defined(__GNUC__)
  552. #define CYTHON_INLINE __inline__
  553. #elif defined(_MSC_VER)
  554. #define CYTHON_INLINE __inline
  555. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  556. #define CYTHON_INLINE inline
  557. #else
  558. #define CYTHON_INLINE
  559. #endif
  560. #endif
  561. #define __PYX_BUILD_PY_SSIZE_T "n"
  562. #define CYTHON_FORMAT_SSIZE_T "z"
  563. #if PY_MAJOR_VERSION < 3
  564. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  565. #define __Pyx_DefaultClassType PyClass_Type
  566. #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  567. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  568. #else
  569. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  570. #define __Pyx_DefaultClassType PyType_Type
  571. #if CYTHON_COMPILING_IN_LIMITED_API
  572. static CYTHON_INLINE PyObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
  573. PyObject *code, PyObject *c, PyObject* n, PyObject *v,
  574. PyObject *fv, PyObject *cell, PyObject* fn,
  575. PyObject *name, int fline, PyObject *lnos) {
  576. PyObject *exception_table = NULL;
  577. PyObject *types_module=NULL, *code_type=NULL, *result=NULL;
  578. #if __PYX_LIMITED_VERSION_HEX < 0x030B0000
  579. PyObject *version_info; // borrowed
  580. PyObject *py_minor_version = NULL;
  581. #endif
  582. long minor_version = 0;
  583. PyObject *type, *value, *traceback;
  584. PyErr_Fetch(&type, &value, &traceback);
  585. #if __PYX_LIMITED_VERSION_HEX >= 0x030B0000
  586. minor_version = 11; // we don't yet need to distinguish between versions > 11
  587. #else
  588. if (!(version_info = PySys_GetObject("version_info"))) goto end;
  589. if (!(py_minor_version = PySequence_GetItem(version_info, 1))) goto end;
  590. minor_version = PyLong_AsLong(py_minor_version);
  591. Py_DECREF(py_minor_version);
  592. if (minor_version == -1 && PyErr_Occurred()) goto end;
  593. #endif
  594. if (!(types_module = PyImport_ImportModule("types"))) goto end;
  595. if (!(code_type = PyObject_GetAttrString(types_module, "CodeType"))) goto end;
  596. if (minor_version <= 7) {
  597. (void)p;
  598. result = PyObject_CallFunction(code_type, "iiiiiOOOOOOiOO", a, k, l, s, f, code,
  599. c, n, v, fn, name, fline, lnos, fv, cell);
  600. } else if (minor_version <= 10) {
  601. result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOiOO", a,p, k, l, s, f, code,
  602. c, n, v, fn, name, fline, lnos, fv, cell);
  603. } else {
  604. if (!(exception_table = PyBytes_FromStringAndSize(NULL, 0))) goto end;
  605. result = PyObject_CallFunction(code_type, "iiiiiiOOOOOOOiOO", a,p, k, l, s, f, code,
  606. c, n, v, fn, name, name, fline, lnos, exception_table, fv, cell);
  607. }
  608. end:
  609. Py_XDECREF(code_type);
  610. Py_XDECREF(exception_table);
  611. Py_XDECREF(types_module);
  612. if (type) {
  613. PyErr_Restore(type, value, traceback);
  614. }
  615. return result;
  616. }
  617. #ifndef CO_OPTIMIZED
  618. #define CO_OPTIMIZED 0x0001
  619. #endif
  620. #ifndef CO_NEWLOCALS
  621. #define CO_NEWLOCALS 0x0002
  622. #endif
  623. #ifndef CO_VARARGS
  624. #define CO_VARARGS 0x0004
  625. #endif
  626. #ifndef CO_VARKEYWORDS
  627. #define CO_VARKEYWORDS 0x0008
  628. #endif
  629. #ifndef CO_ASYNC_GENERATOR
  630. #define CO_ASYNC_GENERATOR 0x0200
  631. #endif
  632. #ifndef CO_GENERATOR
  633. #define CO_GENERATOR 0x0020
  634. #endif
  635. #ifndef CO_COROUTINE
  636. #define CO_COROUTINE 0x0080
  637. #endif
  638. #elif PY_VERSION_HEX >= 0x030B0000
  639. static CYTHON_INLINE PyCodeObject* __Pyx_PyCode_New(int a, int p, int k, int l, int s, int f,
  640. PyObject *code, PyObject *c, PyObject* n, PyObject *v,
  641. PyObject *fv, PyObject *cell, PyObject* fn,
  642. PyObject *name, int fline, PyObject *lnos) {
  643. PyCodeObject *result;
  644. PyObject *empty_bytes = PyBytes_FromStringAndSize("", 0); // we don't have access to __pyx_empty_bytes here
  645. if (!empty_bytes) return NULL;
  646. result =
  647. #if PY_VERSION_HEX >= 0x030C0000
  648. PyUnstable_Code_NewWithPosOnlyArgs
  649. #else
  650. PyCode_NewWithPosOnlyArgs
  651. #endif
  652. (a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, name, fline, lnos, empty_bytes);
  653. Py_DECREF(empty_bytes);
  654. return result;
  655. }
  656. #elif PY_VERSION_HEX >= 0x030800B2 && !CYTHON_COMPILING_IN_PYPY
  657. #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  658. PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  659. #else
  660. #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  661. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  662. #endif
  663. #endif
  664. #if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  665. #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
  666. #else
  667. #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
  668. #endif
  669. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_Is)
  670. #define __Pyx_Py_Is(x, y) Py_Is(x, y)
  671. #else
  672. #define __Pyx_Py_Is(x, y) ((x) == (y))
  673. #endif
  674. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsNone)
  675. #define __Pyx_Py_IsNone(ob) Py_IsNone(ob)
  676. #else
  677. #define __Pyx_Py_IsNone(ob) __Pyx_Py_Is((ob), Py_None)
  678. #endif
  679. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsTrue)
  680. #define __Pyx_Py_IsTrue(ob) Py_IsTrue(ob)
  681. #else
  682. #define __Pyx_Py_IsTrue(ob) __Pyx_Py_Is((ob), Py_True)
  683. #endif
  684. #if PY_VERSION_HEX >= 0x030A00B1 || defined(Py_IsFalse)
  685. #define __Pyx_Py_IsFalse(ob) Py_IsFalse(ob)
  686. #else
  687. #define __Pyx_Py_IsFalse(ob) __Pyx_Py_Is((ob), Py_False)
  688. #endif
  689. #define __Pyx_NoneAsNull(obj) (__Pyx_Py_IsNone(obj) ? NULL : (obj))
  690. #if PY_VERSION_HEX >= 0x030900F0 && !CYTHON_COMPILING_IN_PYPY
  691. #define __Pyx_PyObject_GC_IsFinalized(o) PyObject_GC_IsFinalized(o)
  692. #else
  693. #define __Pyx_PyObject_GC_IsFinalized(o) _PyGC_FINALIZED(o)
  694. #endif
  695. #ifndef CO_COROUTINE
  696. #define CO_COROUTINE 0x80
  697. #endif
  698. #ifndef CO_ASYNC_GENERATOR
  699. #define CO_ASYNC_GENERATOR 0x200
  700. #endif
  701. #ifndef Py_TPFLAGS_CHECKTYPES
  702. #define Py_TPFLAGS_CHECKTYPES 0
  703. #endif
  704. #ifndef Py_TPFLAGS_HAVE_INDEX
  705. #define Py_TPFLAGS_HAVE_INDEX 0
  706. #endif
  707. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  708. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  709. #endif
  710. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  711. #define Py_TPFLAGS_HAVE_FINALIZE 0
  712. #endif
  713. #ifndef Py_TPFLAGS_SEQUENCE
  714. #define Py_TPFLAGS_SEQUENCE 0
  715. #endif
  716. #ifndef Py_TPFLAGS_MAPPING
  717. #define Py_TPFLAGS_MAPPING 0
  718. #endif
  719. #ifndef METH_STACKLESS
  720. #define METH_STACKLESS 0
  721. #endif
  722. #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  723. #ifndef METH_FASTCALL
  724. #define METH_FASTCALL 0x80
  725. #endif
  726. typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  727. typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
  728. Py_ssize_t nargs, PyObject *kwnames);
  729. #else
  730. #define __Pyx_PyCFunctionFast _PyCFunctionFast
  731. #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  732. #endif
  733. #if CYTHON_METH_FASTCALL
  734. #define __Pyx_METH_FASTCALL METH_FASTCALL
  735. #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  736. #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
  737. #else
  738. #define __Pyx_METH_FASTCALL METH_VARARGS
  739. #define __Pyx_PyCFunction_FastCall PyCFunction
  740. #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
  741. #endif
  742. #if CYTHON_VECTORCALL
  743. #define __pyx_vectorcallfunc vectorcallfunc
  744. #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET PY_VECTORCALL_ARGUMENTS_OFFSET
  745. #define __Pyx_PyVectorcall_NARGS(n) PyVectorcall_NARGS((size_t)(n))
  746. #elif CYTHON_BACKPORT_VECTORCALL
  747. typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
  748. size_t nargsf, PyObject *kwnames);
  749. #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET ((size_t)1 << (8 * sizeof(size_t) - 1))
  750. #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
  751. #else
  752. #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET 0
  753. #define __Pyx_PyVectorcall_NARGS(n) ((Py_ssize_t)(n))
  754. #endif
  755. #if PY_MAJOR_VERSION >= 0x030900B1
  756. #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_CheckExact(func)
  757. #else
  758. #define __Pyx_PyCFunction_CheckExact(func) PyCFunction_Check(func)
  759. #endif
  760. #define __Pyx_CyOrPyCFunction_Check(func) PyCFunction_Check(func)
  761. #if CYTHON_COMPILING_IN_CPYTHON
  762. #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) (((PyCFunctionObject*)(func))->m_ml->ml_meth)
  763. #elif !CYTHON_COMPILING_IN_LIMITED_API
  764. #define __Pyx_CyOrPyCFunction_GET_FUNCTION(func) PyCFunction_GET_FUNCTION(func)
  765. #endif
  766. #if CYTHON_COMPILING_IN_CPYTHON
  767. #define __Pyx_CyOrPyCFunction_GET_FLAGS(func) (((PyCFunctionObject*)(func))->m_ml->ml_flags)
  768. static CYTHON_INLINE PyObject* __Pyx_CyOrPyCFunction_GET_SELF(PyObject *func) {
  769. return (__Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_STATIC) ? NULL : ((PyCFunctionObject*)func)->m_self;
  770. }
  771. #endif
  772. static CYTHON_INLINE int __Pyx__IsSameCFunction(PyObject *func, void *cfunc) {
  773. #if CYTHON_COMPILING_IN_LIMITED_API
  774. return PyCFunction_Check(func) && PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
  775. #else
  776. return PyCFunction_Check(func) && PyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
  777. #endif
  778. }
  779. #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCFunction(func, cfunc)
  780. #if __PYX_LIMITED_VERSION_HEX < 0x030900B1
  781. #define __Pyx_PyType_FromModuleAndSpec(m, s, b) ((void)m, PyType_FromSpecWithBases(s, b))
  782. typedef PyObject *(*__Pyx_PyCMethod)(PyObject *, PyTypeObject *, PyObject *const *, size_t, PyObject *);
  783. #else
  784. #define __Pyx_PyType_FromModuleAndSpec(m, s, b) PyType_FromModuleAndSpec(m, s, b)
  785. #define __Pyx_PyCMethod PyCMethod
  786. #endif
  787. #ifndef METH_METHOD
  788. #define METH_METHOD 0x200
  789. #endif
  790. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  791. #define PyObject_Malloc(s) PyMem_Malloc(s)
  792. #define PyObject_Free(p) PyMem_Free(p)
  793. #define PyObject_Realloc(p) PyMem_Realloc(p)
  794. #endif
  795. #if CYTHON_COMPILING_IN_LIMITED_API
  796. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  797. #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
  798. #else
  799. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  800. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
  801. #endif
  802. #if CYTHON_COMPILING_IN_LIMITED_API
  803. #define __Pyx_PyThreadState_Current PyThreadState_Get()
  804. #elif !CYTHON_FAST_THREAD_STATE
  805. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  806. #elif PY_VERSION_HEX >= 0x030d00A1
  807. #define __Pyx_PyThreadState_Current PyThreadState_GetUnchecked()
  808. #elif PY_VERSION_HEX >= 0x03060000
  809. #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
  810. #elif PY_VERSION_HEX >= 0x03000000
  811. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  812. #else
  813. #define __Pyx_PyThreadState_Current _PyThreadState_Current
  814. #endif
  815. #if CYTHON_COMPILING_IN_LIMITED_API
  816. static CYTHON_INLINE void *__Pyx_PyModule_GetState(PyObject *op)
  817. {
  818. void *result;
  819. result = PyModule_GetState(op);
  820. if (!result)
  821. Py_FatalError("Couldn't find the module state");
  822. return result;
  823. }
  824. #endif
  825. #define __Pyx_PyObject_GetSlot(obj, name, func_ctype) __Pyx_PyType_GetSlot(Py_TYPE(obj), name, func_ctype)
  826. #if CYTHON_COMPILING_IN_LIMITED_API
  827. #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((func_ctype) PyType_GetSlot((type), Py_##name))
  828. #else
  829. #define __Pyx_PyType_GetSlot(type, name, func_ctype) ((type)->name)
  830. #endif
  831. #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
  832. #include "pythread.h"
  833. #define Py_tss_NEEDS_INIT 0
  834. typedef int Py_tss_t;
  835. static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  836. *key = PyThread_create_key();
  837. return 0;
  838. }
  839. static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  840. Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  841. *key = Py_tss_NEEDS_INIT;
  842. return key;
  843. }
  844. static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  845. PyObject_Free(key);
  846. }
  847. static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  848. return *key != Py_tss_NEEDS_INIT;
  849. }
  850. static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  851. PyThread_delete_key(*key);
  852. *key = Py_tss_NEEDS_INIT;
  853. }
  854. static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  855. return PyThread_set_key_value(*key, value);
  856. }
  857. static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  858. return PyThread_get_key_value(*key);
  859. }
  860. #endif
  861. #if PY_MAJOR_VERSION < 3
  862. #if CYTHON_COMPILING_IN_PYPY
  863. #if PYPY_VERSION_NUM < 0x07030600
  864. #if defined(__cplusplus) && __cplusplus >= 201402L
  865. [[deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")]]
  866. #elif defined(__GNUC__) || defined(__clang__)
  867. __attribute__ ((__deprecated__("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6")))
  868. #elif defined(_MSC_VER)
  869. __declspec(deprecated("`with nogil:` inside a nogil function will not release the GIL in PyPy2 < 7.3.6"))
  870. #endif
  871. static CYTHON_INLINE int PyGILState_Check(void) {
  872. return 0;
  873. }
  874. #else // PYPY_VERSION_NUM < 0x07030600
  875. #endif // PYPY_VERSION_NUM < 0x07030600
  876. #else
  877. static CYTHON_INLINE int PyGILState_Check(void) {
  878. PyThreadState * tstate = _PyThreadState_Current;
  879. return tstate && (tstate == PyGILState_GetThisThreadState());
  880. }
  881. #endif
  882. #endif
  883. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030d0000 || defined(_PyDict_NewPresized)
  884. #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
  885. #else
  886. #define __Pyx_PyDict_NewPresized(n) PyDict_New()
  887. #endif
  888. #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  889. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  890. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  891. #else
  892. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  893. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  894. #endif
  895. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && PY_VERSION_HEX < 0x030d0000 && CYTHON_USE_UNICODE_INTERNALS
  896. #define __Pyx_PyDict_GetItemStrWithError(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
  897. static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
  898. PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
  899. if (res == NULL) PyErr_Clear();
  900. return res;
  901. }
  902. #elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
  903. #define __Pyx_PyDict_GetItemStrWithError PyDict_GetItemWithError
  904. #define __Pyx_PyDict_GetItemStr PyDict_GetItem
  905. #else
  906. static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
  907. #if CYTHON_COMPILING_IN_PYPY
  908. return PyDict_GetItem(dict, name);
  909. #else
  910. PyDictEntry *ep;
  911. PyDictObject *mp = (PyDictObject*) dict;
  912. long hash = ((PyStringObject *) name)->ob_shash;
  913. assert(hash != -1);
  914. ep = (mp->ma_lookup)(mp, name, hash);
  915. if (ep == NULL) {
  916. return NULL;
  917. }
  918. return ep->me_value;
  919. #endif
  920. }
  921. #define __Pyx_PyDict_GetItemStr PyDict_GetItem
  922. #endif
  923. #if CYTHON_USE_TYPE_SLOTS
  924. #define __Pyx_PyType_GetFlags(tp) (((PyTypeObject *)tp)->tp_flags)
  925. #define __Pyx_PyType_HasFeature(type, feature) ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  926. #define __Pyx_PyObject_GetIterNextFunc(obj) (Py_TYPE(obj)->tp_iternext)
  927. #else
  928. #define __Pyx_PyType_GetFlags(tp) (PyType_GetFlags((PyTypeObject *)tp))
  929. #define __Pyx_PyType_HasFeature(type, feature) PyType_HasFeature(type, feature)
  930. #define __Pyx_PyObject_GetIterNextFunc(obj) PyIter_Next
  931. #endif
  932. #if CYTHON_COMPILING_IN_LIMITED_API
  933. #define __Pyx_SetItemOnTypeDict(tp, k, v) PyObject_GenericSetAttr((PyObject*)tp, k, v)
  934. #else
  935. #define __Pyx_SetItemOnTypeDict(tp, k, v) PyDict_SetItem(tp->tp_dict, k, v)
  936. #endif
  937. #if CYTHON_USE_TYPE_SPECS && PY_VERSION_HEX >= 0x03080000
  938. #define __Pyx_PyHeapTypeObject_GC_Del(obj) {\
  939. PyTypeObject *type = Py_TYPE((PyObject*)obj);\
  940. assert(__Pyx_PyType_HasFeature(type, Py_TPFLAGS_HEAPTYPE));\
  941. PyObject_GC_Del(obj);\
  942. Py_DECREF(type);\
  943. }
  944. #else
  945. #define __Pyx_PyHeapTypeObject_GC_Del(obj) PyObject_GC_Del(obj)
  946. #endif
  947. #if CYTHON_COMPILING_IN_LIMITED_API
  948. #define CYTHON_PEP393_ENABLED 1
  949. #define __Pyx_PyUnicode_READY(op) (0)
  950. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GetLength(u)
  951. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  952. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((void)u, 1114111U)
  953. #define __Pyx_PyUnicode_KIND(u) ((void)u, (0))
  954. #define __Pyx_PyUnicode_DATA(u) ((void*)u)
  955. #define __Pyx_PyUnicode_READ(k, d, i) ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  956. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GetLength(u))
  957. #elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  958. #define CYTHON_PEP393_ENABLED 1
  959. #if PY_VERSION_HEX >= 0x030C0000
  960. #define __Pyx_PyUnicode_READY(op) (0)
  961. #else
  962. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
  963. 0 : _PyUnicode_Ready((PyObject *)(op)))
  964. #endif
  965. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  966. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  967. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
  968. #define __Pyx_PyUnicode_KIND(u) ((int)PyUnicode_KIND(u))
  969. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  970. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  971. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, (Py_UCS4) ch)
  972. #if PY_VERSION_HEX >= 0x030C0000
  973. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
  974. #else
  975. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  976. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  977. #else
  978. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  979. #endif
  980. #endif
  981. #else
  982. #define CYTHON_PEP393_ENABLED 0
  983. #define PyUnicode_1BYTE_KIND 1
  984. #define PyUnicode_2BYTE_KIND 2
  985. #define PyUnicode_4BYTE_KIND 4
  986. #define __Pyx_PyUnicode_READY(op) (0)
  987. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  988. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  989. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535U : 1114111U)
  990. #define __Pyx_PyUnicode_KIND(u) ((int)sizeof(Py_UNICODE))
  991. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  992. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  993. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = (Py_UNICODE) ch)
  994. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
  995. #endif
  996. #if CYTHON_COMPILING_IN_PYPY
  997. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  998. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  999. #else
  1000. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  1001. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  1002. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  1003. #endif
  1004. #if CYTHON_COMPILING_IN_PYPY
  1005. #if !defined(PyUnicode_DecodeUnicodeEscape)
  1006. #define PyUnicode_DecodeUnicodeEscape(s, size, errors) PyUnicode_Decode(s, size, "unicode_escape", errors)
  1007. #endif
  1008. #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
  1009. #undef PyUnicode_Contains
  1010. #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
  1011. #endif
  1012. #if !defined(PyByteArray_Check)
  1013. #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
  1014. #endif
  1015. #if !defined(PyObject_Format)
  1016. #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
  1017. #endif
  1018. #endif
  1019. #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
  1020. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  1021. #if PY_MAJOR_VERSION >= 3
  1022. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  1023. #else
  1024. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  1025. #endif
  1026. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  1027. #define PyObject_ASCII(o) PyObject_Repr(o)
  1028. #endif
  1029. #if PY_MAJOR_VERSION >= 3
  1030. #define PyBaseString_Type PyUnicode_Type
  1031. #define PyStringObject PyUnicodeObject
  1032. #define PyString_Type PyUnicode_Type
  1033. #define PyString_Check PyUnicode_Check
  1034. #define PyString_CheckExact PyUnicode_CheckExact
  1035. #ifndef PyObject_Unicode
  1036. #define PyObject_Unicode PyObject_Str
  1037. #endif
  1038. #endif
  1039. #if PY_MAJOR_VERSION >= 3
  1040. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  1041. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  1042. #else
  1043. #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  1044. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  1045. #endif
  1046. #if CYTHON_COMPILING_IN_CPYTHON
  1047. #define __Pyx_PySequence_ListKeepNew(obj)\
  1048. (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
  1049. #else
  1050. #define __Pyx_PySequence_ListKeepNew(obj) PySequence_List(obj)
  1051. #endif
  1052. #ifndef PySet_CheckExact
  1053. #define PySet_CheckExact(obj) __Pyx_IS_TYPE(obj, &PySet_Type)
  1054. #endif
  1055. #if PY_VERSION_HEX >= 0x030900A4
  1056. #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  1057. #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
  1058. #else
  1059. #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  1060. #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
  1061. #endif
  1062. #if CYTHON_ASSUME_SAFE_MACROS
  1063. #define __Pyx_PySequence_ITEM(o, i) PySequence_ITEM(o, i)
  1064. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  1065. #define __Pyx_PyTuple_SET_ITEM(o, i, v) (PyTuple_SET_ITEM(o, i, v), (0))
  1066. #define __Pyx_PyList_SET_ITEM(o, i, v) (PyList_SET_ITEM(o, i, v), (0))
  1067. #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_GET_SIZE(o)
  1068. #define __Pyx_PyList_GET_SIZE(o) PyList_GET_SIZE(o)
  1069. #define __Pyx_PySet_GET_SIZE(o) PySet_GET_SIZE(o)
  1070. #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_GET_SIZE(o)
  1071. #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_GET_SIZE(o)
  1072. #else
  1073. #define __Pyx_PySequence_ITEM(o, i) PySequence_GetItem(o, i)
  1074. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  1075. #define __Pyx_PyTuple_SET_ITEM(o, i, v) PyTuple_SetItem(o, i, v)
  1076. #define __Pyx_PyList_SET_ITEM(o, i, v) PyList_SetItem(o, i, v)
  1077. #define __Pyx_PyTuple_GET_SIZE(o) PyTuple_Size(o)
  1078. #define __Pyx_PyList_GET_SIZE(o) PyList_Size(o)
  1079. #define __Pyx_PySet_GET_SIZE(o) PySet_Size(o)
  1080. #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o)
  1081. #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o)
  1082. #endif
  1083. #if PY_VERSION_HEX >= 0x030d00A1
  1084. #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name)
  1085. #else
  1086. static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) {
  1087. PyObject *module = PyImport_AddModule(name);
  1088. Py_XINCREF(module);
  1089. return module;
  1090. }
  1091. #endif
  1092. #if PY_MAJOR_VERSION >= 3
  1093. #define PyIntObject PyLongObject
  1094. #define PyInt_Type PyLong_Type
  1095. #define PyInt_Check(op) PyLong_Check(op)
  1096. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  1097. #define __Pyx_Py3Int_Check(op) PyLong_Check(op)
  1098. #define __Pyx_Py3Int_CheckExact(op) PyLong_CheckExact(op)
  1099. #define PyInt_FromString PyLong_FromString
  1100. #define PyInt_FromUnicode PyLong_FromUnicode
  1101. #define PyInt_FromLong PyLong_FromLong
  1102. #define PyInt_FromSize_t PyLong_FromSize_t
  1103. #define PyInt_FromSsize_t PyLong_FromSsize_t
  1104. #define PyInt_AsLong PyLong_AsLong
  1105. #define PyInt_AS_LONG PyLong_AS_LONG
  1106. #define PyInt_AsSsize_t PyLong_AsSsize_t
  1107. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  1108. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  1109. #define PyNumber_Int PyNumber_Long
  1110. #else
  1111. #define __Pyx_Py3Int_Check(op) (PyLong_Check(op) || PyInt_Check(op))
  1112. #define __Pyx_Py3Int_CheckExact(op) (PyLong_CheckExact(op) || PyInt_CheckExact(op))
  1113. #endif
  1114. #if PY_MAJOR_VERSION >= 3
  1115. #define PyBoolObject PyLongObject
  1116. #endif
  1117. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  1118. #ifndef PyUnicode_InternFromString
  1119. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  1120. #endif
  1121. #endif
  1122. #if PY_VERSION_HEX < 0x030200A4
  1123. typedef long Py_hash_t;
  1124. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  1125. #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsHash_t
  1126. #else
  1127. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  1128. #define __Pyx_PyInt_AsHash_t __Pyx_PyIndex_AsSsize_t
  1129. #endif
  1130. #if CYTHON_USE_ASYNC_SLOTS
  1131. #if PY_VERSION_HEX >= 0x030500B1
  1132. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  1133. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  1134. #else
  1135. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  1136. #endif
  1137. #else
  1138. #define __Pyx_PyType_AsAsync(obj) NULL
  1139. #endif
  1140. #ifndef __Pyx_PyAsyncMethodsStruct
  1141. typedef struct {
  1142. unaryfunc am_await;
  1143. unaryfunc am_aiter;
  1144. unaryfunc am_anext;
  1145. } __Pyx_PyAsyncMethodsStruct;
  1146. #endif
  1147. #if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  1148. #if !defined(_USE_MATH_DEFINES)
  1149. #define _USE_MATH_DEFINES
  1150. #endif
  1151. #endif
  1152. #include <math.h>
  1153. #ifdef NAN
  1154. #define __PYX_NAN() ((float) NAN)
  1155. #else
  1156. static CYTHON_INLINE float __PYX_NAN() {
  1157. float value;
  1158. memset(&value, 0xFF, sizeof(value));
  1159. return value;
  1160. }
  1161. #endif
  1162. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  1163. #define __Pyx_truncl trunc
  1164. #else
  1165. #define __Pyx_truncl truncl
  1166. #endif
  1167. #define __PYX_MARK_ERR_POS(f_index, lineno) \
  1168. { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
  1169. #define __PYX_ERR(f_index, lineno, Ln_error) \
  1170. { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
  1171. #ifdef CYTHON_EXTERN_C
  1172. #undef __PYX_EXTERN_C
  1173. #define __PYX_EXTERN_C CYTHON_EXTERN_C
  1174. #elif defined(__PYX_EXTERN_C)
  1175. #ifdef _MSC_VER
  1176. #pragma message ("Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.")
  1177. #else
  1178. #warning Please do not define the '__PYX_EXTERN_C' macro externally. Use 'CYTHON_EXTERN_C' instead.
  1179. #endif
  1180. #else
  1181. #ifdef __cplusplus
  1182. #define __PYX_EXTERN_C extern "C"
  1183. #else
  1184. #define __PYX_EXTERN_C extern
  1185. #endif
  1186. #endif
  1187. #define __PYX_HAVE__fontTools__pens__momentsPen
  1188. #define __PYX_HAVE_API__fontTools__pens__momentsPen
  1189. /* Early includes */
  1190. #ifdef _OPENMP
  1191. #include <omp.h>
  1192. #endif /* _OPENMP */
  1193. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  1194. #define CYTHON_WITHOUT_ASSERTIONS
  1195. #endif
  1196. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  1197. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  1198. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  1199. #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
  1200. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
  1201. #define __PYX_DEFAULT_STRING_ENCODING ""
  1202. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  1203. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  1204. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  1205. #define __Pyx_long_cast(x) ((long)x)
  1206. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  1207. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  1208. (sizeof(type) > sizeof(Py_ssize_t) &&\
  1209. likely(v < (type)PY_SSIZE_T_MAX ||\
  1210. v == (type)PY_SSIZE_T_MAX) &&\
  1211. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  1212. v == (type)PY_SSIZE_T_MIN))) ||\
  1213. (sizeof(type) == sizeof(Py_ssize_t) &&\
  1214. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  1215. v == (type)PY_SSIZE_T_MAX))) )
  1216. static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
  1217. return (size_t) i < (size_t) limit;
  1218. }
  1219. #if defined (__cplusplus) && __cplusplus >= 201103L
  1220. #include <cstdlib>
  1221. #define __Pyx_sst_abs(value) std::abs(value)
  1222. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  1223. #define __Pyx_sst_abs(value) abs(value)
  1224. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  1225. #define __Pyx_sst_abs(value) labs(value)
  1226. #elif defined (_MSC_VER)
  1227. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  1228. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  1229. #define __Pyx_sst_abs(value) llabs(value)
  1230. #elif defined (__GNUC__)
  1231. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  1232. #else
  1233. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  1234. #endif
  1235. static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s);
  1236. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  1237. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  1238. static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char*);
  1239. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  1240. #define __Pyx_PyBytes_FromString PyBytes_FromString
  1241. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  1242. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  1243. #if PY_MAJOR_VERSION < 3
  1244. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  1245. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  1246. #else
  1247. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  1248. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  1249. #endif
  1250. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  1251. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  1252. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  1253. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  1254. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  1255. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  1256. #define __Pyx_PyObject_AsWritableString(s) ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1257. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1258. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
  1259. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  1260. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  1261. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  1262. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  1263. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  1264. #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
  1265. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  1266. #if CYTHON_COMPILING_IN_LIMITED_API
  1267. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
  1268. {
  1269. const wchar_t *u_end = u;
  1270. while (*u_end++) ;
  1271. return (size_t)(u_end - u - 1);
  1272. }
  1273. #else
  1274. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
  1275. {
  1276. const Py_UNICODE *u_end = u;
  1277. while (*u_end++) ;
  1278. return (size_t)(u_end - u - 1);
  1279. }
  1280. #endif
  1281. #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o)
  1282. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  1283. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  1284. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  1285. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  1286. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  1287. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  1288. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  1289. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
  1290. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  1291. #define __Pyx_PySequence_Tuple(obj)\
  1292. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  1293. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  1294. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  1295. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
  1296. #if CYTHON_ASSUME_SAFE_MACROS
  1297. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  1298. #else
  1299. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  1300. #endif
  1301. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  1302. #if PY_MAJOR_VERSION >= 3
  1303. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  1304. #else
  1305. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  1306. #endif
  1307. #if CYTHON_USE_PYLONG_INTERNALS
  1308. #if PY_VERSION_HEX >= 0x030C00A7
  1309. #ifndef _PyLong_SIGN_MASK
  1310. #define _PyLong_SIGN_MASK 3
  1311. #endif
  1312. #ifndef _PyLong_NON_SIZE_BITS
  1313. #define _PyLong_NON_SIZE_BITS 3
  1314. #endif
  1315. #define __Pyx_PyLong_Sign(x) (((PyLongObject*)x)->long_value.lv_tag & _PyLong_SIGN_MASK)
  1316. #define __Pyx_PyLong_IsNeg(x) ((__Pyx_PyLong_Sign(x) & 2) != 0)
  1317. #define __Pyx_PyLong_IsNonNeg(x) (!__Pyx_PyLong_IsNeg(x))
  1318. #define __Pyx_PyLong_IsZero(x) (__Pyx_PyLong_Sign(x) & 1)
  1319. #define __Pyx_PyLong_IsPos(x) (__Pyx_PyLong_Sign(x) == 0)
  1320. #define __Pyx_PyLong_CompactValueUnsigned(x) (__Pyx_PyLong_Digits(x)[0])
  1321. #define __Pyx_PyLong_DigitCount(x) ((Py_ssize_t) (((PyLongObject*)x)->long_value.lv_tag >> _PyLong_NON_SIZE_BITS))
  1322. #define __Pyx_PyLong_SignedDigitCount(x)\
  1323. ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
  1324. #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
  1325. #define __Pyx_PyLong_IsCompact(x) PyUnstable_Long_IsCompact((PyLongObject*) x)
  1326. #define __Pyx_PyLong_CompactValue(x) PyUnstable_Long_CompactValue((PyLongObject*) x)
  1327. #else
  1328. #define __Pyx_PyLong_IsCompact(x) (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
  1329. #define __Pyx_PyLong_CompactValue(x) ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
  1330. #endif
  1331. typedef Py_ssize_t __Pyx_compact_pylong;
  1332. typedef size_t __Pyx_compact_upylong;
  1333. #else // Py < 3.12
  1334. #define __Pyx_PyLong_IsNeg(x) (Py_SIZE(x) < 0)
  1335. #define __Pyx_PyLong_IsNonNeg(x) (Py_SIZE(x) >= 0)
  1336. #define __Pyx_PyLong_IsZero(x) (Py_SIZE(x) == 0)
  1337. #define __Pyx_PyLong_IsPos(x) (Py_SIZE(x) > 0)
  1338. #define __Pyx_PyLong_CompactValueUnsigned(x) ((Py_SIZE(x) == 0) ? 0 : __Pyx_PyLong_Digits(x)[0])
  1339. #define __Pyx_PyLong_DigitCount(x) __Pyx_sst_abs(Py_SIZE(x))
  1340. #define __Pyx_PyLong_SignedDigitCount(x) Py_SIZE(x)
  1341. #define __Pyx_PyLong_IsCompact(x) (Py_SIZE(x) == 0 || Py_SIZE(x) == 1 || Py_SIZE(x) == -1)
  1342. #define __Pyx_PyLong_CompactValue(x)\
  1343. ((Py_SIZE(x) == 0) ? (sdigit) 0 : ((Py_SIZE(x) < 0) ? -(sdigit)__Pyx_PyLong_Digits(x)[0] : (sdigit)__Pyx_PyLong_Digits(x)[0]))
  1344. typedef sdigit __Pyx_compact_pylong;
  1345. typedef digit __Pyx_compact_upylong;
  1346. #endif
  1347. #if PY_VERSION_HEX >= 0x030C00A5
  1348. #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->long_value.ob_digit)
  1349. #else
  1350. #define __Pyx_PyLong_Digits(x) (((PyLongObject*)x)->ob_digit)
  1351. #endif
  1352. #endif
  1353. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  1354. #include <string.h>
  1355. static int __Pyx_sys_getdefaultencoding_not_ascii;
  1356. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  1357. PyObject* sys;
  1358. PyObject* default_encoding = NULL;
  1359. PyObject* ascii_chars_u = NULL;
  1360. PyObject* ascii_chars_b = NULL;
  1361. const char* default_encoding_c;
  1362. sys = PyImport_ImportModule("sys");
  1363. if (!sys) goto bad;
  1364. default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  1365. Py_DECREF(sys);
  1366. if (!default_encoding) goto bad;
  1367. default_encoding_c = PyBytes_AsString(default_encoding);
  1368. if (!default_encoding_c) goto bad;
  1369. if (strcmp(default_encoding_c, "ascii") == 0) {
  1370. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  1371. } else {
  1372. char ascii_chars[128];
  1373. int c;
  1374. for (c = 0; c < 128; c++) {
  1375. ascii_chars[c] = (char) c;
  1376. }
  1377. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  1378. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  1379. if (!ascii_chars_u) goto bad;
  1380. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  1381. if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  1382. PyErr_Format(
  1383. PyExc_ValueError,
  1384. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  1385. default_encoding_c);
  1386. goto bad;
  1387. }
  1388. Py_DECREF(ascii_chars_u);
  1389. Py_DECREF(ascii_chars_b);
  1390. }
  1391. Py_DECREF(default_encoding);
  1392. return 0;
  1393. bad:
  1394. Py_XDECREF(default_encoding);
  1395. Py_XDECREF(ascii_chars_u);
  1396. Py_XDECREF(ascii_chars_b);
  1397. return -1;
  1398. }
  1399. #endif
  1400. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  1401. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  1402. #else
  1403. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  1404. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  1405. #include <string.h>
  1406. static char* __PYX_DEFAULT_STRING_ENCODING;
  1407. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  1408. PyObject* sys;
  1409. PyObject* default_encoding = NULL;
  1410. char* default_encoding_c;
  1411. sys = PyImport_ImportModule("sys");
  1412. if (!sys) goto bad;
  1413. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  1414. Py_DECREF(sys);
  1415. if (!default_encoding) goto bad;
  1416. default_encoding_c = PyBytes_AsString(default_encoding);
  1417. if (!default_encoding_c) goto bad;
  1418. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
  1419. if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  1420. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  1421. Py_DECREF(default_encoding);
  1422. return 0;
  1423. bad:
  1424. Py_XDECREF(default_encoding);
  1425. return -1;
  1426. }
  1427. #endif
  1428. #endif
  1429. /* Test for GCC > 2.95 */
  1430. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  1431. #define likely(x) __builtin_expect(!!(x), 1)
  1432. #define unlikely(x) __builtin_expect(!!(x), 0)
  1433. #else /* !__GNUC__ or GCC < 2.95 */
  1434. #define likely(x) (x)
  1435. #define unlikely(x) (x)
  1436. #endif /* __GNUC__ */
  1437. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  1438. #if !CYTHON_USE_MODULE_STATE
  1439. static PyObject *__pyx_m = NULL;
  1440. #endif
  1441. static int __pyx_lineno;
  1442. static int __pyx_clineno = 0;
  1443. static const char * __pyx_cfilenm = __FILE__;
  1444. static const char *__pyx_filename;
  1445. /* #### Code section: filename_table ### */
  1446. static const char *__pyx_f[] = {
  1447. "Lib/fontTools/pens/momentsPen.py",
  1448. };
  1449. /* #### Code section: utility_code_proto_before_types ### */
  1450. /* ForceInitThreads.proto */
  1451. #ifndef __PYX_FORCE_INIT_THREADS
  1452. #define __PYX_FORCE_INIT_THREADS 0
  1453. #endif
  1454. /* #### Code section: numeric_typedefs ### */
  1455. /* #### Code section: complex_type_declarations ### */
  1456. /* #### Code section: type_declarations ### */
  1457. /*--- Type declarations ---*/
  1458. /* #### Code section: utility_code_proto ### */
  1459. /* --- Runtime support code (head) --- */
  1460. /* Refnanny.proto */
  1461. #ifndef CYTHON_REFNANNY
  1462. #define CYTHON_REFNANNY 0
  1463. #endif
  1464. #if CYTHON_REFNANNY
  1465. typedef struct {
  1466. void (*INCREF)(void*, PyObject*, Py_ssize_t);
  1467. void (*DECREF)(void*, PyObject*, Py_ssize_t);
  1468. void (*GOTREF)(void*, PyObject*, Py_ssize_t);
  1469. void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
  1470. void* (*SetupContext)(const char*, Py_ssize_t, const char*);
  1471. void (*FinishContext)(void**);
  1472. } __Pyx_RefNannyAPIStruct;
  1473. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  1474. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  1475. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  1476. #ifdef WITH_THREAD
  1477. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1478. if (acquire_gil) {\
  1479. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1480. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
  1481. PyGILState_Release(__pyx_gilstate_save);\
  1482. } else {\
  1483. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
  1484. }
  1485. #define __Pyx_RefNannyFinishContextNogil() {\
  1486. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1487. __Pyx_RefNannyFinishContext();\
  1488. PyGILState_Release(__pyx_gilstate_save);\
  1489. }
  1490. #else
  1491. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1492. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  1493. #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
  1494. #endif
  1495. #define __Pyx_RefNannyFinishContextNogil() {\
  1496. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1497. __Pyx_RefNannyFinishContext();\
  1498. PyGILState_Release(__pyx_gilstate_save);\
  1499. }
  1500. #define __Pyx_RefNannyFinishContext()\
  1501. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  1502. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1503. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1504. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1505. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  1506. #define __Pyx_XINCREF(r) do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  1507. #define __Pyx_XDECREF(r) do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  1508. #define __Pyx_XGOTREF(r) do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  1509. #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
  1510. #else
  1511. #define __Pyx_RefNannyDeclarations
  1512. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  1513. #define __Pyx_RefNannyFinishContextNogil()
  1514. #define __Pyx_RefNannyFinishContext()
  1515. #define __Pyx_INCREF(r) Py_INCREF(r)
  1516. #define __Pyx_DECREF(r) Py_DECREF(r)
  1517. #define __Pyx_GOTREF(r)
  1518. #define __Pyx_GIVEREF(r)
  1519. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  1520. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  1521. #define __Pyx_XGOTREF(r)
  1522. #define __Pyx_XGIVEREF(r)
  1523. #endif
  1524. #define __Pyx_Py_XDECREF_SET(r, v) do {\
  1525. PyObject *tmp = (PyObject *) r;\
  1526. r = v; Py_XDECREF(tmp);\
  1527. } while (0)
  1528. #define __Pyx_XDECREF_SET(r, v) do {\
  1529. PyObject *tmp = (PyObject *) r;\
  1530. r = v; __Pyx_XDECREF(tmp);\
  1531. } while (0)
  1532. #define __Pyx_DECREF_SET(r, v) do {\
  1533. PyObject *tmp = (PyObject *) r;\
  1534. r = v; __Pyx_DECREF(tmp);\
  1535. } while (0)
  1536. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  1537. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  1538. /* PyErrExceptionMatches.proto */
  1539. #if CYTHON_FAST_THREAD_STATE
  1540. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1541. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1542. #else
  1543. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1544. #endif
  1545. /* PyThreadStateGet.proto */
  1546. #if CYTHON_FAST_THREAD_STATE
  1547. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  1548. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  1549. #if PY_VERSION_HEX >= 0x030C00A6
  1550. #define __Pyx_PyErr_Occurred() (__pyx_tstate->current_exception != NULL)
  1551. #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->current_exception ? (PyObject*) Py_TYPE(__pyx_tstate->current_exception) : (PyObject*) NULL)
  1552. #else
  1553. #define __Pyx_PyErr_Occurred() (__pyx_tstate->curexc_type != NULL)
  1554. #define __Pyx_PyErr_CurrentExceptionType() (__pyx_tstate->curexc_type)
  1555. #endif
  1556. #else
  1557. #define __Pyx_PyThreadState_declare
  1558. #define __Pyx_PyThreadState_assign
  1559. #define __Pyx_PyErr_Occurred() (PyErr_Occurred() != NULL)
  1560. #define __Pyx_PyErr_CurrentExceptionType() PyErr_Occurred()
  1561. #endif
  1562. /* PyErrFetchRestore.proto */
  1563. #if CYTHON_FAST_THREAD_STATE
  1564. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  1565. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  1566. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  1567. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  1568. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  1569. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1570. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1571. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A6
  1572. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  1573. #else
  1574. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1575. #endif
  1576. #else
  1577. #define __Pyx_PyErr_Clear() PyErr_Clear()
  1578. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1579. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  1580. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  1581. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  1582. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  1583. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  1584. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  1585. #endif
  1586. /* PyObjectGetAttrStr.proto */
  1587. #if CYTHON_USE_TYPE_SLOTS
  1588. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  1589. #else
  1590. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  1591. #endif
  1592. /* PyObjectGetAttrStrNoError.proto */
  1593. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
  1594. /* GetBuiltinName.proto */
  1595. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  1596. /* TupleAndListFromArray.proto */
  1597. #if CYTHON_COMPILING_IN_CPYTHON
  1598. static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
  1599. static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
  1600. #endif
  1601. /* IncludeStringH.proto */
  1602. #include <string.h>
  1603. /* BytesEquals.proto */
  1604. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
  1605. /* UnicodeEquals.proto */
  1606. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
  1607. /* fastcall.proto */
  1608. #if CYTHON_AVOID_BORROWED_REFS
  1609. #define __Pyx_Arg_VARARGS(args, i) PySequence_GetItem(args, i)
  1610. #elif CYTHON_ASSUME_SAFE_MACROS
  1611. #define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
  1612. #else
  1613. #define __Pyx_Arg_VARARGS(args, i) PyTuple_GetItem(args, i)
  1614. #endif
  1615. #if CYTHON_AVOID_BORROWED_REFS
  1616. #define __Pyx_Arg_NewRef_VARARGS(arg) __Pyx_NewRef(arg)
  1617. #define __Pyx_Arg_XDECREF_VARARGS(arg) Py_XDECREF(arg)
  1618. #else
  1619. #define __Pyx_Arg_NewRef_VARARGS(arg) arg // no-op
  1620. #define __Pyx_Arg_XDECREF_VARARGS(arg) // no-op - arg is borrowed
  1621. #endif
  1622. #define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
  1623. #define __Pyx_KwValues_VARARGS(args, nargs) NULL
  1624. #define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
  1625. #define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
  1626. #if CYTHON_METH_FASTCALL
  1627. #define __Pyx_Arg_FASTCALL(args, i) args[i]
  1628. #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
  1629. #define __Pyx_KwValues_FASTCALL(args, nargs) ((args) + (nargs))
  1630. static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
  1631. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
  1632. CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues);
  1633. #else
  1634. #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
  1635. #endif
  1636. #define __Pyx_Arg_NewRef_FASTCALL(arg) arg // no-op, __Pyx_Arg_FASTCALL is direct and this needs
  1637. #define __Pyx_Arg_XDECREF_FASTCALL(arg) // no-op - arg was returned from array
  1638. #else
  1639. #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
  1640. #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
  1641. #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
  1642. #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
  1643. #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
  1644. #define __Pyx_Arg_NewRef_FASTCALL(arg) __Pyx_Arg_NewRef_VARARGS(arg)
  1645. #define __Pyx_Arg_XDECREF_FASTCALL(arg) __Pyx_Arg_XDECREF_VARARGS(arg)
  1646. #endif
  1647. #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  1648. #define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
  1649. #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
  1650. #else
  1651. #define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
  1652. #define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
  1653. #endif
  1654. /* RaiseDoubleKeywords.proto */
  1655. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  1656. /* ParseKeywords.proto */
  1657. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
  1658. PyObject **argnames[],
  1659. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
  1660. const char* function_name);
  1661. /* RaiseArgTupleInvalid.proto */
  1662. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  1663. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  1664. /* PyDictVersioning.proto */
  1665. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  1666. #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
  1667. #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
  1668. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
  1669. (version_var) = __PYX_GET_DICT_VERSION(dict);\
  1670. (cache_var) = (value);
  1671. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
  1672. static PY_UINT64_T __pyx_dict_version = 0;\
  1673. static PyObject *__pyx_dict_cached_value = NULL;\
  1674. if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
  1675. (VAR) = __pyx_dict_cached_value;\
  1676. } else {\
  1677. (VAR) = __pyx_dict_cached_value = (LOOKUP);\
  1678. __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
  1679. }\
  1680. }
  1681. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
  1682. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
  1683. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
  1684. #else
  1685. #define __PYX_GET_DICT_VERSION(dict) (0)
  1686. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
  1687. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
  1688. #endif
  1689. /* GetModuleGlobalName.proto */
  1690. #if CYTHON_USE_DICT_VERSIONS
  1691. #define __Pyx_GetModuleGlobalName(var, name) do {\
  1692. static PY_UINT64_T __pyx_dict_version = 0;\
  1693. static PyObject *__pyx_dict_cached_value = NULL;\
  1694. (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
  1695. (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
  1696. __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1697. } while(0)
  1698. #define __Pyx_GetModuleGlobalNameUncached(var, name) do {\
  1699. PY_UINT64_T __pyx_dict_version;\
  1700. PyObject *__pyx_dict_cached_value;\
  1701. (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1702. } while(0)
  1703. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
  1704. #else
  1705. #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1706. #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1707. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
  1708. #endif
  1709. /* PyFunctionFastCall.proto */
  1710. #if CYTHON_FAST_PYCALL
  1711. #if !CYTHON_VECTORCALL
  1712. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  1713. __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  1714. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
  1715. #endif
  1716. #define __Pyx_BUILD_ASSERT_EXPR(cond)\
  1717. (sizeof(char [1 - 2*!(cond)]) - 1)
  1718. #ifndef Py_MEMBER_SIZE
  1719. #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
  1720. #endif
  1721. #if !CYTHON_VECTORCALL
  1722. #if PY_VERSION_HEX >= 0x03080000
  1723. #include "frameobject.h"
  1724. #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  1725. #ifndef Py_BUILD_CORE
  1726. #define Py_BUILD_CORE 1
  1727. #endif
  1728. #include "internal/pycore_frame.h"
  1729. #endif
  1730. #define __Pxy_PyFrame_Initialize_Offsets()
  1731. #define __Pyx_PyFrame_GetLocalsplus(frame) ((frame)->f_localsplus)
  1732. #else
  1733. static size_t __pyx_pyframe_localsplus_offset = 0;
  1734. #include "frameobject.h"
  1735. #define __Pxy_PyFrame_Initialize_Offsets()\
  1736. ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
  1737. (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  1738. #define __Pyx_PyFrame_GetLocalsplus(frame)\
  1739. (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
  1740. #endif
  1741. #endif
  1742. #endif
  1743. /* PyObjectCall.proto */
  1744. #if CYTHON_COMPILING_IN_CPYTHON
  1745. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  1746. #else
  1747. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  1748. #endif
  1749. /* PyObjectCallMethO.proto */
  1750. #if CYTHON_COMPILING_IN_CPYTHON
  1751. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  1752. #endif
  1753. /* PyObjectFastCall.proto */
  1754. #define __Pyx_PyObject_FastCall(func, args, nargs) __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
  1755. static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);
  1756. /* PyObjectSetAttrStr.proto */
  1757. #if CYTHON_USE_TYPE_SLOTS
  1758. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
  1759. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
  1760. #else
  1761. #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
  1762. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  1763. #endif
  1764. /* RaiseException.proto */
  1765. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  1766. /* RaiseTooManyValuesToUnpack.proto */
  1767. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  1768. /* RaiseNeedMoreValuesToUnpack.proto */
  1769. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  1770. /* IterFinish.proto */
  1771. static CYTHON_INLINE int __Pyx_IterFinish(void);
  1772. /* UnpackItemEndCheck.proto */
  1773. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
  1774. /* Import.proto */
  1775. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  1776. /* ImportFrom.proto */
  1777. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  1778. /* GetTopmostException.proto */
  1779. #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
  1780. static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
  1781. #endif
  1782. /* SaveResetException.proto */
  1783. #if CYTHON_FAST_THREAD_STATE
  1784. #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
  1785. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1786. #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
  1787. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1788. #else
  1789. #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
  1790. #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
  1791. #endif
  1792. /* FastTypeChecks.proto */
  1793. #if CYTHON_COMPILING_IN_CPYTHON
  1794. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1795. #define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
  1796. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1797. static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
  1798. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1799. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1800. #else
  1801. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1802. #define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
  1803. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1804. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1805. #endif
  1806. #define __Pyx_PyErr_ExceptionMatches2(err1, err2) __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_CurrentExceptionType(), err1, err2)
  1807. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1808. /* GetException.proto */
  1809. #if CYTHON_FAST_THREAD_STATE
  1810. #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
  1811. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1812. #else
  1813. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
  1814. #endif
  1815. /* PyObjectCallOneArg.proto */
  1816. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  1817. /* Py3UpdateBases.proto */
  1818. static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);
  1819. /* CalculateMetaclass.proto */
  1820. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  1821. /* IncludeStructmemberH.proto */
  1822. #include <structmember.h>
  1823. /* FixUpExtensionType.proto */
  1824. #if CYTHON_USE_TYPE_SPECS
  1825. static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type);
  1826. #endif
  1827. /* FetchSharedCythonModule.proto */
  1828. static PyObject *__Pyx_FetchSharedCythonABIModule(void);
  1829. /* FetchCommonType.proto */
  1830. #if !CYTHON_USE_TYPE_SPECS
  1831. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  1832. #else
  1833. static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases);
  1834. #endif
  1835. /* PyMethodNew.proto */
  1836. #if CYTHON_COMPILING_IN_LIMITED_API
  1837. static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
  1838. PyObject *typesModule=NULL, *methodType=NULL, *result=NULL;
  1839. CYTHON_UNUSED_VAR(typ);
  1840. if (!self)
  1841. return __Pyx_NewRef(func);
  1842. typesModule = PyImport_ImportModule("types");
  1843. if (!typesModule) return NULL;
  1844. methodType = PyObject_GetAttrString(typesModule, "MethodType");
  1845. Py_DECREF(typesModule);
  1846. if (!methodType) return NULL;
  1847. result = PyObject_CallFunctionObjArgs(methodType, func, self, NULL);
  1848. Py_DECREF(methodType);
  1849. return result;
  1850. }
  1851. #elif PY_MAJOR_VERSION >= 3
  1852. static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
  1853. CYTHON_UNUSED_VAR(typ);
  1854. if (!self)
  1855. return __Pyx_NewRef(func);
  1856. return PyMethod_New(func, self);
  1857. }
  1858. #else
  1859. #define __Pyx_PyMethod_New PyMethod_New
  1860. #endif
  1861. /* PyVectorcallFastCallDict.proto */
  1862. #if CYTHON_METH_FASTCALL
  1863. static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
  1864. #endif
  1865. /* CythonFunctionShared.proto */
  1866. #define __Pyx_CyFunction_USED
  1867. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  1868. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  1869. #define __Pyx_CYFUNCTION_CCLASS 0x04
  1870. #define __Pyx_CYFUNCTION_COROUTINE 0x08
  1871. #define __Pyx_CyFunction_GetClosure(f)\
  1872. (((__pyx_CyFunctionObject *) (f))->func_closure)
  1873. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  1874. #define __Pyx_CyFunction_GetClassObj(f)\
  1875. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  1876. #else
  1877. #define __Pyx_CyFunction_GetClassObj(f)\
  1878. ((PyObject*) ((PyCMethodObject *) (f))->mm_class)
  1879. #endif
  1880. #define __Pyx_CyFunction_SetClassObj(f, classobj)\
  1881. __Pyx__CyFunction_SetClassObj((__pyx_CyFunctionObject *) (f), (classobj))
  1882. #define __Pyx_CyFunction_Defaults(type, f)\
  1883. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  1884. #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
  1885. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  1886. typedef struct {
  1887. #if CYTHON_COMPILING_IN_LIMITED_API
  1888. PyObject_HEAD
  1889. PyObject *func;
  1890. #elif PY_VERSION_HEX < 0x030900B1
  1891. PyCFunctionObject func;
  1892. #else
  1893. PyCMethodObject func;
  1894. #endif
  1895. #if CYTHON_BACKPORT_VECTORCALL
  1896. __pyx_vectorcallfunc func_vectorcall;
  1897. #endif
  1898. #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
  1899. PyObject *func_weakreflist;
  1900. #endif
  1901. PyObject *func_dict;
  1902. PyObject *func_name;
  1903. PyObject *func_qualname;
  1904. PyObject *func_doc;
  1905. PyObject *func_globals;
  1906. PyObject *func_code;
  1907. PyObject *func_closure;
  1908. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  1909. PyObject *func_classobj;
  1910. #endif
  1911. void *defaults;
  1912. int defaults_pyobjects;
  1913. size_t defaults_size; // used by FusedFunction for copying defaults
  1914. int flags;
  1915. PyObject *defaults_tuple;
  1916. PyObject *defaults_kwdict;
  1917. PyObject *(*defaults_getter)(PyObject *);
  1918. PyObject *func_annotations;
  1919. PyObject *func_is_coroutine;
  1920. } __pyx_CyFunctionObject;
  1921. #undef __Pyx_CyOrPyCFunction_Check
  1922. #define __Pyx_CyFunction_Check(obj) __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
  1923. #define __Pyx_CyOrPyCFunction_Check(obj) __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
  1924. #define __Pyx_CyFunction_CheckExact(obj) __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
  1925. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc);
  1926. #undef __Pyx_IsSameCFunction
  1927. #define __Pyx_IsSameCFunction(func, cfunc) __Pyx__IsSameCyOrCFunction(func, cfunc)
  1928. static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
  1929. int flags, PyObject* qualname,
  1930. PyObject *closure,
  1931. PyObject *module, PyObject *globals,
  1932. PyObject* code);
  1933. static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj);
  1934. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  1935. size_t size,
  1936. int pyobjects);
  1937. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  1938. PyObject *tuple);
  1939. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  1940. PyObject *dict);
  1941. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  1942. PyObject *dict);
  1943. static int __pyx_CyFunction_init(PyObject *module);
  1944. #if CYTHON_METH_FASTCALL
  1945. static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  1946. static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  1947. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  1948. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
  1949. #if CYTHON_BACKPORT_VECTORCALL
  1950. #define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
  1951. #else
  1952. #define __Pyx_CyFunction_func_vectorcall(f) (((PyCFunctionObject*)f)->vectorcall)
  1953. #endif
  1954. #endif
  1955. /* CythonFunction.proto */
  1956. static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
  1957. int flags, PyObject* qualname,
  1958. PyObject *closure,
  1959. PyObject *module, PyObject *globals,
  1960. PyObject* code);
  1961. /* SetNameInClass.proto */
  1962. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
  1963. #define __Pyx_SetNameInClass(ns, name, value)\
  1964. (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
  1965. #elif CYTHON_COMPILING_IN_CPYTHON
  1966. #define __Pyx_SetNameInClass(ns, name, value)\
  1967. (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
  1968. #else
  1969. #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
  1970. #endif
  1971. /* PyObjectCall2Args.proto */
  1972. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
  1973. /* PyObjectLookupSpecial.proto */
  1974. #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  1975. #define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
  1976. #define __Pyx_PyObject_LookupSpecial(obj, attr_name) __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
  1977. static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
  1978. #else
  1979. #define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
  1980. #define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
  1981. #endif
  1982. /* Py3ClassCreate.proto */
  1983. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  1984. PyObject *mkw, PyObject *modname, PyObject *doc);
  1985. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  1986. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
  1987. /* CLineInTraceback.proto */
  1988. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1989. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1990. #else
  1991. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1992. #endif
  1993. /* CodeObjectCache.proto */
  1994. #if !CYTHON_COMPILING_IN_LIMITED_API
  1995. typedef struct {
  1996. PyCodeObject* code_object;
  1997. int code_line;
  1998. } __Pyx_CodeObjectCacheEntry;
  1999. struct __Pyx_CodeObjectCache {
  2000. int count;
  2001. int max_count;
  2002. __Pyx_CodeObjectCacheEntry* entries;
  2003. };
  2004. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  2005. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  2006. static PyCodeObject *__pyx_find_code_object(int code_line);
  2007. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  2008. #endif
  2009. /* AddTraceback.proto */
  2010. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  2011. int py_line, const char *filename);
  2012. /* FormatTypeName.proto */
  2013. #if CYTHON_COMPILING_IN_LIMITED_API
  2014. typedef PyObject *__Pyx_TypeName;
  2015. #define __Pyx_FMT_TYPENAME "%U"
  2016. static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
  2017. #define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
  2018. #else
  2019. typedef const char *__Pyx_TypeName;
  2020. #define __Pyx_FMT_TYPENAME "%.200s"
  2021. #define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
  2022. #define __Pyx_DECREF_TypeName(obj)
  2023. #endif
  2024. /* GCCDiagnostics.proto */
  2025. #if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
  2026. #define __Pyx_HAS_GCC_DIAGNOSTIC
  2027. #endif
  2028. /* CIntToPy.proto */
  2029. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  2030. /* CIntFromPy.proto */
  2031. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  2032. /* CIntFromPy.proto */
  2033. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  2034. /* CheckBinaryVersion.proto */
  2035. static unsigned long __Pyx_get_runtime_version(void);
  2036. static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer);
  2037. /* InitStrings.proto */
  2038. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  2039. /* #### Code section: module_declarations ### */
  2040. /* Module declarations from "cython" */
  2041. /* Module declarations from "fontTools.pens.momentsPen" */
  2042. /* #### Code section: typeinfo ### */
  2043. /* #### Code section: before_global_var ### */
  2044. #define __Pyx_MODULE_NAME "fontTools.pens.momentsPen"
  2045. extern int __pyx_module_is_main_fontTools__pens__momentsPen;
  2046. int __pyx_module_is_main_fontTools__pens__momentsPen = 0;
  2047. /* Implementation of "fontTools.pens.momentsPen" */
  2048. /* #### Code section: global_var ### */
  2049. static PyObject *__pyx_builtin_AttributeError;
  2050. static PyObject *__pyx_builtin_ImportError;
  2051. /* #### Code section: string_decls ### */
  2052. static const char __pyx_k_[] = ".";
  2053. static const char __pyx_k_x[] = "x";
  2054. static const char __pyx_k_y[] = "y";
  2055. static const char __pyx_k_p0[] = "p0";
  2056. static const char __pyx_k_p1[] = "p1";
  2057. static const char __pyx_k_p2[] = "p2";
  2058. static const char __pyx_k_p3[] = "p3";
  2059. static const char __pyx_k_r0[] = "r0";
  2060. static const char __pyx_k_r1[] = "r1";
  2061. static const char __pyx_k_r2[] = "r2";
  2062. static const char __pyx_k_r3[] = "r3";
  2063. static const char __pyx_k_r4[] = "r4";
  2064. static const char __pyx_k_r5[] = "r5";
  2065. static const char __pyx_k_r6[] = "r6";
  2066. static const char __pyx_k_r7[] = "r7";
  2067. static const char __pyx_k_r8[] = "r8";
  2068. static const char __pyx_k_r9[] = "r9";
  2069. static const char __pyx_k_x0[] = "x0";
  2070. static const char __pyx_k_x1[] = "x1";
  2071. static const char __pyx_k_x2[] = "x2";
  2072. static const char __pyx_k_x3[] = "x3";
  2073. static const char __pyx_k_y0[] = "y0";
  2074. static const char __pyx_k_y1[] = "y1";
  2075. static const char __pyx_k_y2[] = "y2";
  2076. static const char __pyx_k_y3[] = "y3";
  2077. static const char __pyx_k__16[] = "?";
  2078. static const char __pyx_k_all[] = "__all__";
  2079. static const char __pyx_k_doc[] = "__doc__";
  2080. static const char __pyx_k_r10[] = "r10";
  2081. static const char __pyx_k_r11[] = "r11";
  2082. static const char __pyx_k_r12[] = "r12";
  2083. static const char __pyx_k_r13[] = "r13";
  2084. static const char __pyx_k_r14[] = "r14";
  2085. static const char __pyx_k_r15[] = "r15";
  2086. static const char __pyx_k_r16[] = "r16";
  2087. static const char __pyx_k_r17[] = "r17";
  2088. static const char __pyx_k_r18[] = "r18";
  2089. static const char __pyx_k_r19[] = "r19";
  2090. static const char __pyx_k_r20[] = "r20";
  2091. static const char __pyx_k_r21[] = "r21";
  2092. static const char __pyx_k_r22[] = "r22";
  2093. static const char __pyx_k_r23[] = "r23";
  2094. static const char __pyx_k_r24[] = "r24";
  2095. static const char __pyx_k_r25[] = "r25";
  2096. static const char __pyx_k_r26[] = "r26";
  2097. static const char __pyx_k_r27[] = "r27";
  2098. static const char __pyx_k_r28[] = "r28";
  2099. static const char __pyx_k_r29[] = "r29";
  2100. static const char __pyx_k_r30[] = "r30";
  2101. static const char __pyx_k_r31[] = "r31";
  2102. static const char __pyx_k_r32[] = "r32";
  2103. static const char __pyx_k_r33[] = "r33";
  2104. static const char __pyx_k_r34[] = "r34";
  2105. static const char __pyx_k_r35[] = "r35";
  2106. static const char __pyx_k_r36[] = "r36";
  2107. static const char __pyx_k_r37[] = "r37";
  2108. static const char __pyx_k_r38[] = "r38";
  2109. static const char __pyx_k_r39[] = "r39";
  2110. static const char __pyx_k_r40[] = "r40";
  2111. static const char __pyx_k_r41[] = "r41";
  2112. static const char __pyx_k_r42[] = "r42";
  2113. static const char __pyx_k_r43[] = "r43";
  2114. static const char __pyx_k_r44[] = "r44";
  2115. static const char __pyx_k_r45[] = "r45";
  2116. static const char __pyx_k_r46[] = "r46";
  2117. static const char __pyx_k_r47[] = "r47";
  2118. static const char __pyx_k_r48[] = "r48";
  2119. static const char __pyx_k_r49[] = "r49";
  2120. static const char __pyx_k_r50[] = "r50";
  2121. static const char __pyx_k_r51[] = "r51";
  2122. static const char __pyx_k_r52[] = "r52";
  2123. static const char __pyx_k_r53[] = "r53";
  2124. static const char __pyx_k_r54[] = "r54";
  2125. static const char __pyx_k_r55[] = "r55";
  2126. static const char __pyx_k_r56[] = "r56";
  2127. static const char __pyx_k_r57[] = "r57";
  2128. static const char __pyx_k_r58[] = "r58";
  2129. static const char __pyx_k_r59[] = "r59";
  2130. static const char __pyx_k_r60[] = "r60";
  2131. static const char __pyx_k_r61[] = "r61";
  2132. static const char __pyx_k_r62[] = "r62";
  2133. static const char __pyx_k_r63[] = "r63";
  2134. static const char __pyx_k_r64[] = "r64";
  2135. static const char __pyx_k_r65[] = "r65";
  2136. static const char __pyx_k_r66[] = "r66";
  2137. static const char __pyx_k_r67[] = "r67";
  2138. static const char __pyx_k_r68[] = "r68";
  2139. static const char __pyx_k_r69[] = "r69";
  2140. static const char __pyx_k_r70[] = "r70";
  2141. static const char __pyx_k_r71[] = "r71";
  2142. static const char __pyx_k_r72[] = "r72";
  2143. static const char __pyx_k_r73[] = "r73";
  2144. static const char __pyx_k_r74[] = "r74";
  2145. static const char __pyx_k_r75[] = "r75";
  2146. static const char __pyx_k_r76[] = "r76";
  2147. static const char __pyx_k_r77[] = "r77";
  2148. static const char __pyx_k_r78[] = "r78";
  2149. static const char __pyx_k_r79[] = "r79";
  2150. static const char __pyx_k_r80[] = "r80";
  2151. static const char __pyx_k_r81[] = "r81";
  2152. static const char __pyx_k_r82[] = "r82";
  2153. static const char __pyx_k_r83[] = "r83";
  2154. static const char __pyx_k_r84[] = "r84";
  2155. static const char __pyx_k_r85[] = "r85";
  2156. static const char __pyx_k_r86[] = "r86";
  2157. static const char __pyx_k_r87[] = "r87";
  2158. static const char __pyx_k_r88[] = "r88";
  2159. static const char __pyx_k_r89[] = "r89";
  2160. static const char __pyx_k_r90[] = "r90";
  2161. static const char __pyx_k_r91[] = "r91";
  2162. static const char __pyx_k_r92[] = "r92";
  2163. static const char __pyx_k_r93[] = "r93";
  2164. static const char __pyx_k_r94[] = "r94";
  2165. static const char __pyx_k_r95[] = "r95";
  2166. static const char __pyx_k_r96[] = "r96";
  2167. static const char __pyx_k_r97[] = "r97";
  2168. static const char __pyx_k_r98[] = "r98";
  2169. static const char __pyx_k_r99[] = "r99";
  2170. static const char __pyx_k_area[] = "area";
  2171. static const char __pyx_k_dict[] = "__dict__";
  2172. static const char __pyx_k_init[] = "__init__";
  2173. static const char __pyx_k_main[] = "__main__";
  2174. static const char __pyx_k_name[] = "__name__";
  2175. static const char __pyx_k_r100[] = "r100";
  2176. static const char __pyx_k_r101[] = "r101";
  2177. static const char __pyx_k_r102[] = "r102";
  2178. static const char __pyx_k_r103[] = "r103";
  2179. static const char __pyx_k_r104[] = "r104";
  2180. static const char __pyx_k_r105[] = "r105";
  2181. static const char __pyx_k_r106[] = "r106";
  2182. static const char __pyx_k_r107[] = "r107";
  2183. static const char __pyx_k_r108[] = "r108";
  2184. static const char __pyx_k_r109[] = "r109";
  2185. static const char __pyx_k_r110[] = "r110";
  2186. static const char __pyx_k_r111[] = "r111";
  2187. static const char __pyx_k_r112[] = "r112";
  2188. static const char __pyx_k_r113[] = "r113";
  2189. static const char __pyx_k_r114[] = "r114";
  2190. static const char __pyx_k_r115[] = "r115";
  2191. static const char __pyx_k_r116[] = "r116";
  2192. static const char __pyx_k_r117[] = "r117";
  2193. static const char __pyx_k_r118[] = "r118";
  2194. static const char __pyx_k_r119[] = "r119";
  2195. static const char __pyx_k_r120[] = "r120";
  2196. static const char __pyx_k_r121[] = "r121";
  2197. static const char __pyx_k_r122[] = "r122";
  2198. static const char __pyx_k_r123[] = "r123";
  2199. static const char __pyx_k_r124[] = "r124";
  2200. static const char __pyx_k_r125[] = "r125";
  2201. static const char __pyx_k_r126[] = "r126";
  2202. static const char __pyx_k_r127[] = "r127";
  2203. static const char __pyx_k_r128[] = "r128";
  2204. static const char __pyx_k_r129[] = "r129";
  2205. static const char __pyx_k_r130[] = "r130";
  2206. static const char __pyx_k_r131[] = "r131";
  2207. static const char __pyx_k_r132[] = "r132";
  2208. static const char __pyx_k_self[] = "self";
  2209. static const char __pyx_k_test[] = "__test__";
  2210. static const char __pyx_k_super[] = "super";
  2211. static const char __pyx_k_cython[] = "cython";
  2212. static const char __pyx_k_import[] = "__import__";
  2213. static const char __pyx_k_lineTo[] = "_lineTo";
  2214. static const char __pyx_k_module[] = "__module__";
  2215. static const char __pyx_k_moveTo[] = "_moveTo";
  2216. static const char __pyx_k_BasePen[] = "BasePen";
  2217. static const char __pyx_k_endPath[] = "_endPath";
  2218. static const char __pyx_k_momentX[] = "momentX";
  2219. static const char __pyx_k_momentY[] = "momentY";
  2220. static const char __pyx_k_prepare[] = "__prepare__";
  2221. static const char __pyx_k_COMPILED[] = "COMPILED";
  2222. static const char __pyx_k_glyphset[] = "glyphset";
  2223. static const char __pyx_k_momentXX[] = "momentXX";
  2224. static const char __pyx_k_momentXY[] = "momentXY";
  2225. static const char __pyx_k_momentYY[] = "momentYY";
  2226. static const char __pyx_k_qualname[] = "__qualname__";
  2227. static const char __pyx_k_set_name[] = "__set_name__";
  2228. static const char __pyx_k_closePath[] = "_closePath";
  2229. static const char __pyx_k_metaclass[] = "__metaclass__";
  2230. static const char __pyx_k_MomentsPen[] = "MomentsPen";
  2231. static const char __pyx_k_curveToOne[] = "_curveToOne";
  2232. static const char __pyx_k_ImportError[] = "ImportError";
  2233. static const char __pyx_k_mro_entries[] = "__mro_entries__";
  2234. static const char __pyx_k_qCurveToOne[] = "_qCurveToOne";
  2235. static const char __pyx_k_is_coroutine[] = "_is_coroutine";
  2236. static const char __pyx_k_init_subclass[] = "__init_subclass__";
  2237. static const char __pyx_k_printGreenPen[] = "printGreenPen";
  2238. static const char __pyx_k_AttributeError[] = "AttributeError";
  2239. static const char __pyx_k_fontTools_misc[] = "fontTools.misc";
  2240. static const char __pyx_k_getCurrentPoint[] = "_getCurrentPoint";
  2241. static const char __pyx_k_OpenContourError[] = "OpenContourError";
  2242. static const char __pyx_k_MomentsPen___init[] = "MomentsPen.__init__";
  2243. static const char __pyx_k_MomentsPen__lineTo[] = "MomentsPen._lineTo";
  2244. static const char __pyx_k_MomentsPen__moveTo[] = "MomentsPen._moveTo";
  2245. static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
  2246. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  2247. static const char __pyx_k_MomentsPen__endPath[] = "MomentsPen._endPath";
  2248. static const char __pyx_k_MomentsPen__closePath[] = "MomentsPen._closePath";
  2249. static const char __pyx_k_MomentsPen__curveToOne[] = "MomentsPen._curveToOne";
  2250. static const char __pyx_k_MomentsPen__startPoint[] = "_MomentsPen__startPoint";
  2251. static const char __pyx_k_fontTools_misc_symfont[] = "fontTools.misc.symfont";
  2252. static const char __pyx_k_fontTools_pens_basePen[] = "fontTools.pens.basePen";
  2253. static const char __pyx_k_MomentsPen__qCurveToOne[] = "MomentsPen._qCurveToOne";
  2254. static const char __pyx_k_fontTools_pens_momentsPen[] = "fontTools.pens.momentsPen";
  2255. static const char __pyx_k_Glyph_statistics_not_defined_on[] = "Glyph statistics not defined on open contours.";
  2256. static const char __pyx_k_Lib_fontTools_pens_momentsPen_py[] = "Lib/fontTools/pens/momentsPen.py";
  2257. /* #### Code section: decls ### */
  2258. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_glyphset); /* proto */
  2259. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p0); /* proto */
  2260. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
  2261. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
  2262. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1); /* proto */
  2263. 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 */
  2264. 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 */
  2265. /* #### Code section: late_includes ### */
  2266. /* #### Code section: module_state ### */
  2267. typedef struct {
  2268. PyObject *__pyx_d;
  2269. PyObject *__pyx_b;
  2270. PyObject *__pyx_cython_runtime;
  2271. PyObject *__pyx_empty_tuple;
  2272. PyObject *__pyx_empty_bytes;
  2273. PyObject *__pyx_empty_unicode;
  2274. #ifdef __Pyx_CyFunction_USED
  2275. PyTypeObject *__pyx_CyFunctionType;
  2276. #endif
  2277. #ifdef __Pyx_FusedFunction_USED
  2278. PyTypeObject *__pyx_FusedFunctionType;
  2279. #endif
  2280. #ifdef __Pyx_Generator_USED
  2281. PyTypeObject *__pyx_GeneratorType;
  2282. #endif
  2283. #ifdef __Pyx_IterableCoroutine_USED
  2284. PyTypeObject *__pyx_IterableCoroutineType;
  2285. #endif
  2286. #ifdef __Pyx_Coroutine_USED
  2287. PyTypeObject *__pyx_CoroutineAwaitType;
  2288. #endif
  2289. #ifdef __Pyx_Coroutine_USED
  2290. PyTypeObject *__pyx_CoroutineType;
  2291. #endif
  2292. #if CYTHON_USE_MODULE_STATE
  2293. #endif
  2294. #if CYTHON_USE_MODULE_STATE
  2295. #endif
  2296. PyObject *__pyx_kp_u_;
  2297. PyObject *__pyx_n_s_AttributeError;
  2298. PyObject *__pyx_n_s_BasePen;
  2299. PyObject *__pyx_n_s_COMPILED;
  2300. PyObject *__pyx_kp_u_Glyph_statistics_not_defined_on;
  2301. PyObject *__pyx_n_s_ImportError;
  2302. PyObject *__pyx_kp_s_Lib_fontTools_pens_momentsPen_py;
  2303. PyObject *__pyx_n_s_MomentsPen;
  2304. PyObject *__pyx_n_u_MomentsPen;
  2305. PyObject *__pyx_n_s_MomentsPen___init;
  2306. PyObject *__pyx_n_s_MomentsPen__closePath;
  2307. PyObject *__pyx_n_s_MomentsPen__curveToOne;
  2308. PyObject *__pyx_n_s_MomentsPen__endPath;
  2309. PyObject *__pyx_n_s_MomentsPen__lineTo;
  2310. PyObject *__pyx_n_s_MomentsPen__moveTo;
  2311. PyObject *__pyx_n_s_MomentsPen__qCurveToOne;
  2312. PyObject *__pyx_n_s_MomentsPen__startPoint;
  2313. PyObject *__pyx_n_s_OpenContourError;
  2314. PyObject *__pyx_n_s__16;
  2315. PyObject *__pyx_n_s_all;
  2316. PyObject *__pyx_n_s_area;
  2317. PyObject *__pyx_n_u_area;
  2318. PyObject *__pyx_n_s_asyncio_coroutines;
  2319. PyObject *__pyx_n_s_cline_in_traceback;
  2320. PyObject *__pyx_n_s_closePath;
  2321. PyObject *__pyx_n_s_curveToOne;
  2322. PyObject *__pyx_n_s_cython;
  2323. PyObject *__pyx_n_s_dict;
  2324. PyObject *__pyx_n_s_doc;
  2325. PyObject *__pyx_n_s_endPath;
  2326. PyObject *__pyx_n_s_fontTools_misc;
  2327. PyObject *__pyx_n_s_fontTools_misc_symfont;
  2328. PyObject *__pyx_n_s_fontTools_pens_basePen;
  2329. PyObject *__pyx_n_s_fontTools_pens_momentsPen;
  2330. PyObject *__pyx_n_s_getCurrentPoint;
  2331. PyObject *__pyx_n_s_glyphset;
  2332. PyObject *__pyx_n_s_import;
  2333. PyObject *__pyx_n_s_init;
  2334. PyObject *__pyx_n_s_init_subclass;
  2335. PyObject *__pyx_n_s_is_coroutine;
  2336. PyObject *__pyx_n_s_lineTo;
  2337. PyObject *__pyx_n_s_main;
  2338. PyObject *__pyx_n_u_main;
  2339. PyObject *__pyx_n_s_metaclass;
  2340. PyObject *__pyx_n_s_module;
  2341. PyObject *__pyx_n_s_momentX;
  2342. PyObject *__pyx_n_u_momentX;
  2343. PyObject *__pyx_n_s_momentXX;
  2344. PyObject *__pyx_n_u_momentXX;
  2345. PyObject *__pyx_n_s_momentXY;
  2346. PyObject *__pyx_n_u_momentXY;
  2347. PyObject *__pyx_n_s_momentY;
  2348. PyObject *__pyx_n_u_momentY;
  2349. PyObject *__pyx_n_s_momentYY;
  2350. PyObject *__pyx_n_u_momentYY;
  2351. PyObject *__pyx_n_s_moveTo;
  2352. PyObject *__pyx_n_s_mro_entries;
  2353. PyObject *__pyx_n_s_name;
  2354. PyObject *__pyx_n_s_p0;
  2355. PyObject *__pyx_n_s_p1;
  2356. PyObject *__pyx_n_s_p2;
  2357. PyObject *__pyx_n_s_p3;
  2358. PyObject *__pyx_n_s_prepare;
  2359. PyObject *__pyx_n_s_printGreenPen;
  2360. PyObject *__pyx_n_s_qCurveToOne;
  2361. PyObject *__pyx_n_s_qualname;
  2362. PyObject *__pyx_n_s_r0;
  2363. PyObject *__pyx_n_s_r1;
  2364. PyObject *__pyx_n_s_r10;
  2365. PyObject *__pyx_n_s_r100;
  2366. PyObject *__pyx_n_s_r101;
  2367. PyObject *__pyx_n_s_r102;
  2368. PyObject *__pyx_n_s_r103;
  2369. PyObject *__pyx_n_s_r104;
  2370. PyObject *__pyx_n_s_r105;
  2371. PyObject *__pyx_n_s_r106;
  2372. PyObject *__pyx_n_s_r107;
  2373. PyObject *__pyx_n_s_r108;
  2374. PyObject *__pyx_n_s_r109;
  2375. PyObject *__pyx_n_s_r11;
  2376. PyObject *__pyx_n_s_r110;
  2377. PyObject *__pyx_n_s_r111;
  2378. PyObject *__pyx_n_s_r112;
  2379. PyObject *__pyx_n_s_r113;
  2380. PyObject *__pyx_n_s_r114;
  2381. PyObject *__pyx_n_s_r115;
  2382. PyObject *__pyx_n_s_r116;
  2383. PyObject *__pyx_n_s_r117;
  2384. PyObject *__pyx_n_s_r118;
  2385. PyObject *__pyx_n_s_r119;
  2386. PyObject *__pyx_n_s_r12;
  2387. PyObject *__pyx_n_s_r120;
  2388. PyObject *__pyx_n_s_r121;
  2389. PyObject *__pyx_n_s_r122;
  2390. PyObject *__pyx_n_s_r123;
  2391. PyObject *__pyx_n_s_r124;
  2392. PyObject *__pyx_n_s_r125;
  2393. PyObject *__pyx_n_s_r126;
  2394. PyObject *__pyx_n_s_r127;
  2395. PyObject *__pyx_n_s_r128;
  2396. PyObject *__pyx_n_s_r129;
  2397. PyObject *__pyx_n_s_r13;
  2398. PyObject *__pyx_n_s_r130;
  2399. PyObject *__pyx_n_s_r131;
  2400. PyObject *__pyx_n_s_r132;
  2401. PyObject *__pyx_n_s_r14;
  2402. PyObject *__pyx_n_s_r15;
  2403. PyObject *__pyx_n_s_r16;
  2404. PyObject *__pyx_n_s_r17;
  2405. PyObject *__pyx_n_s_r18;
  2406. PyObject *__pyx_n_s_r19;
  2407. PyObject *__pyx_n_s_r2;
  2408. PyObject *__pyx_n_s_r20;
  2409. PyObject *__pyx_n_s_r21;
  2410. PyObject *__pyx_n_s_r22;
  2411. PyObject *__pyx_n_s_r23;
  2412. PyObject *__pyx_n_s_r24;
  2413. PyObject *__pyx_n_s_r25;
  2414. PyObject *__pyx_n_s_r26;
  2415. PyObject *__pyx_n_s_r27;
  2416. PyObject *__pyx_n_s_r28;
  2417. PyObject *__pyx_n_s_r29;
  2418. PyObject *__pyx_n_s_r3;
  2419. PyObject *__pyx_n_s_r30;
  2420. PyObject *__pyx_n_s_r31;
  2421. PyObject *__pyx_n_s_r32;
  2422. PyObject *__pyx_n_s_r33;
  2423. PyObject *__pyx_n_s_r34;
  2424. PyObject *__pyx_n_s_r35;
  2425. PyObject *__pyx_n_s_r36;
  2426. PyObject *__pyx_n_s_r37;
  2427. PyObject *__pyx_n_s_r38;
  2428. PyObject *__pyx_n_s_r39;
  2429. PyObject *__pyx_n_s_r4;
  2430. PyObject *__pyx_n_s_r40;
  2431. PyObject *__pyx_n_s_r41;
  2432. PyObject *__pyx_n_s_r42;
  2433. PyObject *__pyx_n_s_r43;
  2434. PyObject *__pyx_n_s_r44;
  2435. PyObject *__pyx_n_s_r45;
  2436. PyObject *__pyx_n_s_r46;
  2437. PyObject *__pyx_n_s_r47;
  2438. PyObject *__pyx_n_s_r48;
  2439. PyObject *__pyx_n_s_r49;
  2440. PyObject *__pyx_n_s_r5;
  2441. PyObject *__pyx_n_s_r50;
  2442. PyObject *__pyx_n_s_r51;
  2443. PyObject *__pyx_n_s_r52;
  2444. PyObject *__pyx_n_s_r53;
  2445. PyObject *__pyx_n_s_r54;
  2446. PyObject *__pyx_n_s_r55;
  2447. PyObject *__pyx_n_s_r56;
  2448. PyObject *__pyx_n_s_r57;
  2449. PyObject *__pyx_n_s_r58;
  2450. PyObject *__pyx_n_s_r59;
  2451. PyObject *__pyx_n_s_r6;
  2452. PyObject *__pyx_n_s_r60;
  2453. PyObject *__pyx_n_s_r61;
  2454. PyObject *__pyx_n_s_r62;
  2455. PyObject *__pyx_n_s_r63;
  2456. PyObject *__pyx_n_s_r64;
  2457. PyObject *__pyx_n_s_r65;
  2458. PyObject *__pyx_n_s_r66;
  2459. PyObject *__pyx_n_s_r67;
  2460. PyObject *__pyx_n_s_r68;
  2461. PyObject *__pyx_n_s_r69;
  2462. PyObject *__pyx_n_s_r7;
  2463. PyObject *__pyx_n_s_r70;
  2464. PyObject *__pyx_n_s_r71;
  2465. PyObject *__pyx_n_s_r72;
  2466. PyObject *__pyx_n_s_r73;
  2467. PyObject *__pyx_n_s_r74;
  2468. PyObject *__pyx_n_s_r75;
  2469. PyObject *__pyx_n_s_r76;
  2470. PyObject *__pyx_n_s_r77;
  2471. PyObject *__pyx_n_s_r78;
  2472. PyObject *__pyx_n_s_r79;
  2473. PyObject *__pyx_n_s_r8;
  2474. PyObject *__pyx_n_s_r80;
  2475. PyObject *__pyx_n_s_r81;
  2476. PyObject *__pyx_n_s_r82;
  2477. PyObject *__pyx_n_s_r83;
  2478. PyObject *__pyx_n_s_r84;
  2479. PyObject *__pyx_n_s_r85;
  2480. PyObject *__pyx_n_s_r86;
  2481. PyObject *__pyx_n_s_r87;
  2482. PyObject *__pyx_n_s_r88;
  2483. PyObject *__pyx_n_s_r89;
  2484. PyObject *__pyx_n_s_r9;
  2485. PyObject *__pyx_n_s_r90;
  2486. PyObject *__pyx_n_s_r91;
  2487. PyObject *__pyx_n_s_r92;
  2488. PyObject *__pyx_n_s_r93;
  2489. PyObject *__pyx_n_s_r94;
  2490. PyObject *__pyx_n_s_r95;
  2491. PyObject *__pyx_n_s_r96;
  2492. PyObject *__pyx_n_s_r97;
  2493. PyObject *__pyx_n_s_r98;
  2494. PyObject *__pyx_n_s_r99;
  2495. PyObject *__pyx_n_s_self;
  2496. PyObject *__pyx_n_s_set_name;
  2497. PyObject *__pyx_n_s_super;
  2498. PyObject *__pyx_n_s_test;
  2499. PyObject *__pyx_n_s_x;
  2500. PyObject *__pyx_n_s_x0;
  2501. PyObject *__pyx_n_s_x1;
  2502. PyObject *__pyx_n_s_x2;
  2503. PyObject *__pyx_n_s_x3;
  2504. PyObject *__pyx_n_s_y;
  2505. PyObject *__pyx_n_s_y0;
  2506. PyObject *__pyx_n_s_y1;
  2507. PyObject *__pyx_n_s_y2;
  2508. PyObject *__pyx_n_s_y3;
  2509. PyObject *__pyx_int_0;
  2510. PyObject *__pyx_int_1;
  2511. PyObject *__pyx_int_2;
  2512. PyObject *__pyx_tuple__2;
  2513. PyObject *__pyx_tuple__4;
  2514. PyObject *__pyx_tuple__5;
  2515. PyObject *__pyx_tuple__9;
  2516. PyObject *__pyx_tuple__11;
  2517. PyObject *__pyx_tuple__13;
  2518. PyObject *__pyx_tuple__15;
  2519. PyObject *__pyx_codeobj__3;
  2520. PyObject *__pyx_codeobj__6;
  2521. PyObject *__pyx_codeobj__7;
  2522. PyObject *__pyx_codeobj__8;
  2523. PyObject *__pyx_codeobj__10;
  2524. PyObject *__pyx_codeobj__12;
  2525. PyObject *__pyx_codeobj__14;
  2526. } __pyx_mstate;
  2527. #if CYTHON_USE_MODULE_STATE
  2528. #ifdef __cplusplus
  2529. namespace {
  2530. extern struct PyModuleDef __pyx_moduledef;
  2531. } /* anonymous namespace */
  2532. #else
  2533. static struct PyModuleDef __pyx_moduledef;
  2534. #endif
  2535. #define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))
  2536. #define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))
  2537. #define __pyx_m (PyState_FindModule(&__pyx_moduledef))
  2538. #else
  2539. static __pyx_mstate __pyx_mstate_global_static =
  2540. #ifdef __cplusplus
  2541. {};
  2542. #else
  2543. {0};
  2544. #endif
  2545. static __pyx_mstate *__pyx_mstate_global = &__pyx_mstate_global_static;
  2546. #endif
  2547. /* #### Code section: module_state_clear ### */
  2548. #if CYTHON_USE_MODULE_STATE
  2549. static int __pyx_m_clear(PyObject *m) {
  2550. __pyx_mstate *clear_module_state = __pyx_mstate(m);
  2551. if (!clear_module_state) return 0;
  2552. Py_CLEAR(clear_module_state->__pyx_d);
  2553. Py_CLEAR(clear_module_state->__pyx_b);
  2554. Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  2555. Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  2556. Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  2557. Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  2558. #ifdef __Pyx_CyFunction_USED
  2559. Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  2560. #endif
  2561. #ifdef __Pyx_FusedFunction_USED
  2562. Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  2563. #endif
  2564. Py_CLEAR(clear_module_state->__pyx_kp_u_);
  2565. Py_CLEAR(clear_module_state->__pyx_n_s_AttributeError);
  2566. Py_CLEAR(clear_module_state->__pyx_n_s_BasePen);
  2567. Py_CLEAR(clear_module_state->__pyx_n_s_COMPILED);
  2568. Py_CLEAR(clear_module_state->__pyx_kp_u_Glyph_statistics_not_defined_on);
  2569. Py_CLEAR(clear_module_state->__pyx_n_s_ImportError);
  2570. Py_CLEAR(clear_module_state->__pyx_kp_s_Lib_fontTools_pens_momentsPen_py);
  2571. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen);
  2572. Py_CLEAR(clear_module_state->__pyx_n_u_MomentsPen);
  2573. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen___init);
  2574. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__closePath);
  2575. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__curveToOne);
  2576. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__endPath);
  2577. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__lineTo);
  2578. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__moveTo);
  2579. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__qCurveToOne);
  2580. Py_CLEAR(clear_module_state->__pyx_n_s_MomentsPen__startPoint);
  2581. Py_CLEAR(clear_module_state->__pyx_n_s_OpenContourError);
  2582. Py_CLEAR(clear_module_state->__pyx_n_s__16);
  2583. Py_CLEAR(clear_module_state->__pyx_n_s_all);
  2584. Py_CLEAR(clear_module_state->__pyx_n_s_area);
  2585. Py_CLEAR(clear_module_state->__pyx_n_u_area);
  2586. Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  2587. Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  2588. Py_CLEAR(clear_module_state->__pyx_n_s_closePath);
  2589. Py_CLEAR(clear_module_state->__pyx_n_s_curveToOne);
  2590. Py_CLEAR(clear_module_state->__pyx_n_s_cython);
  2591. Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  2592. Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  2593. Py_CLEAR(clear_module_state->__pyx_n_s_endPath);
  2594. Py_CLEAR(clear_module_state->__pyx_n_s_fontTools_misc);
  2595. Py_CLEAR(clear_module_state->__pyx_n_s_fontTools_misc_symfont);
  2596. Py_CLEAR(clear_module_state->__pyx_n_s_fontTools_pens_basePen);
  2597. Py_CLEAR(clear_module_state->__pyx_n_s_fontTools_pens_momentsPen);
  2598. Py_CLEAR(clear_module_state->__pyx_n_s_getCurrentPoint);
  2599. Py_CLEAR(clear_module_state->__pyx_n_s_glyphset);
  2600. Py_CLEAR(clear_module_state->__pyx_n_s_import);
  2601. Py_CLEAR(clear_module_state->__pyx_n_s_init);
  2602. Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  2603. Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  2604. Py_CLEAR(clear_module_state->__pyx_n_s_lineTo);
  2605. Py_CLEAR(clear_module_state->__pyx_n_s_main);
  2606. Py_CLEAR(clear_module_state->__pyx_n_u_main);
  2607. Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  2608. Py_CLEAR(clear_module_state->__pyx_n_s_module);
  2609. Py_CLEAR(clear_module_state->__pyx_n_s_momentX);
  2610. Py_CLEAR(clear_module_state->__pyx_n_u_momentX);
  2611. Py_CLEAR(clear_module_state->__pyx_n_s_momentXX);
  2612. Py_CLEAR(clear_module_state->__pyx_n_u_momentXX);
  2613. Py_CLEAR(clear_module_state->__pyx_n_s_momentXY);
  2614. Py_CLEAR(clear_module_state->__pyx_n_u_momentXY);
  2615. Py_CLEAR(clear_module_state->__pyx_n_s_momentY);
  2616. Py_CLEAR(clear_module_state->__pyx_n_u_momentY);
  2617. Py_CLEAR(clear_module_state->__pyx_n_s_momentYY);
  2618. Py_CLEAR(clear_module_state->__pyx_n_u_momentYY);
  2619. Py_CLEAR(clear_module_state->__pyx_n_s_moveTo);
  2620. Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  2621. Py_CLEAR(clear_module_state->__pyx_n_s_name);
  2622. Py_CLEAR(clear_module_state->__pyx_n_s_p0);
  2623. Py_CLEAR(clear_module_state->__pyx_n_s_p1);
  2624. Py_CLEAR(clear_module_state->__pyx_n_s_p2);
  2625. Py_CLEAR(clear_module_state->__pyx_n_s_p3);
  2626. Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  2627. Py_CLEAR(clear_module_state->__pyx_n_s_printGreenPen);
  2628. Py_CLEAR(clear_module_state->__pyx_n_s_qCurveToOne);
  2629. Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  2630. Py_CLEAR(clear_module_state->__pyx_n_s_r0);
  2631. Py_CLEAR(clear_module_state->__pyx_n_s_r1);
  2632. Py_CLEAR(clear_module_state->__pyx_n_s_r10);
  2633. Py_CLEAR(clear_module_state->__pyx_n_s_r100);
  2634. Py_CLEAR(clear_module_state->__pyx_n_s_r101);
  2635. Py_CLEAR(clear_module_state->__pyx_n_s_r102);
  2636. Py_CLEAR(clear_module_state->__pyx_n_s_r103);
  2637. Py_CLEAR(clear_module_state->__pyx_n_s_r104);
  2638. Py_CLEAR(clear_module_state->__pyx_n_s_r105);
  2639. Py_CLEAR(clear_module_state->__pyx_n_s_r106);
  2640. Py_CLEAR(clear_module_state->__pyx_n_s_r107);
  2641. Py_CLEAR(clear_module_state->__pyx_n_s_r108);
  2642. Py_CLEAR(clear_module_state->__pyx_n_s_r109);
  2643. Py_CLEAR(clear_module_state->__pyx_n_s_r11);
  2644. Py_CLEAR(clear_module_state->__pyx_n_s_r110);
  2645. Py_CLEAR(clear_module_state->__pyx_n_s_r111);
  2646. Py_CLEAR(clear_module_state->__pyx_n_s_r112);
  2647. Py_CLEAR(clear_module_state->__pyx_n_s_r113);
  2648. Py_CLEAR(clear_module_state->__pyx_n_s_r114);
  2649. Py_CLEAR(clear_module_state->__pyx_n_s_r115);
  2650. Py_CLEAR(clear_module_state->__pyx_n_s_r116);
  2651. Py_CLEAR(clear_module_state->__pyx_n_s_r117);
  2652. Py_CLEAR(clear_module_state->__pyx_n_s_r118);
  2653. Py_CLEAR(clear_module_state->__pyx_n_s_r119);
  2654. Py_CLEAR(clear_module_state->__pyx_n_s_r12);
  2655. Py_CLEAR(clear_module_state->__pyx_n_s_r120);
  2656. Py_CLEAR(clear_module_state->__pyx_n_s_r121);
  2657. Py_CLEAR(clear_module_state->__pyx_n_s_r122);
  2658. Py_CLEAR(clear_module_state->__pyx_n_s_r123);
  2659. Py_CLEAR(clear_module_state->__pyx_n_s_r124);
  2660. Py_CLEAR(clear_module_state->__pyx_n_s_r125);
  2661. Py_CLEAR(clear_module_state->__pyx_n_s_r126);
  2662. Py_CLEAR(clear_module_state->__pyx_n_s_r127);
  2663. Py_CLEAR(clear_module_state->__pyx_n_s_r128);
  2664. Py_CLEAR(clear_module_state->__pyx_n_s_r129);
  2665. Py_CLEAR(clear_module_state->__pyx_n_s_r13);
  2666. Py_CLEAR(clear_module_state->__pyx_n_s_r130);
  2667. Py_CLEAR(clear_module_state->__pyx_n_s_r131);
  2668. Py_CLEAR(clear_module_state->__pyx_n_s_r132);
  2669. Py_CLEAR(clear_module_state->__pyx_n_s_r14);
  2670. Py_CLEAR(clear_module_state->__pyx_n_s_r15);
  2671. Py_CLEAR(clear_module_state->__pyx_n_s_r16);
  2672. Py_CLEAR(clear_module_state->__pyx_n_s_r17);
  2673. Py_CLEAR(clear_module_state->__pyx_n_s_r18);
  2674. Py_CLEAR(clear_module_state->__pyx_n_s_r19);
  2675. Py_CLEAR(clear_module_state->__pyx_n_s_r2);
  2676. Py_CLEAR(clear_module_state->__pyx_n_s_r20);
  2677. Py_CLEAR(clear_module_state->__pyx_n_s_r21);
  2678. Py_CLEAR(clear_module_state->__pyx_n_s_r22);
  2679. Py_CLEAR(clear_module_state->__pyx_n_s_r23);
  2680. Py_CLEAR(clear_module_state->__pyx_n_s_r24);
  2681. Py_CLEAR(clear_module_state->__pyx_n_s_r25);
  2682. Py_CLEAR(clear_module_state->__pyx_n_s_r26);
  2683. Py_CLEAR(clear_module_state->__pyx_n_s_r27);
  2684. Py_CLEAR(clear_module_state->__pyx_n_s_r28);
  2685. Py_CLEAR(clear_module_state->__pyx_n_s_r29);
  2686. Py_CLEAR(clear_module_state->__pyx_n_s_r3);
  2687. Py_CLEAR(clear_module_state->__pyx_n_s_r30);
  2688. Py_CLEAR(clear_module_state->__pyx_n_s_r31);
  2689. Py_CLEAR(clear_module_state->__pyx_n_s_r32);
  2690. Py_CLEAR(clear_module_state->__pyx_n_s_r33);
  2691. Py_CLEAR(clear_module_state->__pyx_n_s_r34);
  2692. Py_CLEAR(clear_module_state->__pyx_n_s_r35);
  2693. Py_CLEAR(clear_module_state->__pyx_n_s_r36);
  2694. Py_CLEAR(clear_module_state->__pyx_n_s_r37);
  2695. Py_CLEAR(clear_module_state->__pyx_n_s_r38);
  2696. Py_CLEAR(clear_module_state->__pyx_n_s_r39);
  2697. Py_CLEAR(clear_module_state->__pyx_n_s_r4);
  2698. Py_CLEAR(clear_module_state->__pyx_n_s_r40);
  2699. Py_CLEAR(clear_module_state->__pyx_n_s_r41);
  2700. Py_CLEAR(clear_module_state->__pyx_n_s_r42);
  2701. Py_CLEAR(clear_module_state->__pyx_n_s_r43);
  2702. Py_CLEAR(clear_module_state->__pyx_n_s_r44);
  2703. Py_CLEAR(clear_module_state->__pyx_n_s_r45);
  2704. Py_CLEAR(clear_module_state->__pyx_n_s_r46);
  2705. Py_CLEAR(clear_module_state->__pyx_n_s_r47);
  2706. Py_CLEAR(clear_module_state->__pyx_n_s_r48);
  2707. Py_CLEAR(clear_module_state->__pyx_n_s_r49);
  2708. Py_CLEAR(clear_module_state->__pyx_n_s_r5);
  2709. Py_CLEAR(clear_module_state->__pyx_n_s_r50);
  2710. Py_CLEAR(clear_module_state->__pyx_n_s_r51);
  2711. Py_CLEAR(clear_module_state->__pyx_n_s_r52);
  2712. Py_CLEAR(clear_module_state->__pyx_n_s_r53);
  2713. Py_CLEAR(clear_module_state->__pyx_n_s_r54);
  2714. Py_CLEAR(clear_module_state->__pyx_n_s_r55);
  2715. Py_CLEAR(clear_module_state->__pyx_n_s_r56);
  2716. Py_CLEAR(clear_module_state->__pyx_n_s_r57);
  2717. Py_CLEAR(clear_module_state->__pyx_n_s_r58);
  2718. Py_CLEAR(clear_module_state->__pyx_n_s_r59);
  2719. Py_CLEAR(clear_module_state->__pyx_n_s_r6);
  2720. Py_CLEAR(clear_module_state->__pyx_n_s_r60);
  2721. Py_CLEAR(clear_module_state->__pyx_n_s_r61);
  2722. Py_CLEAR(clear_module_state->__pyx_n_s_r62);
  2723. Py_CLEAR(clear_module_state->__pyx_n_s_r63);
  2724. Py_CLEAR(clear_module_state->__pyx_n_s_r64);
  2725. Py_CLEAR(clear_module_state->__pyx_n_s_r65);
  2726. Py_CLEAR(clear_module_state->__pyx_n_s_r66);
  2727. Py_CLEAR(clear_module_state->__pyx_n_s_r67);
  2728. Py_CLEAR(clear_module_state->__pyx_n_s_r68);
  2729. Py_CLEAR(clear_module_state->__pyx_n_s_r69);
  2730. Py_CLEAR(clear_module_state->__pyx_n_s_r7);
  2731. Py_CLEAR(clear_module_state->__pyx_n_s_r70);
  2732. Py_CLEAR(clear_module_state->__pyx_n_s_r71);
  2733. Py_CLEAR(clear_module_state->__pyx_n_s_r72);
  2734. Py_CLEAR(clear_module_state->__pyx_n_s_r73);
  2735. Py_CLEAR(clear_module_state->__pyx_n_s_r74);
  2736. Py_CLEAR(clear_module_state->__pyx_n_s_r75);
  2737. Py_CLEAR(clear_module_state->__pyx_n_s_r76);
  2738. Py_CLEAR(clear_module_state->__pyx_n_s_r77);
  2739. Py_CLEAR(clear_module_state->__pyx_n_s_r78);
  2740. Py_CLEAR(clear_module_state->__pyx_n_s_r79);
  2741. Py_CLEAR(clear_module_state->__pyx_n_s_r8);
  2742. Py_CLEAR(clear_module_state->__pyx_n_s_r80);
  2743. Py_CLEAR(clear_module_state->__pyx_n_s_r81);
  2744. Py_CLEAR(clear_module_state->__pyx_n_s_r82);
  2745. Py_CLEAR(clear_module_state->__pyx_n_s_r83);
  2746. Py_CLEAR(clear_module_state->__pyx_n_s_r84);
  2747. Py_CLEAR(clear_module_state->__pyx_n_s_r85);
  2748. Py_CLEAR(clear_module_state->__pyx_n_s_r86);
  2749. Py_CLEAR(clear_module_state->__pyx_n_s_r87);
  2750. Py_CLEAR(clear_module_state->__pyx_n_s_r88);
  2751. Py_CLEAR(clear_module_state->__pyx_n_s_r89);
  2752. Py_CLEAR(clear_module_state->__pyx_n_s_r9);
  2753. Py_CLEAR(clear_module_state->__pyx_n_s_r90);
  2754. Py_CLEAR(clear_module_state->__pyx_n_s_r91);
  2755. Py_CLEAR(clear_module_state->__pyx_n_s_r92);
  2756. Py_CLEAR(clear_module_state->__pyx_n_s_r93);
  2757. Py_CLEAR(clear_module_state->__pyx_n_s_r94);
  2758. Py_CLEAR(clear_module_state->__pyx_n_s_r95);
  2759. Py_CLEAR(clear_module_state->__pyx_n_s_r96);
  2760. Py_CLEAR(clear_module_state->__pyx_n_s_r97);
  2761. Py_CLEAR(clear_module_state->__pyx_n_s_r98);
  2762. Py_CLEAR(clear_module_state->__pyx_n_s_r99);
  2763. Py_CLEAR(clear_module_state->__pyx_n_s_self);
  2764. Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  2765. Py_CLEAR(clear_module_state->__pyx_n_s_super);
  2766. Py_CLEAR(clear_module_state->__pyx_n_s_test);
  2767. Py_CLEAR(clear_module_state->__pyx_n_s_x);
  2768. Py_CLEAR(clear_module_state->__pyx_n_s_x0);
  2769. Py_CLEAR(clear_module_state->__pyx_n_s_x1);
  2770. Py_CLEAR(clear_module_state->__pyx_n_s_x2);
  2771. Py_CLEAR(clear_module_state->__pyx_n_s_x3);
  2772. Py_CLEAR(clear_module_state->__pyx_n_s_y);
  2773. Py_CLEAR(clear_module_state->__pyx_n_s_y0);
  2774. Py_CLEAR(clear_module_state->__pyx_n_s_y1);
  2775. Py_CLEAR(clear_module_state->__pyx_n_s_y2);
  2776. Py_CLEAR(clear_module_state->__pyx_n_s_y3);
  2777. Py_CLEAR(clear_module_state->__pyx_int_0);
  2778. Py_CLEAR(clear_module_state->__pyx_int_1);
  2779. Py_CLEAR(clear_module_state->__pyx_int_2);
  2780. Py_CLEAR(clear_module_state->__pyx_tuple__2);
  2781. Py_CLEAR(clear_module_state->__pyx_tuple__4);
  2782. Py_CLEAR(clear_module_state->__pyx_tuple__5);
  2783. Py_CLEAR(clear_module_state->__pyx_tuple__9);
  2784. Py_CLEAR(clear_module_state->__pyx_tuple__11);
  2785. Py_CLEAR(clear_module_state->__pyx_tuple__13);
  2786. Py_CLEAR(clear_module_state->__pyx_tuple__15);
  2787. Py_CLEAR(clear_module_state->__pyx_codeobj__3);
  2788. Py_CLEAR(clear_module_state->__pyx_codeobj__6);
  2789. Py_CLEAR(clear_module_state->__pyx_codeobj__7);
  2790. Py_CLEAR(clear_module_state->__pyx_codeobj__8);
  2791. Py_CLEAR(clear_module_state->__pyx_codeobj__10);
  2792. Py_CLEAR(clear_module_state->__pyx_codeobj__12);
  2793. Py_CLEAR(clear_module_state->__pyx_codeobj__14);
  2794. return 0;
  2795. }
  2796. #endif
  2797. /* #### Code section: module_state_traverse ### */
  2798. #if CYTHON_USE_MODULE_STATE
  2799. static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  2800. __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  2801. if (!traverse_module_state) return 0;
  2802. Py_VISIT(traverse_module_state->__pyx_d);
  2803. Py_VISIT(traverse_module_state->__pyx_b);
  2804. Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  2805. Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  2806. Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  2807. Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  2808. #ifdef __Pyx_CyFunction_USED
  2809. Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  2810. #endif
  2811. #ifdef __Pyx_FusedFunction_USED
  2812. Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  2813. #endif
  2814. Py_VISIT(traverse_module_state->__pyx_kp_u_);
  2815. Py_VISIT(traverse_module_state->__pyx_n_s_AttributeError);
  2816. Py_VISIT(traverse_module_state->__pyx_n_s_BasePen);
  2817. Py_VISIT(traverse_module_state->__pyx_n_s_COMPILED);
  2818. Py_VISIT(traverse_module_state->__pyx_kp_u_Glyph_statistics_not_defined_on);
  2819. Py_VISIT(traverse_module_state->__pyx_n_s_ImportError);
  2820. Py_VISIT(traverse_module_state->__pyx_kp_s_Lib_fontTools_pens_momentsPen_py);
  2821. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen);
  2822. Py_VISIT(traverse_module_state->__pyx_n_u_MomentsPen);
  2823. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen___init);
  2824. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__closePath);
  2825. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__curveToOne);
  2826. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__endPath);
  2827. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__lineTo);
  2828. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__moveTo);
  2829. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__qCurveToOne);
  2830. Py_VISIT(traverse_module_state->__pyx_n_s_MomentsPen__startPoint);
  2831. Py_VISIT(traverse_module_state->__pyx_n_s_OpenContourError);
  2832. Py_VISIT(traverse_module_state->__pyx_n_s__16);
  2833. Py_VISIT(traverse_module_state->__pyx_n_s_all);
  2834. Py_VISIT(traverse_module_state->__pyx_n_s_area);
  2835. Py_VISIT(traverse_module_state->__pyx_n_u_area);
  2836. Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  2837. Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  2838. Py_VISIT(traverse_module_state->__pyx_n_s_closePath);
  2839. Py_VISIT(traverse_module_state->__pyx_n_s_curveToOne);
  2840. Py_VISIT(traverse_module_state->__pyx_n_s_cython);
  2841. Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  2842. Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  2843. Py_VISIT(traverse_module_state->__pyx_n_s_endPath);
  2844. Py_VISIT(traverse_module_state->__pyx_n_s_fontTools_misc);
  2845. Py_VISIT(traverse_module_state->__pyx_n_s_fontTools_misc_symfont);
  2846. Py_VISIT(traverse_module_state->__pyx_n_s_fontTools_pens_basePen);
  2847. Py_VISIT(traverse_module_state->__pyx_n_s_fontTools_pens_momentsPen);
  2848. Py_VISIT(traverse_module_state->__pyx_n_s_getCurrentPoint);
  2849. Py_VISIT(traverse_module_state->__pyx_n_s_glyphset);
  2850. Py_VISIT(traverse_module_state->__pyx_n_s_import);
  2851. Py_VISIT(traverse_module_state->__pyx_n_s_init);
  2852. Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  2853. Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  2854. Py_VISIT(traverse_module_state->__pyx_n_s_lineTo);
  2855. Py_VISIT(traverse_module_state->__pyx_n_s_main);
  2856. Py_VISIT(traverse_module_state->__pyx_n_u_main);
  2857. Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  2858. Py_VISIT(traverse_module_state->__pyx_n_s_module);
  2859. Py_VISIT(traverse_module_state->__pyx_n_s_momentX);
  2860. Py_VISIT(traverse_module_state->__pyx_n_u_momentX);
  2861. Py_VISIT(traverse_module_state->__pyx_n_s_momentXX);
  2862. Py_VISIT(traverse_module_state->__pyx_n_u_momentXX);
  2863. Py_VISIT(traverse_module_state->__pyx_n_s_momentXY);
  2864. Py_VISIT(traverse_module_state->__pyx_n_u_momentXY);
  2865. Py_VISIT(traverse_module_state->__pyx_n_s_momentY);
  2866. Py_VISIT(traverse_module_state->__pyx_n_u_momentY);
  2867. Py_VISIT(traverse_module_state->__pyx_n_s_momentYY);
  2868. Py_VISIT(traverse_module_state->__pyx_n_u_momentYY);
  2869. Py_VISIT(traverse_module_state->__pyx_n_s_moveTo);
  2870. Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  2871. Py_VISIT(traverse_module_state->__pyx_n_s_name);
  2872. Py_VISIT(traverse_module_state->__pyx_n_s_p0);
  2873. Py_VISIT(traverse_module_state->__pyx_n_s_p1);
  2874. Py_VISIT(traverse_module_state->__pyx_n_s_p2);
  2875. Py_VISIT(traverse_module_state->__pyx_n_s_p3);
  2876. Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  2877. Py_VISIT(traverse_module_state->__pyx_n_s_printGreenPen);
  2878. Py_VISIT(traverse_module_state->__pyx_n_s_qCurveToOne);
  2879. Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  2880. Py_VISIT(traverse_module_state->__pyx_n_s_r0);
  2881. Py_VISIT(traverse_module_state->__pyx_n_s_r1);
  2882. Py_VISIT(traverse_module_state->__pyx_n_s_r10);
  2883. Py_VISIT(traverse_module_state->__pyx_n_s_r100);
  2884. Py_VISIT(traverse_module_state->__pyx_n_s_r101);
  2885. Py_VISIT(traverse_module_state->__pyx_n_s_r102);
  2886. Py_VISIT(traverse_module_state->__pyx_n_s_r103);
  2887. Py_VISIT(traverse_module_state->__pyx_n_s_r104);
  2888. Py_VISIT(traverse_module_state->__pyx_n_s_r105);
  2889. Py_VISIT(traverse_module_state->__pyx_n_s_r106);
  2890. Py_VISIT(traverse_module_state->__pyx_n_s_r107);
  2891. Py_VISIT(traverse_module_state->__pyx_n_s_r108);
  2892. Py_VISIT(traverse_module_state->__pyx_n_s_r109);
  2893. Py_VISIT(traverse_module_state->__pyx_n_s_r11);
  2894. Py_VISIT(traverse_module_state->__pyx_n_s_r110);
  2895. Py_VISIT(traverse_module_state->__pyx_n_s_r111);
  2896. Py_VISIT(traverse_module_state->__pyx_n_s_r112);
  2897. Py_VISIT(traverse_module_state->__pyx_n_s_r113);
  2898. Py_VISIT(traverse_module_state->__pyx_n_s_r114);
  2899. Py_VISIT(traverse_module_state->__pyx_n_s_r115);
  2900. Py_VISIT(traverse_module_state->__pyx_n_s_r116);
  2901. Py_VISIT(traverse_module_state->__pyx_n_s_r117);
  2902. Py_VISIT(traverse_module_state->__pyx_n_s_r118);
  2903. Py_VISIT(traverse_module_state->__pyx_n_s_r119);
  2904. Py_VISIT(traverse_module_state->__pyx_n_s_r12);
  2905. Py_VISIT(traverse_module_state->__pyx_n_s_r120);
  2906. Py_VISIT(traverse_module_state->__pyx_n_s_r121);
  2907. Py_VISIT(traverse_module_state->__pyx_n_s_r122);
  2908. Py_VISIT(traverse_module_state->__pyx_n_s_r123);
  2909. Py_VISIT(traverse_module_state->__pyx_n_s_r124);
  2910. Py_VISIT(traverse_module_state->__pyx_n_s_r125);
  2911. Py_VISIT(traverse_module_state->__pyx_n_s_r126);
  2912. Py_VISIT(traverse_module_state->__pyx_n_s_r127);
  2913. Py_VISIT(traverse_module_state->__pyx_n_s_r128);
  2914. Py_VISIT(traverse_module_state->__pyx_n_s_r129);
  2915. Py_VISIT(traverse_module_state->__pyx_n_s_r13);
  2916. Py_VISIT(traverse_module_state->__pyx_n_s_r130);
  2917. Py_VISIT(traverse_module_state->__pyx_n_s_r131);
  2918. Py_VISIT(traverse_module_state->__pyx_n_s_r132);
  2919. Py_VISIT(traverse_module_state->__pyx_n_s_r14);
  2920. Py_VISIT(traverse_module_state->__pyx_n_s_r15);
  2921. Py_VISIT(traverse_module_state->__pyx_n_s_r16);
  2922. Py_VISIT(traverse_module_state->__pyx_n_s_r17);
  2923. Py_VISIT(traverse_module_state->__pyx_n_s_r18);
  2924. Py_VISIT(traverse_module_state->__pyx_n_s_r19);
  2925. Py_VISIT(traverse_module_state->__pyx_n_s_r2);
  2926. Py_VISIT(traverse_module_state->__pyx_n_s_r20);
  2927. Py_VISIT(traverse_module_state->__pyx_n_s_r21);
  2928. Py_VISIT(traverse_module_state->__pyx_n_s_r22);
  2929. Py_VISIT(traverse_module_state->__pyx_n_s_r23);
  2930. Py_VISIT(traverse_module_state->__pyx_n_s_r24);
  2931. Py_VISIT(traverse_module_state->__pyx_n_s_r25);
  2932. Py_VISIT(traverse_module_state->__pyx_n_s_r26);
  2933. Py_VISIT(traverse_module_state->__pyx_n_s_r27);
  2934. Py_VISIT(traverse_module_state->__pyx_n_s_r28);
  2935. Py_VISIT(traverse_module_state->__pyx_n_s_r29);
  2936. Py_VISIT(traverse_module_state->__pyx_n_s_r3);
  2937. Py_VISIT(traverse_module_state->__pyx_n_s_r30);
  2938. Py_VISIT(traverse_module_state->__pyx_n_s_r31);
  2939. Py_VISIT(traverse_module_state->__pyx_n_s_r32);
  2940. Py_VISIT(traverse_module_state->__pyx_n_s_r33);
  2941. Py_VISIT(traverse_module_state->__pyx_n_s_r34);
  2942. Py_VISIT(traverse_module_state->__pyx_n_s_r35);
  2943. Py_VISIT(traverse_module_state->__pyx_n_s_r36);
  2944. Py_VISIT(traverse_module_state->__pyx_n_s_r37);
  2945. Py_VISIT(traverse_module_state->__pyx_n_s_r38);
  2946. Py_VISIT(traverse_module_state->__pyx_n_s_r39);
  2947. Py_VISIT(traverse_module_state->__pyx_n_s_r4);
  2948. Py_VISIT(traverse_module_state->__pyx_n_s_r40);
  2949. Py_VISIT(traverse_module_state->__pyx_n_s_r41);
  2950. Py_VISIT(traverse_module_state->__pyx_n_s_r42);
  2951. Py_VISIT(traverse_module_state->__pyx_n_s_r43);
  2952. Py_VISIT(traverse_module_state->__pyx_n_s_r44);
  2953. Py_VISIT(traverse_module_state->__pyx_n_s_r45);
  2954. Py_VISIT(traverse_module_state->__pyx_n_s_r46);
  2955. Py_VISIT(traverse_module_state->__pyx_n_s_r47);
  2956. Py_VISIT(traverse_module_state->__pyx_n_s_r48);
  2957. Py_VISIT(traverse_module_state->__pyx_n_s_r49);
  2958. Py_VISIT(traverse_module_state->__pyx_n_s_r5);
  2959. Py_VISIT(traverse_module_state->__pyx_n_s_r50);
  2960. Py_VISIT(traverse_module_state->__pyx_n_s_r51);
  2961. Py_VISIT(traverse_module_state->__pyx_n_s_r52);
  2962. Py_VISIT(traverse_module_state->__pyx_n_s_r53);
  2963. Py_VISIT(traverse_module_state->__pyx_n_s_r54);
  2964. Py_VISIT(traverse_module_state->__pyx_n_s_r55);
  2965. Py_VISIT(traverse_module_state->__pyx_n_s_r56);
  2966. Py_VISIT(traverse_module_state->__pyx_n_s_r57);
  2967. Py_VISIT(traverse_module_state->__pyx_n_s_r58);
  2968. Py_VISIT(traverse_module_state->__pyx_n_s_r59);
  2969. Py_VISIT(traverse_module_state->__pyx_n_s_r6);
  2970. Py_VISIT(traverse_module_state->__pyx_n_s_r60);
  2971. Py_VISIT(traverse_module_state->__pyx_n_s_r61);
  2972. Py_VISIT(traverse_module_state->__pyx_n_s_r62);
  2973. Py_VISIT(traverse_module_state->__pyx_n_s_r63);
  2974. Py_VISIT(traverse_module_state->__pyx_n_s_r64);
  2975. Py_VISIT(traverse_module_state->__pyx_n_s_r65);
  2976. Py_VISIT(traverse_module_state->__pyx_n_s_r66);
  2977. Py_VISIT(traverse_module_state->__pyx_n_s_r67);
  2978. Py_VISIT(traverse_module_state->__pyx_n_s_r68);
  2979. Py_VISIT(traverse_module_state->__pyx_n_s_r69);
  2980. Py_VISIT(traverse_module_state->__pyx_n_s_r7);
  2981. Py_VISIT(traverse_module_state->__pyx_n_s_r70);
  2982. Py_VISIT(traverse_module_state->__pyx_n_s_r71);
  2983. Py_VISIT(traverse_module_state->__pyx_n_s_r72);
  2984. Py_VISIT(traverse_module_state->__pyx_n_s_r73);
  2985. Py_VISIT(traverse_module_state->__pyx_n_s_r74);
  2986. Py_VISIT(traverse_module_state->__pyx_n_s_r75);
  2987. Py_VISIT(traverse_module_state->__pyx_n_s_r76);
  2988. Py_VISIT(traverse_module_state->__pyx_n_s_r77);
  2989. Py_VISIT(traverse_module_state->__pyx_n_s_r78);
  2990. Py_VISIT(traverse_module_state->__pyx_n_s_r79);
  2991. Py_VISIT(traverse_module_state->__pyx_n_s_r8);
  2992. Py_VISIT(traverse_module_state->__pyx_n_s_r80);
  2993. Py_VISIT(traverse_module_state->__pyx_n_s_r81);
  2994. Py_VISIT(traverse_module_state->__pyx_n_s_r82);
  2995. Py_VISIT(traverse_module_state->__pyx_n_s_r83);
  2996. Py_VISIT(traverse_module_state->__pyx_n_s_r84);
  2997. Py_VISIT(traverse_module_state->__pyx_n_s_r85);
  2998. Py_VISIT(traverse_module_state->__pyx_n_s_r86);
  2999. Py_VISIT(traverse_module_state->__pyx_n_s_r87);
  3000. Py_VISIT(traverse_module_state->__pyx_n_s_r88);
  3001. Py_VISIT(traverse_module_state->__pyx_n_s_r89);
  3002. Py_VISIT(traverse_module_state->__pyx_n_s_r9);
  3003. Py_VISIT(traverse_module_state->__pyx_n_s_r90);
  3004. Py_VISIT(traverse_module_state->__pyx_n_s_r91);
  3005. Py_VISIT(traverse_module_state->__pyx_n_s_r92);
  3006. Py_VISIT(traverse_module_state->__pyx_n_s_r93);
  3007. Py_VISIT(traverse_module_state->__pyx_n_s_r94);
  3008. Py_VISIT(traverse_module_state->__pyx_n_s_r95);
  3009. Py_VISIT(traverse_module_state->__pyx_n_s_r96);
  3010. Py_VISIT(traverse_module_state->__pyx_n_s_r97);
  3011. Py_VISIT(traverse_module_state->__pyx_n_s_r98);
  3012. Py_VISIT(traverse_module_state->__pyx_n_s_r99);
  3013. Py_VISIT(traverse_module_state->__pyx_n_s_self);
  3014. Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  3015. Py_VISIT(traverse_module_state->__pyx_n_s_super);
  3016. Py_VISIT(traverse_module_state->__pyx_n_s_test);
  3017. Py_VISIT(traverse_module_state->__pyx_n_s_x);
  3018. Py_VISIT(traverse_module_state->__pyx_n_s_x0);
  3019. Py_VISIT(traverse_module_state->__pyx_n_s_x1);
  3020. Py_VISIT(traverse_module_state->__pyx_n_s_x2);
  3021. Py_VISIT(traverse_module_state->__pyx_n_s_x3);
  3022. Py_VISIT(traverse_module_state->__pyx_n_s_y);
  3023. Py_VISIT(traverse_module_state->__pyx_n_s_y0);
  3024. Py_VISIT(traverse_module_state->__pyx_n_s_y1);
  3025. Py_VISIT(traverse_module_state->__pyx_n_s_y2);
  3026. Py_VISIT(traverse_module_state->__pyx_n_s_y3);
  3027. Py_VISIT(traverse_module_state->__pyx_int_0);
  3028. Py_VISIT(traverse_module_state->__pyx_int_1);
  3029. Py_VISIT(traverse_module_state->__pyx_int_2);
  3030. Py_VISIT(traverse_module_state->__pyx_tuple__2);
  3031. Py_VISIT(traverse_module_state->__pyx_tuple__4);
  3032. Py_VISIT(traverse_module_state->__pyx_tuple__5);
  3033. Py_VISIT(traverse_module_state->__pyx_tuple__9);
  3034. Py_VISIT(traverse_module_state->__pyx_tuple__11);
  3035. Py_VISIT(traverse_module_state->__pyx_tuple__13);
  3036. Py_VISIT(traverse_module_state->__pyx_tuple__15);
  3037. Py_VISIT(traverse_module_state->__pyx_codeobj__3);
  3038. Py_VISIT(traverse_module_state->__pyx_codeobj__6);
  3039. Py_VISIT(traverse_module_state->__pyx_codeobj__7);
  3040. Py_VISIT(traverse_module_state->__pyx_codeobj__8);
  3041. Py_VISIT(traverse_module_state->__pyx_codeobj__10);
  3042. Py_VISIT(traverse_module_state->__pyx_codeobj__12);
  3043. Py_VISIT(traverse_module_state->__pyx_codeobj__14);
  3044. return 0;
  3045. }
  3046. #endif
  3047. /* #### Code section: module_state_defines ### */
  3048. #define __pyx_d __pyx_mstate_global->__pyx_d
  3049. #define __pyx_b __pyx_mstate_global->__pyx_b
  3050. #define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
  3051. #define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
  3052. #define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
  3053. #define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
  3054. #ifdef __Pyx_CyFunction_USED
  3055. #define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
  3056. #endif
  3057. #ifdef __Pyx_FusedFunction_USED
  3058. #define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
  3059. #endif
  3060. #ifdef __Pyx_Generator_USED
  3061. #define __pyx_GeneratorType __pyx_mstate_global->__pyx_GeneratorType
  3062. #endif
  3063. #ifdef __Pyx_IterableCoroutine_USED
  3064. #define __pyx_IterableCoroutineType __pyx_mstate_global->__pyx_IterableCoroutineType
  3065. #endif
  3066. #ifdef __Pyx_Coroutine_USED
  3067. #define __pyx_CoroutineAwaitType __pyx_mstate_global->__pyx_CoroutineAwaitType
  3068. #endif
  3069. #ifdef __Pyx_Coroutine_USED
  3070. #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType
  3071. #endif
  3072. #if CYTHON_USE_MODULE_STATE
  3073. #endif
  3074. #if CYTHON_USE_MODULE_STATE
  3075. #endif
  3076. #define __pyx_kp_u_ __pyx_mstate_global->__pyx_kp_u_
  3077. #define __pyx_n_s_AttributeError __pyx_mstate_global->__pyx_n_s_AttributeError
  3078. #define __pyx_n_s_BasePen __pyx_mstate_global->__pyx_n_s_BasePen
  3079. #define __pyx_n_s_COMPILED __pyx_mstate_global->__pyx_n_s_COMPILED
  3080. #define __pyx_kp_u_Glyph_statistics_not_defined_on __pyx_mstate_global->__pyx_kp_u_Glyph_statistics_not_defined_on
  3081. #define __pyx_n_s_ImportError __pyx_mstate_global->__pyx_n_s_ImportError
  3082. #define __pyx_kp_s_Lib_fontTools_pens_momentsPen_py __pyx_mstate_global->__pyx_kp_s_Lib_fontTools_pens_momentsPen_py
  3083. #define __pyx_n_s_MomentsPen __pyx_mstate_global->__pyx_n_s_MomentsPen
  3084. #define __pyx_n_u_MomentsPen __pyx_mstate_global->__pyx_n_u_MomentsPen
  3085. #define __pyx_n_s_MomentsPen___init __pyx_mstate_global->__pyx_n_s_MomentsPen___init
  3086. #define __pyx_n_s_MomentsPen__closePath __pyx_mstate_global->__pyx_n_s_MomentsPen__closePath
  3087. #define __pyx_n_s_MomentsPen__curveToOne __pyx_mstate_global->__pyx_n_s_MomentsPen__curveToOne
  3088. #define __pyx_n_s_MomentsPen__endPath __pyx_mstate_global->__pyx_n_s_MomentsPen__endPath
  3089. #define __pyx_n_s_MomentsPen__lineTo __pyx_mstate_global->__pyx_n_s_MomentsPen__lineTo
  3090. #define __pyx_n_s_MomentsPen__moveTo __pyx_mstate_global->__pyx_n_s_MomentsPen__moveTo
  3091. #define __pyx_n_s_MomentsPen__qCurveToOne __pyx_mstate_global->__pyx_n_s_MomentsPen__qCurveToOne
  3092. #define __pyx_n_s_MomentsPen__startPoint __pyx_mstate_global->__pyx_n_s_MomentsPen__startPoint
  3093. #define __pyx_n_s_OpenContourError __pyx_mstate_global->__pyx_n_s_OpenContourError
  3094. #define __pyx_n_s__16 __pyx_mstate_global->__pyx_n_s__16
  3095. #define __pyx_n_s_all __pyx_mstate_global->__pyx_n_s_all
  3096. #define __pyx_n_s_area __pyx_mstate_global->__pyx_n_s_area
  3097. #define __pyx_n_u_area __pyx_mstate_global->__pyx_n_u_area
  3098. #define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
  3099. #define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
  3100. #define __pyx_n_s_closePath __pyx_mstate_global->__pyx_n_s_closePath
  3101. #define __pyx_n_s_curveToOne __pyx_mstate_global->__pyx_n_s_curveToOne
  3102. #define __pyx_n_s_cython __pyx_mstate_global->__pyx_n_s_cython
  3103. #define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
  3104. #define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
  3105. #define __pyx_n_s_endPath __pyx_mstate_global->__pyx_n_s_endPath
  3106. #define __pyx_n_s_fontTools_misc __pyx_mstate_global->__pyx_n_s_fontTools_misc
  3107. #define __pyx_n_s_fontTools_misc_symfont __pyx_mstate_global->__pyx_n_s_fontTools_misc_symfont
  3108. #define __pyx_n_s_fontTools_pens_basePen __pyx_mstate_global->__pyx_n_s_fontTools_pens_basePen
  3109. #define __pyx_n_s_fontTools_pens_momentsPen __pyx_mstate_global->__pyx_n_s_fontTools_pens_momentsPen
  3110. #define __pyx_n_s_getCurrentPoint __pyx_mstate_global->__pyx_n_s_getCurrentPoint
  3111. #define __pyx_n_s_glyphset __pyx_mstate_global->__pyx_n_s_glyphset
  3112. #define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
  3113. #define __pyx_n_s_init __pyx_mstate_global->__pyx_n_s_init
  3114. #define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
  3115. #define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
  3116. #define __pyx_n_s_lineTo __pyx_mstate_global->__pyx_n_s_lineTo
  3117. #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
  3118. #define __pyx_n_u_main __pyx_mstate_global->__pyx_n_u_main
  3119. #define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
  3120. #define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
  3121. #define __pyx_n_s_momentX __pyx_mstate_global->__pyx_n_s_momentX
  3122. #define __pyx_n_u_momentX __pyx_mstate_global->__pyx_n_u_momentX
  3123. #define __pyx_n_s_momentXX __pyx_mstate_global->__pyx_n_s_momentXX
  3124. #define __pyx_n_u_momentXX __pyx_mstate_global->__pyx_n_u_momentXX
  3125. #define __pyx_n_s_momentXY __pyx_mstate_global->__pyx_n_s_momentXY
  3126. #define __pyx_n_u_momentXY __pyx_mstate_global->__pyx_n_u_momentXY
  3127. #define __pyx_n_s_momentY __pyx_mstate_global->__pyx_n_s_momentY
  3128. #define __pyx_n_u_momentY __pyx_mstate_global->__pyx_n_u_momentY
  3129. #define __pyx_n_s_momentYY __pyx_mstate_global->__pyx_n_s_momentYY
  3130. #define __pyx_n_u_momentYY __pyx_mstate_global->__pyx_n_u_momentYY
  3131. #define __pyx_n_s_moveTo __pyx_mstate_global->__pyx_n_s_moveTo
  3132. #define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
  3133. #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
  3134. #define __pyx_n_s_p0 __pyx_mstate_global->__pyx_n_s_p0
  3135. #define __pyx_n_s_p1 __pyx_mstate_global->__pyx_n_s_p1
  3136. #define __pyx_n_s_p2 __pyx_mstate_global->__pyx_n_s_p2
  3137. #define __pyx_n_s_p3 __pyx_mstate_global->__pyx_n_s_p3
  3138. #define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
  3139. #define __pyx_n_s_printGreenPen __pyx_mstate_global->__pyx_n_s_printGreenPen
  3140. #define __pyx_n_s_qCurveToOne __pyx_mstate_global->__pyx_n_s_qCurveToOne
  3141. #define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
  3142. #define __pyx_n_s_r0 __pyx_mstate_global->__pyx_n_s_r0
  3143. #define __pyx_n_s_r1 __pyx_mstate_global->__pyx_n_s_r1
  3144. #define __pyx_n_s_r10 __pyx_mstate_global->__pyx_n_s_r10
  3145. #define __pyx_n_s_r100 __pyx_mstate_global->__pyx_n_s_r100
  3146. #define __pyx_n_s_r101 __pyx_mstate_global->__pyx_n_s_r101
  3147. #define __pyx_n_s_r102 __pyx_mstate_global->__pyx_n_s_r102
  3148. #define __pyx_n_s_r103 __pyx_mstate_global->__pyx_n_s_r103
  3149. #define __pyx_n_s_r104 __pyx_mstate_global->__pyx_n_s_r104
  3150. #define __pyx_n_s_r105 __pyx_mstate_global->__pyx_n_s_r105
  3151. #define __pyx_n_s_r106 __pyx_mstate_global->__pyx_n_s_r106
  3152. #define __pyx_n_s_r107 __pyx_mstate_global->__pyx_n_s_r107
  3153. #define __pyx_n_s_r108 __pyx_mstate_global->__pyx_n_s_r108
  3154. #define __pyx_n_s_r109 __pyx_mstate_global->__pyx_n_s_r109
  3155. #define __pyx_n_s_r11 __pyx_mstate_global->__pyx_n_s_r11
  3156. #define __pyx_n_s_r110 __pyx_mstate_global->__pyx_n_s_r110
  3157. #define __pyx_n_s_r111 __pyx_mstate_global->__pyx_n_s_r111
  3158. #define __pyx_n_s_r112 __pyx_mstate_global->__pyx_n_s_r112
  3159. #define __pyx_n_s_r113 __pyx_mstate_global->__pyx_n_s_r113
  3160. #define __pyx_n_s_r114 __pyx_mstate_global->__pyx_n_s_r114
  3161. #define __pyx_n_s_r115 __pyx_mstate_global->__pyx_n_s_r115
  3162. #define __pyx_n_s_r116 __pyx_mstate_global->__pyx_n_s_r116
  3163. #define __pyx_n_s_r117 __pyx_mstate_global->__pyx_n_s_r117
  3164. #define __pyx_n_s_r118 __pyx_mstate_global->__pyx_n_s_r118
  3165. #define __pyx_n_s_r119 __pyx_mstate_global->__pyx_n_s_r119
  3166. #define __pyx_n_s_r12 __pyx_mstate_global->__pyx_n_s_r12
  3167. #define __pyx_n_s_r120 __pyx_mstate_global->__pyx_n_s_r120
  3168. #define __pyx_n_s_r121 __pyx_mstate_global->__pyx_n_s_r121
  3169. #define __pyx_n_s_r122 __pyx_mstate_global->__pyx_n_s_r122
  3170. #define __pyx_n_s_r123 __pyx_mstate_global->__pyx_n_s_r123
  3171. #define __pyx_n_s_r124 __pyx_mstate_global->__pyx_n_s_r124
  3172. #define __pyx_n_s_r125 __pyx_mstate_global->__pyx_n_s_r125
  3173. #define __pyx_n_s_r126 __pyx_mstate_global->__pyx_n_s_r126
  3174. #define __pyx_n_s_r127 __pyx_mstate_global->__pyx_n_s_r127
  3175. #define __pyx_n_s_r128 __pyx_mstate_global->__pyx_n_s_r128
  3176. #define __pyx_n_s_r129 __pyx_mstate_global->__pyx_n_s_r129
  3177. #define __pyx_n_s_r13 __pyx_mstate_global->__pyx_n_s_r13
  3178. #define __pyx_n_s_r130 __pyx_mstate_global->__pyx_n_s_r130
  3179. #define __pyx_n_s_r131 __pyx_mstate_global->__pyx_n_s_r131
  3180. #define __pyx_n_s_r132 __pyx_mstate_global->__pyx_n_s_r132
  3181. #define __pyx_n_s_r14 __pyx_mstate_global->__pyx_n_s_r14
  3182. #define __pyx_n_s_r15 __pyx_mstate_global->__pyx_n_s_r15
  3183. #define __pyx_n_s_r16 __pyx_mstate_global->__pyx_n_s_r16
  3184. #define __pyx_n_s_r17 __pyx_mstate_global->__pyx_n_s_r17
  3185. #define __pyx_n_s_r18 __pyx_mstate_global->__pyx_n_s_r18
  3186. #define __pyx_n_s_r19 __pyx_mstate_global->__pyx_n_s_r19
  3187. #define __pyx_n_s_r2 __pyx_mstate_global->__pyx_n_s_r2
  3188. #define __pyx_n_s_r20 __pyx_mstate_global->__pyx_n_s_r20
  3189. #define __pyx_n_s_r21 __pyx_mstate_global->__pyx_n_s_r21
  3190. #define __pyx_n_s_r22 __pyx_mstate_global->__pyx_n_s_r22
  3191. #define __pyx_n_s_r23 __pyx_mstate_global->__pyx_n_s_r23
  3192. #define __pyx_n_s_r24 __pyx_mstate_global->__pyx_n_s_r24
  3193. #define __pyx_n_s_r25 __pyx_mstate_global->__pyx_n_s_r25
  3194. #define __pyx_n_s_r26 __pyx_mstate_global->__pyx_n_s_r26
  3195. #define __pyx_n_s_r27 __pyx_mstate_global->__pyx_n_s_r27
  3196. #define __pyx_n_s_r28 __pyx_mstate_global->__pyx_n_s_r28
  3197. #define __pyx_n_s_r29 __pyx_mstate_global->__pyx_n_s_r29
  3198. #define __pyx_n_s_r3 __pyx_mstate_global->__pyx_n_s_r3
  3199. #define __pyx_n_s_r30 __pyx_mstate_global->__pyx_n_s_r30
  3200. #define __pyx_n_s_r31 __pyx_mstate_global->__pyx_n_s_r31
  3201. #define __pyx_n_s_r32 __pyx_mstate_global->__pyx_n_s_r32
  3202. #define __pyx_n_s_r33 __pyx_mstate_global->__pyx_n_s_r33
  3203. #define __pyx_n_s_r34 __pyx_mstate_global->__pyx_n_s_r34
  3204. #define __pyx_n_s_r35 __pyx_mstate_global->__pyx_n_s_r35
  3205. #define __pyx_n_s_r36 __pyx_mstate_global->__pyx_n_s_r36
  3206. #define __pyx_n_s_r37 __pyx_mstate_global->__pyx_n_s_r37
  3207. #define __pyx_n_s_r38 __pyx_mstate_global->__pyx_n_s_r38
  3208. #define __pyx_n_s_r39 __pyx_mstate_global->__pyx_n_s_r39
  3209. #define __pyx_n_s_r4 __pyx_mstate_global->__pyx_n_s_r4
  3210. #define __pyx_n_s_r40 __pyx_mstate_global->__pyx_n_s_r40
  3211. #define __pyx_n_s_r41 __pyx_mstate_global->__pyx_n_s_r41
  3212. #define __pyx_n_s_r42 __pyx_mstate_global->__pyx_n_s_r42
  3213. #define __pyx_n_s_r43 __pyx_mstate_global->__pyx_n_s_r43
  3214. #define __pyx_n_s_r44 __pyx_mstate_global->__pyx_n_s_r44
  3215. #define __pyx_n_s_r45 __pyx_mstate_global->__pyx_n_s_r45
  3216. #define __pyx_n_s_r46 __pyx_mstate_global->__pyx_n_s_r46
  3217. #define __pyx_n_s_r47 __pyx_mstate_global->__pyx_n_s_r47
  3218. #define __pyx_n_s_r48 __pyx_mstate_global->__pyx_n_s_r48
  3219. #define __pyx_n_s_r49 __pyx_mstate_global->__pyx_n_s_r49
  3220. #define __pyx_n_s_r5 __pyx_mstate_global->__pyx_n_s_r5
  3221. #define __pyx_n_s_r50 __pyx_mstate_global->__pyx_n_s_r50
  3222. #define __pyx_n_s_r51 __pyx_mstate_global->__pyx_n_s_r51
  3223. #define __pyx_n_s_r52 __pyx_mstate_global->__pyx_n_s_r52
  3224. #define __pyx_n_s_r53 __pyx_mstate_global->__pyx_n_s_r53
  3225. #define __pyx_n_s_r54 __pyx_mstate_global->__pyx_n_s_r54
  3226. #define __pyx_n_s_r55 __pyx_mstate_global->__pyx_n_s_r55
  3227. #define __pyx_n_s_r56 __pyx_mstate_global->__pyx_n_s_r56
  3228. #define __pyx_n_s_r57 __pyx_mstate_global->__pyx_n_s_r57
  3229. #define __pyx_n_s_r58 __pyx_mstate_global->__pyx_n_s_r58
  3230. #define __pyx_n_s_r59 __pyx_mstate_global->__pyx_n_s_r59
  3231. #define __pyx_n_s_r6 __pyx_mstate_global->__pyx_n_s_r6
  3232. #define __pyx_n_s_r60 __pyx_mstate_global->__pyx_n_s_r60
  3233. #define __pyx_n_s_r61 __pyx_mstate_global->__pyx_n_s_r61
  3234. #define __pyx_n_s_r62 __pyx_mstate_global->__pyx_n_s_r62
  3235. #define __pyx_n_s_r63 __pyx_mstate_global->__pyx_n_s_r63
  3236. #define __pyx_n_s_r64 __pyx_mstate_global->__pyx_n_s_r64
  3237. #define __pyx_n_s_r65 __pyx_mstate_global->__pyx_n_s_r65
  3238. #define __pyx_n_s_r66 __pyx_mstate_global->__pyx_n_s_r66
  3239. #define __pyx_n_s_r67 __pyx_mstate_global->__pyx_n_s_r67
  3240. #define __pyx_n_s_r68 __pyx_mstate_global->__pyx_n_s_r68
  3241. #define __pyx_n_s_r69 __pyx_mstate_global->__pyx_n_s_r69
  3242. #define __pyx_n_s_r7 __pyx_mstate_global->__pyx_n_s_r7
  3243. #define __pyx_n_s_r70 __pyx_mstate_global->__pyx_n_s_r70
  3244. #define __pyx_n_s_r71 __pyx_mstate_global->__pyx_n_s_r71
  3245. #define __pyx_n_s_r72 __pyx_mstate_global->__pyx_n_s_r72
  3246. #define __pyx_n_s_r73 __pyx_mstate_global->__pyx_n_s_r73
  3247. #define __pyx_n_s_r74 __pyx_mstate_global->__pyx_n_s_r74
  3248. #define __pyx_n_s_r75 __pyx_mstate_global->__pyx_n_s_r75
  3249. #define __pyx_n_s_r76 __pyx_mstate_global->__pyx_n_s_r76
  3250. #define __pyx_n_s_r77 __pyx_mstate_global->__pyx_n_s_r77
  3251. #define __pyx_n_s_r78 __pyx_mstate_global->__pyx_n_s_r78
  3252. #define __pyx_n_s_r79 __pyx_mstate_global->__pyx_n_s_r79
  3253. #define __pyx_n_s_r8 __pyx_mstate_global->__pyx_n_s_r8
  3254. #define __pyx_n_s_r80 __pyx_mstate_global->__pyx_n_s_r80
  3255. #define __pyx_n_s_r81 __pyx_mstate_global->__pyx_n_s_r81
  3256. #define __pyx_n_s_r82 __pyx_mstate_global->__pyx_n_s_r82
  3257. #define __pyx_n_s_r83 __pyx_mstate_global->__pyx_n_s_r83
  3258. #define __pyx_n_s_r84 __pyx_mstate_global->__pyx_n_s_r84
  3259. #define __pyx_n_s_r85 __pyx_mstate_global->__pyx_n_s_r85
  3260. #define __pyx_n_s_r86 __pyx_mstate_global->__pyx_n_s_r86
  3261. #define __pyx_n_s_r87 __pyx_mstate_global->__pyx_n_s_r87
  3262. #define __pyx_n_s_r88 __pyx_mstate_global->__pyx_n_s_r88
  3263. #define __pyx_n_s_r89 __pyx_mstate_global->__pyx_n_s_r89
  3264. #define __pyx_n_s_r9 __pyx_mstate_global->__pyx_n_s_r9
  3265. #define __pyx_n_s_r90 __pyx_mstate_global->__pyx_n_s_r90
  3266. #define __pyx_n_s_r91 __pyx_mstate_global->__pyx_n_s_r91
  3267. #define __pyx_n_s_r92 __pyx_mstate_global->__pyx_n_s_r92
  3268. #define __pyx_n_s_r93 __pyx_mstate_global->__pyx_n_s_r93
  3269. #define __pyx_n_s_r94 __pyx_mstate_global->__pyx_n_s_r94
  3270. #define __pyx_n_s_r95 __pyx_mstate_global->__pyx_n_s_r95
  3271. #define __pyx_n_s_r96 __pyx_mstate_global->__pyx_n_s_r96
  3272. #define __pyx_n_s_r97 __pyx_mstate_global->__pyx_n_s_r97
  3273. #define __pyx_n_s_r98 __pyx_mstate_global->__pyx_n_s_r98
  3274. #define __pyx_n_s_r99 __pyx_mstate_global->__pyx_n_s_r99
  3275. #define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
  3276. #define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
  3277. #define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
  3278. #define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
  3279. #define __pyx_n_s_x __pyx_mstate_global->__pyx_n_s_x
  3280. #define __pyx_n_s_x0 __pyx_mstate_global->__pyx_n_s_x0
  3281. #define __pyx_n_s_x1 __pyx_mstate_global->__pyx_n_s_x1
  3282. #define __pyx_n_s_x2 __pyx_mstate_global->__pyx_n_s_x2
  3283. #define __pyx_n_s_x3 __pyx_mstate_global->__pyx_n_s_x3
  3284. #define __pyx_n_s_y __pyx_mstate_global->__pyx_n_s_y
  3285. #define __pyx_n_s_y0 __pyx_mstate_global->__pyx_n_s_y0
  3286. #define __pyx_n_s_y1 __pyx_mstate_global->__pyx_n_s_y1
  3287. #define __pyx_n_s_y2 __pyx_mstate_global->__pyx_n_s_y2
  3288. #define __pyx_n_s_y3 __pyx_mstate_global->__pyx_n_s_y3
  3289. #define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
  3290. #define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
  3291. #define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
  3292. #define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
  3293. #define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
  3294. #define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
  3295. #define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
  3296. #define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
  3297. #define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
  3298. #define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
  3299. #define __pyx_codeobj__3 __pyx_mstate_global->__pyx_codeobj__3
  3300. #define __pyx_codeobj__6 __pyx_mstate_global->__pyx_codeobj__6
  3301. #define __pyx_codeobj__7 __pyx_mstate_global->__pyx_codeobj__7
  3302. #define __pyx_codeobj__8 __pyx_mstate_global->__pyx_codeobj__8
  3303. #define __pyx_codeobj__10 __pyx_mstate_global->__pyx_codeobj__10
  3304. #define __pyx_codeobj__12 __pyx_mstate_global->__pyx_codeobj__12
  3305. #define __pyx_codeobj__14 __pyx_mstate_global->__pyx_codeobj__14
  3306. /* #### Code section: module_code ### */
  3307. /* "fontTools/pens/momentsPen.py":18
  3308. *
  3309. * class MomentsPen(BasePen):
  3310. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  3311. * BasePen.__init__(self, glyphset)
  3312. *
  3313. */
  3314. /* Python wrapper */
  3315. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__(PyObject *__pyx_self,
  3316. #if CYTHON_METH_FASTCALL
  3317. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3318. #else
  3319. PyObject *__pyx_args, PyObject *__pyx_kwds
  3320. #endif
  3321. ); /*proto*/
  3322. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen___init__, "MomentsPen.__init__(self, glyphset=None)");
  3323. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__ = {"__init__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen___init__};
  3324. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__(PyObject *__pyx_self,
  3325. #if CYTHON_METH_FASTCALL
  3326. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3327. #else
  3328. PyObject *__pyx_args, PyObject *__pyx_kwds
  3329. #endif
  3330. ) {
  3331. PyObject *__pyx_v_self = 0;
  3332. PyObject *__pyx_v_glyphset = 0;
  3333. #if !CYTHON_METH_FASTCALL
  3334. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3335. #endif
  3336. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3337. PyObject* values[2] = {0,0};
  3338. int __pyx_lineno = 0;
  3339. const char *__pyx_filename = NULL;
  3340. int __pyx_clineno = 0;
  3341. PyObject *__pyx_r = 0;
  3342. __Pyx_RefNannyDeclarations
  3343. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  3344. #if !CYTHON_METH_FASTCALL
  3345. #if CYTHON_ASSUME_SAFE_MACROS
  3346. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3347. #else
  3348. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3349. #endif
  3350. #endif
  3351. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3352. {
  3353. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_glyphset,0};
  3354. values[1] = __Pyx_Arg_NewRef_FASTCALL(((PyObject *)Py_None));
  3355. if (__pyx_kwds) {
  3356. Py_ssize_t kw_args;
  3357. switch (__pyx_nargs) {
  3358. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  3359. CYTHON_FALLTHROUGH;
  3360. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3361. CYTHON_FALLTHROUGH;
  3362. case 0: break;
  3363. default: goto __pyx_L5_argtuple_error;
  3364. }
  3365. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  3366. switch (__pyx_nargs) {
  3367. case 0:
  3368. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  3369. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  3370. kw_args--;
  3371. }
  3372. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
  3373. else goto __pyx_L5_argtuple_error;
  3374. CYTHON_FALLTHROUGH;
  3375. case 1:
  3376. if (kw_args > 0) {
  3377. PyObject* value = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_glyphset);
  3378. if (value) { values[1] = __Pyx_Arg_NewRef_FASTCALL(value); kw_args--; }
  3379. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 18, __pyx_L3_error)
  3380. }
  3381. }
  3382. if (unlikely(kw_args > 0)) {
  3383. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3384. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 18, __pyx_L3_error)
  3385. }
  3386. } else {
  3387. switch (__pyx_nargs) {
  3388. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  3389. CYTHON_FALLTHROUGH;
  3390. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3391. break;
  3392. default: goto __pyx_L5_argtuple_error;
  3393. }
  3394. }
  3395. __pyx_v_self = values[0];
  3396. __pyx_v_glyphset = values[1];
  3397. }
  3398. goto __pyx_L6_skip;
  3399. __pyx_L5_argtuple_error:;
  3400. __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 2, __pyx_nargs); __PYX_ERR(0, 18, __pyx_L3_error)
  3401. __pyx_L6_skip:;
  3402. goto __pyx_L4_argument_unpacking_done;
  3403. __pyx_L3_error:;
  3404. {
  3405. Py_ssize_t __pyx_temp;
  3406. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3407. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3408. }
  3409. }
  3410. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3411. __Pyx_RefNannyFinishContext();
  3412. return NULL;
  3413. __pyx_L4_argument_unpacking_done:;
  3414. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(__pyx_self, __pyx_v_self, __pyx_v_glyphset);
  3415. /* function exit code */
  3416. {
  3417. Py_ssize_t __pyx_temp;
  3418. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3419. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3420. }
  3421. }
  3422. __Pyx_RefNannyFinishContext();
  3423. return __pyx_r;
  3424. }
  3425. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_glyphset) {
  3426. PyObject *__pyx_r = NULL;
  3427. __Pyx_RefNannyDeclarations
  3428. PyObject *__pyx_t_1 = NULL;
  3429. PyObject *__pyx_t_2 = NULL;
  3430. PyObject *__pyx_t_3 = NULL;
  3431. int __pyx_t_4;
  3432. int __pyx_lineno = 0;
  3433. const char *__pyx_filename = NULL;
  3434. int __pyx_clineno = 0;
  3435. __Pyx_RefNannySetupContext("__init__", 1);
  3436. /* "fontTools/pens/momentsPen.py":19
  3437. * class MomentsPen(BasePen):
  3438. * def __init__(self, glyphset=None):
  3439. * BasePen.__init__(self, glyphset) # <<<<<<<<<<<<<<
  3440. *
  3441. * self.area = 0
  3442. */
  3443. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_BasePen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 19, __pyx_L1_error)
  3444. __Pyx_GOTREF(__pyx_t_2);
  3445. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_init); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 19, __pyx_L1_error)
  3446. __Pyx_GOTREF(__pyx_t_3);
  3447. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3448. __pyx_t_2 = NULL;
  3449. __pyx_t_4 = 0;
  3450. #if CYTHON_UNPACK_METHODS
  3451. if (unlikely(PyMethod_Check(__pyx_t_3))) {
  3452. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  3453. if (likely(__pyx_t_2)) {
  3454. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3455. __Pyx_INCREF(__pyx_t_2);
  3456. __Pyx_INCREF(function);
  3457. __Pyx_DECREF_SET(__pyx_t_3, function);
  3458. __pyx_t_4 = 1;
  3459. }
  3460. }
  3461. #endif
  3462. {
  3463. PyObject *__pyx_callargs[3] = {__pyx_t_2, __pyx_v_self, __pyx_v_glyphset};
  3464. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
  3465. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  3466. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 19, __pyx_L1_error)
  3467. __Pyx_GOTREF(__pyx_t_1);
  3468. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3469. }
  3470. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3471. /* "fontTools/pens/momentsPen.py":21
  3472. * BasePen.__init__(self, glyphset)
  3473. *
  3474. * self.area = 0 # <<<<<<<<<<<<<<
  3475. * self.momentX = 0
  3476. * self.momentY = 0
  3477. */
  3478. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_area, __pyx_int_0) < 0) __PYX_ERR(0, 21, __pyx_L1_error)
  3479. /* "fontTools/pens/momentsPen.py":22
  3480. *
  3481. * self.area = 0
  3482. * self.momentX = 0 # <<<<<<<<<<<<<<
  3483. * self.momentY = 0
  3484. * self.momentXX = 0
  3485. */
  3486. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentX, __pyx_int_0) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  3487. /* "fontTools/pens/momentsPen.py":23
  3488. * self.area = 0
  3489. * self.momentX = 0
  3490. * self.momentY = 0 # <<<<<<<<<<<<<<
  3491. * self.momentXX = 0
  3492. * self.momentXY = 0
  3493. */
  3494. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentY, __pyx_int_0) < 0) __PYX_ERR(0, 23, __pyx_L1_error)
  3495. /* "fontTools/pens/momentsPen.py":24
  3496. * self.momentX = 0
  3497. * self.momentY = 0
  3498. * self.momentXX = 0 # <<<<<<<<<<<<<<
  3499. * self.momentXY = 0
  3500. * self.momentYY = 0
  3501. */
  3502. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXX, __pyx_int_0) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  3503. /* "fontTools/pens/momentsPen.py":25
  3504. * self.momentY = 0
  3505. * self.momentXX = 0
  3506. * self.momentXY = 0 # <<<<<<<<<<<<<<
  3507. * self.momentYY = 0
  3508. *
  3509. */
  3510. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXY, __pyx_int_0) < 0) __PYX_ERR(0, 25, __pyx_L1_error)
  3511. /* "fontTools/pens/momentsPen.py":26
  3512. * self.momentXX = 0
  3513. * self.momentXY = 0
  3514. * self.momentYY = 0 # <<<<<<<<<<<<<<
  3515. *
  3516. * def _moveTo(self, p0):
  3517. */
  3518. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentYY, __pyx_int_0) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
  3519. /* "fontTools/pens/momentsPen.py":18
  3520. *
  3521. * class MomentsPen(BasePen):
  3522. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  3523. * BasePen.__init__(self, glyphset)
  3524. *
  3525. */
  3526. /* function exit code */
  3527. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3528. goto __pyx_L0;
  3529. __pyx_L1_error:;
  3530. __Pyx_XDECREF(__pyx_t_1);
  3531. __Pyx_XDECREF(__pyx_t_2);
  3532. __Pyx_XDECREF(__pyx_t_3);
  3533. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3534. __pyx_r = NULL;
  3535. __pyx_L0:;
  3536. __Pyx_XGIVEREF(__pyx_r);
  3537. __Pyx_RefNannyFinishContext();
  3538. return __pyx_r;
  3539. }
  3540. /* "fontTools/pens/momentsPen.py":28
  3541. * self.momentYY = 0
  3542. *
  3543. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  3544. * self.__startPoint = p0
  3545. *
  3546. */
  3547. /* Python wrapper */
  3548. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo(PyObject *__pyx_self,
  3549. #if CYTHON_METH_FASTCALL
  3550. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3551. #else
  3552. PyObject *__pyx_args, PyObject *__pyx_kwds
  3553. #endif
  3554. ); /*proto*/
  3555. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo, "MomentsPen._moveTo(self, p0)");
  3556. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo = {"_moveTo", (PyCFunction)(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};
  3557. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo(PyObject *__pyx_self,
  3558. #if CYTHON_METH_FASTCALL
  3559. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3560. #else
  3561. PyObject *__pyx_args, PyObject *__pyx_kwds
  3562. #endif
  3563. ) {
  3564. PyObject *__pyx_v_self = 0;
  3565. PyObject *__pyx_v_p0 = 0;
  3566. #if !CYTHON_METH_FASTCALL
  3567. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3568. #endif
  3569. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3570. PyObject* values[2] = {0,0};
  3571. int __pyx_lineno = 0;
  3572. const char *__pyx_filename = NULL;
  3573. int __pyx_clineno = 0;
  3574. PyObject *__pyx_r = 0;
  3575. __Pyx_RefNannyDeclarations
  3576. __Pyx_RefNannySetupContext("_moveTo (wrapper)", 0);
  3577. #if !CYTHON_METH_FASTCALL
  3578. #if CYTHON_ASSUME_SAFE_MACROS
  3579. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3580. #else
  3581. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3582. #endif
  3583. #endif
  3584. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3585. {
  3586. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p0,0};
  3587. if (__pyx_kwds) {
  3588. Py_ssize_t kw_args;
  3589. switch (__pyx_nargs) {
  3590. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  3591. CYTHON_FALLTHROUGH;
  3592. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3593. CYTHON_FALLTHROUGH;
  3594. case 0: break;
  3595. default: goto __pyx_L5_argtuple_error;
  3596. }
  3597. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  3598. switch (__pyx_nargs) {
  3599. case 0:
  3600. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  3601. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  3602. kw_args--;
  3603. }
  3604. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
  3605. else goto __pyx_L5_argtuple_error;
  3606. CYTHON_FALLTHROUGH;
  3607. case 1:
  3608. if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p0)) != 0)) {
  3609. (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
  3610. kw_args--;
  3611. }
  3612. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 28, __pyx_L3_error)
  3613. else {
  3614. __Pyx_RaiseArgtupleInvalid("_moveTo", 1, 2, 2, 1); __PYX_ERR(0, 28, __pyx_L3_error)
  3615. }
  3616. }
  3617. if (unlikely(kw_args > 0)) {
  3618. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3619. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_moveTo") < 0)) __PYX_ERR(0, 28, __pyx_L3_error)
  3620. }
  3621. } else if (unlikely(__pyx_nargs != 2)) {
  3622. goto __pyx_L5_argtuple_error;
  3623. } else {
  3624. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3625. values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  3626. }
  3627. __pyx_v_self = values[0];
  3628. __pyx_v_p0 = values[1];
  3629. }
  3630. goto __pyx_L6_skip;
  3631. __pyx_L5_argtuple_error:;
  3632. __Pyx_RaiseArgtupleInvalid("_moveTo", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 28, __pyx_L3_error)
  3633. __pyx_L6_skip:;
  3634. goto __pyx_L4_argument_unpacking_done;
  3635. __pyx_L3_error:;
  3636. {
  3637. Py_ssize_t __pyx_temp;
  3638. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3639. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3640. }
  3641. }
  3642. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._moveTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3643. __Pyx_RefNannyFinishContext();
  3644. return NULL;
  3645. __pyx_L4_argument_unpacking_done:;
  3646. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(__pyx_self, __pyx_v_self, __pyx_v_p0);
  3647. /* function exit code */
  3648. {
  3649. Py_ssize_t __pyx_temp;
  3650. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3651. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3652. }
  3653. }
  3654. __Pyx_RefNannyFinishContext();
  3655. return __pyx_r;
  3656. }
  3657. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_2_moveTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p0) {
  3658. PyObject *__pyx_r = NULL;
  3659. __Pyx_RefNannyDeclarations
  3660. int __pyx_lineno = 0;
  3661. const char *__pyx_filename = NULL;
  3662. int __pyx_clineno = 0;
  3663. __Pyx_RefNannySetupContext("_moveTo", 1);
  3664. /* "fontTools/pens/momentsPen.py":29
  3665. *
  3666. * def _moveTo(self, p0):
  3667. * self.__startPoint = p0 # <<<<<<<<<<<<<<
  3668. *
  3669. * def _closePath(self):
  3670. */
  3671. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_MomentsPen__startPoint, __pyx_v_p0) < 0) __PYX_ERR(0, 29, __pyx_L1_error)
  3672. /* "fontTools/pens/momentsPen.py":28
  3673. * self.momentYY = 0
  3674. *
  3675. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  3676. * self.__startPoint = p0
  3677. *
  3678. */
  3679. /* function exit code */
  3680. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3681. goto __pyx_L0;
  3682. __pyx_L1_error:;
  3683. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._moveTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3684. __pyx_r = NULL;
  3685. __pyx_L0:;
  3686. __Pyx_XGIVEREF(__pyx_r);
  3687. __Pyx_RefNannyFinishContext();
  3688. return __pyx_r;
  3689. }
  3690. /* "fontTools/pens/momentsPen.py":31
  3691. * self.__startPoint = p0
  3692. *
  3693. * def _closePath(self): # <<<<<<<<<<<<<<
  3694. * p0 = self._getCurrentPoint()
  3695. * if p0 != self.__startPoint:
  3696. */
  3697. /* Python wrapper */
  3698. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath(PyObject *__pyx_self,
  3699. #if CYTHON_METH_FASTCALL
  3700. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3701. #else
  3702. PyObject *__pyx_args, PyObject *__pyx_kwds
  3703. #endif
  3704. ); /*proto*/
  3705. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath, "MomentsPen._closePath(self)");
  3706. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath = {"_closePath", (PyCFunction)(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};
  3707. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath(PyObject *__pyx_self,
  3708. #if CYTHON_METH_FASTCALL
  3709. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3710. #else
  3711. PyObject *__pyx_args, PyObject *__pyx_kwds
  3712. #endif
  3713. ) {
  3714. PyObject *__pyx_v_self = 0;
  3715. #if !CYTHON_METH_FASTCALL
  3716. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3717. #endif
  3718. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3719. PyObject* values[1] = {0};
  3720. int __pyx_lineno = 0;
  3721. const char *__pyx_filename = NULL;
  3722. int __pyx_clineno = 0;
  3723. PyObject *__pyx_r = 0;
  3724. __Pyx_RefNannyDeclarations
  3725. __Pyx_RefNannySetupContext("_closePath (wrapper)", 0);
  3726. #if !CYTHON_METH_FASTCALL
  3727. #if CYTHON_ASSUME_SAFE_MACROS
  3728. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3729. #else
  3730. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3731. #endif
  3732. #endif
  3733. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3734. {
  3735. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
  3736. if (__pyx_kwds) {
  3737. Py_ssize_t kw_args;
  3738. switch (__pyx_nargs) {
  3739. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3740. CYTHON_FALLTHROUGH;
  3741. case 0: break;
  3742. default: goto __pyx_L5_argtuple_error;
  3743. }
  3744. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  3745. switch (__pyx_nargs) {
  3746. case 0:
  3747. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  3748. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  3749. kw_args--;
  3750. }
  3751. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 31, __pyx_L3_error)
  3752. else goto __pyx_L5_argtuple_error;
  3753. }
  3754. if (unlikely(kw_args > 0)) {
  3755. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3756. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_closePath") < 0)) __PYX_ERR(0, 31, __pyx_L3_error)
  3757. }
  3758. } else if (unlikely(__pyx_nargs != 1)) {
  3759. goto __pyx_L5_argtuple_error;
  3760. } else {
  3761. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3762. }
  3763. __pyx_v_self = values[0];
  3764. }
  3765. goto __pyx_L6_skip;
  3766. __pyx_L5_argtuple_error:;
  3767. __Pyx_RaiseArgtupleInvalid("_closePath", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 31, __pyx_L3_error)
  3768. __pyx_L6_skip:;
  3769. goto __pyx_L4_argument_unpacking_done;
  3770. __pyx_L3_error:;
  3771. {
  3772. Py_ssize_t __pyx_temp;
  3773. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3774. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3775. }
  3776. }
  3777. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._closePath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3778. __Pyx_RefNannyFinishContext();
  3779. return NULL;
  3780. __pyx_L4_argument_unpacking_done:;
  3781. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(__pyx_self, __pyx_v_self);
  3782. /* function exit code */
  3783. {
  3784. Py_ssize_t __pyx_temp;
  3785. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  3786. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  3787. }
  3788. }
  3789. __Pyx_RefNannyFinishContext();
  3790. return __pyx_r;
  3791. }
  3792. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_4_closePath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  3793. PyObject *__pyx_v_p0 = NULL;
  3794. PyObject *__pyx_r = NULL;
  3795. __Pyx_RefNannyDeclarations
  3796. PyObject *__pyx_t_1 = NULL;
  3797. PyObject *__pyx_t_2 = NULL;
  3798. PyObject *__pyx_t_3 = NULL;
  3799. int __pyx_t_4;
  3800. int __pyx_t_5;
  3801. PyObject *__pyx_t_6 = NULL;
  3802. int __pyx_lineno = 0;
  3803. const char *__pyx_filename = NULL;
  3804. int __pyx_clineno = 0;
  3805. __Pyx_RefNannySetupContext("_closePath", 1);
  3806. /* "fontTools/pens/momentsPen.py":32
  3807. *
  3808. * def _closePath(self):
  3809. * p0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  3810. * if p0 != self.__startPoint:
  3811. * self._lineTo(self.__startPoint)
  3812. */
  3813. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCurrentPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 32, __pyx_L1_error)
  3814. __Pyx_GOTREF(__pyx_t_2);
  3815. __pyx_t_3 = NULL;
  3816. __pyx_t_4 = 0;
  3817. #if CYTHON_UNPACK_METHODS
  3818. if (likely(PyMethod_Check(__pyx_t_2))) {
  3819. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3820. if (likely(__pyx_t_3)) {
  3821. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3822. __Pyx_INCREF(__pyx_t_3);
  3823. __Pyx_INCREF(function);
  3824. __Pyx_DECREF_SET(__pyx_t_2, function);
  3825. __pyx_t_4 = 1;
  3826. }
  3827. }
  3828. #endif
  3829. {
  3830. PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
  3831. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
  3832. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3833. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 32, __pyx_L1_error)
  3834. __Pyx_GOTREF(__pyx_t_1);
  3835. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3836. }
  3837. __pyx_v_p0 = __pyx_t_1;
  3838. __pyx_t_1 = 0;
  3839. /* "fontTools/pens/momentsPen.py":33
  3840. * def _closePath(self):
  3841. * p0 = self._getCurrentPoint()
  3842. * if p0 != self.__startPoint: # <<<<<<<<<<<<<<
  3843. * self._lineTo(self.__startPoint)
  3844. *
  3845. */
  3846. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MomentsPen__startPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 33, __pyx_L1_error)
  3847. __Pyx_GOTREF(__pyx_t_1);
  3848. __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, 33, __pyx_L1_error)
  3849. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3850. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 33, __pyx_L1_error)
  3851. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3852. if (__pyx_t_5) {
  3853. /* "fontTools/pens/momentsPen.py":34
  3854. * p0 = self._getCurrentPoint()
  3855. * if p0 != self.__startPoint:
  3856. * self._lineTo(self.__startPoint) # <<<<<<<<<<<<<<
  3857. *
  3858. * def _endPath(self):
  3859. */
  3860. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_lineTo); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 34, __pyx_L1_error)
  3861. __Pyx_GOTREF(__pyx_t_1);
  3862. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MomentsPen__startPoint); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 34, __pyx_L1_error)
  3863. __Pyx_GOTREF(__pyx_t_3);
  3864. __pyx_t_6 = NULL;
  3865. __pyx_t_4 = 0;
  3866. #if CYTHON_UNPACK_METHODS
  3867. if (likely(PyMethod_Check(__pyx_t_1))) {
  3868. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  3869. if (likely(__pyx_t_6)) {
  3870. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  3871. __Pyx_INCREF(__pyx_t_6);
  3872. __Pyx_INCREF(function);
  3873. __Pyx_DECREF_SET(__pyx_t_1, function);
  3874. __pyx_t_4 = 1;
  3875. }
  3876. }
  3877. #endif
  3878. {
  3879. PyObject *__pyx_callargs[2] = {__pyx_t_6, __pyx_t_3};
  3880. __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
  3881. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  3882. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3883. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 34, __pyx_L1_error)
  3884. __Pyx_GOTREF(__pyx_t_2);
  3885. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3886. }
  3887. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3888. /* "fontTools/pens/momentsPen.py":33
  3889. * def _closePath(self):
  3890. * p0 = self._getCurrentPoint()
  3891. * if p0 != self.__startPoint: # <<<<<<<<<<<<<<
  3892. * self._lineTo(self.__startPoint)
  3893. *
  3894. */
  3895. }
  3896. /* "fontTools/pens/momentsPen.py":31
  3897. * self.__startPoint = p0
  3898. *
  3899. * def _closePath(self): # <<<<<<<<<<<<<<
  3900. * p0 = self._getCurrentPoint()
  3901. * if p0 != self.__startPoint:
  3902. */
  3903. /* function exit code */
  3904. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3905. goto __pyx_L0;
  3906. __pyx_L1_error:;
  3907. __Pyx_XDECREF(__pyx_t_1);
  3908. __Pyx_XDECREF(__pyx_t_2);
  3909. __Pyx_XDECREF(__pyx_t_3);
  3910. __Pyx_XDECREF(__pyx_t_6);
  3911. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._closePath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3912. __pyx_r = NULL;
  3913. __pyx_L0:;
  3914. __Pyx_XDECREF(__pyx_v_p0);
  3915. __Pyx_XGIVEREF(__pyx_r);
  3916. __Pyx_RefNannyFinishContext();
  3917. return __pyx_r;
  3918. }
  3919. /* "fontTools/pens/momentsPen.py":36
  3920. * self._lineTo(self.__startPoint)
  3921. *
  3922. * def _endPath(self): # <<<<<<<<<<<<<<
  3923. * p0 = self._getCurrentPoint()
  3924. * if p0 != self.__startPoint:
  3925. */
  3926. /* Python wrapper */
  3927. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath(PyObject *__pyx_self,
  3928. #if CYTHON_METH_FASTCALL
  3929. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3930. #else
  3931. PyObject *__pyx_args, PyObject *__pyx_kwds
  3932. #endif
  3933. ); /*proto*/
  3934. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath, "MomentsPen._endPath(self)");
  3935. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath = {"_endPath", (PyCFunction)(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};
  3936. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath(PyObject *__pyx_self,
  3937. #if CYTHON_METH_FASTCALL
  3938. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  3939. #else
  3940. PyObject *__pyx_args, PyObject *__pyx_kwds
  3941. #endif
  3942. ) {
  3943. PyObject *__pyx_v_self = 0;
  3944. #if !CYTHON_METH_FASTCALL
  3945. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  3946. #endif
  3947. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  3948. PyObject* values[1] = {0};
  3949. int __pyx_lineno = 0;
  3950. const char *__pyx_filename = NULL;
  3951. int __pyx_clineno = 0;
  3952. PyObject *__pyx_r = 0;
  3953. __Pyx_RefNannyDeclarations
  3954. __Pyx_RefNannySetupContext("_endPath (wrapper)", 0);
  3955. #if !CYTHON_METH_FASTCALL
  3956. #if CYTHON_ASSUME_SAFE_MACROS
  3957. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  3958. #else
  3959. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  3960. #endif
  3961. #endif
  3962. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  3963. {
  3964. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
  3965. if (__pyx_kwds) {
  3966. Py_ssize_t kw_args;
  3967. switch (__pyx_nargs) {
  3968. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3969. CYTHON_FALLTHROUGH;
  3970. case 0: break;
  3971. default: goto __pyx_L5_argtuple_error;
  3972. }
  3973. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  3974. switch (__pyx_nargs) {
  3975. case 0:
  3976. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  3977. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  3978. kw_args--;
  3979. }
  3980. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L3_error)
  3981. else goto __pyx_L5_argtuple_error;
  3982. }
  3983. if (unlikely(kw_args > 0)) {
  3984. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  3985. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_endPath") < 0)) __PYX_ERR(0, 36, __pyx_L3_error)
  3986. }
  3987. } else if (unlikely(__pyx_nargs != 1)) {
  3988. goto __pyx_L5_argtuple_error;
  3989. } else {
  3990. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  3991. }
  3992. __pyx_v_self = values[0];
  3993. }
  3994. goto __pyx_L6_skip;
  3995. __pyx_L5_argtuple_error:;
  3996. __Pyx_RaiseArgtupleInvalid("_endPath", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 36, __pyx_L3_error)
  3997. __pyx_L6_skip:;
  3998. goto __pyx_L4_argument_unpacking_done;
  3999. __pyx_L3_error:;
  4000. {
  4001. Py_ssize_t __pyx_temp;
  4002. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4003. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4004. }
  4005. }
  4006. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._endPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4007. __Pyx_RefNannyFinishContext();
  4008. return NULL;
  4009. __pyx_L4_argument_unpacking_done:;
  4010. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(__pyx_self, __pyx_v_self);
  4011. /* function exit code */
  4012. {
  4013. Py_ssize_t __pyx_temp;
  4014. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4015. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4016. }
  4017. }
  4018. __Pyx_RefNannyFinishContext();
  4019. return __pyx_r;
  4020. }
  4021. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_6_endPath(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  4022. PyObject *__pyx_v_p0 = NULL;
  4023. PyObject *__pyx_r = NULL;
  4024. __Pyx_RefNannyDeclarations
  4025. PyObject *__pyx_t_1 = NULL;
  4026. PyObject *__pyx_t_2 = NULL;
  4027. PyObject *__pyx_t_3 = NULL;
  4028. int __pyx_t_4;
  4029. int __pyx_t_5;
  4030. int __pyx_lineno = 0;
  4031. const char *__pyx_filename = NULL;
  4032. int __pyx_clineno = 0;
  4033. __Pyx_RefNannySetupContext("_endPath", 1);
  4034. /* "fontTools/pens/momentsPen.py":37
  4035. *
  4036. * def _endPath(self):
  4037. * p0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  4038. * if p0 != self.__startPoint:
  4039. * raise OpenContourError("Glyph statistics not defined on open contours.")
  4040. */
  4041. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCurrentPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 37, __pyx_L1_error)
  4042. __Pyx_GOTREF(__pyx_t_2);
  4043. __pyx_t_3 = NULL;
  4044. __pyx_t_4 = 0;
  4045. #if CYTHON_UNPACK_METHODS
  4046. if (likely(PyMethod_Check(__pyx_t_2))) {
  4047. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4048. if (likely(__pyx_t_3)) {
  4049. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4050. __Pyx_INCREF(__pyx_t_3);
  4051. __Pyx_INCREF(function);
  4052. __Pyx_DECREF_SET(__pyx_t_2, function);
  4053. __pyx_t_4 = 1;
  4054. }
  4055. }
  4056. #endif
  4057. {
  4058. PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
  4059. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
  4060. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4061. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 37, __pyx_L1_error)
  4062. __Pyx_GOTREF(__pyx_t_1);
  4063. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4064. }
  4065. __pyx_v_p0 = __pyx_t_1;
  4066. __pyx_t_1 = 0;
  4067. /* "fontTools/pens/momentsPen.py":38
  4068. * def _endPath(self):
  4069. * p0 = self._getCurrentPoint()
  4070. * if p0 != self.__startPoint: # <<<<<<<<<<<<<<
  4071. * raise OpenContourError("Glyph statistics not defined on open contours.")
  4072. *
  4073. */
  4074. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_MomentsPen__startPoint); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 38, __pyx_L1_error)
  4075. __Pyx_GOTREF(__pyx_t_1);
  4076. __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, 38, __pyx_L1_error)
  4077. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4078. __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 38, __pyx_L1_error)
  4079. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4080. if (unlikely(__pyx_t_5)) {
  4081. /* "fontTools/pens/momentsPen.py":39
  4082. * p0 = self._getCurrentPoint()
  4083. * if p0 != self.__startPoint:
  4084. * raise OpenContourError("Glyph statistics not defined on open contours.") # <<<<<<<<<<<<<<
  4085. *
  4086. * @cython.locals(r0=cython.double)
  4087. */
  4088. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_OpenContourError); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 39, __pyx_L1_error)
  4089. __Pyx_GOTREF(__pyx_t_1);
  4090. __pyx_t_3 = NULL;
  4091. __pyx_t_4 = 0;
  4092. #if CYTHON_UNPACK_METHODS
  4093. if (unlikely(PyMethod_Check(__pyx_t_1))) {
  4094. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  4095. if (likely(__pyx_t_3)) {
  4096. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  4097. __Pyx_INCREF(__pyx_t_3);
  4098. __Pyx_INCREF(function);
  4099. __Pyx_DECREF_SET(__pyx_t_1, function);
  4100. __pyx_t_4 = 1;
  4101. }
  4102. }
  4103. #endif
  4104. {
  4105. PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_kp_u_Glyph_statistics_not_defined_on};
  4106. __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
  4107. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4108. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 39, __pyx_L1_error)
  4109. __Pyx_GOTREF(__pyx_t_2);
  4110. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4111. }
  4112. __Pyx_Raise(__pyx_t_2, 0, 0, 0);
  4113. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4114. __PYX_ERR(0, 39, __pyx_L1_error)
  4115. /* "fontTools/pens/momentsPen.py":38
  4116. * def _endPath(self):
  4117. * p0 = self._getCurrentPoint()
  4118. * if p0 != self.__startPoint: # <<<<<<<<<<<<<<
  4119. * raise OpenContourError("Glyph statistics not defined on open contours.")
  4120. *
  4121. */
  4122. }
  4123. /* "fontTools/pens/momentsPen.py":36
  4124. * self._lineTo(self.__startPoint)
  4125. *
  4126. * def _endPath(self): # <<<<<<<<<<<<<<
  4127. * p0 = self._getCurrentPoint()
  4128. * if p0 != self.__startPoint:
  4129. */
  4130. /* function exit code */
  4131. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4132. goto __pyx_L0;
  4133. __pyx_L1_error:;
  4134. __Pyx_XDECREF(__pyx_t_1);
  4135. __Pyx_XDECREF(__pyx_t_2);
  4136. __Pyx_XDECREF(__pyx_t_3);
  4137. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._endPath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4138. __pyx_r = NULL;
  4139. __pyx_L0:;
  4140. __Pyx_XDECREF(__pyx_v_p0);
  4141. __Pyx_XGIVEREF(__pyx_r);
  4142. __Pyx_RefNannyFinishContext();
  4143. return __pyx_r;
  4144. }
  4145. /* "fontTools/pens/momentsPen.py":41
  4146. * raise OpenContourError("Glyph statistics not defined on open contours.")
  4147. *
  4148. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  4149. * @cython.locals(r1=cython.double)
  4150. * @cython.locals(r2=cython.double)
  4151. */
  4152. /* Python wrapper */
  4153. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo(PyObject *__pyx_self,
  4154. #if CYTHON_METH_FASTCALL
  4155. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4156. #else
  4157. PyObject *__pyx_args, PyObject *__pyx_kwds
  4158. #endif
  4159. ); /*proto*/
  4160. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo, "MomentsPen._lineTo(self, p1)");
  4161. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo = {"_lineTo", (PyCFunction)(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};
  4162. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo(PyObject *__pyx_self,
  4163. #if CYTHON_METH_FASTCALL
  4164. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4165. #else
  4166. PyObject *__pyx_args, PyObject *__pyx_kwds
  4167. #endif
  4168. ) {
  4169. PyObject *__pyx_v_self = 0;
  4170. PyObject *__pyx_v_p1 = 0;
  4171. #if !CYTHON_METH_FASTCALL
  4172. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  4173. #endif
  4174. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  4175. PyObject* values[2] = {0,0};
  4176. int __pyx_lineno = 0;
  4177. const char *__pyx_filename = NULL;
  4178. int __pyx_clineno = 0;
  4179. PyObject *__pyx_r = 0;
  4180. __Pyx_RefNannyDeclarations
  4181. __Pyx_RefNannySetupContext("_lineTo (wrapper)", 0);
  4182. #if !CYTHON_METH_FASTCALL
  4183. #if CYTHON_ASSUME_SAFE_MACROS
  4184. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  4185. #else
  4186. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  4187. #endif
  4188. #endif
  4189. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  4190. {
  4191. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p1,0};
  4192. if (__pyx_kwds) {
  4193. Py_ssize_t kw_args;
  4194. switch (__pyx_nargs) {
  4195. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  4196. CYTHON_FALLTHROUGH;
  4197. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  4198. CYTHON_FALLTHROUGH;
  4199. case 0: break;
  4200. default: goto __pyx_L5_argtuple_error;
  4201. }
  4202. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  4203. switch (__pyx_nargs) {
  4204. case 0:
  4205. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  4206. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  4207. kw_args--;
  4208. }
  4209. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
  4210. else goto __pyx_L5_argtuple_error;
  4211. CYTHON_FALLTHROUGH;
  4212. case 1:
  4213. if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) {
  4214. (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
  4215. kw_args--;
  4216. }
  4217. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L3_error)
  4218. else {
  4219. __Pyx_RaiseArgtupleInvalid("_lineTo", 1, 2, 2, 1); __PYX_ERR(0, 41, __pyx_L3_error)
  4220. }
  4221. }
  4222. if (unlikely(kw_args > 0)) {
  4223. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  4224. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_lineTo") < 0)) __PYX_ERR(0, 41, __pyx_L3_error)
  4225. }
  4226. } else if (unlikely(__pyx_nargs != 2)) {
  4227. goto __pyx_L5_argtuple_error;
  4228. } else {
  4229. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  4230. values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  4231. }
  4232. __pyx_v_self = values[0];
  4233. __pyx_v_p1 = values[1];
  4234. }
  4235. goto __pyx_L6_skip;
  4236. __pyx_L5_argtuple_error:;
  4237. __Pyx_RaiseArgtupleInvalid("_lineTo", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 41, __pyx_L3_error)
  4238. __pyx_L6_skip:;
  4239. goto __pyx_L4_argument_unpacking_done;
  4240. __pyx_L3_error:;
  4241. {
  4242. Py_ssize_t __pyx_temp;
  4243. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4244. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4245. }
  4246. }
  4247. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._lineTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4248. __Pyx_RefNannyFinishContext();
  4249. return NULL;
  4250. __pyx_L4_argument_unpacking_done:;
  4251. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(__pyx_self, __pyx_v_self, __pyx_v_p1);
  4252. /* function exit code */
  4253. {
  4254. Py_ssize_t __pyx_temp;
  4255. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4256. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4257. }
  4258. }
  4259. __Pyx_RefNannyFinishContext();
  4260. return __pyx_r;
  4261. }
  4262. static PyObject *__pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_8_lineTo(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_p1) {
  4263. double __pyx_v_x1;
  4264. double __pyx_v_y1;
  4265. double __pyx_v_x0;
  4266. double __pyx_v_y0;
  4267. double __pyx_v_r12;
  4268. double __pyx_v_r11;
  4269. double __pyx_v_r10;
  4270. double __pyx_v_r9;
  4271. double __pyx_v_r8;
  4272. double __pyx_v_r7;
  4273. double __pyx_v_r6;
  4274. double __pyx_v_r5;
  4275. double __pyx_v_r4;
  4276. double __pyx_v_r3;
  4277. double __pyx_v_r2;
  4278. double __pyx_v_r1;
  4279. double __pyx_v_r0;
  4280. PyObject *__pyx_r = NULL;
  4281. __Pyx_RefNannyDeclarations
  4282. PyObject *__pyx_t_1 = NULL;
  4283. PyObject *__pyx_t_2 = NULL;
  4284. PyObject *__pyx_t_3 = NULL;
  4285. int __pyx_t_4;
  4286. PyObject *__pyx_t_5 = NULL;
  4287. PyObject *(*__pyx_t_6)(PyObject *);
  4288. double __pyx_t_7;
  4289. double __pyx_t_8;
  4290. int __pyx_lineno = 0;
  4291. const char *__pyx_filename = NULL;
  4292. int __pyx_clineno = 0;
  4293. __Pyx_RefNannySetupContext("_lineTo", 1);
  4294. /* "fontTools/pens/momentsPen.py":57
  4295. * @cython.locals(x1=cython.double, y1=cython.double)
  4296. * def _lineTo(self, p1):
  4297. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  4298. * x1, y1 = p1
  4299. *
  4300. */
  4301. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCurrentPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  4302. __Pyx_GOTREF(__pyx_t_2);
  4303. __pyx_t_3 = NULL;
  4304. __pyx_t_4 = 0;
  4305. #if CYTHON_UNPACK_METHODS
  4306. if (likely(PyMethod_Check(__pyx_t_2))) {
  4307. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4308. if (likely(__pyx_t_3)) {
  4309. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4310. __Pyx_INCREF(__pyx_t_3);
  4311. __Pyx_INCREF(function);
  4312. __Pyx_DECREF_SET(__pyx_t_2, function);
  4313. __pyx_t_4 = 1;
  4314. }
  4315. }
  4316. #endif
  4317. {
  4318. PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
  4319. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
  4320. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4321. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
  4322. __Pyx_GOTREF(__pyx_t_1);
  4323. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4324. }
  4325. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  4326. PyObject* sequence = __pyx_t_1;
  4327. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4328. if (unlikely(size != 2)) {
  4329. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4330. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4331. __PYX_ERR(0, 57, __pyx_L1_error)
  4332. }
  4333. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4334. if (likely(PyTuple_CheckExact(sequence))) {
  4335. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  4336. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  4337. } else {
  4338. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  4339. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  4340. }
  4341. __Pyx_INCREF(__pyx_t_2);
  4342. __Pyx_INCREF(__pyx_t_3);
  4343. #else
  4344. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 57, __pyx_L1_error)
  4345. __Pyx_GOTREF(__pyx_t_2);
  4346. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
  4347. __Pyx_GOTREF(__pyx_t_3);
  4348. #endif
  4349. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4350. } else {
  4351. Py_ssize_t index = -1;
  4352. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 57, __pyx_L1_error)
  4353. __Pyx_GOTREF(__pyx_t_5);
  4354. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4355. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  4356. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  4357. __Pyx_GOTREF(__pyx_t_2);
  4358. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
  4359. __Pyx_GOTREF(__pyx_t_3);
  4360. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
  4361. __pyx_t_6 = NULL;
  4362. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4363. goto __pyx_L4_unpacking_done;
  4364. __pyx_L3_unpacking_failed:;
  4365. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4366. __pyx_t_6 = NULL;
  4367. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4368. __PYX_ERR(0, 57, __pyx_L1_error)
  4369. __pyx_L4_unpacking_done:;
  4370. }
  4371. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
  4372. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4373. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 57, __pyx_L1_error)
  4374. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4375. __pyx_v_x0 = __pyx_t_7;
  4376. __pyx_v_y0 = __pyx_t_8;
  4377. /* "fontTools/pens/momentsPen.py":58
  4378. * def _lineTo(self, p1):
  4379. * x0, y0 = self._getCurrentPoint()
  4380. * x1, y1 = p1 # <<<<<<<<<<<<<<
  4381. *
  4382. * r0 = x1 * y0
  4383. */
  4384. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  4385. PyObject* sequence = __pyx_v_p1;
  4386. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4387. if (unlikely(size != 2)) {
  4388. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4389. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4390. __PYX_ERR(0, 58, __pyx_L1_error)
  4391. }
  4392. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4393. if (likely(PyTuple_CheckExact(sequence))) {
  4394. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  4395. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  4396. } else {
  4397. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  4398. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  4399. }
  4400. __Pyx_INCREF(__pyx_t_1);
  4401. __Pyx_INCREF(__pyx_t_3);
  4402. #else
  4403. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
  4404. __Pyx_GOTREF(__pyx_t_1);
  4405. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
  4406. __Pyx_GOTREF(__pyx_t_3);
  4407. #endif
  4408. } else {
  4409. Py_ssize_t index = -1;
  4410. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 58, __pyx_L1_error)
  4411. __Pyx_GOTREF(__pyx_t_2);
  4412. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  4413. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  4414. __Pyx_GOTREF(__pyx_t_1);
  4415. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
  4416. __Pyx_GOTREF(__pyx_t_3);
  4417. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 58, __pyx_L1_error)
  4418. __pyx_t_6 = NULL;
  4419. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4420. goto __pyx_L6_unpacking_done;
  4421. __pyx_L5_unpacking_failed:;
  4422. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4423. __pyx_t_6 = NULL;
  4424. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4425. __PYX_ERR(0, 58, __pyx_L1_error)
  4426. __pyx_L6_unpacking_done:;
  4427. }
  4428. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
  4429. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4430. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 58, __pyx_L1_error)
  4431. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4432. __pyx_v_x1 = __pyx_t_8;
  4433. __pyx_v_y1 = __pyx_t_7;
  4434. /* "fontTools/pens/momentsPen.py":60
  4435. * x1, y1 = p1
  4436. *
  4437. * r0 = x1 * y0 # <<<<<<<<<<<<<<
  4438. * r1 = x1 * y1
  4439. * r2 = x1**2
  4440. */
  4441. __pyx_v_r0 = (__pyx_v_x1 * __pyx_v_y0);
  4442. /* "fontTools/pens/momentsPen.py":61
  4443. *
  4444. * r0 = x1 * y0
  4445. * r1 = x1 * y1 # <<<<<<<<<<<<<<
  4446. * r2 = x1**2
  4447. * r3 = r2 * y1
  4448. */
  4449. __pyx_v_r1 = (__pyx_v_x1 * __pyx_v_y1);
  4450. /* "fontTools/pens/momentsPen.py":62
  4451. * r0 = x1 * y0
  4452. * r1 = x1 * y1
  4453. * r2 = x1**2 # <<<<<<<<<<<<<<
  4454. * r3 = r2 * y1
  4455. * r4 = y0 - y1
  4456. */
  4457. __pyx_v_r2 = pow(__pyx_v_x1, 2.0);
  4458. /* "fontTools/pens/momentsPen.py":63
  4459. * r1 = x1 * y1
  4460. * r2 = x1**2
  4461. * r3 = r2 * y1 # <<<<<<<<<<<<<<
  4462. * r4 = y0 - y1
  4463. * r5 = r4 * x0
  4464. */
  4465. __pyx_v_r3 = (__pyx_v_r2 * __pyx_v_y1);
  4466. /* "fontTools/pens/momentsPen.py":64
  4467. * r2 = x1**2
  4468. * r3 = r2 * y1
  4469. * r4 = y0 - y1 # <<<<<<<<<<<<<<
  4470. * r5 = r4 * x0
  4471. * r6 = x0**2
  4472. */
  4473. __pyx_v_r4 = (__pyx_v_y0 - __pyx_v_y1);
  4474. /* "fontTools/pens/momentsPen.py":65
  4475. * r3 = r2 * y1
  4476. * r4 = y0 - y1
  4477. * r5 = r4 * x0 # <<<<<<<<<<<<<<
  4478. * r6 = x0**2
  4479. * r7 = 2 * y0
  4480. */
  4481. __pyx_v_r5 = (__pyx_v_r4 * __pyx_v_x0);
  4482. /* "fontTools/pens/momentsPen.py":66
  4483. * r4 = y0 - y1
  4484. * r5 = r4 * x0
  4485. * r6 = x0**2 # <<<<<<<<<<<<<<
  4486. * r7 = 2 * y0
  4487. * r8 = y0**2
  4488. */
  4489. __pyx_v_r6 = pow(__pyx_v_x0, 2.0);
  4490. /* "fontTools/pens/momentsPen.py":67
  4491. * r5 = r4 * x0
  4492. * r6 = x0**2
  4493. * r7 = 2 * y0 # <<<<<<<<<<<<<<
  4494. * r8 = y0**2
  4495. * r9 = y1**2
  4496. */
  4497. __pyx_v_r7 = (2.0 * __pyx_v_y0);
  4498. /* "fontTools/pens/momentsPen.py":68
  4499. * r6 = x0**2
  4500. * r7 = 2 * y0
  4501. * r8 = y0**2 # <<<<<<<<<<<<<<
  4502. * r9 = y1**2
  4503. * r10 = x1**3
  4504. */
  4505. __pyx_v_r8 = pow(__pyx_v_y0, 2.0);
  4506. /* "fontTools/pens/momentsPen.py":69
  4507. * r7 = 2 * y0
  4508. * r8 = y0**2
  4509. * r9 = y1**2 # <<<<<<<<<<<<<<
  4510. * r10 = x1**3
  4511. * r11 = y0**3
  4512. */
  4513. __pyx_v_r9 = pow(__pyx_v_y1, 2.0);
  4514. /* "fontTools/pens/momentsPen.py":70
  4515. * r8 = y0**2
  4516. * r9 = y1**2
  4517. * r10 = x1**3 # <<<<<<<<<<<<<<
  4518. * r11 = y0**3
  4519. * r12 = y1**3
  4520. */
  4521. __pyx_v_r10 = pow(__pyx_v_x1, 3.0);
  4522. /* "fontTools/pens/momentsPen.py":71
  4523. * r9 = y1**2
  4524. * r10 = x1**3
  4525. * r11 = y0**3 # <<<<<<<<<<<<<<
  4526. * r12 = y1**3
  4527. *
  4528. */
  4529. __pyx_v_r11 = pow(__pyx_v_y0, 3.0);
  4530. /* "fontTools/pens/momentsPen.py":72
  4531. * r10 = x1**3
  4532. * r11 = y0**3
  4533. * r12 = y1**3 # <<<<<<<<<<<<<<
  4534. *
  4535. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  4536. */
  4537. __pyx_v_r12 = pow(__pyx_v_y1, 3.0);
  4538. /* "fontTools/pens/momentsPen.py":74
  4539. * r12 = y1**3
  4540. *
  4541. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2 # <<<<<<<<<<<<<<
  4542. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  4543. * self.momentY += (
  4544. */
  4545. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_area); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 74, __pyx_L1_error)
  4546. __Pyx_GOTREF(__pyx_t_3);
  4547. __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, 74, __pyx_L1_error)
  4548. __Pyx_GOTREF(__pyx_t_1);
  4549. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 74, __pyx_L1_error)
  4550. __Pyx_GOTREF(__pyx_t_2);
  4551. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4552. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4553. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_area, __pyx_t_2) < 0) __PYX_ERR(0, 74, __pyx_L1_error)
  4554. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4555. /* "fontTools/pens/momentsPen.py":75
  4556. *
  4557. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  4558. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6 # <<<<<<<<<<<<<<
  4559. * self.momentY += (
  4560. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  4561. */
  4562. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 75, __pyx_L1_error)
  4563. __Pyx_GOTREF(__pyx_t_2);
  4564. __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, 75, __pyx_L1_error)
  4565. __Pyx_GOTREF(__pyx_t_1);
  4566. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 75, __pyx_L1_error)
  4567. __Pyx_GOTREF(__pyx_t_3);
  4568. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4569. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4570. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentX, __pyx_t_3) < 0) __PYX_ERR(0, 75, __pyx_L1_error)
  4571. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4572. /* "fontTools/pens/momentsPen.py":76
  4573. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  4574. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  4575. * self.momentY += ( # <<<<<<<<<<<<<<
  4576. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  4577. * )
  4578. */
  4579. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 76, __pyx_L1_error)
  4580. __Pyx_GOTREF(__pyx_t_3);
  4581. /* "fontTools/pens/momentsPen.py":77
  4582. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  4583. * self.momentY += (
  4584. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6 # <<<<<<<<<<<<<<
  4585. * )
  4586. * self.momentXX += (
  4587. */
  4588. __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, 77, __pyx_L1_error)
  4589. __Pyx_GOTREF(__pyx_t_1);
  4590. /* "fontTools/pens/momentsPen.py":76
  4591. * self.area += -r0 / 2 - r1 / 2 + x0 * (y0 + y1) / 2
  4592. * self.momentX += -r2 * y0 / 6 - r3 / 3 - r5 * x1 / 6 + r6 * (r7 + y1) / 6
  4593. * self.momentY += ( # <<<<<<<<<<<<<<
  4594. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  4595. * )
  4596. */
  4597. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 76, __pyx_L1_error)
  4598. __Pyx_GOTREF(__pyx_t_2);
  4599. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4600. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4601. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentY, __pyx_t_2) < 0) __PYX_ERR(0, 76, __pyx_L1_error)
  4602. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4603. /* "fontTools/pens/momentsPen.py":79
  4604. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  4605. * )
  4606. * self.momentXX += ( # <<<<<<<<<<<<<<
  4607. * -r10 * y0 / 12
  4608. * - r10 * y1 / 4
  4609. */
  4610. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 79, __pyx_L1_error)
  4611. __Pyx_GOTREF(__pyx_t_2);
  4612. /* "fontTools/pens/momentsPen.py":84
  4613. * - r2 * r5 / 12
  4614. * - r4 * r6 * x1 / 12
  4615. * + x0**3 * (3 * y0 + y1) / 12 # <<<<<<<<<<<<<<
  4616. * )
  4617. * self.momentXY += (
  4618. */
  4619. __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, 84, __pyx_L1_error)
  4620. __Pyx_GOTREF(__pyx_t_1);
  4621. /* "fontTools/pens/momentsPen.py":79
  4622. * -r0 * y1 / 6 - r8 * x1 / 6 - r9 * x1 / 6 + x0 * (r8 + r9 + y0 * y1) / 6
  4623. * )
  4624. * self.momentXX += ( # <<<<<<<<<<<<<<
  4625. * -r10 * y0 / 12
  4626. * - r10 * y1 / 4
  4627. */
  4628. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 79, __pyx_L1_error)
  4629. __Pyx_GOTREF(__pyx_t_3);
  4630. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4631. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4632. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXX, __pyx_t_3) < 0) __PYX_ERR(0, 79, __pyx_L1_error)
  4633. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4634. /* "fontTools/pens/momentsPen.py":86
  4635. * + x0**3 * (3 * y0 + y1) / 12
  4636. * )
  4637. * self.momentXY += ( # <<<<<<<<<<<<<<
  4638. * -r2 * r8 / 24
  4639. * - r2 * r9 / 8
  4640. */
  4641. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 86, __pyx_L1_error)
  4642. __Pyx_GOTREF(__pyx_t_3);
  4643. /* "fontTools/pens/momentsPen.py":91
  4644. * - r3 * r7 / 24
  4645. * + r6 * (r7 * y1 + 3 * r8 + r9) / 24
  4646. * - x0 * x1 * (r8 - r9) / 12 # <<<<<<<<<<<<<<
  4647. * )
  4648. * self.momentYY += (
  4649. */
  4650. __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, 91, __pyx_L1_error)
  4651. __Pyx_GOTREF(__pyx_t_1);
  4652. /* "fontTools/pens/momentsPen.py":86
  4653. * + x0**3 * (3 * y0 + y1) / 12
  4654. * )
  4655. * self.momentXY += ( # <<<<<<<<<<<<<<
  4656. * -r2 * r8 / 24
  4657. * - r2 * r9 / 8
  4658. */
  4659. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 86, __pyx_L1_error)
  4660. __Pyx_GOTREF(__pyx_t_2);
  4661. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4662. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4663. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXY, __pyx_t_2) < 0) __PYX_ERR(0, 86, __pyx_L1_error)
  4664. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4665. /* "fontTools/pens/momentsPen.py":93
  4666. * - x0 * x1 * (r8 - r9) / 12
  4667. * )
  4668. * self.momentYY += ( # <<<<<<<<<<<<<<
  4669. * -r0 * r9 / 12
  4670. * - r1 * r8 / 12
  4671. */
  4672. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 93, __pyx_L1_error)
  4673. __Pyx_GOTREF(__pyx_t_2);
  4674. /* "fontTools/pens/momentsPen.py":98
  4675. * - r11 * x1 / 12
  4676. * - r12 * x1 / 12
  4677. * + x0 * (r11 + r12 + r8 * y1 + r9 * y0) / 12 # <<<<<<<<<<<<<<
  4678. * )
  4679. *
  4680. */
  4681. __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, 98, __pyx_L1_error)
  4682. __Pyx_GOTREF(__pyx_t_1);
  4683. /* "fontTools/pens/momentsPen.py":93
  4684. * - x0 * x1 * (r8 - r9) / 12
  4685. * )
  4686. * self.momentYY += ( # <<<<<<<<<<<<<<
  4687. * -r0 * r9 / 12
  4688. * - r1 * r8 / 12
  4689. */
  4690. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 93, __pyx_L1_error)
  4691. __Pyx_GOTREF(__pyx_t_3);
  4692. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4693. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4694. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentYY, __pyx_t_3) < 0) __PYX_ERR(0, 93, __pyx_L1_error)
  4695. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  4696. /* "fontTools/pens/momentsPen.py":41
  4697. * raise OpenContourError("Glyph statistics not defined on open contours.")
  4698. *
  4699. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  4700. * @cython.locals(r1=cython.double)
  4701. * @cython.locals(r2=cython.double)
  4702. */
  4703. /* function exit code */
  4704. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4705. goto __pyx_L0;
  4706. __pyx_L1_error:;
  4707. __Pyx_XDECREF(__pyx_t_1);
  4708. __Pyx_XDECREF(__pyx_t_2);
  4709. __Pyx_XDECREF(__pyx_t_3);
  4710. __Pyx_XDECREF(__pyx_t_5);
  4711. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._lineTo", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4712. __pyx_r = NULL;
  4713. __pyx_L0:;
  4714. __Pyx_XGIVEREF(__pyx_r);
  4715. __Pyx_RefNannyFinishContext();
  4716. return __pyx_r;
  4717. }
  4718. /* "fontTools/pens/momentsPen.py":101
  4719. * )
  4720. *
  4721. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  4722. * @cython.locals(r1=cython.double)
  4723. * @cython.locals(r2=cython.double)
  4724. */
  4725. /* Python wrapper */
  4726. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne(PyObject *__pyx_self,
  4727. #if CYTHON_METH_FASTCALL
  4728. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4729. #else
  4730. PyObject *__pyx_args, PyObject *__pyx_kwds
  4731. #endif
  4732. ); /*proto*/
  4733. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne, "MomentsPen._qCurveToOne(self, p1, p2)");
  4734. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne = {"_qCurveToOne", (PyCFunction)(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};
  4735. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne(PyObject *__pyx_self,
  4736. #if CYTHON_METH_FASTCALL
  4737. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  4738. #else
  4739. PyObject *__pyx_args, PyObject *__pyx_kwds
  4740. #endif
  4741. ) {
  4742. PyObject *__pyx_v_self = 0;
  4743. PyObject *__pyx_v_p1 = 0;
  4744. PyObject *__pyx_v_p2 = 0;
  4745. #if !CYTHON_METH_FASTCALL
  4746. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  4747. #endif
  4748. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  4749. PyObject* values[3] = {0,0,0};
  4750. int __pyx_lineno = 0;
  4751. const char *__pyx_filename = NULL;
  4752. int __pyx_clineno = 0;
  4753. PyObject *__pyx_r = 0;
  4754. __Pyx_RefNannyDeclarations
  4755. __Pyx_RefNannySetupContext("_qCurveToOne (wrapper)", 0);
  4756. #if !CYTHON_METH_FASTCALL
  4757. #if CYTHON_ASSUME_SAFE_MACROS
  4758. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  4759. #else
  4760. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  4761. #endif
  4762. #endif
  4763. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  4764. {
  4765. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p1,&__pyx_n_s_p2,0};
  4766. if (__pyx_kwds) {
  4767. Py_ssize_t kw_args;
  4768. switch (__pyx_nargs) {
  4769. case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
  4770. CYTHON_FALLTHROUGH;
  4771. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  4772. CYTHON_FALLTHROUGH;
  4773. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  4774. CYTHON_FALLTHROUGH;
  4775. case 0: break;
  4776. default: goto __pyx_L5_argtuple_error;
  4777. }
  4778. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  4779. switch (__pyx_nargs) {
  4780. case 0:
  4781. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  4782. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  4783. kw_args--;
  4784. }
  4785. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error)
  4786. else goto __pyx_L5_argtuple_error;
  4787. CYTHON_FALLTHROUGH;
  4788. case 1:
  4789. if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) {
  4790. (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
  4791. kw_args--;
  4792. }
  4793. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error)
  4794. else {
  4795. __Pyx_RaiseArgtupleInvalid("_qCurveToOne", 1, 3, 3, 1); __PYX_ERR(0, 101, __pyx_L3_error)
  4796. }
  4797. CYTHON_FALLTHROUGH;
  4798. case 2:
  4799. if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) {
  4800. (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
  4801. kw_args--;
  4802. }
  4803. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L3_error)
  4804. else {
  4805. __Pyx_RaiseArgtupleInvalid("_qCurveToOne", 1, 3, 3, 2); __PYX_ERR(0, 101, __pyx_L3_error)
  4806. }
  4807. }
  4808. if (unlikely(kw_args > 0)) {
  4809. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  4810. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_qCurveToOne") < 0)) __PYX_ERR(0, 101, __pyx_L3_error)
  4811. }
  4812. } else if (unlikely(__pyx_nargs != 3)) {
  4813. goto __pyx_L5_argtuple_error;
  4814. } else {
  4815. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  4816. values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  4817. values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
  4818. }
  4819. __pyx_v_self = values[0];
  4820. __pyx_v_p1 = values[1];
  4821. __pyx_v_p2 = values[2];
  4822. }
  4823. goto __pyx_L6_skip;
  4824. __pyx_L5_argtuple_error:;
  4825. __Pyx_RaiseArgtupleInvalid("_qCurveToOne", 1, 3, 3, __pyx_nargs); __PYX_ERR(0, 101, __pyx_L3_error)
  4826. __pyx_L6_skip:;
  4827. goto __pyx_L4_argument_unpacking_done;
  4828. __pyx_L3_error:;
  4829. {
  4830. Py_ssize_t __pyx_temp;
  4831. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4832. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4833. }
  4834. }
  4835. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._qCurveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4836. __Pyx_RefNannyFinishContext();
  4837. return NULL;
  4838. __pyx_L4_argument_unpacking_done:;
  4839. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_10_qCurveToOne(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2);
  4840. /* function exit code */
  4841. {
  4842. Py_ssize_t __pyx_temp;
  4843. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  4844. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  4845. }
  4846. }
  4847. __Pyx_RefNannyFinishContext();
  4848. return __pyx_r;
  4849. }
  4850. 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) {
  4851. double __pyx_v_x2;
  4852. double __pyx_v_y2;
  4853. double __pyx_v_x1;
  4854. double __pyx_v_y1;
  4855. double __pyx_v_x0;
  4856. double __pyx_v_y0;
  4857. double __pyx_v_r53;
  4858. double __pyx_v_r52;
  4859. double __pyx_v_r51;
  4860. double __pyx_v_r50;
  4861. double __pyx_v_r49;
  4862. double __pyx_v_r48;
  4863. double __pyx_v_r47;
  4864. double __pyx_v_r46;
  4865. double __pyx_v_r45;
  4866. double __pyx_v_r44;
  4867. double __pyx_v_r43;
  4868. double __pyx_v_r42;
  4869. double __pyx_v_r41;
  4870. double __pyx_v_r40;
  4871. double __pyx_v_r39;
  4872. double __pyx_v_r38;
  4873. double __pyx_v_r37;
  4874. double __pyx_v_r36;
  4875. double __pyx_v_r35;
  4876. double __pyx_v_r34;
  4877. double __pyx_v_r33;
  4878. double __pyx_v_r32;
  4879. double __pyx_v_r31;
  4880. double __pyx_v_r30;
  4881. double __pyx_v_r29;
  4882. double __pyx_v_r28;
  4883. double __pyx_v_r27;
  4884. double __pyx_v_r26;
  4885. double __pyx_v_r25;
  4886. double __pyx_v_r24;
  4887. double __pyx_v_r23;
  4888. double __pyx_v_r22;
  4889. double __pyx_v_r21;
  4890. double __pyx_v_r20;
  4891. double __pyx_v_r19;
  4892. double __pyx_v_r18;
  4893. double __pyx_v_r17;
  4894. double __pyx_v_r16;
  4895. double __pyx_v_r15;
  4896. double __pyx_v_r14;
  4897. double __pyx_v_r13;
  4898. double __pyx_v_r12;
  4899. double __pyx_v_r11;
  4900. double __pyx_v_r10;
  4901. double __pyx_v_r9;
  4902. double __pyx_v_r8;
  4903. double __pyx_v_r7;
  4904. double __pyx_v_r6;
  4905. double __pyx_v_r5;
  4906. double __pyx_v_r4;
  4907. double __pyx_v_r3;
  4908. double __pyx_v_r2;
  4909. double __pyx_v_r1;
  4910. double __pyx_v_r0;
  4911. PyObject *__pyx_r = NULL;
  4912. __Pyx_RefNannyDeclarations
  4913. PyObject *__pyx_t_1 = NULL;
  4914. PyObject *__pyx_t_2 = NULL;
  4915. PyObject *__pyx_t_3 = NULL;
  4916. int __pyx_t_4;
  4917. PyObject *__pyx_t_5 = NULL;
  4918. PyObject *(*__pyx_t_6)(PyObject *);
  4919. double __pyx_t_7;
  4920. double __pyx_t_8;
  4921. int __pyx_lineno = 0;
  4922. const char *__pyx_filename = NULL;
  4923. int __pyx_clineno = 0;
  4924. __Pyx_RefNannySetupContext("_qCurveToOne", 1);
  4925. /* "fontTools/pens/momentsPen.py":159
  4926. * @cython.locals(x2=cython.double, y2=cython.double)
  4927. * def _qCurveToOne(self, p1, p2):
  4928. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  4929. * x1, y1 = p1
  4930. * x2, y2 = p2
  4931. */
  4932. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCurrentPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  4933. __Pyx_GOTREF(__pyx_t_2);
  4934. __pyx_t_3 = NULL;
  4935. __pyx_t_4 = 0;
  4936. #if CYTHON_UNPACK_METHODS
  4937. if (likely(PyMethod_Check(__pyx_t_2))) {
  4938. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4939. if (likely(__pyx_t_3)) {
  4940. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4941. __Pyx_INCREF(__pyx_t_3);
  4942. __Pyx_INCREF(function);
  4943. __Pyx_DECREF_SET(__pyx_t_2, function);
  4944. __pyx_t_4 = 1;
  4945. }
  4946. }
  4947. #endif
  4948. {
  4949. PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
  4950. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
  4951. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4952. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 159, __pyx_L1_error)
  4953. __Pyx_GOTREF(__pyx_t_1);
  4954. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4955. }
  4956. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  4957. PyObject* sequence = __pyx_t_1;
  4958. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  4959. if (unlikely(size != 2)) {
  4960. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  4961. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  4962. __PYX_ERR(0, 159, __pyx_L1_error)
  4963. }
  4964. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  4965. if (likely(PyTuple_CheckExact(sequence))) {
  4966. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  4967. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  4968. } else {
  4969. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  4970. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  4971. }
  4972. __Pyx_INCREF(__pyx_t_2);
  4973. __Pyx_INCREF(__pyx_t_3);
  4974. #else
  4975. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 159, __pyx_L1_error)
  4976. __Pyx_GOTREF(__pyx_t_2);
  4977. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
  4978. __Pyx_GOTREF(__pyx_t_3);
  4979. #endif
  4980. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4981. } else {
  4982. Py_ssize_t index = -1;
  4983. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 159, __pyx_L1_error)
  4984. __Pyx_GOTREF(__pyx_t_5);
  4985. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4986. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  4987. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  4988. __Pyx_GOTREF(__pyx_t_2);
  4989. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
  4990. __Pyx_GOTREF(__pyx_t_3);
  4991. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 159, __pyx_L1_error)
  4992. __pyx_t_6 = NULL;
  4993. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4994. goto __pyx_L4_unpacking_done;
  4995. __pyx_L3_unpacking_failed:;
  4996. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4997. __pyx_t_6 = NULL;
  4998. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  4999. __PYX_ERR(0, 159, __pyx_L1_error)
  5000. __pyx_L4_unpacking_done:;
  5001. }
  5002. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  5003. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5004. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
  5005. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5006. __pyx_v_x0 = __pyx_t_7;
  5007. __pyx_v_y0 = __pyx_t_8;
  5008. /* "fontTools/pens/momentsPen.py":160
  5009. * def _qCurveToOne(self, p1, p2):
  5010. * x0, y0 = self._getCurrentPoint()
  5011. * x1, y1 = p1 # <<<<<<<<<<<<<<
  5012. * x2, y2 = p2
  5013. *
  5014. */
  5015. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  5016. PyObject* sequence = __pyx_v_p1;
  5017. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5018. if (unlikely(size != 2)) {
  5019. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5020. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5021. __PYX_ERR(0, 160, __pyx_L1_error)
  5022. }
  5023. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5024. if (likely(PyTuple_CheckExact(sequence))) {
  5025. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  5026. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  5027. } else {
  5028. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  5029. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  5030. }
  5031. __Pyx_INCREF(__pyx_t_1);
  5032. __Pyx_INCREF(__pyx_t_3);
  5033. #else
  5034. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
  5035. __Pyx_GOTREF(__pyx_t_1);
  5036. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
  5037. __Pyx_GOTREF(__pyx_t_3);
  5038. #endif
  5039. } else {
  5040. Py_ssize_t index = -1;
  5041. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 160, __pyx_L1_error)
  5042. __Pyx_GOTREF(__pyx_t_2);
  5043. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  5044. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  5045. __Pyx_GOTREF(__pyx_t_1);
  5046. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
  5047. __Pyx_GOTREF(__pyx_t_3);
  5048. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 160, __pyx_L1_error)
  5049. __pyx_t_6 = NULL;
  5050. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5051. goto __pyx_L6_unpacking_done;
  5052. __pyx_L5_unpacking_failed:;
  5053. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5054. __pyx_t_6 = NULL;
  5055. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5056. __PYX_ERR(0, 160, __pyx_L1_error)
  5057. __pyx_L6_unpacking_done:;
  5058. }
  5059. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
  5060. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5061. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
  5062. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5063. __pyx_v_x1 = __pyx_t_8;
  5064. __pyx_v_y1 = __pyx_t_7;
  5065. /* "fontTools/pens/momentsPen.py":161
  5066. * x0, y0 = self._getCurrentPoint()
  5067. * x1, y1 = p1
  5068. * x2, y2 = p2 # <<<<<<<<<<<<<<
  5069. *
  5070. * r0 = 2 * y1
  5071. */
  5072. if ((likely(PyTuple_CheckExact(__pyx_v_p2))) || (PyList_CheckExact(__pyx_v_p2))) {
  5073. PyObject* sequence = __pyx_v_p2;
  5074. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  5075. if (unlikely(size != 2)) {
  5076. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  5077. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  5078. __PYX_ERR(0, 161, __pyx_L1_error)
  5079. }
  5080. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  5081. if (likely(PyTuple_CheckExact(sequence))) {
  5082. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  5083. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
  5084. } else {
  5085. __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
  5086. __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
  5087. }
  5088. __Pyx_INCREF(__pyx_t_3);
  5089. __Pyx_INCREF(__pyx_t_1);
  5090. #else
  5091. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
  5092. __Pyx_GOTREF(__pyx_t_3);
  5093. __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
  5094. __Pyx_GOTREF(__pyx_t_1);
  5095. #endif
  5096. } else {
  5097. Py_ssize_t index = -1;
  5098. __pyx_t_2 = PyObject_GetIter(__pyx_v_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 161, __pyx_L1_error)
  5099. __Pyx_GOTREF(__pyx_t_2);
  5100. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  5101. index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  5102. __Pyx_GOTREF(__pyx_t_3);
  5103. index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
  5104. __Pyx_GOTREF(__pyx_t_1);
  5105. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 161, __pyx_L1_error)
  5106. __pyx_t_6 = NULL;
  5107. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5108. goto __pyx_L8_unpacking_done;
  5109. __pyx_L7_unpacking_failed:;
  5110. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5111. __pyx_t_6 = NULL;
  5112. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  5113. __PYX_ERR(0, 161, __pyx_L1_error)
  5114. __pyx_L8_unpacking_done:;
  5115. }
  5116. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
  5117. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5118. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
  5119. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5120. __pyx_v_x2 = __pyx_t_7;
  5121. __pyx_v_y2 = __pyx_t_8;
  5122. /* "fontTools/pens/momentsPen.py":163
  5123. * x2, y2 = p2
  5124. *
  5125. * r0 = 2 * y1 # <<<<<<<<<<<<<<
  5126. * r1 = r0 * x2
  5127. * r2 = x2 * y2
  5128. */
  5129. __pyx_v_r0 = (2.0 * __pyx_v_y1);
  5130. /* "fontTools/pens/momentsPen.py":164
  5131. *
  5132. * r0 = 2 * y1
  5133. * r1 = r0 * x2 # <<<<<<<<<<<<<<
  5134. * r2 = x2 * y2
  5135. * r3 = 3 * r2
  5136. */
  5137. __pyx_v_r1 = (__pyx_v_r0 * __pyx_v_x2);
  5138. /* "fontTools/pens/momentsPen.py":165
  5139. * r0 = 2 * y1
  5140. * r1 = r0 * x2
  5141. * r2 = x2 * y2 # <<<<<<<<<<<<<<
  5142. * r3 = 3 * r2
  5143. * r4 = 2 * x1
  5144. */
  5145. __pyx_v_r2 = (__pyx_v_x2 * __pyx_v_y2);
  5146. /* "fontTools/pens/momentsPen.py":166
  5147. * r1 = r0 * x2
  5148. * r2 = x2 * y2
  5149. * r3 = 3 * r2 # <<<<<<<<<<<<<<
  5150. * r4 = 2 * x1
  5151. * r5 = 3 * y0
  5152. */
  5153. __pyx_v_r3 = (3.0 * __pyx_v_r2);
  5154. /* "fontTools/pens/momentsPen.py":167
  5155. * r2 = x2 * y2
  5156. * r3 = 3 * r2
  5157. * r4 = 2 * x1 # <<<<<<<<<<<<<<
  5158. * r5 = 3 * y0
  5159. * r6 = x1**2
  5160. */
  5161. __pyx_v_r4 = (2.0 * __pyx_v_x1);
  5162. /* "fontTools/pens/momentsPen.py":168
  5163. * r3 = 3 * r2
  5164. * r4 = 2 * x1
  5165. * r5 = 3 * y0 # <<<<<<<<<<<<<<
  5166. * r6 = x1**2
  5167. * r7 = x2**2
  5168. */
  5169. __pyx_v_r5 = (3.0 * __pyx_v_y0);
  5170. /* "fontTools/pens/momentsPen.py":169
  5171. * r4 = 2 * x1
  5172. * r5 = 3 * y0
  5173. * r6 = x1**2 # <<<<<<<<<<<<<<
  5174. * r7 = x2**2
  5175. * r8 = 4 * y1
  5176. */
  5177. __pyx_v_r6 = pow(__pyx_v_x1, 2.0);
  5178. /* "fontTools/pens/momentsPen.py":170
  5179. * r5 = 3 * y0
  5180. * r6 = x1**2
  5181. * r7 = x2**2 # <<<<<<<<<<<<<<
  5182. * r8 = 4 * y1
  5183. * r9 = 10 * y2
  5184. */
  5185. __pyx_v_r7 = pow(__pyx_v_x2, 2.0);
  5186. /* "fontTools/pens/momentsPen.py":171
  5187. * r6 = x1**2
  5188. * r7 = x2**2
  5189. * r8 = 4 * y1 # <<<<<<<<<<<<<<
  5190. * r9 = 10 * y2
  5191. * r10 = 2 * y2
  5192. */
  5193. __pyx_v_r8 = (4.0 * __pyx_v_y1);
  5194. /* "fontTools/pens/momentsPen.py":172
  5195. * r7 = x2**2
  5196. * r8 = 4 * y1
  5197. * r9 = 10 * y2 # <<<<<<<<<<<<<<
  5198. * r10 = 2 * y2
  5199. * r11 = r4 * x2
  5200. */
  5201. __pyx_v_r9 = (10.0 * __pyx_v_y2);
  5202. /* "fontTools/pens/momentsPen.py":173
  5203. * r8 = 4 * y1
  5204. * r9 = 10 * y2
  5205. * r10 = 2 * y2 # <<<<<<<<<<<<<<
  5206. * r11 = r4 * x2
  5207. * r12 = x0**2
  5208. */
  5209. __pyx_v_r10 = (2.0 * __pyx_v_y2);
  5210. /* "fontTools/pens/momentsPen.py":174
  5211. * r9 = 10 * y2
  5212. * r10 = 2 * y2
  5213. * r11 = r4 * x2 # <<<<<<<<<<<<<<
  5214. * r12 = x0**2
  5215. * r13 = 10 * y0
  5216. */
  5217. __pyx_v_r11 = (__pyx_v_r4 * __pyx_v_x2);
  5218. /* "fontTools/pens/momentsPen.py":175
  5219. * r10 = 2 * y2
  5220. * r11 = r4 * x2
  5221. * r12 = x0**2 # <<<<<<<<<<<<<<
  5222. * r13 = 10 * y0
  5223. * r14 = r4 * y2
  5224. */
  5225. __pyx_v_r12 = pow(__pyx_v_x0, 2.0);
  5226. /* "fontTools/pens/momentsPen.py":176
  5227. * r11 = r4 * x2
  5228. * r12 = x0**2
  5229. * r13 = 10 * y0 # <<<<<<<<<<<<<<
  5230. * r14 = r4 * y2
  5231. * r15 = x2 * y0
  5232. */
  5233. __pyx_v_r13 = (10.0 * __pyx_v_y0);
  5234. /* "fontTools/pens/momentsPen.py":177
  5235. * r12 = x0**2
  5236. * r13 = 10 * y0
  5237. * r14 = r4 * y2 # <<<<<<<<<<<<<<
  5238. * r15 = x2 * y0
  5239. * r16 = 4 * x1
  5240. */
  5241. __pyx_v_r14 = (__pyx_v_r4 * __pyx_v_y2);
  5242. /* "fontTools/pens/momentsPen.py":178
  5243. * r13 = 10 * y0
  5244. * r14 = r4 * y2
  5245. * r15 = x2 * y0 # <<<<<<<<<<<<<<
  5246. * r16 = 4 * x1
  5247. * r17 = r0 * x1 + r2
  5248. */
  5249. __pyx_v_r15 = (__pyx_v_x2 * __pyx_v_y0);
  5250. /* "fontTools/pens/momentsPen.py":179
  5251. * r14 = r4 * y2
  5252. * r15 = x2 * y0
  5253. * r16 = 4 * x1 # <<<<<<<<<<<<<<
  5254. * r17 = r0 * x1 + r2
  5255. * r18 = r2 * r8
  5256. */
  5257. __pyx_v_r16 = (4.0 * __pyx_v_x1);
  5258. /* "fontTools/pens/momentsPen.py":180
  5259. * r15 = x2 * y0
  5260. * r16 = 4 * x1
  5261. * r17 = r0 * x1 + r2 # <<<<<<<<<<<<<<
  5262. * r18 = r2 * r8
  5263. * r19 = y1**2
  5264. */
  5265. __pyx_v_r17 = ((__pyx_v_r0 * __pyx_v_x1) + __pyx_v_r2);
  5266. /* "fontTools/pens/momentsPen.py":181
  5267. * r16 = 4 * x1
  5268. * r17 = r0 * x1 + r2
  5269. * r18 = r2 * r8 # <<<<<<<<<<<<<<
  5270. * r19 = y1**2
  5271. * r20 = 2 * r19
  5272. */
  5273. __pyx_v_r18 = (__pyx_v_r2 * __pyx_v_r8);
  5274. /* "fontTools/pens/momentsPen.py":182
  5275. * r17 = r0 * x1 + r2
  5276. * r18 = r2 * r8
  5277. * r19 = y1**2 # <<<<<<<<<<<<<<
  5278. * r20 = 2 * r19
  5279. * r21 = y2**2
  5280. */
  5281. __pyx_v_r19 = pow(__pyx_v_y1, 2.0);
  5282. /* "fontTools/pens/momentsPen.py":183
  5283. * r18 = r2 * r8
  5284. * r19 = y1**2
  5285. * r20 = 2 * r19 # <<<<<<<<<<<<<<
  5286. * r21 = y2**2
  5287. * r22 = r21 * x2
  5288. */
  5289. __pyx_v_r20 = (2.0 * __pyx_v_r19);
  5290. /* "fontTools/pens/momentsPen.py":184
  5291. * r19 = y1**2
  5292. * r20 = 2 * r19
  5293. * r21 = y2**2 # <<<<<<<<<<<<<<
  5294. * r22 = r21 * x2
  5295. * r23 = 5 * r22
  5296. */
  5297. __pyx_v_r21 = pow(__pyx_v_y2, 2.0);
  5298. /* "fontTools/pens/momentsPen.py":185
  5299. * r20 = 2 * r19
  5300. * r21 = y2**2
  5301. * r22 = r21 * x2 # <<<<<<<<<<<<<<
  5302. * r23 = 5 * r22
  5303. * r24 = y0**2
  5304. */
  5305. __pyx_v_r22 = (__pyx_v_r21 * __pyx_v_x2);
  5306. /* "fontTools/pens/momentsPen.py":186
  5307. * r21 = y2**2
  5308. * r22 = r21 * x2
  5309. * r23 = 5 * r22 # <<<<<<<<<<<<<<
  5310. * r24 = y0**2
  5311. * r25 = y0 * y2
  5312. */
  5313. __pyx_v_r23 = (5.0 * __pyx_v_r22);
  5314. /* "fontTools/pens/momentsPen.py":187
  5315. * r22 = r21 * x2
  5316. * r23 = 5 * r22
  5317. * r24 = y0**2 # <<<<<<<<<<<<<<
  5318. * r25 = y0 * y2
  5319. * r26 = 5 * r24
  5320. */
  5321. __pyx_v_r24 = pow(__pyx_v_y0, 2.0);
  5322. /* "fontTools/pens/momentsPen.py":188
  5323. * r23 = 5 * r22
  5324. * r24 = y0**2
  5325. * r25 = y0 * y2 # <<<<<<<<<<<<<<
  5326. * r26 = 5 * r24
  5327. * r27 = x1**3
  5328. */
  5329. __pyx_v_r25 = (__pyx_v_y0 * __pyx_v_y2);
  5330. /* "fontTools/pens/momentsPen.py":189
  5331. * r24 = y0**2
  5332. * r25 = y0 * y2
  5333. * r26 = 5 * r24 # <<<<<<<<<<<<<<
  5334. * r27 = x1**3
  5335. * r28 = x2**3
  5336. */
  5337. __pyx_v_r26 = (5.0 * __pyx_v_r24);
  5338. /* "fontTools/pens/momentsPen.py":190
  5339. * r25 = y0 * y2
  5340. * r26 = 5 * r24
  5341. * r27 = x1**3 # <<<<<<<<<<<<<<
  5342. * r28 = x2**3
  5343. * r29 = 30 * y1
  5344. */
  5345. __pyx_v_r27 = pow(__pyx_v_x1, 3.0);
  5346. /* "fontTools/pens/momentsPen.py":191
  5347. * r26 = 5 * r24
  5348. * r27 = x1**3
  5349. * r28 = x2**3 # <<<<<<<<<<<<<<
  5350. * r29 = 30 * y1
  5351. * r30 = 6 * y1
  5352. */
  5353. __pyx_v_r28 = pow(__pyx_v_x2, 3.0);
  5354. /* "fontTools/pens/momentsPen.py":192
  5355. * r27 = x1**3
  5356. * r28 = x2**3
  5357. * r29 = 30 * y1 # <<<<<<<<<<<<<<
  5358. * r30 = 6 * y1
  5359. * r31 = 10 * r7 * x1
  5360. */
  5361. __pyx_v_r29 = (30.0 * __pyx_v_y1);
  5362. /* "fontTools/pens/momentsPen.py":193
  5363. * r28 = x2**3
  5364. * r29 = 30 * y1
  5365. * r30 = 6 * y1 # <<<<<<<<<<<<<<
  5366. * r31 = 10 * r7 * x1
  5367. * r32 = 5 * y2
  5368. */
  5369. __pyx_v_r30 = (6.0 * __pyx_v_y1);
  5370. /* "fontTools/pens/momentsPen.py":194
  5371. * r29 = 30 * y1
  5372. * r30 = 6 * y1
  5373. * r31 = 10 * r7 * x1 # <<<<<<<<<<<<<<
  5374. * r32 = 5 * y2
  5375. * r33 = 12 * r6
  5376. */
  5377. __pyx_v_r31 = ((10.0 * __pyx_v_r7) * __pyx_v_x1);
  5378. /* "fontTools/pens/momentsPen.py":195
  5379. * r30 = 6 * y1
  5380. * r31 = 10 * r7 * x1
  5381. * r32 = 5 * y2 # <<<<<<<<<<<<<<
  5382. * r33 = 12 * r6
  5383. * r34 = 30 * x1
  5384. */
  5385. __pyx_v_r32 = (5.0 * __pyx_v_y2);
  5386. /* "fontTools/pens/momentsPen.py":196
  5387. * r31 = 10 * r7 * x1
  5388. * r32 = 5 * y2
  5389. * r33 = 12 * r6 # <<<<<<<<<<<<<<
  5390. * r34 = 30 * x1
  5391. * r35 = x1 * y1
  5392. */
  5393. __pyx_v_r33 = (12.0 * __pyx_v_r6);
  5394. /* "fontTools/pens/momentsPen.py":197
  5395. * r32 = 5 * y2
  5396. * r33 = 12 * r6
  5397. * r34 = 30 * x1 # <<<<<<<<<<<<<<
  5398. * r35 = x1 * y1
  5399. * r36 = r3 + 20 * r35
  5400. */
  5401. __pyx_v_r34 = (30.0 * __pyx_v_x1);
  5402. /* "fontTools/pens/momentsPen.py":198
  5403. * r33 = 12 * r6
  5404. * r34 = 30 * x1
  5405. * r35 = x1 * y1 # <<<<<<<<<<<<<<
  5406. * r36 = r3 + 20 * r35
  5407. * r37 = 12 * x1
  5408. */
  5409. __pyx_v_r35 = (__pyx_v_x1 * __pyx_v_y1);
  5410. /* "fontTools/pens/momentsPen.py":199
  5411. * r34 = 30 * x1
  5412. * r35 = x1 * y1
  5413. * r36 = r3 + 20 * r35 # <<<<<<<<<<<<<<
  5414. * r37 = 12 * x1
  5415. * r38 = 20 * r6
  5416. */
  5417. __pyx_v_r36 = (__pyx_v_r3 + (20.0 * __pyx_v_r35));
  5418. /* "fontTools/pens/momentsPen.py":200
  5419. * r35 = x1 * y1
  5420. * r36 = r3 + 20 * r35
  5421. * r37 = 12 * x1 # <<<<<<<<<<<<<<
  5422. * r38 = 20 * r6
  5423. * r39 = 8 * r6 * y1
  5424. */
  5425. __pyx_v_r37 = (12.0 * __pyx_v_x1);
  5426. /* "fontTools/pens/momentsPen.py":201
  5427. * r36 = r3 + 20 * r35
  5428. * r37 = 12 * x1
  5429. * r38 = 20 * r6 # <<<<<<<<<<<<<<
  5430. * r39 = 8 * r6 * y1
  5431. * r40 = r32 * r7
  5432. */
  5433. __pyx_v_r38 = (20.0 * __pyx_v_r6);
  5434. /* "fontTools/pens/momentsPen.py":202
  5435. * r37 = 12 * x1
  5436. * r38 = 20 * r6
  5437. * r39 = 8 * r6 * y1 # <<<<<<<<<<<<<<
  5438. * r40 = r32 * r7
  5439. * r41 = 60 * y1
  5440. */
  5441. __pyx_v_r39 = ((8.0 * __pyx_v_r6) * __pyx_v_y1);
  5442. /* "fontTools/pens/momentsPen.py":203
  5443. * r38 = 20 * r6
  5444. * r39 = 8 * r6 * y1
  5445. * r40 = r32 * r7 # <<<<<<<<<<<<<<
  5446. * r41 = 60 * y1
  5447. * r42 = 20 * r19
  5448. */
  5449. __pyx_v_r40 = (__pyx_v_r32 * __pyx_v_r7);
  5450. /* "fontTools/pens/momentsPen.py":204
  5451. * r39 = 8 * r6 * y1
  5452. * r40 = r32 * r7
  5453. * r41 = 60 * y1 # <<<<<<<<<<<<<<
  5454. * r42 = 20 * r19
  5455. * r43 = 4 * r19
  5456. */
  5457. __pyx_v_r41 = (60.0 * __pyx_v_y1);
  5458. /* "fontTools/pens/momentsPen.py":205
  5459. * r40 = r32 * r7
  5460. * r41 = 60 * y1
  5461. * r42 = 20 * r19 # <<<<<<<<<<<<<<
  5462. * r43 = 4 * r19
  5463. * r44 = 15 * r21
  5464. */
  5465. __pyx_v_r42 = (20.0 * __pyx_v_r19);
  5466. /* "fontTools/pens/momentsPen.py":206
  5467. * r41 = 60 * y1
  5468. * r42 = 20 * r19
  5469. * r43 = 4 * r19 # <<<<<<<<<<<<<<
  5470. * r44 = 15 * r21
  5471. * r45 = 12 * x2
  5472. */
  5473. __pyx_v_r43 = (4.0 * __pyx_v_r19);
  5474. /* "fontTools/pens/momentsPen.py":207
  5475. * r42 = 20 * r19
  5476. * r43 = 4 * r19
  5477. * r44 = 15 * r21 # <<<<<<<<<<<<<<
  5478. * r45 = 12 * x2
  5479. * r46 = 12 * y2
  5480. */
  5481. __pyx_v_r44 = (15.0 * __pyx_v_r21);
  5482. /* "fontTools/pens/momentsPen.py":208
  5483. * r43 = 4 * r19
  5484. * r44 = 15 * r21
  5485. * r45 = 12 * x2 # <<<<<<<<<<<<<<
  5486. * r46 = 12 * y2
  5487. * r47 = 6 * x1
  5488. */
  5489. __pyx_v_r45 = (12.0 * __pyx_v_x2);
  5490. /* "fontTools/pens/momentsPen.py":209
  5491. * r44 = 15 * r21
  5492. * r45 = 12 * x2
  5493. * r46 = 12 * y2 # <<<<<<<<<<<<<<
  5494. * r47 = 6 * x1
  5495. * r48 = 8 * r19 * x1 + r23
  5496. */
  5497. __pyx_v_r46 = (12.0 * __pyx_v_y2);
  5498. /* "fontTools/pens/momentsPen.py":210
  5499. * r45 = 12 * x2
  5500. * r46 = 12 * y2
  5501. * r47 = 6 * x1 # <<<<<<<<<<<<<<
  5502. * r48 = 8 * r19 * x1 + r23
  5503. * r49 = 8 * y1**3
  5504. */
  5505. __pyx_v_r47 = (6.0 * __pyx_v_x1);
  5506. /* "fontTools/pens/momentsPen.py":211
  5507. * r46 = 12 * y2
  5508. * r47 = 6 * x1
  5509. * r48 = 8 * r19 * x1 + r23 # <<<<<<<<<<<<<<
  5510. * r49 = 8 * y1**3
  5511. * r50 = y2**3
  5512. */
  5513. __pyx_v_r48 = (((8.0 * __pyx_v_r19) * __pyx_v_x1) + __pyx_v_r23);
  5514. /* "fontTools/pens/momentsPen.py":212
  5515. * r47 = 6 * x1
  5516. * r48 = 8 * r19 * x1 + r23
  5517. * r49 = 8 * y1**3 # <<<<<<<<<<<<<<
  5518. * r50 = y2**3
  5519. * r51 = y0**3
  5520. */
  5521. __pyx_v_r49 = (8.0 * pow(__pyx_v_y1, 3.0));
  5522. /* "fontTools/pens/momentsPen.py":213
  5523. * r48 = 8 * r19 * x1 + r23
  5524. * r49 = 8 * y1**3
  5525. * r50 = y2**3 # <<<<<<<<<<<<<<
  5526. * r51 = y0**3
  5527. * r52 = 10 * y1
  5528. */
  5529. __pyx_v_r50 = pow(__pyx_v_y2, 3.0);
  5530. /* "fontTools/pens/momentsPen.py":214
  5531. * r49 = 8 * y1**3
  5532. * r50 = y2**3
  5533. * r51 = y0**3 # <<<<<<<<<<<<<<
  5534. * r52 = 10 * y1
  5535. * r53 = 12 * y1
  5536. */
  5537. __pyx_v_r51 = pow(__pyx_v_y0, 3.0);
  5538. /* "fontTools/pens/momentsPen.py":215
  5539. * r50 = y2**3
  5540. * r51 = y0**3
  5541. * r52 = 10 * y1 # <<<<<<<<<<<<<<
  5542. * r53 = 12 * y1
  5543. *
  5544. */
  5545. __pyx_v_r52 = (10.0 * __pyx_v_y1);
  5546. /* "fontTools/pens/momentsPen.py":216
  5547. * r51 = y0**3
  5548. * r52 = 10 * y1
  5549. * r53 = 12 * y1 # <<<<<<<<<<<<<<
  5550. *
  5551. * self.area += (
  5552. */
  5553. __pyx_v_r53 = (12.0 * __pyx_v_y1);
  5554. /* "fontTools/pens/momentsPen.py":218
  5555. * r53 = 12 * y1
  5556. *
  5557. * self.area += ( # <<<<<<<<<<<<<<
  5558. * -r1 / 6
  5559. * - r3 / 6
  5560. */
  5561. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_area); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 218, __pyx_L1_error)
  5562. __Pyx_GOTREF(__pyx_t_1);
  5563. /* "fontTools/pens/momentsPen.py":223
  5564. * + x0 * (r0 + r5 + y2) / 6
  5565. * + x1 * y2 / 3
  5566. * - y0 * (r4 + x2) / 6 # <<<<<<<<<<<<<<
  5567. * )
  5568. * self.momentX += (
  5569. */
  5570. __pyx_t_3 = 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_3)) __PYX_ERR(0, 223, __pyx_L1_error)
  5571. __Pyx_GOTREF(__pyx_t_3);
  5572. /* "fontTools/pens/momentsPen.py":218
  5573. * r53 = 12 * y1
  5574. *
  5575. * self.area += ( # <<<<<<<<<<<<<<
  5576. * -r1 / 6
  5577. * - r3 / 6
  5578. */
  5579. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 218, __pyx_L1_error)
  5580. __Pyx_GOTREF(__pyx_t_2);
  5581. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5582. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5583. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_area, __pyx_t_2) < 0) __PYX_ERR(0, 218, __pyx_L1_error)
  5584. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5585. /* "fontTools/pens/momentsPen.py":225
  5586. * - y0 * (r4 + x2) / 6
  5587. * )
  5588. * self.momentX += ( # <<<<<<<<<<<<<<
  5589. * -r11 * (-r10 + y1) / 30
  5590. * + r12 * (r13 + r8 + y2) / 30
  5591. */
  5592. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
  5593. __Pyx_GOTREF(__pyx_t_2);
  5594. /* "fontTools/pens/momentsPen.py":232
  5595. * - r7 * r9 / 30
  5596. * + x0 * (r14 - r15 - r16 * y0 + r17) / 30
  5597. * - y0 * (r11 + 2 * r6 + r7) / 30 # <<<<<<<<<<<<<<
  5598. * )
  5599. * self.momentY += (
  5600. */
  5601. __pyx_t_3 = 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_3)) __PYX_ERR(0, 232, __pyx_L1_error)
  5602. __Pyx_GOTREF(__pyx_t_3);
  5603. /* "fontTools/pens/momentsPen.py":225
  5604. * - y0 * (r4 + x2) / 6
  5605. * )
  5606. * self.momentX += ( # <<<<<<<<<<<<<<
  5607. * -r11 * (-r10 + y1) / 30
  5608. * + r12 * (r13 + r8 + y2) / 30
  5609. */
  5610. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
  5611. __Pyx_GOTREF(__pyx_t_1);
  5612. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5613. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5614. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentX, __pyx_t_1) < 0) __PYX_ERR(0, 225, __pyx_L1_error)
  5615. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5616. /* "fontTools/pens/momentsPen.py":234
  5617. * - y0 * (r11 + 2 * r6 + r7) / 30
  5618. * )
  5619. * self.momentY += ( # <<<<<<<<<<<<<<
  5620. * -r18 / 30
  5621. * - r20 * x2 / 30
  5622. */
  5623. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  5624. __Pyx_GOTREF(__pyx_t_1);
  5625. /* "fontTools/pens/momentsPen.py":241
  5626. * + x0 * (r0 * y2 + r20 + r21 + r25 + r26 + r8 * y0) / 30
  5627. * + x1 * y2 * (r10 + y1) / 15
  5628. * - y0 * (r1 + r17) / 30 # <<<<<<<<<<<<<<
  5629. * )
  5630. * self.momentXX += (
  5631. */
  5632. __pyx_t_3 = 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_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  5633. __Pyx_GOTREF(__pyx_t_3);
  5634. /* "fontTools/pens/momentsPen.py":234
  5635. * - y0 * (r11 + 2 * r6 + r7) / 30
  5636. * )
  5637. * self.momentY += ( # <<<<<<<<<<<<<<
  5638. * -r18 / 30
  5639. * - r20 * x2 / 30
  5640. */
  5641. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 234, __pyx_L1_error)
  5642. __Pyx_GOTREF(__pyx_t_2);
  5643. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5644. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5645. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentY, __pyx_t_2) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  5646. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5647. /* "fontTools/pens/momentsPen.py":243
  5648. * - y0 * (r1 + r17) / 30
  5649. * )
  5650. * self.momentXX += ( # <<<<<<<<<<<<<<
  5651. * r12 * (r1 - 5 * r15 - r34 * y0 + r36 + r9 * x1) / 420
  5652. * + 2 * r27 * y2 / 105
  5653. */
  5654. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  5655. __Pyx_GOTREF(__pyx_t_2);
  5656. /* "fontTools/pens/momentsPen.py":263
  5657. * )
  5658. * / 420
  5659. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420 # <<<<<<<<<<<<<<
  5660. * )
  5661. * self.momentXY += (
  5662. */
  5663. __pyx_t_3 = 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_3)) __PYX_ERR(0, 263, __pyx_L1_error)
  5664. __Pyx_GOTREF(__pyx_t_3);
  5665. /* "fontTools/pens/momentsPen.py":243
  5666. * - y0 * (r1 + r17) / 30
  5667. * )
  5668. * self.momentXX += ( # <<<<<<<<<<<<<<
  5669. * r12 * (r1 - 5 * r15 - r34 * y0 + r36 + r9 * x1) / 420
  5670. * + 2 * r27 * y2 / 105
  5671. */
  5672. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 243, __pyx_L1_error)
  5673. __Pyx_GOTREF(__pyx_t_1);
  5674. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5675. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5676. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXX, __pyx_t_1) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
  5677. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5678. /* "fontTools/pens/momentsPen.py":265
  5679. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420
  5680. * )
  5681. * self.momentXY += ( # <<<<<<<<<<<<<<
  5682. * r12 * (r13 * y2 + 3 * r21 + 105 * r24 + r41 * y0 + r42 + r46 * y1) / 840
  5683. * - r16 * x2 * (r43 - r44) / 840
  5684. */
  5685. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXY); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 265, __pyx_L1_error)
  5686. __Pyx_GOTREF(__pyx_t_1);
  5687. /* "fontTools/pens/momentsPen.py":285
  5688. * )
  5689. * / 420
  5690. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420 # <<<<<<<<<<<<<<
  5691. * )
  5692. * self.momentYY += (
  5693. */
  5694. __pyx_t_3 = 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_3)) __PYX_ERR(0, 285, __pyx_L1_error)
  5695. __Pyx_GOTREF(__pyx_t_3);
  5696. /* "fontTools/pens/momentsPen.py":265
  5697. * - y0 * (8 * r27 + 5 * r28 + r31 + r33 * x2) / 420
  5698. * )
  5699. * self.momentXY += ( # <<<<<<<<<<<<<<
  5700. * r12 * (r13 * y2 + 3 * r21 + 105 * r24 + r41 * y0 + r42 + r46 * y1) / 840
  5701. * - r16 * x2 * (r43 - r44) / 840
  5702. */
  5703. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  5704. __Pyx_GOTREF(__pyx_t_2);
  5705. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5706. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5707. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXY, __pyx_t_2) < 0) __PYX_ERR(0, 265, __pyx_L1_error)
  5708. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5709. /* "fontTools/pens/momentsPen.py":287
  5710. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420
  5711. * )
  5712. * self.momentYY += ( # <<<<<<<<<<<<<<
  5713. * -r2 * r42 / 420
  5714. * - r22 * r29 / 420
  5715. */
  5716. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 287, __pyx_L1_error)
  5717. __Pyx_GOTREF(__pyx_t_2);
  5718. /* "fontTools/pens/momentsPen.py":309
  5719. * / 420
  5720. * + x1 * y2 * (r43 + r44 + r9 * y1) / 210
  5721. * - y0 * (r19 * r45 + r2 * r53 - r21 * r4 + r48) / 420 # <<<<<<<<<<<<<<
  5722. * )
  5723. *
  5724. */
  5725. __pyx_t_3 = 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_3)) __PYX_ERR(0, 309, __pyx_L1_error)
  5726. __Pyx_GOTREF(__pyx_t_3);
  5727. /* "fontTools/pens/momentsPen.py":287
  5728. * - y0 * (r16 * r2 + r30 * r7 + r35 * r45 + r39 + r40) / 420
  5729. * )
  5730. * self.momentYY += ( # <<<<<<<<<<<<<<
  5731. * -r2 * r42 / 420
  5732. * - r22 * r29 / 420
  5733. */
  5734. __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
  5735. __Pyx_GOTREF(__pyx_t_1);
  5736. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  5737. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  5738. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentYY, __pyx_t_1) < 0) __PYX_ERR(0, 287, __pyx_L1_error)
  5739. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5740. /* "fontTools/pens/momentsPen.py":101
  5741. * )
  5742. *
  5743. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  5744. * @cython.locals(r1=cython.double)
  5745. * @cython.locals(r2=cython.double)
  5746. */
  5747. /* function exit code */
  5748. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5749. goto __pyx_L0;
  5750. __pyx_L1_error:;
  5751. __Pyx_XDECREF(__pyx_t_1);
  5752. __Pyx_XDECREF(__pyx_t_2);
  5753. __Pyx_XDECREF(__pyx_t_3);
  5754. __Pyx_XDECREF(__pyx_t_5);
  5755. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._qCurveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5756. __pyx_r = NULL;
  5757. __pyx_L0:;
  5758. __Pyx_XGIVEREF(__pyx_r);
  5759. __Pyx_RefNannyFinishContext();
  5760. return __pyx_r;
  5761. }
  5762. /* "fontTools/pens/momentsPen.py":312
  5763. * )
  5764. *
  5765. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  5766. * @cython.locals(r1=cython.double)
  5767. * @cython.locals(r2=cython.double)
  5768. */
  5769. /* Python wrapper */
  5770. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne(PyObject *__pyx_self,
  5771. #if CYTHON_METH_FASTCALL
  5772. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  5773. #else
  5774. PyObject *__pyx_args, PyObject *__pyx_kwds
  5775. #endif
  5776. ); /*proto*/
  5777. PyDoc_STRVAR(__pyx_doc_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne, "MomentsPen._curveToOne(self, p1, p2, p3)");
  5778. static PyMethodDef __pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne = {"_curveToOne", (PyCFunction)(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};
  5779. static PyObject *__pyx_pw_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne(PyObject *__pyx_self,
  5780. #if CYTHON_METH_FASTCALL
  5781. PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
  5782. #else
  5783. PyObject *__pyx_args, PyObject *__pyx_kwds
  5784. #endif
  5785. ) {
  5786. PyObject *__pyx_v_self = 0;
  5787. PyObject *__pyx_v_p1 = 0;
  5788. PyObject *__pyx_v_p2 = 0;
  5789. PyObject *__pyx_v_p3 = 0;
  5790. #if !CYTHON_METH_FASTCALL
  5791. CYTHON_UNUSED Py_ssize_t __pyx_nargs;
  5792. #endif
  5793. CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
  5794. PyObject* values[4] = {0,0,0,0};
  5795. int __pyx_lineno = 0;
  5796. const char *__pyx_filename = NULL;
  5797. int __pyx_clineno = 0;
  5798. PyObject *__pyx_r = 0;
  5799. __Pyx_RefNannyDeclarations
  5800. __Pyx_RefNannySetupContext("_curveToOne (wrapper)", 0);
  5801. #if !CYTHON_METH_FASTCALL
  5802. #if CYTHON_ASSUME_SAFE_MACROS
  5803. __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  5804. #else
  5805. __pyx_nargs = PyTuple_Size(__pyx_args); if (unlikely(__pyx_nargs < 0)) return NULL;
  5806. #endif
  5807. #endif
  5808. __pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  5809. {
  5810. PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_p1,&__pyx_n_s_p2,&__pyx_n_s_p3,0};
  5811. if (__pyx_kwds) {
  5812. Py_ssize_t kw_args;
  5813. switch (__pyx_nargs) {
  5814. case 4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
  5815. CYTHON_FALLTHROUGH;
  5816. case 3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
  5817. CYTHON_FALLTHROUGH;
  5818. case 2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  5819. CYTHON_FALLTHROUGH;
  5820. case 1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  5821. CYTHON_FALLTHROUGH;
  5822. case 0: break;
  5823. default: goto __pyx_L5_argtuple_error;
  5824. }
  5825. kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
  5826. switch (__pyx_nargs) {
  5827. case 0:
  5828. if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_self)) != 0)) {
  5829. (void)__Pyx_Arg_NewRef_FASTCALL(values[0]);
  5830. kw_args--;
  5831. }
  5832. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error)
  5833. else goto __pyx_L5_argtuple_error;
  5834. CYTHON_FALLTHROUGH;
  5835. case 1:
  5836. if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p1)) != 0)) {
  5837. (void)__Pyx_Arg_NewRef_FASTCALL(values[1]);
  5838. kw_args--;
  5839. }
  5840. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error)
  5841. else {
  5842. __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, 1); __PYX_ERR(0, 312, __pyx_L3_error)
  5843. }
  5844. CYTHON_FALLTHROUGH;
  5845. case 2:
  5846. if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p2)) != 0)) {
  5847. (void)__Pyx_Arg_NewRef_FASTCALL(values[2]);
  5848. kw_args--;
  5849. }
  5850. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error)
  5851. else {
  5852. __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, 2); __PYX_ERR(0, 312, __pyx_L3_error)
  5853. }
  5854. CYTHON_FALLTHROUGH;
  5855. case 3:
  5856. if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_p3)) != 0)) {
  5857. (void)__Pyx_Arg_NewRef_FASTCALL(values[3]);
  5858. kw_args--;
  5859. }
  5860. else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L3_error)
  5861. else {
  5862. __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, 3); __PYX_ERR(0, 312, __pyx_L3_error)
  5863. }
  5864. }
  5865. if (unlikely(kw_args > 0)) {
  5866. const Py_ssize_t kwd_pos_args = __pyx_nargs;
  5867. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_curveToOne") < 0)) __PYX_ERR(0, 312, __pyx_L3_error)
  5868. }
  5869. } else if (unlikely(__pyx_nargs != 4)) {
  5870. goto __pyx_L5_argtuple_error;
  5871. } else {
  5872. values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
  5873. values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
  5874. values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
  5875. values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
  5876. }
  5877. __pyx_v_self = values[0];
  5878. __pyx_v_p1 = values[1];
  5879. __pyx_v_p2 = values[2];
  5880. __pyx_v_p3 = values[3];
  5881. }
  5882. goto __pyx_L6_skip;
  5883. __pyx_L5_argtuple_error:;
  5884. __Pyx_RaiseArgtupleInvalid("_curveToOne", 1, 4, 4, __pyx_nargs); __PYX_ERR(0, 312, __pyx_L3_error)
  5885. __pyx_L6_skip:;
  5886. goto __pyx_L4_argument_unpacking_done;
  5887. __pyx_L3_error:;
  5888. {
  5889. Py_ssize_t __pyx_temp;
  5890. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  5891. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  5892. }
  5893. }
  5894. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._curveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5895. __Pyx_RefNannyFinishContext();
  5896. return NULL;
  5897. __pyx_L4_argument_unpacking_done:;
  5898. __pyx_r = __pyx_pf_9fontTools_4pens_10momentsPen_10MomentsPen_12_curveToOne(__pyx_self, __pyx_v_self, __pyx_v_p1, __pyx_v_p2, __pyx_v_p3);
  5899. /* function exit code */
  5900. {
  5901. Py_ssize_t __pyx_temp;
  5902. for (__pyx_temp=0; __pyx_temp < (Py_ssize_t)(sizeof(values)/sizeof(values[0])); ++__pyx_temp) {
  5903. __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
  5904. }
  5905. }
  5906. __Pyx_RefNannyFinishContext();
  5907. return __pyx_r;
  5908. }
  5909. 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) {
  5910. double __pyx_v_x3;
  5911. double __pyx_v_y3;
  5912. double __pyx_v_x2;
  5913. double __pyx_v_y2;
  5914. double __pyx_v_x1;
  5915. double __pyx_v_y1;
  5916. double __pyx_v_x0;
  5917. double __pyx_v_y0;
  5918. double __pyx_v_r132;
  5919. double __pyx_v_r131;
  5920. double __pyx_v_r130;
  5921. double __pyx_v_r129;
  5922. double __pyx_v_r128;
  5923. double __pyx_v_r127;
  5924. double __pyx_v_r126;
  5925. double __pyx_v_r125;
  5926. double __pyx_v_r124;
  5927. double __pyx_v_r123;
  5928. double __pyx_v_r122;
  5929. double __pyx_v_r121;
  5930. double __pyx_v_r120;
  5931. double __pyx_v_r119;
  5932. double __pyx_v_r118;
  5933. double __pyx_v_r117;
  5934. double __pyx_v_r116;
  5935. double __pyx_v_r115;
  5936. double __pyx_v_r114;
  5937. double __pyx_v_r113;
  5938. double __pyx_v_r112;
  5939. double __pyx_v_r111;
  5940. double __pyx_v_r110;
  5941. double __pyx_v_r109;
  5942. double __pyx_v_r108;
  5943. double __pyx_v_r107;
  5944. double __pyx_v_r106;
  5945. double __pyx_v_r105;
  5946. double __pyx_v_r104;
  5947. double __pyx_v_r103;
  5948. double __pyx_v_r102;
  5949. double __pyx_v_r101;
  5950. double __pyx_v_r100;
  5951. double __pyx_v_r99;
  5952. double __pyx_v_r98;
  5953. double __pyx_v_r97;
  5954. double __pyx_v_r96;
  5955. double __pyx_v_r95;
  5956. double __pyx_v_r94;
  5957. double __pyx_v_r93;
  5958. double __pyx_v_r92;
  5959. double __pyx_v_r91;
  5960. double __pyx_v_r90;
  5961. double __pyx_v_r89;
  5962. double __pyx_v_r88;
  5963. double __pyx_v_r87;
  5964. double __pyx_v_r86;
  5965. double __pyx_v_r85;
  5966. double __pyx_v_r84;
  5967. double __pyx_v_r83;
  5968. double __pyx_v_r82;
  5969. double __pyx_v_r81;
  5970. double __pyx_v_r80;
  5971. double __pyx_v_r79;
  5972. double __pyx_v_r78;
  5973. double __pyx_v_r77;
  5974. double __pyx_v_r76;
  5975. double __pyx_v_r75;
  5976. double __pyx_v_r74;
  5977. double __pyx_v_r73;
  5978. double __pyx_v_r72;
  5979. double __pyx_v_r71;
  5980. double __pyx_v_r70;
  5981. double __pyx_v_r69;
  5982. double __pyx_v_r68;
  5983. double __pyx_v_r67;
  5984. double __pyx_v_r66;
  5985. double __pyx_v_r65;
  5986. double __pyx_v_r64;
  5987. double __pyx_v_r63;
  5988. double __pyx_v_r62;
  5989. double __pyx_v_r61;
  5990. double __pyx_v_r60;
  5991. double __pyx_v_r59;
  5992. double __pyx_v_r58;
  5993. double __pyx_v_r57;
  5994. double __pyx_v_r56;
  5995. double __pyx_v_r55;
  5996. double __pyx_v_r54;
  5997. double __pyx_v_r53;
  5998. double __pyx_v_r52;
  5999. double __pyx_v_r51;
  6000. double __pyx_v_r50;
  6001. double __pyx_v_r49;
  6002. double __pyx_v_r48;
  6003. double __pyx_v_r47;
  6004. double __pyx_v_r46;
  6005. double __pyx_v_r45;
  6006. double __pyx_v_r44;
  6007. double __pyx_v_r43;
  6008. double __pyx_v_r42;
  6009. double __pyx_v_r41;
  6010. double __pyx_v_r40;
  6011. double __pyx_v_r39;
  6012. double __pyx_v_r38;
  6013. double __pyx_v_r37;
  6014. double __pyx_v_r36;
  6015. double __pyx_v_r35;
  6016. double __pyx_v_r34;
  6017. double __pyx_v_r33;
  6018. double __pyx_v_r32;
  6019. double __pyx_v_r31;
  6020. double __pyx_v_r30;
  6021. double __pyx_v_r29;
  6022. double __pyx_v_r28;
  6023. double __pyx_v_r27;
  6024. double __pyx_v_r26;
  6025. double __pyx_v_r25;
  6026. double __pyx_v_r24;
  6027. double __pyx_v_r23;
  6028. double __pyx_v_r22;
  6029. double __pyx_v_r21;
  6030. double __pyx_v_r20;
  6031. double __pyx_v_r19;
  6032. double __pyx_v_r18;
  6033. double __pyx_v_r17;
  6034. double __pyx_v_r16;
  6035. double __pyx_v_r15;
  6036. double __pyx_v_r14;
  6037. double __pyx_v_r13;
  6038. double __pyx_v_r12;
  6039. double __pyx_v_r11;
  6040. double __pyx_v_r10;
  6041. double __pyx_v_r9;
  6042. double __pyx_v_r8;
  6043. double __pyx_v_r7;
  6044. double __pyx_v_r6;
  6045. double __pyx_v_r5;
  6046. double __pyx_v_r4;
  6047. double __pyx_v_r3;
  6048. double __pyx_v_r2;
  6049. double __pyx_v_r1;
  6050. double __pyx_v_r0;
  6051. PyObject *__pyx_r = NULL;
  6052. __Pyx_RefNannyDeclarations
  6053. PyObject *__pyx_t_1 = NULL;
  6054. PyObject *__pyx_t_2 = NULL;
  6055. PyObject *__pyx_t_3 = NULL;
  6056. int __pyx_t_4;
  6057. PyObject *__pyx_t_5 = NULL;
  6058. PyObject *(*__pyx_t_6)(PyObject *);
  6059. double __pyx_t_7;
  6060. double __pyx_t_8;
  6061. int __pyx_lineno = 0;
  6062. const char *__pyx_filename = NULL;
  6063. int __pyx_clineno = 0;
  6064. __Pyx_RefNannySetupContext("_curveToOne", 1);
  6065. /* "fontTools/pens/momentsPen.py":450
  6066. * @cython.locals(x3=cython.double, y3=cython.double)
  6067. * def _curveToOne(self, p1, p2, p3):
  6068. * x0, y0 = self._getCurrentPoint() # <<<<<<<<<<<<<<
  6069. * x1, y1 = p1
  6070. * x2, y2 = p2
  6071. */
  6072. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_getCurrentPoint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
  6073. __Pyx_GOTREF(__pyx_t_2);
  6074. __pyx_t_3 = NULL;
  6075. __pyx_t_4 = 0;
  6076. #if CYTHON_UNPACK_METHODS
  6077. if (likely(PyMethod_Check(__pyx_t_2))) {
  6078. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  6079. if (likely(__pyx_t_3)) {
  6080. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  6081. __Pyx_INCREF(__pyx_t_3);
  6082. __Pyx_INCREF(function);
  6083. __Pyx_DECREF_SET(__pyx_t_2, function);
  6084. __pyx_t_4 = 1;
  6085. }
  6086. }
  6087. #endif
  6088. {
  6089. PyObject *__pyx_callargs[2] = {__pyx_t_3, NULL};
  6090. __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
  6091. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  6092. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  6093. __Pyx_GOTREF(__pyx_t_1);
  6094. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6095. }
  6096. if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
  6097. PyObject* sequence = __pyx_t_1;
  6098. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  6099. if (unlikely(size != 2)) {
  6100. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  6101. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  6102. __PYX_ERR(0, 450, __pyx_L1_error)
  6103. }
  6104. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6105. if (likely(PyTuple_CheckExact(sequence))) {
  6106. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  6107. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  6108. } else {
  6109. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  6110. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  6111. }
  6112. __Pyx_INCREF(__pyx_t_2);
  6113. __Pyx_INCREF(__pyx_t_3);
  6114. #else
  6115. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 450, __pyx_L1_error)
  6116. __Pyx_GOTREF(__pyx_t_2);
  6117. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 450, __pyx_L1_error)
  6118. __Pyx_GOTREF(__pyx_t_3);
  6119. #endif
  6120. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6121. } else {
  6122. Py_ssize_t index = -1;
  6123. __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 450, __pyx_L1_error)
  6124. __Pyx_GOTREF(__pyx_t_5);
  6125. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6126. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5);
  6127. index = 0; __pyx_t_2 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  6128. __Pyx_GOTREF(__pyx_t_2);
  6129. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
  6130. __Pyx_GOTREF(__pyx_t_3);
  6131. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
  6132. __pyx_t_6 = NULL;
  6133. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6134. goto __pyx_L4_unpacking_done;
  6135. __pyx_L3_unpacking_failed:;
  6136. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6137. __pyx_t_6 = NULL;
  6138. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  6139. __PYX_ERR(0, 450, __pyx_L1_error)
  6140. __pyx_L4_unpacking_done:;
  6141. }
  6142. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error)
  6143. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6144. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error)
  6145. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6146. __pyx_v_x0 = __pyx_t_7;
  6147. __pyx_v_y0 = __pyx_t_8;
  6148. /* "fontTools/pens/momentsPen.py":451
  6149. * def _curveToOne(self, p1, p2, p3):
  6150. * x0, y0 = self._getCurrentPoint()
  6151. * x1, y1 = p1 # <<<<<<<<<<<<<<
  6152. * x2, y2 = p2
  6153. * x3, y3 = p3
  6154. */
  6155. if ((likely(PyTuple_CheckExact(__pyx_v_p1))) || (PyList_CheckExact(__pyx_v_p1))) {
  6156. PyObject* sequence = __pyx_v_p1;
  6157. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  6158. if (unlikely(size != 2)) {
  6159. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  6160. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  6161. __PYX_ERR(0, 451, __pyx_L1_error)
  6162. }
  6163. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6164. if (likely(PyTuple_CheckExact(sequence))) {
  6165. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  6166. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  6167. } else {
  6168. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  6169. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  6170. }
  6171. __Pyx_INCREF(__pyx_t_1);
  6172. __Pyx_INCREF(__pyx_t_3);
  6173. #else
  6174. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  6175. __Pyx_GOTREF(__pyx_t_1);
  6176. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 451, __pyx_L1_error)
  6177. __Pyx_GOTREF(__pyx_t_3);
  6178. #endif
  6179. } else {
  6180. Py_ssize_t index = -1;
  6181. __pyx_t_2 = PyObject_GetIter(__pyx_v_p1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 451, __pyx_L1_error)
  6182. __Pyx_GOTREF(__pyx_t_2);
  6183. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  6184. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
  6185. __Pyx_GOTREF(__pyx_t_1);
  6186. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
  6187. __Pyx_GOTREF(__pyx_t_3);
  6188. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 451, __pyx_L1_error)
  6189. __pyx_t_6 = NULL;
  6190. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6191. goto __pyx_L6_unpacking_done;
  6192. __pyx_L5_unpacking_failed:;
  6193. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6194. __pyx_t_6 = NULL;
  6195. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  6196. __PYX_ERR(0, 451, __pyx_L1_error)
  6197. __pyx_L6_unpacking_done:;
  6198. }
  6199. __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)
  6200. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6201. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error)
  6202. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6203. __pyx_v_x1 = __pyx_t_8;
  6204. __pyx_v_y1 = __pyx_t_7;
  6205. /* "fontTools/pens/momentsPen.py":452
  6206. * x0, y0 = self._getCurrentPoint()
  6207. * x1, y1 = p1
  6208. * x2, y2 = p2 # <<<<<<<<<<<<<<
  6209. * x3, y3 = p3
  6210. *
  6211. */
  6212. if ((likely(PyTuple_CheckExact(__pyx_v_p2))) || (PyList_CheckExact(__pyx_v_p2))) {
  6213. PyObject* sequence = __pyx_v_p2;
  6214. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  6215. if (unlikely(size != 2)) {
  6216. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  6217. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  6218. __PYX_ERR(0, 452, __pyx_L1_error)
  6219. }
  6220. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6221. if (likely(PyTuple_CheckExact(sequence))) {
  6222. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  6223. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
  6224. } else {
  6225. __pyx_t_3 = PyList_GET_ITEM(sequence, 0);
  6226. __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
  6227. }
  6228. __Pyx_INCREF(__pyx_t_3);
  6229. __Pyx_INCREF(__pyx_t_1);
  6230. #else
  6231. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 452, __pyx_L1_error)
  6232. __Pyx_GOTREF(__pyx_t_3);
  6233. __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  6234. __Pyx_GOTREF(__pyx_t_1);
  6235. #endif
  6236. } else {
  6237. Py_ssize_t index = -1;
  6238. __pyx_t_2 = PyObject_GetIter(__pyx_v_p2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 452, __pyx_L1_error)
  6239. __Pyx_GOTREF(__pyx_t_2);
  6240. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  6241. index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  6242. __Pyx_GOTREF(__pyx_t_3);
  6243. index = 1; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L7_unpacking_failed;
  6244. __Pyx_GOTREF(__pyx_t_1);
  6245. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 452, __pyx_L1_error)
  6246. __pyx_t_6 = NULL;
  6247. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6248. goto __pyx_L8_unpacking_done;
  6249. __pyx_L7_unpacking_failed:;
  6250. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6251. __pyx_t_6 = NULL;
  6252. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  6253. __PYX_ERR(0, 452, __pyx_L1_error)
  6254. __pyx_L8_unpacking_done:;
  6255. }
  6256. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error)
  6257. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6258. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error)
  6259. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6260. __pyx_v_x2 = __pyx_t_7;
  6261. __pyx_v_y2 = __pyx_t_8;
  6262. /* "fontTools/pens/momentsPen.py":453
  6263. * x1, y1 = p1
  6264. * x2, y2 = p2
  6265. * x3, y3 = p3 # <<<<<<<<<<<<<<
  6266. *
  6267. * r0 = 6 * y2
  6268. */
  6269. if ((likely(PyTuple_CheckExact(__pyx_v_p3))) || (PyList_CheckExact(__pyx_v_p3))) {
  6270. PyObject* sequence = __pyx_v_p3;
  6271. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  6272. if (unlikely(size != 2)) {
  6273. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  6274. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  6275. __PYX_ERR(0, 453, __pyx_L1_error)
  6276. }
  6277. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6278. if (likely(PyTuple_CheckExact(sequence))) {
  6279. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  6280. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  6281. } else {
  6282. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  6283. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  6284. }
  6285. __Pyx_INCREF(__pyx_t_1);
  6286. __Pyx_INCREF(__pyx_t_3);
  6287. #else
  6288. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  6289. __Pyx_GOTREF(__pyx_t_1);
  6290. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
  6291. __Pyx_GOTREF(__pyx_t_3);
  6292. #endif
  6293. } else {
  6294. Py_ssize_t index = -1;
  6295. __pyx_t_2 = PyObject_GetIter(__pyx_v_p3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
  6296. __Pyx_GOTREF(__pyx_t_2);
  6297. __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2);
  6298. index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
  6299. __Pyx_GOTREF(__pyx_t_1);
  6300. index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_2); if (unlikely(!__pyx_t_3)) goto __pyx_L9_unpacking_failed;
  6301. __Pyx_GOTREF(__pyx_t_3);
  6302. if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_2), 2) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  6303. __pyx_t_6 = NULL;
  6304. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6305. goto __pyx_L10_unpacking_done;
  6306. __pyx_L9_unpacking_failed:;
  6307. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  6308. __pyx_t_6 = NULL;
  6309. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  6310. __PYX_ERR(0, 453, __pyx_L1_error)
  6311. __pyx_L10_unpacking_done:;
  6312. }
  6313. __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
  6314. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  6315. __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
  6316. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  6317. __pyx_v_x3 = __pyx_t_8;
  6318. __pyx_v_y3 = __pyx_t_7;
  6319. /* "fontTools/pens/momentsPen.py":455
  6320. * x3, y3 = p3
  6321. *
  6322. * r0 = 6 * y2 # <<<<<<<<<<<<<<
  6323. * r1 = r0 * x3
  6324. * r2 = 10 * y3
  6325. */
  6326. __pyx_v_r0 = (6.0 * __pyx_v_y2);
  6327. /* "fontTools/pens/momentsPen.py":456
  6328. *
  6329. * r0 = 6 * y2
  6330. * r1 = r0 * x3 # <<<<<<<<<<<<<<
  6331. * r2 = 10 * y3
  6332. * r3 = r2 * x3
  6333. */
  6334. __pyx_v_r1 = (__pyx_v_r0 * __pyx_v_x3);
  6335. /* "fontTools/pens/momentsPen.py":457
  6336. * r0 = 6 * y2
  6337. * r1 = r0 * x3
  6338. * r2 = 10 * y3 # <<<<<<<<<<<<<<
  6339. * r3 = r2 * x3
  6340. * r4 = 3 * y1
  6341. */
  6342. __pyx_v_r2 = (10.0 * __pyx_v_y3);
  6343. /* "fontTools/pens/momentsPen.py":458
  6344. * r1 = r0 * x3
  6345. * r2 = 10 * y3
  6346. * r3 = r2 * x3 # <<<<<<<<<<<<<<
  6347. * r4 = 3 * y1
  6348. * r5 = 6 * x1
  6349. */
  6350. __pyx_v_r3 = (__pyx_v_r2 * __pyx_v_x3);
  6351. /* "fontTools/pens/momentsPen.py":459
  6352. * r2 = 10 * y3
  6353. * r3 = r2 * x3
  6354. * r4 = 3 * y1 # <<<<<<<<<<<<<<
  6355. * r5 = 6 * x1
  6356. * r6 = 3 * x2
  6357. */
  6358. __pyx_v_r4 = (3.0 * __pyx_v_y1);
  6359. /* "fontTools/pens/momentsPen.py":460
  6360. * r3 = r2 * x3
  6361. * r4 = 3 * y1
  6362. * r5 = 6 * x1 # <<<<<<<<<<<<<<
  6363. * r6 = 3 * x2
  6364. * r7 = 6 * y1
  6365. */
  6366. __pyx_v_r5 = (6.0 * __pyx_v_x1);
  6367. /* "fontTools/pens/momentsPen.py":461
  6368. * r4 = 3 * y1
  6369. * r5 = 6 * x1
  6370. * r6 = 3 * x2 # <<<<<<<<<<<<<<
  6371. * r7 = 6 * y1
  6372. * r8 = 3 * y2
  6373. */
  6374. __pyx_v_r6 = (3.0 * __pyx_v_x2);
  6375. /* "fontTools/pens/momentsPen.py":462
  6376. * r5 = 6 * x1
  6377. * r6 = 3 * x2
  6378. * r7 = 6 * y1 # <<<<<<<<<<<<<<
  6379. * r8 = 3 * y2
  6380. * r9 = x2**2
  6381. */
  6382. __pyx_v_r7 = (6.0 * __pyx_v_y1);
  6383. /* "fontTools/pens/momentsPen.py":463
  6384. * r6 = 3 * x2
  6385. * r7 = 6 * y1
  6386. * r8 = 3 * y2 # <<<<<<<<<<<<<<
  6387. * r9 = x2**2
  6388. * r10 = 45 * r9
  6389. */
  6390. __pyx_v_r8 = (3.0 * __pyx_v_y2);
  6391. /* "fontTools/pens/momentsPen.py":464
  6392. * r7 = 6 * y1
  6393. * r8 = 3 * y2
  6394. * r9 = x2**2 # <<<<<<<<<<<<<<
  6395. * r10 = 45 * r9
  6396. * r11 = r10 * y3
  6397. */
  6398. __pyx_v_r9 = pow(__pyx_v_x2, 2.0);
  6399. /* "fontTools/pens/momentsPen.py":465
  6400. * r8 = 3 * y2
  6401. * r9 = x2**2
  6402. * r10 = 45 * r9 # <<<<<<<<<<<<<<
  6403. * r11 = r10 * y3
  6404. * r12 = x3**2
  6405. */
  6406. __pyx_v_r10 = (45.0 * __pyx_v_r9);
  6407. /* "fontTools/pens/momentsPen.py":466
  6408. * r9 = x2**2
  6409. * r10 = 45 * r9
  6410. * r11 = r10 * y3 # <<<<<<<<<<<<<<
  6411. * r12 = x3**2
  6412. * r13 = r12 * y2
  6413. */
  6414. __pyx_v_r11 = (__pyx_v_r10 * __pyx_v_y3);
  6415. /* "fontTools/pens/momentsPen.py":467
  6416. * r10 = 45 * r9
  6417. * r11 = r10 * y3
  6418. * r12 = x3**2 # <<<<<<<<<<<<<<
  6419. * r13 = r12 * y2
  6420. * r14 = r12 * y3
  6421. */
  6422. __pyx_v_r12 = pow(__pyx_v_x3, 2.0);
  6423. /* "fontTools/pens/momentsPen.py":468
  6424. * r11 = r10 * y3
  6425. * r12 = x3**2
  6426. * r13 = r12 * y2 # <<<<<<<<<<<<<<
  6427. * r14 = r12 * y3
  6428. * r15 = 7 * y3
  6429. */
  6430. __pyx_v_r13 = (__pyx_v_r12 * __pyx_v_y2);
  6431. /* "fontTools/pens/momentsPen.py":469
  6432. * r12 = x3**2
  6433. * r13 = r12 * y2
  6434. * r14 = r12 * y3 # <<<<<<<<<<<<<<
  6435. * r15 = 7 * y3
  6436. * r16 = 15 * x3
  6437. */
  6438. __pyx_v_r14 = (__pyx_v_r12 * __pyx_v_y3);
  6439. /* "fontTools/pens/momentsPen.py":470
  6440. * r13 = r12 * y2
  6441. * r14 = r12 * y3
  6442. * r15 = 7 * y3 # <<<<<<<<<<<<<<
  6443. * r16 = 15 * x3
  6444. * r17 = r16 * x2
  6445. */
  6446. __pyx_v_r15 = (7.0 * __pyx_v_y3);
  6447. /* "fontTools/pens/momentsPen.py":471
  6448. * r14 = r12 * y3
  6449. * r15 = 7 * y3
  6450. * r16 = 15 * x3 # <<<<<<<<<<<<<<
  6451. * r17 = r16 * x2
  6452. * r18 = x1**2
  6453. */
  6454. __pyx_v_r16 = (15.0 * __pyx_v_x3);
  6455. /* "fontTools/pens/momentsPen.py":472
  6456. * r15 = 7 * y3
  6457. * r16 = 15 * x3
  6458. * r17 = r16 * x2 # <<<<<<<<<<<<<<
  6459. * r18 = x1**2
  6460. * r19 = 9 * r18
  6461. */
  6462. __pyx_v_r17 = (__pyx_v_r16 * __pyx_v_x2);
  6463. /* "fontTools/pens/momentsPen.py":473
  6464. * r16 = 15 * x3
  6465. * r17 = r16 * x2
  6466. * r18 = x1**2 # <<<<<<<<<<<<<<
  6467. * r19 = 9 * r18
  6468. * r20 = x0**2
  6469. */
  6470. __pyx_v_r18 = pow(__pyx_v_x1, 2.0);
  6471. /* "fontTools/pens/momentsPen.py":474
  6472. * r17 = r16 * x2
  6473. * r18 = x1**2
  6474. * r19 = 9 * r18 # <<<<<<<<<<<<<<
  6475. * r20 = x0**2
  6476. * r21 = 21 * y1
  6477. */
  6478. __pyx_v_r19 = (9.0 * __pyx_v_r18);
  6479. /* "fontTools/pens/momentsPen.py":475
  6480. * r18 = x1**2
  6481. * r19 = 9 * r18
  6482. * r20 = x0**2 # <<<<<<<<<<<<<<
  6483. * r21 = 21 * y1
  6484. * r22 = 9 * r9
  6485. */
  6486. __pyx_v_r20 = pow(__pyx_v_x0, 2.0);
  6487. /* "fontTools/pens/momentsPen.py":476
  6488. * r19 = 9 * r18
  6489. * r20 = x0**2
  6490. * r21 = 21 * y1 # <<<<<<<<<<<<<<
  6491. * r22 = 9 * r9
  6492. * r23 = r7 * x3
  6493. */
  6494. __pyx_v_r21 = (21.0 * __pyx_v_y1);
  6495. /* "fontTools/pens/momentsPen.py":477
  6496. * r20 = x0**2
  6497. * r21 = 21 * y1
  6498. * r22 = 9 * r9 # <<<<<<<<<<<<<<
  6499. * r23 = r7 * x3
  6500. * r24 = 9 * y2
  6501. */
  6502. __pyx_v_r22 = (9.0 * __pyx_v_r9);
  6503. /* "fontTools/pens/momentsPen.py":478
  6504. * r21 = 21 * y1
  6505. * r22 = 9 * r9
  6506. * r23 = r7 * x3 # <<<<<<<<<<<<<<
  6507. * r24 = 9 * y2
  6508. * r25 = r24 * x2 + r3
  6509. */
  6510. __pyx_v_r23 = (__pyx_v_r7 * __pyx_v_x3);
  6511. /* "fontTools/pens/momentsPen.py":479
  6512. * r22 = 9 * r9
  6513. * r23 = r7 * x3
  6514. * r24 = 9 * y2 # <<<<<<<<<<<<<<
  6515. * r25 = r24 * x2 + r3
  6516. * r26 = 9 * x2
  6517. */
  6518. __pyx_v_r24 = (9.0 * __pyx_v_y2);
  6519. /* "fontTools/pens/momentsPen.py":480
  6520. * r23 = r7 * x3
  6521. * r24 = 9 * y2
  6522. * r25 = r24 * x2 + r3 # <<<<<<<<<<<<<<
  6523. * r26 = 9 * x2
  6524. * r27 = x2 * y3
  6525. */
  6526. __pyx_v_r25 = ((__pyx_v_r24 * __pyx_v_x2) + __pyx_v_r3);
  6527. /* "fontTools/pens/momentsPen.py":481
  6528. * r24 = 9 * y2
  6529. * r25 = r24 * x2 + r3
  6530. * r26 = 9 * x2 # <<<<<<<<<<<<<<
  6531. * r27 = x2 * y3
  6532. * r28 = -r26 * y1 + 15 * r27
  6533. */
  6534. __pyx_v_r26 = (9.0 * __pyx_v_x2);
  6535. /* "fontTools/pens/momentsPen.py":482
  6536. * r25 = r24 * x2 + r3
  6537. * r26 = 9 * x2
  6538. * r27 = x2 * y3 # <<<<<<<<<<<<<<
  6539. * r28 = -r26 * y1 + 15 * r27
  6540. * r29 = 3 * x1
  6541. */
  6542. __pyx_v_r27 = (__pyx_v_x2 * __pyx_v_y3);
  6543. /* "fontTools/pens/momentsPen.py":483
  6544. * r26 = 9 * x2
  6545. * r27 = x2 * y3
  6546. * r28 = -r26 * y1 + 15 * r27 # <<<<<<<<<<<<<<
  6547. * r29 = 3 * x1
  6548. * r30 = 45 * x1
  6549. */
  6550. __pyx_v_r28 = (((-__pyx_v_r26) * __pyx_v_y1) + (15.0 * __pyx_v_r27));
  6551. /* "fontTools/pens/momentsPen.py":484
  6552. * r27 = x2 * y3
  6553. * r28 = -r26 * y1 + 15 * r27
  6554. * r29 = 3 * x1 # <<<<<<<<<<<<<<
  6555. * r30 = 45 * x1
  6556. * r31 = 12 * x3
  6557. */
  6558. __pyx_v_r29 = (3.0 * __pyx_v_x1);
  6559. /* "fontTools/pens/momentsPen.py":485
  6560. * r28 = -r26 * y1 + 15 * r27
  6561. * r29 = 3 * x1
  6562. * r30 = 45 * x1 # <<<<<<<<<<<<<<
  6563. * r31 = 12 * x3
  6564. * r32 = 45 * r18
  6565. */
  6566. __pyx_v_r30 = (45.0 * __pyx_v_x1);
  6567. /* "fontTools/pens/momentsPen.py":486
  6568. * r29 = 3 * x1
  6569. * r30 = 45 * x1
  6570. * r31 = 12 * x3 # <<<<<<<<<<<<<<
  6571. * r32 = 45 * r18
  6572. * r33 = 5 * r12
  6573. */
  6574. __pyx_v_r31 = (12.0 * __pyx_v_x3);
  6575. /* "fontTools/pens/momentsPen.py":487
  6576. * r30 = 45 * x1
  6577. * r31 = 12 * x3
  6578. * r32 = 45 * r18 # <<<<<<<<<<<<<<
  6579. * r33 = 5 * r12
  6580. * r34 = r8 * x3
  6581. */
  6582. __pyx_v_r32 = (45.0 * __pyx_v_r18);
  6583. /* "fontTools/pens/momentsPen.py":488
  6584. * r31 = 12 * x3
  6585. * r32 = 45 * r18
  6586. * r33 = 5 * r12 # <<<<<<<<<<<<<<
  6587. * r34 = r8 * x3
  6588. * r35 = 105 * y0
  6589. */
  6590. __pyx_v_r33 = (5.0 * __pyx_v_r12);
  6591. /* "fontTools/pens/momentsPen.py":489
  6592. * r32 = 45 * r18
  6593. * r33 = 5 * r12
  6594. * r34 = r8 * x3 # <<<<<<<<<<<<<<
  6595. * r35 = 105 * y0
  6596. * r36 = 30 * y0
  6597. */
  6598. __pyx_v_r34 = (__pyx_v_r8 * __pyx_v_x3);
  6599. /* "fontTools/pens/momentsPen.py":490
  6600. * r33 = 5 * r12
  6601. * r34 = r8 * x3
  6602. * r35 = 105 * y0 # <<<<<<<<<<<<<<
  6603. * r36 = 30 * y0
  6604. * r37 = r36 * x2
  6605. */
  6606. __pyx_v_r35 = (105.0 * __pyx_v_y0);
  6607. /* "fontTools/pens/momentsPen.py":491
  6608. * r34 = r8 * x3
  6609. * r35 = 105 * y0
  6610. * r36 = 30 * y0 # <<<<<<<<<<<<<<
  6611. * r37 = r36 * x2
  6612. * r38 = 5 * x3
  6613. */
  6614. __pyx_v_r36 = (30.0 * __pyx_v_y0);
  6615. /* "fontTools/pens/momentsPen.py":492
  6616. * r35 = 105 * y0
  6617. * r36 = 30 * y0
  6618. * r37 = r36 * x2 # <<<<<<<<<<<<<<
  6619. * r38 = 5 * x3
  6620. * r39 = 15 * y3
  6621. */
  6622. __pyx_v_r37 = (__pyx_v_r36 * __pyx_v_x2);
  6623. /* "fontTools/pens/momentsPen.py":493
  6624. * r36 = 30 * y0
  6625. * r37 = r36 * x2
  6626. * r38 = 5 * x3 # <<<<<<<<<<<<<<
  6627. * r39 = 15 * y3
  6628. * r40 = 5 * y3
  6629. */
  6630. __pyx_v_r38 = (5.0 * __pyx_v_x3);
  6631. /* "fontTools/pens/momentsPen.py":494
  6632. * r37 = r36 * x2
  6633. * r38 = 5 * x3
  6634. * r39 = 15 * y3 # <<<<<<<<<<<<<<
  6635. * r40 = 5 * y3
  6636. * r41 = r40 * x3
  6637. */
  6638. __pyx_v_r39 = (15.0 * __pyx_v_y3);
  6639. /* "fontTools/pens/momentsPen.py":495
  6640. * r38 = 5 * x3
  6641. * r39 = 15 * y3
  6642. * r40 = 5 * y3 # <<<<<<<<<<<<<<
  6643. * r41 = r40 * x3
  6644. * r42 = x2 * y2
  6645. */
  6646. __pyx_v_r40 = (5.0 * __pyx_v_y3);
  6647. /* "fontTools/pens/momentsPen.py":496
  6648. * r39 = 15 * y3
  6649. * r40 = 5 * y3
  6650. * r41 = r40 * x3 # <<<<<<<<<<<<<<
  6651. * r42 = x2 * y2
  6652. * r43 = 18 * r42
  6653. */
  6654. __pyx_v_r41 = (__pyx_v_r40 * __pyx_v_x3);
  6655. /* "fontTools/pens/momentsPen.py":497
  6656. * r40 = 5 * y3
  6657. * r41 = r40 * x3
  6658. * r42 = x2 * y2 # <<<<<<<<<<<<<<
  6659. * r43 = 18 * r42
  6660. * r44 = 45 * y1
  6661. */
  6662. __pyx_v_r42 = (__pyx_v_x2 * __pyx_v_y2);
  6663. /* "fontTools/pens/momentsPen.py":498
  6664. * r41 = r40 * x3
  6665. * r42 = x2 * y2
  6666. * r43 = 18 * r42 # <<<<<<<<<<<<<<
  6667. * r44 = 45 * y1
  6668. * r45 = r41 + r43 + r44 * x1
  6669. */
  6670. __pyx_v_r43 = (18.0 * __pyx_v_r42);
  6671. /* "fontTools/pens/momentsPen.py":499
  6672. * r42 = x2 * y2
  6673. * r43 = 18 * r42
  6674. * r44 = 45 * y1 # <<<<<<<<<<<<<<
  6675. * r45 = r41 + r43 + r44 * x1
  6676. * r46 = y2 * y3
  6677. */
  6678. __pyx_v_r44 = (45.0 * __pyx_v_y1);
  6679. /* "fontTools/pens/momentsPen.py":500
  6680. * r43 = 18 * r42
  6681. * r44 = 45 * y1
  6682. * r45 = r41 + r43 + r44 * x1 # <<<<<<<<<<<<<<
  6683. * r46 = y2 * y3
  6684. * r47 = r46 * x3
  6685. */
  6686. __pyx_v_r45 = ((__pyx_v_r41 + __pyx_v_r43) + (__pyx_v_r44 * __pyx_v_x1));
  6687. /* "fontTools/pens/momentsPen.py":501
  6688. * r44 = 45 * y1
  6689. * r45 = r41 + r43 + r44 * x1
  6690. * r46 = y2 * y3 # <<<<<<<<<<<<<<
  6691. * r47 = r46 * x3
  6692. * r48 = y2**2
  6693. */
  6694. __pyx_v_r46 = (__pyx_v_y2 * __pyx_v_y3);
  6695. /* "fontTools/pens/momentsPen.py":502
  6696. * r45 = r41 + r43 + r44 * x1
  6697. * r46 = y2 * y3
  6698. * r47 = r46 * x3 # <<<<<<<<<<<<<<
  6699. * r48 = y2**2
  6700. * r49 = 45 * r48
  6701. */
  6702. __pyx_v_r47 = (__pyx_v_r46 * __pyx_v_x3);
  6703. /* "fontTools/pens/momentsPen.py":503
  6704. * r46 = y2 * y3
  6705. * r47 = r46 * x3
  6706. * r48 = y2**2 # <<<<<<<<<<<<<<
  6707. * r49 = 45 * r48
  6708. * r50 = r49 * x3
  6709. */
  6710. __pyx_v_r48 = pow(__pyx_v_y2, 2.0);
  6711. /* "fontTools/pens/momentsPen.py":504
  6712. * r47 = r46 * x3
  6713. * r48 = y2**2
  6714. * r49 = 45 * r48 # <<<<<<<<<<<<<<
  6715. * r50 = r49 * x3
  6716. * r51 = y3**2
  6717. */
  6718. __pyx_v_r49 = (45.0 * __pyx_v_r48);
  6719. /* "fontTools/pens/momentsPen.py":505
  6720. * r48 = y2**2
  6721. * r49 = 45 * r48
  6722. * r50 = r49 * x3 # <<<<<<<<<<<<<<
  6723. * r51 = y3**2
  6724. * r52 = r51 * x3
  6725. */
  6726. __pyx_v_r50 = (__pyx_v_r49 * __pyx_v_x3);
  6727. /* "fontTools/pens/momentsPen.py":506
  6728. * r49 = 45 * r48
  6729. * r50 = r49 * x3
  6730. * r51 = y3**2 # <<<<<<<<<<<<<<
  6731. * r52 = r51 * x3
  6732. * r53 = y1**2
  6733. */
  6734. __pyx_v_r51 = pow(__pyx_v_y3, 2.0);
  6735. /* "fontTools/pens/momentsPen.py":507
  6736. * r50 = r49 * x3
  6737. * r51 = y3**2
  6738. * r52 = r51 * x3 # <<<<<<<<<<<<<<
  6739. * r53 = y1**2
  6740. * r54 = 9 * r53
  6741. */
  6742. __pyx_v_r52 = (__pyx_v_r51 * __pyx_v_x3);
  6743. /* "fontTools/pens/momentsPen.py":508
  6744. * r51 = y3**2
  6745. * r52 = r51 * x3
  6746. * r53 = y1**2 # <<<<<<<<<<<<<<
  6747. * r54 = 9 * r53
  6748. * r55 = y0**2
  6749. */
  6750. __pyx_v_r53 = pow(__pyx_v_y1, 2.0);
  6751. /* "fontTools/pens/momentsPen.py":509
  6752. * r52 = r51 * x3
  6753. * r53 = y1**2
  6754. * r54 = 9 * r53 # <<<<<<<<<<<<<<
  6755. * r55 = y0**2
  6756. * r56 = 21 * x1
  6757. */
  6758. __pyx_v_r54 = (9.0 * __pyx_v_r53);
  6759. /* "fontTools/pens/momentsPen.py":510
  6760. * r53 = y1**2
  6761. * r54 = 9 * r53
  6762. * r55 = y0**2 # <<<<<<<<<<<<<<
  6763. * r56 = 21 * x1
  6764. * r57 = 6 * x2
  6765. */
  6766. __pyx_v_r55 = pow(__pyx_v_y0, 2.0);
  6767. /* "fontTools/pens/momentsPen.py":511
  6768. * r54 = 9 * r53
  6769. * r55 = y0**2
  6770. * r56 = 21 * x1 # <<<<<<<<<<<<<<
  6771. * r57 = 6 * x2
  6772. * r58 = r16 * y2
  6773. */
  6774. __pyx_v_r56 = (21.0 * __pyx_v_x1);
  6775. /* "fontTools/pens/momentsPen.py":512
  6776. * r55 = y0**2
  6777. * r56 = 21 * x1
  6778. * r57 = 6 * x2 # <<<<<<<<<<<<<<
  6779. * r58 = r16 * y2
  6780. * r59 = r39 * y2
  6781. */
  6782. __pyx_v_r57 = (6.0 * __pyx_v_x2);
  6783. /* "fontTools/pens/momentsPen.py":513
  6784. * r56 = 21 * x1
  6785. * r57 = 6 * x2
  6786. * r58 = r16 * y2 # <<<<<<<<<<<<<<
  6787. * r59 = r39 * y2
  6788. * r60 = 9 * r48
  6789. */
  6790. __pyx_v_r58 = (__pyx_v_r16 * __pyx_v_y2);
  6791. /* "fontTools/pens/momentsPen.py":514
  6792. * r57 = 6 * x2
  6793. * r58 = r16 * y2
  6794. * r59 = r39 * y2 # <<<<<<<<<<<<<<
  6795. * r60 = 9 * r48
  6796. * r61 = r6 * y3
  6797. */
  6798. __pyx_v_r59 = (__pyx_v_r39 * __pyx_v_y2);
  6799. /* "fontTools/pens/momentsPen.py":515
  6800. * r58 = r16 * y2
  6801. * r59 = r39 * y2
  6802. * r60 = 9 * r48 # <<<<<<<<<<<<<<
  6803. * r61 = r6 * y3
  6804. * r62 = 3 * y3
  6805. */
  6806. __pyx_v_r60 = (9.0 * __pyx_v_r48);
  6807. /* "fontTools/pens/momentsPen.py":516
  6808. * r59 = r39 * y2
  6809. * r60 = 9 * r48
  6810. * r61 = r6 * y3 # <<<<<<<<<<<<<<
  6811. * r62 = 3 * y3
  6812. * r63 = r36 * y2
  6813. */
  6814. __pyx_v_r61 = (__pyx_v_r6 * __pyx_v_y3);
  6815. /* "fontTools/pens/momentsPen.py":517
  6816. * r60 = 9 * r48
  6817. * r61 = r6 * y3
  6818. * r62 = 3 * y3 # <<<<<<<<<<<<<<
  6819. * r63 = r36 * y2
  6820. * r64 = y1 * y3
  6821. */
  6822. __pyx_v_r62 = (3.0 * __pyx_v_y3);
  6823. /* "fontTools/pens/momentsPen.py":518
  6824. * r61 = r6 * y3
  6825. * r62 = 3 * y3
  6826. * r63 = r36 * y2 # <<<<<<<<<<<<<<
  6827. * r64 = y1 * y3
  6828. * r65 = 45 * r53
  6829. */
  6830. __pyx_v_r63 = (__pyx_v_r36 * __pyx_v_y2);
  6831. /* "fontTools/pens/momentsPen.py":519
  6832. * r62 = 3 * y3
  6833. * r63 = r36 * y2
  6834. * r64 = y1 * y3 # <<<<<<<<<<<<<<
  6835. * r65 = 45 * r53
  6836. * r66 = 5 * r51
  6837. */
  6838. __pyx_v_r64 = (__pyx_v_y1 * __pyx_v_y3);
  6839. /* "fontTools/pens/momentsPen.py":520
  6840. * r63 = r36 * y2
  6841. * r64 = y1 * y3
  6842. * r65 = 45 * r53 # <<<<<<<<<<<<<<
  6843. * r66 = 5 * r51
  6844. * r67 = x2**3
  6845. */
  6846. __pyx_v_r65 = (45.0 * __pyx_v_r53);
  6847. /* "fontTools/pens/momentsPen.py":521
  6848. * r64 = y1 * y3
  6849. * r65 = 45 * r53
  6850. * r66 = 5 * r51 # <<<<<<<<<<<<<<
  6851. * r67 = x2**3
  6852. * r68 = x3**3
  6853. */
  6854. __pyx_v_r66 = (5.0 * __pyx_v_r51);
  6855. /* "fontTools/pens/momentsPen.py":522
  6856. * r65 = 45 * r53
  6857. * r66 = 5 * r51
  6858. * r67 = x2**3 # <<<<<<<<<<<<<<
  6859. * r68 = x3**3
  6860. * r69 = 630 * y2
  6861. */
  6862. __pyx_v_r67 = pow(__pyx_v_x2, 3.0);
  6863. /* "fontTools/pens/momentsPen.py":523
  6864. * r66 = 5 * r51
  6865. * r67 = x2**3
  6866. * r68 = x3**3 # <<<<<<<<<<<<<<
  6867. * r69 = 630 * y2
  6868. * r70 = 126 * x3
  6869. */
  6870. __pyx_v_r68 = pow(__pyx_v_x3, 3.0);
  6871. /* "fontTools/pens/momentsPen.py":524
  6872. * r67 = x2**3
  6873. * r68 = x3**3
  6874. * r69 = 630 * y2 # <<<<<<<<<<<<<<
  6875. * r70 = 126 * x3
  6876. * r71 = x1**3
  6877. */
  6878. __pyx_v_r69 = (630.0 * __pyx_v_y2);
  6879. /* "fontTools/pens/momentsPen.py":525
  6880. * r68 = x3**3
  6881. * r69 = 630 * y2
  6882. * r70 = 126 * x3 # <<<<<<<<<<<<<<
  6883. * r71 = x1**3
  6884. * r72 = 126 * x2
  6885. */
  6886. __pyx_v_r70 = (126.0 * __pyx_v_x3);
  6887. /* "fontTools/pens/momentsPen.py":526
  6888. * r69 = 630 * y2
  6889. * r70 = 126 * x3
  6890. * r71 = x1**3 # <<<<<<<<<<<<<<
  6891. * r72 = 126 * x2
  6892. * r73 = 63 * r9
  6893. */
  6894. __pyx_v_r71 = pow(__pyx_v_x1, 3.0);
  6895. /* "fontTools/pens/momentsPen.py":527
  6896. * r70 = 126 * x3
  6897. * r71 = x1**3
  6898. * r72 = 126 * x2 # <<<<<<<<<<<<<<
  6899. * r73 = 63 * r9
  6900. * r74 = r73 * x3
  6901. */
  6902. __pyx_v_r72 = (126.0 * __pyx_v_x2);
  6903. /* "fontTools/pens/momentsPen.py":528
  6904. * r71 = x1**3
  6905. * r72 = 126 * x2
  6906. * r73 = 63 * r9 # <<<<<<<<<<<<<<
  6907. * r74 = r73 * x3
  6908. * r75 = r15 * x3 + 15 * r42
  6909. */
  6910. __pyx_v_r73 = (63.0 * __pyx_v_r9);
  6911. /* "fontTools/pens/momentsPen.py":529
  6912. * r72 = 126 * x2
  6913. * r73 = 63 * r9
  6914. * r74 = r73 * x3 # <<<<<<<<<<<<<<
  6915. * r75 = r15 * x3 + 15 * r42
  6916. * r76 = 630 * x1
  6917. */
  6918. __pyx_v_r74 = (__pyx_v_r73 * __pyx_v_x3);
  6919. /* "fontTools/pens/momentsPen.py":530
  6920. * r73 = 63 * r9
  6921. * r74 = r73 * x3
  6922. * r75 = r15 * x3 + 15 * r42 # <<<<<<<<<<<<<<
  6923. * r76 = 630 * x1
  6924. * r77 = 14 * x3
  6925. */
  6926. __pyx_v_r75 = ((__pyx_v_r15 * __pyx_v_x3) + (15.0 * __pyx_v_r42));
  6927. /* "fontTools/pens/momentsPen.py":531
  6928. * r74 = r73 * x3
  6929. * r75 = r15 * x3 + 15 * r42
  6930. * r76 = 630 * x1 # <<<<<<<<<<<<<<
  6931. * r77 = 14 * x3
  6932. * r78 = 21 * r27
  6933. */
  6934. __pyx_v_r76 = (630.0 * __pyx_v_x1);
  6935. /* "fontTools/pens/momentsPen.py":532
  6936. * r75 = r15 * x3 + 15 * r42
  6937. * r76 = 630 * x1
  6938. * r77 = 14 * x3 # <<<<<<<<<<<<<<
  6939. * r78 = 21 * r27
  6940. * r79 = 42 * x1
  6941. */
  6942. __pyx_v_r77 = (14.0 * __pyx_v_x3);
  6943. /* "fontTools/pens/momentsPen.py":533
  6944. * r76 = 630 * x1
  6945. * r77 = 14 * x3
  6946. * r78 = 21 * r27 # <<<<<<<<<<<<<<
  6947. * r79 = 42 * x1
  6948. * r80 = 42 * x2
  6949. */
  6950. __pyx_v_r78 = (21.0 * __pyx_v_r27);
  6951. /* "fontTools/pens/momentsPen.py":534
  6952. * r77 = 14 * x3
  6953. * r78 = 21 * r27
  6954. * r79 = 42 * x1 # <<<<<<<<<<<<<<
  6955. * r80 = 42 * x2
  6956. * r81 = x1 * y2
  6957. */
  6958. __pyx_v_r79 = (42.0 * __pyx_v_x1);
  6959. /* "fontTools/pens/momentsPen.py":535
  6960. * r78 = 21 * r27
  6961. * r79 = 42 * x1
  6962. * r80 = 42 * x2 # <<<<<<<<<<<<<<
  6963. * r81 = x1 * y2
  6964. * r82 = 63 * r42
  6965. */
  6966. __pyx_v_r80 = (42.0 * __pyx_v_x2);
  6967. /* "fontTools/pens/momentsPen.py":536
  6968. * r79 = 42 * x1
  6969. * r80 = 42 * x2
  6970. * r81 = x1 * y2 # <<<<<<<<<<<<<<
  6971. * r82 = 63 * r42
  6972. * r83 = x1 * y1
  6973. */
  6974. __pyx_v_r81 = (__pyx_v_x1 * __pyx_v_y2);
  6975. /* "fontTools/pens/momentsPen.py":537
  6976. * r80 = 42 * x2
  6977. * r81 = x1 * y2
  6978. * r82 = 63 * r42 # <<<<<<<<<<<<<<
  6979. * r83 = x1 * y1
  6980. * r84 = r41 + r82 + 378 * r83
  6981. */
  6982. __pyx_v_r82 = (63.0 * __pyx_v_r42);
  6983. /* "fontTools/pens/momentsPen.py":538
  6984. * r81 = x1 * y2
  6985. * r82 = 63 * r42
  6986. * r83 = x1 * y1 # <<<<<<<<<<<<<<
  6987. * r84 = r41 + r82 + 378 * r83
  6988. * r85 = x2 * x3
  6989. */
  6990. __pyx_v_r83 = (__pyx_v_x1 * __pyx_v_y1);
  6991. /* "fontTools/pens/momentsPen.py":539
  6992. * r82 = 63 * r42
  6993. * r83 = x1 * y1
  6994. * r84 = r41 + r82 + 378 * r83 # <<<<<<<<<<<<<<
  6995. * r85 = x2 * x3
  6996. * r86 = r85 * y1
  6997. */
  6998. __pyx_v_r84 = ((__pyx_v_r41 + __pyx_v_r82) + (378.0 * __pyx_v_r83));
  6999. /* "fontTools/pens/momentsPen.py":540
  7000. * r83 = x1 * y1
  7001. * r84 = r41 + r82 + 378 * r83
  7002. * r85 = x2 * x3 # <<<<<<<<<<<<<<
  7003. * r86 = r85 * y1
  7004. * r87 = r27 * x3
  7005. */
  7006. __pyx_v_r85 = (__pyx_v_x2 * __pyx_v_x3);
  7007. /* "fontTools/pens/momentsPen.py":541
  7008. * r84 = r41 + r82 + 378 * r83
  7009. * r85 = x2 * x3
  7010. * r86 = r85 * y1 # <<<<<<<<<<<<<<
  7011. * r87 = r27 * x3
  7012. * r88 = 27 * r9
  7013. */
  7014. __pyx_v_r86 = (__pyx_v_r85 * __pyx_v_y1);
  7015. /* "fontTools/pens/momentsPen.py":542
  7016. * r85 = x2 * x3
  7017. * r86 = r85 * y1
  7018. * r87 = r27 * x3 # <<<<<<<<<<<<<<
  7019. * r88 = 27 * r9
  7020. * r89 = r88 * y2
  7021. */
  7022. __pyx_v_r87 = (__pyx_v_r27 * __pyx_v_x3);
  7023. /* "fontTools/pens/momentsPen.py":543
  7024. * r86 = r85 * y1
  7025. * r87 = r27 * x3
  7026. * r88 = 27 * r9 # <<<<<<<<<<<<<<
  7027. * r89 = r88 * y2
  7028. * r90 = 42 * r14
  7029. */
  7030. __pyx_v_r88 = (27.0 * __pyx_v_r9);
  7031. /* "fontTools/pens/momentsPen.py":544
  7032. * r87 = r27 * x3
  7033. * r88 = 27 * r9
  7034. * r89 = r88 * y2 # <<<<<<<<<<<<<<
  7035. * r90 = 42 * r14
  7036. * r91 = 90 * x1
  7037. */
  7038. __pyx_v_r89 = (__pyx_v_r88 * __pyx_v_y2);
  7039. /* "fontTools/pens/momentsPen.py":545
  7040. * r88 = 27 * r9
  7041. * r89 = r88 * y2
  7042. * r90 = 42 * r14 # <<<<<<<<<<<<<<
  7043. * r91 = 90 * x1
  7044. * r92 = 189 * r18
  7045. */
  7046. __pyx_v_r90 = (42.0 * __pyx_v_r14);
  7047. /* "fontTools/pens/momentsPen.py":546
  7048. * r89 = r88 * y2
  7049. * r90 = 42 * r14
  7050. * r91 = 90 * x1 # <<<<<<<<<<<<<<
  7051. * r92 = 189 * r18
  7052. * r93 = 378 * r18
  7053. */
  7054. __pyx_v_r91 = (90.0 * __pyx_v_x1);
  7055. /* "fontTools/pens/momentsPen.py":547
  7056. * r90 = 42 * r14
  7057. * r91 = 90 * x1
  7058. * r92 = 189 * r18 # <<<<<<<<<<<<<<
  7059. * r93 = 378 * r18
  7060. * r94 = r12 * y1
  7061. */
  7062. __pyx_v_r92 = (189.0 * __pyx_v_r18);
  7063. /* "fontTools/pens/momentsPen.py":548
  7064. * r91 = 90 * x1
  7065. * r92 = 189 * r18
  7066. * r93 = 378 * r18 # <<<<<<<<<<<<<<
  7067. * r94 = r12 * y1
  7068. * r95 = 252 * x1 * x2
  7069. */
  7070. __pyx_v_r93 = (378.0 * __pyx_v_r18);
  7071. /* "fontTools/pens/momentsPen.py":549
  7072. * r92 = 189 * r18
  7073. * r93 = 378 * r18
  7074. * r94 = r12 * y1 # <<<<<<<<<<<<<<
  7075. * r95 = 252 * x1 * x2
  7076. * r96 = r79 * x3
  7077. */
  7078. __pyx_v_r94 = (__pyx_v_r12 * __pyx_v_y1);
  7079. /* "fontTools/pens/momentsPen.py":550
  7080. * r93 = 378 * r18
  7081. * r94 = r12 * y1
  7082. * r95 = 252 * x1 * x2 # <<<<<<<<<<<<<<
  7083. * r96 = r79 * x3
  7084. * r97 = 30 * r85
  7085. */
  7086. __pyx_v_r95 = ((252.0 * __pyx_v_x1) * __pyx_v_x2);
  7087. /* "fontTools/pens/momentsPen.py":551
  7088. * r94 = r12 * y1
  7089. * r95 = 252 * x1 * x2
  7090. * r96 = r79 * x3 # <<<<<<<<<<<<<<
  7091. * r97 = 30 * r85
  7092. * r98 = r83 * x3
  7093. */
  7094. __pyx_v_r96 = (__pyx_v_r79 * __pyx_v_x3);
  7095. /* "fontTools/pens/momentsPen.py":552
  7096. * r95 = 252 * x1 * x2
  7097. * r96 = r79 * x3
  7098. * r97 = 30 * r85 # <<<<<<<<<<<<<<
  7099. * r98 = r83 * x3
  7100. * r99 = 30 * x3
  7101. */
  7102. __pyx_v_r97 = (30.0 * __pyx_v_r85);
  7103. /* "fontTools/pens/momentsPen.py":553
  7104. * r96 = r79 * x3
  7105. * r97 = 30 * r85
  7106. * r98 = r83 * x3 # <<<<<<<<<<<<<<
  7107. * r99 = 30 * x3
  7108. * r100 = 42 * x3
  7109. */
  7110. __pyx_v_r98 = (__pyx_v_r83 * __pyx_v_x3);
  7111. /* "fontTools/pens/momentsPen.py":554
  7112. * r97 = 30 * r85
  7113. * r98 = r83 * x3
  7114. * r99 = 30 * x3 # <<<<<<<<<<<<<<
  7115. * r100 = 42 * x3
  7116. * r101 = r42 * x1
  7117. */
  7118. __pyx_v_r99 = (30.0 * __pyx_v_x3);
  7119. /* "fontTools/pens/momentsPen.py":555
  7120. * r98 = r83 * x3
  7121. * r99 = 30 * x3
  7122. * r100 = 42 * x3 # <<<<<<<<<<<<<<
  7123. * r101 = r42 * x1
  7124. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  7125. */
  7126. __pyx_v_r100 = (42.0 * __pyx_v_x3);
  7127. /* "fontTools/pens/momentsPen.py":556
  7128. * r99 = 30 * x3
  7129. * r100 = 42 * x3
  7130. * r101 = r42 * x1 # <<<<<<<<<<<<<<
  7131. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  7132. * r103 = 378 * r48
  7133. */
  7134. __pyx_v_r101 = (__pyx_v_r42 * __pyx_v_x1);
  7135. /* "fontTools/pens/momentsPen.py":557
  7136. * r100 = 42 * x3
  7137. * r101 = r42 * x1
  7138. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99 # <<<<<<<<<<<<<<
  7139. * r103 = 378 * r48
  7140. * r104 = 18 * y1
  7141. */
  7142. __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));
  7143. /* "fontTools/pens/momentsPen.py":558
  7144. * r101 = r42 * x1
  7145. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  7146. * r103 = 378 * r48 # <<<<<<<<<<<<<<
  7147. * r104 = 18 * y1
  7148. * r105 = r104 * y2
  7149. */
  7150. __pyx_v_r103 = (378.0 * __pyx_v_r48);
  7151. /* "fontTools/pens/momentsPen.py":559
  7152. * r102 = r10 * y2 + 14 * r14 + 126 * r18 * y1 + r81 * r99
  7153. * r103 = 378 * r48
  7154. * r104 = 18 * y1 # <<<<<<<<<<<<<<
  7155. * r105 = r104 * y2
  7156. * r106 = y0 * y1
  7157. */
  7158. __pyx_v_r104 = (18.0 * __pyx_v_y1);
  7159. /* "fontTools/pens/momentsPen.py":560
  7160. * r103 = 378 * r48
  7161. * r104 = 18 * y1
  7162. * r105 = r104 * y2 # <<<<<<<<<<<<<<
  7163. * r106 = y0 * y1
  7164. * r107 = 252 * y2
  7165. */
  7166. __pyx_v_r105 = (__pyx_v_r104 * __pyx_v_y2);
  7167. /* "fontTools/pens/momentsPen.py":561
  7168. * r104 = 18 * y1
  7169. * r105 = r104 * y2
  7170. * r106 = y0 * y1 # <<<<<<<<<<<<<<
  7171. * r107 = 252 * y2
  7172. * r108 = r107 * y0
  7173. */
  7174. __pyx_v_r106 = (__pyx_v_y0 * __pyx_v_y1);
  7175. /* "fontTools/pens/momentsPen.py":562
  7176. * r105 = r104 * y2
  7177. * r106 = y0 * y1
  7178. * r107 = 252 * y2 # <<<<<<<<<<<<<<
  7179. * r108 = r107 * y0
  7180. * r109 = y0 * y3
  7181. */
  7182. __pyx_v_r107 = (252.0 * __pyx_v_y2);
  7183. /* "fontTools/pens/momentsPen.py":563
  7184. * r106 = y0 * y1
  7185. * r107 = 252 * y2
  7186. * r108 = r107 * y0 # <<<<<<<<<<<<<<
  7187. * r109 = y0 * y3
  7188. * r110 = 42 * r64
  7189. */
  7190. __pyx_v_r108 = (__pyx_v_r107 * __pyx_v_y0);
  7191. /* "fontTools/pens/momentsPen.py":564
  7192. * r107 = 252 * y2
  7193. * r108 = r107 * y0
  7194. * r109 = y0 * y3 # <<<<<<<<<<<<<<
  7195. * r110 = 42 * r64
  7196. * r111 = 378 * r53
  7197. */
  7198. __pyx_v_r109 = (__pyx_v_y0 * __pyx_v_y3);
  7199. /* "fontTools/pens/momentsPen.py":565
  7200. * r108 = r107 * y0
  7201. * r109 = y0 * y3
  7202. * r110 = 42 * r64 # <<<<<<<<<<<<<<
  7203. * r111 = 378 * r53
  7204. * r112 = 63 * r48
  7205. */
  7206. __pyx_v_r110 = (42.0 * __pyx_v_r64);
  7207. /* "fontTools/pens/momentsPen.py":566
  7208. * r109 = y0 * y3
  7209. * r110 = 42 * r64
  7210. * r111 = 378 * r53 # <<<<<<<<<<<<<<
  7211. * r112 = 63 * r48
  7212. * r113 = 27 * x2
  7213. */
  7214. __pyx_v_r111 = (378.0 * __pyx_v_r53);
  7215. /* "fontTools/pens/momentsPen.py":567
  7216. * r110 = 42 * r64
  7217. * r111 = 378 * r53
  7218. * r112 = 63 * r48 # <<<<<<<<<<<<<<
  7219. * r113 = 27 * x2
  7220. * r114 = r27 * y2
  7221. */
  7222. __pyx_v_r112 = (63.0 * __pyx_v_r48);
  7223. /* "fontTools/pens/momentsPen.py":568
  7224. * r111 = 378 * r53
  7225. * r112 = 63 * r48
  7226. * r113 = 27 * x2 # <<<<<<<<<<<<<<
  7227. * r114 = r27 * y2
  7228. * r115 = r113 * r48 + 42 * r52
  7229. */
  7230. __pyx_v_r113 = (27.0 * __pyx_v_x2);
  7231. /* "fontTools/pens/momentsPen.py":569
  7232. * r112 = 63 * r48
  7233. * r113 = 27 * x2
  7234. * r114 = r27 * y2 # <<<<<<<<<<<<<<
  7235. * r115 = r113 * r48 + 42 * r52
  7236. * r116 = x3 * y3
  7237. */
  7238. __pyx_v_r114 = (__pyx_v_r27 * __pyx_v_y2);
  7239. /* "fontTools/pens/momentsPen.py":570
  7240. * r113 = 27 * x2
  7241. * r114 = r27 * y2
  7242. * r115 = r113 * r48 + 42 * r52 # <<<<<<<<<<<<<<
  7243. * r116 = x3 * y3
  7244. * r117 = 54 * r42
  7245. */
  7246. __pyx_v_r115 = ((__pyx_v_r113 * __pyx_v_r48) + (42.0 * __pyx_v_r52));
  7247. /* "fontTools/pens/momentsPen.py":571
  7248. * r114 = r27 * y2
  7249. * r115 = r113 * r48 + 42 * r52
  7250. * r116 = x3 * y3 # <<<<<<<<<<<<<<
  7251. * r117 = 54 * r42
  7252. * r118 = r51 * x1
  7253. */
  7254. __pyx_v_r116 = (__pyx_v_x3 * __pyx_v_y3);
  7255. /* "fontTools/pens/momentsPen.py":572
  7256. * r115 = r113 * r48 + 42 * r52
  7257. * r116 = x3 * y3
  7258. * r117 = 54 * r42 # <<<<<<<<<<<<<<
  7259. * r118 = r51 * x1
  7260. * r119 = r51 * x2
  7261. */
  7262. __pyx_v_r117 = (54.0 * __pyx_v_r42);
  7263. /* "fontTools/pens/momentsPen.py":573
  7264. * r116 = x3 * y3
  7265. * r117 = 54 * r42
  7266. * r118 = r51 * x1 # <<<<<<<<<<<<<<
  7267. * r119 = r51 * x2
  7268. * r120 = r48 * x1
  7269. */
  7270. __pyx_v_r118 = (__pyx_v_r51 * __pyx_v_x1);
  7271. /* "fontTools/pens/momentsPen.py":574
  7272. * r117 = 54 * r42
  7273. * r118 = r51 * x1
  7274. * r119 = r51 * x2 # <<<<<<<<<<<<<<
  7275. * r120 = r48 * x1
  7276. * r121 = 21 * x3
  7277. */
  7278. __pyx_v_r119 = (__pyx_v_r51 * __pyx_v_x2);
  7279. /* "fontTools/pens/momentsPen.py":575
  7280. * r118 = r51 * x1
  7281. * r119 = r51 * x2
  7282. * r120 = r48 * x1 # <<<<<<<<<<<<<<
  7283. * r121 = 21 * x3
  7284. * r122 = r64 * x1
  7285. */
  7286. __pyx_v_r120 = (__pyx_v_r48 * __pyx_v_x1);
  7287. /* "fontTools/pens/momentsPen.py":576
  7288. * r119 = r51 * x2
  7289. * r120 = r48 * x1
  7290. * r121 = 21 * x3 # <<<<<<<<<<<<<<
  7291. * r122 = r64 * x1
  7292. * r123 = r81 * y3
  7293. */
  7294. __pyx_v_r121 = (21.0 * __pyx_v_x3);
  7295. /* "fontTools/pens/momentsPen.py":577
  7296. * r120 = r48 * x1
  7297. * r121 = 21 * x3
  7298. * r122 = r64 * x1 # <<<<<<<<<<<<<<
  7299. * r123 = r81 * y3
  7300. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  7301. */
  7302. __pyx_v_r122 = (__pyx_v_r64 * __pyx_v_x1);
  7303. /* "fontTools/pens/momentsPen.py":578
  7304. * r121 = 21 * x3
  7305. * r122 = r64 * x1
  7306. * r123 = r81 * y3 # <<<<<<<<<<<<<<
  7307. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  7308. * r125 = y2**3
  7309. */
  7310. __pyx_v_r123 = (__pyx_v_r81 * __pyx_v_y3);
  7311. /* "fontTools/pens/momentsPen.py":579
  7312. * r122 = r64 * x1
  7313. * r123 = r81 * y3
  7314. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1 # <<<<<<<<<<<<<<
  7315. * r125 = y2**3
  7316. * r126 = y3**3
  7317. */
  7318. __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));
  7319. /* "fontTools/pens/momentsPen.py":580
  7320. * r123 = r81 * y3
  7321. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  7322. * r125 = y2**3 # <<<<<<<<<<<<<<
  7323. * r126 = y3**3
  7324. * r127 = y1**3
  7325. */
  7326. __pyx_v_r125 = pow(__pyx_v_y2, 3.0);
  7327. /* "fontTools/pens/momentsPen.py":581
  7328. * r124 = 30 * r27 * y1 + r49 * x2 + 14 * r52 + 126 * r53 * x1
  7329. * r125 = y2**3
  7330. * r126 = y3**3 # <<<<<<<<<<<<<<
  7331. * r127 = y1**3
  7332. * r128 = y0**3
  7333. */
  7334. __pyx_v_r126 = pow(__pyx_v_y3, 3.0);
  7335. /* "fontTools/pens/momentsPen.py":582
  7336. * r125 = y2**3
  7337. * r126 = y3**3
  7338. * r127 = y1**3 # <<<<<<<<<<<<<<
  7339. * r128 = y0**3
  7340. * r129 = r51 * y2
  7341. */
  7342. __pyx_v_r127 = pow(__pyx_v_y1, 3.0);
  7343. /* "fontTools/pens/momentsPen.py":583
  7344. * r126 = y3**3
  7345. * r127 = y1**3
  7346. * r128 = y0**3 # <<<<<<<<<<<<<<
  7347. * r129 = r51 * y2
  7348. * r130 = r112 * y3 + r21 * r51
  7349. */
  7350. __pyx_v_r128 = pow(__pyx_v_y0, 3.0);
  7351. /* "fontTools/pens/momentsPen.py":584
  7352. * r127 = y1**3
  7353. * r128 = y0**3
  7354. * r129 = r51 * y2 # <<<<<<<<<<<<<<
  7355. * r130 = r112 * y3 + r21 * r51
  7356. * r131 = 189 * r53
  7357. */
  7358. __pyx_v_r129 = (__pyx_v_r51 * __pyx_v_y2);
  7359. /* "fontTools/pens/momentsPen.py":585
  7360. * r128 = y0**3
  7361. * r129 = r51 * y2
  7362. * r130 = r112 * y3 + r21 * r51 # <<<<<<<<<<<<<<
  7363. * r131 = 189 * r53
  7364. * r132 = 90 * y2
  7365. */
  7366. __pyx_v_r130 = ((__pyx_v_r112 * __pyx_v_y3) + (__pyx_v_r21 * __pyx_v_r51));
  7367. /* "fontTools/pens/momentsPen.py":586
  7368. * r129 = r51 * y2
  7369. * r130 = r112 * y3 + r21 * r51
  7370. * r131 = 189 * r53 # <<<<<<<<<<<<<<
  7371. * r132 = 90 * y2
  7372. *
  7373. */
  7374. __pyx_v_r131 = (189.0 * __pyx_v_r53);
  7375. /* "fontTools/pens/momentsPen.py":587
  7376. * r130 = r112 * y3 + r21 * r51
  7377. * r131 = 189 * r53
  7378. * r132 = 90 * y2 # <<<<<<<<<<<<<<
  7379. *
  7380. * self.area += (
  7381. */
  7382. __pyx_v_r132 = (90.0 * __pyx_v_y2);
  7383. /* "fontTools/pens/momentsPen.py":589
  7384. * r132 = 90 * y2
  7385. *
  7386. * self.area += ( # <<<<<<<<<<<<<<
  7387. * -r1 / 20
  7388. * - r3 / 20
  7389. */
  7390. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_area); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 589, __pyx_L1_error)
  7391. __Pyx_GOTREF(__pyx_t_3);
  7392. /* "fontTools/pens/momentsPen.py":596
  7393. * + 3 * x1 * (y2 + y3) / 20
  7394. * + 3 * x2 * y3 / 10
  7395. * - y0 * (r5 + r6 + x3) / 20 # <<<<<<<<<<<<<<
  7396. * )
  7397. * self.momentX += (
  7398. */
  7399. __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, 596, __pyx_L1_error)
  7400. __Pyx_GOTREF(__pyx_t_1);
  7401. /* "fontTools/pens/momentsPen.py":589
  7402. * r132 = 90 * y2
  7403. *
  7404. * self.area += ( # <<<<<<<<<<<<<<
  7405. * -r1 / 20
  7406. * - r3 / 20
  7407. */
  7408. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 589, __pyx_L1_error)
  7409. __Pyx_GOTREF(__pyx_t_2);
  7410. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7411. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7412. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_area, __pyx_t_2) < 0) __PYX_ERR(0, 589, __pyx_L1_error)
  7413. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7414. /* "fontTools/pens/momentsPen.py":598
  7415. * - y0 * (r5 + r6 + x3) / 20
  7416. * )
  7417. * self.momentX += ( # <<<<<<<<<<<<<<
  7418. * r11 / 840
  7419. * - r13 / 8
  7420. */
  7421. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 598, __pyx_L1_error)
  7422. __Pyx_GOTREF(__pyx_t_2);
  7423. /* "fontTools/pens/momentsPen.py":620
  7424. * )
  7425. * / 840
  7426. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840 # <<<<<<<<<<<<<<
  7427. * )
  7428. * self.momentY += (
  7429. */
  7430. __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, 620, __pyx_L1_error)
  7431. __Pyx_GOTREF(__pyx_t_1);
  7432. /* "fontTools/pens/momentsPen.py":598
  7433. * - y0 * (r5 + r6 + x3) / 20
  7434. * )
  7435. * self.momentX += ( # <<<<<<<<<<<<<<
  7436. * r11 / 840
  7437. * - r13 / 8
  7438. */
  7439. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
  7440. __Pyx_GOTREF(__pyx_t_3);
  7441. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7442. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7443. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentX, __pyx_t_3) < 0) __PYX_ERR(0, 598, __pyx_L1_error)
  7444. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7445. /* "fontTools/pens/momentsPen.py":622
  7446. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840
  7447. * )
  7448. * self.momentY += ( # <<<<<<<<<<<<<<
  7449. * -r4 * (r25 + r58) / 840
  7450. * - r47 / 8
  7451. */
  7452. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 622, __pyx_L1_error)
  7453. __Pyx_GOTREF(__pyx_t_3);
  7454. /* "fontTools/pens/momentsPen.py":645
  7455. * + x1 * (r24 * y1 + 10 * r51 + r59 + r60 + r7 * y3) / 280
  7456. * + x2 * y3 * (r15 + r8) / 56
  7457. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840 # <<<<<<<<<<<<<<
  7458. * )
  7459. * self.momentXX += (
  7460. */
  7461. __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, 645, __pyx_L1_error)
  7462. __Pyx_GOTREF(__pyx_t_1);
  7463. /* "fontTools/pens/momentsPen.py":622
  7464. * - y0 * (r17 + r30 * x2 + r31 * x1 + r32 + r33 + 18 * r9) / 840
  7465. * )
  7466. * self.momentY += ( # <<<<<<<<<<<<<<
  7467. * -r4 * (r25 + r58) / 840
  7468. * - r47 / 8
  7469. */
  7470. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
  7471. __Pyx_GOTREF(__pyx_t_2);
  7472. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7473. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7474. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentY, __pyx_t_2) < 0) __PYX_ERR(0, 622, __pyx_L1_error)
  7475. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7476. /* "fontTools/pens/momentsPen.py":647
  7477. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840
  7478. * )
  7479. * self.momentXX += ( # <<<<<<<<<<<<<<
  7480. * -r12 * r72 * (-r40 + r8) / 9240
  7481. * + 3 * r18 * (r28 + r34 - r38 * y1 + r75) / 3080
  7482. */
  7483. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXX); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 647, __pyx_L1_error)
  7484. __Pyx_GOTREF(__pyx_t_2);
  7485. /* "fontTools/pens/momentsPen.py":705
  7486. * )
  7487. * / 9240
  7488. * - y0 # <<<<<<<<<<<<<<
  7489. * * (
  7490. * r12 * r56
  7491. */
  7492. __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, 705, __pyx_L1_error)
  7493. __Pyx_GOTREF(__pyx_t_1);
  7494. /* "fontTools/pens/momentsPen.py":647
  7495. * - y0 * (r16 * y1 + r31 * y2 + r44 * x2 + r45 + r61 - r62 * x1) / 840
  7496. * )
  7497. * self.momentXX += ( # <<<<<<<<<<<<<<
  7498. * -r12 * r72 * (-r40 + r8) / 9240
  7499. * + 3 * r18 * (r28 + r34 - r38 * y1 + r75) / 3080
  7500. */
  7501. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 647, __pyx_L1_error)
  7502. __Pyx_GOTREF(__pyx_t_3);
  7503. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7504. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7505. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXX, __pyx_t_3) < 0) __PYX_ERR(0, 647, __pyx_L1_error)
  7506. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7507. /* "fontTools/pens/momentsPen.py":720
  7508. * / 9240
  7509. * )
  7510. * self.momentXY += ( # <<<<<<<<<<<<<<
  7511. * -r103 * r12 / 18480
  7512. * - r12 * r51 / 8
  7513. */
  7514. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentXY); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 720, __pyx_L1_error)
  7515. __Pyx_GOTREF(__pyx_t_3);
  7516. /* "fontTools/pens/momentsPen.py":782
  7517. * )
  7518. * / 3080
  7519. * - y0 # <<<<<<<<<<<<<<
  7520. * * (
  7521. * 54 * r101
  7522. */
  7523. __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, 782, __pyx_L1_error)
  7524. __Pyx_GOTREF(__pyx_t_1);
  7525. /* "fontTools/pens/momentsPen.py":720
  7526. * / 9240
  7527. * )
  7528. * self.momentXY += ( # <<<<<<<<<<<<<<
  7529. * -r103 * r12 / 18480
  7530. * - r12 * r51 / 8
  7531. */
  7532. __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L1_error)
  7533. __Pyx_GOTREF(__pyx_t_2);
  7534. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7535. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7536. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentXY, __pyx_t_2) < 0) __PYX_ERR(0, 720, __pyx_L1_error)
  7537. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7538. /* "fontTools/pens/momentsPen.py":800
  7539. * / 9240
  7540. * )
  7541. * self.momentYY += ( # <<<<<<<<<<<<<<
  7542. * -r103 * r116 / 9240
  7543. * - r125 * r70 / 9240
  7544. */
  7545. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_momentYY); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 800, __pyx_L1_error)
  7546. __Pyx_GOTREF(__pyx_t_2);
  7547. /* "fontTools/pens/momentsPen.py":848
  7548. * / 3080
  7549. * + 3 * x2 * y3 * (r48 + r66 + r8 * y3) / 220
  7550. * - y0 # <<<<<<<<<<<<<<
  7551. * * (
  7552. * r100 * r46
  7553. */
  7554. __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, 848, __pyx_L1_error)
  7555. __Pyx_GOTREF(__pyx_t_1);
  7556. /* "fontTools/pens/momentsPen.py":800
  7557. * / 9240
  7558. * )
  7559. * self.momentYY += ( # <<<<<<<<<<<<<<
  7560. * -r103 * r116 / 9240
  7561. * - r125 * r70 / 9240
  7562. */
  7563. __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 800, __pyx_L1_error)
  7564. __Pyx_GOTREF(__pyx_t_3);
  7565. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7566. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7567. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_momentYY, __pyx_t_3) < 0) __PYX_ERR(0, 800, __pyx_L1_error)
  7568. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7569. /* "fontTools/pens/momentsPen.py":312
  7570. * )
  7571. *
  7572. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7573. * @cython.locals(r1=cython.double)
  7574. * @cython.locals(r2=cython.double)
  7575. */
  7576. /* function exit code */
  7577. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  7578. goto __pyx_L0;
  7579. __pyx_L1_error:;
  7580. __Pyx_XDECREF(__pyx_t_1);
  7581. __Pyx_XDECREF(__pyx_t_2);
  7582. __Pyx_XDECREF(__pyx_t_3);
  7583. __Pyx_XDECREF(__pyx_t_5);
  7584. __Pyx_AddTraceback("fontTools.pens.momentsPen.MomentsPen._curveToOne", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7585. __pyx_r = NULL;
  7586. __pyx_L0:;
  7587. __Pyx_XGIVEREF(__pyx_r);
  7588. __Pyx_RefNannyFinishContext();
  7589. return __pyx_r;
  7590. }
  7591. static PyMethodDef __pyx_methods[] = {
  7592. {0, 0, 0, 0}
  7593. };
  7594. #ifndef CYTHON_SMALL_CODE
  7595. #if defined(__clang__)
  7596. #define CYTHON_SMALL_CODE
  7597. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  7598. #define CYTHON_SMALL_CODE __attribute__((cold))
  7599. #else
  7600. #define CYTHON_SMALL_CODE
  7601. #endif
  7602. #endif
  7603. /* #### Code section: pystring_table ### */
  7604. static int __Pyx_CreateStringTabAndInitStrings(void) {
  7605. __Pyx_StringTabEntry __pyx_string_tab[] = {
  7606. {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  7607. {&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
  7608. {&__pyx_n_s_BasePen, __pyx_k_BasePen, sizeof(__pyx_k_BasePen), 0, 0, 1, 1},
  7609. {&__pyx_n_s_COMPILED, __pyx_k_COMPILED, sizeof(__pyx_k_COMPILED), 0, 0, 1, 1},
  7610. {&__pyx_kp_u_Glyph_statistics_not_defined_on, __pyx_k_Glyph_statistics_not_defined_on, sizeof(__pyx_k_Glyph_statistics_not_defined_on), 0, 1, 0, 0},
  7611. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  7612. {&__pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_k_Lib_fontTools_pens_momentsPen_py, sizeof(__pyx_k_Lib_fontTools_pens_momentsPen_py), 0, 0, 1, 0},
  7613. {&__pyx_n_s_MomentsPen, __pyx_k_MomentsPen, sizeof(__pyx_k_MomentsPen), 0, 0, 1, 1},
  7614. {&__pyx_n_u_MomentsPen, __pyx_k_MomentsPen, sizeof(__pyx_k_MomentsPen), 0, 1, 0, 1},
  7615. {&__pyx_n_s_MomentsPen___init, __pyx_k_MomentsPen___init, sizeof(__pyx_k_MomentsPen___init), 0, 0, 1, 1},
  7616. {&__pyx_n_s_MomentsPen__closePath, __pyx_k_MomentsPen__closePath, sizeof(__pyx_k_MomentsPen__closePath), 0, 0, 1, 1},
  7617. {&__pyx_n_s_MomentsPen__curveToOne, __pyx_k_MomentsPen__curveToOne, sizeof(__pyx_k_MomentsPen__curveToOne), 0, 0, 1, 1},
  7618. {&__pyx_n_s_MomentsPen__endPath, __pyx_k_MomentsPen__endPath, sizeof(__pyx_k_MomentsPen__endPath), 0, 0, 1, 1},
  7619. {&__pyx_n_s_MomentsPen__lineTo, __pyx_k_MomentsPen__lineTo, sizeof(__pyx_k_MomentsPen__lineTo), 0, 0, 1, 1},
  7620. {&__pyx_n_s_MomentsPen__moveTo, __pyx_k_MomentsPen__moveTo, sizeof(__pyx_k_MomentsPen__moveTo), 0, 0, 1, 1},
  7621. {&__pyx_n_s_MomentsPen__qCurveToOne, __pyx_k_MomentsPen__qCurveToOne, sizeof(__pyx_k_MomentsPen__qCurveToOne), 0, 0, 1, 1},
  7622. {&__pyx_n_s_MomentsPen__startPoint, __pyx_k_MomentsPen__startPoint, sizeof(__pyx_k_MomentsPen__startPoint), 0, 0, 1, 1},
  7623. {&__pyx_n_s_OpenContourError, __pyx_k_OpenContourError, sizeof(__pyx_k_OpenContourError), 0, 0, 1, 1},
  7624. {&__pyx_n_s__16, __pyx_k__16, sizeof(__pyx_k__16), 0, 0, 1, 1},
  7625. {&__pyx_n_s_all, __pyx_k_all, sizeof(__pyx_k_all), 0, 0, 1, 1},
  7626. {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1},
  7627. {&__pyx_n_u_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 1, 0, 1},
  7628. {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  7629. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  7630. {&__pyx_n_s_closePath, __pyx_k_closePath, sizeof(__pyx_k_closePath), 0, 0, 1, 1},
  7631. {&__pyx_n_s_curveToOne, __pyx_k_curveToOne, sizeof(__pyx_k_curveToOne), 0, 0, 1, 1},
  7632. {&__pyx_n_s_cython, __pyx_k_cython, sizeof(__pyx_k_cython), 0, 0, 1, 1},
  7633. {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  7634. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  7635. {&__pyx_n_s_endPath, __pyx_k_endPath, sizeof(__pyx_k_endPath), 0, 0, 1, 1},
  7636. {&__pyx_n_s_fontTools_misc, __pyx_k_fontTools_misc, sizeof(__pyx_k_fontTools_misc), 0, 0, 1, 1},
  7637. {&__pyx_n_s_fontTools_misc_symfont, __pyx_k_fontTools_misc_symfont, sizeof(__pyx_k_fontTools_misc_symfont), 0, 0, 1, 1},
  7638. {&__pyx_n_s_fontTools_pens_basePen, __pyx_k_fontTools_pens_basePen, sizeof(__pyx_k_fontTools_pens_basePen), 0, 0, 1, 1},
  7639. {&__pyx_n_s_fontTools_pens_momentsPen, __pyx_k_fontTools_pens_momentsPen, sizeof(__pyx_k_fontTools_pens_momentsPen), 0, 0, 1, 1},
  7640. {&__pyx_n_s_getCurrentPoint, __pyx_k_getCurrentPoint, sizeof(__pyx_k_getCurrentPoint), 0, 0, 1, 1},
  7641. {&__pyx_n_s_glyphset, __pyx_k_glyphset, sizeof(__pyx_k_glyphset), 0, 0, 1, 1},
  7642. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  7643. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  7644. {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
  7645. {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  7646. {&__pyx_n_s_lineTo, __pyx_k_lineTo, sizeof(__pyx_k_lineTo), 0, 0, 1, 1},
  7647. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  7648. {&__pyx_n_u_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 1, 0, 1},
  7649. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  7650. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  7651. {&__pyx_n_s_momentX, __pyx_k_momentX, sizeof(__pyx_k_momentX), 0, 0, 1, 1},
  7652. {&__pyx_n_u_momentX, __pyx_k_momentX, sizeof(__pyx_k_momentX), 0, 1, 0, 1},
  7653. {&__pyx_n_s_momentXX, __pyx_k_momentXX, sizeof(__pyx_k_momentXX), 0, 0, 1, 1},
  7654. {&__pyx_n_u_momentXX, __pyx_k_momentXX, sizeof(__pyx_k_momentXX), 0, 1, 0, 1},
  7655. {&__pyx_n_s_momentXY, __pyx_k_momentXY, sizeof(__pyx_k_momentXY), 0, 0, 1, 1},
  7656. {&__pyx_n_u_momentXY, __pyx_k_momentXY, sizeof(__pyx_k_momentXY), 0, 1, 0, 1},
  7657. {&__pyx_n_s_momentY, __pyx_k_momentY, sizeof(__pyx_k_momentY), 0, 0, 1, 1},
  7658. {&__pyx_n_u_momentY, __pyx_k_momentY, sizeof(__pyx_k_momentY), 0, 1, 0, 1},
  7659. {&__pyx_n_s_momentYY, __pyx_k_momentYY, sizeof(__pyx_k_momentYY), 0, 0, 1, 1},
  7660. {&__pyx_n_u_momentYY, __pyx_k_momentYY, sizeof(__pyx_k_momentYY), 0, 1, 0, 1},
  7661. {&__pyx_n_s_moveTo, __pyx_k_moveTo, sizeof(__pyx_k_moveTo), 0, 0, 1, 1},
  7662. {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
  7663. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  7664. {&__pyx_n_s_p0, __pyx_k_p0, sizeof(__pyx_k_p0), 0, 0, 1, 1},
  7665. {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
  7666. {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
  7667. {&__pyx_n_s_p3, __pyx_k_p3, sizeof(__pyx_k_p3), 0, 0, 1, 1},
  7668. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  7669. {&__pyx_n_s_printGreenPen, __pyx_k_printGreenPen, sizeof(__pyx_k_printGreenPen), 0, 0, 1, 1},
  7670. {&__pyx_n_s_qCurveToOne, __pyx_k_qCurveToOne, sizeof(__pyx_k_qCurveToOne), 0, 0, 1, 1},
  7671. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  7672. {&__pyx_n_s_r0, __pyx_k_r0, sizeof(__pyx_k_r0), 0, 0, 1, 1},
  7673. {&__pyx_n_s_r1, __pyx_k_r1, sizeof(__pyx_k_r1), 0, 0, 1, 1},
  7674. {&__pyx_n_s_r10, __pyx_k_r10, sizeof(__pyx_k_r10), 0, 0, 1, 1},
  7675. {&__pyx_n_s_r100, __pyx_k_r100, sizeof(__pyx_k_r100), 0, 0, 1, 1},
  7676. {&__pyx_n_s_r101, __pyx_k_r101, sizeof(__pyx_k_r101), 0, 0, 1, 1},
  7677. {&__pyx_n_s_r102, __pyx_k_r102, sizeof(__pyx_k_r102), 0, 0, 1, 1},
  7678. {&__pyx_n_s_r103, __pyx_k_r103, sizeof(__pyx_k_r103), 0, 0, 1, 1},
  7679. {&__pyx_n_s_r104, __pyx_k_r104, sizeof(__pyx_k_r104), 0, 0, 1, 1},
  7680. {&__pyx_n_s_r105, __pyx_k_r105, sizeof(__pyx_k_r105), 0, 0, 1, 1},
  7681. {&__pyx_n_s_r106, __pyx_k_r106, sizeof(__pyx_k_r106), 0, 0, 1, 1},
  7682. {&__pyx_n_s_r107, __pyx_k_r107, sizeof(__pyx_k_r107), 0, 0, 1, 1},
  7683. {&__pyx_n_s_r108, __pyx_k_r108, sizeof(__pyx_k_r108), 0, 0, 1, 1},
  7684. {&__pyx_n_s_r109, __pyx_k_r109, sizeof(__pyx_k_r109), 0, 0, 1, 1},
  7685. {&__pyx_n_s_r11, __pyx_k_r11, sizeof(__pyx_k_r11), 0, 0, 1, 1},
  7686. {&__pyx_n_s_r110, __pyx_k_r110, sizeof(__pyx_k_r110), 0, 0, 1, 1},
  7687. {&__pyx_n_s_r111, __pyx_k_r111, sizeof(__pyx_k_r111), 0, 0, 1, 1},
  7688. {&__pyx_n_s_r112, __pyx_k_r112, sizeof(__pyx_k_r112), 0, 0, 1, 1},
  7689. {&__pyx_n_s_r113, __pyx_k_r113, sizeof(__pyx_k_r113), 0, 0, 1, 1},
  7690. {&__pyx_n_s_r114, __pyx_k_r114, sizeof(__pyx_k_r114), 0, 0, 1, 1},
  7691. {&__pyx_n_s_r115, __pyx_k_r115, sizeof(__pyx_k_r115), 0, 0, 1, 1},
  7692. {&__pyx_n_s_r116, __pyx_k_r116, sizeof(__pyx_k_r116), 0, 0, 1, 1},
  7693. {&__pyx_n_s_r117, __pyx_k_r117, sizeof(__pyx_k_r117), 0, 0, 1, 1},
  7694. {&__pyx_n_s_r118, __pyx_k_r118, sizeof(__pyx_k_r118), 0, 0, 1, 1},
  7695. {&__pyx_n_s_r119, __pyx_k_r119, sizeof(__pyx_k_r119), 0, 0, 1, 1},
  7696. {&__pyx_n_s_r12, __pyx_k_r12, sizeof(__pyx_k_r12), 0, 0, 1, 1},
  7697. {&__pyx_n_s_r120, __pyx_k_r120, sizeof(__pyx_k_r120), 0, 0, 1, 1},
  7698. {&__pyx_n_s_r121, __pyx_k_r121, sizeof(__pyx_k_r121), 0, 0, 1, 1},
  7699. {&__pyx_n_s_r122, __pyx_k_r122, sizeof(__pyx_k_r122), 0, 0, 1, 1},
  7700. {&__pyx_n_s_r123, __pyx_k_r123, sizeof(__pyx_k_r123), 0, 0, 1, 1},
  7701. {&__pyx_n_s_r124, __pyx_k_r124, sizeof(__pyx_k_r124), 0, 0, 1, 1},
  7702. {&__pyx_n_s_r125, __pyx_k_r125, sizeof(__pyx_k_r125), 0, 0, 1, 1},
  7703. {&__pyx_n_s_r126, __pyx_k_r126, sizeof(__pyx_k_r126), 0, 0, 1, 1},
  7704. {&__pyx_n_s_r127, __pyx_k_r127, sizeof(__pyx_k_r127), 0, 0, 1, 1},
  7705. {&__pyx_n_s_r128, __pyx_k_r128, sizeof(__pyx_k_r128), 0, 0, 1, 1},
  7706. {&__pyx_n_s_r129, __pyx_k_r129, sizeof(__pyx_k_r129), 0, 0, 1, 1},
  7707. {&__pyx_n_s_r13, __pyx_k_r13, sizeof(__pyx_k_r13), 0, 0, 1, 1},
  7708. {&__pyx_n_s_r130, __pyx_k_r130, sizeof(__pyx_k_r130), 0, 0, 1, 1},
  7709. {&__pyx_n_s_r131, __pyx_k_r131, sizeof(__pyx_k_r131), 0, 0, 1, 1},
  7710. {&__pyx_n_s_r132, __pyx_k_r132, sizeof(__pyx_k_r132), 0, 0, 1, 1},
  7711. {&__pyx_n_s_r14, __pyx_k_r14, sizeof(__pyx_k_r14), 0, 0, 1, 1},
  7712. {&__pyx_n_s_r15, __pyx_k_r15, sizeof(__pyx_k_r15), 0, 0, 1, 1},
  7713. {&__pyx_n_s_r16, __pyx_k_r16, sizeof(__pyx_k_r16), 0, 0, 1, 1},
  7714. {&__pyx_n_s_r17, __pyx_k_r17, sizeof(__pyx_k_r17), 0, 0, 1, 1},
  7715. {&__pyx_n_s_r18, __pyx_k_r18, sizeof(__pyx_k_r18), 0, 0, 1, 1},
  7716. {&__pyx_n_s_r19, __pyx_k_r19, sizeof(__pyx_k_r19), 0, 0, 1, 1},
  7717. {&__pyx_n_s_r2, __pyx_k_r2, sizeof(__pyx_k_r2), 0, 0, 1, 1},
  7718. {&__pyx_n_s_r20, __pyx_k_r20, sizeof(__pyx_k_r20), 0, 0, 1, 1},
  7719. {&__pyx_n_s_r21, __pyx_k_r21, sizeof(__pyx_k_r21), 0, 0, 1, 1},
  7720. {&__pyx_n_s_r22, __pyx_k_r22, sizeof(__pyx_k_r22), 0, 0, 1, 1},
  7721. {&__pyx_n_s_r23, __pyx_k_r23, sizeof(__pyx_k_r23), 0, 0, 1, 1},
  7722. {&__pyx_n_s_r24, __pyx_k_r24, sizeof(__pyx_k_r24), 0, 0, 1, 1},
  7723. {&__pyx_n_s_r25, __pyx_k_r25, sizeof(__pyx_k_r25), 0, 0, 1, 1},
  7724. {&__pyx_n_s_r26, __pyx_k_r26, sizeof(__pyx_k_r26), 0, 0, 1, 1},
  7725. {&__pyx_n_s_r27, __pyx_k_r27, sizeof(__pyx_k_r27), 0, 0, 1, 1},
  7726. {&__pyx_n_s_r28, __pyx_k_r28, sizeof(__pyx_k_r28), 0, 0, 1, 1},
  7727. {&__pyx_n_s_r29, __pyx_k_r29, sizeof(__pyx_k_r29), 0, 0, 1, 1},
  7728. {&__pyx_n_s_r3, __pyx_k_r3, sizeof(__pyx_k_r3), 0, 0, 1, 1},
  7729. {&__pyx_n_s_r30, __pyx_k_r30, sizeof(__pyx_k_r30), 0, 0, 1, 1},
  7730. {&__pyx_n_s_r31, __pyx_k_r31, sizeof(__pyx_k_r31), 0, 0, 1, 1},
  7731. {&__pyx_n_s_r32, __pyx_k_r32, sizeof(__pyx_k_r32), 0, 0, 1, 1},
  7732. {&__pyx_n_s_r33, __pyx_k_r33, sizeof(__pyx_k_r33), 0, 0, 1, 1},
  7733. {&__pyx_n_s_r34, __pyx_k_r34, sizeof(__pyx_k_r34), 0, 0, 1, 1},
  7734. {&__pyx_n_s_r35, __pyx_k_r35, sizeof(__pyx_k_r35), 0, 0, 1, 1},
  7735. {&__pyx_n_s_r36, __pyx_k_r36, sizeof(__pyx_k_r36), 0, 0, 1, 1},
  7736. {&__pyx_n_s_r37, __pyx_k_r37, sizeof(__pyx_k_r37), 0, 0, 1, 1},
  7737. {&__pyx_n_s_r38, __pyx_k_r38, sizeof(__pyx_k_r38), 0, 0, 1, 1},
  7738. {&__pyx_n_s_r39, __pyx_k_r39, sizeof(__pyx_k_r39), 0, 0, 1, 1},
  7739. {&__pyx_n_s_r4, __pyx_k_r4, sizeof(__pyx_k_r4), 0, 0, 1, 1},
  7740. {&__pyx_n_s_r40, __pyx_k_r40, sizeof(__pyx_k_r40), 0, 0, 1, 1},
  7741. {&__pyx_n_s_r41, __pyx_k_r41, sizeof(__pyx_k_r41), 0, 0, 1, 1},
  7742. {&__pyx_n_s_r42, __pyx_k_r42, sizeof(__pyx_k_r42), 0, 0, 1, 1},
  7743. {&__pyx_n_s_r43, __pyx_k_r43, sizeof(__pyx_k_r43), 0, 0, 1, 1},
  7744. {&__pyx_n_s_r44, __pyx_k_r44, sizeof(__pyx_k_r44), 0, 0, 1, 1},
  7745. {&__pyx_n_s_r45, __pyx_k_r45, sizeof(__pyx_k_r45), 0, 0, 1, 1},
  7746. {&__pyx_n_s_r46, __pyx_k_r46, sizeof(__pyx_k_r46), 0, 0, 1, 1},
  7747. {&__pyx_n_s_r47, __pyx_k_r47, sizeof(__pyx_k_r47), 0, 0, 1, 1},
  7748. {&__pyx_n_s_r48, __pyx_k_r48, sizeof(__pyx_k_r48), 0, 0, 1, 1},
  7749. {&__pyx_n_s_r49, __pyx_k_r49, sizeof(__pyx_k_r49), 0, 0, 1, 1},
  7750. {&__pyx_n_s_r5, __pyx_k_r5, sizeof(__pyx_k_r5), 0, 0, 1, 1},
  7751. {&__pyx_n_s_r50, __pyx_k_r50, sizeof(__pyx_k_r50), 0, 0, 1, 1},
  7752. {&__pyx_n_s_r51, __pyx_k_r51, sizeof(__pyx_k_r51), 0, 0, 1, 1},
  7753. {&__pyx_n_s_r52, __pyx_k_r52, sizeof(__pyx_k_r52), 0, 0, 1, 1},
  7754. {&__pyx_n_s_r53, __pyx_k_r53, sizeof(__pyx_k_r53), 0, 0, 1, 1},
  7755. {&__pyx_n_s_r54, __pyx_k_r54, sizeof(__pyx_k_r54), 0, 0, 1, 1},
  7756. {&__pyx_n_s_r55, __pyx_k_r55, sizeof(__pyx_k_r55), 0, 0, 1, 1},
  7757. {&__pyx_n_s_r56, __pyx_k_r56, sizeof(__pyx_k_r56), 0, 0, 1, 1},
  7758. {&__pyx_n_s_r57, __pyx_k_r57, sizeof(__pyx_k_r57), 0, 0, 1, 1},
  7759. {&__pyx_n_s_r58, __pyx_k_r58, sizeof(__pyx_k_r58), 0, 0, 1, 1},
  7760. {&__pyx_n_s_r59, __pyx_k_r59, sizeof(__pyx_k_r59), 0, 0, 1, 1},
  7761. {&__pyx_n_s_r6, __pyx_k_r6, sizeof(__pyx_k_r6), 0, 0, 1, 1},
  7762. {&__pyx_n_s_r60, __pyx_k_r60, sizeof(__pyx_k_r60), 0, 0, 1, 1},
  7763. {&__pyx_n_s_r61, __pyx_k_r61, sizeof(__pyx_k_r61), 0, 0, 1, 1},
  7764. {&__pyx_n_s_r62, __pyx_k_r62, sizeof(__pyx_k_r62), 0, 0, 1, 1},
  7765. {&__pyx_n_s_r63, __pyx_k_r63, sizeof(__pyx_k_r63), 0, 0, 1, 1},
  7766. {&__pyx_n_s_r64, __pyx_k_r64, sizeof(__pyx_k_r64), 0, 0, 1, 1},
  7767. {&__pyx_n_s_r65, __pyx_k_r65, sizeof(__pyx_k_r65), 0, 0, 1, 1},
  7768. {&__pyx_n_s_r66, __pyx_k_r66, sizeof(__pyx_k_r66), 0, 0, 1, 1},
  7769. {&__pyx_n_s_r67, __pyx_k_r67, sizeof(__pyx_k_r67), 0, 0, 1, 1},
  7770. {&__pyx_n_s_r68, __pyx_k_r68, sizeof(__pyx_k_r68), 0, 0, 1, 1},
  7771. {&__pyx_n_s_r69, __pyx_k_r69, sizeof(__pyx_k_r69), 0, 0, 1, 1},
  7772. {&__pyx_n_s_r7, __pyx_k_r7, sizeof(__pyx_k_r7), 0, 0, 1, 1},
  7773. {&__pyx_n_s_r70, __pyx_k_r70, sizeof(__pyx_k_r70), 0, 0, 1, 1},
  7774. {&__pyx_n_s_r71, __pyx_k_r71, sizeof(__pyx_k_r71), 0, 0, 1, 1},
  7775. {&__pyx_n_s_r72, __pyx_k_r72, sizeof(__pyx_k_r72), 0, 0, 1, 1},
  7776. {&__pyx_n_s_r73, __pyx_k_r73, sizeof(__pyx_k_r73), 0, 0, 1, 1},
  7777. {&__pyx_n_s_r74, __pyx_k_r74, sizeof(__pyx_k_r74), 0, 0, 1, 1},
  7778. {&__pyx_n_s_r75, __pyx_k_r75, sizeof(__pyx_k_r75), 0, 0, 1, 1},
  7779. {&__pyx_n_s_r76, __pyx_k_r76, sizeof(__pyx_k_r76), 0, 0, 1, 1},
  7780. {&__pyx_n_s_r77, __pyx_k_r77, sizeof(__pyx_k_r77), 0, 0, 1, 1},
  7781. {&__pyx_n_s_r78, __pyx_k_r78, sizeof(__pyx_k_r78), 0, 0, 1, 1},
  7782. {&__pyx_n_s_r79, __pyx_k_r79, sizeof(__pyx_k_r79), 0, 0, 1, 1},
  7783. {&__pyx_n_s_r8, __pyx_k_r8, sizeof(__pyx_k_r8), 0, 0, 1, 1},
  7784. {&__pyx_n_s_r80, __pyx_k_r80, sizeof(__pyx_k_r80), 0, 0, 1, 1},
  7785. {&__pyx_n_s_r81, __pyx_k_r81, sizeof(__pyx_k_r81), 0, 0, 1, 1},
  7786. {&__pyx_n_s_r82, __pyx_k_r82, sizeof(__pyx_k_r82), 0, 0, 1, 1},
  7787. {&__pyx_n_s_r83, __pyx_k_r83, sizeof(__pyx_k_r83), 0, 0, 1, 1},
  7788. {&__pyx_n_s_r84, __pyx_k_r84, sizeof(__pyx_k_r84), 0, 0, 1, 1},
  7789. {&__pyx_n_s_r85, __pyx_k_r85, sizeof(__pyx_k_r85), 0, 0, 1, 1},
  7790. {&__pyx_n_s_r86, __pyx_k_r86, sizeof(__pyx_k_r86), 0, 0, 1, 1},
  7791. {&__pyx_n_s_r87, __pyx_k_r87, sizeof(__pyx_k_r87), 0, 0, 1, 1},
  7792. {&__pyx_n_s_r88, __pyx_k_r88, sizeof(__pyx_k_r88), 0, 0, 1, 1},
  7793. {&__pyx_n_s_r89, __pyx_k_r89, sizeof(__pyx_k_r89), 0, 0, 1, 1},
  7794. {&__pyx_n_s_r9, __pyx_k_r9, sizeof(__pyx_k_r9), 0, 0, 1, 1},
  7795. {&__pyx_n_s_r90, __pyx_k_r90, sizeof(__pyx_k_r90), 0, 0, 1, 1},
  7796. {&__pyx_n_s_r91, __pyx_k_r91, sizeof(__pyx_k_r91), 0, 0, 1, 1},
  7797. {&__pyx_n_s_r92, __pyx_k_r92, sizeof(__pyx_k_r92), 0, 0, 1, 1},
  7798. {&__pyx_n_s_r93, __pyx_k_r93, sizeof(__pyx_k_r93), 0, 0, 1, 1},
  7799. {&__pyx_n_s_r94, __pyx_k_r94, sizeof(__pyx_k_r94), 0, 0, 1, 1},
  7800. {&__pyx_n_s_r95, __pyx_k_r95, sizeof(__pyx_k_r95), 0, 0, 1, 1},
  7801. {&__pyx_n_s_r96, __pyx_k_r96, sizeof(__pyx_k_r96), 0, 0, 1, 1},
  7802. {&__pyx_n_s_r97, __pyx_k_r97, sizeof(__pyx_k_r97), 0, 0, 1, 1},
  7803. {&__pyx_n_s_r98, __pyx_k_r98, sizeof(__pyx_k_r98), 0, 0, 1, 1},
  7804. {&__pyx_n_s_r99, __pyx_k_r99, sizeof(__pyx_k_r99), 0, 0, 1, 1},
  7805. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  7806. {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  7807. {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  7808. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  7809. {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  7810. {&__pyx_n_s_x0, __pyx_k_x0, sizeof(__pyx_k_x0), 0, 0, 1, 1},
  7811. {&__pyx_n_s_x1, __pyx_k_x1, sizeof(__pyx_k_x1), 0, 0, 1, 1},
  7812. {&__pyx_n_s_x2, __pyx_k_x2, sizeof(__pyx_k_x2), 0, 0, 1, 1},
  7813. {&__pyx_n_s_x3, __pyx_k_x3, sizeof(__pyx_k_x3), 0, 0, 1, 1},
  7814. {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  7815. {&__pyx_n_s_y0, __pyx_k_y0, sizeof(__pyx_k_y0), 0, 0, 1, 1},
  7816. {&__pyx_n_s_y1, __pyx_k_y1, sizeof(__pyx_k_y1), 0, 0, 1, 1},
  7817. {&__pyx_n_s_y2, __pyx_k_y2, sizeof(__pyx_k_y2), 0, 0, 1, 1},
  7818. {&__pyx_n_s_y3, __pyx_k_y3, sizeof(__pyx_k_y3), 0, 0, 1, 1},
  7819. {0, 0, 0, 0, 0, 0, 0}
  7820. };
  7821. return __Pyx_InitStrings(__pyx_string_tab);
  7822. }
  7823. /* #### Code section: cached_builtins ### */
  7824. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  7825. __pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(0, 7, __pyx_L1_error)
  7826. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(0, 7, __pyx_L1_error)
  7827. return 0;
  7828. __pyx_L1_error:;
  7829. return -1;
  7830. }
  7831. /* #### Code section: cached_constants ### */
  7832. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  7833. __Pyx_RefNannyDeclarations
  7834. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  7835. /* "fontTools/pens/momentsPen.py":18
  7836. *
  7837. * class MomentsPen(BasePen):
  7838. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  7839. * BasePen.__init__(self, glyphset)
  7840. *
  7841. */
  7842. __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_glyphset); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 18, __pyx_L1_error)
  7843. __Pyx_GOTREF(__pyx_tuple__2);
  7844. __Pyx_GIVEREF(__pyx_tuple__2);
  7845. __pyx_codeobj__3 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__2, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_init, 18, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__3)) __PYX_ERR(0, 18, __pyx_L1_error)
  7846. __pyx_tuple__4 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 18, __pyx_L1_error)
  7847. __Pyx_GOTREF(__pyx_tuple__4);
  7848. __Pyx_GIVEREF(__pyx_tuple__4);
  7849. /* "fontTools/pens/momentsPen.py":28
  7850. * self.momentYY = 0
  7851. *
  7852. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  7853. * self.__startPoint = p0
  7854. *
  7855. */
  7856. __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_p0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 28, __pyx_L1_error)
  7857. __Pyx_GOTREF(__pyx_tuple__5);
  7858. __Pyx_GIVEREF(__pyx_tuple__5);
  7859. __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_moveTo, 28, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 28, __pyx_L1_error)
  7860. /* "fontTools/pens/momentsPen.py":31
  7861. * self.__startPoint = p0
  7862. *
  7863. * def _closePath(self): # <<<<<<<<<<<<<<
  7864. * p0 = self._getCurrentPoint()
  7865. * if p0 != self.__startPoint:
  7866. */
  7867. __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_closePath, 31, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 31, __pyx_L1_error)
  7868. /* "fontTools/pens/momentsPen.py":36
  7869. * self._lineTo(self.__startPoint)
  7870. *
  7871. * def _endPath(self): # <<<<<<<<<<<<<<
  7872. * p0 = self._getCurrentPoint()
  7873. * if p0 != self.__startPoint:
  7874. */
  7875. __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_endPath, 36, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 36, __pyx_L1_error)
  7876. /* "fontTools/pens/momentsPen.py":41
  7877. * raise OpenContourError("Glyph statistics not defined on open contours.")
  7878. *
  7879. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7880. * @cython.locals(r1=cython.double)
  7881. * @cython.locals(r2=cython.double)
  7882. */
  7883. __pyx_tuple__9 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_r12, __pyx_n_s_r11, __pyx_n_s_r10, __pyx_n_s_r9, __pyx_n_s_r8, __pyx_n_s_r7, __pyx_n_s_r6, __pyx_n_s_r5, __pyx_n_s_r4, __pyx_n_s_r3, __pyx_n_s_r2, __pyx_n_s_r1, __pyx_n_s_r0); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 41, __pyx_L1_error)
  7884. __Pyx_GOTREF(__pyx_tuple__9);
  7885. __Pyx_GIVEREF(__pyx_tuple__9);
  7886. __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__9, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_lineTo, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 41, __pyx_L1_error)
  7887. /* "fontTools/pens/momentsPen.py":101
  7888. * )
  7889. *
  7890. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7891. * @cython.locals(r1=cython.double)
  7892. * @cython.locals(r2=cython.double)
  7893. */
  7894. __pyx_tuple__11 = PyTuple_Pack(63, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_r53, __pyx_n_s_r52, __pyx_n_s_r51, __pyx_n_s_r50, __pyx_n_s_r49, __pyx_n_s_r48, __pyx_n_s_r47, __pyx_n_s_r46, __pyx_n_s_r45, __pyx_n_s_r44, __pyx_n_s_r43, __pyx_n_s_r42, __pyx_n_s_r41, __pyx_n_s_r40, __pyx_n_s_r39, __pyx_n_s_r38, __pyx_n_s_r37, __pyx_n_s_r36, __pyx_n_s_r35, __pyx_n_s_r34, __pyx_n_s_r33, __pyx_n_s_r32, __pyx_n_s_r31, __pyx_n_s_r30, __pyx_n_s_r29, __pyx_n_s_r28, __pyx_n_s_r27, __pyx_n_s_r26, __pyx_n_s_r25, __pyx_n_s_r24, __pyx_n_s_r23, __pyx_n_s_r22, __pyx_n_s_r21, __pyx_n_s_r20, __pyx_n_s_r19, __pyx_n_s_r18, __pyx_n_s_r17, __pyx_n_s_r16, __pyx_n_s_r15, __pyx_n_s_r14, __pyx_n_s_r13, __pyx_n_s_r12, __pyx_n_s_r11, __pyx_n_s_r10, __pyx_n_s_r9, __pyx_n_s_r8, __pyx_n_s_r7, __pyx_n_s_r6, __pyx_n_s_r5, __pyx_n_s_r4, __pyx_n_s_r3, __pyx_n_s_r2, __pyx_n_s_r1, __pyx_n_s_r0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 101, __pyx_L1_error)
  7895. __Pyx_GOTREF(__pyx_tuple__11);
  7896. __Pyx_GIVEREF(__pyx_tuple__11);
  7897. __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 63, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__11, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_qCurveToOne, 101, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 101, __pyx_L1_error)
  7898. /* "fontTools/pens/momentsPen.py":312
  7899. * )
  7900. *
  7901. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  7902. * @cython.locals(r1=cython.double)
  7903. * @cython.locals(r2=cython.double)
  7904. */
  7905. __pyx_tuple__13 = PyTuple_Pack(145, __pyx_n_s_self, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_x3, __pyx_n_s_y3, __pyx_n_s_x2, __pyx_n_s_y2, __pyx_n_s_x1, __pyx_n_s_y1, __pyx_n_s_x0, __pyx_n_s_y0, __pyx_n_s_r132, __pyx_n_s_r131, __pyx_n_s_r130, __pyx_n_s_r129, __pyx_n_s_r128, __pyx_n_s_r127, __pyx_n_s_r126, __pyx_n_s_r125, __pyx_n_s_r124, __pyx_n_s_r123, __pyx_n_s_r122, __pyx_n_s_r121, __pyx_n_s_r120, __pyx_n_s_r119, __pyx_n_s_r118, __pyx_n_s_r117, __pyx_n_s_r116, __pyx_n_s_r115, __pyx_n_s_r114, __pyx_n_s_r113, __pyx_n_s_r112, __pyx_n_s_r111, __pyx_n_s_r110, __pyx_n_s_r109, __pyx_n_s_r108, __pyx_n_s_r107, __pyx_n_s_r106, __pyx_n_s_r105, __pyx_n_s_r104, __pyx_n_s_r103, __pyx_n_s_r102, __pyx_n_s_r101, __pyx_n_s_r100, __pyx_n_s_r99, __pyx_n_s_r98, __pyx_n_s_r97, __pyx_n_s_r96, __pyx_n_s_r95, __pyx_n_s_r94, __pyx_n_s_r93, __pyx_n_s_r92, __pyx_n_s_r91, __pyx_n_s_r90, __pyx_n_s_r89, __pyx_n_s_r88, __pyx_n_s_r87, __pyx_n_s_r86, __pyx_n_s_r85, __pyx_n_s_r84, __pyx_n_s_r83, __pyx_n_s_r82, __pyx_n_s_r81, __pyx_n_s_r80, __pyx_n_s_r79, __pyx_n_s_r78, __pyx_n_s_r77, __pyx_n_s_r76, __pyx_n_s_r75, __pyx_n_s_r74, __pyx_n_s_r73, __pyx_n_s_r72, __pyx_n_s_r71, __pyx_n_s_r70, __pyx_n_s_r69, __pyx_n_s_r68, __pyx_n_s_r67, __pyx_n_s_r66, __pyx_n_s_r65, __pyx_n_s_r64, __pyx_n_s_r63, __pyx_n_s_r62, __pyx_n_s_r61, __pyx_n_s_r60, __pyx_n_s_r59, __pyx_n_s_r58, __pyx_n_s_r57, __pyx_n_s_r56, __pyx_n_s_r55, __pyx_n_s_r54, __pyx_n_s_r53, __pyx_n_s_r52, __pyx_n_s_r51, __pyx_n_s_r50, __pyx_n_s_r49, __pyx_n_s_r48, __pyx_n_s_r47, __pyx_n_s_r46, __pyx_n_s_r45, __pyx_n_s_r44, __pyx_n_s_r43, __pyx_n_s_r42, __pyx_n_s_r41, __pyx_n_s_r40, __pyx_n_s_r39, __pyx_n_s_r38, __pyx_n_s_r37, __pyx_n_s_r36, __pyx_n_s_r35, __pyx_n_s_r34, __pyx_n_s_r33, __pyx_n_s_r32, __pyx_n_s_r31, __pyx_n_s_r30, __pyx_n_s_r29, __pyx_n_s_r28, __pyx_n_s_r27, __pyx_n_s_r26, __pyx_n_s_r25, __pyx_n_s_r24, __pyx_n_s_r23, __pyx_n_s_r22, __pyx_n_s_r21, __pyx_n_s_r20, __pyx_n_s_r19, __pyx_n_s_r18, __pyx_n_s_r17, __pyx_n_s_r16, __pyx_n_s_r15, __pyx_n_s_r14, __pyx_n_s_r13, __pyx_n_s_r12, __pyx_n_s_r11, __pyx_n_s_r10, __pyx_n_s_r9, __pyx_n_s_r8, __pyx_n_s_r7, __pyx_n_s_r6, __pyx_n_s_r5, __pyx_n_s_r4, __pyx_n_s_r3, __pyx_n_s_r2, __pyx_n_s_r1, __pyx_n_s_r0); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 312, __pyx_L1_error)
  7906. __Pyx_GOTREF(__pyx_tuple__13);
  7907. __Pyx_GIVEREF(__pyx_tuple__13);
  7908. __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(4, 0, 0, 145, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_Lib_fontTools_pens_momentsPen_py, __pyx_n_s_curveToOne, 312, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 312, __pyx_L1_error)
  7909. /* "fontTools/pens/momentsPen.py":874
  7910. * "MomentsPen",
  7911. * [
  7912. * ("area", 1), # <<<<<<<<<<<<<<
  7913. * ("momentX", x),
  7914. * ("momentY", y),
  7915. */
  7916. __pyx_tuple__15 = PyTuple_Pack(2, __pyx_n_u_area, __pyx_int_1); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 874, __pyx_L1_error)
  7917. __Pyx_GOTREF(__pyx_tuple__15);
  7918. __Pyx_GIVEREF(__pyx_tuple__15);
  7919. __Pyx_RefNannyFinishContext();
  7920. return 0;
  7921. __pyx_L1_error:;
  7922. __Pyx_RefNannyFinishContext();
  7923. return -1;
  7924. }
  7925. /* #### Code section: init_constants ### */
  7926. static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
  7927. if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  7928. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  7929. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  7930. __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  7931. return 0;
  7932. __pyx_L1_error:;
  7933. return -1;
  7934. }
  7935. /* #### Code section: init_globals ### */
  7936. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  7937. return 0;
  7938. }
  7939. /* #### Code section: init_module ### */
  7940. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  7941. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  7942. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  7943. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  7944. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  7945. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  7946. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  7947. static int __Pyx_modinit_global_init_code(void) {
  7948. __Pyx_RefNannyDeclarations
  7949. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  7950. /*--- Global init code ---*/
  7951. __Pyx_RefNannyFinishContext();
  7952. return 0;
  7953. }
  7954. static int __Pyx_modinit_variable_export_code(void) {
  7955. __Pyx_RefNannyDeclarations
  7956. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  7957. /*--- Variable export code ---*/
  7958. __Pyx_RefNannyFinishContext();
  7959. return 0;
  7960. }
  7961. static int __Pyx_modinit_function_export_code(void) {
  7962. __Pyx_RefNannyDeclarations
  7963. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  7964. /*--- Function export code ---*/
  7965. __Pyx_RefNannyFinishContext();
  7966. return 0;
  7967. }
  7968. static int __Pyx_modinit_type_init_code(void) {
  7969. __Pyx_RefNannyDeclarations
  7970. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  7971. /*--- Type init code ---*/
  7972. __Pyx_RefNannyFinishContext();
  7973. return 0;
  7974. }
  7975. static int __Pyx_modinit_type_import_code(void) {
  7976. __Pyx_RefNannyDeclarations
  7977. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  7978. /*--- Type import code ---*/
  7979. __Pyx_RefNannyFinishContext();
  7980. return 0;
  7981. }
  7982. static int __Pyx_modinit_variable_import_code(void) {
  7983. __Pyx_RefNannyDeclarations
  7984. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  7985. /*--- Variable import code ---*/
  7986. __Pyx_RefNannyFinishContext();
  7987. return 0;
  7988. }
  7989. static int __Pyx_modinit_function_import_code(void) {
  7990. __Pyx_RefNannyDeclarations
  7991. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  7992. /*--- Function import code ---*/
  7993. __Pyx_RefNannyFinishContext();
  7994. return 0;
  7995. }
  7996. #if PY_MAJOR_VERSION >= 3
  7997. #if CYTHON_PEP489_MULTI_PHASE_INIT
  7998. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  7999. static int __pyx_pymod_exec_momentsPen(PyObject* module); /*proto*/
  8000. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  8001. {Py_mod_create, (void*)__pyx_pymod_create},
  8002. {Py_mod_exec, (void*)__pyx_pymod_exec_momentsPen},
  8003. {0, NULL}
  8004. };
  8005. #endif
  8006. #ifdef __cplusplus
  8007. namespace {
  8008. struct PyModuleDef __pyx_moduledef =
  8009. #else
  8010. static struct PyModuleDef __pyx_moduledef =
  8011. #endif
  8012. {
  8013. PyModuleDef_HEAD_INIT,
  8014. "momentsPen",
  8015. 0, /* m_doc */
  8016. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8017. 0, /* m_size */
  8018. #elif CYTHON_USE_MODULE_STATE
  8019. sizeof(__pyx_mstate), /* m_size */
  8020. #else
  8021. -1, /* m_size */
  8022. #endif
  8023. __pyx_methods /* m_methods */,
  8024. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8025. __pyx_moduledef_slots, /* m_slots */
  8026. #else
  8027. NULL, /* m_reload */
  8028. #endif
  8029. #if CYTHON_USE_MODULE_STATE
  8030. __pyx_m_traverse, /* m_traverse */
  8031. __pyx_m_clear, /* m_clear */
  8032. NULL /* m_free */
  8033. #else
  8034. NULL, /* m_traverse */
  8035. NULL, /* m_clear */
  8036. NULL /* m_free */
  8037. #endif
  8038. };
  8039. #ifdef __cplusplus
  8040. } /* anonymous namespace */
  8041. #endif
  8042. #endif
  8043. #ifndef CYTHON_NO_PYINIT_EXPORT
  8044. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  8045. #elif PY_MAJOR_VERSION < 3
  8046. #ifdef __cplusplus
  8047. #define __Pyx_PyMODINIT_FUNC extern "C" void
  8048. #else
  8049. #define __Pyx_PyMODINIT_FUNC void
  8050. #endif
  8051. #else
  8052. #ifdef __cplusplus
  8053. #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
  8054. #else
  8055. #define __Pyx_PyMODINIT_FUNC PyObject *
  8056. #endif
  8057. #endif
  8058. #if PY_MAJOR_VERSION < 3
  8059. __Pyx_PyMODINIT_FUNC initmomentsPen(void) CYTHON_SMALL_CODE; /*proto*/
  8060. __Pyx_PyMODINIT_FUNC initmomentsPen(void)
  8061. #else
  8062. __Pyx_PyMODINIT_FUNC PyInit_momentsPen(void) CYTHON_SMALL_CODE; /*proto*/
  8063. __Pyx_PyMODINIT_FUNC PyInit_momentsPen(void)
  8064. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8065. {
  8066. return PyModuleDef_Init(&__pyx_moduledef);
  8067. }
  8068. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  8069. #if PY_VERSION_HEX >= 0x030700A1
  8070. static PY_INT64_T main_interpreter_id = -1;
  8071. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  8072. if (main_interpreter_id == -1) {
  8073. main_interpreter_id = current_id;
  8074. return (unlikely(current_id == -1)) ? -1 : 0;
  8075. } else if (unlikely(main_interpreter_id != current_id))
  8076. #else
  8077. static PyInterpreterState *main_interpreter = NULL;
  8078. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  8079. if (!main_interpreter) {
  8080. main_interpreter = current_interpreter;
  8081. } else if (unlikely(main_interpreter != current_interpreter))
  8082. #endif
  8083. {
  8084. PyErr_SetString(
  8085. PyExc_ImportError,
  8086. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  8087. return -1;
  8088. }
  8089. return 0;
  8090. }
  8091. #if CYTHON_COMPILING_IN_LIMITED_API
  8092. static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
  8093. #else
  8094. 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)
  8095. #endif
  8096. {
  8097. PyObject *value = PyObject_GetAttrString(spec, from_name);
  8098. int result = 0;
  8099. if (likely(value)) {
  8100. if (allow_none || value != Py_None) {
  8101. #if CYTHON_COMPILING_IN_LIMITED_API
  8102. result = PyModule_AddObject(module, to_name, value);
  8103. #else
  8104. result = PyDict_SetItemString(moddict, to_name, value);
  8105. #endif
  8106. }
  8107. Py_DECREF(value);
  8108. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  8109. PyErr_Clear();
  8110. } else {
  8111. result = -1;
  8112. }
  8113. return result;
  8114. }
  8115. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
  8116. PyObject *module = NULL, *moddict, *modname;
  8117. CYTHON_UNUSED_VAR(def);
  8118. if (__Pyx_check_single_interpreter())
  8119. return NULL;
  8120. if (__pyx_m)
  8121. return __Pyx_NewRef(__pyx_m);
  8122. modname = PyObject_GetAttrString(spec, "name");
  8123. if (unlikely(!modname)) goto bad;
  8124. module = PyModule_NewObject(modname);
  8125. Py_DECREF(modname);
  8126. if (unlikely(!module)) goto bad;
  8127. #if CYTHON_COMPILING_IN_LIMITED_API
  8128. moddict = module;
  8129. #else
  8130. moddict = PyModule_GetDict(module);
  8131. if (unlikely(!moddict)) goto bad;
  8132. #endif
  8133. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  8134. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  8135. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  8136. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  8137. return module;
  8138. bad:
  8139. Py_XDECREF(module);
  8140. return NULL;
  8141. }
  8142. static CYTHON_SMALL_CODE int __pyx_pymod_exec_momentsPen(PyObject *__pyx_pyinit_module)
  8143. #endif
  8144. #endif
  8145. {
  8146. int stringtab_initialized = 0;
  8147. #if CYTHON_USE_MODULE_STATE
  8148. int pystate_addmodule_run = 0;
  8149. #endif
  8150. PyObject *__pyx_t_1 = NULL;
  8151. PyObject *__pyx_t_2 = NULL;
  8152. PyObject *__pyx_t_3 = NULL;
  8153. PyObject *__pyx_t_4 = NULL;
  8154. PyObject *__pyx_t_5 = NULL;
  8155. int __pyx_t_6;
  8156. PyObject *__pyx_t_7 = NULL;
  8157. PyObject *__pyx_t_8 = NULL;
  8158. PyObject *__pyx_t_9 = NULL;
  8159. int __pyx_t_10;
  8160. PyObject *__pyx_t_11 = NULL;
  8161. PyObject *__pyx_t_12 = NULL;
  8162. int __pyx_lineno = 0;
  8163. const char *__pyx_filename = NULL;
  8164. int __pyx_clineno = 0;
  8165. __Pyx_RefNannyDeclarations
  8166. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8167. if (__pyx_m) {
  8168. if (__pyx_m == __pyx_pyinit_module) return 0;
  8169. PyErr_SetString(PyExc_RuntimeError, "Module 'momentsPen' has already been imported. Re-initialisation is not supported.");
  8170. return -1;
  8171. }
  8172. #elif PY_MAJOR_VERSION >= 3
  8173. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  8174. #endif
  8175. /*--- Module creation code ---*/
  8176. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8177. __pyx_m = __pyx_pyinit_module;
  8178. Py_INCREF(__pyx_m);
  8179. #else
  8180. #if PY_MAJOR_VERSION < 3
  8181. __pyx_m = Py_InitModule4("momentsPen", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  8182. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  8183. #elif CYTHON_USE_MODULE_STATE
  8184. __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  8185. {
  8186. int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
  8187. __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to momentsPen pseudovariable */
  8188. if (unlikely((add_module_result < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  8189. pystate_addmodule_run = 1;
  8190. }
  8191. #else
  8192. __pyx_m = PyModule_Create(&__pyx_moduledef);
  8193. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  8194. #endif
  8195. #endif
  8196. CYTHON_UNUSED_VAR(__pyx_t_1);
  8197. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  8198. Py_INCREF(__pyx_d);
  8199. __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  8200. __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  8201. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8202. #if CYTHON_REFNANNY
  8203. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  8204. if (!__Pyx_RefNanny) {
  8205. PyErr_Clear();
  8206. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  8207. if (!__Pyx_RefNanny)
  8208. Py_FatalError("failed to import 'refnanny' module");
  8209. }
  8210. #endif
  8211. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_momentsPen(void)", 0);
  8212. 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)
  8213. #ifdef __Pxy_PyFrame_Initialize_Offsets
  8214. __Pxy_PyFrame_Initialize_Offsets();
  8215. #endif
  8216. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  8217. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  8218. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  8219. #ifdef __Pyx_CyFunction_USED
  8220. if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8221. #endif
  8222. #ifdef __Pyx_FusedFunction_USED
  8223. if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8224. #endif
  8225. #ifdef __Pyx_Coroutine_USED
  8226. if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8227. #endif
  8228. #ifdef __Pyx_Generator_USED
  8229. if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8230. #endif
  8231. #ifdef __Pyx_AsyncGen_USED
  8232. if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8233. #endif
  8234. #ifdef __Pyx_StopAsyncIteration_USED
  8235. if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8236. #endif
  8237. /*--- Library function declarations ---*/
  8238. /*--- Threads initialization code ---*/
  8239. #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  8240. PyEval_InitThreads();
  8241. #endif
  8242. /*--- Initialize various global constants etc. ---*/
  8243. if (__Pyx_InitConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8244. stringtab_initialized = 1;
  8245. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8246. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  8247. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8248. #endif
  8249. if (__pyx_module_is_main_fontTools__pens__momentsPen) {
  8250. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8251. }
  8252. #if PY_MAJOR_VERSION >= 3
  8253. {
  8254. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  8255. if (!PyDict_GetItemString(modules, "fontTools.pens.momentsPen")) {
  8256. if (unlikely((PyDict_SetItemString(modules, "fontTools.pens.momentsPen", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  8257. }
  8258. }
  8259. #endif
  8260. /*--- Builtin init code ---*/
  8261. if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8262. /*--- Constants init code ---*/
  8263. if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8264. /*--- Global type/function init code ---*/
  8265. (void)__Pyx_modinit_global_init_code();
  8266. (void)__Pyx_modinit_variable_export_code();
  8267. (void)__Pyx_modinit_function_export_code();
  8268. (void)__Pyx_modinit_type_init_code();
  8269. (void)__Pyx_modinit_type_import_code();
  8270. (void)__Pyx_modinit_variable_import_code();
  8271. (void)__Pyx_modinit_function_import_code();
  8272. /*--- Execution code ---*/
  8273. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  8274. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8275. #endif
  8276. /* "fontTools/pens/momentsPen.py":1
  8277. * from fontTools.pens.basePen import BasePen, OpenContourError # <<<<<<<<<<<<<<
  8278. *
  8279. * try:
  8280. */
  8281. __pyx_t_2 = PyList_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  8282. __Pyx_GOTREF(__pyx_t_2);
  8283. __Pyx_INCREF(__pyx_n_s_BasePen);
  8284. __Pyx_GIVEREF(__pyx_n_s_BasePen);
  8285. if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_BasePen)) __PYX_ERR(0, 1, __pyx_L1_error);
  8286. __Pyx_INCREF(__pyx_n_s_OpenContourError);
  8287. __Pyx_GIVEREF(__pyx_n_s_OpenContourError);
  8288. if (__Pyx_PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_OpenContourError)) __PYX_ERR(0, 1, __pyx_L1_error);
  8289. __pyx_t_3 = __Pyx_Import(__pyx_n_s_fontTools_pens_basePen, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  8290. __Pyx_GOTREF(__pyx_t_3);
  8291. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8292. __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_BasePen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  8293. __Pyx_GOTREF(__pyx_t_2);
  8294. if (PyDict_SetItem(__pyx_d, __pyx_n_s_BasePen, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8295. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8296. __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_OpenContourError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  8297. __Pyx_GOTREF(__pyx_t_2);
  8298. if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpenContourError, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8299. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8300. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8301. /* "fontTools/pens/momentsPen.py":3
  8302. * from fontTools.pens.basePen import BasePen, OpenContourError
  8303. *
  8304. * try: # <<<<<<<<<<<<<<
  8305. * import cython
  8306. *
  8307. */
  8308. {
  8309. __Pyx_PyThreadState_declare
  8310. __Pyx_PyThreadState_assign
  8311. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_4, &__pyx_t_5);
  8312. __Pyx_XGOTREF(__pyx_t_1);
  8313. __Pyx_XGOTREF(__pyx_t_4);
  8314. __Pyx_XGOTREF(__pyx_t_5);
  8315. /*try:*/ {
  8316. /* "fontTools/pens/momentsPen.py":6
  8317. * import cython
  8318. *
  8319. * COMPILED = cython.compiled # <<<<<<<<<<<<<<
  8320. * except (AttributeError, ImportError):
  8321. * # if cython not installed, use mock module with no-op decorators and types
  8322. */
  8323. if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_True) < 0) __PYX_ERR(0, 6, __pyx_L2_error)
  8324. /* "fontTools/pens/momentsPen.py":3
  8325. * from fontTools.pens.basePen import BasePen, OpenContourError
  8326. *
  8327. * try: # <<<<<<<<<<<<<<
  8328. * import cython
  8329. *
  8330. */
  8331. }
  8332. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  8333. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8334. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  8335. goto __pyx_L7_try_end;
  8336. __pyx_L2_error:;
  8337. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  8338. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8339. /* "fontTools/pens/momentsPen.py":7
  8340. *
  8341. * COMPILED = cython.compiled
  8342. * except (AttributeError, ImportError): # <<<<<<<<<<<<<<
  8343. * # if cython not installed, use mock module with no-op decorators and types
  8344. * from fontTools.misc import cython
  8345. */
  8346. __pyx_t_6 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_AttributeError, __pyx_builtin_ImportError);
  8347. if (__pyx_t_6) {
  8348. __Pyx_AddTraceback("fontTools.pens.momentsPen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8349. if (__Pyx_GetException(&__pyx_t_3, &__pyx_t_2, &__pyx_t_7) < 0) __PYX_ERR(0, 7, __pyx_L4_except_error)
  8350. __Pyx_XGOTREF(__pyx_t_3);
  8351. __Pyx_XGOTREF(__pyx_t_2);
  8352. __Pyx_XGOTREF(__pyx_t_7);
  8353. /* "fontTools/pens/momentsPen.py":9
  8354. * except (AttributeError, ImportError):
  8355. * # if cython not installed, use mock module with no-op decorators and types
  8356. * from fontTools.misc import cython # <<<<<<<<<<<<<<
  8357. *
  8358. * COMPILED = False
  8359. */
  8360. __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 9, __pyx_L4_except_error)
  8361. __Pyx_GOTREF(__pyx_t_8);
  8362. __Pyx_INCREF(__pyx_n_s_cython);
  8363. __Pyx_GIVEREF(__pyx_n_s_cython);
  8364. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_n_s_cython)) __PYX_ERR(0, 9, __pyx_L4_except_error);
  8365. __pyx_t_9 = __Pyx_Import(__pyx_n_s_fontTools_misc, __pyx_t_8, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 9, __pyx_L4_except_error)
  8366. __Pyx_GOTREF(__pyx_t_9);
  8367. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8368. __pyx_t_8 = __Pyx_ImportFrom(__pyx_t_9, __pyx_n_s_cython); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 9, __pyx_L4_except_error)
  8369. __Pyx_GOTREF(__pyx_t_8);
  8370. if (PyDict_SetItem(__pyx_d, __pyx_n_s_cython, __pyx_t_8) < 0) __PYX_ERR(0, 9, __pyx_L4_except_error)
  8371. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8372. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8373. /* "fontTools/pens/momentsPen.py":11
  8374. * from fontTools.misc import cython
  8375. *
  8376. * COMPILED = False # <<<<<<<<<<<<<<
  8377. *
  8378. *
  8379. */
  8380. if (PyDict_SetItem(__pyx_d, __pyx_n_s_COMPILED, Py_False) < 0) __PYX_ERR(0, 11, __pyx_L4_except_error)
  8381. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8382. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  8383. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  8384. goto __pyx_L3_exception_handled;
  8385. }
  8386. goto __pyx_L4_except_error;
  8387. /* "fontTools/pens/momentsPen.py":3
  8388. * from fontTools.pens.basePen import BasePen, OpenContourError
  8389. *
  8390. * try: # <<<<<<<<<<<<<<
  8391. * import cython
  8392. *
  8393. */
  8394. __pyx_L4_except_error:;
  8395. __Pyx_XGIVEREF(__pyx_t_1);
  8396. __Pyx_XGIVEREF(__pyx_t_4);
  8397. __Pyx_XGIVEREF(__pyx_t_5);
  8398. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
  8399. goto __pyx_L1_error;
  8400. __pyx_L3_exception_handled:;
  8401. __Pyx_XGIVEREF(__pyx_t_1);
  8402. __Pyx_XGIVEREF(__pyx_t_4);
  8403. __Pyx_XGIVEREF(__pyx_t_5);
  8404. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_4, __pyx_t_5);
  8405. __pyx_L7_try_end:;
  8406. }
  8407. /* "fontTools/pens/momentsPen.py":14
  8408. *
  8409. *
  8410. * __all__ = ["MomentsPen"] # <<<<<<<<<<<<<<
  8411. *
  8412. *
  8413. */
  8414. __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 14, __pyx_L1_error)
  8415. __Pyx_GOTREF(__pyx_t_7);
  8416. __Pyx_INCREF(__pyx_n_u_MomentsPen);
  8417. __Pyx_GIVEREF(__pyx_n_u_MomentsPen);
  8418. if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_MomentsPen)) __PYX_ERR(0, 14, __pyx_L1_error);
  8419. if (PyDict_SetItem(__pyx_d, __pyx_n_s_all, __pyx_t_7) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
  8420. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8421. /* "fontTools/pens/momentsPen.py":17
  8422. *
  8423. *
  8424. * class MomentsPen(BasePen): # <<<<<<<<<<<<<<
  8425. * def __init__(self, glyphset=None):
  8426. * BasePen.__init__(self, glyphset)
  8427. */
  8428. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_BasePen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error)
  8429. __Pyx_GOTREF(__pyx_t_7);
  8430. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  8431. __Pyx_GOTREF(__pyx_t_2);
  8432. __Pyx_GIVEREF(__pyx_t_7);
  8433. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error);
  8434. __pyx_t_7 = 0;
  8435. __pyx_t_7 = __Pyx_PEP560_update_bases(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 17, __pyx_L1_error)
  8436. __Pyx_GOTREF(__pyx_t_7);
  8437. __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
  8438. __Pyx_GOTREF(__pyx_t_3);
  8439. __pyx_t_9 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_7, __pyx_n_s_MomentsPen, __pyx_n_s_MomentsPen, (PyObject *) NULL, __pyx_n_s_fontTools_pens_momentsPen, (PyObject *) NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 17, __pyx_L1_error)
  8440. __Pyx_GOTREF(__pyx_t_9);
  8441. if (__pyx_t_7 != __pyx_t_2) {
  8442. if (unlikely((PyDict_SetItemString(__pyx_t_9, "__orig_bases__", __pyx_t_2) < 0))) __PYX_ERR(0, 17, __pyx_L1_error)
  8443. }
  8444. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8445. /* "fontTools/pens/momentsPen.py":18
  8446. *
  8447. * class MomentsPen(BasePen):
  8448. * def __init__(self, glyphset=None): # <<<<<<<<<<<<<<
  8449. * BasePen.__init__(self, glyphset)
  8450. *
  8451. */
  8452. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_1__init__, 0, __pyx_n_s_MomentsPen___init, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 18, __pyx_L1_error)
  8453. __Pyx_GOTREF(__pyx_t_2);
  8454. __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__4);
  8455. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_init, __pyx_t_2) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
  8456. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8457. /* "fontTools/pens/momentsPen.py":28
  8458. * self.momentYY = 0
  8459. *
  8460. * def _moveTo(self, p0): # <<<<<<<<<<<<<<
  8461. * self.__startPoint = p0
  8462. *
  8463. */
  8464. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_3_moveTo, 0, __pyx_n_s_MomentsPen__moveTo, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 28, __pyx_L1_error)
  8465. __Pyx_GOTREF(__pyx_t_2);
  8466. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_moveTo, __pyx_t_2) < 0) __PYX_ERR(0, 28, __pyx_L1_error)
  8467. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8468. /* "fontTools/pens/momentsPen.py":31
  8469. * self.__startPoint = p0
  8470. *
  8471. * def _closePath(self): # <<<<<<<<<<<<<<
  8472. * p0 = self._getCurrentPoint()
  8473. * if p0 != self.__startPoint:
  8474. */
  8475. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_5_closePath, 0, __pyx_n_s_MomentsPen__closePath, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 31, __pyx_L1_error)
  8476. __Pyx_GOTREF(__pyx_t_2);
  8477. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_closePath, __pyx_t_2) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
  8478. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8479. /* "fontTools/pens/momentsPen.py":36
  8480. * self._lineTo(self.__startPoint)
  8481. *
  8482. * def _endPath(self): # <<<<<<<<<<<<<<
  8483. * p0 = self._getCurrentPoint()
  8484. * if p0 != self.__startPoint:
  8485. */
  8486. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_7_endPath, 0, __pyx_n_s_MomentsPen__endPath, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 36, __pyx_L1_error)
  8487. __Pyx_GOTREF(__pyx_t_2);
  8488. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_endPath, __pyx_t_2) < 0) __PYX_ERR(0, 36, __pyx_L1_error)
  8489. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8490. /* "fontTools/pens/momentsPen.py":41
  8491. * raise OpenContourError("Glyph statistics not defined on open contours.")
  8492. *
  8493. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  8494. * @cython.locals(r1=cython.double)
  8495. * @cython.locals(r2=cython.double)
  8496. */
  8497. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_9_lineTo, 0, __pyx_n_s_MomentsPen__lineTo, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 41, __pyx_L1_error)
  8498. __Pyx_GOTREF(__pyx_t_2);
  8499. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_lineTo, __pyx_t_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
  8500. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8501. /* "fontTools/pens/momentsPen.py":101
  8502. * )
  8503. *
  8504. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  8505. * @cython.locals(r1=cython.double)
  8506. * @cython.locals(r2=cython.double)
  8507. */
  8508. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_11_qCurveToOne, 0, __pyx_n_s_MomentsPen__qCurveToOne, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
  8509. __Pyx_GOTREF(__pyx_t_2);
  8510. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_qCurveToOne, __pyx_t_2) < 0) __PYX_ERR(0, 101, __pyx_L1_error)
  8511. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8512. /* "fontTools/pens/momentsPen.py":312
  8513. * )
  8514. *
  8515. * @cython.locals(r0=cython.double) # <<<<<<<<<<<<<<
  8516. * @cython.locals(r1=cython.double)
  8517. * @cython.locals(r2=cython.double)
  8518. */
  8519. __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_9fontTools_4pens_10momentsPen_10MomentsPen_13_curveToOne, 0, __pyx_n_s_MomentsPen__curveToOne, NULL, __pyx_n_s_fontTools_pens_momentsPen, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  8520. __Pyx_GOTREF(__pyx_t_2);
  8521. if (__Pyx_SetNameInClass(__pyx_t_9, __pyx_n_s_curveToOne, __pyx_t_2) < 0) __PYX_ERR(0, 312, __pyx_L1_error)
  8522. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8523. /* "fontTools/pens/momentsPen.py":17
  8524. *
  8525. *
  8526. * class MomentsPen(BasePen): # <<<<<<<<<<<<<<
  8527. * def __init__(self, glyphset=None):
  8528. * BasePen.__init__(self, glyphset)
  8529. */
  8530. __pyx_t_2 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_MomentsPen, __pyx_t_7, __pyx_t_9, NULL, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 17, __pyx_L1_error)
  8531. __Pyx_GOTREF(__pyx_t_2);
  8532. if (PyDict_SetItem(__pyx_d, __pyx_n_s_MomentsPen, __pyx_t_2) < 0) __PYX_ERR(0, 17, __pyx_L1_error)
  8533. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8534. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8535. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8536. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8537. /* "fontTools/pens/momentsPen.py":868
  8538. *
  8539. *
  8540. * if __name__ == "__main__": # <<<<<<<<<<<<<<
  8541. * from fontTools.misc.symfont import x, y, printGreenPen
  8542. *
  8543. */
  8544. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_name); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 868, __pyx_L1_error)
  8545. __Pyx_GOTREF(__pyx_t_7);
  8546. __pyx_t_10 = (__Pyx_PyUnicode_Equals(__pyx_t_7, __pyx_n_u_main, Py_EQ)); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 868, __pyx_L1_error)
  8547. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8548. if (__pyx_t_10) {
  8549. /* "fontTools/pens/momentsPen.py":869
  8550. *
  8551. * if __name__ == "__main__":
  8552. * from fontTools.misc.symfont import x, y, printGreenPen # <<<<<<<<<<<<<<
  8553. *
  8554. * printGreenPen(
  8555. */
  8556. __pyx_t_7 = PyList_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
  8557. __Pyx_GOTREF(__pyx_t_7);
  8558. __Pyx_INCREF(__pyx_n_s_x);
  8559. __Pyx_GIVEREF(__pyx_n_s_x);
  8560. if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_x)) __PYX_ERR(0, 869, __pyx_L1_error);
  8561. __Pyx_INCREF(__pyx_n_s_y);
  8562. __Pyx_GIVEREF(__pyx_n_s_y);
  8563. if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 1, __pyx_n_s_y)) __PYX_ERR(0, 869, __pyx_L1_error);
  8564. __Pyx_INCREF(__pyx_n_s_printGreenPen);
  8565. __Pyx_GIVEREF(__pyx_n_s_printGreenPen);
  8566. if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 2, __pyx_n_s_printGreenPen)) __PYX_ERR(0, 869, __pyx_L1_error);
  8567. __pyx_t_3 = __Pyx_Import(__pyx_n_s_fontTools_misc_symfont, __pyx_t_7, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
  8568. __Pyx_GOTREF(__pyx_t_3);
  8569. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8570. __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
  8571. __Pyx_GOTREF(__pyx_t_7);
  8572. if (PyDict_SetItem(__pyx_d, __pyx_n_s_x, __pyx_t_7) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
  8573. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8574. __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
  8575. __Pyx_GOTREF(__pyx_t_7);
  8576. if (PyDict_SetItem(__pyx_d, __pyx_n_s_y, __pyx_t_7) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
  8577. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8578. __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_printGreenPen); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 869, __pyx_L1_error)
  8579. __Pyx_GOTREF(__pyx_t_7);
  8580. if (PyDict_SetItem(__pyx_d, __pyx_n_s_printGreenPen, __pyx_t_7) < 0) __PYX_ERR(0, 869, __pyx_L1_error)
  8581. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8582. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8583. /* "fontTools/pens/momentsPen.py":871
  8584. * from fontTools.misc.symfont import x, y, printGreenPen
  8585. *
  8586. * printGreenPen( # <<<<<<<<<<<<<<
  8587. * "MomentsPen",
  8588. * [
  8589. */
  8590. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_printGreenPen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
  8591. __Pyx_GOTREF(__pyx_t_3);
  8592. /* "fontTools/pens/momentsPen.py":875
  8593. * [
  8594. * ("area", 1),
  8595. * ("momentX", x), # <<<<<<<<<<<<<<
  8596. * ("momentY", y),
  8597. * ("momentXX", x**2),
  8598. */
  8599. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error)
  8600. __Pyx_GOTREF(__pyx_t_7);
  8601. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 875, __pyx_L1_error)
  8602. __Pyx_GOTREF(__pyx_t_9);
  8603. __Pyx_INCREF(__pyx_n_u_momentX);
  8604. __Pyx_GIVEREF(__pyx_n_u_momentX);
  8605. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_n_u_momentX)) __PYX_ERR(0, 875, __pyx_L1_error);
  8606. __Pyx_GIVEREF(__pyx_t_7);
  8607. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_7)) __PYX_ERR(0, 875, __pyx_L1_error);
  8608. __pyx_t_7 = 0;
  8609. /* "fontTools/pens/momentsPen.py":876
  8610. * ("area", 1),
  8611. * ("momentX", x),
  8612. * ("momentY", y), # <<<<<<<<<<<<<<
  8613. * ("momentXX", x**2),
  8614. * ("momentXY", x * y),
  8615. */
  8616. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_y); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 876, __pyx_L1_error)
  8617. __Pyx_GOTREF(__pyx_t_7);
  8618. __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
  8619. __Pyx_GOTREF(__pyx_t_2);
  8620. __Pyx_INCREF(__pyx_n_u_momentY);
  8621. __Pyx_GIVEREF(__pyx_n_u_momentY);
  8622. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_n_u_momentY)) __PYX_ERR(0, 876, __pyx_L1_error);
  8623. __Pyx_GIVEREF(__pyx_t_7);
  8624. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7)) __PYX_ERR(0, 876, __pyx_L1_error);
  8625. __pyx_t_7 = 0;
  8626. /* "fontTools/pens/momentsPen.py":877
  8627. * ("momentX", x),
  8628. * ("momentY", y),
  8629. * ("momentXX", x**2), # <<<<<<<<<<<<<<
  8630. * ("momentXY", x * y),
  8631. * ("momentYY", y**2),
  8632. */
  8633. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_x); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L1_error)
  8634. __Pyx_GOTREF(__pyx_t_7);
  8635. __pyx_t_8 = PyNumber_Power(__pyx_t_7, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error)
  8636. __Pyx_GOTREF(__pyx_t_8);
  8637. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  8638. __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L1_error)
  8639. __Pyx_GOTREF(__pyx_t_7);
  8640. __Pyx_INCREF(__pyx_n_u_momentXX);
  8641. __Pyx_GIVEREF(__pyx_n_u_momentXX);
  8642. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_n_u_momentXX)) __PYX_ERR(0, 877, __pyx_L1_error);
  8643. __Pyx_GIVEREF(__pyx_t_8);
  8644. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_8)) __PYX_ERR(0, 877, __pyx_L1_error);
  8645. __pyx_t_8 = 0;
  8646. /* "fontTools/pens/momentsPen.py":878
  8647. * ("momentY", y),
  8648. * ("momentXX", x**2),
  8649. * ("momentXY", x * y), # <<<<<<<<<<<<<<
  8650. * ("momentYY", y**2),
  8651. * ],
  8652. */
  8653. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_x); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 878, __pyx_L1_error)
  8654. __Pyx_GOTREF(__pyx_t_8);
  8655. __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_y); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 878, __pyx_L1_error)
  8656. __Pyx_GOTREF(__pyx_t_11);
  8657. __pyx_t_12 = PyNumber_Multiply(__pyx_t_8, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 878, __pyx_L1_error)
  8658. __Pyx_GOTREF(__pyx_t_12);
  8659. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8660. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8661. __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 878, __pyx_L1_error)
  8662. __Pyx_GOTREF(__pyx_t_11);
  8663. __Pyx_INCREF(__pyx_n_u_momentXY);
  8664. __Pyx_GIVEREF(__pyx_n_u_momentXY);
  8665. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_n_u_momentXY)) __PYX_ERR(0, 878, __pyx_L1_error);
  8666. __Pyx_GIVEREF(__pyx_t_12);
  8667. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12)) __PYX_ERR(0, 878, __pyx_L1_error);
  8668. __pyx_t_12 = 0;
  8669. /* "fontTools/pens/momentsPen.py":879
  8670. * ("momentXX", x**2),
  8671. * ("momentXY", x * y),
  8672. * ("momentYY", y**2), # <<<<<<<<<<<<<<
  8673. * ],
  8674. * )
  8675. */
  8676. __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_y); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 879, __pyx_L1_error)
  8677. __Pyx_GOTREF(__pyx_t_12);
  8678. __pyx_t_8 = PyNumber_Power(__pyx_t_12, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error)
  8679. __Pyx_GOTREF(__pyx_t_8);
  8680. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8681. __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 879, __pyx_L1_error)
  8682. __Pyx_GOTREF(__pyx_t_12);
  8683. __Pyx_INCREF(__pyx_n_u_momentYY);
  8684. __Pyx_GIVEREF(__pyx_n_u_momentYY);
  8685. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_momentYY)) __PYX_ERR(0, 879, __pyx_L1_error);
  8686. __Pyx_GIVEREF(__pyx_t_8);
  8687. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 879, __pyx_L1_error);
  8688. __pyx_t_8 = 0;
  8689. /* "fontTools/pens/momentsPen.py":873
  8690. * printGreenPen(
  8691. * "MomentsPen",
  8692. * [ # <<<<<<<<<<<<<<
  8693. * ("area", 1),
  8694. * ("momentX", x),
  8695. */
  8696. __pyx_t_8 = PyList_New(6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 873, __pyx_L1_error)
  8697. __Pyx_GOTREF(__pyx_t_8);
  8698. __Pyx_INCREF(__pyx_tuple__15);
  8699. __Pyx_GIVEREF(__pyx_tuple__15);
  8700. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 0, __pyx_tuple__15)) __PYX_ERR(0, 873, __pyx_L1_error);
  8701. __Pyx_GIVEREF(__pyx_t_9);
  8702. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 1, __pyx_t_9)) __PYX_ERR(0, 873, __pyx_L1_error);
  8703. __Pyx_GIVEREF(__pyx_t_2);
  8704. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 2, __pyx_t_2)) __PYX_ERR(0, 873, __pyx_L1_error);
  8705. __Pyx_GIVEREF(__pyx_t_7);
  8706. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 3, __pyx_t_7)) __PYX_ERR(0, 873, __pyx_L1_error);
  8707. __Pyx_GIVEREF(__pyx_t_11);
  8708. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 4, __pyx_t_11)) __PYX_ERR(0, 873, __pyx_L1_error);
  8709. __Pyx_GIVEREF(__pyx_t_12);
  8710. if (__Pyx_PyList_SET_ITEM(__pyx_t_8, 5, __pyx_t_12)) __PYX_ERR(0, 873, __pyx_L1_error);
  8711. __pyx_t_9 = 0;
  8712. __pyx_t_2 = 0;
  8713. __pyx_t_7 = 0;
  8714. __pyx_t_11 = 0;
  8715. __pyx_t_12 = 0;
  8716. /* "fontTools/pens/momentsPen.py":871
  8717. * from fontTools.misc.symfont import x, y, printGreenPen
  8718. *
  8719. * printGreenPen( # <<<<<<<<<<<<<<
  8720. * "MomentsPen",
  8721. * [
  8722. */
  8723. __pyx_t_12 = PyTuple_New(2); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 871, __pyx_L1_error)
  8724. __Pyx_GOTREF(__pyx_t_12);
  8725. __Pyx_INCREF(__pyx_n_u_MomentsPen);
  8726. __Pyx_GIVEREF(__pyx_n_u_MomentsPen);
  8727. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_n_u_MomentsPen)) __PYX_ERR(0, 871, __pyx_L1_error);
  8728. __Pyx_GIVEREF(__pyx_t_8);
  8729. if (__Pyx_PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error);
  8730. __pyx_t_8 = 0;
  8731. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_12, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 871, __pyx_L1_error)
  8732. __Pyx_GOTREF(__pyx_t_8);
  8733. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8734. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8735. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8736. /* "fontTools/pens/momentsPen.py":868
  8737. *
  8738. *
  8739. * if __name__ == "__main__": # <<<<<<<<<<<<<<
  8740. * from fontTools.misc.symfont import x, y, printGreenPen
  8741. *
  8742. */
  8743. }
  8744. /* "fontTools/pens/momentsPen.py":1
  8745. * from fontTools.pens.basePen import BasePen, OpenContourError # <<<<<<<<<<<<<<
  8746. *
  8747. * try:
  8748. */
  8749. __pyx_t_8 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  8750. __Pyx_GOTREF(__pyx_t_8);
  8751. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  8752. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  8753. /*--- Wrapped vars code ---*/
  8754. goto __pyx_L0;
  8755. __pyx_L1_error:;
  8756. __Pyx_XDECREF(__pyx_t_2);
  8757. __Pyx_XDECREF(__pyx_t_3);
  8758. __Pyx_XDECREF(__pyx_t_7);
  8759. __Pyx_XDECREF(__pyx_t_8);
  8760. __Pyx_XDECREF(__pyx_t_9);
  8761. __Pyx_XDECREF(__pyx_t_11);
  8762. __Pyx_XDECREF(__pyx_t_12);
  8763. if (__pyx_m) {
  8764. if (__pyx_d && stringtab_initialized) {
  8765. __Pyx_AddTraceback("init fontTools.pens.momentsPen", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8766. }
  8767. #if !CYTHON_USE_MODULE_STATE
  8768. Py_CLEAR(__pyx_m);
  8769. #else
  8770. Py_DECREF(__pyx_m);
  8771. if (pystate_addmodule_run) {
  8772. PyObject *tp, *value, *tb;
  8773. PyErr_Fetch(&tp, &value, &tb);
  8774. PyState_RemoveModule(&__pyx_moduledef);
  8775. PyErr_Restore(tp, value, tb);
  8776. }
  8777. #endif
  8778. } else if (!PyErr_Occurred()) {
  8779. PyErr_SetString(PyExc_ImportError, "init fontTools.pens.momentsPen");
  8780. }
  8781. __pyx_L0:;
  8782. __Pyx_RefNannyFinishContext();
  8783. #if CYTHON_PEP489_MULTI_PHASE_INIT
  8784. return (__pyx_m != NULL) ? 0 : -1;
  8785. #elif PY_MAJOR_VERSION >= 3
  8786. return __pyx_m;
  8787. #else
  8788. return;
  8789. #endif
  8790. }
  8791. /* #### Code section: cleanup_globals ### */
  8792. /* #### Code section: cleanup_module ### */
  8793. /* #### Code section: main_method ### */
  8794. /* #### Code section: utility_code_pragmas ### */
  8795. #ifdef _MSC_VER
  8796. #pragma warning( push )
  8797. /* Warning 4127: conditional expression is constant
  8798. * Cython uses constant conditional expressions to allow in inline functions to be optimized at
  8799. * compile-time, so this warning is not useful
  8800. */
  8801. #pragma warning( disable : 4127 )
  8802. #endif
  8803. /* #### Code section: utility_code_def ### */
  8804. /* --- Runtime support code --- */
  8805. /* Refnanny */
  8806. #if CYTHON_REFNANNY
  8807. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  8808. PyObject *m = NULL, *p = NULL;
  8809. void *r = NULL;
  8810. m = PyImport_ImportModule(modname);
  8811. if (!m) goto end;
  8812. p = PyObject_GetAttrString(m, "RefNannyAPI");
  8813. if (!p) goto end;
  8814. r = PyLong_AsVoidPtr(p);
  8815. end:
  8816. Py_XDECREF(p);
  8817. Py_XDECREF(m);
  8818. return (__Pyx_RefNannyAPIStruct *)r;
  8819. }
  8820. #endif
  8821. /* PyErrExceptionMatches */
  8822. #if CYTHON_FAST_THREAD_STATE
  8823. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  8824. Py_ssize_t i, n;
  8825. n = PyTuple_GET_SIZE(tuple);
  8826. #if PY_MAJOR_VERSION >= 3
  8827. for (i=0; i<n; i++) {
  8828. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  8829. }
  8830. #endif
  8831. for (i=0; i<n; i++) {
  8832. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  8833. }
  8834. return 0;
  8835. }
  8836. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  8837. int result;
  8838. PyObject *exc_type;
  8839. #if PY_VERSION_HEX >= 0x030C00A6
  8840. PyObject *current_exception = tstate->current_exception;
  8841. if (unlikely(!current_exception)) return 0;
  8842. exc_type = (PyObject*) Py_TYPE(current_exception);
  8843. if (exc_type == err) return 1;
  8844. #else
  8845. exc_type = tstate->curexc_type;
  8846. if (exc_type == err) return 1;
  8847. if (unlikely(!exc_type)) return 0;
  8848. #endif
  8849. #if CYTHON_AVOID_BORROWED_REFS
  8850. Py_INCREF(exc_type);
  8851. #endif
  8852. if (unlikely(PyTuple_Check(err))) {
  8853. result = __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  8854. } else {
  8855. result = __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  8856. }
  8857. #if CYTHON_AVOID_BORROWED_REFS
  8858. Py_DECREF(exc_type);
  8859. #endif
  8860. return result;
  8861. }
  8862. #endif
  8863. /* PyErrFetchRestore */
  8864. #if CYTHON_FAST_THREAD_STATE
  8865. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  8866. #if PY_VERSION_HEX >= 0x030C00A6
  8867. PyObject *tmp_value;
  8868. assert(type == NULL || (value != NULL && type == (PyObject*) Py_TYPE(value)));
  8869. if (value) {
  8870. #if CYTHON_COMPILING_IN_CPYTHON
  8871. if (unlikely(((PyBaseExceptionObject*) value)->traceback != tb))
  8872. #endif
  8873. PyException_SetTraceback(value, tb);
  8874. }
  8875. tmp_value = tstate->current_exception;
  8876. tstate->current_exception = value;
  8877. Py_XDECREF(tmp_value);
  8878. Py_XDECREF(type);
  8879. Py_XDECREF(tb);
  8880. #else
  8881. PyObject *tmp_type, *tmp_value, *tmp_tb;
  8882. tmp_type = tstate->curexc_type;
  8883. tmp_value = tstate->curexc_value;
  8884. tmp_tb = tstate->curexc_traceback;
  8885. tstate->curexc_type = type;
  8886. tstate->curexc_value = value;
  8887. tstate->curexc_traceback = tb;
  8888. Py_XDECREF(tmp_type);
  8889. Py_XDECREF(tmp_value);
  8890. Py_XDECREF(tmp_tb);
  8891. #endif
  8892. }
  8893. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  8894. #if PY_VERSION_HEX >= 0x030C00A6
  8895. PyObject* exc_value;
  8896. exc_value = tstate->current_exception;
  8897. tstate->current_exception = 0;
  8898. *value = exc_value;
  8899. *type = NULL;
  8900. *tb = NULL;
  8901. if (exc_value) {
  8902. *type = (PyObject*) Py_TYPE(exc_value);
  8903. Py_INCREF(*type);
  8904. #if CYTHON_COMPILING_IN_CPYTHON
  8905. *tb = ((PyBaseExceptionObject*) exc_value)->traceback;
  8906. Py_XINCREF(*tb);
  8907. #else
  8908. *tb = PyException_GetTraceback(exc_value);
  8909. #endif
  8910. }
  8911. #else
  8912. *type = tstate->curexc_type;
  8913. *value = tstate->curexc_value;
  8914. *tb = tstate->curexc_traceback;
  8915. tstate->curexc_type = 0;
  8916. tstate->curexc_value = 0;
  8917. tstate->curexc_traceback = 0;
  8918. #endif
  8919. }
  8920. #endif
  8921. /* PyObjectGetAttrStr */
  8922. #if CYTHON_USE_TYPE_SLOTS
  8923. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  8924. PyTypeObject* tp = Py_TYPE(obj);
  8925. if (likely(tp->tp_getattro))
  8926. return tp->tp_getattro(obj, attr_name);
  8927. #if PY_MAJOR_VERSION < 3
  8928. if (likely(tp->tp_getattr))
  8929. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  8930. #endif
  8931. return PyObject_GetAttr(obj, attr_name);
  8932. }
  8933. #endif
  8934. /* PyObjectGetAttrStrNoError */
  8935. #if __PYX_LIMITED_VERSION_HEX < 0x030d00A1
  8936. static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
  8937. __Pyx_PyThreadState_declare
  8938. __Pyx_PyThreadState_assign
  8939. if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
  8940. __Pyx_PyErr_Clear();
  8941. }
  8942. #endif
  8943. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
  8944. PyObject *result;
  8945. #if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1
  8946. (void) PyObject_GetOptionalAttr(obj, attr_name, &result);
  8947. return result;
  8948. #else
  8949. #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
  8950. PyTypeObject* tp = Py_TYPE(obj);
  8951. if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
  8952. return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
  8953. }
  8954. #endif
  8955. result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
  8956. if (unlikely(!result)) {
  8957. __Pyx_PyObject_GetAttrStr_ClearAttributeError();
  8958. }
  8959. return result;
  8960. #endif
  8961. }
  8962. /* GetBuiltinName */
  8963. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  8964. PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
  8965. if (unlikely(!result) && !PyErr_Occurred()) {
  8966. PyErr_Format(PyExc_NameError,
  8967. #if PY_MAJOR_VERSION >= 3
  8968. "name '%U' is not defined", name);
  8969. #else
  8970. "name '%.200s' is not defined", PyString_AS_STRING(name));
  8971. #endif
  8972. }
  8973. return result;
  8974. }
  8975. /* TupleAndListFromArray */
  8976. #if CYTHON_COMPILING_IN_CPYTHON
  8977. static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
  8978. PyObject *v;
  8979. Py_ssize_t i;
  8980. for (i = 0; i < length; i++) {
  8981. v = dest[i] = src[i];
  8982. Py_INCREF(v);
  8983. }
  8984. }
  8985. static CYTHON_INLINE PyObject *
  8986. __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
  8987. {
  8988. PyObject *res;
  8989. if (n <= 0) {
  8990. Py_INCREF(__pyx_empty_tuple);
  8991. return __pyx_empty_tuple;
  8992. }
  8993. res = PyTuple_New(n);
  8994. if (unlikely(res == NULL)) return NULL;
  8995. __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
  8996. return res;
  8997. }
  8998. static CYTHON_INLINE PyObject *
  8999. __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
  9000. {
  9001. PyObject *res;
  9002. if (n <= 0) {
  9003. return PyList_New(0);
  9004. }
  9005. res = PyList_New(n);
  9006. if (unlikely(res == NULL)) return NULL;
  9007. __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
  9008. return res;
  9009. }
  9010. #endif
  9011. /* BytesEquals */
  9012. static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
  9013. #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
  9014. return PyObject_RichCompareBool(s1, s2, equals);
  9015. #else
  9016. if (s1 == s2) {
  9017. return (equals == Py_EQ);
  9018. } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
  9019. const char *ps1, *ps2;
  9020. Py_ssize_t length = PyBytes_GET_SIZE(s1);
  9021. if (length != PyBytes_GET_SIZE(s2))
  9022. return (equals == Py_NE);
  9023. ps1 = PyBytes_AS_STRING(s1);
  9024. ps2 = PyBytes_AS_STRING(s2);
  9025. if (ps1[0] != ps2[0]) {
  9026. return (equals == Py_NE);
  9027. } else if (length == 1) {
  9028. return (equals == Py_EQ);
  9029. } else {
  9030. int result;
  9031. #if CYTHON_USE_UNICODE_INTERNALS && (PY_VERSION_HEX < 0x030B0000)
  9032. Py_hash_t hash1, hash2;
  9033. hash1 = ((PyBytesObject*)s1)->ob_shash;
  9034. hash2 = ((PyBytesObject*)s2)->ob_shash;
  9035. if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
  9036. return (equals == Py_NE);
  9037. }
  9038. #endif
  9039. result = memcmp(ps1, ps2, (size_t)length);
  9040. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  9041. }
  9042. } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
  9043. return (equals == Py_NE);
  9044. } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
  9045. return (equals == Py_NE);
  9046. } else {
  9047. int result;
  9048. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  9049. if (!py_result)
  9050. return -1;
  9051. result = __Pyx_PyObject_IsTrue(py_result);
  9052. Py_DECREF(py_result);
  9053. return result;
  9054. }
  9055. #endif
  9056. }
  9057. /* UnicodeEquals */
  9058. static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
  9059. #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
  9060. return PyObject_RichCompareBool(s1, s2, equals);
  9061. #else
  9062. #if PY_MAJOR_VERSION < 3
  9063. PyObject* owned_ref = NULL;
  9064. #endif
  9065. int s1_is_unicode, s2_is_unicode;
  9066. if (s1 == s2) {
  9067. goto return_eq;
  9068. }
  9069. s1_is_unicode = PyUnicode_CheckExact(s1);
  9070. s2_is_unicode = PyUnicode_CheckExact(s2);
  9071. #if PY_MAJOR_VERSION < 3
  9072. if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
  9073. owned_ref = PyUnicode_FromObject(s2);
  9074. if (unlikely(!owned_ref))
  9075. return -1;
  9076. s2 = owned_ref;
  9077. s2_is_unicode = 1;
  9078. } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
  9079. owned_ref = PyUnicode_FromObject(s1);
  9080. if (unlikely(!owned_ref))
  9081. return -1;
  9082. s1 = owned_ref;
  9083. s1_is_unicode = 1;
  9084. } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
  9085. return __Pyx_PyBytes_Equals(s1, s2, equals);
  9086. }
  9087. #endif
  9088. if (s1_is_unicode & s2_is_unicode) {
  9089. Py_ssize_t length;
  9090. int kind;
  9091. void *data1, *data2;
  9092. if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
  9093. return -1;
  9094. length = __Pyx_PyUnicode_GET_LENGTH(s1);
  9095. if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
  9096. goto return_ne;
  9097. }
  9098. #if CYTHON_USE_UNICODE_INTERNALS
  9099. {
  9100. Py_hash_t hash1, hash2;
  9101. #if CYTHON_PEP393_ENABLED
  9102. hash1 = ((PyASCIIObject*)s1)->hash;
  9103. hash2 = ((PyASCIIObject*)s2)->hash;
  9104. #else
  9105. hash1 = ((PyUnicodeObject*)s1)->hash;
  9106. hash2 = ((PyUnicodeObject*)s2)->hash;
  9107. #endif
  9108. if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
  9109. goto return_ne;
  9110. }
  9111. }
  9112. #endif
  9113. kind = __Pyx_PyUnicode_KIND(s1);
  9114. if (kind != __Pyx_PyUnicode_KIND(s2)) {
  9115. goto return_ne;
  9116. }
  9117. data1 = __Pyx_PyUnicode_DATA(s1);
  9118. data2 = __Pyx_PyUnicode_DATA(s2);
  9119. if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
  9120. goto return_ne;
  9121. } else if (length == 1) {
  9122. goto return_eq;
  9123. } else {
  9124. int result = memcmp(data1, data2, (size_t)(length * kind));
  9125. #if PY_MAJOR_VERSION < 3
  9126. Py_XDECREF(owned_ref);
  9127. #endif
  9128. return (equals == Py_EQ) ? (result == 0) : (result != 0);
  9129. }
  9130. } else if ((s1 == Py_None) & s2_is_unicode) {
  9131. goto return_ne;
  9132. } else if ((s2 == Py_None) & s1_is_unicode) {
  9133. goto return_ne;
  9134. } else {
  9135. int result;
  9136. PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
  9137. #if PY_MAJOR_VERSION < 3
  9138. Py_XDECREF(owned_ref);
  9139. #endif
  9140. if (!py_result)
  9141. return -1;
  9142. result = __Pyx_PyObject_IsTrue(py_result);
  9143. Py_DECREF(py_result);
  9144. return result;
  9145. }
  9146. return_eq:
  9147. #if PY_MAJOR_VERSION < 3
  9148. Py_XDECREF(owned_ref);
  9149. #endif
  9150. return (equals == Py_EQ);
  9151. return_ne:
  9152. #if PY_MAJOR_VERSION < 3
  9153. Py_XDECREF(owned_ref);
  9154. #endif
  9155. return (equals == Py_NE);
  9156. #endif
  9157. }
  9158. /* fastcall */
  9159. #if CYTHON_METH_FASTCALL
  9160. static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
  9161. {
  9162. Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
  9163. for (i = 0; i < n; i++)
  9164. {
  9165. if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
  9166. }
  9167. for (i = 0; i < n; i++)
  9168. {
  9169. int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
  9170. if (unlikely(eq != 0)) {
  9171. if (unlikely(eq < 0)) return NULL; // error
  9172. return kwvalues[i];
  9173. }
  9174. }
  9175. return NULL; // not found (no exception set)
  9176. }
  9177. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030d0000
  9178. CYTHON_UNUSED static PyObject *__Pyx_KwargsAsDict_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues) {
  9179. Py_ssize_t i, nkwargs = PyTuple_GET_SIZE(kwnames);
  9180. PyObject *dict;
  9181. dict = PyDict_New();
  9182. if (unlikely(!dict))
  9183. return NULL;
  9184. for (i=0; i<nkwargs; i++) {
  9185. PyObject *key = PyTuple_GET_ITEM(kwnames, i);
  9186. if (unlikely(PyDict_SetItem(dict, key, kwvalues[i]) < 0))
  9187. goto bad;
  9188. }
  9189. return dict;
  9190. bad:
  9191. Py_DECREF(dict);
  9192. return NULL;
  9193. }
  9194. #endif
  9195. #endif
  9196. /* RaiseDoubleKeywords */
  9197. static void __Pyx_RaiseDoubleKeywordsError(
  9198. const char* func_name,
  9199. PyObject* kw_name)
  9200. {
  9201. PyErr_Format(PyExc_TypeError,
  9202. #if PY_MAJOR_VERSION >= 3
  9203. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  9204. #else
  9205. "%s() got multiple values for keyword argument '%s'", func_name,
  9206. PyString_AsString(kw_name));
  9207. #endif
  9208. }
  9209. /* ParseKeywords */
  9210. static int __Pyx_ParseOptionalKeywords(
  9211. PyObject *kwds,
  9212. PyObject *const *kwvalues,
  9213. PyObject **argnames[],
  9214. PyObject *kwds2,
  9215. PyObject *values[],
  9216. Py_ssize_t num_pos_args,
  9217. const char* function_name)
  9218. {
  9219. PyObject *key = 0, *value = 0;
  9220. Py_ssize_t pos = 0;
  9221. PyObject*** name;
  9222. PyObject*** first_kw_arg = argnames + num_pos_args;
  9223. int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
  9224. while (1) {
  9225. Py_XDECREF(key); key = NULL;
  9226. Py_XDECREF(value); value = NULL;
  9227. if (kwds_is_tuple) {
  9228. Py_ssize_t size;
  9229. #if CYTHON_ASSUME_SAFE_MACROS
  9230. size = PyTuple_GET_SIZE(kwds);
  9231. #else
  9232. size = PyTuple_Size(kwds);
  9233. if (size < 0) goto bad;
  9234. #endif
  9235. if (pos >= size) break;
  9236. #if CYTHON_AVOID_BORROWED_REFS
  9237. key = __Pyx_PySequence_ITEM(kwds, pos);
  9238. if (!key) goto bad;
  9239. #elif CYTHON_ASSUME_SAFE_MACROS
  9240. key = PyTuple_GET_ITEM(kwds, pos);
  9241. #else
  9242. key = PyTuple_GetItem(kwds, pos);
  9243. if (!key) goto bad;
  9244. #endif
  9245. value = kwvalues[pos];
  9246. pos++;
  9247. }
  9248. else
  9249. {
  9250. if (!PyDict_Next(kwds, &pos, &key, &value)) break;
  9251. #if CYTHON_AVOID_BORROWED_REFS
  9252. Py_INCREF(key);
  9253. #endif
  9254. }
  9255. name = first_kw_arg;
  9256. while (*name && (**name != key)) name++;
  9257. if (*name) {
  9258. values[name-argnames] = value;
  9259. #if CYTHON_AVOID_BORROWED_REFS
  9260. Py_INCREF(value); // transfer ownership of value to values
  9261. Py_DECREF(key);
  9262. #endif
  9263. key = NULL;
  9264. value = NULL;
  9265. continue;
  9266. }
  9267. #if !CYTHON_AVOID_BORROWED_REFS
  9268. Py_INCREF(key);
  9269. #endif
  9270. Py_INCREF(value);
  9271. name = first_kw_arg;
  9272. #if PY_MAJOR_VERSION < 3
  9273. if (likely(PyString_Check(key))) {
  9274. while (*name) {
  9275. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  9276. && _PyString_Eq(**name, key)) {
  9277. values[name-argnames] = value;
  9278. #if CYTHON_AVOID_BORROWED_REFS
  9279. value = NULL; // ownership transferred to values
  9280. #endif
  9281. break;
  9282. }
  9283. name++;
  9284. }
  9285. if (*name) continue;
  9286. else {
  9287. PyObject*** argname = argnames;
  9288. while (argname != first_kw_arg) {
  9289. if ((**argname == key) || (
  9290. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  9291. && _PyString_Eq(**argname, key))) {
  9292. goto arg_passed_twice;
  9293. }
  9294. argname++;
  9295. }
  9296. }
  9297. } else
  9298. #endif
  9299. if (likely(PyUnicode_Check(key))) {
  9300. while (*name) {
  9301. int cmp = (
  9302. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  9303. (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
  9304. #endif
  9305. PyUnicode_Compare(**name, key)
  9306. );
  9307. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  9308. if (cmp == 0) {
  9309. values[name-argnames] = value;
  9310. #if CYTHON_AVOID_BORROWED_REFS
  9311. value = NULL; // ownership transferred to values
  9312. #endif
  9313. break;
  9314. }
  9315. name++;
  9316. }
  9317. if (*name) continue;
  9318. else {
  9319. PyObject*** argname = argnames;
  9320. while (argname != first_kw_arg) {
  9321. int cmp = (**argname == key) ? 0 :
  9322. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  9323. (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
  9324. #endif
  9325. PyUnicode_Compare(**argname, key);
  9326. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  9327. if (cmp == 0) goto arg_passed_twice;
  9328. argname++;
  9329. }
  9330. }
  9331. } else
  9332. goto invalid_keyword_type;
  9333. if (kwds2) {
  9334. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  9335. } else {
  9336. goto invalid_keyword;
  9337. }
  9338. }
  9339. Py_XDECREF(key);
  9340. Py_XDECREF(value);
  9341. return 0;
  9342. arg_passed_twice:
  9343. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  9344. goto bad;
  9345. invalid_keyword_type:
  9346. PyErr_Format(PyExc_TypeError,
  9347. "%.200s() keywords must be strings", function_name);
  9348. goto bad;
  9349. invalid_keyword:
  9350. #if PY_MAJOR_VERSION < 3
  9351. PyErr_Format(PyExc_TypeError,
  9352. "%.200s() got an unexpected keyword argument '%.200s'",
  9353. function_name, PyString_AsString(key));
  9354. #else
  9355. PyErr_Format(PyExc_TypeError,
  9356. "%s() got an unexpected keyword argument '%U'",
  9357. function_name, key);
  9358. #endif
  9359. bad:
  9360. Py_XDECREF(key);
  9361. Py_XDECREF(value);
  9362. return -1;
  9363. }
  9364. /* RaiseArgTupleInvalid */
  9365. static void __Pyx_RaiseArgtupleInvalid(
  9366. const char* func_name,
  9367. int exact,
  9368. Py_ssize_t num_min,
  9369. Py_ssize_t num_max,
  9370. Py_ssize_t num_found)
  9371. {
  9372. Py_ssize_t num_expected;
  9373. const char *more_or_less;
  9374. if (num_found < num_min) {
  9375. num_expected = num_min;
  9376. more_or_less = "at least";
  9377. } else {
  9378. num_expected = num_max;
  9379. more_or_less = "at most";
  9380. }
  9381. if (exact) {
  9382. more_or_less = "exactly";
  9383. }
  9384. PyErr_Format(PyExc_TypeError,
  9385. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  9386. func_name, more_or_less, num_expected,
  9387. (num_expected == 1) ? "" : "s", num_found);
  9388. }
  9389. /* PyDictVersioning */
  9390. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  9391. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  9392. PyObject *dict = Py_TYPE(obj)->tp_dict;
  9393. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  9394. }
  9395. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  9396. PyObject **dictptr = NULL;
  9397. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  9398. if (offset) {
  9399. #if CYTHON_COMPILING_IN_CPYTHON
  9400. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  9401. #else
  9402. dictptr = _PyObject_GetDictPtr(obj);
  9403. #endif
  9404. }
  9405. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  9406. }
  9407. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  9408. PyObject *dict = Py_TYPE(obj)->tp_dict;
  9409. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  9410. return 0;
  9411. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  9412. }
  9413. #endif
  9414. /* GetModuleGlobalName */
  9415. #if CYTHON_USE_DICT_VERSIONS
  9416. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  9417. #else
  9418. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  9419. #endif
  9420. {
  9421. PyObject *result;
  9422. #if !CYTHON_AVOID_BORROWED_REFS
  9423. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && PY_VERSION_HEX < 0x030d0000
  9424. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  9425. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  9426. if (likely(result)) {
  9427. return __Pyx_NewRef(result);
  9428. } else if (unlikely(PyErr_Occurred())) {
  9429. return NULL;
  9430. }
  9431. #elif CYTHON_COMPILING_IN_LIMITED_API
  9432. if (unlikely(!__pyx_m)) {
  9433. return NULL;
  9434. }
  9435. result = PyObject_GetAttr(__pyx_m, name);
  9436. if (likely(result)) {
  9437. return result;
  9438. }
  9439. #else
  9440. result = PyDict_GetItem(__pyx_d, name);
  9441. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  9442. if (likely(result)) {
  9443. return __Pyx_NewRef(result);
  9444. }
  9445. #endif
  9446. #else
  9447. result = PyObject_GetItem(__pyx_d, name);
  9448. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  9449. if (likely(result)) {
  9450. return __Pyx_NewRef(result);
  9451. }
  9452. PyErr_Clear();
  9453. #endif
  9454. return __Pyx_GetBuiltinName(name);
  9455. }
  9456. /* PyFunctionFastCall */
  9457. #if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
  9458. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  9459. PyObject *globals) {
  9460. PyFrameObject *f;
  9461. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  9462. PyObject **fastlocals;
  9463. Py_ssize_t i;
  9464. PyObject *result;
  9465. assert(globals != NULL);
  9466. /* XXX Perhaps we should create a specialized
  9467. PyFrame_New() that doesn't take locals, but does
  9468. take builtins without sanity checking them.
  9469. */
  9470. assert(tstate != NULL);
  9471. f = PyFrame_New(tstate, co, globals, NULL);
  9472. if (f == NULL) {
  9473. return NULL;
  9474. }
  9475. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  9476. for (i = 0; i < na; i++) {
  9477. Py_INCREF(*args);
  9478. fastlocals[i] = *args++;
  9479. }
  9480. result = PyEval_EvalFrameEx(f,0);
  9481. ++tstate->recursion_depth;
  9482. Py_DECREF(f);
  9483. --tstate->recursion_depth;
  9484. return result;
  9485. }
  9486. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  9487. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  9488. PyObject *globals = PyFunction_GET_GLOBALS(func);
  9489. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  9490. PyObject *closure;
  9491. #if PY_MAJOR_VERSION >= 3
  9492. PyObject *kwdefs;
  9493. #endif
  9494. PyObject *kwtuple, **k;
  9495. PyObject **d;
  9496. Py_ssize_t nd;
  9497. Py_ssize_t nk;
  9498. PyObject *result;
  9499. assert(kwargs == NULL || PyDict_Check(kwargs));
  9500. nk = kwargs ? PyDict_Size(kwargs) : 0;
  9501. #if PY_MAJOR_VERSION < 3
  9502. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
  9503. return NULL;
  9504. }
  9505. #else
  9506. if (unlikely(Py_EnterRecursiveCall(" while calling a Python object"))) {
  9507. return NULL;
  9508. }
  9509. #endif
  9510. if (
  9511. #if PY_MAJOR_VERSION >= 3
  9512. co->co_kwonlyargcount == 0 &&
  9513. #endif
  9514. likely(kwargs == NULL || nk == 0) &&
  9515. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  9516. if (argdefs == NULL && co->co_argcount == nargs) {
  9517. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  9518. goto done;
  9519. }
  9520. else if (nargs == 0 && argdefs != NULL
  9521. && co->co_argcount == Py_SIZE(argdefs)) {
  9522. /* function called with no arguments, but all parameters have
  9523. a default value: use default values as arguments .*/
  9524. args = &PyTuple_GET_ITEM(argdefs, 0);
  9525. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  9526. goto done;
  9527. }
  9528. }
  9529. if (kwargs != NULL) {
  9530. Py_ssize_t pos, i;
  9531. kwtuple = PyTuple_New(2 * nk);
  9532. if (kwtuple == NULL) {
  9533. result = NULL;
  9534. goto done;
  9535. }
  9536. k = &PyTuple_GET_ITEM(kwtuple, 0);
  9537. pos = i = 0;
  9538. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  9539. Py_INCREF(k[i]);
  9540. Py_INCREF(k[i+1]);
  9541. i += 2;
  9542. }
  9543. nk = i / 2;
  9544. }
  9545. else {
  9546. kwtuple = NULL;
  9547. k = NULL;
  9548. }
  9549. closure = PyFunction_GET_CLOSURE(func);
  9550. #if PY_MAJOR_VERSION >= 3
  9551. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  9552. #endif
  9553. if (argdefs != NULL) {
  9554. d = &PyTuple_GET_ITEM(argdefs, 0);
  9555. nd = Py_SIZE(argdefs);
  9556. }
  9557. else {
  9558. d = NULL;
  9559. nd = 0;
  9560. }
  9561. #if PY_MAJOR_VERSION >= 3
  9562. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  9563. args, (int)nargs,
  9564. k, (int)nk,
  9565. d, (int)nd, kwdefs, closure);
  9566. #else
  9567. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  9568. args, (int)nargs,
  9569. k, (int)nk,
  9570. d, (int)nd, closure);
  9571. #endif
  9572. Py_XDECREF(kwtuple);
  9573. done:
  9574. Py_LeaveRecursiveCall();
  9575. return result;
  9576. }
  9577. #endif
  9578. /* PyObjectCall */
  9579. #if CYTHON_COMPILING_IN_CPYTHON
  9580. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  9581. PyObject *result;
  9582. ternaryfunc call = Py_TYPE(func)->tp_call;
  9583. if (unlikely(!call))
  9584. return PyObject_Call(func, arg, kw);
  9585. #if PY_MAJOR_VERSION < 3
  9586. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  9587. return NULL;
  9588. #else
  9589. if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
  9590. return NULL;
  9591. #endif
  9592. result = (*call)(func, arg, kw);
  9593. Py_LeaveRecursiveCall();
  9594. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  9595. PyErr_SetString(
  9596. PyExc_SystemError,
  9597. "NULL result without error in PyObject_Call");
  9598. }
  9599. return result;
  9600. }
  9601. #endif
  9602. /* PyObjectCallMethO */
  9603. #if CYTHON_COMPILING_IN_CPYTHON
  9604. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  9605. PyObject *self, *result;
  9606. PyCFunction cfunc;
  9607. cfunc = __Pyx_CyOrPyCFunction_GET_FUNCTION(func);
  9608. self = __Pyx_CyOrPyCFunction_GET_SELF(func);
  9609. #if PY_MAJOR_VERSION < 3
  9610. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  9611. return NULL;
  9612. #else
  9613. if (unlikely(Py_EnterRecursiveCall(" while calling a Python object")))
  9614. return NULL;
  9615. #endif
  9616. result = cfunc(self, arg);
  9617. Py_LeaveRecursiveCall();
  9618. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  9619. PyErr_SetString(
  9620. PyExc_SystemError,
  9621. "NULL result without error in PyObject_Call");
  9622. }
  9623. return result;
  9624. }
  9625. #endif
  9626. /* PyObjectFastCall */
  9627. #if PY_VERSION_HEX < 0x03090000 || CYTHON_COMPILING_IN_LIMITED_API
  9628. static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
  9629. PyObject *argstuple;
  9630. PyObject *result = 0;
  9631. size_t i;
  9632. argstuple = PyTuple_New((Py_ssize_t)nargs);
  9633. if (unlikely(!argstuple)) return NULL;
  9634. for (i = 0; i < nargs; i++) {
  9635. Py_INCREF(args[i]);
  9636. if (__Pyx_PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]) < 0) goto bad;
  9637. }
  9638. result = __Pyx_PyObject_Call(func, argstuple, kwargs);
  9639. bad:
  9640. Py_DECREF(argstuple);
  9641. return result;
  9642. }
  9643. #endif
  9644. static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
  9645. Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
  9646. #if CYTHON_COMPILING_IN_CPYTHON
  9647. if (nargs == 0 && kwargs == NULL) {
  9648. if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_NOARGS))
  9649. return __Pyx_PyObject_CallMethO(func, NULL);
  9650. }
  9651. else if (nargs == 1 && kwargs == NULL) {
  9652. if (__Pyx_CyOrPyCFunction_Check(func) && likely( __Pyx_CyOrPyCFunction_GET_FLAGS(func) & METH_O))
  9653. return __Pyx_PyObject_CallMethO(func, args[0]);
  9654. }
  9655. #endif
  9656. #if PY_VERSION_HEX < 0x030800B1
  9657. #if CYTHON_FAST_PYCCALL
  9658. if (PyCFunction_Check(func)) {
  9659. if (kwargs) {
  9660. return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
  9661. } else {
  9662. return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
  9663. }
  9664. }
  9665. #if PY_VERSION_HEX >= 0x030700A1
  9666. if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
  9667. return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
  9668. }
  9669. #endif
  9670. #endif
  9671. #if CYTHON_FAST_PYCALL
  9672. if (PyFunction_Check(func)) {
  9673. return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
  9674. }
  9675. #endif
  9676. #endif
  9677. if (kwargs == NULL) {
  9678. #if CYTHON_VECTORCALL
  9679. #if PY_VERSION_HEX < 0x03090000
  9680. vectorcallfunc f = _PyVectorcall_Function(func);
  9681. #else
  9682. vectorcallfunc f = PyVectorcall_Function(func);
  9683. #endif
  9684. if (f) {
  9685. return f(func, args, (size_t)nargs, NULL);
  9686. }
  9687. #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
  9688. if (__Pyx_CyFunction_CheckExact(func)) {
  9689. __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
  9690. if (f) return f(func, args, (size_t)nargs, NULL);
  9691. }
  9692. #endif
  9693. }
  9694. if (nargs == 0) {
  9695. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
  9696. }
  9697. #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API
  9698. return PyObject_VectorcallDict(func, args, (size_t)nargs, kwargs);
  9699. #else
  9700. return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
  9701. #endif
  9702. }
  9703. /* PyObjectSetAttrStr */
  9704. #if CYTHON_USE_TYPE_SLOTS
  9705. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  9706. PyTypeObject* tp = Py_TYPE(obj);
  9707. if (likely(tp->tp_setattro))
  9708. return tp->tp_setattro(obj, attr_name, value);
  9709. #if PY_MAJOR_VERSION < 3
  9710. if (likely(tp->tp_setattr))
  9711. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  9712. #endif
  9713. return PyObject_SetAttr(obj, attr_name, value);
  9714. }
  9715. #endif
  9716. /* RaiseException */
  9717. #if PY_MAJOR_VERSION < 3
  9718. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  9719. __Pyx_PyThreadState_declare
  9720. CYTHON_UNUSED_VAR(cause);
  9721. Py_XINCREF(type);
  9722. if (!value || value == Py_None)
  9723. value = NULL;
  9724. else
  9725. Py_INCREF(value);
  9726. if (!tb || tb == Py_None)
  9727. tb = NULL;
  9728. else {
  9729. Py_INCREF(tb);
  9730. if (!PyTraceBack_Check(tb)) {
  9731. PyErr_SetString(PyExc_TypeError,
  9732. "raise: arg 3 must be a traceback or None");
  9733. goto raise_error;
  9734. }
  9735. }
  9736. if (PyType_Check(type)) {
  9737. #if CYTHON_COMPILING_IN_PYPY
  9738. if (!value) {
  9739. Py_INCREF(Py_None);
  9740. value = Py_None;
  9741. }
  9742. #endif
  9743. PyErr_NormalizeException(&type, &value, &tb);
  9744. } else {
  9745. if (value) {
  9746. PyErr_SetString(PyExc_TypeError,
  9747. "instance exception may not have a separate value");
  9748. goto raise_error;
  9749. }
  9750. value = type;
  9751. type = (PyObject*) Py_TYPE(type);
  9752. Py_INCREF(type);
  9753. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  9754. PyErr_SetString(PyExc_TypeError,
  9755. "raise: exception class must be a subclass of BaseException");
  9756. goto raise_error;
  9757. }
  9758. }
  9759. __Pyx_PyThreadState_assign
  9760. __Pyx_ErrRestore(type, value, tb);
  9761. return;
  9762. raise_error:
  9763. Py_XDECREF(value);
  9764. Py_XDECREF(type);
  9765. Py_XDECREF(tb);
  9766. return;
  9767. }
  9768. #else
  9769. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  9770. PyObject* owned_instance = NULL;
  9771. if (tb == Py_None) {
  9772. tb = 0;
  9773. } else if (tb && !PyTraceBack_Check(tb)) {
  9774. PyErr_SetString(PyExc_TypeError,
  9775. "raise: arg 3 must be a traceback or None");
  9776. goto bad;
  9777. }
  9778. if (value == Py_None)
  9779. value = 0;
  9780. if (PyExceptionInstance_Check(type)) {
  9781. if (value) {
  9782. PyErr_SetString(PyExc_TypeError,
  9783. "instance exception may not have a separate value");
  9784. goto bad;
  9785. }
  9786. value = type;
  9787. type = (PyObject*) Py_TYPE(value);
  9788. } else if (PyExceptionClass_Check(type)) {
  9789. PyObject *instance_class = NULL;
  9790. if (value && PyExceptionInstance_Check(value)) {
  9791. instance_class = (PyObject*) Py_TYPE(value);
  9792. if (instance_class != type) {
  9793. int is_subclass = PyObject_IsSubclass(instance_class, type);
  9794. if (!is_subclass) {
  9795. instance_class = NULL;
  9796. } else if (unlikely(is_subclass == -1)) {
  9797. goto bad;
  9798. } else {
  9799. type = instance_class;
  9800. }
  9801. }
  9802. }
  9803. if (!instance_class) {
  9804. PyObject *args;
  9805. if (!value)
  9806. args = PyTuple_New(0);
  9807. else if (PyTuple_Check(value)) {
  9808. Py_INCREF(value);
  9809. args = value;
  9810. } else
  9811. args = PyTuple_Pack(1, value);
  9812. if (!args)
  9813. goto bad;
  9814. owned_instance = PyObject_Call(type, args, NULL);
  9815. Py_DECREF(args);
  9816. if (!owned_instance)
  9817. goto bad;
  9818. value = owned_instance;
  9819. if (!PyExceptionInstance_Check(value)) {
  9820. PyErr_Format(PyExc_TypeError,
  9821. "calling %R should have returned an instance of "
  9822. "BaseException, not %R",
  9823. type, Py_TYPE(value));
  9824. goto bad;
  9825. }
  9826. }
  9827. } else {
  9828. PyErr_SetString(PyExc_TypeError,
  9829. "raise: exception class must be a subclass of BaseException");
  9830. goto bad;
  9831. }
  9832. if (cause) {
  9833. PyObject *fixed_cause;
  9834. if (cause == Py_None) {
  9835. fixed_cause = NULL;
  9836. } else if (PyExceptionClass_Check(cause)) {
  9837. fixed_cause = PyObject_CallObject(cause, NULL);
  9838. if (fixed_cause == NULL)
  9839. goto bad;
  9840. } else if (PyExceptionInstance_Check(cause)) {
  9841. fixed_cause = cause;
  9842. Py_INCREF(fixed_cause);
  9843. } else {
  9844. PyErr_SetString(PyExc_TypeError,
  9845. "exception causes must derive from "
  9846. "BaseException");
  9847. goto bad;
  9848. }
  9849. PyException_SetCause(value, fixed_cause);
  9850. }
  9851. PyErr_SetObject(type, value);
  9852. if (tb) {
  9853. #if PY_VERSION_HEX >= 0x030C00A6
  9854. PyException_SetTraceback(value, tb);
  9855. #elif CYTHON_FAST_THREAD_STATE
  9856. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  9857. PyObject* tmp_tb = tstate->curexc_traceback;
  9858. if (tb != tmp_tb) {
  9859. Py_INCREF(tb);
  9860. tstate->curexc_traceback = tb;
  9861. Py_XDECREF(tmp_tb);
  9862. }
  9863. #else
  9864. PyObject *tmp_type, *tmp_value, *tmp_tb;
  9865. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  9866. Py_INCREF(tb);
  9867. PyErr_Restore(tmp_type, tmp_value, tb);
  9868. Py_XDECREF(tmp_tb);
  9869. #endif
  9870. }
  9871. bad:
  9872. Py_XDECREF(owned_instance);
  9873. return;
  9874. }
  9875. #endif
  9876. /* RaiseTooManyValuesToUnpack */
  9877. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  9878. PyErr_Format(PyExc_ValueError,
  9879. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  9880. }
  9881. /* RaiseNeedMoreValuesToUnpack */
  9882. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  9883. PyErr_Format(PyExc_ValueError,
  9884. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  9885. index, (index == 1) ? "" : "s");
  9886. }
  9887. /* IterFinish */
  9888. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  9889. __Pyx_PyThreadState_declare
  9890. __Pyx_PyThreadState_assign
  9891. PyObject* exc_type = __Pyx_PyErr_CurrentExceptionType();
  9892. if (unlikely(exc_type)) {
  9893. if (unlikely(!__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)))
  9894. return -1;
  9895. __Pyx_PyErr_Clear();
  9896. return 0;
  9897. }
  9898. return 0;
  9899. }
  9900. /* UnpackItemEndCheck */
  9901. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  9902. if (unlikely(retval)) {
  9903. Py_DECREF(retval);
  9904. __Pyx_RaiseTooManyValuesError(expected);
  9905. return -1;
  9906. }
  9907. return __Pyx_IterFinish();
  9908. }
  9909. /* Import */
  9910. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  9911. PyObject *module = 0;
  9912. PyObject *empty_dict = 0;
  9913. PyObject *empty_list = 0;
  9914. #if PY_MAJOR_VERSION < 3
  9915. PyObject *py_import;
  9916. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  9917. if (unlikely(!py_import))
  9918. goto bad;
  9919. if (!from_list) {
  9920. empty_list = PyList_New(0);
  9921. if (unlikely(!empty_list))
  9922. goto bad;
  9923. from_list = empty_list;
  9924. }
  9925. #endif
  9926. empty_dict = PyDict_New();
  9927. if (unlikely(!empty_dict))
  9928. goto bad;
  9929. {
  9930. #if PY_MAJOR_VERSION >= 3
  9931. if (level == -1) {
  9932. if (strchr(__Pyx_MODULE_NAME, '.') != NULL) {
  9933. module = PyImport_ImportModuleLevelObject(
  9934. name, __pyx_d, empty_dict, from_list, 1);
  9935. if (unlikely(!module)) {
  9936. if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
  9937. goto bad;
  9938. PyErr_Clear();
  9939. }
  9940. }
  9941. level = 0;
  9942. }
  9943. #endif
  9944. if (!module) {
  9945. #if PY_MAJOR_VERSION < 3
  9946. PyObject *py_level = PyInt_FromLong(level);
  9947. if (unlikely(!py_level))
  9948. goto bad;
  9949. module = PyObject_CallFunctionObjArgs(py_import,
  9950. name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
  9951. Py_DECREF(py_level);
  9952. #else
  9953. module = PyImport_ImportModuleLevelObject(
  9954. name, __pyx_d, empty_dict, from_list, level);
  9955. #endif
  9956. }
  9957. }
  9958. bad:
  9959. Py_XDECREF(empty_dict);
  9960. Py_XDECREF(empty_list);
  9961. #if PY_MAJOR_VERSION < 3
  9962. Py_XDECREF(py_import);
  9963. #endif
  9964. return module;
  9965. }
  9966. /* ImportFrom */
  9967. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  9968. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  9969. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  9970. const char* module_name_str = 0;
  9971. PyObject* module_name = 0;
  9972. PyObject* module_dot = 0;
  9973. PyObject* full_name = 0;
  9974. PyErr_Clear();
  9975. module_name_str = PyModule_GetName(module);
  9976. if (unlikely(!module_name_str)) { goto modbad; }
  9977. module_name = PyUnicode_FromString(module_name_str);
  9978. if (unlikely(!module_name)) { goto modbad; }
  9979. module_dot = PyUnicode_Concat(module_name, __pyx_kp_u_);
  9980. if (unlikely(!module_dot)) { goto modbad; }
  9981. full_name = PyUnicode_Concat(module_dot, name);
  9982. if (unlikely(!full_name)) { goto modbad; }
  9983. #if PY_VERSION_HEX < 0x030700A1 || (CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM < 0x07030400)
  9984. {
  9985. PyObject *modules = PyImport_GetModuleDict();
  9986. if (unlikely(!modules))
  9987. goto modbad;
  9988. value = PyObject_GetItem(modules, full_name);
  9989. }
  9990. #else
  9991. value = PyImport_GetModule(full_name);
  9992. #endif
  9993. modbad:
  9994. Py_XDECREF(full_name);
  9995. Py_XDECREF(module_dot);
  9996. Py_XDECREF(module_name);
  9997. }
  9998. if (unlikely(!value)) {
  9999. PyErr_Format(PyExc_ImportError,
  10000. #if PY_MAJOR_VERSION < 3
  10001. "cannot import name %.230s", PyString_AS_STRING(name));
  10002. #else
  10003. "cannot import name %S", name);
  10004. #endif
  10005. }
  10006. return value;
  10007. }
  10008. /* GetTopmostException */
  10009. #if CYTHON_USE_EXC_INFO_STACK && CYTHON_FAST_THREAD_STATE
  10010. static _PyErr_StackItem *
  10011. __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
  10012. {
  10013. _PyErr_StackItem *exc_info = tstate->exc_info;
  10014. while ((exc_info->exc_value == NULL || exc_info->exc_value == Py_None) &&
  10015. exc_info->previous_item != NULL)
  10016. {
  10017. exc_info = exc_info->previous_item;
  10018. }
  10019. return exc_info;
  10020. }
  10021. #endif
  10022. /* SaveResetException */
  10023. #if CYTHON_FAST_THREAD_STATE
  10024. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  10025. #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
  10026. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  10027. PyObject *exc_value = exc_info->exc_value;
  10028. if (exc_value == NULL || exc_value == Py_None) {
  10029. *value = NULL;
  10030. *type = NULL;
  10031. *tb = NULL;
  10032. } else {
  10033. *value = exc_value;
  10034. Py_INCREF(*value);
  10035. *type = (PyObject*) Py_TYPE(exc_value);
  10036. Py_INCREF(*type);
  10037. *tb = PyException_GetTraceback(exc_value);
  10038. }
  10039. #elif CYTHON_USE_EXC_INFO_STACK
  10040. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  10041. *type = exc_info->exc_type;
  10042. *value = exc_info->exc_value;
  10043. *tb = exc_info->exc_traceback;
  10044. Py_XINCREF(*type);
  10045. Py_XINCREF(*value);
  10046. Py_XINCREF(*tb);
  10047. #else
  10048. *type = tstate->exc_type;
  10049. *value = tstate->exc_value;
  10050. *tb = tstate->exc_traceback;
  10051. Py_XINCREF(*type);
  10052. Py_XINCREF(*value);
  10053. Py_XINCREF(*tb);
  10054. #endif
  10055. }
  10056. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  10057. #if CYTHON_USE_EXC_INFO_STACK && PY_VERSION_HEX >= 0x030B00a4
  10058. _PyErr_StackItem *exc_info = tstate->exc_info;
  10059. PyObject *tmp_value = exc_info->exc_value;
  10060. exc_info->exc_value = value;
  10061. Py_XDECREF(tmp_value);
  10062. Py_XDECREF(type);
  10063. Py_XDECREF(tb);
  10064. #else
  10065. PyObject *tmp_type, *tmp_value, *tmp_tb;
  10066. #if CYTHON_USE_EXC_INFO_STACK
  10067. _PyErr_StackItem *exc_info = tstate->exc_info;
  10068. tmp_type = exc_info->exc_type;
  10069. tmp_value = exc_info->exc_value;
  10070. tmp_tb = exc_info->exc_traceback;
  10071. exc_info->exc_type = type;
  10072. exc_info->exc_value = value;
  10073. exc_info->exc_traceback = tb;
  10074. #else
  10075. tmp_type = tstate->exc_type;
  10076. tmp_value = tstate->exc_value;
  10077. tmp_tb = tstate->exc_traceback;
  10078. tstate->exc_type = type;
  10079. tstate->exc_value = value;
  10080. tstate->exc_traceback = tb;
  10081. #endif
  10082. Py_XDECREF(tmp_type);
  10083. Py_XDECREF(tmp_value);
  10084. Py_XDECREF(tmp_tb);
  10085. #endif
  10086. }
  10087. #endif
  10088. /* FastTypeChecks */
  10089. #if CYTHON_COMPILING_IN_CPYTHON
  10090. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  10091. while (a) {
  10092. a = __Pyx_PyType_GetSlot(a, tp_base, PyTypeObject*);
  10093. if (a == b)
  10094. return 1;
  10095. }
  10096. return b == &PyBaseObject_Type;
  10097. }
  10098. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  10099. PyObject *mro;
  10100. if (a == b) return 1;
  10101. mro = a->tp_mro;
  10102. if (likely(mro)) {
  10103. Py_ssize_t i, n;
  10104. n = PyTuple_GET_SIZE(mro);
  10105. for (i = 0; i < n; i++) {
  10106. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  10107. return 1;
  10108. }
  10109. return 0;
  10110. }
  10111. return __Pyx_InBases(a, b);
  10112. }
  10113. static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
  10114. PyObject *mro;
  10115. if (cls == a || cls == b) return 1;
  10116. mro = cls->tp_mro;
  10117. if (likely(mro)) {
  10118. Py_ssize_t i, n;
  10119. n = PyTuple_GET_SIZE(mro);
  10120. for (i = 0; i < n; i++) {
  10121. PyObject *base = PyTuple_GET_ITEM(mro, i);
  10122. if (base == (PyObject *)a || base == (PyObject *)b)
  10123. return 1;
  10124. }
  10125. return 0;
  10126. }
  10127. return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
  10128. }
  10129. #if PY_MAJOR_VERSION == 2
  10130. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  10131. PyObject *exception, *value, *tb;
  10132. int res;
  10133. __Pyx_PyThreadState_declare
  10134. __Pyx_PyThreadState_assign
  10135. __Pyx_ErrFetch(&exception, &value, &tb);
  10136. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  10137. if (unlikely(res == -1)) {
  10138. PyErr_WriteUnraisable(err);
  10139. res = 0;
  10140. }
  10141. if (!res) {
  10142. res = PyObject_IsSubclass(err, exc_type2);
  10143. if (unlikely(res == -1)) {
  10144. PyErr_WriteUnraisable(err);
  10145. res = 0;
  10146. }
  10147. }
  10148. __Pyx_ErrRestore(exception, value, tb);
  10149. return res;
  10150. }
  10151. #else
  10152. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  10153. if (exc_type1) {
  10154. return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
  10155. } else {
  10156. return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  10157. }
  10158. }
  10159. #endif
  10160. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  10161. Py_ssize_t i, n;
  10162. assert(PyExceptionClass_Check(exc_type));
  10163. n = PyTuple_GET_SIZE(tuple);
  10164. #if PY_MAJOR_VERSION >= 3
  10165. for (i=0; i<n; i++) {
  10166. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  10167. }
  10168. #endif
  10169. for (i=0; i<n; i++) {
  10170. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  10171. #if PY_MAJOR_VERSION < 3
  10172. if (likely(exc_type == t)) return 1;
  10173. #endif
  10174. if (likely(PyExceptionClass_Check(t))) {
  10175. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  10176. } else {
  10177. }
  10178. }
  10179. return 0;
  10180. }
  10181. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  10182. if (likely(err == exc_type)) return 1;
  10183. if (likely(PyExceptionClass_Check(err))) {
  10184. if (likely(PyExceptionClass_Check(exc_type))) {
  10185. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  10186. } else if (likely(PyTuple_Check(exc_type))) {
  10187. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  10188. } else {
  10189. }
  10190. }
  10191. return PyErr_GivenExceptionMatches(err, exc_type);
  10192. }
  10193. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  10194. assert(PyExceptionClass_Check(exc_type1));
  10195. assert(PyExceptionClass_Check(exc_type2));
  10196. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  10197. if (likely(PyExceptionClass_Check(err))) {
  10198. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  10199. }
  10200. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  10201. }
  10202. #endif
  10203. /* GetException */
  10204. #if CYTHON_FAST_THREAD_STATE
  10205. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
  10206. #else
  10207. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
  10208. #endif
  10209. {
  10210. PyObject *local_type = NULL, *local_value, *local_tb = NULL;
  10211. #if CYTHON_FAST_THREAD_STATE
  10212. PyObject *tmp_type, *tmp_value, *tmp_tb;
  10213. #if PY_VERSION_HEX >= 0x030C00A6
  10214. local_value = tstate->current_exception;
  10215. tstate->current_exception = 0;
  10216. if (likely(local_value)) {
  10217. local_type = (PyObject*) Py_TYPE(local_value);
  10218. Py_INCREF(local_type);
  10219. local_tb = PyException_GetTraceback(local_value);
  10220. }
  10221. #else
  10222. local_type = tstate->curexc_type;
  10223. local_value = tstate->curexc_value;
  10224. local_tb = tstate->curexc_traceback;
  10225. tstate->curexc_type = 0;
  10226. tstate->curexc_value = 0;
  10227. tstate->curexc_traceback = 0;
  10228. #endif
  10229. #else
  10230. PyErr_Fetch(&local_type, &local_value, &local_tb);
  10231. #endif
  10232. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  10233. #if CYTHON_FAST_THREAD_STATE && PY_VERSION_HEX >= 0x030C00A6
  10234. if (unlikely(tstate->current_exception))
  10235. #elif CYTHON_FAST_THREAD_STATE
  10236. if (unlikely(tstate->curexc_type))
  10237. #else
  10238. if (unlikely(PyErr_Occurred()))
  10239. #endif
  10240. goto bad;
  10241. #if PY_MAJOR_VERSION >= 3
  10242. if (local_tb) {
  10243. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  10244. goto bad;
  10245. }
  10246. #endif
  10247. Py_XINCREF(local_tb);
  10248. Py_XINCREF(local_type);
  10249. Py_XINCREF(local_value);
  10250. *type = local_type;
  10251. *value = local_value;
  10252. *tb = local_tb;
  10253. #if CYTHON_FAST_THREAD_STATE
  10254. #if CYTHON_USE_EXC_INFO_STACK
  10255. {
  10256. _PyErr_StackItem *exc_info = tstate->exc_info;
  10257. #if PY_VERSION_HEX >= 0x030B00a4
  10258. tmp_value = exc_info->exc_value;
  10259. exc_info->exc_value = local_value;
  10260. tmp_type = NULL;
  10261. tmp_tb = NULL;
  10262. Py_XDECREF(local_type);
  10263. Py_XDECREF(local_tb);
  10264. #else
  10265. tmp_type = exc_info->exc_type;
  10266. tmp_value = exc_info->exc_value;
  10267. tmp_tb = exc_info->exc_traceback;
  10268. exc_info->exc_type = local_type;
  10269. exc_info->exc_value = local_value;
  10270. exc_info->exc_traceback = local_tb;
  10271. #endif
  10272. }
  10273. #else
  10274. tmp_type = tstate->exc_type;
  10275. tmp_value = tstate->exc_value;
  10276. tmp_tb = tstate->exc_traceback;
  10277. tstate->exc_type = local_type;
  10278. tstate->exc_value = local_value;
  10279. tstate->exc_traceback = local_tb;
  10280. #endif
  10281. Py_XDECREF(tmp_type);
  10282. Py_XDECREF(tmp_value);
  10283. Py_XDECREF(tmp_tb);
  10284. #else
  10285. PyErr_SetExcInfo(local_type, local_value, local_tb);
  10286. #endif
  10287. return 0;
  10288. bad:
  10289. *type = 0;
  10290. *value = 0;
  10291. *tb = 0;
  10292. Py_XDECREF(local_type);
  10293. Py_XDECREF(local_value);
  10294. Py_XDECREF(local_tb);
  10295. return -1;
  10296. }
  10297. /* PyObjectCallOneArg */
  10298. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  10299. PyObject *args[2] = {NULL, arg};
  10300. return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
  10301. }
  10302. /* Py3UpdateBases */
  10303. static PyObject*
  10304. __Pyx_PEP560_update_bases(PyObject *bases)
  10305. {
  10306. Py_ssize_t i, j, size_bases;
  10307. PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
  10308. size_bases = PyTuple_GET_SIZE(bases);
  10309. for (i = 0; i < size_bases; i++) {
  10310. base = PyTuple_GET_ITEM(bases, i);
  10311. if (PyType_Check(base)) {
  10312. if (new_bases) {
  10313. if (PyList_Append(new_bases, base) < 0) {
  10314. goto error;
  10315. }
  10316. }
  10317. continue;
  10318. }
  10319. meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
  10320. if (!meth && PyErr_Occurred()) {
  10321. goto error;
  10322. }
  10323. if (!meth) {
  10324. if (new_bases) {
  10325. if (PyList_Append(new_bases, base) < 0) {
  10326. goto error;
  10327. }
  10328. }
  10329. continue;
  10330. }
  10331. new_base = __Pyx_PyObject_CallOneArg(meth, bases);
  10332. Py_DECREF(meth);
  10333. if (!new_base) {
  10334. goto error;
  10335. }
  10336. if (!PyTuple_Check(new_base)) {
  10337. PyErr_SetString(PyExc_TypeError,
  10338. "__mro_entries__ must return a tuple");
  10339. Py_DECREF(new_base);
  10340. goto error;
  10341. }
  10342. if (!new_bases) {
  10343. if (!(new_bases = PyList_New(i))) {
  10344. goto error;
  10345. }
  10346. for (j = 0; j < i; j++) {
  10347. base = PyTuple_GET_ITEM(bases, j);
  10348. PyList_SET_ITEM(new_bases, j, base);
  10349. Py_INCREF(base);
  10350. }
  10351. }
  10352. j = PyList_GET_SIZE(new_bases);
  10353. if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
  10354. goto error;
  10355. }
  10356. Py_DECREF(new_base);
  10357. }
  10358. if (!new_bases) {
  10359. Py_INCREF(bases);
  10360. return bases;
  10361. }
  10362. result = PyList_AsTuple(new_bases);
  10363. Py_DECREF(new_bases);
  10364. return result;
  10365. error:
  10366. Py_XDECREF(new_bases);
  10367. return NULL;
  10368. }
  10369. /* CalculateMetaclass */
  10370. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  10371. Py_ssize_t i, nbases;
  10372. #if CYTHON_ASSUME_SAFE_MACROS
  10373. nbases = PyTuple_GET_SIZE(bases);
  10374. #else
  10375. nbases = PyTuple_Size(bases);
  10376. if (nbases < 0) return NULL;
  10377. #endif
  10378. for (i=0; i < nbases; i++) {
  10379. PyTypeObject *tmptype;
  10380. #if CYTHON_ASSUME_SAFE_MACROS
  10381. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  10382. #else
  10383. PyObject *tmp = PyTuple_GetItem(bases, i);
  10384. if (!tmp) return NULL;
  10385. #endif
  10386. tmptype = Py_TYPE(tmp);
  10387. #if PY_MAJOR_VERSION < 3
  10388. if (tmptype == &PyClass_Type)
  10389. continue;
  10390. #endif
  10391. if (!metaclass) {
  10392. metaclass = tmptype;
  10393. continue;
  10394. }
  10395. if (PyType_IsSubtype(metaclass, tmptype))
  10396. continue;
  10397. if (PyType_IsSubtype(tmptype, metaclass)) {
  10398. metaclass = tmptype;
  10399. continue;
  10400. }
  10401. PyErr_SetString(PyExc_TypeError,
  10402. "metaclass conflict: "
  10403. "the metaclass of a derived class "
  10404. "must be a (non-strict) subclass "
  10405. "of the metaclasses of all its bases");
  10406. return NULL;
  10407. }
  10408. if (!metaclass) {
  10409. #if PY_MAJOR_VERSION < 3
  10410. metaclass = &PyClass_Type;
  10411. #else
  10412. metaclass = &PyType_Type;
  10413. #endif
  10414. }
  10415. Py_INCREF((PyObject*) metaclass);
  10416. return (PyObject*) metaclass;
  10417. }
  10418. /* FixUpExtensionType */
  10419. #if CYTHON_USE_TYPE_SPECS
  10420. static int __Pyx_fix_up_extension_type_from_spec(PyType_Spec *spec, PyTypeObject *type) {
  10421. #if PY_VERSION_HEX > 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  10422. CYTHON_UNUSED_VAR(spec);
  10423. CYTHON_UNUSED_VAR(type);
  10424. #else
  10425. const PyType_Slot *slot = spec->slots;
  10426. while (slot && slot->slot && slot->slot != Py_tp_members)
  10427. slot++;
  10428. if (slot && slot->slot == Py_tp_members) {
  10429. int changed = 0;
  10430. #if !(PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON)
  10431. const
  10432. #endif
  10433. PyMemberDef *memb = (PyMemberDef*) slot->pfunc;
  10434. while (memb && memb->name) {
  10435. if (memb->name[0] == '_' && memb->name[1] == '_') {
  10436. #if PY_VERSION_HEX < 0x030900b1
  10437. if (strcmp(memb->name, "__weaklistoffset__") == 0) {
  10438. assert(memb->type == T_PYSSIZET);
  10439. assert(memb->flags == READONLY);
  10440. type->tp_weaklistoffset = memb->offset;
  10441. changed = 1;
  10442. }
  10443. else if (strcmp(memb->name, "__dictoffset__") == 0) {
  10444. assert(memb->type == T_PYSSIZET);
  10445. assert(memb->flags == READONLY);
  10446. type->tp_dictoffset = memb->offset;
  10447. changed = 1;
  10448. }
  10449. #if CYTHON_METH_FASTCALL
  10450. else if (strcmp(memb->name, "__vectorcalloffset__") == 0) {
  10451. assert(memb->type == T_PYSSIZET);
  10452. assert(memb->flags == READONLY);
  10453. #if PY_VERSION_HEX >= 0x030800b4
  10454. type->tp_vectorcall_offset = memb->offset;
  10455. #else
  10456. type->tp_print = (printfunc) memb->offset;
  10457. #endif
  10458. changed = 1;
  10459. }
  10460. #endif
  10461. #else
  10462. if ((0));
  10463. #endif
  10464. #if PY_VERSION_HEX <= 0x030900b1 && CYTHON_COMPILING_IN_CPYTHON
  10465. else if (strcmp(memb->name, "__module__") == 0) {
  10466. PyObject *descr;
  10467. assert(memb->type == T_OBJECT);
  10468. assert(memb->flags == 0 || memb->flags == READONLY);
  10469. descr = PyDescr_NewMember(type, memb);
  10470. if (unlikely(!descr))
  10471. return -1;
  10472. if (unlikely(PyDict_SetItem(type->tp_dict, PyDescr_NAME(descr), descr) < 0)) {
  10473. Py_DECREF(descr);
  10474. return -1;
  10475. }
  10476. Py_DECREF(descr);
  10477. changed = 1;
  10478. }
  10479. #endif
  10480. }
  10481. memb++;
  10482. }
  10483. if (changed)
  10484. PyType_Modified(type);
  10485. }
  10486. #endif
  10487. return 0;
  10488. }
  10489. #endif
  10490. /* FetchSharedCythonModule */
  10491. static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
  10492. return __Pyx_PyImport_AddModuleRef((char*) __PYX_ABI_MODULE_NAME);
  10493. }
  10494. /* FetchCommonType */
  10495. static int __Pyx_VerifyCachedType(PyObject *cached_type,
  10496. const char *name,
  10497. Py_ssize_t basicsize,
  10498. Py_ssize_t expected_basicsize) {
  10499. if (!PyType_Check(cached_type)) {
  10500. PyErr_Format(PyExc_TypeError,
  10501. "Shared Cython type %.200s is not a type object", name);
  10502. return -1;
  10503. }
  10504. if (basicsize != expected_basicsize) {
  10505. PyErr_Format(PyExc_TypeError,
  10506. "Shared Cython type %.200s has the wrong size, try recompiling",
  10507. name);
  10508. return -1;
  10509. }
  10510. return 0;
  10511. }
  10512. #if !CYTHON_USE_TYPE_SPECS
  10513. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  10514. PyObject* abi_module;
  10515. const char* object_name;
  10516. PyTypeObject *cached_type = NULL;
  10517. abi_module = __Pyx_FetchSharedCythonABIModule();
  10518. if (!abi_module) return NULL;
  10519. object_name = strrchr(type->tp_name, '.');
  10520. object_name = object_name ? object_name+1 : type->tp_name;
  10521. cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, object_name);
  10522. if (cached_type) {
  10523. if (__Pyx_VerifyCachedType(
  10524. (PyObject *)cached_type,
  10525. object_name,
  10526. cached_type->tp_basicsize,
  10527. type->tp_basicsize) < 0) {
  10528. goto bad;
  10529. }
  10530. goto done;
  10531. }
  10532. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  10533. PyErr_Clear();
  10534. if (PyType_Ready(type) < 0) goto bad;
  10535. if (PyObject_SetAttrString(abi_module, object_name, (PyObject *)type) < 0)
  10536. goto bad;
  10537. Py_INCREF(type);
  10538. cached_type = type;
  10539. done:
  10540. Py_DECREF(abi_module);
  10541. return cached_type;
  10542. bad:
  10543. Py_XDECREF(cached_type);
  10544. cached_type = NULL;
  10545. goto done;
  10546. }
  10547. #else
  10548. static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyObject *module, PyType_Spec *spec, PyObject *bases) {
  10549. PyObject *abi_module, *cached_type = NULL;
  10550. const char* object_name = strrchr(spec->name, '.');
  10551. object_name = object_name ? object_name+1 : spec->name;
  10552. abi_module = __Pyx_FetchSharedCythonABIModule();
  10553. if (!abi_module) return NULL;
  10554. cached_type = PyObject_GetAttrString(abi_module, object_name);
  10555. if (cached_type) {
  10556. Py_ssize_t basicsize;
  10557. #if CYTHON_COMPILING_IN_LIMITED_API
  10558. PyObject *py_basicsize;
  10559. py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
  10560. if (unlikely(!py_basicsize)) goto bad;
  10561. basicsize = PyLong_AsSsize_t(py_basicsize);
  10562. Py_DECREF(py_basicsize);
  10563. py_basicsize = 0;
  10564. if (unlikely(basicsize == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
  10565. #else
  10566. basicsize = likely(PyType_Check(cached_type)) ? ((PyTypeObject*) cached_type)->tp_basicsize : -1;
  10567. #endif
  10568. if (__Pyx_VerifyCachedType(
  10569. cached_type,
  10570. object_name,
  10571. basicsize,
  10572. spec->basicsize) < 0) {
  10573. goto bad;
  10574. }
  10575. goto done;
  10576. }
  10577. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  10578. PyErr_Clear();
  10579. CYTHON_UNUSED_VAR(module);
  10580. cached_type = __Pyx_PyType_FromModuleAndSpec(abi_module, spec, bases);
  10581. if (unlikely(!cached_type)) goto bad;
  10582. if (unlikely(__Pyx_fix_up_extension_type_from_spec(spec, (PyTypeObject *) cached_type) < 0)) goto bad;
  10583. if (PyObject_SetAttrString(abi_module, object_name, cached_type) < 0) goto bad;
  10584. done:
  10585. Py_DECREF(abi_module);
  10586. assert(cached_type == NULL || PyType_Check(cached_type));
  10587. return (PyTypeObject *) cached_type;
  10588. bad:
  10589. Py_XDECREF(cached_type);
  10590. cached_type = NULL;
  10591. goto done;
  10592. }
  10593. #endif
  10594. /* PyVectorcallFastCallDict */
  10595. #if CYTHON_METH_FASTCALL
  10596. static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  10597. {
  10598. PyObject *res = NULL;
  10599. PyObject *kwnames;
  10600. PyObject **newargs;
  10601. PyObject **kwvalues;
  10602. Py_ssize_t i, pos;
  10603. size_t j;
  10604. PyObject *key, *value;
  10605. unsigned long keys_are_strings;
  10606. Py_ssize_t nkw = PyDict_GET_SIZE(kw);
  10607. newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
  10608. if (unlikely(newargs == NULL)) {
  10609. PyErr_NoMemory();
  10610. return NULL;
  10611. }
  10612. for (j = 0; j < nargs; j++) newargs[j] = args[j];
  10613. kwnames = PyTuple_New(nkw);
  10614. if (unlikely(kwnames == NULL)) {
  10615. PyMem_Free(newargs);
  10616. return NULL;
  10617. }
  10618. kwvalues = newargs + nargs;
  10619. pos = i = 0;
  10620. keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
  10621. while (PyDict_Next(kw, &pos, &key, &value)) {
  10622. keys_are_strings &= Py_TYPE(key)->tp_flags;
  10623. Py_INCREF(key);
  10624. Py_INCREF(value);
  10625. PyTuple_SET_ITEM(kwnames, i, key);
  10626. kwvalues[i] = value;
  10627. i++;
  10628. }
  10629. if (unlikely(!keys_are_strings)) {
  10630. PyErr_SetString(PyExc_TypeError, "keywords must be strings");
  10631. goto cleanup;
  10632. }
  10633. res = vc(func, newargs, nargs, kwnames);
  10634. cleanup:
  10635. Py_DECREF(kwnames);
  10636. for (i = 0; i < nkw; i++)
  10637. Py_DECREF(kwvalues[i]);
  10638. PyMem_Free(newargs);
  10639. return res;
  10640. }
  10641. static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
  10642. {
  10643. if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
  10644. return vc(func, args, nargs, NULL);
  10645. }
  10646. return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
  10647. }
  10648. #endif
  10649. /* CythonFunctionShared */
  10650. #if CYTHON_COMPILING_IN_LIMITED_API
  10651. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
  10652. if (__Pyx_CyFunction_Check(func)) {
  10653. return PyCFunction_GetFunction(((__pyx_CyFunctionObject*)func)->func) == (PyCFunction) cfunc;
  10654. } else if (PyCFunction_Check(func)) {
  10655. return PyCFunction_GetFunction(func) == (PyCFunction) cfunc;
  10656. }
  10657. return 0;
  10658. }
  10659. #else
  10660. static CYTHON_INLINE int __Pyx__IsSameCyOrCFunction(PyObject *func, void *cfunc) {
  10661. return __Pyx_CyOrPyCFunction_Check(func) && __Pyx_CyOrPyCFunction_GET_FUNCTION(func) == (PyCFunction) cfunc;
  10662. }
  10663. #endif
  10664. static CYTHON_INLINE void __Pyx__CyFunction_SetClassObj(__pyx_CyFunctionObject* f, PyObject* classobj) {
  10665. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  10666. __Pyx_Py_XDECREF_SET(
  10667. __Pyx_CyFunction_GetClassObj(f),
  10668. ((classobj) ? __Pyx_NewRef(classobj) : NULL));
  10669. #else
  10670. __Pyx_Py_XDECREF_SET(
  10671. ((PyCMethodObject *) (f))->mm_class,
  10672. (PyTypeObject*)((classobj) ? __Pyx_NewRef(classobj) : NULL));
  10673. #endif
  10674. }
  10675. static PyObject *
  10676. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
  10677. {
  10678. CYTHON_UNUSED_VAR(closure);
  10679. if (unlikely(op->func_doc == NULL)) {
  10680. #if CYTHON_COMPILING_IN_LIMITED_API
  10681. op->func_doc = PyObject_GetAttrString(op->func, "__doc__");
  10682. if (unlikely(!op->func_doc)) return NULL;
  10683. #else
  10684. if (((PyCFunctionObject*)op)->m_ml->ml_doc) {
  10685. #if PY_MAJOR_VERSION >= 3
  10686. op->func_doc = PyUnicode_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
  10687. #else
  10688. op->func_doc = PyString_FromString(((PyCFunctionObject*)op)->m_ml->ml_doc);
  10689. #endif
  10690. if (unlikely(op->func_doc == NULL))
  10691. return NULL;
  10692. } else {
  10693. Py_INCREF(Py_None);
  10694. return Py_None;
  10695. }
  10696. #endif
  10697. }
  10698. Py_INCREF(op->func_doc);
  10699. return op->func_doc;
  10700. }
  10701. static int
  10702. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10703. {
  10704. CYTHON_UNUSED_VAR(context);
  10705. if (value == NULL) {
  10706. value = Py_None;
  10707. }
  10708. Py_INCREF(value);
  10709. __Pyx_Py_XDECREF_SET(op->func_doc, value);
  10710. return 0;
  10711. }
  10712. static PyObject *
  10713. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
  10714. {
  10715. CYTHON_UNUSED_VAR(context);
  10716. if (unlikely(op->func_name == NULL)) {
  10717. #if CYTHON_COMPILING_IN_LIMITED_API
  10718. op->func_name = PyObject_GetAttrString(op->func, "__name__");
  10719. #elif PY_MAJOR_VERSION >= 3
  10720. op->func_name = PyUnicode_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
  10721. #else
  10722. op->func_name = PyString_InternFromString(((PyCFunctionObject*)op)->m_ml->ml_name);
  10723. #endif
  10724. if (unlikely(op->func_name == NULL))
  10725. return NULL;
  10726. }
  10727. Py_INCREF(op->func_name);
  10728. return op->func_name;
  10729. }
  10730. static int
  10731. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10732. {
  10733. CYTHON_UNUSED_VAR(context);
  10734. #if PY_MAJOR_VERSION >= 3
  10735. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  10736. #else
  10737. if (unlikely(value == NULL || !PyString_Check(value)))
  10738. #endif
  10739. {
  10740. PyErr_SetString(PyExc_TypeError,
  10741. "__name__ must be set to a string object");
  10742. return -1;
  10743. }
  10744. Py_INCREF(value);
  10745. __Pyx_Py_XDECREF_SET(op->func_name, value);
  10746. return 0;
  10747. }
  10748. static PyObject *
  10749. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
  10750. {
  10751. CYTHON_UNUSED_VAR(context);
  10752. Py_INCREF(op->func_qualname);
  10753. return op->func_qualname;
  10754. }
  10755. static int
  10756. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10757. {
  10758. CYTHON_UNUSED_VAR(context);
  10759. #if PY_MAJOR_VERSION >= 3
  10760. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  10761. #else
  10762. if (unlikely(value == NULL || !PyString_Check(value)))
  10763. #endif
  10764. {
  10765. PyErr_SetString(PyExc_TypeError,
  10766. "__qualname__ must be set to a string object");
  10767. return -1;
  10768. }
  10769. Py_INCREF(value);
  10770. __Pyx_Py_XDECREF_SET(op->func_qualname, value);
  10771. return 0;
  10772. }
  10773. static PyObject *
  10774. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
  10775. {
  10776. CYTHON_UNUSED_VAR(context);
  10777. if (unlikely(op->func_dict == NULL)) {
  10778. op->func_dict = PyDict_New();
  10779. if (unlikely(op->func_dict == NULL))
  10780. return NULL;
  10781. }
  10782. Py_INCREF(op->func_dict);
  10783. return op->func_dict;
  10784. }
  10785. static int
  10786. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
  10787. {
  10788. CYTHON_UNUSED_VAR(context);
  10789. if (unlikely(value == NULL)) {
  10790. PyErr_SetString(PyExc_TypeError,
  10791. "function's dictionary may not be deleted");
  10792. return -1;
  10793. }
  10794. if (unlikely(!PyDict_Check(value))) {
  10795. PyErr_SetString(PyExc_TypeError,
  10796. "setting function's dictionary to a non-dict");
  10797. return -1;
  10798. }
  10799. Py_INCREF(value);
  10800. __Pyx_Py_XDECREF_SET(op->func_dict, value);
  10801. return 0;
  10802. }
  10803. static PyObject *
  10804. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
  10805. {
  10806. CYTHON_UNUSED_VAR(context);
  10807. Py_INCREF(op->func_globals);
  10808. return op->func_globals;
  10809. }
  10810. static PyObject *
  10811. __Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
  10812. {
  10813. CYTHON_UNUSED_VAR(op);
  10814. CYTHON_UNUSED_VAR(context);
  10815. Py_INCREF(Py_None);
  10816. return Py_None;
  10817. }
  10818. static PyObject *
  10819. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
  10820. {
  10821. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  10822. CYTHON_UNUSED_VAR(context);
  10823. Py_INCREF(result);
  10824. return result;
  10825. }
  10826. static int
  10827. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  10828. int result = 0;
  10829. PyObject *res = op->defaults_getter((PyObject *) op);
  10830. if (unlikely(!res))
  10831. return -1;
  10832. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10833. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  10834. Py_INCREF(op->defaults_tuple);
  10835. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  10836. Py_INCREF(op->defaults_kwdict);
  10837. #else
  10838. op->defaults_tuple = __Pyx_PySequence_ITEM(res, 0);
  10839. if (unlikely(!op->defaults_tuple)) result = -1;
  10840. else {
  10841. op->defaults_kwdict = __Pyx_PySequence_ITEM(res, 1);
  10842. if (unlikely(!op->defaults_kwdict)) result = -1;
  10843. }
  10844. #endif
  10845. Py_DECREF(res);
  10846. return result;
  10847. }
  10848. static int
  10849. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10850. CYTHON_UNUSED_VAR(context);
  10851. if (!value) {
  10852. value = Py_None;
  10853. } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
  10854. PyErr_SetString(PyExc_TypeError,
  10855. "__defaults__ must be set to a tuple object");
  10856. return -1;
  10857. }
  10858. PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__defaults__ will not "
  10859. "currently affect the values used in function calls", 1);
  10860. Py_INCREF(value);
  10861. __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
  10862. return 0;
  10863. }
  10864. static PyObject *
  10865. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
  10866. PyObject* result = op->defaults_tuple;
  10867. CYTHON_UNUSED_VAR(context);
  10868. if (unlikely(!result)) {
  10869. if (op->defaults_getter) {
  10870. if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
  10871. result = op->defaults_tuple;
  10872. } else {
  10873. result = Py_None;
  10874. }
  10875. }
  10876. Py_INCREF(result);
  10877. return result;
  10878. }
  10879. static int
  10880. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10881. CYTHON_UNUSED_VAR(context);
  10882. if (!value) {
  10883. value = Py_None;
  10884. } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
  10885. PyErr_SetString(PyExc_TypeError,
  10886. "__kwdefaults__ must be set to a dict object");
  10887. return -1;
  10888. }
  10889. PyErr_WarnEx(PyExc_RuntimeWarning, "changes to cyfunction.__kwdefaults__ will not "
  10890. "currently affect the values used in function calls", 1);
  10891. Py_INCREF(value);
  10892. __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
  10893. return 0;
  10894. }
  10895. static PyObject *
  10896. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
  10897. PyObject* result = op->defaults_kwdict;
  10898. CYTHON_UNUSED_VAR(context);
  10899. if (unlikely(!result)) {
  10900. if (op->defaults_getter) {
  10901. if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
  10902. result = op->defaults_kwdict;
  10903. } else {
  10904. result = Py_None;
  10905. }
  10906. }
  10907. Py_INCREF(result);
  10908. return result;
  10909. }
  10910. static int
  10911. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10912. CYTHON_UNUSED_VAR(context);
  10913. if (!value || value == Py_None) {
  10914. value = NULL;
  10915. } else if (unlikely(!PyDict_Check(value))) {
  10916. PyErr_SetString(PyExc_TypeError,
  10917. "__annotations__ must be set to a dict object");
  10918. return -1;
  10919. }
  10920. Py_XINCREF(value);
  10921. __Pyx_Py_XDECREF_SET(op->func_annotations, value);
  10922. return 0;
  10923. }
  10924. static PyObject *
  10925. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
  10926. PyObject* result = op->func_annotations;
  10927. CYTHON_UNUSED_VAR(context);
  10928. if (unlikely(!result)) {
  10929. result = PyDict_New();
  10930. if (unlikely(!result)) return NULL;
  10931. op->func_annotations = result;
  10932. }
  10933. Py_INCREF(result);
  10934. return result;
  10935. }
  10936. static PyObject *
  10937. __Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
  10938. int is_coroutine;
  10939. CYTHON_UNUSED_VAR(context);
  10940. if (op->func_is_coroutine) {
  10941. return __Pyx_NewRef(op->func_is_coroutine);
  10942. }
  10943. is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
  10944. #if PY_VERSION_HEX >= 0x03050000
  10945. if (is_coroutine) {
  10946. PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
  10947. fromlist = PyList_New(1);
  10948. if (unlikely(!fromlist)) return NULL;
  10949. Py_INCREF(marker);
  10950. #if CYTHON_ASSUME_SAFE_MACROS
  10951. PyList_SET_ITEM(fromlist, 0, marker);
  10952. #else
  10953. if (unlikely(PyList_SetItem(fromlist, 0, marker) < 0)) {
  10954. Py_DECREF(marker);
  10955. Py_DECREF(fromlist);
  10956. return NULL;
  10957. }
  10958. #endif
  10959. module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
  10960. Py_DECREF(fromlist);
  10961. if (unlikely(!module)) goto ignore;
  10962. op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
  10963. Py_DECREF(module);
  10964. if (likely(op->func_is_coroutine)) {
  10965. return __Pyx_NewRef(op->func_is_coroutine);
  10966. }
  10967. ignore:
  10968. PyErr_Clear();
  10969. }
  10970. #endif
  10971. op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
  10972. return __Pyx_NewRef(op->func_is_coroutine);
  10973. }
  10974. #if CYTHON_COMPILING_IN_LIMITED_API
  10975. static PyObject *
  10976. __Pyx_CyFunction_get_module(__pyx_CyFunctionObject *op, void *context) {
  10977. CYTHON_UNUSED_VAR(context);
  10978. return PyObject_GetAttrString(op->func, "__module__");
  10979. }
  10980. static int
  10981. __Pyx_CyFunction_set_module(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
  10982. CYTHON_UNUSED_VAR(context);
  10983. return PyObject_SetAttrString(op->func, "__module__", value);
  10984. }
  10985. #endif
  10986. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  10987. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  10988. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  10989. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  10990. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  10991. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  10992. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  10993. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  10994. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  10995. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  10996. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  10997. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  10998. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  10999. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  11000. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  11001. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  11002. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  11003. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  11004. {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
  11005. #if CYTHON_COMPILING_IN_LIMITED_API
  11006. {"__module__", (getter)__Pyx_CyFunction_get_module, (setter)__Pyx_CyFunction_set_module, 0, 0},
  11007. #endif
  11008. {0, 0, 0, 0, 0}
  11009. };
  11010. static PyMemberDef __pyx_CyFunction_members[] = {
  11011. #if !CYTHON_COMPILING_IN_LIMITED_API
  11012. {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), 0, 0},
  11013. #endif
  11014. #if CYTHON_USE_TYPE_SPECS
  11015. {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
  11016. #if CYTHON_METH_FASTCALL
  11017. #if CYTHON_BACKPORT_VECTORCALL
  11018. {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_vectorcall), READONLY, 0},
  11019. #else
  11020. #if !CYTHON_COMPILING_IN_LIMITED_API
  11021. {(char *) "__vectorcalloffset__", T_PYSSIZET, offsetof(PyCFunctionObject, vectorcall), READONLY, 0},
  11022. #endif
  11023. #endif
  11024. #endif
  11025. #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
  11026. {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
  11027. #else
  11028. {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
  11029. #endif
  11030. #endif
  11031. {0, 0, 0, 0, 0}
  11032. };
  11033. static PyObject *
  11034. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
  11035. {
  11036. CYTHON_UNUSED_VAR(args);
  11037. #if PY_MAJOR_VERSION >= 3
  11038. Py_INCREF(m->func_qualname);
  11039. return m->func_qualname;
  11040. #else
  11041. return PyString_FromString(((PyCFunctionObject*)m)->m_ml->ml_name);
  11042. #endif
  11043. }
  11044. static PyMethodDef __pyx_CyFunction_methods[] = {
  11045. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  11046. {0, 0, 0, 0}
  11047. };
  11048. #if PY_VERSION_HEX < 0x030500A0 || CYTHON_COMPILING_IN_LIMITED_API
  11049. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  11050. #else
  11051. #define __Pyx_CyFunction_weakreflist(cyfunc) (((PyCFunctionObject*)cyfunc)->m_weakreflist)
  11052. #endif
  11053. static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
  11054. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  11055. #if !CYTHON_COMPILING_IN_LIMITED_API
  11056. PyCFunctionObject *cf = (PyCFunctionObject*) op;
  11057. #endif
  11058. if (unlikely(op == NULL))
  11059. return NULL;
  11060. #if CYTHON_COMPILING_IN_LIMITED_API
  11061. op->func = PyCFunction_NewEx(ml, (PyObject*)op, module);
  11062. if (unlikely(!op->func)) return NULL;
  11063. #endif
  11064. op->flags = flags;
  11065. __Pyx_CyFunction_weakreflist(op) = NULL;
  11066. #if !CYTHON_COMPILING_IN_LIMITED_API
  11067. cf->m_ml = ml;
  11068. cf->m_self = (PyObject *) op;
  11069. #endif
  11070. Py_XINCREF(closure);
  11071. op->func_closure = closure;
  11072. #if !CYTHON_COMPILING_IN_LIMITED_API
  11073. Py_XINCREF(module);
  11074. cf->m_module = module;
  11075. #endif
  11076. op->func_dict = NULL;
  11077. op->func_name = NULL;
  11078. Py_INCREF(qualname);
  11079. op->func_qualname = qualname;
  11080. op->func_doc = NULL;
  11081. #if PY_VERSION_HEX < 0x030900B1 || CYTHON_COMPILING_IN_LIMITED_API
  11082. op->func_classobj = NULL;
  11083. #else
  11084. ((PyCMethodObject*)op)->mm_class = NULL;
  11085. #endif
  11086. op->func_globals = globals;
  11087. Py_INCREF(op->func_globals);
  11088. Py_XINCREF(code);
  11089. op->func_code = code;
  11090. op->defaults_pyobjects = 0;
  11091. op->defaults_size = 0;
  11092. op->defaults = NULL;
  11093. op->defaults_tuple = NULL;
  11094. op->defaults_kwdict = NULL;
  11095. op->defaults_getter = NULL;
  11096. op->func_annotations = NULL;
  11097. op->func_is_coroutine = NULL;
  11098. #if CYTHON_METH_FASTCALL
  11099. switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS | METH_METHOD)) {
  11100. case METH_NOARGS:
  11101. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
  11102. break;
  11103. case METH_O:
  11104. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
  11105. break;
  11106. case METH_METHOD | METH_FASTCALL | METH_KEYWORDS:
  11107. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD;
  11108. break;
  11109. case METH_FASTCALL | METH_KEYWORDS:
  11110. __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
  11111. break;
  11112. case METH_VARARGS | METH_KEYWORDS:
  11113. __Pyx_CyFunction_func_vectorcall(op) = NULL;
  11114. break;
  11115. default:
  11116. PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
  11117. Py_DECREF(op);
  11118. return NULL;
  11119. }
  11120. #endif
  11121. return (PyObject *) op;
  11122. }
  11123. static int
  11124. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  11125. {
  11126. Py_CLEAR(m->func_closure);
  11127. #if CYTHON_COMPILING_IN_LIMITED_API
  11128. Py_CLEAR(m->func);
  11129. #else
  11130. Py_CLEAR(((PyCFunctionObject*)m)->m_module);
  11131. #endif
  11132. Py_CLEAR(m->func_dict);
  11133. Py_CLEAR(m->func_name);
  11134. Py_CLEAR(m->func_qualname);
  11135. Py_CLEAR(m->func_doc);
  11136. Py_CLEAR(m->func_globals);
  11137. Py_CLEAR(m->func_code);
  11138. #if !CYTHON_COMPILING_IN_LIMITED_API
  11139. #if PY_VERSION_HEX < 0x030900B1
  11140. Py_CLEAR(__Pyx_CyFunction_GetClassObj(m));
  11141. #else
  11142. {
  11143. PyObject *cls = (PyObject*) ((PyCMethodObject *) (m))->mm_class;
  11144. ((PyCMethodObject *) (m))->mm_class = NULL;
  11145. Py_XDECREF(cls);
  11146. }
  11147. #endif
  11148. #endif
  11149. Py_CLEAR(m->defaults_tuple);
  11150. Py_CLEAR(m->defaults_kwdict);
  11151. Py_CLEAR(m->func_annotations);
  11152. Py_CLEAR(m->func_is_coroutine);
  11153. if (m->defaults) {
  11154. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  11155. int i;
  11156. for (i = 0; i < m->defaults_pyobjects; i++)
  11157. Py_XDECREF(pydefaults[i]);
  11158. PyObject_Free(m->defaults);
  11159. m->defaults = NULL;
  11160. }
  11161. return 0;
  11162. }
  11163. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  11164. {
  11165. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  11166. PyObject_ClearWeakRefs((PyObject *) m);
  11167. __Pyx_CyFunction_clear(m);
  11168. __Pyx_PyHeapTypeObject_GC_Del(m);
  11169. }
  11170. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  11171. {
  11172. PyObject_GC_UnTrack(m);
  11173. __Pyx__CyFunction_dealloc(m);
  11174. }
  11175. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  11176. {
  11177. Py_VISIT(m->func_closure);
  11178. #if CYTHON_COMPILING_IN_LIMITED_API
  11179. Py_VISIT(m->func);
  11180. #else
  11181. Py_VISIT(((PyCFunctionObject*)m)->m_module);
  11182. #endif
  11183. Py_VISIT(m->func_dict);
  11184. Py_VISIT(m->func_name);
  11185. Py_VISIT(m->func_qualname);
  11186. Py_VISIT(m->func_doc);
  11187. Py_VISIT(m->func_globals);
  11188. Py_VISIT(m->func_code);
  11189. #if !CYTHON_COMPILING_IN_LIMITED_API
  11190. Py_VISIT(__Pyx_CyFunction_GetClassObj(m));
  11191. #endif
  11192. Py_VISIT(m->defaults_tuple);
  11193. Py_VISIT(m->defaults_kwdict);
  11194. Py_VISIT(m->func_is_coroutine);
  11195. if (m->defaults) {
  11196. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  11197. int i;
  11198. for (i = 0; i < m->defaults_pyobjects; i++)
  11199. Py_VISIT(pydefaults[i]);
  11200. }
  11201. return 0;
  11202. }
  11203. static PyObject*
  11204. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  11205. {
  11206. #if PY_MAJOR_VERSION >= 3
  11207. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  11208. op->func_qualname, (void *)op);
  11209. #else
  11210. return PyString_FromFormat("<cyfunction %s at %p>",
  11211. PyString_AsString(op->func_qualname), (void *)op);
  11212. #endif
  11213. }
  11214. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  11215. #if CYTHON_COMPILING_IN_LIMITED_API
  11216. PyObject *f = ((__pyx_CyFunctionObject*)func)->func;
  11217. PyObject *py_name = NULL;
  11218. PyCFunction meth;
  11219. int flags;
  11220. meth = PyCFunction_GetFunction(f);
  11221. if (unlikely(!meth)) return NULL;
  11222. flags = PyCFunction_GetFlags(f);
  11223. if (unlikely(flags < 0)) return NULL;
  11224. #else
  11225. PyCFunctionObject* f = (PyCFunctionObject*)func;
  11226. PyCFunction meth = f->m_ml->ml_meth;
  11227. int flags = f->m_ml->ml_flags;
  11228. #endif
  11229. Py_ssize_t size;
  11230. switch (flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  11231. case METH_VARARGS:
  11232. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  11233. return (*meth)(self, arg);
  11234. break;
  11235. case METH_VARARGS | METH_KEYWORDS:
  11236. return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
  11237. case METH_NOARGS:
  11238. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  11239. #if CYTHON_ASSUME_SAFE_MACROS
  11240. size = PyTuple_GET_SIZE(arg);
  11241. #else
  11242. size = PyTuple_Size(arg);
  11243. if (unlikely(size < 0)) return NULL;
  11244. #endif
  11245. if (likely(size == 0))
  11246. return (*meth)(self, NULL);
  11247. #if CYTHON_COMPILING_IN_LIMITED_API
  11248. py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
  11249. if (!py_name) return NULL;
  11250. PyErr_Format(PyExc_TypeError,
  11251. "%.200S() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11252. py_name, size);
  11253. Py_DECREF(py_name);
  11254. #else
  11255. PyErr_Format(PyExc_TypeError,
  11256. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11257. f->m_ml->ml_name, size);
  11258. #endif
  11259. return NULL;
  11260. }
  11261. break;
  11262. case METH_O:
  11263. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  11264. #if CYTHON_ASSUME_SAFE_MACROS
  11265. size = PyTuple_GET_SIZE(arg);
  11266. #else
  11267. size = PyTuple_Size(arg);
  11268. if (unlikely(size < 0)) return NULL;
  11269. #endif
  11270. if (likely(size == 1)) {
  11271. PyObject *result, *arg0;
  11272. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11273. arg0 = PyTuple_GET_ITEM(arg, 0);
  11274. #else
  11275. arg0 = __Pyx_PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  11276. #endif
  11277. result = (*meth)(self, arg0);
  11278. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  11279. Py_DECREF(arg0);
  11280. #endif
  11281. return result;
  11282. }
  11283. #if CYTHON_COMPILING_IN_LIMITED_API
  11284. py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
  11285. if (!py_name) return NULL;
  11286. PyErr_Format(PyExc_TypeError,
  11287. "%.200S() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11288. py_name, size);
  11289. Py_DECREF(py_name);
  11290. #else
  11291. PyErr_Format(PyExc_TypeError,
  11292. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11293. f->m_ml->ml_name, size);
  11294. #endif
  11295. return NULL;
  11296. }
  11297. break;
  11298. default:
  11299. PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
  11300. return NULL;
  11301. }
  11302. #if CYTHON_COMPILING_IN_LIMITED_API
  11303. py_name = __Pyx_CyFunction_get_name((__pyx_CyFunctionObject*)func, NULL);
  11304. if (!py_name) return NULL;
  11305. PyErr_Format(PyExc_TypeError, "%.200S() takes no keyword arguments",
  11306. py_name);
  11307. Py_DECREF(py_name);
  11308. #else
  11309. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  11310. f->m_ml->ml_name);
  11311. #endif
  11312. return NULL;
  11313. }
  11314. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  11315. PyObject *self, *result;
  11316. #if CYTHON_COMPILING_IN_LIMITED_API
  11317. self = PyCFunction_GetSelf(((__pyx_CyFunctionObject*)func)->func);
  11318. if (unlikely(!self) && PyErr_Occurred()) return NULL;
  11319. #else
  11320. self = ((PyCFunctionObject*)func)->m_self;
  11321. #endif
  11322. result = __Pyx_CyFunction_CallMethod(func, self, arg, kw);
  11323. return result;
  11324. }
  11325. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  11326. PyObject *result;
  11327. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  11328. #if CYTHON_METH_FASTCALL
  11329. __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
  11330. if (vc) {
  11331. #if CYTHON_ASSUME_SAFE_MACROS
  11332. return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
  11333. #else
  11334. (void) &__Pyx_PyVectorcall_FastCallDict;
  11335. return PyVectorcall_Call(func, args, kw);
  11336. #endif
  11337. }
  11338. #endif
  11339. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  11340. Py_ssize_t argc;
  11341. PyObject *new_args;
  11342. PyObject *self;
  11343. #if CYTHON_ASSUME_SAFE_MACROS
  11344. argc = PyTuple_GET_SIZE(args);
  11345. #else
  11346. argc = PyTuple_Size(args);
  11347. if (unlikely(!argc) < 0) return NULL;
  11348. #endif
  11349. new_args = PyTuple_GetSlice(args, 1, argc);
  11350. if (unlikely(!new_args))
  11351. return NULL;
  11352. self = PyTuple_GetItem(args, 0);
  11353. if (unlikely(!self)) {
  11354. Py_DECREF(new_args);
  11355. #if PY_MAJOR_VERSION > 2
  11356. PyErr_Format(PyExc_TypeError,
  11357. "unbound method %.200S() needs an argument",
  11358. cyfunc->func_qualname);
  11359. #else
  11360. PyErr_SetString(PyExc_TypeError,
  11361. "unbound method needs an argument");
  11362. #endif
  11363. return NULL;
  11364. }
  11365. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  11366. Py_DECREF(new_args);
  11367. } else {
  11368. result = __Pyx_CyFunction_Call(func, args, kw);
  11369. }
  11370. return result;
  11371. }
  11372. #if CYTHON_METH_FASTCALL
  11373. static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
  11374. {
  11375. int ret = 0;
  11376. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  11377. if (unlikely(nargs < 1)) {
  11378. PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
  11379. ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
  11380. return -1;
  11381. }
  11382. ret = 1;
  11383. }
  11384. if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
  11385. PyErr_Format(PyExc_TypeError,
  11386. "%.200s() takes no keyword arguments", ((PyCFunctionObject*)cyfunc)->m_ml->ml_name);
  11387. return -1;
  11388. }
  11389. return ret;
  11390. }
  11391. static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  11392. {
  11393. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  11394. PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
  11395. #if CYTHON_BACKPORT_VECTORCALL
  11396. Py_ssize_t nargs = (Py_ssize_t)nargsf;
  11397. #else
  11398. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  11399. #endif
  11400. PyObject *self;
  11401. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
  11402. case 1:
  11403. self = args[0];
  11404. args += 1;
  11405. nargs -= 1;
  11406. break;
  11407. case 0:
  11408. self = ((PyCFunctionObject*)cyfunc)->m_self;
  11409. break;
  11410. default:
  11411. return NULL;
  11412. }
  11413. if (unlikely(nargs != 0)) {
  11414. PyErr_Format(PyExc_TypeError,
  11415. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11416. def->ml_name, nargs);
  11417. return NULL;
  11418. }
  11419. return def->ml_meth(self, NULL);
  11420. }
  11421. static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  11422. {
  11423. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  11424. PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
  11425. #if CYTHON_BACKPORT_VECTORCALL
  11426. Py_ssize_t nargs = (Py_ssize_t)nargsf;
  11427. #else
  11428. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  11429. #endif
  11430. PyObject *self;
  11431. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
  11432. case 1:
  11433. self = args[0];
  11434. args += 1;
  11435. nargs -= 1;
  11436. break;
  11437. case 0:
  11438. self = ((PyCFunctionObject*)cyfunc)->m_self;
  11439. break;
  11440. default:
  11441. return NULL;
  11442. }
  11443. if (unlikely(nargs != 1)) {
  11444. PyErr_Format(PyExc_TypeError,
  11445. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  11446. def->ml_name, nargs);
  11447. return NULL;
  11448. }
  11449. return def->ml_meth(self, args[0]);
  11450. }
  11451. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  11452. {
  11453. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  11454. PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
  11455. #if CYTHON_BACKPORT_VECTORCALL
  11456. Py_ssize_t nargs = (Py_ssize_t)nargsf;
  11457. #else
  11458. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  11459. #endif
  11460. PyObject *self;
  11461. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
  11462. case 1:
  11463. self = args[0];
  11464. args += 1;
  11465. nargs -= 1;
  11466. break;
  11467. case 0:
  11468. self = ((PyCFunctionObject*)cyfunc)->m_self;
  11469. break;
  11470. default:
  11471. return NULL;
  11472. }
  11473. return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
  11474. }
  11475. static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
  11476. {
  11477. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
  11478. PyMethodDef* def = ((PyCFunctionObject*)cyfunc)->m_ml;
  11479. PyTypeObject *cls = (PyTypeObject *) __Pyx_CyFunction_GetClassObj(cyfunc);
  11480. #if CYTHON_BACKPORT_VECTORCALL
  11481. Py_ssize_t nargs = (Py_ssize_t)nargsf;
  11482. #else
  11483. Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
  11484. #endif
  11485. PyObject *self;
  11486. switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
  11487. case 1:
  11488. self = args[0];
  11489. args += 1;
  11490. nargs -= 1;
  11491. break;
  11492. case 0:
  11493. self = ((PyCFunctionObject*)cyfunc)->m_self;
  11494. break;
  11495. default:
  11496. return NULL;
  11497. }
  11498. return ((__Pyx_PyCMethod)(void(*)(void))def->ml_meth)(self, cls, args, (size_t)nargs, kwnames);
  11499. }
  11500. #endif
  11501. #if CYTHON_USE_TYPE_SPECS
  11502. static PyType_Slot __pyx_CyFunctionType_slots[] = {
  11503. {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
  11504. {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
  11505. {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
  11506. {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
  11507. {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
  11508. {Py_tp_methods, (void *)__pyx_CyFunction_methods},
  11509. {Py_tp_members, (void *)__pyx_CyFunction_members},
  11510. {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
  11511. {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
  11512. {0, 0},
  11513. };
  11514. static PyType_Spec __pyx_CyFunctionType_spec = {
  11515. __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
  11516. sizeof(__pyx_CyFunctionObject),
  11517. 0,
  11518. #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
  11519. Py_TPFLAGS_METHOD_DESCRIPTOR |
  11520. #endif
  11521. #if (defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL)
  11522. _Py_TPFLAGS_HAVE_VECTORCALL |
  11523. #endif
  11524. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
  11525. __pyx_CyFunctionType_slots
  11526. };
  11527. #else
  11528. static PyTypeObject __pyx_CyFunctionType_type = {
  11529. PyVarObject_HEAD_INIT(0, 0)
  11530. __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
  11531. sizeof(__pyx_CyFunctionObject),
  11532. 0,
  11533. (destructor) __Pyx_CyFunction_dealloc,
  11534. #if !CYTHON_METH_FASTCALL
  11535. 0,
  11536. #elif CYTHON_BACKPORT_VECTORCALL
  11537. (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
  11538. #else
  11539. offsetof(PyCFunctionObject, vectorcall),
  11540. #endif
  11541. 0,
  11542. 0,
  11543. #if PY_MAJOR_VERSION < 3
  11544. 0,
  11545. #else
  11546. 0,
  11547. #endif
  11548. (reprfunc) __Pyx_CyFunction_repr,
  11549. 0,
  11550. 0,
  11551. 0,
  11552. 0,
  11553. __Pyx_CyFunction_CallAsMethod,
  11554. 0,
  11555. 0,
  11556. 0,
  11557. 0,
  11558. #ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
  11559. Py_TPFLAGS_METHOD_DESCRIPTOR |
  11560. #endif
  11561. #if defined(_Py_TPFLAGS_HAVE_VECTORCALL) && CYTHON_METH_FASTCALL
  11562. _Py_TPFLAGS_HAVE_VECTORCALL |
  11563. #endif
  11564. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_BASETYPE,
  11565. 0,
  11566. (traverseproc) __Pyx_CyFunction_traverse,
  11567. (inquiry) __Pyx_CyFunction_clear,
  11568. 0,
  11569. #if PY_VERSION_HEX < 0x030500A0
  11570. offsetof(__pyx_CyFunctionObject, func_weakreflist),
  11571. #else
  11572. offsetof(PyCFunctionObject, m_weakreflist),
  11573. #endif
  11574. 0,
  11575. 0,
  11576. __pyx_CyFunction_methods,
  11577. __pyx_CyFunction_members,
  11578. __pyx_CyFunction_getsets,
  11579. 0,
  11580. 0,
  11581. __Pyx_PyMethod_New,
  11582. 0,
  11583. offsetof(__pyx_CyFunctionObject, func_dict),
  11584. 0,
  11585. 0,
  11586. 0,
  11587. 0,
  11588. 0,
  11589. 0,
  11590. 0,
  11591. 0,
  11592. 0,
  11593. 0,
  11594. 0,
  11595. 0,
  11596. #if PY_VERSION_HEX >= 0x030400a1
  11597. 0,
  11598. #endif
  11599. #if PY_VERSION_HEX >= 0x030800b1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07030800)
  11600. 0,
  11601. #endif
  11602. #if __PYX_NEED_TP_PRINT_SLOT
  11603. 0,
  11604. #endif
  11605. #if PY_VERSION_HEX >= 0x030C0000
  11606. 0,
  11607. #endif
  11608. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX >= 0x03090000 && PY_VERSION_HEX < 0x030a0000
  11609. 0,
  11610. #endif
  11611. };
  11612. #endif
  11613. static int __pyx_CyFunction_init(PyObject *module) {
  11614. #if CYTHON_USE_TYPE_SPECS
  11615. __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(module, &__pyx_CyFunctionType_spec, NULL);
  11616. #else
  11617. CYTHON_UNUSED_VAR(module);
  11618. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  11619. #endif
  11620. if (unlikely(__pyx_CyFunctionType == NULL)) {
  11621. return -1;
  11622. }
  11623. return 0;
  11624. }
  11625. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  11626. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11627. m->defaults = PyObject_Malloc(size);
  11628. if (unlikely(!m->defaults))
  11629. return PyErr_NoMemory();
  11630. memset(m->defaults, 0, size);
  11631. m->defaults_pyobjects = pyobjects;
  11632. m->defaults_size = size;
  11633. return m->defaults;
  11634. }
  11635. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  11636. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11637. m->defaults_tuple = tuple;
  11638. Py_INCREF(tuple);
  11639. }
  11640. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  11641. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11642. m->defaults_kwdict = dict;
  11643. Py_INCREF(dict);
  11644. }
  11645. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  11646. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  11647. m->func_annotations = dict;
  11648. Py_INCREF(dict);
  11649. }
  11650. /* CythonFunction */
  11651. static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
  11652. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  11653. PyObject *op = __Pyx_CyFunction_Init(
  11654. PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
  11655. ml, flags, qualname, closure, module, globals, code
  11656. );
  11657. if (likely(op)) {
  11658. PyObject_GC_Track(op);
  11659. }
  11660. return op;
  11661. }
  11662. /* PyObjectCall2Args */
  11663. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  11664. PyObject *args[3] = {NULL, arg1, arg2};
  11665. return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
  11666. }
  11667. /* PyObjectLookupSpecial */
  11668. #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
  11669. static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
  11670. PyObject *res;
  11671. PyTypeObject *tp = Py_TYPE(obj);
  11672. #if PY_MAJOR_VERSION < 3
  11673. if (unlikely(PyInstance_Check(obj)))
  11674. return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
  11675. #endif
  11676. res = _PyType_Lookup(tp, attr_name);
  11677. if (likely(res)) {
  11678. descrgetfunc f = Py_TYPE(res)->tp_descr_get;
  11679. if (!f) {
  11680. Py_INCREF(res);
  11681. } else {
  11682. res = f(res, obj, (PyObject *)tp);
  11683. }
  11684. } else if (with_error) {
  11685. PyErr_SetObject(PyExc_AttributeError, attr_name);
  11686. }
  11687. return res;
  11688. }
  11689. #endif
  11690. /* Py3ClassCreate */
  11691. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  11692. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  11693. PyObject *ns;
  11694. if (metaclass) {
  11695. PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
  11696. if (prep) {
  11697. PyObject *pargs[3] = {NULL, name, bases};
  11698. ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
  11699. Py_DECREF(prep);
  11700. } else {
  11701. if (unlikely(PyErr_Occurred()))
  11702. return NULL;
  11703. ns = PyDict_New();
  11704. }
  11705. } else {
  11706. ns = PyDict_New();
  11707. }
  11708. if (unlikely(!ns))
  11709. return NULL;
  11710. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  11711. #if PY_VERSION_HEX >= 0x03030000
  11712. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  11713. #else
  11714. CYTHON_MAYBE_UNUSED_VAR(qualname);
  11715. #endif
  11716. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  11717. return ns;
  11718. bad:
  11719. Py_DECREF(ns);
  11720. return NULL;
  11721. }
  11722. #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
  11723. static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
  11724. PyTypeObject *type = (PyTypeObject*) type_obj;
  11725. PyObject *names_to_set, *key, *value, *set_name, *tmp;
  11726. Py_ssize_t i = 0;
  11727. #if CYTHON_USE_TYPE_SLOTS
  11728. names_to_set = PyDict_Copy(type->tp_dict);
  11729. #else
  11730. {
  11731. PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
  11732. names_to_set = NULL;
  11733. if (likely(d)) {
  11734. PyObject *names_to_set = PyDict_New();
  11735. int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
  11736. Py_DECREF(d);
  11737. if (unlikely(ret < 0))
  11738. Py_CLEAR(names_to_set);
  11739. }
  11740. }
  11741. #endif
  11742. if (unlikely(names_to_set == NULL))
  11743. goto bad;
  11744. while (PyDict_Next(names_to_set, &i, &key, &value)) {
  11745. set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
  11746. if (unlikely(set_name != NULL)) {
  11747. tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
  11748. Py_DECREF(set_name);
  11749. if (unlikely(tmp == NULL)) {
  11750. __Pyx_TypeName value_type_name =
  11751. __Pyx_PyType_GetName(Py_TYPE(value));
  11752. __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
  11753. PyErr_Format(PyExc_RuntimeError,
  11754. #if PY_MAJOR_VERSION >= 3
  11755. "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
  11756. value_type_name, key, type_name);
  11757. #else
  11758. "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
  11759. value_type_name,
  11760. PyString_Check(key) ? PyString_AS_STRING(key) : "?",
  11761. type_name);
  11762. #endif
  11763. goto bad;
  11764. } else {
  11765. Py_DECREF(tmp);
  11766. }
  11767. }
  11768. else if (unlikely(PyErr_Occurred())) {
  11769. goto bad;
  11770. }
  11771. }
  11772. Py_DECREF(names_to_set);
  11773. return 0;
  11774. bad:
  11775. Py_XDECREF(names_to_set);
  11776. return -1;
  11777. }
  11778. static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
  11779. #if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11780. PyTypeObject *type = (PyTypeObject*) type_obj;
  11781. PyObject *mro = type->tp_mro;
  11782. Py_ssize_t i, nbases;
  11783. if (unlikely(!mro)) goto done;
  11784. (void) &__Pyx_GetBuiltinName;
  11785. Py_INCREF(mro);
  11786. nbases = PyTuple_GET_SIZE(mro);
  11787. assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
  11788. for (i = 1; i < nbases-1; i++) {
  11789. PyObject *base, *dict, *meth;
  11790. base = PyTuple_GET_ITEM(mro, i);
  11791. dict = ((PyTypeObject *)base)->tp_dict;
  11792. meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
  11793. if (unlikely(meth)) {
  11794. descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
  11795. PyObject *res;
  11796. Py_INCREF(meth);
  11797. if (likely(f)) {
  11798. res = f(meth, NULL, type_obj);
  11799. Py_DECREF(meth);
  11800. if (unlikely(!res)) goto bad;
  11801. meth = res;
  11802. }
  11803. res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
  11804. Py_DECREF(meth);
  11805. if (unlikely(!res)) goto bad;
  11806. Py_DECREF(res);
  11807. goto done;
  11808. } else if (unlikely(PyErr_Occurred())) {
  11809. goto bad;
  11810. }
  11811. }
  11812. done:
  11813. Py_XDECREF(mro);
  11814. return type_obj;
  11815. bad:
  11816. Py_XDECREF(mro);
  11817. Py_DECREF(type_obj);
  11818. return NULL;
  11819. #else
  11820. PyObject *super_type, *super, *func, *res;
  11821. #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
  11822. super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
  11823. #else
  11824. super_type = (PyObject*) &PySuper_Type;
  11825. (void) &__Pyx_GetBuiltinName;
  11826. #endif
  11827. super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
  11828. #if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
  11829. Py_XDECREF(super_type);
  11830. #endif
  11831. if (unlikely(!super)) {
  11832. Py_CLEAR(type_obj);
  11833. goto done;
  11834. }
  11835. func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
  11836. Py_DECREF(super);
  11837. if (likely(!func)) {
  11838. if (unlikely(PyErr_Occurred()))
  11839. Py_CLEAR(type_obj);
  11840. goto done;
  11841. }
  11842. res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
  11843. Py_DECREF(func);
  11844. if (unlikely(!res))
  11845. Py_CLEAR(type_obj);
  11846. Py_XDECREF(res);
  11847. done:
  11848. return type_obj;
  11849. #endif
  11850. }
  11851. #endif
  11852. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  11853. PyObject *dict, PyObject *mkw,
  11854. int calculate_metaclass, int allow_py2_metaclass) {
  11855. PyObject *result;
  11856. PyObject *owned_metaclass = NULL;
  11857. PyObject *margs[4] = {NULL, name, bases, dict};
  11858. if (allow_py2_metaclass) {
  11859. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  11860. if (owned_metaclass) {
  11861. metaclass = owned_metaclass;
  11862. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  11863. PyErr_Clear();
  11864. } else {
  11865. return NULL;
  11866. }
  11867. }
  11868. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  11869. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  11870. Py_XDECREF(owned_metaclass);
  11871. if (unlikely(!metaclass))
  11872. return NULL;
  11873. owned_metaclass = metaclass;
  11874. }
  11875. result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
  11876. #if PY_VERSION_HEX < 0x030600A4
  11877. (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
  11878. #else
  11879. mkw
  11880. #endif
  11881. );
  11882. Py_XDECREF(owned_metaclass);
  11883. #if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
  11884. if (likely(result) && likely(PyType_Check(result))) {
  11885. if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
  11886. Py_CLEAR(result);
  11887. } else {
  11888. result = __Pyx_InitSubclassPEP487(result, mkw);
  11889. }
  11890. }
  11891. #else
  11892. (void) &__Pyx_GetBuiltinName;
  11893. #endif
  11894. return result;
  11895. }
  11896. /* CLineInTraceback */
  11897. #ifndef CYTHON_CLINE_IN_TRACEBACK
  11898. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
  11899. PyObject *use_cline;
  11900. PyObject *ptype, *pvalue, *ptraceback;
  11901. #if CYTHON_COMPILING_IN_CPYTHON
  11902. PyObject **cython_runtime_dict;
  11903. #endif
  11904. CYTHON_MAYBE_UNUSED_VAR(tstate);
  11905. if (unlikely(!__pyx_cython_runtime)) {
  11906. return c_line;
  11907. }
  11908. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  11909. #if CYTHON_COMPILING_IN_CPYTHON
  11910. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  11911. if (likely(cython_runtime_dict)) {
  11912. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  11913. use_cline, *cython_runtime_dict,
  11914. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  11915. } else
  11916. #endif
  11917. {
  11918. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  11919. if (use_cline_obj) {
  11920. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  11921. Py_DECREF(use_cline_obj);
  11922. } else {
  11923. PyErr_Clear();
  11924. use_cline = NULL;
  11925. }
  11926. }
  11927. if (!use_cline) {
  11928. c_line = 0;
  11929. (void) PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  11930. }
  11931. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  11932. c_line = 0;
  11933. }
  11934. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  11935. return c_line;
  11936. }
  11937. #endif
  11938. /* CodeObjectCache */
  11939. #if !CYTHON_COMPILING_IN_LIMITED_API
  11940. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  11941. int start = 0, mid = 0, end = count - 1;
  11942. if (end >= 0 && code_line > entries[end].code_line) {
  11943. return count;
  11944. }
  11945. while (start < end) {
  11946. mid = start + (end - start) / 2;
  11947. if (code_line < entries[mid].code_line) {
  11948. end = mid;
  11949. } else if (code_line > entries[mid].code_line) {
  11950. start = mid + 1;
  11951. } else {
  11952. return mid;
  11953. }
  11954. }
  11955. if (code_line <= entries[mid].code_line) {
  11956. return mid;
  11957. } else {
  11958. return mid + 1;
  11959. }
  11960. }
  11961. static PyCodeObject *__pyx_find_code_object(int code_line) {
  11962. PyCodeObject* code_object;
  11963. int pos;
  11964. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  11965. return NULL;
  11966. }
  11967. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  11968. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  11969. return NULL;
  11970. }
  11971. code_object = __pyx_code_cache.entries[pos].code_object;
  11972. Py_INCREF(code_object);
  11973. return code_object;
  11974. }
  11975. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  11976. int pos, i;
  11977. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  11978. if (unlikely(!code_line)) {
  11979. return;
  11980. }
  11981. if (unlikely(!entries)) {
  11982. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  11983. if (likely(entries)) {
  11984. __pyx_code_cache.entries = entries;
  11985. __pyx_code_cache.max_count = 64;
  11986. __pyx_code_cache.count = 1;
  11987. entries[0].code_line = code_line;
  11988. entries[0].code_object = code_object;
  11989. Py_INCREF(code_object);
  11990. }
  11991. return;
  11992. }
  11993. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  11994. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  11995. PyCodeObject* tmp = entries[pos].code_object;
  11996. entries[pos].code_object = code_object;
  11997. Py_DECREF(tmp);
  11998. return;
  11999. }
  12000. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  12001. int new_max = __pyx_code_cache.max_count + 64;
  12002. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  12003. __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  12004. if (unlikely(!entries)) {
  12005. return;
  12006. }
  12007. __pyx_code_cache.entries = entries;
  12008. __pyx_code_cache.max_count = new_max;
  12009. }
  12010. for (i=__pyx_code_cache.count; i>pos; i--) {
  12011. entries[i] = entries[i-1];
  12012. }
  12013. entries[pos].code_line = code_line;
  12014. entries[pos].code_object = code_object;
  12015. __pyx_code_cache.count++;
  12016. Py_INCREF(code_object);
  12017. }
  12018. #endif
  12019. /* AddTraceback */
  12020. #include "compile.h"
  12021. #include "frameobject.h"
  12022. #include "traceback.h"
  12023. #if PY_VERSION_HEX >= 0x030b00a6 && !CYTHON_COMPILING_IN_LIMITED_API
  12024. #ifndef Py_BUILD_CORE
  12025. #define Py_BUILD_CORE 1
  12026. #endif
  12027. #include "internal/pycore_frame.h"
  12028. #endif
  12029. #if CYTHON_COMPILING_IN_LIMITED_API
  12030. static PyObject *__Pyx_PyCode_Replace_For_AddTraceback(PyObject *code, PyObject *scratch_dict,
  12031. PyObject *firstlineno, PyObject *name) {
  12032. PyObject *replace = NULL;
  12033. if (unlikely(PyDict_SetItemString(scratch_dict, "co_firstlineno", firstlineno))) return NULL;
  12034. if (unlikely(PyDict_SetItemString(scratch_dict, "co_name", name))) return NULL;
  12035. replace = PyObject_GetAttrString(code, "replace");
  12036. if (likely(replace)) {
  12037. PyObject *result;
  12038. result = PyObject_Call(replace, __pyx_empty_tuple, scratch_dict);
  12039. Py_DECREF(replace);
  12040. return result;
  12041. }
  12042. PyErr_Clear();
  12043. #if __PYX_LIMITED_VERSION_HEX < 0x030780000
  12044. {
  12045. PyObject *compiled = NULL, *result = NULL;
  12046. if (unlikely(PyDict_SetItemString(scratch_dict, "code", code))) return NULL;
  12047. if (unlikely(PyDict_SetItemString(scratch_dict, "type", (PyObject*)(&PyType_Type)))) return NULL;
  12048. compiled = Py_CompileString(
  12049. "out = type(code)(\n"
  12050. " code.co_argcount, code.co_kwonlyargcount, code.co_nlocals, code.co_stacksize,\n"
  12051. " code.co_flags, code.co_code, code.co_consts, code.co_names,\n"
  12052. " code.co_varnames, code.co_filename, co_name, co_firstlineno,\n"
  12053. " code.co_lnotab)\n", "<dummy>", Py_file_input);
  12054. if (!compiled) return NULL;
  12055. result = PyEval_EvalCode(compiled, scratch_dict, scratch_dict);
  12056. Py_DECREF(compiled);
  12057. if (!result) PyErr_Print();
  12058. Py_DECREF(result);
  12059. result = PyDict_GetItemString(scratch_dict, "out");
  12060. if (result) Py_INCREF(result);
  12061. return result;
  12062. }
  12063. #else
  12064. return NULL;
  12065. #endif
  12066. }
  12067. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  12068. int py_line, const char *filename) {
  12069. PyObject *code_object = NULL, *py_py_line = NULL, *py_funcname = NULL, *dict = NULL;
  12070. PyObject *replace = NULL, *getframe = NULL, *frame = NULL;
  12071. PyObject *exc_type, *exc_value, *exc_traceback;
  12072. int success = 0;
  12073. if (c_line) {
  12074. (void) __pyx_cfilenm;
  12075. (void) __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
  12076. }
  12077. PyErr_Fetch(&exc_type, &exc_value, &exc_traceback);
  12078. code_object = Py_CompileString("_getframe()", filename, Py_eval_input);
  12079. if (unlikely(!code_object)) goto bad;
  12080. py_py_line = PyLong_FromLong(py_line);
  12081. if (unlikely(!py_py_line)) goto bad;
  12082. py_funcname = PyUnicode_FromString(funcname);
  12083. if (unlikely(!py_funcname)) goto bad;
  12084. dict = PyDict_New();
  12085. if (unlikely(!dict)) goto bad;
  12086. {
  12087. PyObject *old_code_object = code_object;
  12088. code_object = __Pyx_PyCode_Replace_For_AddTraceback(code_object, dict, py_py_line, py_funcname);
  12089. Py_DECREF(old_code_object);
  12090. }
  12091. if (unlikely(!code_object)) goto bad;
  12092. getframe = PySys_GetObject("_getframe");
  12093. if (unlikely(!getframe)) goto bad;
  12094. if (unlikely(PyDict_SetItemString(dict, "_getframe", getframe))) goto bad;
  12095. frame = PyEval_EvalCode(code_object, dict, dict);
  12096. if (unlikely(!frame) || frame == Py_None) goto bad;
  12097. success = 1;
  12098. bad:
  12099. PyErr_Restore(exc_type, exc_value, exc_traceback);
  12100. Py_XDECREF(code_object);
  12101. Py_XDECREF(py_py_line);
  12102. Py_XDECREF(py_funcname);
  12103. Py_XDECREF(dict);
  12104. Py_XDECREF(replace);
  12105. if (success) {
  12106. PyTraceBack_Here(
  12107. (struct _frame*)frame);
  12108. }
  12109. Py_XDECREF(frame);
  12110. }
  12111. #else
  12112. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  12113. const char *funcname, int c_line,
  12114. int py_line, const char *filename) {
  12115. PyCodeObject *py_code = NULL;
  12116. PyObject *py_funcname = NULL;
  12117. #if PY_MAJOR_VERSION < 3
  12118. PyObject *py_srcfile = NULL;
  12119. py_srcfile = PyString_FromString(filename);
  12120. if (!py_srcfile) goto bad;
  12121. #endif
  12122. if (c_line) {
  12123. #if PY_MAJOR_VERSION < 3
  12124. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  12125. if (!py_funcname) goto bad;
  12126. #else
  12127. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  12128. if (!py_funcname) goto bad;
  12129. funcname = PyUnicode_AsUTF8(py_funcname);
  12130. if (!funcname) goto bad;
  12131. #endif
  12132. }
  12133. else {
  12134. #if PY_MAJOR_VERSION < 3
  12135. py_funcname = PyString_FromString(funcname);
  12136. if (!py_funcname) goto bad;
  12137. #endif
  12138. }
  12139. #if PY_MAJOR_VERSION < 3
  12140. py_code = __Pyx_PyCode_New(
  12141. 0,
  12142. 0,
  12143. 0,
  12144. 0,
  12145. 0,
  12146. 0,
  12147. __pyx_empty_bytes, /*PyObject *code,*/
  12148. __pyx_empty_tuple, /*PyObject *consts,*/
  12149. __pyx_empty_tuple, /*PyObject *names,*/
  12150. __pyx_empty_tuple, /*PyObject *varnames,*/
  12151. __pyx_empty_tuple, /*PyObject *freevars,*/
  12152. __pyx_empty_tuple, /*PyObject *cellvars,*/
  12153. py_srcfile, /*PyObject *filename,*/
  12154. py_funcname, /*PyObject *name,*/
  12155. py_line,
  12156. __pyx_empty_bytes /*PyObject *lnotab*/
  12157. );
  12158. Py_DECREF(py_srcfile);
  12159. #else
  12160. py_code = PyCode_NewEmpty(filename, funcname, py_line);
  12161. #endif
  12162. Py_XDECREF(py_funcname); // XDECREF since it's only set on Py3 if cline
  12163. return py_code;
  12164. bad:
  12165. Py_XDECREF(py_funcname);
  12166. #if PY_MAJOR_VERSION < 3
  12167. Py_XDECREF(py_srcfile);
  12168. #endif
  12169. return NULL;
  12170. }
  12171. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  12172. int py_line, const char *filename) {
  12173. PyCodeObject *py_code = 0;
  12174. PyFrameObject *py_frame = 0;
  12175. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  12176. PyObject *ptype, *pvalue, *ptraceback;
  12177. if (c_line) {
  12178. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  12179. }
  12180. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  12181. if (!py_code) {
  12182. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  12183. py_code = __Pyx_CreateCodeObjectForTraceback(
  12184. funcname, c_line, py_line, filename);
  12185. if (!py_code) {
  12186. /* If the code object creation fails, then we should clear the
  12187. fetched exception references and propagate the new exception */
  12188. Py_XDECREF(ptype);
  12189. Py_XDECREF(pvalue);
  12190. Py_XDECREF(ptraceback);
  12191. goto bad;
  12192. }
  12193. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  12194. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  12195. }
  12196. py_frame = PyFrame_New(
  12197. tstate, /*PyThreadState *tstate,*/
  12198. py_code, /*PyCodeObject *code,*/
  12199. __pyx_d, /*PyObject *globals,*/
  12200. 0 /*PyObject *locals*/
  12201. );
  12202. if (!py_frame) goto bad;
  12203. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  12204. PyTraceBack_Here(py_frame);
  12205. bad:
  12206. Py_XDECREF(py_code);
  12207. Py_XDECREF(py_frame);
  12208. }
  12209. #endif
  12210. /* FormatTypeName */
  12211. #if CYTHON_COMPILING_IN_LIMITED_API
  12212. static __Pyx_TypeName
  12213. __Pyx_PyType_GetName(PyTypeObject* tp)
  12214. {
  12215. PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
  12216. __pyx_n_s_name);
  12217. if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
  12218. PyErr_Clear();
  12219. Py_XDECREF(name);
  12220. name = __Pyx_NewRef(__pyx_n_s__16);
  12221. }
  12222. return name;
  12223. }
  12224. #endif
  12225. /* CIntToPy */
  12226. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  12227. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12228. #pragma GCC diagnostic push
  12229. #pragma GCC diagnostic ignored "-Wconversion"
  12230. #endif
  12231. const long neg_one = (long) -1, const_zero = (long) 0;
  12232. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12233. #pragma GCC diagnostic pop
  12234. #endif
  12235. const int is_unsigned = neg_one > const_zero;
  12236. if (is_unsigned) {
  12237. if (sizeof(long) < sizeof(long)) {
  12238. return PyInt_FromLong((long) value);
  12239. } else if (sizeof(long) <= sizeof(unsigned long)) {
  12240. return PyLong_FromUnsignedLong((unsigned long) value);
  12241. #ifdef HAVE_LONG_LONG
  12242. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  12243. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  12244. #endif
  12245. }
  12246. } else {
  12247. if (sizeof(long) <= sizeof(long)) {
  12248. return PyInt_FromLong((long) value);
  12249. #ifdef HAVE_LONG_LONG
  12250. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  12251. return PyLong_FromLongLong((PY_LONG_LONG) value);
  12252. #endif
  12253. }
  12254. }
  12255. {
  12256. int one = 1; int little = (int)*(unsigned char *)&one;
  12257. unsigned char *bytes = (unsigned char *)&value;
  12258. #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
  12259. return _PyLong_FromByteArray(bytes, sizeof(long),
  12260. little, !is_unsigned);
  12261. #else
  12262. PyObject *from_bytes, *result = NULL;
  12263. PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
  12264. from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
  12265. if (!from_bytes) return NULL;
  12266. py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(long));
  12267. if (!py_bytes) goto limited_bad;
  12268. order_str = PyUnicode_FromString(little ? "little" : "big");
  12269. if (!order_str) goto limited_bad;
  12270. arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
  12271. if (!arg_tuple) goto limited_bad;
  12272. if (!is_unsigned) {
  12273. kwds = PyDict_New();
  12274. if (!kwds) goto limited_bad;
  12275. if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
  12276. }
  12277. result = PyObject_Call(from_bytes, arg_tuple, kwds);
  12278. limited_bad:
  12279. Py_XDECREF(kwds);
  12280. Py_XDECREF(arg_tuple);
  12281. Py_XDECREF(order_str);
  12282. Py_XDECREF(py_bytes);
  12283. Py_XDECREF(from_bytes);
  12284. return result;
  12285. #endif
  12286. }
  12287. }
  12288. /* CIntFromPyVerify */
  12289. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  12290. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  12291. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  12292. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  12293. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  12294. {\
  12295. func_type value = func_value;\
  12296. if (sizeof(target_type) < sizeof(func_type)) {\
  12297. if (unlikely(value != (func_type) (target_type) value)) {\
  12298. func_type zero = 0;\
  12299. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  12300. return (target_type) -1;\
  12301. if (is_unsigned && unlikely(value < zero))\
  12302. goto raise_neg_overflow;\
  12303. else\
  12304. goto raise_overflow;\
  12305. }\
  12306. }\
  12307. return (target_type) value;\
  12308. }
  12309. /* CIntFromPy */
  12310. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  12311. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12312. #pragma GCC diagnostic push
  12313. #pragma GCC diagnostic ignored "-Wconversion"
  12314. #endif
  12315. const long neg_one = (long) -1, const_zero = (long) 0;
  12316. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12317. #pragma GCC diagnostic pop
  12318. #endif
  12319. const int is_unsigned = neg_one > const_zero;
  12320. #if PY_MAJOR_VERSION < 3
  12321. if (likely(PyInt_Check(x))) {
  12322. if ((sizeof(long) < sizeof(long))) {
  12323. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  12324. } else {
  12325. long val = PyInt_AS_LONG(x);
  12326. if (is_unsigned && unlikely(val < 0)) {
  12327. goto raise_neg_overflow;
  12328. }
  12329. return (long) val;
  12330. }
  12331. } else
  12332. #endif
  12333. if (likely(PyLong_Check(x))) {
  12334. if (is_unsigned) {
  12335. #if CYTHON_USE_PYLONG_INTERNALS
  12336. if (unlikely(__Pyx_PyLong_IsNeg(x))) {
  12337. goto raise_neg_overflow;
  12338. } else if (__Pyx_PyLong_IsCompact(x)) {
  12339. __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
  12340. } else {
  12341. const digit* digits = __Pyx_PyLong_Digits(x);
  12342. assert(__Pyx_PyLong_DigitCount(x) > 1);
  12343. switch (__Pyx_PyLong_DigitCount(x)) {
  12344. case 2:
  12345. if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
  12346. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12347. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12348. } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
  12349. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  12350. }
  12351. }
  12352. break;
  12353. case 3:
  12354. if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
  12355. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12356. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12357. } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
  12358. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  12359. }
  12360. }
  12361. break;
  12362. case 4:
  12363. if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
  12364. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12365. __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])))
  12366. } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
  12367. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  12368. }
  12369. }
  12370. break;
  12371. }
  12372. }
  12373. #endif
  12374. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
  12375. if (unlikely(Py_SIZE(x) < 0)) {
  12376. goto raise_neg_overflow;
  12377. }
  12378. #else
  12379. {
  12380. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  12381. if (unlikely(result < 0))
  12382. return (long) -1;
  12383. if (unlikely(result == 1))
  12384. goto raise_neg_overflow;
  12385. }
  12386. #endif
  12387. if ((sizeof(long) <= sizeof(unsigned long))) {
  12388. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  12389. #ifdef HAVE_LONG_LONG
  12390. } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
  12391. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  12392. #endif
  12393. }
  12394. } else {
  12395. #if CYTHON_USE_PYLONG_INTERNALS
  12396. if (__Pyx_PyLong_IsCompact(x)) {
  12397. __PYX_VERIFY_RETURN_INT(long, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
  12398. } else {
  12399. const digit* digits = __Pyx_PyLong_Digits(x);
  12400. assert(__Pyx_PyLong_DigitCount(x) > 1);
  12401. switch (__Pyx_PyLong_SignedDigitCount(x)) {
  12402. case -2:
  12403. if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
  12404. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12405. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12406. } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  12407. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12408. }
  12409. }
  12410. break;
  12411. case 2:
  12412. if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
  12413. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12414. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12415. } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  12416. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12417. }
  12418. }
  12419. break;
  12420. case -3:
  12421. if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
  12422. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12423. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12424. } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  12425. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12426. }
  12427. }
  12428. break;
  12429. case 3:
  12430. if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
  12431. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12432. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12433. } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  12434. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12435. }
  12436. }
  12437. break;
  12438. case -4:
  12439. if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
  12440. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12441. __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])))
  12442. } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
  12443. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12444. }
  12445. }
  12446. break;
  12447. case 4:
  12448. if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
  12449. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12450. __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])))
  12451. } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
  12452. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  12453. }
  12454. }
  12455. break;
  12456. }
  12457. }
  12458. #endif
  12459. if ((sizeof(long) <= sizeof(long))) {
  12460. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  12461. #ifdef HAVE_LONG_LONG
  12462. } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
  12463. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  12464. #endif
  12465. }
  12466. }
  12467. {
  12468. long val;
  12469. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  12470. #if PY_MAJOR_VERSION < 3
  12471. if (likely(v) && !PyLong_Check(v)) {
  12472. PyObject *tmp = v;
  12473. v = PyNumber_Long(tmp);
  12474. Py_DECREF(tmp);
  12475. }
  12476. #endif
  12477. if (likely(v)) {
  12478. int ret = -1;
  12479. #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
  12480. int one = 1; int is_little = (int)*(unsigned char *)&one;
  12481. unsigned char *bytes = (unsigned char *)&val;
  12482. ret = _PyLong_AsByteArray((PyLongObject *)v,
  12483. bytes, sizeof(val),
  12484. is_little, !is_unsigned);
  12485. #else
  12486. PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
  12487. int bits, remaining_bits, is_negative = 0;
  12488. long idigit;
  12489. int chunk_size = (sizeof(long) < 8) ? 30 : 62;
  12490. if (unlikely(!PyLong_CheckExact(v))) {
  12491. PyObject *tmp = v;
  12492. v = PyNumber_Long(v);
  12493. assert(PyLong_CheckExact(v));
  12494. Py_DECREF(tmp);
  12495. if (unlikely(!v)) return (long) -1;
  12496. }
  12497. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12498. if (Py_SIZE(x) == 0)
  12499. return (long) 0;
  12500. is_negative = Py_SIZE(x) < 0;
  12501. #else
  12502. {
  12503. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  12504. if (unlikely(result < 0))
  12505. return (long) -1;
  12506. is_negative = result == 1;
  12507. }
  12508. #endif
  12509. if (is_unsigned && unlikely(is_negative)) {
  12510. goto raise_neg_overflow;
  12511. } else if (is_negative) {
  12512. stepval = PyNumber_Invert(v);
  12513. if (unlikely(!stepval))
  12514. return (long) -1;
  12515. } else {
  12516. stepval = __Pyx_NewRef(v);
  12517. }
  12518. val = (long) 0;
  12519. mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
  12520. shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
  12521. for (bits = 0; bits < (int) sizeof(long) * 8 - chunk_size; bits += chunk_size) {
  12522. PyObject *tmp, *digit;
  12523. digit = PyNumber_And(stepval, mask);
  12524. if (unlikely(!digit)) goto done;
  12525. idigit = PyLong_AsLong(digit);
  12526. Py_DECREF(digit);
  12527. if (unlikely(idigit < 0)) goto done;
  12528. tmp = PyNumber_Rshift(stepval, shift);
  12529. if (unlikely(!tmp)) goto done;
  12530. Py_DECREF(stepval); stepval = tmp;
  12531. val |= ((long) idigit) << bits;
  12532. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12533. if (Py_SIZE(stepval) == 0)
  12534. goto unpacking_done;
  12535. #endif
  12536. }
  12537. idigit = PyLong_AsLong(stepval);
  12538. if (unlikely(idigit < 0)) goto done;
  12539. remaining_bits = ((int) sizeof(long) * 8) - bits - (is_unsigned ? 0 : 1);
  12540. if (unlikely(idigit >= (1L << remaining_bits)))
  12541. goto raise_overflow;
  12542. val |= ((long) idigit) << bits;
  12543. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12544. unpacking_done:
  12545. #endif
  12546. if (!is_unsigned) {
  12547. if (unlikely(val & (((long) 1) << (sizeof(long) * 8 - 1))))
  12548. goto raise_overflow;
  12549. if (is_negative)
  12550. val = ~val;
  12551. }
  12552. ret = 0;
  12553. done:
  12554. Py_XDECREF(shift);
  12555. Py_XDECREF(mask);
  12556. Py_XDECREF(stepval);
  12557. #endif
  12558. Py_DECREF(v);
  12559. if (likely(!ret))
  12560. return val;
  12561. }
  12562. return (long) -1;
  12563. }
  12564. } else {
  12565. long val;
  12566. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  12567. if (!tmp) return (long) -1;
  12568. val = __Pyx_PyInt_As_long(tmp);
  12569. Py_DECREF(tmp);
  12570. return val;
  12571. }
  12572. raise_overflow:
  12573. PyErr_SetString(PyExc_OverflowError,
  12574. "value too large to convert to long");
  12575. return (long) -1;
  12576. raise_neg_overflow:
  12577. PyErr_SetString(PyExc_OverflowError,
  12578. "can't convert negative value to long");
  12579. return (long) -1;
  12580. }
  12581. /* CIntFromPy */
  12582. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  12583. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12584. #pragma GCC diagnostic push
  12585. #pragma GCC diagnostic ignored "-Wconversion"
  12586. #endif
  12587. const int neg_one = (int) -1, const_zero = (int) 0;
  12588. #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
  12589. #pragma GCC diagnostic pop
  12590. #endif
  12591. const int is_unsigned = neg_one > const_zero;
  12592. #if PY_MAJOR_VERSION < 3
  12593. if (likely(PyInt_Check(x))) {
  12594. if ((sizeof(int) < sizeof(long))) {
  12595. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  12596. } else {
  12597. long val = PyInt_AS_LONG(x);
  12598. if (is_unsigned && unlikely(val < 0)) {
  12599. goto raise_neg_overflow;
  12600. }
  12601. return (int) val;
  12602. }
  12603. } else
  12604. #endif
  12605. if (likely(PyLong_Check(x))) {
  12606. if (is_unsigned) {
  12607. #if CYTHON_USE_PYLONG_INTERNALS
  12608. if (unlikely(__Pyx_PyLong_IsNeg(x))) {
  12609. goto raise_neg_overflow;
  12610. } else if (__Pyx_PyLong_IsCompact(x)) {
  12611. __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_upylong, __Pyx_PyLong_CompactValueUnsigned(x))
  12612. } else {
  12613. const digit* digits = __Pyx_PyLong_Digits(x);
  12614. assert(__Pyx_PyLong_DigitCount(x) > 1);
  12615. switch (__Pyx_PyLong_DigitCount(x)) {
  12616. case 2:
  12617. if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
  12618. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12619. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12620. } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
  12621. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  12622. }
  12623. }
  12624. break;
  12625. case 3:
  12626. if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
  12627. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12628. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12629. } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
  12630. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  12631. }
  12632. }
  12633. break;
  12634. case 4:
  12635. if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
  12636. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12637. __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])))
  12638. } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
  12639. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  12640. }
  12641. }
  12642. break;
  12643. }
  12644. }
  12645. #endif
  12646. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030C00A7
  12647. if (unlikely(Py_SIZE(x) < 0)) {
  12648. goto raise_neg_overflow;
  12649. }
  12650. #else
  12651. {
  12652. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  12653. if (unlikely(result < 0))
  12654. return (int) -1;
  12655. if (unlikely(result == 1))
  12656. goto raise_neg_overflow;
  12657. }
  12658. #endif
  12659. if ((sizeof(int) <= sizeof(unsigned long))) {
  12660. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  12661. #ifdef HAVE_LONG_LONG
  12662. } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
  12663. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  12664. #endif
  12665. }
  12666. } else {
  12667. #if CYTHON_USE_PYLONG_INTERNALS
  12668. if (__Pyx_PyLong_IsCompact(x)) {
  12669. __PYX_VERIFY_RETURN_INT(int, __Pyx_compact_pylong, __Pyx_PyLong_CompactValue(x))
  12670. } else {
  12671. const digit* digits = __Pyx_PyLong_Digits(x);
  12672. assert(__Pyx_PyLong_DigitCount(x) > 1);
  12673. switch (__Pyx_PyLong_SignedDigitCount(x)) {
  12674. case -2:
  12675. if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
  12676. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12677. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12678. } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  12679. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12680. }
  12681. }
  12682. break;
  12683. case 2:
  12684. if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
  12685. if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
  12686. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12687. } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  12688. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12689. }
  12690. }
  12691. break;
  12692. case -3:
  12693. if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
  12694. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12695. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12696. } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  12697. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12698. }
  12699. }
  12700. break;
  12701. case 3:
  12702. if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
  12703. if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
  12704. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  12705. } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  12706. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12707. }
  12708. }
  12709. break;
  12710. case -4:
  12711. if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
  12712. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12713. __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])))
  12714. } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
  12715. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12716. }
  12717. }
  12718. break;
  12719. case 4:
  12720. if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
  12721. if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
  12722. __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])))
  12723. } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
  12724. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  12725. }
  12726. }
  12727. break;
  12728. }
  12729. }
  12730. #endif
  12731. if ((sizeof(int) <= sizeof(long))) {
  12732. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  12733. #ifdef HAVE_LONG_LONG
  12734. } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
  12735. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  12736. #endif
  12737. }
  12738. }
  12739. {
  12740. int val;
  12741. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  12742. #if PY_MAJOR_VERSION < 3
  12743. if (likely(v) && !PyLong_Check(v)) {
  12744. PyObject *tmp = v;
  12745. v = PyNumber_Long(tmp);
  12746. Py_DECREF(tmp);
  12747. }
  12748. #endif
  12749. if (likely(v)) {
  12750. int ret = -1;
  12751. #if PY_VERSION_HEX < 0x030d0000 && !(CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) || defined(_PyLong_AsByteArray)
  12752. int one = 1; int is_little = (int)*(unsigned char *)&one;
  12753. unsigned char *bytes = (unsigned char *)&val;
  12754. ret = _PyLong_AsByteArray((PyLongObject *)v,
  12755. bytes, sizeof(val),
  12756. is_little, !is_unsigned);
  12757. #else
  12758. PyObject *stepval = NULL, *mask = NULL, *shift = NULL;
  12759. int bits, remaining_bits, is_negative = 0;
  12760. long idigit;
  12761. int chunk_size = (sizeof(long) < 8) ? 30 : 62;
  12762. if (unlikely(!PyLong_CheckExact(v))) {
  12763. PyObject *tmp = v;
  12764. v = PyNumber_Long(v);
  12765. assert(PyLong_CheckExact(v));
  12766. Py_DECREF(tmp);
  12767. if (unlikely(!v)) return (int) -1;
  12768. }
  12769. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12770. if (Py_SIZE(x) == 0)
  12771. return (int) 0;
  12772. is_negative = Py_SIZE(x) < 0;
  12773. #else
  12774. {
  12775. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  12776. if (unlikely(result < 0))
  12777. return (int) -1;
  12778. is_negative = result == 1;
  12779. }
  12780. #endif
  12781. if (is_unsigned && unlikely(is_negative)) {
  12782. goto raise_neg_overflow;
  12783. } else if (is_negative) {
  12784. stepval = PyNumber_Invert(v);
  12785. if (unlikely(!stepval))
  12786. return (int) -1;
  12787. } else {
  12788. stepval = __Pyx_NewRef(v);
  12789. }
  12790. val = (int) 0;
  12791. mask = PyLong_FromLong((1L << chunk_size) - 1); if (unlikely(!mask)) goto done;
  12792. shift = PyLong_FromLong(chunk_size); if (unlikely(!shift)) goto done;
  12793. for (bits = 0; bits < (int) sizeof(int) * 8 - chunk_size; bits += chunk_size) {
  12794. PyObject *tmp, *digit;
  12795. digit = PyNumber_And(stepval, mask);
  12796. if (unlikely(!digit)) goto done;
  12797. idigit = PyLong_AsLong(digit);
  12798. Py_DECREF(digit);
  12799. if (unlikely(idigit < 0)) goto done;
  12800. tmp = PyNumber_Rshift(stepval, shift);
  12801. if (unlikely(!tmp)) goto done;
  12802. Py_DECREF(stepval); stepval = tmp;
  12803. val |= ((int) idigit) << bits;
  12804. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12805. if (Py_SIZE(stepval) == 0)
  12806. goto unpacking_done;
  12807. #endif
  12808. }
  12809. idigit = PyLong_AsLong(stepval);
  12810. if (unlikely(idigit < 0)) goto done;
  12811. remaining_bits = ((int) sizeof(int) * 8) - bits - (is_unsigned ? 0 : 1);
  12812. if (unlikely(idigit >= (1L << remaining_bits)))
  12813. goto raise_overflow;
  12814. val |= ((int) idigit) << bits;
  12815. #if CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030B0000
  12816. unpacking_done:
  12817. #endif
  12818. if (!is_unsigned) {
  12819. if (unlikely(val & (((int) 1) << (sizeof(int) * 8 - 1))))
  12820. goto raise_overflow;
  12821. if (is_negative)
  12822. val = ~val;
  12823. }
  12824. ret = 0;
  12825. done:
  12826. Py_XDECREF(shift);
  12827. Py_XDECREF(mask);
  12828. Py_XDECREF(stepval);
  12829. #endif
  12830. Py_DECREF(v);
  12831. if (likely(!ret))
  12832. return val;
  12833. }
  12834. return (int) -1;
  12835. }
  12836. } else {
  12837. int val;
  12838. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  12839. if (!tmp) return (int) -1;
  12840. val = __Pyx_PyInt_As_int(tmp);
  12841. Py_DECREF(tmp);
  12842. return val;
  12843. }
  12844. raise_overflow:
  12845. PyErr_SetString(PyExc_OverflowError,
  12846. "value too large to convert to int");
  12847. return (int) -1;
  12848. raise_neg_overflow:
  12849. PyErr_SetString(PyExc_OverflowError,
  12850. "can't convert negative value to int");
  12851. return (int) -1;
  12852. }
  12853. /* CheckBinaryVersion */
  12854. static unsigned long __Pyx_get_runtime_version(void) {
  12855. #if __PYX_LIMITED_VERSION_HEX >= 0x030B00A4
  12856. return Py_Version & ~0xFFUL;
  12857. #else
  12858. const char* rt_version = Py_GetVersion();
  12859. unsigned long version = 0;
  12860. unsigned long factor = 0x01000000UL;
  12861. unsigned int digit = 0;
  12862. int i = 0;
  12863. while (factor) {
  12864. while ('0' <= rt_version[i] && rt_version[i] <= '9') {
  12865. digit = digit * 10 + (unsigned int) (rt_version[i] - '0');
  12866. ++i;
  12867. }
  12868. version += factor * digit;
  12869. if (rt_version[i] != '.')
  12870. break;
  12871. digit = 0;
  12872. factor >>= 8;
  12873. ++i;
  12874. }
  12875. return version;
  12876. #endif
  12877. }
  12878. static int __Pyx_check_binary_version(unsigned long ct_version, unsigned long rt_version, int allow_newer) {
  12879. const unsigned long MAJOR_MINOR = 0xFFFF0000UL;
  12880. if ((rt_version & MAJOR_MINOR) == (ct_version & MAJOR_MINOR))
  12881. return 0;
  12882. if (likely(allow_newer && (rt_version & MAJOR_MINOR) > (ct_version & MAJOR_MINOR)))
  12883. return 1;
  12884. {
  12885. char message[200];
  12886. PyOS_snprintf(message, sizeof(message),
  12887. "compile time Python version %d.%d "
  12888. "of module '%.100s' "
  12889. "%s "
  12890. "runtime version %d.%d",
  12891. (int) (ct_version >> 24), (int) ((ct_version >> 16) & 0xFF),
  12892. __Pyx_MODULE_NAME,
  12893. (allow_newer) ? "was newer than" : "does not match",
  12894. (int) (rt_version >> 24), (int) ((rt_version >> 16) & 0xFF)
  12895. );
  12896. return PyErr_WarnEx(NULL, message, 1);
  12897. }
  12898. }
  12899. /* InitStrings */
  12900. #if PY_MAJOR_VERSION >= 3
  12901. static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
  12902. if (t.is_unicode | t.is_str) {
  12903. if (t.intern) {
  12904. *str = PyUnicode_InternFromString(t.s);
  12905. } else if (t.encoding) {
  12906. *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
  12907. } else {
  12908. *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
  12909. }
  12910. } else {
  12911. *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
  12912. }
  12913. if (!*str)
  12914. return -1;
  12915. if (PyObject_Hash(*str) == -1)
  12916. return -1;
  12917. return 0;
  12918. }
  12919. #endif
  12920. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  12921. while (t->p) {
  12922. #if PY_MAJOR_VERSION >= 3
  12923. __Pyx_InitString(*t, t->p);
  12924. #else
  12925. if (t->is_unicode) {
  12926. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  12927. } else if (t->intern) {
  12928. *t->p = PyString_InternFromString(t->s);
  12929. } else {
  12930. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  12931. }
  12932. if (!*t->p)
  12933. return -1;
  12934. if (PyObject_Hash(*t->p) == -1)
  12935. return -1;
  12936. #endif
  12937. ++t;
  12938. }
  12939. return 0;
  12940. }
  12941. #include <string.h>
  12942. static CYTHON_INLINE Py_ssize_t __Pyx_ssize_strlen(const char *s) {
  12943. size_t len = strlen(s);
  12944. if (unlikely(len > (size_t) PY_SSIZE_T_MAX)) {
  12945. PyErr_SetString(PyExc_OverflowError, "byte string is too long");
  12946. return -1;
  12947. }
  12948. return (Py_ssize_t) len;
  12949. }
  12950. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  12951. Py_ssize_t len = __Pyx_ssize_strlen(c_str);
  12952. if (unlikely(len < 0)) return NULL;
  12953. return __Pyx_PyUnicode_FromStringAndSize(c_str, len);
  12954. }
  12955. static CYTHON_INLINE PyObject* __Pyx_PyByteArray_FromString(const char* c_str) {
  12956. Py_ssize_t len = __Pyx_ssize_strlen(c_str);
  12957. if (unlikely(len < 0)) return NULL;
  12958. return PyByteArray_FromStringAndSize(c_str, len);
  12959. }
  12960. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  12961. Py_ssize_t ignore;
  12962. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  12963. }
  12964. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  12965. #if !CYTHON_PEP393_ENABLED
  12966. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  12967. char* defenc_c;
  12968. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  12969. if (!defenc) return NULL;
  12970. defenc_c = PyBytes_AS_STRING(defenc);
  12971. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12972. {
  12973. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  12974. char* c;
  12975. for (c = defenc_c; c < end; c++) {
  12976. if ((unsigned char) (*c) >= 128) {
  12977. PyUnicode_AsASCIIString(o);
  12978. return NULL;
  12979. }
  12980. }
  12981. }
  12982. #endif
  12983. *length = PyBytes_GET_SIZE(defenc);
  12984. return defenc_c;
  12985. }
  12986. #else
  12987. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  12988. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  12989. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  12990. if (likely(PyUnicode_IS_ASCII(o))) {
  12991. *length = PyUnicode_GET_LENGTH(o);
  12992. return PyUnicode_AsUTF8(o);
  12993. } else {
  12994. PyUnicode_AsASCIIString(o);
  12995. return NULL;
  12996. }
  12997. #else
  12998. return PyUnicode_AsUTF8AndSize(o, length);
  12999. #endif
  13000. }
  13001. #endif
  13002. #endif
  13003. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  13004. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  13005. if (
  13006. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  13007. __Pyx_sys_getdefaultencoding_not_ascii &&
  13008. #endif
  13009. PyUnicode_Check(o)) {
  13010. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  13011. } else
  13012. #endif
  13013. #if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  13014. if (PyByteArray_Check(o)) {
  13015. *length = PyByteArray_GET_SIZE(o);
  13016. return PyByteArray_AS_STRING(o);
  13017. } else
  13018. #endif
  13019. {
  13020. char* result;
  13021. int r = PyBytes_AsStringAndSize(o, &result, length);
  13022. if (unlikely(r < 0)) {
  13023. return NULL;
  13024. } else {
  13025. return result;
  13026. }
  13027. }
  13028. }
  13029. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  13030. int is_true = x == Py_True;
  13031. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  13032. else return PyObject_IsTrue(x);
  13033. }
  13034. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  13035. int retval;
  13036. if (unlikely(!x)) return -1;
  13037. retval = __Pyx_PyObject_IsTrue(x);
  13038. Py_DECREF(x);
  13039. return retval;
  13040. }
  13041. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  13042. __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
  13043. #if PY_MAJOR_VERSION >= 3
  13044. if (PyLong_Check(result)) {
  13045. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  13046. "__int__ returned non-int (type " __Pyx_FMT_TYPENAME "). "
  13047. "The ability to return an instance of a strict subclass of int is deprecated, "
  13048. "and may be removed in a future version of Python.",
  13049. result_type_name)) {
  13050. __Pyx_DECREF_TypeName(result_type_name);
  13051. Py_DECREF(result);
  13052. return NULL;
  13053. }
  13054. __Pyx_DECREF_TypeName(result_type_name);
  13055. return result;
  13056. }
  13057. #endif
  13058. PyErr_Format(PyExc_TypeError,
  13059. "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
  13060. type_name, type_name, result_type_name);
  13061. __Pyx_DECREF_TypeName(result_type_name);
  13062. Py_DECREF(result);
  13063. return NULL;
  13064. }
  13065. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  13066. #if CYTHON_USE_TYPE_SLOTS
  13067. PyNumberMethods *m;
  13068. #endif
  13069. const char *name = NULL;
  13070. PyObject *res = NULL;
  13071. #if PY_MAJOR_VERSION < 3
  13072. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  13073. #else
  13074. if (likely(PyLong_Check(x)))
  13075. #endif
  13076. return __Pyx_NewRef(x);
  13077. #if CYTHON_USE_TYPE_SLOTS
  13078. m = Py_TYPE(x)->tp_as_number;
  13079. #if PY_MAJOR_VERSION < 3
  13080. if (m && m->nb_int) {
  13081. name = "int";
  13082. res = m->nb_int(x);
  13083. }
  13084. else if (m && m->nb_long) {
  13085. name = "long";
  13086. res = m->nb_long(x);
  13087. }
  13088. #else
  13089. if (likely(m && m->nb_int)) {
  13090. name = "int";
  13091. res = m->nb_int(x);
  13092. }
  13093. #endif
  13094. #else
  13095. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  13096. res = PyNumber_Int(x);
  13097. }
  13098. #endif
  13099. if (likely(res)) {
  13100. #if PY_MAJOR_VERSION < 3
  13101. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  13102. #else
  13103. if (unlikely(!PyLong_CheckExact(res))) {
  13104. #endif
  13105. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  13106. }
  13107. }
  13108. else if (!PyErr_Occurred()) {
  13109. PyErr_SetString(PyExc_TypeError,
  13110. "an integer is required");
  13111. }
  13112. return res;
  13113. }
  13114. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  13115. Py_ssize_t ival;
  13116. PyObject *x;
  13117. #if PY_MAJOR_VERSION < 3
  13118. if (likely(PyInt_CheckExact(b))) {
  13119. if (sizeof(Py_ssize_t) >= sizeof(long))
  13120. return PyInt_AS_LONG(b);
  13121. else
  13122. return PyInt_AsSsize_t(b);
  13123. }
  13124. #endif
  13125. if (likely(PyLong_CheckExact(b))) {
  13126. #if CYTHON_USE_PYLONG_INTERNALS
  13127. if (likely(__Pyx_PyLong_IsCompact(b))) {
  13128. return __Pyx_PyLong_CompactValue(b);
  13129. } else {
  13130. const digit* digits = __Pyx_PyLong_Digits(b);
  13131. const Py_ssize_t size = __Pyx_PyLong_SignedDigitCount(b);
  13132. switch (size) {
  13133. case 2:
  13134. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  13135. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  13136. }
  13137. break;
  13138. case -2:
  13139. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  13140. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  13141. }
  13142. break;
  13143. case 3:
  13144. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  13145. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  13146. }
  13147. break;
  13148. case -3:
  13149. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  13150. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  13151. }
  13152. break;
  13153. case 4:
  13154. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  13155. 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]));
  13156. }
  13157. break;
  13158. case -4:
  13159. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  13160. 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]));
  13161. }
  13162. break;
  13163. }
  13164. }
  13165. #endif
  13166. return PyLong_AsSsize_t(b);
  13167. }
  13168. x = PyNumber_Index(b);
  13169. if (!x) return -1;
  13170. ival = PyInt_AsSsize_t(x);
  13171. Py_DECREF(x);
  13172. return ival;
  13173. }
  13174. static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  13175. if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
  13176. return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
  13177. #if PY_MAJOR_VERSION < 3
  13178. } else if (likely(PyInt_CheckExact(o))) {
  13179. return PyInt_AS_LONG(o);
  13180. #endif
  13181. } else {
  13182. Py_ssize_t ival;
  13183. PyObject *x;
  13184. x = PyNumber_Index(o);
  13185. if (!x) return -1;
  13186. ival = PyInt_AsLong(x);
  13187. Py_DECREF(x);
  13188. return ival;
  13189. }
  13190. }
  13191. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  13192. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  13193. }
  13194. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  13195. return PyInt_FromSize_t(ival);
  13196. }
  13197. /* #### Code section: utility_code_pragmas_end ### */
  13198. #ifdef _MSC_VER
  13199. #pragma warning( pop )
  13200. #endif
  13201. /* #### Code section: end ### */
  13202. #endif /* Py_PYTHON_H */