You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

gedlibpy.cpp 1.1 MB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510
  1. /* Generated by Cython 0.29.15 */
  2. /* BEGIN: Cython Metadata
  3. {
  4. "distutils": {
  5. "depends": [
  6. "src/GedLibBind.hpp"
  7. ],
  8. "extra_compile_args": [
  9. "-std=c++11"
  10. ],
  11. "extra_link_args": [
  12. "-std=c++11"
  13. ],
  14. "include_dirs": [
  15. "src",
  16. "include",
  17. "include/lsape",
  18. "include/Eigen",
  19. "include/nomad",
  20. "include/sgtelib",
  21. "include/libsvm.3.22",
  22. "include/fann",
  23. "include/boost_1_69_0"
  24. ],
  25. "language": "c++",
  26. "libraries": [
  27. "doublefann",
  28. "sgtelib",
  29. "svm",
  30. "nomad"
  31. ],
  32. "library_dirs": [
  33. "lib/fann",
  34. "lib/gedlib",
  35. "lib/libsvm.3.22",
  36. "lib/nomad"
  37. ],
  38. "name": "gedlibpy",
  39. "sources": [
  40. "gedlibpy.pyx"
  41. ]
  42. },
  43. "module_name": "gedlibpy"
  44. }
  45. END: Cython Metadata */
  46. #define PY_SSIZE_T_CLEAN
  47. #include "Python.h"
  48. #ifndef Py_PYTHON_H
  49. #error Python headers needed to compile C extensions, please install development version of Python.
  50. #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
  51. #error Cython requires Python 2.6+ or Python 3.3+.
  52. #else
  53. #define CYTHON_ABI "0_29_15"
  54. #define CYTHON_HEX_VERSION 0x001D0FF0
  55. #define CYTHON_FUTURE_DIVISION 1
  56. #include <stddef.h>
  57. #ifndef offsetof
  58. #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
  59. #endif
  60. #if !defined(WIN32) && !defined(MS_WINDOWS)
  61. #ifndef __stdcall
  62. #define __stdcall
  63. #endif
  64. #ifndef __cdecl
  65. #define __cdecl
  66. #endif
  67. #ifndef __fastcall
  68. #define __fastcall
  69. #endif
  70. #endif
  71. #ifndef DL_IMPORT
  72. #define DL_IMPORT(t) t
  73. #endif
  74. #ifndef DL_EXPORT
  75. #define DL_EXPORT(t) t
  76. #endif
  77. #define __PYX_COMMA ,
  78. #ifndef HAVE_LONG_LONG
  79. #if PY_VERSION_HEX >= 0x02070000
  80. #define HAVE_LONG_LONG
  81. #endif
  82. #endif
  83. #ifndef PY_LONG_LONG
  84. #define PY_LONG_LONG LONG_LONG
  85. #endif
  86. #ifndef Py_HUGE_VAL
  87. #define Py_HUGE_VAL HUGE_VAL
  88. #endif
  89. #ifdef PYPY_VERSION
  90. #define CYTHON_COMPILING_IN_PYPY 1
  91. #define CYTHON_COMPILING_IN_PYSTON 0
  92. #define CYTHON_COMPILING_IN_CPYTHON 0
  93. #undef CYTHON_USE_TYPE_SLOTS
  94. #define CYTHON_USE_TYPE_SLOTS 0
  95. #undef CYTHON_USE_PYTYPE_LOOKUP
  96. #define CYTHON_USE_PYTYPE_LOOKUP 0
  97. #if PY_VERSION_HEX < 0x03050000
  98. #undef CYTHON_USE_ASYNC_SLOTS
  99. #define CYTHON_USE_ASYNC_SLOTS 0
  100. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  101. #define CYTHON_USE_ASYNC_SLOTS 1
  102. #endif
  103. #undef CYTHON_USE_PYLIST_INTERNALS
  104. #define CYTHON_USE_PYLIST_INTERNALS 0
  105. #undef CYTHON_USE_UNICODE_INTERNALS
  106. #define CYTHON_USE_UNICODE_INTERNALS 0
  107. #undef CYTHON_USE_UNICODE_WRITER
  108. #define CYTHON_USE_UNICODE_WRITER 0
  109. #undef CYTHON_USE_PYLONG_INTERNALS
  110. #define CYTHON_USE_PYLONG_INTERNALS 0
  111. #undef CYTHON_AVOID_BORROWED_REFS
  112. #define CYTHON_AVOID_BORROWED_REFS 1
  113. #undef CYTHON_ASSUME_SAFE_MACROS
  114. #define CYTHON_ASSUME_SAFE_MACROS 0
  115. #undef CYTHON_UNPACK_METHODS
  116. #define CYTHON_UNPACK_METHODS 0
  117. #undef CYTHON_FAST_THREAD_STATE
  118. #define CYTHON_FAST_THREAD_STATE 0
  119. #undef CYTHON_FAST_PYCALL
  120. #define CYTHON_FAST_PYCALL 0
  121. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  122. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  123. #undef CYTHON_USE_TP_FINALIZE
  124. #define CYTHON_USE_TP_FINALIZE 0
  125. #undef CYTHON_USE_DICT_VERSIONS
  126. #define CYTHON_USE_DICT_VERSIONS 0
  127. #undef CYTHON_USE_EXC_INFO_STACK
  128. #define CYTHON_USE_EXC_INFO_STACK 0
  129. #elif defined(PYSTON_VERSION)
  130. #define CYTHON_COMPILING_IN_PYPY 0
  131. #define CYTHON_COMPILING_IN_PYSTON 1
  132. #define CYTHON_COMPILING_IN_CPYTHON 0
  133. #ifndef CYTHON_USE_TYPE_SLOTS
  134. #define CYTHON_USE_TYPE_SLOTS 1
  135. #endif
  136. #undef CYTHON_USE_PYTYPE_LOOKUP
  137. #define CYTHON_USE_PYTYPE_LOOKUP 0
  138. #undef CYTHON_USE_ASYNC_SLOTS
  139. #define CYTHON_USE_ASYNC_SLOTS 0
  140. #undef CYTHON_USE_PYLIST_INTERNALS
  141. #define CYTHON_USE_PYLIST_INTERNALS 0
  142. #ifndef CYTHON_USE_UNICODE_INTERNALS
  143. #define CYTHON_USE_UNICODE_INTERNALS 1
  144. #endif
  145. #undef CYTHON_USE_UNICODE_WRITER
  146. #define CYTHON_USE_UNICODE_WRITER 0
  147. #undef CYTHON_USE_PYLONG_INTERNALS
  148. #define CYTHON_USE_PYLONG_INTERNALS 0
  149. #ifndef CYTHON_AVOID_BORROWED_REFS
  150. #define CYTHON_AVOID_BORROWED_REFS 0
  151. #endif
  152. #ifndef CYTHON_ASSUME_SAFE_MACROS
  153. #define CYTHON_ASSUME_SAFE_MACROS 1
  154. #endif
  155. #ifndef CYTHON_UNPACK_METHODS
  156. #define CYTHON_UNPACK_METHODS 1
  157. #endif
  158. #undef CYTHON_FAST_THREAD_STATE
  159. #define CYTHON_FAST_THREAD_STATE 0
  160. #undef CYTHON_FAST_PYCALL
  161. #define CYTHON_FAST_PYCALL 0
  162. #undef CYTHON_PEP489_MULTI_PHASE_INIT
  163. #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  164. #undef CYTHON_USE_TP_FINALIZE
  165. #define CYTHON_USE_TP_FINALIZE 0
  166. #undef CYTHON_USE_DICT_VERSIONS
  167. #define CYTHON_USE_DICT_VERSIONS 0
  168. #undef CYTHON_USE_EXC_INFO_STACK
  169. #define CYTHON_USE_EXC_INFO_STACK 0
  170. #else
  171. #define CYTHON_COMPILING_IN_PYPY 0
  172. #define CYTHON_COMPILING_IN_PYSTON 0
  173. #define CYTHON_COMPILING_IN_CPYTHON 1
  174. #ifndef CYTHON_USE_TYPE_SLOTS
  175. #define CYTHON_USE_TYPE_SLOTS 1
  176. #endif
  177. #if PY_VERSION_HEX < 0x02070000
  178. #undef CYTHON_USE_PYTYPE_LOOKUP
  179. #define CYTHON_USE_PYTYPE_LOOKUP 0
  180. #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
  181. #define CYTHON_USE_PYTYPE_LOOKUP 1
  182. #endif
  183. #if PY_MAJOR_VERSION < 3
  184. #undef CYTHON_USE_ASYNC_SLOTS
  185. #define CYTHON_USE_ASYNC_SLOTS 0
  186. #elif !defined(CYTHON_USE_ASYNC_SLOTS)
  187. #define CYTHON_USE_ASYNC_SLOTS 1
  188. #endif
  189. #if PY_VERSION_HEX < 0x02070000
  190. #undef CYTHON_USE_PYLONG_INTERNALS
  191. #define CYTHON_USE_PYLONG_INTERNALS 0
  192. #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
  193. #define CYTHON_USE_PYLONG_INTERNALS 1
  194. #endif
  195. #ifndef CYTHON_USE_PYLIST_INTERNALS
  196. #define CYTHON_USE_PYLIST_INTERNALS 1
  197. #endif
  198. #ifndef CYTHON_USE_UNICODE_INTERNALS
  199. #define CYTHON_USE_UNICODE_INTERNALS 1
  200. #endif
  201. #if PY_VERSION_HEX < 0x030300F0
  202. #undef CYTHON_USE_UNICODE_WRITER
  203. #define CYTHON_USE_UNICODE_WRITER 0
  204. #elif !defined(CYTHON_USE_UNICODE_WRITER)
  205. #define CYTHON_USE_UNICODE_WRITER 1
  206. #endif
  207. #ifndef CYTHON_AVOID_BORROWED_REFS
  208. #define CYTHON_AVOID_BORROWED_REFS 0
  209. #endif
  210. #ifndef CYTHON_ASSUME_SAFE_MACROS
  211. #define CYTHON_ASSUME_SAFE_MACROS 1
  212. #endif
  213. #ifndef CYTHON_UNPACK_METHODS
  214. #define CYTHON_UNPACK_METHODS 1
  215. #endif
  216. #ifndef CYTHON_FAST_THREAD_STATE
  217. #define CYTHON_FAST_THREAD_STATE 1
  218. #endif
  219. #ifndef CYTHON_FAST_PYCALL
  220. #define CYTHON_FAST_PYCALL 1
  221. #endif
  222. #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
  223. #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  224. #endif
  225. #ifndef CYTHON_USE_TP_FINALIZE
  226. #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  227. #endif
  228. #ifndef CYTHON_USE_DICT_VERSIONS
  229. #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  230. #endif
  231. #ifndef CYTHON_USE_EXC_INFO_STACK
  232. #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  233. #endif
  234. #endif
  235. #if !defined(CYTHON_FAST_PYCCALL)
  236. #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
  237. #endif
  238. #if CYTHON_USE_PYLONG_INTERNALS
  239. #include "longintrepr.h"
  240. #undef SHIFT
  241. #undef BASE
  242. #undef MASK
  243. #ifdef SIZEOF_VOID_P
  244. enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  245. #endif
  246. #endif
  247. #ifndef __has_attribute
  248. #define __has_attribute(x) 0
  249. #endif
  250. #ifndef __has_cpp_attribute
  251. #define __has_cpp_attribute(x) 0
  252. #endif
  253. #ifndef CYTHON_RESTRICT
  254. #if defined(__GNUC__)
  255. #define CYTHON_RESTRICT __restrict__
  256. #elif defined(_MSC_VER) && _MSC_VER >= 1400
  257. #define CYTHON_RESTRICT __restrict
  258. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  259. #define CYTHON_RESTRICT restrict
  260. #else
  261. #define CYTHON_RESTRICT
  262. #endif
  263. #endif
  264. #ifndef CYTHON_UNUSED
  265. # if defined(__GNUC__)
  266. # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
  267. # define CYTHON_UNUSED __attribute__ ((__unused__))
  268. # else
  269. # define CYTHON_UNUSED
  270. # endif
  271. # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
  272. # define CYTHON_UNUSED __attribute__ ((__unused__))
  273. # else
  274. # define CYTHON_UNUSED
  275. # endif
  276. #endif
  277. #ifndef CYTHON_MAYBE_UNUSED_VAR
  278. # if defined(__cplusplus)
  279. template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
  280. # else
  281. # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
  282. # endif
  283. #endif
  284. #ifndef CYTHON_NCP_UNUSED
  285. # if CYTHON_COMPILING_IN_CPYTHON
  286. # define CYTHON_NCP_UNUSED
  287. # else
  288. # define CYTHON_NCP_UNUSED CYTHON_UNUSED
  289. # endif
  290. #endif
  291. #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
  292. #ifdef _MSC_VER
  293. #ifndef _MSC_STDINT_H_
  294. #if _MSC_VER < 1300
  295. typedef unsigned char uint8_t;
  296. typedef unsigned int uint32_t;
  297. #else
  298. typedef unsigned __int8 uint8_t;
  299. typedef unsigned __int32 uint32_t;
  300. #endif
  301. #endif
  302. #else
  303. #include <stdint.h>
  304. #endif
  305. #ifndef CYTHON_FALLTHROUGH
  306. #if defined(__cplusplus) && __cplusplus >= 201103L
  307. #if __has_cpp_attribute(fallthrough)
  308. #define CYTHON_FALLTHROUGH [[fallthrough]]
  309. #elif __has_cpp_attribute(clang::fallthrough)
  310. #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
  311. #elif __has_cpp_attribute(gnu::fallthrough)
  312. #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
  313. #endif
  314. #endif
  315. #ifndef CYTHON_FALLTHROUGH
  316. #if __has_attribute(fallthrough)
  317. #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
  318. #else
  319. #define CYTHON_FALLTHROUGH
  320. #endif
  321. #endif
  322. #if defined(__clang__ ) && defined(__apple_build_version__)
  323. #if __apple_build_version__ < 7000000
  324. #undef CYTHON_FALLTHROUGH
  325. #define CYTHON_FALLTHROUGH
  326. #endif
  327. #endif
  328. #endif
  329. #ifndef __cplusplus
  330. #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
  331. #endif
  332. #ifndef CYTHON_INLINE
  333. #if defined(__clang__)
  334. #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  335. #else
  336. #define CYTHON_INLINE inline
  337. #endif
  338. #endif
  339. template<typename T>
  340. void __Pyx_call_destructor(T& x) {
  341. x.~T();
  342. }
  343. template<typename T>
  344. class __Pyx_FakeReference {
  345. public:
  346. __Pyx_FakeReference() : ptr(NULL) { }
  347. __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
  348. T *operator->() { return ptr; }
  349. T *operator&() { return ptr; }
  350. operator T&() { return *ptr; }
  351. template<typename U> bool operator ==(U other) { return *ptr == other; }
  352. template<typename U> bool operator !=(U other) { return *ptr != other; }
  353. private:
  354. T *ptr;
  355. };
  356. #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  357. #define Py_OptimizeFlag 0
  358. #endif
  359. #define __PYX_BUILD_PY_SSIZE_T "n"
  360. #define CYTHON_FORMAT_SSIZE_T "z"
  361. #if PY_MAJOR_VERSION < 3
  362. #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  363. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  364. PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  365. #define __Pyx_DefaultClassType PyClass_Type
  366. #else
  367. #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  368. #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  369. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  370. PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  371. #else
  372. #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
  373. PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  374. #endif
  375. #define __Pyx_DefaultClassType PyType_Type
  376. #endif
  377. #ifndef Py_TPFLAGS_CHECKTYPES
  378. #define Py_TPFLAGS_CHECKTYPES 0
  379. #endif
  380. #ifndef Py_TPFLAGS_HAVE_INDEX
  381. #define Py_TPFLAGS_HAVE_INDEX 0
  382. #endif
  383. #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  384. #define Py_TPFLAGS_HAVE_NEWBUFFER 0
  385. #endif
  386. #ifndef Py_TPFLAGS_HAVE_FINALIZE
  387. #define Py_TPFLAGS_HAVE_FINALIZE 0
  388. #endif
  389. #ifndef METH_STACKLESS
  390. #define METH_STACKLESS 0
  391. #endif
  392. #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  393. #ifndef METH_FASTCALL
  394. #define METH_FASTCALL 0x80
  395. #endif
  396. typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  397. typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
  398. Py_ssize_t nargs, PyObject *kwnames);
  399. #else
  400. #define __Pyx_PyCFunctionFast _PyCFunctionFast
  401. #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
  402. #endif
  403. #if CYTHON_FAST_PYCCALL
  404. #define __Pyx_PyFastCFunction_Check(func)\
  405. ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
  406. #else
  407. #define __Pyx_PyFastCFunction_Check(func) 0
  408. #endif
  409. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  410. #define PyObject_Malloc(s) PyMem_Malloc(s)
  411. #define PyObject_Free(p) PyMem_Free(p)
  412. #define PyObject_Realloc(p) PyMem_Realloc(p)
  413. #endif
  414. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  415. #define PyMem_RawMalloc(n) PyMem_Malloc(n)
  416. #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
  417. #define PyMem_RawFree(p) PyMem_Free(p)
  418. #endif
  419. #if CYTHON_COMPILING_IN_PYSTON
  420. #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
  421. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
  422. #else
  423. #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
  424. #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
  425. #endif
  426. #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  427. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  428. #elif PY_VERSION_HEX >= 0x03060000
  429. #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
  430. #elif PY_VERSION_HEX >= 0x03000000
  431. #define __Pyx_PyThreadState_Current PyThreadState_GET()
  432. #else
  433. #define __Pyx_PyThreadState_Current _PyThreadState_Current
  434. #endif
  435. #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
  436. #include "pythread.h"
  437. #define Py_tss_NEEDS_INIT 0
  438. typedef int Py_tss_t;
  439. static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  440. *key = PyThread_create_key();
  441. return 0;
  442. }
  443. static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  444. Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  445. *key = Py_tss_NEEDS_INIT;
  446. return key;
  447. }
  448. static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  449. PyObject_Free(key);
  450. }
  451. static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  452. return *key != Py_tss_NEEDS_INIT;
  453. }
  454. static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  455. PyThread_delete_key(*key);
  456. *key = Py_tss_NEEDS_INIT;
  457. }
  458. static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  459. return PyThread_set_key_value(*key, value);
  460. }
  461. static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  462. return PyThread_get_key_value(*key);
  463. }
  464. #endif
  465. #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
  466. #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
  467. #else
  468. #define __Pyx_PyDict_NewPresized(n) PyDict_New()
  469. #endif
  470. #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  471. #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
  472. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
  473. #else
  474. #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
  475. #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
  476. #endif
  477. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
  478. #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
  479. #else
  480. #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
  481. #endif
  482. #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  483. #define CYTHON_PEP393_ENABLED 1
  484. #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
  485. 0 : _PyUnicode_Ready((PyObject *)(op)))
  486. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
  487. #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  488. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
  489. #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
  490. #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
  491. #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
  492. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
  493. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  494. #else
  495. #define CYTHON_PEP393_ENABLED 0
  496. #define PyUnicode_1BYTE_KIND 1
  497. #define PyUnicode_2BYTE_KIND 2
  498. #define PyUnicode_4BYTE_KIND 4
  499. #define __Pyx_PyUnicode_READY(op) (0)
  500. #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
  501. #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  502. #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  503. #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
  504. #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
  505. #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  506. #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  507. #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
  508. #endif
  509. #if CYTHON_COMPILING_IN_PYPY
  510. #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
  511. #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
  512. #else
  513. #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
  514. #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
  515. PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
  516. #endif
  517. #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  518. #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
  519. #endif
  520. #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  521. #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
  522. #endif
  523. #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  524. #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
  525. #endif
  526. #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))
  527. #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
  528. #if PY_MAJOR_VERSION >= 3
  529. #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
  530. #else
  531. #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
  532. #endif
  533. #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  534. #define PyObject_ASCII(o) PyObject_Repr(o)
  535. #endif
  536. #if PY_MAJOR_VERSION >= 3
  537. #define PyBaseString_Type PyUnicode_Type
  538. #define PyStringObject PyUnicodeObject
  539. #define PyString_Type PyUnicode_Type
  540. #define PyString_Check PyUnicode_Check
  541. #define PyString_CheckExact PyUnicode_CheckExact
  542. #define PyObject_Unicode PyObject_Str
  543. #endif
  544. #if PY_MAJOR_VERSION >= 3
  545. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  546. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  547. #else
  548. #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  549. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  550. #endif
  551. #ifndef PySet_CheckExact
  552. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  553. #endif
  554. #if CYTHON_ASSUME_SAFE_MACROS
  555. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  556. #else
  557. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  558. #endif
  559. #if PY_MAJOR_VERSION >= 3
  560. #define PyIntObject PyLongObject
  561. #define PyInt_Type PyLong_Type
  562. #define PyInt_Check(op) PyLong_Check(op)
  563. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  564. #define PyInt_FromString PyLong_FromString
  565. #define PyInt_FromUnicode PyLong_FromUnicode
  566. #define PyInt_FromLong PyLong_FromLong
  567. #define PyInt_FromSize_t PyLong_FromSize_t
  568. #define PyInt_FromSsize_t PyLong_FromSsize_t
  569. #define PyInt_AsLong PyLong_AsLong
  570. #define PyInt_AS_LONG PyLong_AS_LONG
  571. #define PyInt_AsSsize_t PyLong_AsSsize_t
  572. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  573. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  574. #define PyNumber_Int PyNumber_Long
  575. #endif
  576. #if PY_MAJOR_VERSION >= 3
  577. #define PyBoolObject PyLongObject
  578. #endif
  579. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  580. #ifndef PyUnicode_InternFromString
  581. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  582. #endif
  583. #endif
  584. #if PY_VERSION_HEX < 0x030200A4
  585. typedef long Py_hash_t;
  586. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  587. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  588. #else
  589. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  590. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  591. #endif
  592. #if PY_MAJOR_VERSION >= 3
  593. #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
  594. #else
  595. #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  596. #endif
  597. #if CYTHON_USE_ASYNC_SLOTS
  598. #if PY_VERSION_HEX >= 0x030500B1
  599. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  600. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  601. #else
  602. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  603. #endif
  604. #else
  605. #define __Pyx_PyType_AsAsync(obj) NULL
  606. #endif
  607. #ifndef __Pyx_PyAsyncMethodsStruct
  608. typedef struct {
  609. unaryfunc am_await;
  610. unaryfunc am_aiter;
  611. unaryfunc am_anext;
  612. } __Pyx_PyAsyncMethodsStruct;
  613. #endif
  614. #if defined(WIN32) || defined(MS_WINDOWS)
  615. #define _USE_MATH_DEFINES
  616. #endif
  617. #include <math.h>
  618. #ifdef NAN
  619. #define __PYX_NAN() ((float) NAN)
  620. #else
  621. static CYTHON_INLINE float __PYX_NAN() {
  622. float value;
  623. memset(&value, 0xFF, sizeof(value));
  624. return value;
  625. }
  626. #endif
  627. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  628. #define __Pyx_truncl trunc
  629. #else
  630. #define __Pyx_truncl truncl
  631. #endif
  632. #define __PYX_ERR(f_index, lineno, Ln_error) \
  633. { \
  634. __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
  635. }
  636. #ifndef __PYX_EXTERN_C
  637. #ifdef __cplusplus
  638. #define __PYX_EXTERN_C extern "C"
  639. #else
  640. #define __PYX_EXTERN_C extern
  641. #endif
  642. #endif
  643. #define __PYX_HAVE__gedlibpy
  644. #define __PYX_HAVE_API__gedlibpy
  645. /* Early includes */
  646. #include "ios"
  647. #include "new"
  648. #include "stdexcept"
  649. #include "typeinfo"
  650. #include <vector>
  651. #include <string.h>
  652. #include <string>
  653. #include <utility>
  654. #include <map>
  655. #include <list>
  656. #include <stdio.h>
  657. #include "numpy/arrayobject.h"
  658. #include "numpy/ufuncobject.h"
  659. #include "pythread.h"
  660. #include "src/GedLibBind.hpp"
  661. #ifdef _OPENMP
  662. #include <omp.h>
  663. #endif /* _OPENMP */
  664. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  665. #define CYTHON_WITHOUT_ASSERTIONS
  666. #endif
  667. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  668. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  669. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  670. #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
  671. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
  672. #define __PYX_DEFAULT_STRING_ENCODING ""
  673. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  674. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  675. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  676. #define __Pyx_long_cast(x) ((long)x)
  677. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  678. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  679. (sizeof(type) > sizeof(Py_ssize_t) &&\
  680. likely(v < (type)PY_SSIZE_T_MAX ||\
  681. v == (type)PY_SSIZE_T_MAX) &&\
  682. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  683. v == (type)PY_SSIZE_T_MIN))) ||\
  684. (sizeof(type) == sizeof(Py_ssize_t) &&\
  685. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  686. v == (type)PY_SSIZE_T_MAX))) )
  687. static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
  688. return (size_t) i < (size_t) limit;
  689. }
  690. #if defined (__cplusplus) && __cplusplus >= 201103L
  691. #include <cstdlib>
  692. #define __Pyx_sst_abs(value) std::abs(value)
  693. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  694. #define __Pyx_sst_abs(value) abs(value)
  695. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  696. #define __Pyx_sst_abs(value) labs(value)
  697. #elif defined (_MSC_VER)
  698. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  699. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  700. #define __Pyx_sst_abs(value) llabs(value)
  701. #elif defined (__GNUC__)
  702. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  703. #else
  704. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  705. #endif
  706. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  707. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  708. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  709. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  710. #define __Pyx_PyBytes_FromString PyBytes_FromString
  711. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  712. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  713. #if PY_MAJOR_VERSION < 3
  714. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  715. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  716. #else
  717. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  718. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  719. #endif
  720. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  721. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  722. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  723. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  724. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  725. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  726. #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
  727. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  728. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  729. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  730. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  731. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  732. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  733. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  734. #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
  735. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  736. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
  737. const Py_UNICODE *u_end = u;
  738. while (*u_end++) ;
  739. return (size_t)(u_end - u - 1);
  740. }
  741. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  742. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  743. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  744. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  745. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  746. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  747. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  748. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
  749. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  750. #define __Pyx_PySequence_Tuple(obj)\
  751. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  752. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  753. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  754. #if CYTHON_ASSUME_SAFE_MACROS
  755. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  756. #else
  757. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  758. #endif
  759. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  760. #if PY_MAJOR_VERSION >= 3
  761. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  762. #else
  763. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  764. #endif
  765. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  766. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  767. static int __Pyx_sys_getdefaultencoding_not_ascii;
  768. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  769. PyObject* sys;
  770. PyObject* default_encoding = NULL;
  771. PyObject* ascii_chars_u = NULL;
  772. PyObject* ascii_chars_b = NULL;
  773. const char* default_encoding_c;
  774. sys = PyImport_ImportModule("sys");
  775. if (!sys) goto bad;
  776. default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  777. Py_DECREF(sys);
  778. if (!default_encoding) goto bad;
  779. default_encoding_c = PyBytes_AsString(default_encoding);
  780. if (!default_encoding_c) goto bad;
  781. if (strcmp(default_encoding_c, "ascii") == 0) {
  782. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  783. } else {
  784. char ascii_chars[128];
  785. int c;
  786. for (c = 0; c < 128; c++) {
  787. ascii_chars[c] = c;
  788. }
  789. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  790. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  791. if (!ascii_chars_u) goto bad;
  792. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  793. if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  794. PyErr_Format(
  795. PyExc_ValueError,
  796. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  797. default_encoding_c);
  798. goto bad;
  799. }
  800. Py_DECREF(ascii_chars_u);
  801. Py_DECREF(ascii_chars_b);
  802. }
  803. Py_DECREF(default_encoding);
  804. return 0;
  805. bad:
  806. Py_XDECREF(default_encoding);
  807. Py_XDECREF(ascii_chars_u);
  808. Py_XDECREF(ascii_chars_b);
  809. return -1;
  810. }
  811. #endif
  812. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  813. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  814. #else
  815. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  816. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  817. static char* __PYX_DEFAULT_STRING_ENCODING;
  818. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  819. PyObject* sys;
  820. PyObject* default_encoding = NULL;
  821. char* default_encoding_c;
  822. sys = PyImport_ImportModule("sys");
  823. if (!sys) goto bad;
  824. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  825. Py_DECREF(sys);
  826. if (!default_encoding) goto bad;
  827. default_encoding_c = PyBytes_AsString(default_encoding);
  828. if (!default_encoding_c) goto bad;
  829. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
  830. if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  831. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  832. Py_DECREF(default_encoding);
  833. return 0;
  834. bad:
  835. Py_XDECREF(default_encoding);
  836. return -1;
  837. }
  838. #endif
  839. #endif
  840. /* Test for GCC > 2.95 */
  841. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  842. #define likely(x) __builtin_expect(!!(x), 1)
  843. #define unlikely(x) __builtin_expect(!!(x), 0)
  844. #else /* !__GNUC__ or GCC < 2.95 */
  845. #define likely(x) (x)
  846. #define unlikely(x) (x)
  847. #endif /* __GNUC__ */
  848. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  849. static PyObject *__pyx_m = NULL;
  850. static PyObject *__pyx_d;
  851. static PyObject *__pyx_b;
  852. static PyObject *__pyx_cython_runtime = NULL;
  853. static PyObject *__pyx_empty_tuple;
  854. static PyObject *__pyx_empty_bytes;
  855. static PyObject *__pyx_empty_unicode;
  856. static int __pyx_lineno;
  857. static int __pyx_clineno = 0;
  858. static const char * __pyx_cfilenm= __FILE__;
  859. static const char *__pyx_filename;
  860. /* Header.proto */
  861. #if !defined(CYTHON_CCOMPLEX)
  862. #if defined(__cplusplus)
  863. #define CYTHON_CCOMPLEX 1
  864. #elif defined(_Complex_I)
  865. #define CYTHON_CCOMPLEX 1
  866. #else
  867. #define CYTHON_CCOMPLEX 0
  868. #endif
  869. #endif
  870. #if CYTHON_CCOMPLEX
  871. #ifdef __cplusplus
  872. #include <complex>
  873. #else
  874. #include <complex.h>
  875. #endif
  876. #endif
  877. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  878. #undef _Complex_I
  879. #define _Complex_I 1.0fj
  880. #endif
  881. static const char *__pyx_f[] = {
  882. "gedlibpy.pyx",
  883. "stringsource",
  884. "__init__.pxd",
  885. "array.pxd",
  886. "type.pxd",
  887. "bool.pxd",
  888. "complex.pxd",
  889. };
  890. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
  891. * # in Cython to enable them only on the right systems.
  892. *
  893. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  894. * ctypedef npy_int16 int16_t
  895. * ctypedef npy_int32 int32_t
  896. */
  897. typedef npy_int8 __pyx_t_5numpy_int8_t;
  898. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
  899. *
  900. * ctypedef npy_int8 int8_t
  901. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  902. * ctypedef npy_int32 int32_t
  903. * ctypedef npy_int64 int64_t
  904. */
  905. typedef npy_int16 __pyx_t_5numpy_int16_t;
  906. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
  907. * ctypedef npy_int8 int8_t
  908. * ctypedef npy_int16 int16_t
  909. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  910. * ctypedef npy_int64 int64_t
  911. * #ctypedef npy_int96 int96_t
  912. */
  913. typedef npy_int32 __pyx_t_5numpy_int32_t;
  914. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
  915. * ctypedef npy_int16 int16_t
  916. * ctypedef npy_int32 int32_t
  917. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  918. * #ctypedef npy_int96 int96_t
  919. * #ctypedef npy_int128 int128_t
  920. */
  921. typedef npy_int64 __pyx_t_5numpy_int64_t;
  922. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
  923. * #ctypedef npy_int128 int128_t
  924. *
  925. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  926. * ctypedef npy_uint16 uint16_t
  927. * ctypedef npy_uint32 uint32_t
  928. */
  929. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  930. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
  931. *
  932. * ctypedef npy_uint8 uint8_t
  933. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  934. * ctypedef npy_uint32 uint32_t
  935. * ctypedef npy_uint64 uint64_t
  936. */
  937. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  938. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
  939. * ctypedef npy_uint8 uint8_t
  940. * ctypedef npy_uint16 uint16_t
  941. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  942. * ctypedef npy_uint64 uint64_t
  943. * #ctypedef npy_uint96 uint96_t
  944. */
  945. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  946. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
  947. * ctypedef npy_uint16 uint16_t
  948. * ctypedef npy_uint32 uint32_t
  949. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  950. * #ctypedef npy_uint96 uint96_t
  951. * #ctypedef npy_uint128 uint128_t
  952. */
  953. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  954. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
  955. * #ctypedef npy_uint128 uint128_t
  956. *
  957. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  958. * ctypedef npy_float64 float64_t
  959. * #ctypedef npy_float80 float80_t
  960. */
  961. typedef npy_float32 __pyx_t_5numpy_float32_t;
  962. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
  963. *
  964. * ctypedef npy_float32 float32_t
  965. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  966. * #ctypedef npy_float80 float80_t
  967. * #ctypedef npy_float128 float128_t
  968. */
  969. typedef npy_float64 __pyx_t_5numpy_float64_t;
  970. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
  971. * # The int types are mapped a bit surprising --
  972. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  973. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  974. * ctypedef npy_longlong long_t
  975. * ctypedef npy_longlong longlong_t
  976. */
  977. typedef npy_long __pyx_t_5numpy_int_t;
  978. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
  979. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  980. * ctypedef npy_long int_t
  981. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  982. * ctypedef npy_longlong longlong_t
  983. *
  984. */
  985. typedef npy_longlong __pyx_t_5numpy_long_t;
  986. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
  987. * ctypedef npy_long int_t
  988. * ctypedef npy_longlong long_t
  989. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  990. *
  991. * ctypedef npy_ulong uint_t
  992. */
  993. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  994. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
  995. * ctypedef npy_longlong longlong_t
  996. *
  997. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  998. * ctypedef npy_ulonglong ulong_t
  999. * ctypedef npy_ulonglong ulonglong_t
  1000. */
  1001. typedef npy_ulong __pyx_t_5numpy_uint_t;
  1002. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
  1003. *
  1004. * ctypedef npy_ulong uint_t
  1005. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  1006. * ctypedef npy_ulonglong ulonglong_t
  1007. *
  1008. */
  1009. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  1010. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
  1011. * ctypedef npy_ulong uint_t
  1012. * ctypedef npy_ulonglong ulong_t
  1013. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  1014. *
  1015. * ctypedef npy_intp intp_t
  1016. */
  1017. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  1018. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
  1019. * ctypedef npy_ulonglong ulonglong_t
  1020. *
  1021. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  1022. * ctypedef npy_uintp uintp_t
  1023. *
  1024. */
  1025. typedef npy_intp __pyx_t_5numpy_intp_t;
  1026. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
  1027. *
  1028. * ctypedef npy_intp intp_t
  1029. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  1030. *
  1031. * ctypedef npy_double float_t
  1032. */
  1033. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  1034. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
  1035. * ctypedef npy_uintp uintp_t
  1036. *
  1037. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  1038. * ctypedef npy_double double_t
  1039. * ctypedef npy_longdouble longdouble_t
  1040. */
  1041. typedef npy_double __pyx_t_5numpy_float_t;
  1042. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
  1043. *
  1044. * ctypedef npy_double float_t
  1045. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  1046. * ctypedef npy_longdouble longdouble_t
  1047. *
  1048. */
  1049. typedef npy_double __pyx_t_5numpy_double_t;
  1050. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
  1051. * ctypedef npy_double float_t
  1052. * ctypedef npy_double double_t
  1053. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  1054. *
  1055. * ctypedef npy_cfloat cfloat_t
  1056. */
  1057. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  1058. /* "gedlibpy.pyx":39
  1059. * #Long unsigned int equivalent
  1060. * cimport numpy as np
  1061. * ctypedef np.npy_uint32 UINT32_t # <<<<<<<<<<<<<<
  1062. * from cpython cimport array
  1063. *
  1064. */
  1065. typedef npy_uint32 __pyx_t_8gedlibpy_UINT32_t;
  1066. /* Declarations.proto */
  1067. #if CYTHON_CCOMPLEX
  1068. #ifdef __cplusplus
  1069. typedef ::std::complex< float > __pyx_t_float_complex;
  1070. #else
  1071. typedef float _Complex __pyx_t_float_complex;
  1072. #endif
  1073. #else
  1074. typedef struct { float real, imag; } __pyx_t_float_complex;
  1075. #endif
  1076. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1077. /* Declarations.proto */
  1078. #if CYTHON_CCOMPLEX
  1079. #ifdef __cplusplus
  1080. typedef ::std::complex< double > __pyx_t_double_complex;
  1081. #else
  1082. typedef double _Complex __pyx_t_double_complex;
  1083. #endif
  1084. #else
  1085. typedef struct { double real, imag; } __pyx_t_double_complex;
  1086. #endif
  1087. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  1088. /*--- Type declarations ---*/
  1089. #ifndef _ARRAYARRAY_H
  1090. struct arrayobject;
  1091. typedef struct arrayobject arrayobject;
  1092. #endif
  1093. struct __pyx_obj_8gedlibpy_GEDEnv;
  1094. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
  1095. * ctypedef npy_longdouble longdouble_t
  1096. *
  1097. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  1098. * ctypedef npy_cdouble cdouble_t
  1099. * ctypedef npy_clongdouble clongdouble_t
  1100. */
  1101. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  1102. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
  1103. *
  1104. * ctypedef npy_cfloat cfloat_t
  1105. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  1106. * ctypedef npy_clongdouble clongdouble_t
  1107. *
  1108. */
  1109. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  1110. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
  1111. * ctypedef npy_cfloat cfloat_t
  1112. * ctypedef npy_cdouble cdouble_t
  1113. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  1114. *
  1115. * ctypedef npy_cdouble complex_t
  1116. */
  1117. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  1118. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
  1119. * ctypedef npy_clongdouble clongdouble_t
  1120. *
  1121. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  1122. *
  1123. * cdef inline object PyArray_MultiIterNew1(a):
  1124. */
  1125. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  1126. /* "gedlibpy.pyx":178
  1127. *
  1128. *
  1129. * cdef class GEDEnv: # <<<<<<<<<<<<<<
  1130. * """Cython wrapper class for C++ class PyGEDEnv
  1131. * """
  1132. */
  1133. struct __pyx_obj_8gedlibpy_GEDEnv {
  1134. PyObject_HEAD
  1135. pyged::PyGEDEnv *c_env;
  1136. };
  1137. /* --- Runtime support code (head) --- */
  1138. /* Refnanny.proto */
  1139. #ifndef CYTHON_REFNANNY
  1140. #define CYTHON_REFNANNY 0
  1141. #endif
  1142. #if CYTHON_REFNANNY
  1143. typedef struct {
  1144. void (*INCREF)(void*, PyObject*, int);
  1145. void (*DECREF)(void*, PyObject*, int);
  1146. void (*GOTREF)(void*, PyObject*, int);
  1147. void (*GIVEREF)(void*, PyObject*, int);
  1148. void* (*SetupContext)(const char*, int, const char*);
  1149. void (*FinishContext)(void**);
  1150. } __Pyx_RefNannyAPIStruct;
  1151. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  1152. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  1153. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  1154. #ifdef WITH_THREAD
  1155. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1156. if (acquire_gil) {\
  1157. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1158. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  1159. PyGILState_Release(__pyx_gilstate_save);\
  1160. } else {\
  1161. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  1162. }
  1163. #else
  1164. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1165. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  1166. #endif
  1167. #define __Pyx_RefNannyFinishContext()\
  1168. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  1169. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1170. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1171. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1172. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1173. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  1174. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  1175. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  1176. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  1177. #else
  1178. #define __Pyx_RefNannyDeclarations
  1179. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  1180. #define __Pyx_RefNannyFinishContext()
  1181. #define __Pyx_INCREF(r) Py_INCREF(r)
  1182. #define __Pyx_DECREF(r) Py_DECREF(r)
  1183. #define __Pyx_GOTREF(r)
  1184. #define __Pyx_GIVEREF(r)
  1185. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  1186. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  1187. #define __Pyx_XGOTREF(r)
  1188. #define __Pyx_XGIVEREF(r)
  1189. #endif
  1190. #define __Pyx_XDECREF_SET(r, v) do {\
  1191. PyObject *tmp = (PyObject *) r;\
  1192. r = v; __Pyx_XDECREF(tmp);\
  1193. } while (0)
  1194. #define __Pyx_DECREF_SET(r, v) do {\
  1195. PyObject *tmp = (PyObject *) r;\
  1196. r = v; __Pyx_DECREF(tmp);\
  1197. } while (0)
  1198. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  1199. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  1200. /* PyObjectGetAttrStr.proto */
  1201. #if CYTHON_USE_TYPE_SLOTS
  1202. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  1203. #else
  1204. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  1205. #endif
  1206. /* GetBuiltinName.proto */
  1207. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  1208. /* ListCompAppend.proto */
  1209. #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
  1210. static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
  1211. PyListObject* L = (PyListObject*) list;
  1212. Py_ssize_t len = Py_SIZE(list);
  1213. if (likely(L->allocated > len)) {
  1214. Py_INCREF(x);
  1215. PyList_SET_ITEM(list, len, x);
  1216. Py_SIZE(list) = len+1;
  1217. return 0;
  1218. }
  1219. return PyList_Append(list, x);
  1220. }
  1221. #else
  1222. #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
  1223. #endif
  1224. /* IncludeCppStringH.proto */
  1225. #include <string>
  1226. /* decode_c_string_utf16.proto */
  1227. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
  1228. int byteorder = 0;
  1229. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1230. }
  1231. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
  1232. int byteorder = -1;
  1233. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1234. }
  1235. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
  1236. int byteorder = 1;
  1237. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1238. }
  1239. /* decode_c_bytes.proto */
  1240. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  1241. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  1242. const char* encoding, const char* errors,
  1243. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
  1244. /* decode_cpp_string.proto */
  1245. static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
  1246. std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
  1247. const char* encoding, const char* errors,
  1248. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  1249. return __Pyx_decode_c_bytes(
  1250. cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
  1251. }
  1252. /* RaiseArgTupleInvalid.proto */
  1253. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  1254. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  1255. /* KeywordStringCheck.proto */
  1256. static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
  1257. /* RaiseDoubleKeywords.proto */
  1258. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  1259. /* ParseKeywords.proto */
  1260. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
  1261. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
  1262. const char* function_name);
  1263. /* PyCFunctionFastCall.proto */
  1264. #if CYTHON_FAST_PYCCALL
  1265. static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
  1266. #else
  1267. #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
  1268. #endif
  1269. /* PyFunctionFastCall.proto */
  1270. #if CYTHON_FAST_PYCALL
  1271. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  1272. __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  1273. #if 1 || PY_VERSION_HEX < 0x030600B1
  1274. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
  1275. #else
  1276. #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
  1277. #endif
  1278. #define __Pyx_BUILD_ASSERT_EXPR(cond)\
  1279. (sizeof(char [1 - 2*!(cond)]) - 1)
  1280. #ifndef Py_MEMBER_SIZE
  1281. #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
  1282. #endif
  1283. static size_t __pyx_pyframe_localsplus_offset = 0;
  1284. #include "frameobject.h"
  1285. #define __Pxy_PyFrame_Initialize_Offsets()\
  1286. ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
  1287. (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  1288. #define __Pyx_PyFrame_GetLocalsplus(frame)\
  1289. (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
  1290. #endif
  1291. /* PyObjectCall.proto */
  1292. #if CYTHON_COMPILING_IN_CPYTHON
  1293. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  1294. #else
  1295. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  1296. #endif
  1297. /* PyObjectCall2Args.proto */
  1298. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
  1299. /* PyObjectCallMethO.proto */
  1300. #if CYTHON_COMPILING_IN_CPYTHON
  1301. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  1302. #endif
  1303. /* PyObjectCallOneArg.proto */
  1304. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  1305. /* PyDictVersioning.proto */
  1306. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  1307. #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
  1308. #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
  1309. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
  1310. (version_var) = __PYX_GET_DICT_VERSION(dict);\
  1311. (cache_var) = (value);
  1312. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
  1313. static PY_UINT64_T __pyx_dict_version = 0;\
  1314. static PyObject *__pyx_dict_cached_value = NULL;\
  1315. if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
  1316. (VAR) = __pyx_dict_cached_value;\
  1317. } else {\
  1318. (VAR) = __pyx_dict_cached_value = (LOOKUP);\
  1319. __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
  1320. }\
  1321. }
  1322. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
  1323. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
  1324. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
  1325. #else
  1326. #define __PYX_GET_DICT_VERSION(dict) (0)
  1327. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
  1328. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
  1329. #endif
  1330. /* GetModuleGlobalName.proto */
  1331. #if CYTHON_USE_DICT_VERSIONS
  1332. #define __Pyx_GetModuleGlobalName(var, name) {\
  1333. static PY_UINT64_T __pyx_dict_version = 0;\
  1334. static PyObject *__pyx_dict_cached_value = NULL;\
  1335. (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
  1336. (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
  1337. __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1338. }
  1339. #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
  1340. PY_UINT64_T __pyx_dict_version;\
  1341. PyObject *__pyx_dict_cached_value;\
  1342. (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1343. }
  1344. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
  1345. #else
  1346. #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1347. #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1348. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
  1349. #endif
  1350. /* PySequenceContains.proto */
  1351. static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
  1352. int result = PySequence_Contains(seq, item);
  1353. return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
  1354. }
  1355. /* PyThreadStateGet.proto */
  1356. #if CYTHON_FAST_THREAD_STATE
  1357. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  1358. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  1359. #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
  1360. #else
  1361. #define __Pyx_PyThreadState_declare
  1362. #define __Pyx_PyThreadState_assign
  1363. #define __Pyx_PyErr_Occurred() PyErr_Occurred()
  1364. #endif
  1365. /* PyErrFetchRestore.proto */
  1366. #if CYTHON_FAST_THREAD_STATE
  1367. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  1368. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  1369. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  1370. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  1371. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  1372. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1373. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1374. #if CYTHON_COMPILING_IN_CPYTHON
  1375. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  1376. #else
  1377. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1378. #endif
  1379. #else
  1380. #define __Pyx_PyErr_Clear() PyErr_Clear()
  1381. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1382. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  1383. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  1384. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  1385. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  1386. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  1387. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  1388. #endif
  1389. /* RaiseException.proto */
  1390. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  1391. /* GetItemInt.proto */
  1392. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1393. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1394. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
  1395. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
  1396. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  1397. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1398. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1399. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  1400. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  1401. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  1402. int wraparound, int boundscheck);
  1403. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1404. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1405. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  1406. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  1407. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  1408. int wraparound, int boundscheck);
  1409. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  1410. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  1411. int is_list, int wraparound, int boundscheck);
  1412. /* ObjectGetItem.proto */
  1413. #if CYTHON_USE_TYPE_SLOTS
  1414. static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
  1415. #else
  1416. #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
  1417. #endif
  1418. /* PyObjectCallNoArg.proto */
  1419. #if CYTHON_COMPILING_IN_CPYTHON
  1420. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
  1421. #else
  1422. #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
  1423. #endif
  1424. /* IterFinish.proto */
  1425. static CYTHON_INLINE int __Pyx_IterFinish(void);
  1426. /* PyObjectGetMethod.proto */
  1427. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
  1428. /* PyObjectCallMethod0.proto */
  1429. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
  1430. /* RaiseNeedMoreValuesToUnpack.proto */
  1431. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  1432. /* RaiseTooManyValuesToUnpack.proto */
  1433. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  1434. /* UnpackItemEndCheck.proto */
  1435. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
  1436. /* RaiseNoneIterError.proto */
  1437. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  1438. /* UnpackTupleError.proto */
  1439. static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
  1440. /* UnpackTuple2.proto */
  1441. #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
  1442. (likely(is_tuple || PyTuple_Check(tuple)) ?\
  1443. (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
  1444. __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
  1445. (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
  1446. __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
  1447. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  1448. PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
  1449. static int __Pyx_unpack_tuple2_generic(
  1450. PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
  1451. /* dict_iter.proto */
  1452. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
  1453. Py_ssize_t* p_orig_length, int* p_is_dict);
  1454. static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
  1455. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
  1456. /* PyObjectSetAttrStr.proto */
  1457. #if CYTHON_USE_TYPE_SLOTS
  1458. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
  1459. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
  1460. #else
  1461. #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
  1462. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  1463. #endif
  1464. /* DictGetItem.proto */
  1465. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  1466. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
  1467. #define __Pyx_PyObject_Dict_GetItem(obj, name)\
  1468. (likely(PyDict_CheckExact(obj)) ?\
  1469. __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
  1470. #else
  1471. #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
  1472. #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
  1473. #endif
  1474. /* ExtTypeTest.proto */
  1475. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
  1476. /* GetTopmostException.proto */
  1477. #if CYTHON_USE_EXC_INFO_STACK
  1478. static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
  1479. #endif
  1480. /* SaveResetException.proto */
  1481. #if CYTHON_FAST_THREAD_STATE
  1482. #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
  1483. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1484. #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
  1485. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1486. #else
  1487. #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
  1488. #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
  1489. #endif
  1490. /* PyErrExceptionMatches.proto */
  1491. #if CYTHON_FAST_THREAD_STATE
  1492. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1493. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1494. #else
  1495. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1496. #endif
  1497. /* GetException.proto */
  1498. #if CYTHON_FAST_THREAD_STATE
  1499. #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
  1500. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1501. #else
  1502. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
  1503. #endif
  1504. /* PyObject_GenericGetAttrNoDict.proto */
  1505. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1506. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
  1507. #else
  1508. #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
  1509. #endif
  1510. /* PyObject_GenericGetAttr.proto */
  1511. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1512. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
  1513. #else
  1514. #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
  1515. #endif
  1516. /* SetupReduce.proto */
  1517. static int __Pyx_setup_reduce(PyObject* type_obj);
  1518. /* TypeImport.proto */
  1519. #ifndef __PYX_HAVE_RT_ImportType_proto
  1520. #define __PYX_HAVE_RT_ImportType_proto
  1521. enum __Pyx_ImportType_CheckSize {
  1522. __Pyx_ImportType_CheckSize_Error = 0,
  1523. __Pyx_ImportType_CheckSize_Warn = 1,
  1524. __Pyx_ImportType_CheckSize_Ignore = 2
  1525. };
  1526. static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
  1527. #endif
  1528. /* Import.proto */
  1529. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  1530. /* CalculateMetaclass.proto */
  1531. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  1532. /* Py3ClassCreate.proto */
  1533. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  1534. PyObject *mkw, PyObject *modname, PyObject *doc);
  1535. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  1536. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
  1537. /* FetchCommonType.proto */
  1538. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  1539. /* CythonFunction.proto */
  1540. #define __Pyx_CyFunction_USED 1
  1541. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  1542. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  1543. #define __Pyx_CYFUNCTION_CCLASS 0x04
  1544. #define __Pyx_CyFunction_GetClosure(f)\
  1545. (((__pyx_CyFunctionObject *) (f))->func_closure)
  1546. #define __Pyx_CyFunction_GetClassObj(f)\
  1547. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  1548. #define __Pyx_CyFunction_Defaults(type, f)\
  1549. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  1550. #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
  1551. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  1552. typedef struct {
  1553. PyCFunctionObject func;
  1554. #if PY_VERSION_HEX < 0x030500A0
  1555. PyObject *func_weakreflist;
  1556. #endif
  1557. PyObject *func_dict;
  1558. PyObject *func_name;
  1559. PyObject *func_qualname;
  1560. PyObject *func_doc;
  1561. PyObject *func_globals;
  1562. PyObject *func_code;
  1563. PyObject *func_closure;
  1564. PyObject *func_classobj;
  1565. void *defaults;
  1566. int defaults_pyobjects;
  1567. int flags;
  1568. PyObject *defaults_tuple;
  1569. PyObject *defaults_kwdict;
  1570. PyObject *(*defaults_getter)(PyObject *);
  1571. PyObject *func_annotations;
  1572. } __pyx_CyFunctionObject;
  1573. static PyTypeObject *__pyx_CyFunctionType = 0;
  1574. #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
  1575. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
  1576. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  1577. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  1578. int flags, PyObject* qualname,
  1579. PyObject *self,
  1580. PyObject *module, PyObject *globals,
  1581. PyObject* code);
  1582. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  1583. size_t size,
  1584. int pyobjects);
  1585. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  1586. PyObject *tuple);
  1587. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  1588. PyObject *dict);
  1589. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  1590. PyObject *dict);
  1591. static int __pyx_CyFunction_init(void);
  1592. /* SetNameInClass.proto */
  1593. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  1594. #define __Pyx_SetNameInClass(ns, name, value)\
  1595. (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
  1596. #elif CYTHON_COMPILING_IN_CPYTHON
  1597. #define __Pyx_SetNameInClass(ns, name, value)\
  1598. (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
  1599. #else
  1600. #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
  1601. #endif
  1602. /* CLineInTraceback.proto */
  1603. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1604. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1605. #else
  1606. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1607. #endif
  1608. /* CodeObjectCache.proto */
  1609. typedef struct {
  1610. PyCodeObject* code_object;
  1611. int code_line;
  1612. } __Pyx_CodeObjectCacheEntry;
  1613. struct __Pyx_CodeObjectCache {
  1614. int count;
  1615. int max_count;
  1616. __Pyx_CodeObjectCacheEntry* entries;
  1617. };
  1618. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1619. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1620. static PyCodeObject *__pyx_find_code_object(int code_line);
  1621. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1622. /* AddTraceback.proto */
  1623. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1624. int py_line, const char *filename);
  1625. /* ArrayAPI.proto */
  1626. #ifndef _ARRAYARRAY_H
  1627. #define _ARRAYARRAY_H
  1628. typedef struct arraydescr {
  1629. int typecode;
  1630. int itemsize;
  1631. PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
  1632. int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
  1633. #if PY_MAJOR_VERSION >= 3
  1634. char *formats;
  1635. #endif
  1636. } arraydescr;
  1637. struct arrayobject {
  1638. PyObject_HEAD
  1639. Py_ssize_t ob_size;
  1640. union {
  1641. char *ob_item;
  1642. float *as_floats;
  1643. double *as_doubles;
  1644. int *as_ints;
  1645. unsigned int *as_uints;
  1646. unsigned char *as_uchars;
  1647. signed char *as_schars;
  1648. char *as_chars;
  1649. unsigned long *as_ulongs;
  1650. long *as_longs;
  1651. #if PY_MAJOR_VERSION >= 3
  1652. unsigned long long *as_ulonglongs;
  1653. long long *as_longlongs;
  1654. #endif
  1655. short *as_shorts;
  1656. unsigned short *as_ushorts;
  1657. Py_UNICODE *as_pyunicodes;
  1658. void *as_voidptr;
  1659. } data;
  1660. Py_ssize_t allocated;
  1661. struct arraydescr *ob_descr;
  1662. PyObject *weakreflist;
  1663. #if PY_MAJOR_VERSION >= 3
  1664. int ob_exports;
  1665. #endif
  1666. };
  1667. #ifndef NO_NEWARRAY_INLINE
  1668. static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1669. struct arraydescr *descr) {
  1670. arrayobject *op;
  1671. size_t nbytes;
  1672. if (size < 0) {
  1673. PyErr_BadInternalCall();
  1674. return NULL;
  1675. }
  1676. nbytes = size * descr->itemsize;
  1677. if (nbytes / descr->itemsize != (size_t)size) {
  1678. return PyErr_NoMemory();
  1679. }
  1680. op = (arrayobject *) type->tp_alloc(type, 0);
  1681. if (op == NULL) {
  1682. return NULL;
  1683. }
  1684. op->ob_descr = descr;
  1685. op->allocated = size;
  1686. op->weakreflist = NULL;
  1687. op->ob_size = size;
  1688. if (size <= 0) {
  1689. op->data.ob_item = NULL;
  1690. }
  1691. else {
  1692. op->data.ob_item = PyMem_NEW(char, nbytes);
  1693. if (op->data.ob_item == NULL) {
  1694. Py_DECREF(op);
  1695. return PyErr_NoMemory();
  1696. }
  1697. }
  1698. return (PyObject *) op;
  1699. }
  1700. #else
  1701. PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1702. struct arraydescr *descr);
  1703. #endif
  1704. static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
  1705. void *items = (void*) self->data.ob_item;
  1706. PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
  1707. if (items == NULL) {
  1708. PyErr_NoMemory();
  1709. return -1;
  1710. }
  1711. self->data.ob_item = (char*) items;
  1712. self->ob_size = n;
  1713. self->allocated = n;
  1714. return 0;
  1715. }
  1716. static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
  1717. void *items = (void*) self->data.ob_item;
  1718. Py_ssize_t newsize;
  1719. if (n < self->allocated && n*4 > self->allocated) {
  1720. self->ob_size = n;
  1721. return 0;
  1722. }
  1723. newsize = n + (n / 2) + 1;
  1724. if (newsize <= n) {
  1725. PyErr_NoMemory();
  1726. return -1;
  1727. }
  1728. PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
  1729. if (items == NULL) {
  1730. PyErr_NoMemory();
  1731. return -1;
  1732. }
  1733. self->data.ob_item = (char*) items;
  1734. self->ob_size = n;
  1735. self->allocated = newsize;
  1736. return 0;
  1737. }
  1738. #endif
  1739. /* CppExceptionConversion.proto */
  1740. #ifndef __Pyx_CppExn2PyErr
  1741. #include <new>
  1742. #include <typeinfo>
  1743. #include <stdexcept>
  1744. #include <ios>
  1745. static void __Pyx_CppExn2PyErr() {
  1746. try {
  1747. if (PyErr_Occurred())
  1748. ; // let the latest Python exn pass through and ignore the current one
  1749. else
  1750. throw;
  1751. } catch (const std::bad_alloc& exn) {
  1752. PyErr_SetString(PyExc_MemoryError, exn.what());
  1753. } catch (const std::bad_cast& exn) {
  1754. PyErr_SetString(PyExc_TypeError, exn.what());
  1755. } catch (const std::bad_typeid& exn) {
  1756. PyErr_SetString(PyExc_TypeError, exn.what());
  1757. } catch (const std::domain_error& exn) {
  1758. PyErr_SetString(PyExc_ValueError, exn.what());
  1759. } catch (const std::invalid_argument& exn) {
  1760. PyErr_SetString(PyExc_ValueError, exn.what());
  1761. } catch (const std::ios_base::failure& exn) {
  1762. PyErr_SetString(PyExc_IOError, exn.what());
  1763. } catch (const std::out_of_range& exn) {
  1764. PyErr_SetString(PyExc_IndexError, exn.what());
  1765. } catch (const std::overflow_error& exn) {
  1766. PyErr_SetString(PyExc_OverflowError, exn.what());
  1767. } catch (const std::range_error& exn) {
  1768. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1769. } catch (const std::underflow_error& exn) {
  1770. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1771. } catch (const std::exception& exn) {
  1772. PyErr_SetString(PyExc_RuntimeError, exn.what());
  1773. }
  1774. catch (...)
  1775. {
  1776. PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  1777. }
  1778. }
  1779. #endif
  1780. /* CIntToPy.proto */
  1781. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);
  1782. /* CIntToPy.proto */
  1783. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1784. /* CIntToPy.proto */
  1785. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1786. /* RealImag.proto */
  1787. #if CYTHON_CCOMPLEX
  1788. #ifdef __cplusplus
  1789. #define __Pyx_CREAL(z) ((z).real())
  1790. #define __Pyx_CIMAG(z) ((z).imag())
  1791. #else
  1792. #define __Pyx_CREAL(z) (__real__(z))
  1793. #define __Pyx_CIMAG(z) (__imag__(z))
  1794. #endif
  1795. #else
  1796. #define __Pyx_CREAL(z) ((z).real)
  1797. #define __Pyx_CIMAG(z) ((z).imag)
  1798. #endif
  1799. #if defined(__cplusplus) && CYTHON_CCOMPLEX\
  1800. && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
  1801. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  1802. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  1803. #else
  1804. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  1805. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  1806. #endif
  1807. /* Arithmetic.proto */
  1808. #if CYTHON_CCOMPLEX
  1809. #define __Pyx_c_eq_float(a, b) ((a)==(b))
  1810. #define __Pyx_c_sum_float(a, b) ((a)+(b))
  1811. #define __Pyx_c_diff_float(a, b) ((a)-(b))
  1812. #define __Pyx_c_prod_float(a, b) ((a)*(b))
  1813. #define __Pyx_c_quot_float(a, b) ((a)/(b))
  1814. #define __Pyx_c_neg_float(a) (-(a))
  1815. #ifdef __cplusplus
  1816. #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
  1817. #define __Pyx_c_conj_float(z) (::std::conj(z))
  1818. #if 1
  1819. #define __Pyx_c_abs_float(z) (::std::abs(z))
  1820. #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
  1821. #endif
  1822. #else
  1823. #define __Pyx_c_is_zero_float(z) ((z)==0)
  1824. #define __Pyx_c_conj_float(z) (conjf(z))
  1825. #if 1
  1826. #define __Pyx_c_abs_float(z) (cabsf(z))
  1827. #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
  1828. #endif
  1829. #endif
  1830. #else
  1831. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1832. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1833. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1834. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1835. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1836. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
  1837. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
  1838. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
  1839. #if 1
  1840. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
  1841. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1842. #endif
  1843. #endif
  1844. /* Arithmetic.proto */
  1845. #if CYTHON_CCOMPLEX
  1846. #define __Pyx_c_eq_double(a, b) ((a)==(b))
  1847. #define __Pyx_c_sum_double(a, b) ((a)+(b))
  1848. #define __Pyx_c_diff_double(a, b) ((a)-(b))
  1849. #define __Pyx_c_prod_double(a, b) ((a)*(b))
  1850. #define __Pyx_c_quot_double(a, b) ((a)/(b))
  1851. #define __Pyx_c_neg_double(a) (-(a))
  1852. #ifdef __cplusplus
  1853. #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
  1854. #define __Pyx_c_conj_double(z) (::std::conj(z))
  1855. #if 1
  1856. #define __Pyx_c_abs_double(z) (::std::abs(z))
  1857. #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
  1858. #endif
  1859. #else
  1860. #define __Pyx_c_is_zero_double(z) ((z)==0)
  1861. #define __Pyx_c_conj_double(z) (conj(z))
  1862. #if 1
  1863. #define __Pyx_c_abs_double(z) (cabs(z))
  1864. #define __Pyx_c_pow_double(a, b) (cpow(a, b))
  1865. #endif
  1866. #endif
  1867. #else
  1868. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1869. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1870. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1871. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1872. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1873. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
  1874. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
  1875. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
  1876. #if 1
  1877. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
  1878. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1879. #endif
  1880. #endif
  1881. /* CIntToPy.proto */
  1882. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
  1883. /* CIntFromPy.proto */
  1884. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
  1885. /* CIntFromPy.proto */
  1886. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1887. /* CIntFromPy.proto */
  1888. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1889. /* FastTypeChecks.proto */
  1890. #if CYTHON_COMPILING_IN_CPYTHON
  1891. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1892. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1893. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1894. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1895. #else
  1896. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1897. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1898. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1899. #endif
  1900. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1901. /* CStringEquals.proto */
  1902. static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);
  1903. /* CheckBinaryVersion.proto */
  1904. static int __Pyx_check_binary_version(void);
  1905. /* InitStrings.proto */
  1906. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  1907. /* Module declarations from 'libcpp.vector' */
  1908. /* Module declarations from 'libc.string' */
  1909. /* Module declarations from 'libcpp.string' */
  1910. /* Module declarations from 'libcpp.utility' */
  1911. /* Module declarations from 'libcpp.map' */
  1912. /* Module declarations from 'libcpp' */
  1913. /* Module declarations from 'libcpp.pair' */
  1914. /* Module declarations from 'libcpp.list' */
  1915. /* Module declarations from 'cpython.buffer' */
  1916. /* Module declarations from 'libc.stdio' */
  1917. /* Module declarations from '__builtin__' */
  1918. /* Module declarations from 'cpython.type' */
  1919. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1920. /* Module declarations from 'cpython.version' */
  1921. /* Module declarations from 'cpython.exc' */
  1922. /* Module declarations from 'cpython.module' */
  1923. /* Module declarations from 'cpython.mem' */
  1924. /* Module declarations from 'cpython.tuple' */
  1925. /* Module declarations from 'cpython.list' */
  1926. /* Module declarations from 'cpython.sequence' */
  1927. /* Module declarations from 'cpython.mapping' */
  1928. /* Module declarations from 'cpython.iterator' */
  1929. /* Module declarations from 'cpython.number' */
  1930. /* Module declarations from 'cpython.int' */
  1931. /* Module declarations from '__builtin__' */
  1932. /* Module declarations from 'cpython.bool' */
  1933. static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
  1934. /* Module declarations from 'cpython.long' */
  1935. /* Module declarations from 'cpython.float' */
  1936. /* Module declarations from '__builtin__' */
  1937. /* Module declarations from 'cpython.complex' */
  1938. static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
  1939. /* Module declarations from 'cpython.string' */
  1940. /* Module declarations from 'cpython.unicode' */
  1941. /* Module declarations from 'cpython.dict' */
  1942. /* Module declarations from 'cpython.instance' */
  1943. /* Module declarations from 'cpython.function' */
  1944. /* Module declarations from 'cpython.method' */
  1945. /* Module declarations from 'cpython.weakref' */
  1946. /* Module declarations from 'cpython.getargs' */
  1947. /* Module declarations from 'cpython.pythread' */
  1948. /* Module declarations from 'cpython.pystate' */
  1949. /* Module declarations from 'cpython.cobject' */
  1950. /* Module declarations from 'cpython.oldbuffer' */
  1951. /* Module declarations from 'cpython.set' */
  1952. /* Module declarations from 'cpython.bytes' */
  1953. /* Module declarations from 'cpython.pycapsule' */
  1954. /* Module declarations from 'cpython' */
  1955. /* Module declarations from 'cpython.object' */
  1956. /* Module declarations from 'cpython.ref' */
  1957. /* Module declarations from 'numpy' */
  1958. /* Module declarations from 'numpy' */
  1959. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1960. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1961. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1962. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1963. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1964. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1965. /* Module declarations from 'array' */
  1966. /* Module declarations from 'cpython.array' */
  1967. static PyTypeObject *__pyx_ptype_7cpython_5array_array = 0;
  1968. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
  1969. /* Module declarations from 'gedlibpy' */
  1970. static PyTypeObject *__pyx_ptype_8gedlibpy_GEDEnv = 0;
  1971. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
  1972. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
  1973. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
  1974. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
  1975. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
  1976. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
  1977. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &); /*proto*/
  1978. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &); /*proto*/
  1979. static std::map<std::string,std::string> __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
  1980. static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(std::map<std::string,std::string> const &); /*proto*/
  1981. static PyObject *__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > const &); /*proto*/
  1982. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(const std::vector<std::vector<size_t> > &); /*proto*/
  1983. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1984. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &); /*proto*/
  1985. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(const std::vector<std::pair<size_t,size_t> > &); /*proto*/
  1986. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &); /*proto*/
  1987. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &); /*proto*/
  1988. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(const std::vector<std::vector<npy_uint64> > &); /*proto*/
  1989. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *); /*proto*/
  1990. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *); /*proto*/
  1991. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *); /*proto*/
  1992. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &); /*proto*/
  1993. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &); /*proto*/
  1994. static std::vector<std::map<std::string,std::string> > __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(PyObject *); /*proto*/
  1995. #define __Pyx_MODULE_NAME "gedlibpy"
  1996. extern int __pyx_module_is_main_gedlibpy;
  1997. int __pyx_module_is_main_gedlibpy = 0;
  1998. /* Implementation of 'gedlibpy' */
  1999. static PyObject *__pyx_builtin_print;
  2000. static PyObject *__pyx_builtin_range;
  2001. static PyObject *__pyx_builtin_TypeError;
  2002. static PyObject *__pyx_builtin_ValueError;
  2003. static PyObject *__pyx_builtin_RuntimeError;
  2004. static PyObject *__pyx_builtin_ImportError;
  2005. static PyObject *__pyx_builtin_MemoryError;
  2006. static const char __pyx_k_[] = "";
  2007. static const char __pyx_k_g[] = "g";
  2008. static const char __pyx_k_h[] = "h";
  2009. static const char __pyx_k_g1[] = "g1";
  2010. static const char __pyx_k_g2[] = "g2";
  2011. static const char __pyx_k_id[] = "id";
  2012. static const char __pyx_k_nx[] = "nx";
  2013. static const char __pyx_k_os[] = "os";
  2014. static const char __pyx_k__20[] = "*";
  2015. static const char __pyx_k_doc[] = "__doc__";
  2016. static const char __pyx_k_key[] = "key";
  2017. static const char __pyx_k_res[] = "res";
  2018. static const char __pyx_k_cdll[] = "cdll";
  2019. static const char __pyx_k_file[] = "__file__";
  2020. static const char __pyx_k_g_id[] = "g_id";
  2021. static const char __pyx_k_h_id[] = "h_id";
  2022. static const char __pyx_k_head[] = "head";
  2023. static const char __pyx_k_init[] = "init";
  2024. static const char __pyx_k_lib1[] = "lib1";
  2025. static const char __pyx_k_lib2[] = "lib2";
  2026. static const char __pyx_k_lib3[] = "lib3";
  2027. static const char __pyx_k_lib4[] = "lib4";
  2028. static const char __pyx_k_main[] = "__main__";
  2029. static const char __pyx_k_name[] = "name";
  2030. static const char __pyx_k_path[] = "path";
  2031. static const char __pyx_k_self[] = "self";
  2032. static const char __pyx_k_tail[] = "tail";
  2033. static const char __pyx_k_test[] = "__test__";
  2034. static const char __pyx_k_Error[] = "Error";
  2035. static const char __pyx_k_Graph[] = "Graph";
  2036. static const char __pyx_k_edges[] = "edges";
  2037. static const char __pyx_k_graph[] = "graph";
  2038. static const char __pyx_k_items[] = "items";
  2039. static const char __pyx_k_map_b[] = "map_b";
  2040. static const char __pyx_k_map_u[] = "map_u";
  2041. static const char __pyx_k_nodes[] = "nodes";
  2042. static const char __pyx_k_print[] = "print";
  2043. static const char __pyx_k_range[] = "range";
  2044. static const char __pyx_k_utf_8[] = "utf-8";
  2045. static const char __pyx_k_value[] = "value";
  2046. static const char __pyx_k_GEDEnv[] = "GEDEnv";
  2047. static const char __pyx_k_classe[] = "classe";
  2048. static const char __pyx_k_ctypes[] = "ctypes";
  2049. static const char __pyx_k_decode[] = "decode";
  2050. static const char __pyx_k_encode[] = "encode";
  2051. static const char __pyx_k_import[] = "__import__";
  2052. static const char __pyx_k_init_2[] = "__init__";
  2053. static const char __pyx_k_method[] = "method";
  2054. static const char __pyx_k_module[] = "__module__";
  2055. static const char __pyx_k_name_2[] = "__name__";
  2056. static const char __pyx_k_option[] = "option";
  2057. static const char __pyx_k_reduce[] = "__reduce__";
  2058. static const char __pyx_k_classes[] = "classes";
  2059. static const char __pyx_k_dataset[] = "dataset";
  2060. static const char __pyx_k_dirname[] = "dirname";
  2061. static const char __pyx_k_message[] = "message";
  2062. static const char __pyx_k_node_id[] = "node_id";
  2063. static const char __pyx_k_options[] = "options";
  2064. static const char __pyx_k_prepare[] = "__prepare__";
  2065. static const char __pyx_k_add_edge[] = "add_edge";
  2066. static const char __pyx_k_add_node[] = "add_node";
  2067. static const char __pyx_k_gedlibpy[] = "gedlibpy";
  2068. static const char __pyx_k_getstate[] = "__getstate__";
  2069. static const char __pyx_k_graph_id[] = "graph_id";
  2070. static const char __pyx_k_networkx[] = "networkx";
  2071. static const char __pyx_k_nx_graph[] = "nx_graph";
  2072. static const char __pyx_k_path_XML[] = "path_XML";
  2073. static const char __pyx_k_qualname[] = "__qualname__";
  2074. static const char __pyx_k_realpath[] = "realpath";
  2075. static const char __pyx_k_setstate[] = "__setstate__";
  2076. static const char __pyx_k_InitError[] = "InitError";
  2077. static const char __pyx_k_TypeError[] = "TypeError";
  2078. static const char __pyx_k_add_graph[] = "add_graph";
  2079. static const char __pyx_k_adj_lists[] = "adj_lists";
  2080. static const char __pyx_k_edge_list[] = "edge_list";
  2081. static const char __pyx_k_edge_type[] = "edge_type";
  2082. static const char __pyx_k_edit_cost[] = "edit_cost";
  2083. static const char __pyx_k_graph_ids[] = "graph_ids";
  2084. static const char __pyx_k_iteritems[] = "iteritems";
  2085. static const char __pyx_k_map_edges[] = "map_edges";
  2086. static const char __pyx_k_metaclass[] = "__metaclass__";
  2087. static const char __pyx_k_node_type[] = "node_type";
  2088. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  2089. static const char __pyx_k_ValueError[] = "ValueError";
  2090. static const char __pyx_k_adj_matrix[] = "adj_matrix";
  2091. static const char __pyx_k_edge_label[] = "edge_label";
  2092. static const char __pyx_k_graph_name[] = "graph_name";
  2093. static const char __pyx_k_map_edge_b[] = "map_edge_b";
  2094. static const char __pyx_k_node_label[] = "node_label";
  2095. static const char __pyx_k_run_method[] = "run_method";
  2096. static const char __pyx_k_set_method[] = "set_method";
  2097. static const char __pyx_k_ImportError[] = "ImportError";
  2098. static const char __pyx_k_LoadLibrary[] = "LoadLibrary";
  2099. static const char __pyx_k_MemoryError[] = "MemoryError";
  2100. static const char __pyx_k_MethodError[] = "MethodError";
  2101. static const char __pyx_k_clear_graph[] = "clear_graph";
  2102. static const char __pyx_k_graph_class[] = "graph_class";
  2103. static const char __pyx_k_init_method[] = "init_method";
  2104. static const char __pyx_k_init_option[] = "init_option";
  2105. static const char __pyx_k_path_folder[] = "path_folder";
  2106. static const char __pyx_k_restart_env[] = "restart_env";
  2107. static const char __pyx_k_RuntimeError[] = "RuntimeError";
  2108. static const char __pyx_k_add_nx_graph[] = "add_nx_graph";
  2109. static const char __pyx_k_edge_label_1[] = "edge_label_1";
  2110. static const char __pyx_k_edge_label_2[] = "edge_label_2";
  2111. static const char __pyx_k_edge_label_b[] = "edge_label_b";
  2112. static const char __pyx_k_gedlibpy_pyx[] = "gedlibpy.pyx";
  2113. static const char __pyx_k_get_node_map[] = "get_node_map";
  2114. static const char __pyx_k_node_label_1[] = "node_label_1";
  2115. static const char __pyx_k_node_label_2[] = "node_label_2";
  2116. static const char __pyx_k_EditCostError[] = "EditCostError";
  2117. static const char __pyx_k_Graphs_loaded[] = "Graphs loaded ! ";
  2118. static const char __pyx_k_get_edge_data[] = "get_edge_data";
  2119. static const char __pyx_k_list_of_edges[] = "list_of_edges";
  2120. static const char __pyx_k_list_of_nodes[] = "list_of_nodes";
  2121. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  2122. static const char __pyx_k_set_edit_cost[] = "set_edit_cost";
  2123. static const char __pyx_k_get_dummy_node[] = "get_dummy_node";
  2124. static const char __pyx_k_is_initialized[] = "is_initialized";
  2125. static const char __pyx_k_decode_your_map[] = "decode_your_map";
  2126. static const char __pyx_k_encode_your_map[] = "encode_your_map";
  2127. static const char __pyx_k_get_graph_edges[] = "get_graph_edges";
  2128. static const char __pyx_k_get_upper_bound[] = "get_upper_bound";
  2129. static const char __pyx_k_load_GXL_graphs[] = "load_GXL_graphs";
  2130. static const char __pyx_k_print_to_stdout[] = "print_to_stdout";
  2131. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  2132. static const char __pyx_k_InitError___init[] = "InitError.__init__";
  2133. static const char __pyx_k_Number_of_graphs[] = "Number of graphs = ";
  2134. static const char __pyx_k_get_init_options[] = "get_init_options";
  2135. static const char __pyx_k_ignore_duplicates[] = "ignore_duplicates";
  2136. static const char __pyx_k_original_node_ids[] = "original_node_ids";
  2137. static const char __pyx_k_MethodError___init[] = "MethodError.__init__";
  2138. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  2139. static const char __pyx_k_decode_graph_edges[] = "decode_graph_edges";
  2140. static const char __pyx_k_edit_cost_constant[] = "edit_cost_constant";
  2141. static const char __pyx_k_get_method_options[] = "get_method_options";
  2142. static const char __pyx_k_get_graph_num_nodes[] = "get_graph_num_nodes";
  2143. static const char __pyx_k_EditCostError___init[] = "EditCostError.__init__";
  2144. static const char __pyx_k_list_of_init_options[] = "list_of_init_options";
  2145. static const char __pyx_k_get_edit_cost_options[] = "get_edit_cost_options";
  2146. static const char __pyx_k_get_graph_node_labels[] = "get_graph_node_labels";
  2147. static const char __pyx_k_get_original_node_ids[] = "get_original_node_ids";
  2148. static const char __pyx_k_lib_nomad_libnomad_so[] = "/lib/nomad/libnomad.so";
  2149. static const char __pyx_k_list_of_method_options[] = "list_of_method_options";
  2150. static const char __pyx_k_lib_nomad_libsgtelib_so[] = "/lib/nomad/libsgtelib.so";
  2151. static const char __pyx_k_Computation_between_graph[] = "Computation between graph ";
  2152. static const char __pyx_k_Initialization_terminated[] = "Initialization terminated !";
  2153. static const char __pyx_k_lib_fann_libdoublefann_so[] = "/lib/fann/libdoublefann.so";
  2154. static const char __pyx_k_lib_libsvm_3_22_libsvm_so[] = "/lib/libsvm.3.22/libsvm.so";
  2155. static const char __pyx_k_list_of_edit_cost_options[] = "list_of_edit_cost_options";
  2156. static const char __pyx_k_Initialization_in_progress[] = "Initialization in progress...";
  2157. static const char __pyx_k_Loading_graphs_in_progress[] = "Loading graphs in progress...";
  2158. static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  2159. static const char __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES[] = "EAGER_WITHOUT_SHUFFLED_COPIES";
  2160. static const char __pyx_k_Class_for_Edit_Cost_Error_Raise[] = "\n\t\tClass for Edit Cost Error. Raise an error if an edit cost function doesn't exist in the library (not in list_of_edit_cost_options).\n\n\t\t:attribute message: The message to print when an error is detected.\n\t\t:type message: string\n\t";
  2161. static const char __pyx_k_Class_for_Init_Error_Raise_an_e[] = "\n\t\tClass for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).\n\n\t\t:attribute message: The message to print when an error is detected.\n\t\t:type message: string\n\t";
  2162. static const char __pyx_k_Class_for_Method_Error_Raise_an[] = "\n\t\tClass for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).\n\n\t\t:attribute message: The message to print when an error is detected.\n\t\t:type message: string\n\t";
  2163. static const char __pyx_k_Class_for_error_s_management_Th[] = "\n\t\tClass for error's management. This one is general. \n\t";
  2164. static const char __pyx_k_Finish_The_return_contains_edit[] = "Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment";
  2165. static const char __pyx_k_Finish_You_can_check_the_result[] = "Finish ! You can check the result with each ID of graphs ! There are in the return";
  2166. static const char __pyx_k_Python_GedLib_module_This_modul[] = "\n\tPython GedLib module\n\t======================\n\t\n\tThis module allow to use a C++ library for edit distance between graphs (GedLib) with Python.\n\n\t\n\tAuthors\n\t-------------------\n \n\tDavid Blumenthal\n\tNatacha Lambert\n\tLinlin Jia\n\n\tCopyright (C) 2019-2020 by all the authors\n\n\tClasses & Functions\n\t-------------------\n \n";
  2167. static const char __pyx_k_This_edit_cost_function_doesn_t[] = "This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function";
  2168. static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
  2169. static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  2170. static const char __pyx_k_with_all_the_others_including_h[] = " with all the others including himself.";
  2171. static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  2172. static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  2173. static const char __pyx_k_Please_don_t_restart_the_environ[] = "Please don't restart the environment or recall this function, you will lose your results !";
  2174. static const char __pyx_k_This_init_option_doesn_t_exist_p[] = "This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.";
  2175. static const char __pyx_k_This_method_doesn_t_exist_please[] = "This method doesn't exist, please see list_of_method_options for selecting a method";
  2176. static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  2177. static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
  2178. static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
  2179. static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  2180. static PyObject *__pyx_kp_u_;
  2181. static PyObject *__pyx_kp_s_Class_for_Edit_Cost_Error_Raise;
  2182. static PyObject *__pyx_kp_s_Class_for_Init_Error_Raise_an_e;
  2183. static PyObject *__pyx_kp_s_Class_for_Method_Error_Raise_an;
  2184. static PyObject *__pyx_kp_s_Class_for_error_s_management_Th;
  2185. static PyObject *__pyx_kp_u_Computation_between_graph;
  2186. static PyObject *__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES;
  2187. static PyObject *__pyx_n_s_EditCostError;
  2188. static PyObject *__pyx_n_s_EditCostError___init;
  2189. static PyObject *__pyx_n_s_Error;
  2190. static PyObject *__pyx_kp_u_Finish_The_return_contains_edit;
  2191. static PyObject *__pyx_kp_u_Finish_You_can_check_the_result;
  2192. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  2193. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  2194. static PyObject *__pyx_n_s_GEDEnv;
  2195. static PyObject *__pyx_n_s_Graph;
  2196. static PyObject *__pyx_kp_u_Graphs_loaded;
  2197. static PyObject *__pyx_n_s_ImportError;
  2198. static PyObject *__pyx_n_s_InitError;
  2199. static PyObject *__pyx_n_s_InitError___init;
  2200. static PyObject *__pyx_kp_u_Initialization_in_progress;
  2201. static PyObject *__pyx_kp_u_Initialization_terminated;
  2202. static PyObject *__pyx_n_s_LoadLibrary;
  2203. static PyObject *__pyx_kp_u_Loading_graphs_in_progress;
  2204. static PyObject *__pyx_n_s_MemoryError;
  2205. static PyObject *__pyx_n_s_MethodError;
  2206. static PyObject *__pyx_n_s_MethodError___init;
  2207. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  2208. static PyObject *__pyx_kp_u_Number_of_graphs;
  2209. static PyObject *__pyx_kp_u_Please_don_t_restart_the_environ;
  2210. static PyObject *__pyx_n_s_RuntimeError;
  2211. static PyObject *__pyx_kp_u_This_edit_cost_function_doesn_t;
  2212. static PyObject *__pyx_kp_u_This_init_option_doesn_t_exist_p;
  2213. static PyObject *__pyx_kp_u_This_method_doesn_t_exist_please;
  2214. static PyObject *__pyx_n_s_TypeError;
  2215. static PyObject *__pyx_n_s_ValueError;
  2216. static PyObject *__pyx_n_s__20;
  2217. static PyObject *__pyx_n_s_add_edge;
  2218. static PyObject *__pyx_n_s_add_graph;
  2219. static PyObject *__pyx_n_s_add_node;
  2220. static PyObject *__pyx_n_s_add_nx_graph;
  2221. static PyObject *__pyx_n_s_adj_lists;
  2222. static PyObject *__pyx_n_s_adj_matrix;
  2223. static PyObject *__pyx_n_s_cdll;
  2224. static PyObject *__pyx_n_s_classe;
  2225. static PyObject *__pyx_n_s_classes;
  2226. static PyObject *__pyx_n_s_clear_graph;
  2227. static PyObject *__pyx_n_s_cline_in_traceback;
  2228. static PyObject *__pyx_n_s_ctypes;
  2229. static PyObject *__pyx_n_s_dataset;
  2230. static PyObject *__pyx_n_s_decode;
  2231. static PyObject *__pyx_n_s_decode_graph_edges;
  2232. static PyObject *__pyx_n_s_decode_your_map;
  2233. static PyObject *__pyx_n_s_dirname;
  2234. static PyObject *__pyx_n_s_doc;
  2235. static PyObject *__pyx_n_s_edge_label;
  2236. static PyObject *__pyx_n_s_edge_label_1;
  2237. static PyObject *__pyx_n_s_edge_label_2;
  2238. static PyObject *__pyx_n_s_edge_label_b;
  2239. static PyObject *__pyx_n_s_edge_list;
  2240. static PyObject *__pyx_n_s_edge_type;
  2241. static PyObject *__pyx_n_s_edges;
  2242. static PyObject *__pyx_n_s_edit_cost;
  2243. static PyObject *__pyx_n_s_edit_cost_constant;
  2244. static PyObject *__pyx_n_s_encode;
  2245. static PyObject *__pyx_n_s_encode_your_map;
  2246. static PyObject *__pyx_n_s_file;
  2247. static PyObject *__pyx_n_s_g;
  2248. static PyObject *__pyx_n_s_g1;
  2249. static PyObject *__pyx_n_s_g2;
  2250. static PyObject *__pyx_n_s_g_id;
  2251. static PyObject *__pyx_n_s_gedlibpy;
  2252. static PyObject *__pyx_kp_s_gedlibpy_pyx;
  2253. static PyObject *__pyx_n_s_get_dummy_node;
  2254. static PyObject *__pyx_n_s_get_edge_data;
  2255. static PyObject *__pyx_n_s_get_edit_cost_options;
  2256. static PyObject *__pyx_n_s_get_graph_edges;
  2257. static PyObject *__pyx_n_s_get_graph_node_labels;
  2258. static PyObject *__pyx_n_s_get_graph_num_nodes;
  2259. static PyObject *__pyx_n_s_get_init_options;
  2260. static PyObject *__pyx_n_s_get_method_options;
  2261. static PyObject *__pyx_n_s_get_node_map;
  2262. static PyObject *__pyx_n_s_get_original_node_ids;
  2263. static PyObject *__pyx_n_s_get_upper_bound;
  2264. static PyObject *__pyx_n_s_getstate;
  2265. static PyObject *__pyx_n_s_graph;
  2266. static PyObject *__pyx_n_s_graph_class;
  2267. static PyObject *__pyx_n_s_graph_id;
  2268. static PyObject *__pyx_n_s_graph_ids;
  2269. static PyObject *__pyx_n_s_graph_name;
  2270. static PyObject *__pyx_n_s_h;
  2271. static PyObject *__pyx_n_s_h_id;
  2272. static PyObject *__pyx_n_s_head;
  2273. static PyObject *__pyx_n_u_id;
  2274. static PyObject *__pyx_n_s_ignore_duplicates;
  2275. static PyObject *__pyx_n_s_import;
  2276. static PyObject *__pyx_n_s_init;
  2277. static PyObject *__pyx_n_s_init_2;
  2278. static PyObject *__pyx_n_s_init_method;
  2279. static PyObject *__pyx_n_s_init_option;
  2280. static PyObject *__pyx_n_s_is_initialized;
  2281. static PyObject *__pyx_n_s_items;
  2282. static PyObject *__pyx_n_s_iteritems;
  2283. static PyObject *__pyx_n_s_key;
  2284. static PyObject *__pyx_n_s_lib1;
  2285. static PyObject *__pyx_n_s_lib2;
  2286. static PyObject *__pyx_n_s_lib3;
  2287. static PyObject *__pyx_n_s_lib4;
  2288. static PyObject *__pyx_kp_u_lib_fann_libdoublefann_so;
  2289. static PyObject *__pyx_kp_u_lib_libsvm_3_22_libsvm_so;
  2290. static PyObject *__pyx_kp_u_lib_nomad_libnomad_so;
  2291. static PyObject *__pyx_kp_u_lib_nomad_libsgtelib_so;
  2292. static PyObject *__pyx_n_s_list_of_edges;
  2293. static PyObject *__pyx_n_s_list_of_edit_cost_options;
  2294. static PyObject *__pyx_n_s_list_of_init_options;
  2295. static PyObject *__pyx_n_s_list_of_method_options;
  2296. static PyObject *__pyx_n_s_list_of_nodes;
  2297. static PyObject *__pyx_n_s_load_GXL_graphs;
  2298. static PyObject *__pyx_n_s_main;
  2299. static PyObject *__pyx_n_s_map_b;
  2300. static PyObject *__pyx_n_s_map_edge_b;
  2301. static PyObject *__pyx_n_s_map_edges;
  2302. static PyObject *__pyx_n_s_map_u;
  2303. static PyObject *__pyx_n_s_message;
  2304. static PyObject *__pyx_n_s_metaclass;
  2305. static PyObject *__pyx_n_s_method;
  2306. static PyObject *__pyx_n_s_module;
  2307. static PyObject *__pyx_n_s_name;
  2308. static PyObject *__pyx_n_s_name_2;
  2309. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  2310. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  2311. static PyObject *__pyx_n_s_networkx;
  2312. static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  2313. static PyObject *__pyx_n_s_node_id;
  2314. static PyObject *__pyx_n_s_node_label;
  2315. static PyObject *__pyx_n_s_node_label_1;
  2316. static PyObject *__pyx_n_s_node_label_2;
  2317. static PyObject *__pyx_n_s_node_type;
  2318. static PyObject *__pyx_n_s_nodes;
  2319. static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
  2320. static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
  2321. static PyObject *__pyx_n_s_nx;
  2322. static PyObject *__pyx_n_s_nx_graph;
  2323. static PyObject *__pyx_n_s_option;
  2324. static PyObject *__pyx_n_s_options;
  2325. static PyObject *__pyx_n_u_original_node_ids;
  2326. static PyObject *__pyx_n_s_os;
  2327. static PyObject *__pyx_n_s_path;
  2328. static PyObject *__pyx_n_s_path_XML;
  2329. static PyObject *__pyx_n_s_path_folder;
  2330. static PyObject *__pyx_n_s_prepare;
  2331. static PyObject *__pyx_n_s_print;
  2332. static PyObject *__pyx_n_s_print_to_stdout;
  2333. static PyObject *__pyx_n_s_qualname;
  2334. static PyObject *__pyx_n_s_range;
  2335. static PyObject *__pyx_n_s_realpath;
  2336. static PyObject *__pyx_n_s_reduce;
  2337. static PyObject *__pyx_n_s_reduce_cython;
  2338. static PyObject *__pyx_n_s_reduce_ex;
  2339. static PyObject *__pyx_n_s_res;
  2340. static PyObject *__pyx_n_s_restart_env;
  2341. static PyObject *__pyx_n_s_run_method;
  2342. static PyObject *__pyx_n_s_self;
  2343. static PyObject *__pyx_n_s_set_edit_cost;
  2344. static PyObject *__pyx_n_s_set_method;
  2345. static PyObject *__pyx_n_s_setstate;
  2346. static PyObject *__pyx_n_s_setstate_cython;
  2347. static PyObject *__pyx_n_s_tail;
  2348. static PyObject *__pyx_n_s_test;
  2349. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  2350. static PyObject *__pyx_kp_u_utf_8;
  2351. static PyObject *__pyx_n_s_value;
  2352. static PyObject *__pyx_kp_u_with_all_the_others_including_h;
  2353. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2354. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2355. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2356. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2357. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2358. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2359. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2360. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2361. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_path_folder, PyObject *__pyx_v_path_XML, PyObject *__pyx_v_node_type, PyObject *__pyx_v_edge_type); /* proto */
  2362. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2363. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2364. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2365. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2366. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe); /* proto */
  2367. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_node_id, PyObject *__pyx_v_node_label); /* proto */
  2368. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_tail, PyObject *__pyx_v_head, PyObject *__pyx_v_edge_label, PyObject *__pyx_v_ignore_duplicates); /* proto */
  2369. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_tail, PyObject *__pyx_v_head, PyObject *__pyx_v_edge_label); /* proto */
  2370. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2371. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2372. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2373. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2374. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2375. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2376. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2377. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2378. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_edit_cost_constant); /* proto */
  2379. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost_constant); /* proto */
  2380. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_init_option, PyObject *__pyx_v_print_to_stdout); /* proto */
  2381. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_options); /* proto */
  2382. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2383. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2384. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2385. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2386. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2387. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2388. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2389. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h, PyObject *__pyx_v_node_id); /* proto */
  2390. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h, PyObject *__pyx_v_node_id); /* proto */
  2391. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2392. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2393. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2394. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2395. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h); /* proto */
  2396. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2397. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2398. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2399. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe, PyObject *__pyx_v_list_of_nodes, PyObject *__pyx_v_list_of_edges, PyObject *__pyx_v_ignore_duplicates); /* proto */
  2400. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_classe, PyObject *__pyx_v_ignore_duplicates); /* proto */
  2401. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g1, PyObject *__pyx_v_g2, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option); /* proto */
  2402. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_dataset, PyObject *__pyx_v_classes, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option); /* proto */
  2403. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_path_folder, PyObject *__pyx_v_path_XML, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option); /* proto */
  2404. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2405. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2406. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2407. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2408. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2409. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label_1, PyObject *__pyx_v_node_label_2); /* proto */
  2410. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2411. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2412. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels); /* proto */
  2413. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label_1, PyObject *__pyx_v_edge_label_2); /* proto */
  2414. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2415. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2416. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels); /* proto */
  2417. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, CYTHON_UNUSED PyObject *__pyx_v_adj_matrix, CYTHON_UNUSED PyObject *__pyx_v_adj_lists, CYTHON_UNUSED PyObject *__pyx_v_edge_list); /* proto */
  2418. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2419. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_nx_graph, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_graph_name, PyObject *__pyx_v_graph_class); /* proto */
  2420. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id); /* proto */
  2421. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2422. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
  2423. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2424. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2425. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2426. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u); /* proto */
  2427. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b); /* proto */
  2428. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /* proto */
  2429. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  2430. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2431. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
  2432. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2433. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  2434. static PyObject *__pyx_int_0;
  2435. static PyObject *__pyx_k__2;
  2436. static PyObject *__pyx_k__3;
  2437. static PyObject *__pyx_tuple__4;
  2438. static PyObject *__pyx_tuple__5;
  2439. static PyObject *__pyx_tuple__6;
  2440. static PyObject *__pyx_tuple__7;
  2441. static PyObject *__pyx_tuple__8;
  2442. static PyObject *__pyx_tuple__9;
  2443. static PyObject *__pyx_tuple__10;
  2444. static PyObject *__pyx_tuple__11;
  2445. static PyObject *__pyx_tuple__12;
  2446. static PyObject *__pyx_tuple__13;
  2447. static PyObject *__pyx_tuple__14;
  2448. static PyObject *__pyx_tuple__15;
  2449. static PyObject *__pyx_tuple__16;
  2450. static PyObject *__pyx_tuple__17;
  2451. static PyObject *__pyx_tuple__18;
  2452. static PyObject *__pyx_tuple__19;
  2453. static PyObject *__pyx_tuple__21;
  2454. static PyObject *__pyx_tuple__23;
  2455. static PyObject *__pyx_tuple__25;
  2456. static PyObject *__pyx_tuple__28;
  2457. static PyObject *__pyx_tuple__30;
  2458. static PyObject *__pyx_tuple__32;
  2459. static PyObject *__pyx_tuple__34;
  2460. static PyObject *__pyx_tuple__36;
  2461. static PyObject *__pyx_tuple__38;
  2462. static PyObject *__pyx_codeobj__22;
  2463. static PyObject *__pyx_codeobj__24;
  2464. static PyObject *__pyx_codeobj__26;
  2465. static PyObject *__pyx_codeobj__27;
  2466. static PyObject *__pyx_codeobj__29;
  2467. static PyObject *__pyx_codeobj__31;
  2468. static PyObject *__pyx_codeobj__33;
  2469. static PyObject *__pyx_codeobj__35;
  2470. static PyObject *__pyx_codeobj__37;
  2471. static PyObject *__pyx_codeobj__39;
  2472. /* Late includes */
  2473. /* "gedlibpy.pyx":126
  2474. *
  2475. *
  2476. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2477. * """
  2478. * Searchs the differents edit cost functions and returns the result.
  2479. */
  2480. /* Python wrapper */
  2481. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2482. static char __pyx_doc_8gedlibpy_get_edit_cost_options[] = "\n\t\tSearchs the differents edit cost functions and returns the result.\n \n\t\t:return: The list of edit cost functions\n\t\t:rtype: list[string]\n \n\t\t.. warning:: This function is useless for an external use. Please use directly list_of_edit_cost_options. \n\t\t.. note:: Prefer the list_of_edit_cost_options attribute of this module.\n\t";
  2483. static PyMethodDef __pyx_mdef_8gedlibpy_1get_edit_cost_options = {"get_edit_cost_options", (PyCFunction)__pyx_pw_8gedlibpy_1get_edit_cost_options, METH_NOARGS, __pyx_doc_8gedlibpy_get_edit_cost_options};
  2484. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2485. PyObject *__pyx_r = 0;
  2486. __Pyx_RefNannyDeclarations
  2487. __Pyx_RefNannySetupContext("get_edit_cost_options (wrapper)", 0);
  2488. __pyx_r = __pyx_pf_8gedlibpy_get_edit_cost_options(__pyx_self);
  2489. /* function exit code */
  2490. __Pyx_RefNannyFinishContext();
  2491. return __pyx_r;
  2492. }
  2493. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2494. std::string __pyx_7genexpr__pyx_v_option;
  2495. PyObject *__pyx_r = NULL;
  2496. __Pyx_RefNannyDeclarations
  2497. PyObject *__pyx_t_1 = NULL;
  2498. std::vector<std::string> __pyx_t_2;
  2499. std::vector<std::string> ::iterator __pyx_t_3;
  2500. std::vector<std::string> *__pyx_t_4;
  2501. std::string __pyx_t_5;
  2502. PyObject *__pyx_t_6 = NULL;
  2503. __Pyx_RefNannySetupContext("get_edit_cost_options", 0);
  2504. /* "gedlibpy.pyx":137
  2505. * """
  2506. *
  2507. * return [option.decode('utf-8') for option in getEditCostStringOptions()] # <<<<<<<<<<<<<<
  2508. *
  2509. *
  2510. */
  2511. __Pyx_XDECREF(__pyx_r);
  2512. { /* enter inner scope */
  2513. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 137, __pyx_L1_error)
  2514. __Pyx_GOTREF(__pyx_t_1);
  2515. try {
  2516. __pyx_t_2 = pyged::getEditCostStringOptions();
  2517. } catch(...) {
  2518. __Pyx_CppExn2PyErr();
  2519. __PYX_ERR(0, 137, __pyx_L1_error)
  2520. }
  2521. __pyx_t_4 = &__pyx_t_2;
  2522. __pyx_t_3 = __pyx_t_4->begin();
  2523. for (;;) {
  2524. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2525. __pyx_t_5 = *__pyx_t_3;
  2526. ++__pyx_t_3;
  2527. __pyx_7genexpr__pyx_v_option = __pyx_t_5;
  2528. __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_7genexpr__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
  2529. __Pyx_GOTREF(__pyx_t_6);
  2530. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 137, __pyx_L1_error)
  2531. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2532. }
  2533. } /* exit inner scope */
  2534. __pyx_r = __pyx_t_1;
  2535. __pyx_t_1 = 0;
  2536. goto __pyx_L0;
  2537. /* "gedlibpy.pyx":126
  2538. *
  2539. *
  2540. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2541. * """
  2542. * Searchs the differents edit cost functions and returns the result.
  2543. */
  2544. /* function exit code */
  2545. __pyx_L1_error:;
  2546. __Pyx_XDECREF(__pyx_t_1);
  2547. __Pyx_XDECREF(__pyx_t_6);
  2548. __Pyx_AddTraceback("gedlibpy.get_edit_cost_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2549. __pyx_r = NULL;
  2550. __pyx_L0:;
  2551. __Pyx_XGIVEREF(__pyx_r);
  2552. __Pyx_RefNannyFinishContext();
  2553. return __pyx_r;
  2554. }
  2555. /* "gedlibpy.pyx":140
  2556. *
  2557. *
  2558. * def get_method_options() : # <<<<<<<<<<<<<<
  2559. * """
  2560. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2561. */
  2562. /* Python wrapper */
  2563. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2564. static char __pyx_doc_8gedlibpy_2get_method_options[] = "\n\t\tSearchs the differents method for edit distance computation between graphs and returns the result.\n \n\t\t:return: The list of method to compute the edit distance between graphs\n\t\t:rtype: list[string]\n \n\t\t.. warning:: This function is useless for an external use. Please use directly list_of_method_options.\n\t\t.. note:: Prefer the list_of_method_options attribute of this module.\n\t";
  2565. static PyMethodDef __pyx_mdef_8gedlibpy_3get_method_options = {"get_method_options", (PyCFunction)__pyx_pw_8gedlibpy_3get_method_options, METH_NOARGS, __pyx_doc_8gedlibpy_2get_method_options};
  2566. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2567. PyObject *__pyx_r = 0;
  2568. __Pyx_RefNannyDeclarations
  2569. __Pyx_RefNannySetupContext("get_method_options (wrapper)", 0);
  2570. __pyx_r = __pyx_pf_8gedlibpy_2get_method_options(__pyx_self);
  2571. /* function exit code */
  2572. __Pyx_RefNannyFinishContext();
  2573. return __pyx_r;
  2574. }
  2575. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2576. std::string __pyx_8genexpr1__pyx_v_option;
  2577. PyObject *__pyx_r = NULL;
  2578. __Pyx_RefNannyDeclarations
  2579. PyObject *__pyx_t_1 = NULL;
  2580. std::vector<std::string> __pyx_t_2;
  2581. std::vector<std::string> ::iterator __pyx_t_3;
  2582. std::vector<std::string> *__pyx_t_4;
  2583. std::string __pyx_t_5;
  2584. PyObject *__pyx_t_6 = NULL;
  2585. __Pyx_RefNannySetupContext("get_method_options", 0);
  2586. /* "gedlibpy.pyx":150
  2587. * .. note:: Prefer the list_of_method_options attribute of this module.
  2588. * """
  2589. * return [option.decode('utf-8') for option in getMethodStringOptions()] # <<<<<<<<<<<<<<
  2590. *
  2591. *
  2592. */
  2593. __Pyx_XDECREF(__pyx_r);
  2594. { /* enter inner scope */
  2595. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
  2596. __Pyx_GOTREF(__pyx_t_1);
  2597. try {
  2598. __pyx_t_2 = pyged::getMethodStringOptions();
  2599. } catch(...) {
  2600. __Pyx_CppExn2PyErr();
  2601. __PYX_ERR(0, 150, __pyx_L1_error)
  2602. }
  2603. __pyx_t_4 = &__pyx_t_2;
  2604. __pyx_t_3 = __pyx_t_4->begin();
  2605. for (;;) {
  2606. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2607. __pyx_t_5 = *__pyx_t_3;
  2608. ++__pyx_t_3;
  2609. __pyx_8genexpr1__pyx_v_option = __pyx_t_5;
  2610. __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr1__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
  2611. __Pyx_GOTREF(__pyx_t_6);
  2612. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 150, __pyx_L1_error)
  2613. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2614. }
  2615. } /* exit inner scope */
  2616. __pyx_r = __pyx_t_1;
  2617. __pyx_t_1 = 0;
  2618. goto __pyx_L0;
  2619. /* "gedlibpy.pyx":140
  2620. *
  2621. *
  2622. * def get_method_options() : # <<<<<<<<<<<<<<
  2623. * """
  2624. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2625. */
  2626. /* function exit code */
  2627. __pyx_L1_error:;
  2628. __Pyx_XDECREF(__pyx_t_1);
  2629. __Pyx_XDECREF(__pyx_t_6);
  2630. __Pyx_AddTraceback("gedlibpy.get_method_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2631. __pyx_r = NULL;
  2632. __pyx_L0:;
  2633. __Pyx_XGIVEREF(__pyx_r);
  2634. __Pyx_RefNannyFinishContext();
  2635. return __pyx_r;
  2636. }
  2637. /* "gedlibpy.pyx":153
  2638. *
  2639. *
  2640. * def get_init_options() : # <<<<<<<<<<<<<<
  2641. * """
  2642. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2643. */
  2644. /* Python wrapper */
  2645. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2646. static char __pyx_doc_8gedlibpy_4get_init_options[] = "\n\t\tSearchs the differents initialization parameters for the environment computation for graphs and returns the result.\n \n\t\t:return: The list of options to initialize the computation environment\n\t\t:rtype: list[string]\n \n\t\t.. warning:: This function is useless for an external use. Please use directly list_of_init_options.\n\t\t.. note:: Prefer the list_of_init_options attribute of this module.\n\t";
  2647. static PyMethodDef __pyx_mdef_8gedlibpy_5get_init_options = {"get_init_options", (PyCFunction)__pyx_pw_8gedlibpy_5get_init_options, METH_NOARGS, __pyx_doc_8gedlibpy_4get_init_options};
  2648. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2649. PyObject *__pyx_r = 0;
  2650. __Pyx_RefNannyDeclarations
  2651. __Pyx_RefNannySetupContext("get_init_options (wrapper)", 0);
  2652. __pyx_r = __pyx_pf_8gedlibpy_4get_init_options(__pyx_self);
  2653. /* function exit code */
  2654. __Pyx_RefNannyFinishContext();
  2655. return __pyx_r;
  2656. }
  2657. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2658. std::string __pyx_8genexpr2__pyx_v_option;
  2659. PyObject *__pyx_r = NULL;
  2660. __Pyx_RefNannyDeclarations
  2661. PyObject *__pyx_t_1 = NULL;
  2662. std::vector<std::string> __pyx_t_2;
  2663. std::vector<std::string> ::iterator __pyx_t_3;
  2664. std::vector<std::string> *__pyx_t_4;
  2665. std::string __pyx_t_5;
  2666. PyObject *__pyx_t_6 = NULL;
  2667. __Pyx_RefNannySetupContext("get_init_options", 0);
  2668. /* "gedlibpy.pyx":163
  2669. * .. note:: Prefer the list_of_init_options attribute of this module.
  2670. * """
  2671. * return [option.decode('utf-8') for option in getInitStringOptions()] # <<<<<<<<<<<<<<
  2672. *
  2673. *
  2674. */
  2675. __Pyx_XDECREF(__pyx_r);
  2676. { /* enter inner scope */
  2677. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
  2678. __Pyx_GOTREF(__pyx_t_1);
  2679. try {
  2680. __pyx_t_2 = pyged::getInitStringOptions();
  2681. } catch(...) {
  2682. __Pyx_CppExn2PyErr();
  2683. __PYX_ERR(0, 163, __pyx_L1_error)
  2684. }
  2685. __pyx_t_4 = &__pyx_t_2;
  2686. __pyx_t_3 = __pyx_t_4->begin();
  2687. for (;;) {
  2688. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2689. __pyx_t_5 = *__pyx_t_3;
  2690. ++__pyx_t_3;
  2691. __pyx_8genexpr2__pyx_v_option = __pyx_t_5;
  2692. __pyx_t_6 = __Pyx_decode_cpp_string(__pyx_8genexpr2__pyx_v_option, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
  2693. __Pyx_GOTREF(__pyx_t_6);
  2694. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 163, __pyx_L1_error)
  2695. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2696. }
  2697. } /* exit inner scope */
  2698. __pyx_r = __pyx_t_1;
  2699. __pyx_t_1 = 0;
  2700. goto __pyx_L0;
  2701. /* "gedlibpy.pyx":153
  2702. *
  2703. *
  2704. * def get_init_options() : # <<<<<<<<<<<<<<
  2705. * """
  2706. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2707. */
  2708. /* function exit code */
  2709. __pyx_L1_error:;
  2710. __Pyx_XDECREF(__pyx_t_1);
  2711. __Pyx_XDECREF(__pyx_t_6);
  2712. __Pyx_AddTraceback("gedlibpy.get_init_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2713. __pyx_r = NULL;
  2714. __pyx_L0:;
  2715. __Pyx_XGIVEREF(__pyx_r);
  2716. __Pyx_RefNannyFinishContext();
  2717. return __pyx_r;
  2718. }
  2719. /* "gedlibpy.pyx":166
  2720. *
  2721. *
  2722. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2723. * """
  2724. * Returns the ID of a dummy node.
  2725. */
  2726. /* Python wrapper */
  2727. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2728. static char __pyx_doc_8gedlibpy_6get_dummy_node[] = "\n\t\tReturns the ID of a dummy node.\n\n\t\t:return: The ID of the dummy node (18446744073709551614 for my computer, the hugest number possible)\n\t\t:rtype: size_t\n\t\t\n\t\t.. note:: A dummy node is used when a node isn't associated to an other node.\t \n\t";
  2729. static PyMethodDef __pyx_mdef_8gedlibpy_7get_dummy_node = {"get_dummy_node", (PyCFunction)__pyx_pw_8gedlibpy_7get_dummy_node, METH_NOARGS, __pyx_doc_8gedlibpy_6get_dummy_node};
  2730. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2731. PyObject *__pyx_r = 0;
  2732. __Pyx_RefNannyDeclarations
  2733. __Pyx_RefNannySetupContext("get_dummy_node (wrapper)", 0);
  2734. __pyx_r = __pyx_pf_8gedlibpy_6get_dummy_node(__pyx_self);
  2735. /* function exit code */
  2736. __Pyx_RefNannyFinishContext();
  2737. return __pyx_r;
  2738. }
  2739. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self) {
  2740. PyObject *__pyx_r = NULL;
  2741. __Pyx_RefNannyDeclarations
  2742. size_t __pyx_t_1;
  2743. PyObject *__pyx_t_2 = NULL;
  2744. __Pyx_RefNannySetupContext("get_dummy_node", 0);
  2745. /* "gedlibpy.pyx":175
  2746. * .. note:: A dummy node is used when a node isn't associated to an other node.
  2747. * """
  2748. * return getDummyNode() # <<<<<<<<<<<<<<
  2749. *
  2750. *
  2751. */
  2752. __Pyx_XDECREF(__pyx_r);
  2753. try {
  2754. __pyx_t_1 = pyged::getDummyNode();
  2755. } catch(...) {
  2756. __Pyx_CppExn2PyErr();
  2757. __PYX_ERR(0, 175, __pyx_L1_error)
  2758. }
  2759. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
  2760. __Pyx_GOTREF(__pyx_t_2);
  2761. __pyx_r = __pyx_t_2;
  2762. __pyx_t_2 = 0;
  2763. goto __pyx_L0;
  2764. /* "gedlibpy.pyx":166
  2765. *
  2766. *
  2767. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2768. * """
  2769. * Returns the ID of a dummy node.
  2770. */
  2771. /* function exit code */
  2772. __pyx_L1_error:;
  2773. __Pyx_XDECREF(__pyx_t_2);
  2774. __Pyx_AddTraceback("gedlibpy.get_dummy_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2775. __pyx_r = NULL;
  2776. __pyx_L0:;
  2777. __Pyx_XGIVEREF(__pyx_r);
  2778. __Pyx_RefNannyFinishContext();
  2779. return __pyx_r;
  2780. }
  2781. /* "gedlibpy.pyx":185
  2782. *
  2783. *
  2784. * def __cinit__(self): # <<<<<<<<<<<<<<
  2785. * self.c_env = new PyGEDEnv()
  2786. *
  2787. */
  2788. /* Python wrapper */
  2789. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2790. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2791. int __pyx_r;
  2792. __Pyx_RefNannyDeclarations
  2793. __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  2794. if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
  2795. __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  2796. if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  2797. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv___cinit__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2798. /* function exit code */
  2799. __Pyx_RefNannyFinishContext();
  2800. return __pyx_r;
  2801. }
  2802. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2803. int __pyx_r;
  2804. __Pyx_RefNannyDeclarations
  2805. pyged::PyGEDEnv *__pyx_t_1;
  2806. __Pyx_RefNannySetupContext("__cinit__", 0);
  2807. /* "gedlibpy.pyx":186
  2808. *
  2809. * def __cinit__(self):
  2810. * self.c_env = new PyGEDEnv() # <<<<<<<<<<<<<<
  2811. *
  2812. *
  2813. */
  2814. try {
  2815. __pyx_t_1 = new pyged::PyGEDEnv();
  2816. } catch(...) {
  2817. __Pyx_CppExn2PyErr();
  2818. __PYX_ERR(0, 186, __pyx_L1_error)
  2819. }
  2820. __pyx_v_self->c_env = __pyx_t_1;
  2821. /* "gedlibpy.pyx":185
  2822. *
  2823. *
  2824. * def __cinit__(self): # <<<<<<<<<<<<<<
  2825. * self.c_env = new PyGEDEnv()
  2826. *
  2827. */
  2828. /* function exit code */
  2829. __pyx_r = 0;
  2830. goto __pyx_L0;
  2831. __pyx_L1_error:;
  2832. __Pyx_AddTraceback("gedlibpy.GEDEnv.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2833. __pyx_r = -1;
  2834. __pyx_L0:;
  2835. __Pyx_RefNannyFinishContext();
  2836. return __pyx_r;
  2837. }
  2838. /* "gedlibpy.pyx":189
  2839. *
  2840. *
  2841. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2842. * del self.c_env
  2843. *
  2844. */
  2845. /* Python wrapper */
  2846. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
  2847. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self) {
  2848. __Pyx_RefNannyDeclarations
  2849. __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  2850. __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2851. /* function exit code */
  2852. __Pyx_RefNannyFinishContext();
  2853. }
  2854. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2855. __Pyx_RefNannyDeclarations
  2856. __Pyx_RefNannySetupContext("__dealloc__", 0);
  2857. /* "gedlibpy.pyx":190
  2858. *
  2859. * def __dealloc__(self):
  2860. * del self.c_env # <<<<<<<<<<<<<<
  2861. *
  2862. *
  2863. */
  2864. delete __pyx_v_self->c_env;
  2865. /* "gedlibpy.pyx":189
  2866. *
  2867. *
  2868. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2869. * del self.c_env
  2870. *
  2871. */
  2872. /* function exit code */
  2873. __Pyx_RefNannyFinishContext();
  2874. }
  2875. /* "gedlibpy.pyx":193
  2876. *
  2877. *
  2878. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2879. * """
  2880. * Checks and returns if the computation environment is initialized or not.
  2881. */
  2882. /* Python wrapper */
  2883. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2884. static char __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized[] = "\n\t\t\tChecks and returns if the computation environment is initialized or not.\n\t \n\t\t\t:return: True if it's initialized, False otherwise\n\t\t\t:rtype: bool\n\t\t\t\n\t\t\t.. note:: This function exists for internals verifications but you can use it for your code. \n\t\t";
  2885. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2886. PyObject *__pyx_r = 0;
  2887. __Pyx_RefNannyDeclarations
  2888. __Pyx_RefNannySetupContext("is_initialized (wrapper)", 0);
  2889. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2890. /* function exit code */
  2891. __Pyx_RefNannyFinishContext();
  2892. return __pyx_r;
  2893. }
  2894. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2895. PyObject *__pyx_r = NULL;
  2896. __Pyx_RefNannyDeclarations
  2897. bool __pyx_t_1;
  2898. PyObject *__pyx_t_2 = NULL;
  2899. __Pyx_RefNannySetupContext("is_initialized", 0);
  2900. /* "gedlibpy.pyx":202
  2901. * .. note:: This function exists for internals verifications but you can use it for your code.
  2902. * """
  2903. * return self.c_env.isInitialized() # <<<<<<<<<<<<<<
  2904. *
  2905. *
  2906. */
  2907. __Pyx_XDECREF(__pyx_r);
  2908. try {
  2909. __pyx_t_1 = __pyx_v_self->c_env->isInitialized();
  2910. } catch(...) {
  2911. __Pyx_CppExn2PyErr();
  2912. __PYX_ERR(0, 202, __pyx_L1_error)
  2913. }
  2914. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 202, __pyx_L1_error)
  2915. __Pyx_GOTREF(__pyx_t_2);
  2916. __pyx_r = __pyx_t_2;
  2917. __pyx_t_2 = 0;
  2918. goto __pyx_L0;
  2919. /* "gedlibpy.pyx":193
  2920. *
  2921. *
  2922. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2923. * """
  2924. * Checks and returns if the computation environment is initialized or not.
  2925. */
  2926. /* function exit code */
  2927. __pyx_L1_error:;
  2928. __Pyx_XDECREF(__pyx_t_2);
  2929. __Pyx_AddTraceback("gedlibpy.GEDEnv.is_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2930. __pyx_r = NULL;
  2931. __pyx_L0:;
  2932. __Pyx_XGIVEREF(__pyx_r);
  2933. __Pyx_RefNannyFinishContext();
  2934. return __pyx_r;
  2935. }
  2936. /* "gedlibpy.pyx":205
  2937. *
  2938. *
  2939. * def restart_env(self) : # <<<<<<<<<<<<<<
  2940. * """
  2941. * Restarts the environment variable. All data related to it will be delete.
  2942. */
  2943. /* Python wrapper */
  2944. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2945. static char __pyx_doc_8gedlibpy_6GEDEnv_6restart_env[] = "\n\t\t\tRestarts the environment variable. All data related to it will be delete. \n\t \n\t\t\t.. warning:: This function deletes all graphs, computations and more so make sure you don't need anymore your environment. \n\t\t\t.. note:: You can now delete and add somes graphs after initialization so you can avoid this function. \n\t\t";
  2946. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2947. PyObject *__pyx_r = 0;
  2948. __Pyx_RefNannyDeclarations
  2949. __Pyx_RefNannySetupContext("restart_env (wrapper)", 0);
  2950. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_6restart_env(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2951. /* function exit code */
  2952. __Pyx_RefNannyFinishContext();
  2953. return __pyx_r;
  2954. }
  2955. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2956. PyObject *__pyx_r = NULL;
  2957. __Pyx_RefNannyDeclarations
  2958. __Pyx_RefNannySetupContext("restart_env", 0);
  2959. /* "gedlibpy.pyx":212
  2960. * .. note:: You can now delete and add somes graphs after initialization so you can avoid this function.
  2961. * """
  2962. * self.c_env.restartEnv() # <<<<<<<<<<<<<<
  2963. *
  2964. *
  2965. */
  2966. try {
  2967. __pyx_v_self->c_env->restartEnv();
  2968. } catch(...) {
  2969. __Pyx_CppExn2PyErr();
  2970. __PYX_ERR(0, 212, __pyx_L1_error)
  2971. }
  2972. /* "gedlibpy.pyx":205
  2973. *
  2974. *
  2975. * def restart_env(self) : # <<<<<<<<<<<<<<
  2976. * """
  2977. * Restarts the environment variable. All data related to it will be delete.
  2978. */
  2979. /* function exit code */
  2980. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  2981. goto __pyx_L0;
  2982. __pyx_L1_error:;
  2983. __Pyx_AddTraceback("gedlibpy.GEDEnv.restart_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2984. __pyx_r = NULL;
  2985. __pyx_L0:;
  2986. __Pyx_XGIVEREF(__pyx_r);
  2987. __Pyx_RefNannyFinishContext();
  2988. return __pyx_r;
  2989. }
  2990. /* "gedlibpy.pyx":215
  2991. *
  2992. *
  2993. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  2994. * """
  2995. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  2996. */
  2997. /* Python wrapper */
  2998. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2999. static char __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs[] = "\n\t\t\tLoads some GXL graphes on the environment which is in a same folder, and present in the XMLfile. \n\t\t\t\n\t\t\t:param path_folder: The folder's path which contains GXL graphs\n\t\t\t:param path_XML: The XML's path which indicates which graphes you want to load\n\t\t\t:param node_type: Select if nodes are labeled or unlabeled\n\t\t\t:param edge_type: Select if edges are labeled or unlabeled\n\t\t\t:type path_folder: string\n\t\t\t:type path_XML: string\n\t\t\t:type node_type: bool\n\t\t\t:type edge_type: bool\n\n\t \n\t\t\t.. note:: You can call this function multiple times if you want, but not after an init call. \n\t\t";
  3000. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3001. PyObject *__pyx_v_path_folder = 0;
  3002. PyObject *__pyx_v_path_XML = 0;
  3003. PyObject *__pyx_v_node_type = 0;
  3004. PyObject *__pyx_v_edge_type = 0;
  3005. PyObject *__pyx_r = 0;
  3006. __Pyx_RefNannyDeclarations
  3007. __Pyx_RefNannySetupContext("load_GXL_graphs (wrapper)", 0);
  3008. {
  3009. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path_folder,&__pyx_n_s_path_XML,&__pyx_n_s_node_type,&__pyx_n_s_edge_type,0};
  3010. PyObject* values[4] = {0,0,0,0};
  3011. if (unlikely(__pyx_kwds)) {
  3012. Py_ssize_t kw_args;
  3013. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3014. switch (pos_args) {
  3015. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3016. CYTHON_FALLTHROUGH;
  3017. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3018. CYTHON_FALLTHROUGH;
  3019. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3020. CYTHON_FALLTHROUGH;
  3021. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3022. CYTHON_FALLTHROUGH;
  3023. case 0: break;
  3024. default: goto __pyx_L5_argtuple_error;
  3025. }
  3026. kw_args = PyDict_Size(__pyx_kwds);
  3027. switch (pos_args) {
  3028. case 0:
  3029. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  3030. else goto __pyx_L5_argtuple_error;
  3031. CYTHON_FALLTHROUGH;
  3032. case 1:
  3033. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  3034. else {
  3035. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 215, __pyx_L3_error)
  3036. }
  3037. CYTHON_FALLTHROUGH;
  3038. case 2:
  3039. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_type)) != 0)) kw_args--;
  3040. else {
  3041. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 215, __pyx_L3_error)
  3042. }
  3043. CYTHON_FALLTHROUGH;
  3044. case 3:
  3045. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_type)) != 0)) kw_args--;
  3046. else {
  3047. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 215, __pyx_L3_error)
  3048. }
  3049. }
  3050. if (unlikely(kw_args > 0)) {
  3051. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 215, __pyx_L3_error)
  3052. }
  3053. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  3054. goto __pyx_L5_argtuple_error;
  3055. } else {
  3056. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3057. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3058. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3059. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3060. }
  3061. __pyx_v_path_folder = values[0];
  3062. __pyx_v_path_XML = values[1];
  3063. __pyx_v_node_type = values[2];
  3064. __pyx_v_edge_type = values[3];
  3065. }
  3066. goto __pyx_L4_argument_unpacking_done;
  3067. __pyx_L5_argtuple_error:;
  3068. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 215, __pyx_L3_error)
  3069. __pyx_L3_error:;
  3070. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3071. __Pyx_RefNannyFinishContext();
  3072. return NULL;
  3073. __pyx_L4_argument_unpacking_done:;
  3074. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_path_folder, __pyx_v_path_XML, __pyx_v_node_type, __pyx_v_edge_type);
  3075. /* function exit code */
  3076. __Pyx_RefNannyFinishContext();
  3077. return __pyx_r;
  3078. }
  3079. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_8load_GXL_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_path_folder, PyObject *__pyx_v_path_XML, PyObject *__pyx_v_node_type, PyObject *__pyx_v_edge_type) {
  3080. PyObject *__pyx_r = NULL;
  3081. __Pyx_RefNannyDeclarations
  3082. PyObject *__pyx_t_1 = NULL;
  3083. PyObject *__pyx_t_2 = NULL;
  3084. PyObject *__pyx_t_3 = NULL;
  3085. std::string __pyx_t_4;
  3086. std::string __pyx_t_5;
  3087. bool __pyx_t_6;
  3088. bool __pyx_t_7;
  3089. __Pyx_RefNannySetupContext("load_GXL_graphs", 0);
  3090. /* "gedlibpy.pyx":231
  3091. * .. note:: You can call this function multiple times if you want, but not after an init call.
  3092. * """
  3093. * self.c_env.loadGXLGraph(path_folder.encode('utf-8'), path_XML.encode('utf-8'), node_type, edge_type) # <<<<<<<<<<<<<<
  3094. *
  3095. *
  3096. */
  3097. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_folder, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  3098. __Pyx_GOTREF(__pyx_t_2);
  3099. __pyx_t_3 = NULL;
  3100. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3101. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3102. if (likely(__pyx_t_3)) {
  3103. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3104. __Pyx_INCREF(__pyx_t_3);
  3105. __Pyx_INCREF(function);
  3106. __Pyx_DECREF_SET(__pyx_t_2, function);
  3107. }
  3108. }
  3109. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  3110. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3111. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  3112. __Pyx_GOTREF(__pyx_t_1);
  3113. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3114. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  3115. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3116. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_XML, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 231, __pyx_L1_error)
  3117. __Pyx_GOTREF(__pyx_t_2);
  3118. __pyx_t_3 = NULL;
  3119. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3120. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3121. if (likely(__pyx_t_3)) {
  3122. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3123. __Pyx_INCREF(__pyx_t_3);
  3124. __Pyx_INCREF(function);
  3125. __Pyx_DECREF_SET(__pyx_t_2, function);
  3126. }
  3127. }
  3128. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  3129. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3130. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
  3131. __Pyx_GOTREF(__pyx_t_1);
  3132. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3133. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  3134. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3135. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_node_type); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  3136. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_edge_type); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 231, __pyx_L1_error)
  3137. try {
  3138. __pyx_v_self->c_env->loadGXLGraph(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
  3139. } catch(...) {
  3140. __Pyx_CppExn2PyErr();
  3141. __PYX_ERR(0, 231, __pyx_L1_error)
  3142. }
  3143. /* "gedlibpy.pyx":215
  3144. *
  3145. *
  3146. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3147. * """
  3148. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3149. */
  3150. /* function exit code */
  3151. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3152. goto __pyx_L0;
  3153. __pyx_L1_error:;
  3154. __Pyx_XDECREF(__pyx_t_1);
  3155. __Pyx_XDECREF(__pyx_t_2);
  3156. __Pyx_XDECREF(__pyx_t_3);
  3157. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3158. __pyx_r = NULL;
  3159. __pyx_L0:;
  3160. __Pyx_XGIVEREF(__pyx_r);
  3161. __Pyx_RefNannyFinishContext();
  3162. return __pyx_r;
  3163. }
  3164. /* "gedlibpy.pyx":234
  3165. *
  3166. *
  3167. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3168. * """
  3169. * Searchs the first and last IDs of the loaded graphs in the environment.
  3170. */
  3171. /* Python wrapper */
  3172. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3173. static char __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids[] = "\n\t\t\tSearchs the first and last IDs of the loaded graphs in the environment. \n\t \n\t\t\t:return: The pair of the first and the last graphs Ids\n\t\t\t:rtype: tuple(size_t, size_t)\n\t\t\t\n\t\t\t.. note:: Prefer this function if you have huges structures with lots of graphs. \n\t\t";
  3174. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3175. PyObject *__pyx_r = 0;
  3176. __Pyx_RefNannyDeclarations
  3177. __Pyx_RefNannySetupContext("graph_ids (wrapper)", 0);
  3178. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3179. /* function exit code */
  3180. __Pyx_RefNannyFinishContext();
  3181. return __pyx_r;
  3182. }
  3183. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3184. PyObject *__pyx_r = NULL;
  3185. __Pyx_RefNannyDeclarations
  3186. std::pair<size_t,size_t> __pyx_t_1;
  3187. PyObject *__pyx_t_2 = NULL;
  3188. __Pyx_RefNannySetupContext("graph_ids", 0);
  3189. /* "gedlibpy.pyx":243
  3190. * .. note:: Prefer this function if you have huges structures with lots of graphs.
  3191. * """
  3192. * return self.c_env.getGraphIds() # <<<<<<<<<<<<<<
  3193. *
  3194. *
  3195. */
  3196. __Pyx_XDECREF(__pyx_r);
  3197. try {
  3198. __pyx_t_1 = __pyx_v_self->c_env->getGraphIds();
  3199. } catch(...) {
  3200. __Pyx_CppExn2PyErr();
  3201. __PYX_ERR(0, 243, __pyx_L1_error)
  3202. }
  3203. __pyx_t_2 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 243, __pyx_L1_error)
  3204. __Pyx_GOTREF(__pyx_t_2);
  3205. __pyx_r = __pyx_t_2;
  3206. __pyx_t_2 = 0;
  3207. goto __pyx_L0;
  3208. /* "gedlibpy.pyx":234
  3209. *
  3210. *
  3211. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3212. * """
  3213. * Searchs the first and last IDs of the loaded graphs in the environment.
  3214. */
  3215. /* function exit code */
  3216. __pyx_L1_error:;
  3217. __Pyx_XDECREF(__pyx_t_2);
  3218. __Pyx_AddTraceback("gedlibpy.GEDEnv.graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3219. __pyx_r = NULL;
  3220. __pyx_L0:;
  3221. __Pyx_XGIVEREF(__pyx_r);
  3222. __Pyx_RefNannyFinishContext();
  3223. return __pyx_r;
  3224. }
  3225. /* "gedlibpy.pyx":246
  3226. *
  3227. *
  3228. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3229. * """
  3230. * Searchs all the IDs of the loaded graphs in the environment.
  3231. */
  3232. /* Python wrapper */
  3233. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3234. static char __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids[] = "\n\t\t\tSearchs all the IDs of the loaded graphs in the environment. \n\t \n\t\t\t:return: The list of all graphs's Ids \n\t\t\t:rtype: list[size_t]\n\t\t\t\n\t\t\t.. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order. \n\t\t";
  3235. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3236. PyObject *__pyx_r = 0;
  3237. __Pyx_RefNannyDeclarations
  3238. __Pyx_RefNannySetupContext("get_all_graph_ids (wrapper)", 0);
  3239. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3240. /* function exit code */
  3241. __Pyx_RefNannyFinishContext();
  3242. return __pyx_r;
  3243. }
  3244. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3245. PyObject *__pyx_r = NULL;
  3246. __Pyx_RefNannyDeclarations
  3247. std::vector<size_t> __pyx_t_1;
  3248. PyObject *__pyx_t_2 = NULL;
  3249. __Pyx_RefNannySetupContext("get_all_graph_ids", 0);
  3250. /* "gedlibpy.pyx":255
  3251. * .. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order.
  3252. * """
  3253. * return self.c_env.getAllGraphIds() # <<<<<<<<<<<<<<
  3254. *
  3255. *
  3256. */
  3257. __Pyx_XDECREF(__pyx_r);
  3258. try {
  3259. __pyx_t_1 = __pyx_v_self->c_env->getAllGraphIds();
  3260. } catch(...) {
  3261. __Pyx_CppExn2PyErr();
  3262. __PYX_ERR(0, 255, __pyx_L1_error)
  3263. }
  3264. __pyx_t_2 = __pyx_convert_vector_to_py_size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
  3265. __Pyx_GOTREF(__pyx_t_2);
  3266. __pyx_r = __pyx_t_2;
  3267. __pyx_t_2 = 0;
  3268. goto __pyx_L0;
  3269. /* "gedlibpy.pyx":246
  3270. *
  3271. *
  3272. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3273. * """
  3274. * Searchs all the IDs of the loaded graphs in the environment.
  3275. */
  3276. /* function exit code */
  3277. __pyx_L1_error:;
  3278. __Pyx_XDECREF(__pyx_t_2);
  3279. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3280. __pyx_r = NULL;
  3281. __pyx_L0:;
  3282. __Pyx_XGIVEREF(__pyx_r);
  3283. __Pyx_RefNannyFinishContext();
  3284. return __pyx_r;
  3285. }
  3286. /* "gedlibpy.pyx":258
  3287. *
  3288. *
  3289. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3290. * """
  3291. * Returns the class of a graph with its ID.
  3292. */
  3293. /* Python wrapper */
  3294. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3295. static char __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class[] = "\n\t\t\tReturns the class of a graph with its ID.\n\t\n\t\t\t:param id: The ID of the wanted graph\n\t\t\t:type id: size_t\n\t\t\t:return: The class of the graph which correpond to the ID\n\t\t\t:rtype: string\n\t\t\t\n\t\t\t.. seealso:: get_graph_class()\n\t\t\t.. note:: An empty string can be a class. \n\t\t";
  3296. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3297. PyObject *__pyx_r = 0;
  3298. __Pyx_RefNannyDeclarations
  3299. __Pyx_RefNannySetupContext("get_graph_class (wrapper)", 0);
  3300. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3301. /* function exit code */
  3302. __Pyx_RefNannyFinishContext();
  3303. return __pyx_r;
  3304. }
  3305. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3306. PyObject *__pyx_r = NULL;
  3307. __Pyx_RefNannyDeclarations
  3308. size_t __pyx_t_1;
  3309. std::string __pyx_t_2;
  3310. PyObject *__pyx_t_3 = NULL;
  3311. __Pyx_RefNannySetupContext("get_graph_class", 0);
  3312. /* "gedlibpy.pyx":270
  3313. * .. note:: An empty string can be a class.
  3314. * """
  3315. * return self.c_env.getGraphClass(id) # <<<<<<<<<<<<<<
  3316. *
  3317. *
  3318. */
  3319. __Pyx_XDECREF(__pyx_r);
  3320. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 270, __pyx_L1_error)
  3321. try {
  3322. __pyx_t_2 = __pyx_v_self->c_env->getGraphClass(__pyx_t_1);
  3323. } catch(...) {
  3324. __Pyx_CppExn2PyErr();
  3325. __PYX_ERR(0, 270, __pyx_L1_error)
  3326. }
  3327. __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 270, __pyx_L1_error)
  3328. __Pyx_GOTREF(__pyx_t_3);
  3329. __pyx_r = __pyx_t_3;
  3330. __pyx_t_3 = 0;
  3331. goto __pyx_L0;
  3332. /* "gedlibpy.pyx":258
  3333. *
  3334. *
  3335. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3336. * """
  3337. * Returns the class of a graph with its ID.
  3338. */
  3339. /* function exit code */
  3340. __pyx_L1_error:;
  3341. __Pyx_XDECREF(__pyx_t_3);
  3342. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3343. __pyx_r = NULL;
  3344. __pyx_L0:;
  3345. __Pyx_XGIVEREF(__pyx_r);
  3346. __Pyx_RefNannyFinishContext();
  3347. return __pyx_r;
  3348. }
  3349. /* "gedlibpy.pyx":273
  3350. *
  3351. *
  3352. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3353. * """
  3354. * Returns the name of a graph with its ID.
  3355. */
  3356. /* Python wrapper */
  3357. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3358. static char __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name[] = "\n\t\t\tReturns the name of a graph with its ID. \n\t\n\t\t\t:param id: The ID of the wanted graph\n\t\t\t:type id: size_t\n\t\t\t:return: The name of the graph which correpond to the ID\n\t\t\t:rtype: string\n\t\t\t\n\t\t\t.. seealso:: get_graph_class()\n\t\t\t.. note:: An empty string can be a name. \n\t\t";
  3359. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3360. PyObject *__pyx_r = 0;
  3361. __Pyx_RefNannyDeclarations
  3362. __Pyx_RefNannySetupContext("get_graph_name (wrapper)", 0);
  3363. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3364. /* function exit code */
  3365. __Pyx_RefNannyFinishContext();
  3366. return __pyx_r;
  3367. }
  3368. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3369. PyObject *__pyx_r = NULL;
  3370. __Pyx_RefNannyDeclarations
  3371. size_t __pyx_t_1;
  3372. std::string __pyx_t_2;
  3373. PyObject *__pyx_t_3 = NULL;
  3374. __Pyx_RefNannySetupContext("get_graph_name", 0);
  3375. /* "gedlibpy.pyx":285
  3376. * .. note:: An empty string can be a name.
  3377. * """
  3378. * return self.c_env.getGraphName(id).decode('utf-8') # <<<<<<<<<<<<<<
  3379. *
  3380. *
  3381. */
  3382. __Pyx_XDECREF(__pyx_r);
  3383. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 285, __pyx_L1_error)
  3384. try {
  3385. __pyx_t_2 = __pyx_v_self->c_env->getGraphName(__pyx_t_1);
  3386. } catch(...) {
  3387. __Pyx_CppExn2PyErr();
  3388. __PYX_ERR(0, 285, __pyx_L1_error)
  3389. }
  3390. __pyx_t_3 = __Pyx_decode_cpp_string(__pyx_t_2, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 285, __pyx_L1_error)
  3391. __Pyx_GOTREF(__pyx_t_3);
  3392. __pyx_r = __pyx_t_3;
  3393. __pyx_t_3 = 0;
  3394. goto __pyx_L0;
  3395. /* "gedlibpy.pyx":273
  3396. *
  3397. *
  3398. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3399. * """
  3400. * Returns the name of a graph with its ID.
  3401. */
  3402. /* function exit code */
  3403. __pyx_L1_error:;
  3404. __Pyx_XDECREF(__pyx_t_3);
  3405. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3406. __pyx_r = NULL;
  3407. __pyx_L0:;
  3408. __Pyx_XGIVEREF(__pyx_r);
  3409. __Pyx_RefNannyFinishContext();
  3410. return __pyx_r;
  3411. }
  3412. /* "gedlibpy.pyx":288
  3413. *
  3414. *
  3415. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3416. * """
  3417. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3418. */
  3419. /* Python wrapper */
  3420. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3421. static char __pyx_doc_8gedlibpy_6GEDEnv_18add_graph[] = "\n\t\t\tAdds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time. \n\t\n\t\t\t:param name: The name of the new graph, an empty string by default\n\t\t\t:param classe: The class of the new graph, an empty string by default\n\t\t\t:type name: string\n\t\t\t:type classe: string\n\t\t\t:return: The ID of the newly graphe\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso::add_node(), add_edge() , add_symmetrical_edge()\n\t\t\t.. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications. \n\t\t";
  3422. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3423. PyObject *__pyx_v_name = 0;
  3424. PyObject *__pyx_v_classe = 0;
  3425. PyObject *__pyx_r = 0;
  3426. __Pyx_RefNannyDeclarations
  3427. __Pyx_RefNannySetupContext("add_graph (wrapper)", 0);
  3428. {
  3429. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_classe,0};
  3430. PyObject* values[2] = {0,0};
  3431. values[0] = ((PyObject *)__pyx_kp_u_);
  3432. values[1] = ((PyObject *)__pyx_kp_u_);
  3433. if (unlikely(__pyx_kwds)) {
  3434. Py_ssize_t kw_args;
  3435. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3436. switch (pos_args) {
  3437. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3438. CYTHON_FALLTHROUGH;
  3439. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3440. CYTHON_FALLTHROUGH;
  3441. case 0: break;
  3442. default: goto __pyx_L5_argtuple_error;
  3443. }
  3444. kw_args = PyDict_Size(__pyx_kwds);
  3445. switch (pos_args) {
  3446. case 0:
  3447. if (kw_args > 0) {
  3448. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
  3449. if (value) { values[0] = value; kw_args--; }
  3450. }
  3451. CYTHON_FALLTHROUGH;
  3452. case 1:
  3453. if (kw_args > 0) {
  3454. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe);
  3455. if (value) { values[1] = value; kw_args--; }
  3456. }
  3457. }
  3458. if (unlikely(kw_args > 0)) {
  3459. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 288, __pyx_L3_error)
  3460. }
  3461. } else {
  3462. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3463. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3464. CYTHON_FALLTHROUGH;
  3465. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3466. CYTHON_FALLTHROUGH;
  3467. case 0: break;
  3468. default: goto __pyx_L5_argtuple_error;
  3469. }
  3470. }
  3471. __pyx_v_name = values[0];
  3472. __pyx_v_classe = values[1];
  3473. }
  3474. goto __pyx_L4_argument_unpacking_done;
  3475. __pyx_L5_argtuple_error:;
  3476. __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 288, __pyx_L3_error)
  3477. __pyx_L3_error:;
  3478. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3479. __Pyx_RefNannyFinishContext();
  3480. return NULL;
  3481. __pyx_L4_argument_unpacking_done:;
  3482. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_18add_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_name, __pyx_v_classe);
  3483. /* function exit code */
  3484. __Pyx_RefNannyFinishContext();
  3485. return __pyx_r;
  3486. }
  3487. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe) {
  3488. PyObject *__pyx_r = NULL;
  3489. __Pyx_RefNannyDeclarations
  3490. PyObject *__pyx_t_1 = NULL;
  3491. PyObject *__pyx_t_2 = NULL;
  3492. PyObject *__pyx_t_3 = NULL;
  3493. std::string __pyx_t_4;
  3494. std::string __pyx_t_5;
  3495. size_t __pyx_t_6;
  3496. __Pyx_RefNannySetupContext("add_graph", 0);
  3497. /* "gedlibpy.pyx":302
  3498. * .. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications.
  3499. * """
  3500. * return self.c_env.addGraph(name.encode('utf-8'), classe.encode('utf-8')) # <<<<<<<<<<<<<<
  3501. *
  3502. *
  3503. */
  3504. __Pyx_XDECREF(__pyx_r);
  3505. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
  3506. __Pyx_GOTREF(__pyx_t_2);
  3507. __pyx_t_3 = NULL;
  3508. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3509. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3510. if (likely(__pyx_t_3)) {
  3511. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3512. __Pyx_INCREF(__pyx_t_3);
  3513. __Pyx_INCREF(function);
  3514. __Pyx_DECREF_SET(__pyx_t_2, function);
  3515. }
  3516. }
  3517. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  3518. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3519. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  3520. __Pyx_GOTREF(__pyx_t_1);
  3521. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3522. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error)
  3523. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3524. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_classe, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 302, __pyx_L1_error)
  3525. __Pyx_GOTREF(__pyx_t_2);
  3526. __pyx_t_3 = NULL;
  3527. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3528. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3529. if (likely(__pyx_t_3)) {
  3530. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3531. __Pyx_INCREF(__pyx_t_3);
  3532. __Pyx_INCREF(function);
  3533. __Pyx_DECREF_SET(__pyx_t_2, function);
  3534. }
  3535. }
  3536. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  3537. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3538. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  3539. __Pyx_GOTREF(__pyx_t_1);
  3540. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3541. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 302, __pyx_L1_error)
  3542. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3543. try {
  3544. __pyx_t_6 = __pyx_v_self->c_env->addGraph(__pyx_t_4, __pyx_t_5);
  3545. } catch(...) {
  3546. __Pyx_CppExn2PyErr();
  3547. __PYX_ERR(0, 302, __pyx_L1_error)
  3548. }
  3549. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 302, __pyx_L1_error)
  3550. __Pyx_GOTREF(__pyx_t_1);
  3551. __pyx_r = __pyx_t_1;
  3552. __pyx_t_1 = 0;
  3553. goto __pyx_L0;
  3554. /* "gedlibpy.pyx":288
  3555. *
  3556. *
  3557. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3558. * """
  3559. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3560. */
  3561. /* function exit code */
  3562. __pyx_L1_error:;
  3563. __Pyx_XDECREF(__pyx_t_1);
  3564. __Pyx_XDECREF(__pyx_t_2);
  3565. __Pyx_XDECREF(__pyx_t_3);
  3566. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3567. __pyx_r = NULL;
  3568. __pyx_L0:;
  3569. __Pyx_XGIVEREF(__pyx_r);
  3570. __Pyx_RefNannyFinishContext();
  3571. return __pyx_r;
  3572. }
  3573. /* "gedlibpy.pyx":305
  3574. *
  3575. *
  3576. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3577. * """
  3578. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3579. */
  3580. /* Python wrapper */
  3581. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3582. static char __pyx_doc_8gedlibpy_6GEDEnv_20add_node[] = "\n\t\t\tAdds a node on a graph selected by its ID. A ID and a label for the node is required. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:param node_id: The ID of the new node\n\t\t\t:param node_label: The label of the new node\n\t\t\t:type graph_id: size_t\n\t\t\t:type node_id: string\n\t\t\t:type node_label: dict{string : string}\n\t\t\t\n\t\t\t.. seealso:: add_graph(), add_edge(), add_symmetrical_edge()\n\t\t\t.. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. \n\t\t";
  3583. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3584. PyObject *__pyx_v_graph_id = 0;
  3585. PyObject *__pyx_v_node_id = 0;
  3586. PyObject *__pyx_v_node_label = 0;
  3587. PyObject *__pyx_r = 0;
  3588. __Pyx_RefNannyDeclarations
  3589. __Pyx_RefNannySetupContext("add_node (wrapper)", 0);
  3590. {
  3591. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_node_id,&__pyx_n_s_node_label,0};
  3592. PyObject* values[3] = {0,0,0};
  3593. if (unlikely(__pyx_kwds)) {
  3594. Py_ssize_t kw_args;
  3595. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3596. switch (pos_args) {
  3597. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3598. CYTHON_FALLTHROUGH;
  3599. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3600. CYTHON_FALLTHROUGH;
  3601. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3602. CYTHON_FALLTHROUGH;
  3603. case 0: break;
  3604. default: goto __pyx_L5_argtuple_error;
  3605. }
  3606. kw_args = PyDict_Size(__pyx_kwds);
  3607. switch (pos_args) {
  3608. case 0:
  3609. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3610. else goto __pyx_L5_argtuple_error;
  3611. CYTHON_FALLTHROUGH;
  3612. case 1:
  3613. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  3614. else {
  3615. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 305, __pyx_L3_error)
  3616. }
  3617. CYTHON_FALLTHROUGH;
  3618. case 2:
  3619. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label)) != 0)) kw_args--;
  3620. else {
  3621. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 305, __pyx_L3_error)
  3622. }
  3623. }
  3624. if (unlikely(kw_args > 0)) {
  3625. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 305, __pyx_L3_error)
  3626. }
  3627. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  3628. goto __pyx_L5_argtuple_error;
  3629. } else {
  3630. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3631. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3632. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3633. }
  3634. __pyx_v_graph_id = values[0];
  3635. __pyx_v_node_id = values[1];
  3636. __pyx_v_node_label = values[2];
  3637. }
  3638. goto __pyx_L4_argument_unpacking_done;
  3639. __pyx_L5_argtuple_error:;
  3640. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 305, __pyx_L3_error)
  3641. __pyx_L3_error:;
  3642. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3643. __Pyx_RefNannyFinishContext();
  3644. return NULL;
  3645. __pyx_L4_argument_unpacking_done:;
  3646. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_20add_node(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_graph_id, __pyx_v_node_id, __pyx_v_node_label);
  3647. /* function exit code */
  3648. __Pyx_RefNannyFinishContext();
  3649. return __pyx_r;
  3650. }
  3651. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_20add_node(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_node_id, PyObject *__pyx_v_node_label) {
  3652. PyObject *__pyx_r = NULL;
  3653. __Pyx_RefNannyDeclarations
  3654. size_t __pyx_t_1;
  3655. PyObject *__pyx_t_2 = NULL;
  3656. PyObject *__pyx_t_3 = NULL;
  3657. PyObject *__pyx_t_4 = NULL;
  3658. std::string __pyx_t_5;
  3659. std::map<std::string,std::string> __pyx_t_6;
  3660. __Pyx_RefNannySetupContext("add_node", 0);
  3661. /* "gedlibpy.pyx":319
  3662. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3663. * """
  3664. * self.c_env.addNode(graph_id, node_id.encode('utf-8'), encode_your_map(node_label)) # <<<<<<<<<<<<<<
  3665. *
  3666. *
  3667. */
  3668. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error)
  3669. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
  3670. __Pyx_GOTREF(__pyx_t_3);
  3671. __pyx_t_4 = NULL;
  3672. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3673. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3674. if (likely(__pyx_t_4)) {
  3675. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3676. __Pyx_INCREF(__pyx_t_4);
  3677. __Pyx_INCREF(function);
  3678. __Pyx_DECREF_SET(__pyx_t_3, function);
  3679. }
  3680. }
  3681. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8);
  3682. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3683. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
  3684. __Pyx_GOTREF(__pyx_t_2);
  3685. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3686. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error)
  3687. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3688. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 319, __pyx_L1_error)
  3689. __Pyx_GOTREF(__pyx_t_3);
  3690. __pyx_t_4 = NULL;
  3691. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3692. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3693. if (likely(__pyx_t_4)) {
  3694. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3695. __Pyx_INCREF(__pyx_t_4);
  3696. __Pyx_INCREF(function);
  3697. __Pyx_DECREF_SET(__pyx_t_3, function);
  3698. }
  3699. }
  3700. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_node_label);
  3701. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3702. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 319, __pyx_L1_error)
  3703. __Pyx_GOTREF(__pyx_t_2);
  3704. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3705. __pyx_t_6 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error)
  3706. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3707. try {
  3708. __pyx_v_self->c_env->addNode(__pyx_t_1, __pyx_t_5, __pyx_t_6);
  3709. } catch(...) {
  3710. __Pyx_CppExn2PyErr();
  3711. __PYX_ERR(0, 319, __pyx_L1_error)
  3712. }
  3713. /* "gedlibpy.pyx":305
  3714. *
  3715. *
  3716. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3717. * """
  3718. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3719. */
  3720. /* function exit code */
  3721. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3722. goto __pyx_L0;
  3723. __pyx_L1_error:;
  3724. __Pyx_XDECREF(__pyx_t_2);
  3725. __Pyx_XDECREF(__pyx_t_3);
  3726. __Pyx_XDECREF(__pyx_t_4);
  3727. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3728. __pyx_r = NULL;
  3729. __pyx_L0:;
  3730. __Pyx_XGIVEREF(__pyx_r);
  3731. __Pyx_RefNannyFinishContext();
  3732. return __pyx_r;
  3733. }
  3734. /* "gedlibpy.pyx":322
  3735. *
  3736. *
  3737. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3738. * """
  3739. * Adds an edge on a graph selected by its ID.
  3740. */
  3741. /* Python wrapper */
  3742. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3743. static char __pyx_doc_8gedlibpy_6GEDEnv_22add_edge[] = "\n\t\t\tAdds an edge on a graph selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:param tail: The ID of the tail node for the new edge\n\t\t\t:param head: The ID of the head node for the new edge\n\t\t\t:param edge_label: The label of the new edge\n\t\t\t:param ignore_duplicates: If True, duplicate edges are ignored, otherwise it's raise an error if an existing edge is added. True by default\n\t\t\t:type graph_id: size_t\n\t\t\t:type tail: string\n\t\t\t:type head: string\n\t\t\t:type edge_label: dict{string : string}\n\t\t\t:type ignore_duplicates: bool\n\t\t\t\n\t\t\t.. seealso:: add_graph(), add_node(), add_symmetrical_edge()\n\t\t\t.. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. \n\t\t";
  3744. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3745. PyObject *__pyx_v_graph_id = 0;
  3746. PyObject *__pyx_v_tail = 0;
  3747. PyObject *__pyx_v_head = 0;
  3748. PyObject *__pyx_v_edge_label = 0;
  3749. PyObject *__pyx_v_ignore_duplicates = 0;
  3750. PyObject *__pyx_r = 0;
  3751. __Pyx_RefNannyDeclarations
  3752. __Pyx_RefNannySetupContext("add_edge (wrapper)", 0);
  3753. {
  3754. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_tail,&__pyx_n_s_head,&__pyx_n_s_edge_label,&__pyx_n_s_ignore_duplicates,0};
  3755. PyObject* values[5] = {0,0,0,0,0};
  3756. values[4] = ((PyObject *)Py_True);
  3757. if (unlikely(__pyx_kwds)) {
  3758. Py_ssize_t kw_args;
  3759. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3760. switch (pos_args) {
  3761. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3762. CYTHON_FALLTHROUGH;
  3763. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3764. CYTHON_FALLTHROUGH;
  3765. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3766. CYTHON_FALLTHROUGH;
  3767. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3768. CYTHON_FALLTHROUGH;
  3769. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3770. CYTHON_FALLTHROUGH;
  3771. case 0: break;
  3772. default: goto __pyx_L5_argtuple_error;
  3773. }
  3774. kw_args = PyDict_Size(__pyx_kwds);
  3775. switch (pos_args) {
  3776. case 0:
  3777. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3778. else goto __pyx_L5_argtuple_error;
  3779. CYTHON_FALLTHROUGH;
  3780. case 1:
  3781. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  3782. else {
  3783. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 322, __pyx_L3_error)
  3784. }
  3785. CYTHON_FALLTHROUGH;
  3786. case 2:
  3787. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  3788. else {
  3789. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 322, __pyx_L3_error)
  3790. }
  3791. CYTHON_FALLTHROUGH;
  3792. case 3:
  3793. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  3794. else {
  3795. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 322, __pyx_L3_error)
  3796. }
  3797. CYTHON_FALLTHROUGH;
  3798. case 4:
  3799. if (kw_args > 0) {
  3800. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  3801. if (value) { values[4] = value; kw_args--; }
  3802. }
  3803. }
  3804. if (unlikely(kw_args > 0)) {
  3805. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 322, __pyx_L3_error)
  3806. }
  3807. } else {
  3808. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3809. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3810. CYTHON_FALLTHROUGH;
  3811. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3812. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3813. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3814. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3815. break;
  3816. default: goto __pyx_L5_argtuple_error;
  3817. }
  3818. }
  3819. __pyx_v_graph_id = values[0];
  3820. __pyx_v_tail = values[1];
  3821. __pyx_v_head = values[2];
  3822. __pyx_v_edge_label = values[3];
  3823. __pyx_v_ignore_duplicates = values[4];
  3824. }
  3825. goto __pyx_L4_argument_unpacking_done;
  3826. __pyx_L5_argtuple_error:;
  3827. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 322, __pyx_L3_error)
  3828. __pyx_L3_error:;
  3829. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3830. __Pyx_RefNannyFinishContext();
  3831. return NULL;
  3832. __pyx_L4_argument_unpacking_done:;
  3833. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_22add_edge(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_graph_id, __pyx_v_tail, __pyx_v_head, __pyx_v_edge_label, __pyx_v_ignore_duplicates);
  3834. /* function exit code */
  3835. __Pyx_RefNannyFinishContext();
  3836. return __pyx_r;
  3837. }
  3838. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_22add_edge(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_tail, PyObject *__pyx_v_head, PyObject *__pyx_v_edge_label, PyObject *__pyx_v_ignore_duplicates) {
  3839. PyObject *__pyx_r = NULL;
  3840. __Pyx_RefNannyDeclarations
  3841. size_t __pyx_t_1;
  3842. PyObject *__pyx_t_2 = NULL;
  3843. PyObject *__pyx_t_3 = NULL;
  3844. PyObject *__pyx_t_4 = NULL;
  3845. std::string __pyx_t_5;
  3846. std::string __pyx_t_6;
  3847. std::map<std::string,std::string> __pyx_t_7;
  3848. bool __pyx_t_8;
  3849. __Pyx_RefNannySetupContext("add_edge", 0);
  3850. /* "gedlibpy.pyx":340
  3851. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3852. * """
  3853. * self.c_env.addEdge(graph_id, tail.encode('utf-8'), head.encode('utf-8'), encode_your_map(edge_label), ignore_duplicates) # <<<<<<<<<<<<<<
  3854. *
  3855. *
  3856. */
  3857. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
  3858. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  3859. __Pyx_GOTREF(__pyx_t_3);
  3860. __pyx_t_4 = NULL;
  3861. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3862. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3863. if (likely(__pyx_t_4)) {
  3864. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3865. __Pyx_INCREF(__pyx_t_4);
  3866. __Pyx_INCREF(function);
  3867. __Pyx_DECREF_SET(__pyx_t_3, function);
  3868. }
  3869. }
  3870. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8);
  3871. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3872. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  3873. __Pyx_GOTREF(__pyx_t_2);
  3874. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3875. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
  3876. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3877. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  3878. __Pyx_GOTREF(__pyx_t_3);
  3879. __pyx_t_4 = NULL;
  3880. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3881. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3882. if (likely(__pyx_t_4)) {
  3883. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3884. __Pyx_INCREF(__pyx_t_4);
  3885. __Pyx_INCREF(function);
  3886. __Pyx_DECREF_SET(__pyx_t_3, function);
  3887. }
  3888. }
  3889. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_kp_u_utf_8);
  3890. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3891. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  3892. __Pyx_GOTREF(__pyx_t_2);
  3893. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3894. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
  3895. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3896. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
  3897. __Pyx_GOTREF(__pyx_t_3);
  3898. __pyx_t_4 = NULL;
  3899. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3900. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3901. if (likely(__pyx_t_4)) {
  3902. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3903. __Pyx_INCREF(__pyx_t_4);
  3904. __Pyx_INCREF(function);
  3905. __Pyx_DECREF_SET(__pyx_t_3, function);
  3906. }
  3907. }
  3908. __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_edge_label);
  3909. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3910. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
  3911. __Pyx_GOTREF(__pyx_t_2);
  3912. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3913. __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
  3914. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3915. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_duplicates); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 340, __pyx_L1_error)
  3916. try {
  3917. __pyx_v_self->c_env->addEdge(__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
  3918. } catch(...) {
  3919. __Pyx_CppExn2PyErr();
  3920. __PYX_ERR(0, 340, __pyx_L1_error)
  3921. }
  3922. /* "gedlibpy.pyx":322
  3923. *
  3924. *
  3925. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3926. * """
  3927. * Adds an edge on a graph selected by its ID.
  3928. */
  3929. /* function exit code */
  3930. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3931. goto __pyx_L0;
  3932. __pyx_L1_error:;
  3933. __Pyx_XDECREF(__pyx_t_2);
  3934. __Pyx_XDECREF(__pyx_t_3);
  3935. __Pyx_XDECREF(__pyx_t_4);
  3936. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3937. __pyx_r = NULL;
  3938. __pyx_L0:;
  3939. __Pyx_XGIVEREF(__pyx_r);
  3940. __Pyx_RefNannyFinishContext();
  3941. return __pyx_r;
  3942. }
  3943. /* "gedlibpy.pyx":343
  3944. *
  3945. *
  3946. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  3947. * """
  3948. * Adds a symmetrical edge on a graph selected by its ID.
  3949. */
  3950. /* Python wrapper */
  3951. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3952. static char __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge[] = "\n\t\t\tAdds a symmetrical edge on a graph selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:param tail: The ID of the tail node for the new edge\n\t\t\t:param head: The ID of the head node for the new edge\n\t\t\t:param edge_label: The label of the new edge\n\t\t\t:type graph_id: size_t\n\t\t\t:type tail: string\n\t\t\t:type head: string\n\t\t\t:type edge_label: dict{string : string}\n\t\t\t\n\t\t\t.. seealso:: add_graph(), add_node(), add_edge()\n\t\t\t.. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications. \n\t\t";
  3953. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3954. PyObject *__pyx_v_graph_id = 0;
  3955. PyObject *__pyx_v_tail = 0;
  3956. PyObject *__pyx_v_head = 0;
  3957. PyObject *__pyx_v_edge_label = 0;
  3958. PyObject *__pyx_r = 0;
  3959. __Pyx_RefNannyDeclarations
  3960. __Pyx_RefNannySetupContext("add_symmetrical_edge (wrapper)", 0);
  3961. {
  3962. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_tail,&__pyx_n_s_head,&__pyx_n_s_edge_label,0};
  3963. PyObject* values[4] = {0,0,0,0};
  3964. if (unlikely(__pyx_kwds)) {
  3965. Py_ssize_t kw_args;
  3966. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3967. switch (pos_args) {
  3968. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3969. CYTHON_FALLTHROUGH;
  3970. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3971. CYTHON_FALLTHROUGH;
  3972. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3973. CYTHON_FALLTHROUGH;
  3974. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3975. CYTHON_FALLTHROUGH;
  3976. case 0: break;
  3977. default: goto __pyx_L5_argtuple_error;
  3978. }
  3979. kw_args = PyDict_Size(__pyx_kwds);
  3980. switch (pos_args) {
  3981. case 0:
  3982. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3983. else goto __pyx_L5_argtuple_error;
  3984. CYTHON_FALLTHROUGH;
  3985. case 1:
  3986. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  3987. else {
  3988. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 343, __pyx_L3_error)
  3989. }
  3990. CYTHON_FALLTHROUGH;
  3991. case 2:
  3992. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  3993. else {
  3994. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 343, __pyx_L3_error)
  3995. }
  3996. CYTHON_FALLTHROUGH;
  3997. case 3:
  3998. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  3999. else {
  4000. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 343, __pyx_L3_error)
  4001. }
  4002. }
  4003. if (unlikely(kw_args > 0)) {
  4004. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 343, __pyx_L3_error)
  4005. }
  4006. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  4007. goto __pyx_L5_argtuple_error;
  4008. } else {
  4009. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4010. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4011. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4012. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4013. }
  4014. __pyx_v_graph_id = values[0];
  4015. __pyx_v_tail = values[1];
  4016. __pyx_v_head = values[2];
  4017. __pyx_v_edge_label = values[3];
  4018. }
  4019. goto __pyx_L4_argument_unpacking_done;
  4020. __pyx_L5_argtuple_error:;
  4021. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 343, __pyx_L3_error)
  4022. __pyx_L3_error:;
  4023. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4024. __Pyx_RefNannyFinishContext();
  4025. return NULL;
  4026. __pyx_L4_argument_unpacking_done:;
  4027. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_graph_id, __pyx_v_tail, __pyx_v_head, __pyx_v_edge_label);
  4028. /* function exit code */
  4029. __Pyx_RefNannyFinishContext();
  4030. return __pyx_r;
  4031. }
  4032. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_24add_symmetrical_edge(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_tail, PyObject *__pyx_v_head, PyObject *__pyx_v_edge_label) {
  4033. PyObject *__pyx_v_tailB = NULL;
  4034. PyObject *__pyx_v_headB = NULL;
  4035. PyObject *__pyx_v_edgeLabelB = NULL;
  4036. PyObject *__pyx_r = NULL;
  4037. __Pyx_RefNannyDeclarations
  4038. PyObject *__pyx_t_1 = NULL;
  4039. PyObject *__pyx_t_2 = NULL;
  4040. PyObject *__pyx_t_3 = NULL;
  4041. size_t __pyx_t_4;
  4042. std::string __pyx_t_5;
  4043. std::string __pyx_t_6;
  4044. std::map<std::string,std::string> __pyx_t_7;
  4045. __Pyx_RefNannySetupContext("add_symmetrical_edge", 0);
  4046. /* "gedlibpy.pyx":359
  4047. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  4048. * """
  4049. * tailB = tail.encode('utf-8') # <<<<<<<<<<<<<<
  4050. * headB = head.encode('utf-8')
  4051. * edgeLabelB = encode_your_map(edge_label)
  4052. */
  4053. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 359, __pyx_L1_error)
  4054. __Pyx_GOTREF(__pyx_t_2);
  4055. __pyx_t_3 = NULL;
  4056. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4057. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4058. if (likely(__pyx_t_3)) {
  4059. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4060. __Pyx_INCREF(__pyx_t_3);
  4061. __Pyx_INCREF(function);
  4062. __Pyx_DECREF_SET(__pyx_t_2, function);
  4063. }
  4064. }
  4065. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  4066. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4067. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 359, __pyx_L1_error)
  4068. __Pyx_GOTREF(__pyx_t_1);
  4069. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4070. __pyx_v_tailB = __pyx_t_1;
  4071. __pyx_t_1 = 0;
  4072. /* "gedlibpy.pyx":360
  4073. * """
  4074. * tailB = tail.encode('utf-8')
  4075. * headB = head.encode('utf-8') # <<<<<<<<<<<<<<
  4076. * edgeLabelB = encode_your_map(edge_label)
  4077. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4078. */
  4079. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 360, __pyx_L1_error)
  4080. __Pyx_GOTREF(__pyx_t_2);
  4081. __pyx_t_3 = NULL;
  4082. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4083. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4084. if (likely(__pyx_t_3)) {
  4085. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4086. __Pyx_INCREF(__pyx_t_3);
  4087. __Pyx_INCREF(function);
  4088. __Pyx_DECREF_SET(__pyx_t_2, function);
  4089. }
  4090. }
  4091. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_kp_u_utf_8);
  4092. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4093. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 360, __pyx_L1_error)
  4094. __Pyx_GOTREF(__pyx_t_1);
  4095. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4096. __pyx_v_headB = __pyx_t_1;
  4097. __pyx_t_1 = 0;
  4098. /* "gedlibpy.pyx":361
  4099. * tailB = tail.encode('utf-8')
  4100. * headB = head.encode('utf-8')
  4101. * edgeLabelB = encode_your_map(edge_label) # <<<<<<<<<<<<<<
  4102. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4103. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4104. */
  4105. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
  4106. __Pyx_GOTREF(__pyx_t_2);
  4107. __pyx_t_3 = NULL;
  4108. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4109. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4110. if (likely(__pyx_t_3)) {
  4111. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4112. __Pyx_INCREF(__pyx_t_3);
  4113. __Pyx_INCREF(function);
  4114. __Pyx_DECREF_SET(__pyx_t_2, function);
  4115. }
  4116. }
  4117. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label);
  4118. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4119. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
  4120. __Pyx_GOTREF(__pyx_t_1);
  4121. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4122. __pyx_v_edgeLabelB = __pyx_t_1;
  4123. __pyx_t_1 = 0;
  4124. /* "gedlibpy.pyx":362
  4125. * headB = head.encode('utf-8')
  4126. * edgeLabelB = encode_your_map(edge_label)
  4127. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4128. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4129. *
  4130. */
  4131. __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error)
  4132. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error)
  4133. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error)
  4134. __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 362, __pyx_L1_error)
  4135. try {
  4136. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, 1);
  4137. } catch(...) {
  4138. __Pyx_CppExn2PyErr();
  4139. __PYX_ERR(0, 362, __pyx_L1_error)
  4140. }
  4141. /* "gedlibpy.pyx":363
  4142. * edgeLabelB = encode_your_map(edge_label)
  4143. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4144. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4145. *
  4146. *
  4147. */
  4148. __pyx_t_4 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_4 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
  4149. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
  4150. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
  4151. __pyx_t_7 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_edgeLabelB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L1_error)
  4152. try {
  4153. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_t_7, 1);
  4154. } catch(...) {
  4155. __Pyx_CppExn2PyErr();
  4156. __PYX_ERR(0, 363, __pyx_L1_error)
  4157. }
  4158. /* "gedlibpy.pyx":343
  4159. *
  4160. *
  4161. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  4162. * """
  4163. * Adds a symmetrical edge on a graph selected by its ID.
  4164. */
  4165. /* function exit code */
  4166. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4167. goto __pyx_L0;
  4168. __pyx_L1_error:;
  4169. __Pyx_XDECREF(__pyx_t_1);
  4170. __Pyx_XDECREF(__pyx_t_2);
  4171. __Pyx_XDECREF(__pyx_t_3);
  4172. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4173. __pyx_r = NULL;
  4174. __pyx_L0:;
  4175. __Pyx_XDECREF(__pyx_v_tailB);
  4176. __Pyx_XDECREF(__pyx_v_headB);
  4177. __Pyx_XDECREF(__pyx_v_edgeLabelB);
  4178. __Pyx_XGIVEREF(__pyx_r);
  4179. __Pyx_RefNannyFinishContext();
  4180. return __pyx_r;
  4181. }
  4182. /* "gedlibpy.pyx":366
  4183. *
  4184. *
  4185. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4186. * """
  4187. * Deletes a graph, selected by its ID, to the environment.
  4188. */
  4189. /* Python wrapper */
  4190. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4191. static char __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph[] = "\n\t\t\tDeletes a graph, selected by its ID, to the environment.\n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t\n\t\t\t.. note:: Call init() after you're finished your modifications. \n\t\t";
  4192. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4193. PyObject *__pyx_r = 0;
  4194. __Pyx_RefNannyDeclarations
  4195. __Pyx_RefNannySetupContext("clear_graph (wrapper)", 0);
  4196. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4197. /* function exit code */
  4198. __Pyx_RefNannyFinishContext();
  4199. return __pyx_r;
  4200. }
  4201. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4202. PyObject *__pyx_r = NULL;
  4203. __Pyx_RefNannyDeclarations
  4204. size_t __pyx_t_1;
  4205. __Pyx_RefNannySetupContext("clear_graph", 0);
  4206. /* "gedlibpy.pyx":375
  4207. * .. note:: Call init() after you're finished your modifications.
  4208. * """
  4209. * self.c_env.clearGraph(graph_id) # <<<<<<<<<<<<<<
  4210. *
  4211. *
  4212. */
  4213. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 375, __pyx_L1_error)
  4214. try {
  4215. __pyx_v_self->c_env->clearGraph(__pyx_t_1);
  4216. } catch(...) {
  4217. __Pyx_CppExn2PyErr();
  4218. __PYX_ERR(0, 375, __pyx_L1_error)
  4219. }
  4220. /* "gedlibpy.pyx":366
  4221. *
  4222. *
  4223. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4224. * """
  4225. * Deletes a graph, selected by its ID, to the environment.
  4226. */
  4227. /* function exit code */
  4228. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4229. goto __pyx_L0;
  4230. __pyx_L1_error:;
  4231. __Pyx_AddTraceback("gedlibpy.GEDEnv.clear_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4232. __pyx_r = NULL;
  4233. __pyx_L0:;
  4234. __Pyx_XGIVEREF(__pyx_r);
  4235. __Pyx_RefNannyFinishContext();
  4236. return __pyx_r;
  4237. }
  4238. /* "gedlibpy.pyx":378
  4239. *
  4240. *
  4241. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4242. * """
  4243. * Searchs and returns the internal Id of a graph, selected by its ID.
  4244. */
  4245. /* Python wrapper */
  4246. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4247. static char __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id[] = "\n\t\t\tSearchs and returns the internal Id of a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The internal ID of the selected graph\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso:: get_graph_num_nodes(), get_graph_num_edges(), get_original_node_ids(), get_graph_node_labels(), get_graph_edges(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4248. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4249. PyObject *__pyx_r = 0;
  4250. __Pyx_RefNannyDeclarations
  4251. __Pyx_RefNannySetupContext("get_graph_internal_id (wrapper)", 0);
  4252. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4253. /* function exit code */
  4254. __Pyx_RefNannyFinishContext();
  4255. return __pyx_r;
  4256. }
  4257. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4258. PyObject *__pyx_r = NULL;
  4259. __Pyx_RefNannyDeclarations
  4260. size_t __pyx_t_1;
  4261. size_t __pyx_t_2;
  4262. PyObject *__pyx_t_3 = NULL;
  4263. __Pyx_RefNannySetupContext("get_graph_internal_id", 0);
  4264. /* "gedlibpy.pyx":390
  4265. * .. note:: These functions allow to collect all the graph's informations.
  4266. * """
  4267. * return self.c_env.getGraphInternalId(graph_id) # <<<<<<<<<<<<<<
  4268. *
  4269. *
  4270. */
  4271. __Pyx_XDECREF(__pyx_r);
  4272. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
  4273. try {
  4274. __pyx_t_2 = __pyx_v_self->c_env->getGraphInternalId(__pyx_t_1);
  4275. } catch(...) {
  4276. __Pyx_CppExn2PyErr();
  4277. __PYX_ERR(0, 390, __pyx_L1_error)
  4278. }
  4279. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 390, __pyx_L1_error)
  4280. __Pyx_GOTREF(__pyx_t_3);
  4281. __pyx_r = __pyx_t_3;
  4282. __pyx_t_3 = 0;
  4283. goto __pyx_L0;
  4284. /* "gedlibpy.pyx":378
  4285. *
  4286. *
  4287. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4288. * """
  4289. * Searchs and returns the internal Id of a graph, selected by its ID.
  4290. */
  4291. /* function exit code */
  4292. __pyx_L1_error:;
  4293. __Pyx_XDECREF(__pyx_t_3);
  4294. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_internal_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4295. __pyx_r = NULL;
  4296. __pyx_L0:;
  4297. __Pyx_XGIVEREF(__pyx_r);
  4298. __Pyx_RefNannyFinishContext();
  4299. return __pyx_r;
  4300. }
  4301. /* "gedlibpy.pyx":393
  4302. *
  4303. *
  4304. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4305. * """
  4306. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4307. */
  4308. /* Python wrapper */
  4309. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4310. static char __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes[] = "\n\t\t\tSearchs and returns the number of nodes on a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The number of nodes on the selected graph\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso:: get_graph_internal_id(), get_graph_num_edges(), get_original_node_ids(), get_graph_node_labels(), get_graph_edges(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4311. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4312. PyObject *__pyx_r = 0;
  4313. __Pyx_RefNannyDeclarations
  4314. __Pyx_RefNannySetupContext("get_graph_num_nodes (wrapper)", 0);
  4315. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4316. /* function exit code */
  4317. __Pyx_RefNannyFinishContext();
  4318. return __pyx_r;
  4319. }
  4320. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4321. PyObject *__pyx_r = NULL;
  4322. __Pyx_RefNannyDeclarations
  4323. size_t __pyx_t_1;
  4324. size_t __pyx_t_2;
  4325. PyObject *__pyx_t_3 = NULL;
  4326. __Pyx_RefNannySetupContext("get_graph_num_nodes", 0);
  4327. /* "gedlibpy.pyx":405
  4328. * .. note:: These functions allow to collect all the graph's informations.
  4329. * """
  4330. * return self.c_env.getGraphNumNodes(graph_id) # <<<<<<<<<<<<<<
  4331. *
  4332. *
  4333. */
  4334. __Pyx_XDECREF(__pyx_r);
  4335. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L1_error)
  4336. try {
  4337. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumNodes(__pyx_t_1);
  4338. } catch(...) {
  4339. __Pyx_CppExn2PyErr();
  4340. __PYX_ERR(0, 405, __pyx_L1_error)
  4341. }
  4342. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 405, __pyx_L1_error)
  4343. __Pyx_GOTREF(__pyx_t_3);
  4344. __pyx_r = __pyx_t_3;
  4345. __pyx_t_3 = 0;
  4346. goto __pyx_L0;
  4347. /* "gedlibpy.pyx":393
  4348. *
  4349. *
  4350. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4351. * """
  4352. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4353. */
  4354. /* function exit code */
  4355. __pyx_L1_error:;
  4356. __Pyx_XDECREF(__pyx_t_3);
  4357. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4358. __pyx_r = NULL;
  4359. __pyx_L0:;
  4360. __Pyx_XGIVEREF(__pyx_r);
  4361. __Pyx_RefNannyFinishContext();
  4362. return __pyx_r;
  4363. }
  4364. /* "gedlibpy.pyx":408
  4365. *
  4366. *
  4367. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4368. * """
  4369. * Searchs and returns the number of edges on a graph, selected by its ID.
  4370. */
  4371. /* Python wrapper */
  4372. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4373. static char __pyx_doc_8gedlibpy_6GEDEnv_32get_graph_num_edges[] = "\n\t\t\tSearchs and returns the number of edges on a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The number of edges on the selected graph\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso:: get_graph_internal_id(), get_graph_num_nodes(), get_original_node_ids(), get_graph_node_labels(), get_graph_edges(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4374. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4375. PyObject *__pyx_r = 0;
  4376. __Pyx_RefNannyDeclarations
  4377. __Pyx_RefNannySetupContext("get_graph_num_edges (wrapper)", 0);
  4378. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4379. /* function exit code */
  4380. __Pyx_RefNannyFinishContext();
  4381. return __pyx_r;
  4382. }
  4383. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4384. PyObject *__pyx_r = NULL;
  4385. __Pyx_RefNannyDeclarations
  4386. size_t __pyx_t_1;
  4387. size_t __pyx_t_2;
  4388. PyObject *__pyx_t_3 = NULL;
  4389. __Pyx_RefNannySetupContext("get_graph_num_edges", 0);
  4390. /* "gedlibpy.pyx":420
  4391. * .. note:: These functions allow to collect all the graph's informations.
  4392. * """
  4393. * return self.c_env.getGraphNumEdges(graph_id) # <<<<<<<<<<<<<<
  4394. *
  4395. *
  4396. */
  4397. __Pyx_XDECREF(__pyx_r);
  4398. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 420, __pyx_L1_error)
  4399. try {
  4400. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumEdges(__pyx_t_1);
  4401. } catch(...) {
  4402. __Pyx_CppExn2PyErr();
  4403. __PYX_ERR(0, 420, __pyx_L1_error)
  4404. }
  4405. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
  4406. __Pyx_GOTREF(__pyx_t_3);
  4407. __pyx_r = __pyx_t_3;
  4408. __pyx_t_3 = 0;
  4409. goto __pyx_L0;
  4410. /* "gedlibpy.pyx":408
  4411. *
  4412. *
  4413. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4414. * """
  4415. * Searchs and returns the number of edges on a graph, selected by its ID.
  4416. */
  4417. /* function exit code */
  4418. __pyx_L1_error:;
  4419. __Pyx_XDECREF(__pyx_t_3);
  4420. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4421. __pyx_r = NULL;
  4422. __pyx_L0:;
  4423. __Pyx_XGIVEREF(__pyx_r);
  4424. __Pyx_RefNannyFinishContext();
  4425. return __pyx_r;
  4426. }
  4427. /* "gedlibpy.pyx":423
  4428. *
  4429. *
  4430. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4431. * """
  4432. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4433. */
  4434. /* Python wrapper */
  4435. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4436. static char __pyx_doc_8gedlibpy_6GEDEnv_34get_original_node_ids[] = "\n\t\t\tSearchs and returns all th Ids of nodes on a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The list of IDs's nodes on the selected graph\n\t\t\t:rtype: list[string]\n\t\t\t\n\t\t\t.. seealso::get_graph_internal_id(), get_graph_num_nodes(), get_graph_num_edges(), get_graph_node_labels(), get_graph_edges(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4437. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4438. PyObject *__pyx_r = 0;
  4439. __Pyx_RefNannyDeclarations
  4440. __Pyx_RefNannySetupContext("get_original_node_ids (wrapper)", 0);
  4441. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4442. /* function exit code */
  4443. __Pyx_RefNannyFinishContext();
  4444. return __pyx_r;
  4445. }
  4446. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4447. std::string __pyx_8genexpr3__pyx_v_gid;
  4448. PyObject *__pyx_r = NULL;
  4449. __Pyx_RefNannyDeclarations
  4450. PyObject *__pyx_t_1 = NULL;
  4451. size_t __pyx_t_2;
  4452. std::vector<std::string> __pyx_t_3;
  4453. std::vector<std::string> ::iterator __pyx_t_4;
  4454. std::vector<std::string> *__pyx_t_5;
  4455. std::string __pyx_t_6;
  4456. PyObject *__pyx_t_7 = NULL;
  4457. __Pyx_RefNannySetupContext("get_original_node_ids", 0);
  4458. /* "gedlibpy.pyx":435
  4459. * .. note:: These functions allow to collect all the graph's informations.
  4460. * """
  4461. * return [gid.decode('utf-8') for gid in self.c_env.getGraphOriginalNodeIds(graph_id)] # <<<<<<<<<<<<<<
  4462. *
  4463. *
  4464. */
  4465. __Pyx_XDECREF(__pyx_r);
  4466. { /* enter inner scope */
  4467. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 435, __pyx_L1_error)
  4468. __Pyx_GOTREF(__pyx_t_1);
  4469. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L1_error)
  4470. try {
  4471. __pyx_t_3 = __pyx_v_self->c_env->getGraphOriginalNodeIds(__pyx_t_2);
  4472. } catch(...) {
  4473. __Pyx_CppExn2PyErr();
  4474. __PYX_ERR(0, 435, __pyx_L1_error)
  4475. }
  4476. __pyx_t_5 = &__pyx_t_3;
  4477. __pyx_t_4 = __pyx_t_5->begin();
  4478. for (;;) {
  4479. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4480. __pyx_t_6 = *__pyx_t_4;
  4481. ++__pyx_t_4;
  4482. __pyx_8genexpr3__pyx_v_gid = __pyx_t_6;
  4483. __pyx_t_7 = __Pyx_decode_cpp_string(__pyx_8genexpr3__pyx_v_gid, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 435, __pyx_L1_error)
  4484. __Pyx_GOTREF(__pyx_t_7);
  4485. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 435, __pyx_L1_error)
  4486. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4487. }
  4488. } /* exit inner scope */
  4489. __pyx_r = __pyx_t_1;
  4490. __pyx_t_1 = 0;
  4491. goto __pyx_L0;
  4492. /* "gedlibpy.pyx":423
  4493. *
  4494. *
  4495. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4496. * """
  4497. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4498. */
  4499. /* function exit code */
  4500. __pyx_L1_error:;
  4501. __Pyx_XDECREF(__pyx_t_1);
  4502. __Pyx_XDECREF(__pyx_t_7);
  4503. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_original_node_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4504. __pyx_r = NULL;
  4505. __pyx_L0:;
  4506. __Pyx_XGIVEREF(__pyx_r);
  4507. __Pyx_RefNannyFinishContext();
  4508. return __pyx_r;
  4509. }
  4510. /* "gedlibpy.pyx":438
  4511. *
  4512. *
  4513. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4514. * """
  4515. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4516. */
  4517. /* Python wrapper */
  4518. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4519. static char __pyx_doc_8gedlibpy_6GEDEnv_36get_graph_node_labels[] = "\n\t\t\tSearchs and returns all the labels of nodes on a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The list of nodes' labels on the selected graph\n\t\t\t:rtype: list[dict{string : string}]\n\t\t\t\n\t\t\t.. seealso:: get_graph_internal_id(), get_graph_num_nodes(), get_graph_num_edges(), get_original_node_ids(), get_graph_edges(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4520. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4521. PyObject *__pyx_r = 0;
  4522. __Pyx_RefNannyDeclarations
  4523. __Pyx_RefNannySetupContext("get_graph_node_labels (wrapper)", 0);
  4524. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4525. /* function exit code */
  4526. __Pyx_RefNannyFinishContext();
  4527. return __pyx_r;
  4528. }
  4529. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4530. std::map<std::string,std::string> __pyx_8genexpr4__pyx_v_node_label;
  4531. PyObject *__pyx_r = NULL;
  4532. __Pyx_RefNannyDeclarations
  4533. PyObject *__pyx_t_1 = NULL;
  4534. size_t __pyx_t_2;
  4535. std::vector<std::map<std::string,std::string> > __pyx_t_3;
  4536. std::vector<std::map<std::string,std::string> > ::iterator __pyx_t_4;
  4537. std::vector<std::map<std::string,std::string> > *__pyx_t_5;
  4538. std::map<std::string,std::string> __pyx_t_6;
  4539. PyObject *__pyx_t_7 = NULL;
  4540. PyObject *__pyx_t_8 = NULL;
  4541. PyObject *__pyx_t_9 = NULL;
  4542. PyObject *__pyx_t_10 = NULL;
  4543. __Pyx_RefNannySetupContext("get_graph_node_labels", 0);
  4544. /* "gedlibpy.pyx":450
  4545. * .. note:: These functions allow to collect all the graph's informations.
  4546. * """
  4547. * return [decode_your_map(node_label) for node_label in self.c_env.getGraphNodeLabels(graph_id)] # <<<<<<<<<<<<<<
  4548. *
  4549. *
  4550. */
  4551. __Pyx_XDECREF(__pyx_r);
  4552. { /* enter inner scope */
  4553. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 450, __pyx_L1_error)
  4554. __Pyx_GOTREF(__pyx_t_1);
  4555. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 450, __pyx_L1_error)
  4556. try {
  4557. __pyx_t_3 = __pyx_v_self->c_env->getGraphNodeLabels(__pyx_t_2);
  4558. } catch(...) {
  4559. __Pyx_CppExn2PyErr();
  4560. __PYX_ERR(0, 450, __pyx_L1_error)
  4561. }
  4562. __pyx_t_5 = &__pyx_t_3;
  4563. __pyx_t_4 = __pyx_t_5->begin();
  4564. for (;;) {
  4565. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4566. __pyx_t_6 = *__pyx_t_4;
  4567. ++__pyx_t_4;
  4568. __pyx_8genexpr4__pyx_v_node_label = __pyx_t_6;
  4569. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 450, __pyx_L1_error)
  4570. __Pyx_GOTREF(__pyx_t_8);
  4571. __pyx_t_9 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_8genexpr4__pyx_v_node_label); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 450, __pyx_L1_error)
  4572. __Pyx_GOTREF(__pyx_t_9);
  4573. __pyx_t_10 = NULL;
  4574. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  4575. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
  4576. if (likely(__pyx_t_10)) {
  4577. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  4578. __Pyx_INCREF(__pyx_t_10);
  4579. __Pyx_INCREF(function);
  4580. __Pyx_DECREF_SET(__pyx_t_8, function);
  4581. }
  4582. }
  4583. __pyx_t_7 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_9);
  4584. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  4585. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4586. if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 450, __pyx_L1_error)
  4587. __Pyx_GOTREF(__pyx_t_7);
  4588. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4589. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 450, __pyx_L1_error)
  4590. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4591. }
  4592. } /* exit inner scope */
  4593. __pyx_r = __pyx_t_1;
  4594. __pyx_t_1 = 0;
  4595. goto __pyx_L0;
  4596. /* "gedlibpy.pyx":438
  4597. *
  4598. *
  4599. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4600. * """
  4601. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4602. */
  4603. /* function exit code */
  4604. __pyx_L1_error:;
  4605. __Pyx_XDECREF(__pyx_t_1);
  4606. __Pyx_XDECREF(__pyx_t_7);
  4607. __Pyx_XDECREF(__pyx_t_8);
  4608. __Pyx_XDECREF(__pyx_t_9);
  4609. __Pyx_XDECREF(__pyx_t_10);
  4610. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4611. __pyx_r = NULL;
  4612. __pyx_L0:;
  4613. __Pyx_XGIVEREF(__pyx_r);
  4614. __Pyx_RefNannyFinishContext();
  4615. return __pyx_r;
  4616. }
  4617. /* "gedlibpy.pyx":453
  4618. *
  4619. *
  4620. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4621. * """
  4622. * Searchs and returns all the edges on a graph, selected by its ID.
  4623. */
  4624. /* Python wrapper */
  4625. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4626. static char __pyx_doc_8gedlibpy_6GEDEnv_38get_graph_edges[] = "\n\t\t\tSearchs and returns all the edges on a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The list of edges on the selected graph\n\t\t\t:rtype: dict{tuple(size_t, size_t) : dict{string : string}}\n\t\t\t\n\t\t\t.. seealso::get_graph_internal_id(), get_graph_num_nodes(), get_graph_num_edges(), get_original_node_ids(), get_graph_node_labels(), get_graph_adjacence_matrix()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4627. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4628. PyObject *__pyx_r = 0;
  4629. __Pyx_RefNannyDeclarations
  4630. __Pyx_RefNannySetupContext("get_graph_edges (wrapper)", 0);
  4631. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4632. /* function exit code */
  4633. __Pyx_RefNannyFinishContext();
  4634. return __pyx_r;
  4635. }
  4636. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4637. PyObject *__pyx_r = NULL;
  4638. __Pyx_RefNannyDeclarations
  4639. PyObject *__pyx_t_1 = NULL;
  4640. PyObject *__pyx_t_2 = NULL;
  4641. size_t __pyx_t_3;
  4642. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > __pyx_t_4;
  4643. PyObject *__pyx_t_5 = NULL;
  4644. PyObject *__pyx_t_6 = NULL;
  4645. __Pyx_RefNannySetupContext("get_graph_edges", 0);
  4646. /* "gedlibpy.pyx":465
  4647. * .. note:: These functions allow to collect all the graph's informations.
  4648. * """
  4649. * return decode_graph_edges(self.c_env.getGraphEdges(graph_id)) # <<<<<<<<<<<<<<
  4650. *
  4651. *
  4652. */
  4653. __Pyx_XDECREF(__pyx_r);
  4654. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L1_error)
  4655. __Pyx_GOTREF(__pyx_t_2);
  4656. __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
  4657. try {
  4658. __pyx_t_4 = __pyx_v_self->c_env->getGraphEdges(__pyx_t_3);
  4659. } catch(...) {
  4660. __Pyx_CppExn2PyErr();
  4661. __PYX_ERR(0, 465, __pyx_L1_error)
  4662. }
  4663. __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 465, __pyx_L1_error)
  4664. __Pyx_GOTREF(__pyx_t_5);
  4665. __pyx_t_6 = NULL;
  4666. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4667. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  4668. if (likely(__pyx_t_6)) {
  4669. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4670. __Pyx_INCREF(__pyx_t_6);
  4671. __Pyx_INCREF(function);
  4672. __Pyx_DECREF_SET(__pyx_t_2, function);
  4673. }
  4674. }
  4675. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  4676. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4677. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4678. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 465, __pyx_L1_error)
  4679. __Pyx_GOTREF(__pyx_t_1);
  4680. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4681. __pyx_r = __pyx_t_1;
  4682. __pyx_t_1 = 0;
  4683. goto __pyx_L0;
  4684. /* "gedlibpy.pyx":453
  4685. *
  4686. *
  4687. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4688. * """
  4689. * Searchs and returns all the edges on a graph, selected by its ID.
  4690. */
  4691. /* function exit code */
  4692. __pyx_L1_error:;
  4693. __Pyx_XDECREF(__pyx_t_1);
  4694. __Pyx_XDECREF(__pyx_t_2);
  4695. __Pyx_XDECREF(__pyx_t_5);
  4696. __Pyx_XDECREF(__pyx_t_6);
  4697. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4698. __pyx_r = NULL;
  4699. __pyx_L0:;
  4700. __Pyx_XGIVEREF(__pyx_r);
  4701. __Pyx_RefNannyFinishContext();
  4702. return __pyx_r;
  4703. }
  4704. /* "gedlibpy.pyx":468
  4705. *
  4706. *
  4707. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4708. * """
  4709. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4710. */
  4711. /* Python wrapper */
  4712. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4713. static char __pyx_doc_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix[] = "\n\t\t\tSearchs and returns the adjacence list of a graph, selected by its ID. \n\t\n\t\t\t:param graph_id: The ID of the wanted graph\n\t\t\t:type graph_id: size_t\n\t\t\t:return: The adjacence list of the selected graph\n\t\t\t:rtype: list[list[size_t]]\n\t\t\t\n\t\t\t.. seealso:: get_graph_internal_id(), get_graph_num_nodes(), get_graph_num_edges(), get_original_node_ids(), get_graph_node_labels(), get_graph_edges()\n\t\t\t.. note:: These functions allow to collect all the graph's informations.\n\t\t";
  4714. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4715. PyObject *__pyx_r = 0;
  4716. __Pyx_RefNannyDeclarations
  4717. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix (wrapper)", 0);
  4718. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4719. /* function exit code */
  4720. __Pyx_RefNannyFinishContext();
  4721. return __pyx_r;
  4722. }
  4723. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4724. PyObject *__pyx_r = NULL;
  4725. __Pyx_RefNannyDeclarations
  4726. size_t __pyx_t_1;
  4727. std::vector<std::vector<size_t> > __pyx_t_2;
  4728. PyObject *__pyx_t_3 = NULL;
  4729. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix", 0);
  4730. /* "gedlibpy.pyx":480
  4731. * .. note:: These functions allow to collect all the graph's informations.
  4732. * """
  4733. * return self.c_env.getGraphAdjacenceMatrix(graph_id) # <<<<<<<<<<<<<<
  4734. *
  4735. *
  4736. */
  4737. __Pyx_XDECREF(__pyx_r);
  4738. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_graph_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 480, __pyx_L1_error)
  4739. try {
  4740. __pyx_t_2 = __pyx_v_self->c_env->getGraphAdjacenceMatrix(__pyx_t_1);
  4741. } catch(...) {
  4742. __Pyx_CppExn2PyErr();
  4743. __PYX_ERR(0, 480, __pyx_L1_error)
  4744. }
  4745. __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 480, __pyx_L1_error)
  4746. __Pyx_GOTREF(__pyx_t_3);
  4747. __pyx_r = __pyx_t_3;
  4748. __pyx_t_3 = 0;
  4749. goto __pyx_L0;
  4750. /* "gedlibpy.pyx":468
  4751. *
  4752. *
  4753. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4754. * """
  4755. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4756. */
  4757. /* function exit code */
  4758. __pyx_L1_error:;
  4759. __Pyx_XDECREF(__pyx_t_3);
  4760. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_adjacence_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4761. __pyx_r = NULL;
  4762. __pyx_L0:;
  4763. __Pyx_XGIVEREF(__pyx_r);
  4764. __Pyx_RefNannyFinishContext();
  4765. return __pyx_r;
  4766. }
  4767. /* "gedlibpy.pyx":483
  4768. *
  4769. *
  4770. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4771. * """
  4772. * Sets an edit cost function to the environment, if it exists.
  4773. */
  4774. /* Python wrapper */
  4775. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4776. static char __pyx_doc_8gedlibpy_6GEDEnv_42set_edit_cost[] = "\n\t\t\tSets an edit cost function to the environment, if it exists. \n\t\n\t\t\t:param edit_cost: The name of the edit cost function\n\t\t\t:type edit_cost: string\n\t\t\t:param edi_cost_constant: The parameters you will add to the editCost, empty by default\n\t\t\t:type edit_cost_constant: list\n\t\t\t\n\t\t\t.. seealso:: list_of_edit_cost_options\n\t\t\t.. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise. \n\t\t";
  4777. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4778. PyObject *__pyx_v_edit_cost = 0;
  4779. PyObject *__pyx_v_edit_cost_constant = 0;
  4780. PyObject *__pyx_r = 0;
  4781. __Pyx_RefNannyDeclarations
  4782. __Pyx_RefNannySetupContext("set_edit_cost (wrapper)", 0);
  4783. {
  4784. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost,&__pyx_n_s_edit_cost_constant,0};
  4785. PyObject* values[2] = {0,0};
  4786. values[1] = __pyx_k__2;
  4787. if (unlikely(__pyx_kwds)) {
  4788. Py_ssize_t kw_args;
  4789. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4790. switch (pos_args) {
  4791. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4792. CYTHON_FALLTHROUGH;
  4793. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4794. CYTHON_FALLTHROUGH;
  4795. case 0: break;
  4796. default: goto __pyx_L5_argtuple_error;
  4797. }
  4798. kw_args = PyDict_Size(__pyx_kwds);
  4799. switch (pos_args) {
  4800. case 0:
  4801. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  4802. else goto __pyx_L5_argtuple_error;
  4803. CYTHON_FALLTHROUGH;
  4804. case 1:
  4805. if (kw_args > 0) {
  4806. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  4807. if (value) { values[1] = value; kw_args--; }
  4808. }
  4809. }
  4810. if (unlikely(kw_args > 0)) {
  4811. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 483, __pyx_L3_error)
  4812. }
  4813. } else {
  4814. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4815. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4816. CYTHON_FALLTHROUGH;
  4817. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4818. break;
  4819. default: goto __pyx_L5_argtuple_error;
  4820. }
  4821. }
  4822. __pyx_v_edit_cost = values[0];
  4823. __pyx_v_edit_cost_constant = values[1];
  4824. }
  4825. goto __pyx_L4_argument_unpacking_done;
  4826. __pyx_L5_argtuple_error:;
  4827. __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 483, __pyx_L3_error)
  4828. __pyx_L3_error:;
  4829. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4830. __Pyx_RefNannyFinishContext();
  4831. return NULL;
  4832. __pyx_L4_argument_unpacking_done:;
  4833. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edit_cost, __pyx_v_edit_cost_constant);
  4834. /* function exit code */
  4835. __Pyx_RefNannyFinishContext();
  4836. return __pyx_r;
  4837. }
  4838. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_42set_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_edit_cost_constant) {
  4839. PyObject *__pyx_v_edit_cost_b = NULL;
  4840. PyObject *__pyx_r = NULL;
  4841. __Pyx_RefNannyDeclarations
  4842. PyObject *__pyx_t_1 = NULL;
  4843. int __pyx_t_2;
  4844. int __pyx_t_3;
  4845. PyObject *__pyx_t_4 = NULL;
  4846. PyObject *__pyx_t_5 = NULL;
  4847. std::string __pyx_t_6;
  4848. std::vector<double> __pyx_t_7;
  4849. __Pyx_RefNannySetupContext("set_edit_cost", 0);
  4850. /* "gedlibpy.pyx":495
  4851. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4852. * """
  4853. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4854. * edit_cost_b = edit_cost.encode('utf-8')
  4855. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4856. */
  4857. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
  4858. __Pyx_GOTREF(__pyx_t_1);
  4859. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_edit_cost, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 495, __pyx_L1_error)
  4860. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4861. __pyx_t_3 = (__pyx_t_2 != 0);
  4862. if (likely(__pyx_t_3)) {
  4863. /* "gedlibpy.pyx":496
  4864. * """
  4865. * if edit_cost in list_of_edit_cost_options:
  4866. * edit_cost_b = edit_cost.encode('utf-8') # <<<<<<<<<<<<<<
  4867. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4868. * else:
  4869. */
  4870. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edit_cost, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
  4871. __Pyx_GOTREF(__pyx_t_4);
  4872. __pyx_t_5 = NULL;
  4873. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  4874. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4875. if (likely(__pyx_t_5)) {
  4876. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4877. __Pyx_INCREF(__pyx_t_5);
  4878. __Pyx_INCREF(function);
  4879. __Pyx_DECREF_SET(__pyx_t_4, function);
  4880. }
  4881. }
  4882. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  4883. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4884. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
  4885. __Pyx_GOTREF(__pyx_t_1);
  4886. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4887. __pyx_v_edit_cost_b = __pyx_t_1;
  4888. __pyx_t_1 = 0;
  4889. /* "gedlibpy.pyx":497
  4890. * if edit_cost in list_of_edit_cost_options:
  4891. * edit_cost_b = edit_cost.encode('utf-8')
  4892. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) # <<<<<<<<<<<<<<
  4893. * else:
  4894. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function")
  4895. */
  4896. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_edit_cost_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
  4897. __pyx_t_7 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 497, __pyx_L1_error)
  4898. try {
  4899. __pyx_v_self->c_env->setEditCost(__pyx_t_6, __pyx_t_7);
  4900. } catch(...) {
  4901. __Pyx_CppExn2PyErr();
  4902. __PYX_ERR(0, 497, __pyx_L1_error)
  4903. }
  4904. /* "gedlibpy.pyx":495
  4905. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4906. * """
  4907. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4908. * edit_cost_b = edit_cost.encode('utf-8')
  4909. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4910. */
  4911. goto __pyx_L3;
  4912. }
  4913. /* "gedlibpy.pyx":499
  4914. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4915. * else:
  4916. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") # <<<<<<<<<<<<<<
  4917. *
  4918. *
  4919. */
  4920. /*else*/ {
  4921. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 499, __pyx_L1_error)
  4922. __Pyx_GOTREF(__pyx_t_4);
  4923. __pyx_t_5 = NULL;
  4924. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  4925. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4926. if (likely(__pyx_t_5)) {
  4927. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4928. __Pyx_INCREF(__pyx_t_5);
  4929. __Pyx_INCREF(function);
  4930. __Pyx_DECREF_SET(__pyx_t_4, function);
  4931. }
  4932. }
  4933. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_edit_cost_function_doesn_t) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_edit_cost_function_doesn_t);
  4934. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4935. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  4936. __Pyx_GOTREF(__pyx_t_1);
  4937. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4938. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  4939. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4940. __PYX_ERR(0, 499, __pyx_L1_error)
  4941. }
  4942. __pyx_L3:;
  4943. /* "gedlibpy.pyx":483
  4944. *
  4945. *
  4946. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4947. * """
  4948. * Sets an edit cost function to the environment, if it exists.
  4949. */
  4950. /* function exit code */
  4951. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4952. goto __pyx_L0;
  4953. __pyx_L1_error:;
  4954. __Pyx_XDECREF(__pyx_t_1);
  4955. __Pyx_XDECREF(__pyx_t_4);
  4956. __Pyx_XDECREF(__pyx_t_5);
  4957. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4958. __pyx_r = NULL;
  4959. __pyx_L0:;
  4960. __Pyx_XDECREF(__pyx_v_edit_cost_b);
  4961. __Pyx_XGIVEREF(__pyx_r);
  4962. __Pyx_RefNannyFinishContext();
  4963. return __pyx_r;
  4964. }
  4965. /* "gedlibpy.pyx":502
  4966. *
  4967. *
  4968. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4969. * """
  4970. * Sets an personal edit cost function to the environment.
  4971. */
  4972. /* Python wrapper */
  4973. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4974. static char __pyx_doc_8gedlibpy_6GEDEnv_44set_personal_edit_cost[] = "\n\t\t\tSets an personal edit cost function to the environment.\n\t\n\t\t\t:param edit_cost_constant: The parameters you will add to the editCost, empty by default\n\t\t\t:type edit_cost_constant: list\n\t\n\t\t\t.. seealso:: list_of_edit_cost_options, set_edit_cost()\n\t\t\t.. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function. \n\t\t";
  4975. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4976. PyObject *__pyx_v_edit_cost_constant = 0;
  4977. PyObject *__pyx_r = 0;
  4978. __Pyx_RefNannyDeclarations
  4979. __Pyx_RefNannySetupContext("set_personal_edit_cost (wrapper)", 0);
  4980. {
  4981. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost_constant,0};
  4982. PyObject* values[1] = {0};
  4983. values[0] = __pyx_k__3;
  4984. if (unlikely(__pyx_kwds)) {
  4985. Py_ssize_t kw_args;
  4986. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4987. switch (pos_args) {
  4988. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4989. CYTHON_FALLTHROUGH;
  4990. case 0: break;
  4991. default: goto __pyx_L5_argtuple_error;
  4992. }
  4993. kw_args = PyDict_Size(__pyx_kwds);
  4994. switch (pos_args) {
  4995. case 0:
  4996. if (kw_args > 0) {
  4997. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  4998. if (value) { values[0] = value; kw_args--; }
  4999. }
  5000. }
  5001. if (unlikely(kw_args > 0)) {
  5002. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 502, __pyx_L3_error)
  5003. }
  5004. } else {
  5005. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5006. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5007. CYTHON_FALLTHROUGH;
  5008. case 0: break;
  5009. default: goto __pyx_L5_argtuple_error;
  5010. }
  5011. }
  5012. __pyx_v_edit_cost_constant = values[0];
  5013. }
  5014. goto __pyx_L4_argument_unpacking_done;
  5015. __pyx_L5_argtuple_error:;
  5016. __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 502, __pyx_L3_error)
  5017. __pyx_L3_error:;
  5018. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5019. __Pyx_RefNannyFinishContext();
  5020. return NULL;
  5021. __pyx_L4_argument_unpacking_done:;
  5022. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edit_cost_constant);
  5023. /* function exit code */
  5024. __Pyx_RefNannyFinishContext();
  5025. return __pyx_r;
  5026. }
  5027. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost_constant) {
  5028. PyObject *__pyx_r = NULL;
  5029. __Pyx_RefNannyDeclarations
  5030. std::vector<double> __pyx_t_1;
  5031. __Pyx_RefNannySetupContext("set_personal_edit_cost", 0);
  5032. /* "gedlibpy.pyx":512
  5033. * .. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function.
  5034. * """
  5035. * self.c_env.setPersonalEditCost(edit_cost_constant) # <<<<<<<<<<<<<<
  5036. *
  5037. *
  5038. */
  5039. __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 512, __pyx_L1_error)
  5040. try {
  5041. __pyx_v_self->c_env->setPersonalEditCost(__pyx_t_1);
  5042. } catch(...) {
  5043. __Pyx_CppExn2PyErr();
  5044. __PYX_ERR(0, 512, __pyx_L1_error)
  5045. }
  5046. /* "gedlibpy.pyx":502
  5047. *
  5048. *
  5049. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5050. * """
  5051. * Sets an personal edit cost function to the environment.
  5052. */
  5053. /* function exit code */
  5054. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5055. goto __pyx_L0;
  5056. __pyx_L1_error:;
  5057. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5058. __pyx_r = NULL;
  5059. __pyx_L0:;
  5060. __Pyx_XGIVEREF(__pyx_r);
  5061. __Pyx_RefNannyFinishContext();
  5062. return __pyx_r;
  5063. }
  5064. /* "gedlibpy.pyx":515
  5065. *
  5066. *
  5067. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5068. * """
  5069. * Initializes the environment with the chosen edit cost function and graphs.
  5070. */
  5071. /* Python wrapper */
  5072. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5073. static char __pyx_doc_8gedlibpy_6GEDEnv_46init[] = "\n\t\t\tInitializes the environment with the chosen edit cost function and graphs.\n\t\n\t\t\t:param init_option: The name of the init option, \"EAGER_WITHOUT_SHUFFLED_COPIES\" by default\n\t\t\t:type init_option: string\n\t\t\t\n\t\t\t.. seealso:: list_of_init_options\n\t\t\t.. warning:: No modification were allowed after initialization. Try to make sure your choices is correct. You can though clear or add a graph, but recall init() after that. \n\t\t\t.. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.\n\t\t";
  5074. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5075. PyObject *__pyx_v_init_option = 0;
  5076. PyObject *__pyx_v_print_to_stdout = 0;
  5077. PyObject *__pyx_r = 0;
  5078. __Pyx_RefNannyDeclarations
  5079. __Pyx_RefNannySetupContext("init (wrapper)", 0);
  5080. {
  5081. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_init_option,&__pyx_n_s_print_to_stdout,0};
  5082. PyObject* values[2] = {0,0};
  5083. values[0] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  5084. values[1] = ((PyObject *)Py_False);
  5085. if (unlikely(__pyx_kwds)) {
  5086. Py_ssize_t kw_args;
  5087. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5088. switch (pos_args) {
  5089. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5090. CYTHON_FALLTHROUGH;
  5091. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5092. CYTHON_FALLTHROUGH;
  5093. case 0: break;
  5094. default: goto __pyx_L5_argtuple_error;
  5095. }
  5096. kw_args = PyDict_Size(__pyx_kwds);
  5097. switch (pos_args) {
  5098. case 0:
  5099. if (kw_args > 0) {
  5100. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  5101. if (value) { values[0] = value; kw_args--; }
  5102. }
  5103. CYTHON_FALLTHROUGH;
  5104. case 1:
  5105. if (kw_args > 0) {
  5106. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_print_to_stdout);
  5107. if (value) { values[1] = value; kw_args--; }
  5108. }
  5109. }
  5110. if (unlikely(kw_args > 0)) {
  5111. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
  5112. }
  5113. } else {
  5114. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5115. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5116. CYTHON_FALLTHROUGH;
  5117. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5118. CYTHON_FALLTHROUGH;
  5119. case 0: break;
  5120. default: goto __pyx_L5_argtuple_error;
  5121. }
  5122. }
  5123. __pyx_v_init_option = values[0];
  5124. __pyx_v_print_to_stdout = values[1];
  5125. }
  5126. goto __pyx_L4_argument_unpacking_done;
  5127. __pyx_L5_argtuple_error:;
  5128. __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 515, __pyx_L3_error)
  5129. __pyx_L3_error:;
  5130. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5131. __Pyx_RefNannyFinishContext();
  5132. return NULL;
  5133. __pyx_L4_argument_unpacking_done:;
  5134. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_46init(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_init_option, __pyx_v_print_to_stdout);
  5135. /* function exit code */
  5136. __Pyx_RefNannyFinishContext();
  5137. return __pyx_r;
  5138. }
  5139. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_46init(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_init_option, PyObject *__pyx_v_print_to_stdout) {
  5140. PyObject *__pyx_v_init_option_b = NULL;
  5141. PyObject *__pyx_r = NULL;
  5142. __Pyx_RefNannyDeclarations
  5143. PyObject *__pyx_t_1 = NULL;
  5144. int __pyx_t_2;
  5145. int __pyx_t_3;
  5146. PyObject *__pyx_t_4 = NULL;
  5147. PyObject *__pyx_t_5 = NULL;
  5148. std::string __pyx_t_6;
  5149. bool __pyx_t_7;
  5150. __Pyx_RefNannySetupContext("init", 0);
  5151. /* "gedlibpy.pyx":526
  5152. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5153. * """
  5154. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5155. * init_option_b = init_option.encode('utf-8')
  5156. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5157. */
  5158. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 526, __pyx_L1_error)
  5159. __Pyx_GOTREF(__pyx_t_1);
  5160. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_init_option, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 526, __pyx_L1_error)
  5161. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5162. __pyx_t_3 = (__pyx_t_2 != 0);
  5163. if (likely(__pyx_t_3)) {
  5164. /* "gedlibpy.pyx":527
  5165. * """
  5166. * if init_option in list_of_init_options:
  5167. * init_option_b = init_option.encode('utf-8') # <<<<<<<<<<<<<<
  5168. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5169. * else:
  5170. */
  5171. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_init_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 527, __pyx_L1_error)
  5172. __Pyx_GOTREF(__pyx_t_4);
  5173. __pyx_t_5 = NULL;
  5174. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5175. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5176. if (likely(__pyx_t_5)) {
  5177. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5178. __Pyx_INCREF(__pyx_t_5);
  5179. __Pyx_INCREF(function);
  5180. __Pyx_DECREF_SET(__pyx_t_4, function);
  5181. }
  5182. }
  5183. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  5184. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5185. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 527, __pyx_L1_error)
  5186. __Pyx_GOTREF(__pyx_t_1);
  5187. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5188. __pyx_v_init_option_b = __pyx_t_1;
  5189. __pyx_t_1 = 0;
  5190. /* "gedlibpy.pyx":528
  5191. * if init_option in list_of_init_options:
  5192. * init_option_b = init_option.encode('utf-8')
  5193. * self.c_env.initEnv(init_option_b, print_to_stdout) # <<<<<<<<<<<<<<
  5194. * else:
  5195. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.")
  5196. */
  5197. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_init_option_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error)
  5198. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_print_to_stdout); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error)
  5199. try {
  5200. __pyx_v_self->c_env->initEnv(__pyx_t_6, __pyx_t_7);
  5201. } catch(...) {
  5202. __Pyx_CppExn2PyErr();
  5203. __PYX_ERR(0, 528, __pyx_L1_error)
  5204. }
  5205. /* "gedlibpy.pyx":526
  5206. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5207. * """
  5208. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5209. * init_option_b = init_option.encode('utf-8')
  5210. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5211. */
  5212. goto __pyx_L3;
  5213. }
  5214. /* "gedlibpy.pyx":530
  5215. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5216. * else:
  5217. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") # <<<<<<<<<<<<<<
  5218. *
  5219. *
  5220. */
  5221. /*else*/ {
  5222. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 530, __pyx_L1_error)
  5223. __Pyx_GOTREF(__pyx_t_4);
  5224. __pyx_t_5 = NULL;
  5225. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5226. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5227. if (likely(__pyx_t_5)) {
  5228. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5229. __Pyx_INCREF(__pyx_t_5);
  5230. __Pyx_INCREF(function);
  5231. __Pyx_DECREF_SET(__pyx_t_4, function);
  5232. }
  5233. }
  5234. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_init_option_doesn_t_exist_p) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_init_option_doesn_t_exist_p);
  5235. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5236. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
  5237. __Pyx_GOTREF(__pyx_t_1);
  5238. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5239. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5240. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5241. __PYX_ERR(0, 530, __pyx_L1_error)
  5242. }
  5243. __pyx_L3:;
  5244. /* "gedlibpy.pyx":515
  5245. *
  5246. *
  5247. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5248. * """
  5249. * Initializes the environment with the chosen edit cost function and graphs.
  5250. */
  5251. /* function exit code */
  5252. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5253. goto __pyx_L0;
  5254. __pyx_L1_error:;
  5255. __Pyx_XDECREF(__pyx_t_1);
  5256. __Pyx_XDECREF(__pyx_t_4);
  5257. __Pyx_XDECREF(__pyx_t_5);
  5258. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5259. __pyx_r = NULL;
  5260. __pyx_L0:;
  5261. __Pyx_XDECREF(__pyx_v_init_option_b);
  5262. __Pyx_XGIVEREF(__pyx_r);
  5263. __Pyx_RefNannyFinishContext();
  5264. return __pyx_r;
  5265. }
  5266. /* "gedlibpy.pyx":533
  5267. *
  5268. *
  5269. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5270. * """
  5271. * Sets a computation method to the environment, if its exists.
  5272. */
  5273. /* Python wrapper */
  5274. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5275. static char __pyx_doc_8gedlibpy_6GEDEnv_48set_method[] = "\n\t\t\tSets a computation method to the environment, if its exists. \n\t\n\t\t\t:param method: The name of the computation method\n\t\t\t:param options: The options of the method (like bash options), an empty string by default\n\t\t\t:type method: string\n\t\t\t:type options: string\n\t\t\t\n\t\t\t.. seealso:: init_method(), list_of_method_options\n\t\t\t.. note:: Try to make sure the edit cost function exists with list_of_method_options, raise an error otherwise. Call init_method() after your set. \n\t\t";
  5276. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5277. PyObject *__pyx_v_method = 0;
  5278. PyObject *__pyx_v_options = 0;
  5279. PyObject *__pyx_r = 0;
  5280. __Pyx_RefNannyDeclarations
  5281. __Pyx_RefNannySetupContext("set_method (wrapper)", 0);
  5282. {
  5283. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_options,0};
  5284. PyObject* values[2] = {0,0};
  5285. values[1] = ((PyObject *)__pyx_kp_u_);
  5286. if (unlikely(__pyx_kwds)) {
  5287. Py_ssize_t kw_args;
  5288. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5289. switch (pos_args) {
  5290. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5291. CYTHON_FALLTHROUGH;
  5292. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5293. CYTHON_FALLTHROUGH;
  5294. case 0: break;
  5295. default: goto __pyx_L5_argtuple_error;
  5296. }
  5297. kw_args = PyDict_Size(__pyx_kwds);
  5298. switch (pos_args) {
  5299. case 0:
  5300. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  5301. else goto __pyx_L5_argtuple_error;
  5302. CYTHON_FALLTHROUGH;
  5303. case 1:
  5304. if (kw_args > 0) {
  5305. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  5306. if (value) { values[1] = value; kw_args--; }
  5307. }
  5308. }
  5309. if (unlikely(kw_args > 0)) {
  5310. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 533, __pyx_L3_error)
  5311. }
  5312. } else {
  5313. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5314. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5315. CYTHON_FALLTHROUGH;
  5316. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5317. break;
  5318. default: goto __pyx_L5_argtuple_error;
  5319. }
  5320. }
  5321. __pyx_v_method = values[0];
  5322. __pyx_v_options = values[1];
  5323. }
  5324. goto __pyx_L4_argument_unpacking_done;
  5325. __pyx_L5_argtuple_error:;
  5326. __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 533, __pyx_L3_error)
  5327. __pyx_L3_error:;
  5328. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5329. __Pyx_RefNannyFinishContext();
  5330. return NULL;
  5331. __pyx_L4_argument_unpacking_done:;
  5332. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_48set_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_method, __pyx_v_options);
  5333. /* function exit code */
  5334. __Pyx_RefNannyFinishContext();
  5335. return __pyx_r;
  5336. }
  5337. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_options) {
  5338. PyObject *__pyx_v_method_b = NULL;
  5339. PyObject *__pyx_r = NULL;
  5340. __Pyx_RefNannyDeclarations
  5341. PyObject *__pyx_t_1 = NULL;
  5342. int __pyx_t_2;
  5343. int __pyx_t_3;
  5344. PyObject *__pyx_t_4 = NULL;
  5345. PyObject *__pyx_t_5 = NULL;
  5346. std::string __pyx_t_6;
  5347. std::string __pyx_t_7;
  5348. __Pyx_RefNannySetupContext("set_method", 0);
  5349. /* "gedlibpy.pyx":545
  5350. * .. note:: Try to make sure the edit cost function exists with list_of_method_options, raise an error otherwise. Call init_method() after your set.
  5351. * """
  5352. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5353. * method_b = method.encode('utf-8')
  5354. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5355. */
  5356. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 545, __pyx_L1_error)
  5357. __Pyx_GOTREF(__pyx_t_1);
  5358. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 545, __pyx_L1_error)
  5359. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5360. __pyx_t_3 = (__pyx_t_2 != 0);
  5361. if (likely(__pyx_t_3)) {
  5362. /* "gedlibpy.pyx":546
  5363. * """
  5364. * if method in list_of_method_options:
  5365. * method_b = method.encode('utf-8') # <<<<<<<<<<<<<<
  5366. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5367. * else:
  5368. */
  5369. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
  5370. __Pyx_GOTREF(__pyx_t_4);
  5371. __pyx_t_5 = NULL;
  5372. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5373. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5374. if (likely(__pyx_t_5)) {
  5375. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5376. __Pyx_INCREF(__pyx_t_5);
  5377. __Pyx_INCREF(function);
  5378. __Pyx_DECREF_SET(__pyx_t_4, function);
  5379. }
  5380. }
  5381. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  5382. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5383. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 546, __pyx_L1_error)
  5384. __Pyx_GOTREF(__pyx_t_1);
  5385. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5386. __pyx_v_method_b = __pyx_t_1;
  5387. __pyx_t_1 = 0;
  5388. /* "gedlibpy.pyx":547
  5389. * if method in list_of_method_options:
  5390. * method_b = method.encode('utf-8')
  5391. * self.c_env.setMethod(method_b, options.encode('utf-8')) # <<<<<<<<<<<<<<
  5392. * else:
  5393. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method")
  5394. */
  5395. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_method_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
  5396. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 547, __pyx_L1_error)
  5397. __Pyx_GOTREF(__pyx_t_4);
  5398. __pyx_t_5 = NULL;
  5399. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5400. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5401. if (likely(__pyx_t_5)) {
  5402. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5403. __Pyx_INCREF(__pyx_t_5);
  5404. __Pyx_INCREF(function);
  5405. __Pyx_DECREF_SET(__pyx_t_4, function);
  5406. }
  5407. }
  5408. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_utf_8);
  5409. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5410. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  5411. __Pyx_GOTREF(__pyx_t_1);
  5412. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5413. __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 547, __pyx_L1_error)
  5414. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5415. try {
  5416. __pyx_v_self->c_env->setMethod(__pyx_t_6, __pyx_t_7);
  5417. } catch(...) {
  5418. __Pyx_CppExn2PyErr();
  5419. __PYX_ERR(0, 547, __pyx_L1_error)
  5420. }
  5421. /* "gedlibpy.pyx":545
  5422. * .. note:: Try to make sure the edit cost function exists with list_of_method_options, raise an error otherwise. Call init_method() after your set.
  5423. * """
  5424. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5425. * method_b = method.encode('utf-8')
  5426. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5427. */
  5428. goto __pyx_L3;
  5429. }
  5430. /* "gedlibpy.pyx":549
  5431. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5432. * else:
  5433. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") # <<<<<<<<<<<<<<
  5434. *
  5435. *
  5436. */
  5437. /*else*/ {
  5438. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
  5439. __Pyx_GOTREF(__pyx_t_4);
  5440. __pyx_t_5 = NULL;
  5441. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5442. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5443. if (likely(__pyx_t_5)) {
  5444. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5445. __Pyx_INCREF(__pyx_t_5);
  5446. __Pyx_INCREF(function);
  5447. __Pyx_DECREF_SET(__pyx_t_4, function);
  5448. }
  5449. }
  5450. __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_kp_u_This_method_doesn_t_exist_please) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_kp_u_This_method_doesn_t_exist_please);
  5451. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5452. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
  5453. __Pyx_GOTREF(__pyx_t_1);
  5454. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5455. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5456. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5457. __PYX_ERR(0, 549, __pyx_L1_error)
  5458. }
  5459. __pyx_L3:;
  5460. /* "gedlibpy.pyx":533
  5461. *
  5462. *
  5463. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5464. * """
  5465. * Sets a computation method to the environment, if its exists.
  5466. */
  5467. /* function exit code */
  5468. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5469. goto __pyx_L0;
  5470. __pyx_L1_error:;
  5471. __Pyx_XDECREF(__pyx_t_1);
  5472. __Pyx_XDECREF(__pyx_t_4);
  5473. __Pyx_XDECREF(__pyx_t_5);
  5474. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5475. __pyx_r = NULL;
  5476. __pyx_L0:;
  5477. __Pyx_XDECREF(__pyx_v_method_b);
  5478. __Pyx_XGIVEREF(__pyx_r);
  5479. __Pyx_RefNannyFinishContext();
  5480. return __pyx_r;
  5481. }
  5482. /* "gedlibpy.pyx":552
  5483. *
  5484. *
  5485. * def init_method(self) : # <<<<<<<<<<<<<<
  5486. * """
  5487. * Inits the environment with the set method.
  5488. */
  5489. /* Python wrapper */
  5490. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5491. static char __pyx_doc_8gedlibpy_6GEDEnv_50init_method[] = "\n\t\t\tInits the environment with the set method.\n\t\n\t\t\t.. seealso:: set_method(), list_of_method_options\n\t\t\t.. note:: Call this function after set the method. You can't launch computation or change the method after that. \n\t\t";
  5492. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5493. PyObject *__pyx_r = 0;
  5494. __Pyx_RefNannyDeclarations
  5495. __Pyx_RefNannySetupContext("init_method (wrapper)", 0);
  5496. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_50init_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5497. /* function exit code */
  5498. __Pyx_RefNannyFinishContext();
  5499. return __pyx_r;
  5500. }
  5501. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5502. PyObject *__pyx_r = NULL;
  5503. __Pyx_RefNannyDeclarations
  5504. __Pyx_RefNannySetupContext("init_method", 0);
  5505. /* "gedlibpy.pyx":559
  5506. * .. note:: Call this function after set the method. You can't launch computation or change the method after that.
  5507. * """
  5508. * self.c_env.initMethod() # <<<<<<<<<<<<<<
  5509. *
  5510. *
  5511. */
  5512. try {
  5513. __pyx_v_self->c_env->initMethod();
  5514. } catch(...) {
  5515. __Pyx_CppExn2PyErr();
  5516. __PYX_ERR(0, 559, __pyx_L1_error)
  5517. }
  5518. /* "gedlibpy.pyx":552
  5519. *
  5520. *
  5521. * def init_method(self) : # <<<<<<<<<<<<<<
  5522. * """
  5523. * Inits the environment with the set method.
  5524. */
  5525. /* function exit code */
  5526. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5527. goto __pyx_L0;
  5528. __pyx_L1_error:;
  5529. __Pyx_AddTraceback("gedlibpy.GEDEnv.init_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5530. __pyx_r = NULL;
  5531. __pyx_L0:;
  5532. __Pyx_XGIVEREF(__pyx_r);
  5533. __Pyx_RefNannyFinishContext();
  5534. return __pyx_r;
  5535. }
  5536. /* "gedlibpy.pyx":562
  5537. *
  5538. *
  5539. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5540. * """
  5541. * Returns the initialization time.
  5542. */
  5543. /* Python wrapper */
  5544. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5545. static char __pyx_doc_8gedlibpy_6GEDEnv_52get_init_time[] = "\n\t\t\tReturns the initialization time.\n\t\n\t\t\t:return: The initialization time\n\t\t\t:rtype: double\n\t\t";
  5546. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5547. PyObject *__pyx_r = 0;
  5548. __Pyx_RefNannyDeclarations
  5549. __Pyx_RefNannySetupContext("get_init_time (wrapper)", 0);
  5550. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5551. /* function exit code */
  5552. __Pyx_RefNannyFinishContext();
  5553. return __pyx_r;
  5554. }
  5555. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5556. PyObject *__pyx_r = NULL;
  5557. __Pyx_RefNannyDeclarations
  5558. double __pyx_t_1;
  5559. PyObject *__pyx_t_2 = NULL;
  5560. __Pyx_RefNannySetupContext("get_init_time", 0);
  5561. /* "gedlibpy.pyx":569
  5562. * :rtype: double
  5563. * """
  5564. * return self.c_env.getInitime() # <<<<<<<<<<<<<<
  5565. *
  5566. *
  5567. */
  5568. __Pyx_XDECREF(__pyx_r);
  5569. try {
  5570. __pyx_t_1 = __pyx_v_self->c_env->getInitime();
  5571. } catch(...) {
  5572. __Pyx_CppExn2PyErr();
  5573. __PYX_ERR(0, 569, __pyx_L1_error)
  5574. }
  5575. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 569, __pyx_L1_error)
  5576. __Pyx_GOTREF(__pyx_t_2);
  5577. __pyx_r = __pyx_t_2;
  5578. __pyx_t_2 = 0;
  5579. goto __pyx_L0;
  5580. /* "gedlibpy.pyx":562
  5581. *
  5582. *
  5583. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5584. * """
  5585. * Returns the initialization time.
  5586. */
  5587. /* function exit code */
  5588. __pyx_L1_error:;
  5589. __Pyx_XDECREF(__pyx_t_2);
  5590. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5591. __pyx_r = NULL;
  5592. __pyx_L0:;
  5593. __Pyx_XGIVEREF(__pyx_r);
  5594. __Pyx_RefNannyFinishContext();
  5595. return __pyx_r;
  5596. }
  5597. /* "gedlibpy.pyx":572
  5598. *
  5599. *
  5600. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5601. * """
  5602. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5603. */
  5604. /* Python wrapper */
  5605. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5606. static char __pyx_doc_8gedlibpy_6GEDEnv_54run_method[] = "\n\t\t\tComputes the edit distance between two graphs g and h, with the edit cost function and method computation selected. \n\t\n\t\t\t:param g: The Id of the first graph to compare\n\t\t\t:param h: The Id of the second graph to compare\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t\n\t\t\t.. seealso:: get_upper_bound(), get_lower_bound(), get_forward_map(), get_backward_map(), get_runtime(), quasimetric_cost()\n\t\t\t.. note:: This function only compute the distance between two graphs, without returning a result. Use the differents function to see the result between the two graphs. \n\t\t";
  5607. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5608. PyObject *__pyx_v_g = 0;
  5609. PyObject *__pyx_v_h = 0;
  5610. PyObject *__pyx_r = 0;
  5611. __Pyx_RefNannyDeclarations
  5612. __Pyx_RefNannySetupContext("run_method (wrapper)", 0);
  5613. {
  5614. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5615. PyObject* values[2] = {0,0};
  5616. if (unlikely(__pyx_kwds)) {
  5617. Py_ssize_t kw_args;
  5618. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5619. switch (pos_args) {
  5620. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5621. CYTHON_FALLTHROUGH;
  5622. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5623. CYTHON_FALLTHROUGH;
  5624. case 0: break;
  5625. default: goto __pyx_L5_argtuple_error;
  5626. }
  5627. kw_args = PyDict_Size(__pyx_kwds);
  5628. switch (pos_args) {
  5629. case 0:
  5630. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5631. else goto __pyx_L5_argtuple_error;
  5632. CYTHON_FALLTHROUGH;
  5633. case 1:
  5634. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5635. else {
  5636. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 572, __pyx_L3_error)
  5637. }
  5638. }
  5639. if (unlikely(kw_args > 0)) {
  5640. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 572, __pyx_L3_error)
  5641. }
  5642. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5643. goto __pyx_L5_argtuple_error;
  5644. } else {
  5645. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5646. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5647. }
  5648. __pyx_v_g = values[0];
  5649. __pyx_v_h = values[1];
  5650. }
  5651. goto __pyx_L4_argument_unpacking_done;
  5652. __pyx_L5_argtuple_error:;
  5653. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 572, __pyx_L3_error)
  5654. __pyx_L3_error:;
  5655. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5656. __Pyx_RefNannyFinishContext();
  5657. return NULL;
  5658. __pyx_L4_argument_unpacking_done:;
  5659. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_54run_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5660. /* function exit code */
  5661. __Pyx_RefNannyFinishContext();
  5662. return __pyx_r;
  5663. }
  5664. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5665. PyObject *__pyx_r = NULL;
  5666. __Pyx_RefNannyDeclarations
  5667. size_t __pyx_t_1;
  5668. size_t __pyx_t_2;
  5669. __Pyx_RefNannySetupContext("run_method", 0);
  5670. /* "gedlibpy.pyx":584
  5671. * .. note:: This function only compute the distance between two graphs, without returning a result. Use the differents function to see the result between the two graphs.
  5672. * """
  5673. * self.c_env.runMethod(g, h) # <<<<<<<<<<<<<<
  5674. *
  5675. *
  5676. */
  5677. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
  5678. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 584, __pyx_L1_error)
  5679. try {
  5680. __pyx_v_self->c_env->runMethod(__pyx_t_1, __pyx_t_2);
  5681. } catch(...) {
  5682. __Pyx_CppExn2PyErr();
  5683. __PYX_ERR(0, 584, __pyx_L1_error)
  5684. }
  5685. /* "gedlibpy.pyx":572
  5686. *
  5687. *
  5688. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5689. * """
  5690. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5691. */
  5692. /* function exit code */
  5693. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5694. goto __pyx_L0;
  5695. __pyx_L1_error:;
  5696. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5697. __pyx_r = NULL;
  5698. __pyx_L0:;
  5699. __Pyx_XGIVEREF(__pyx_r);
  5700. __Pyx_RefNannyFinishContext();
  5701. return __pyx_r;
  5702. }
  5703. /* "gedlibpy.pyx":587
  5704. *
  5705. *
  5706. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5707. * """
  5708. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5709. */
  5710. /* Python wrapper */
  5711. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5712. static char __pyx_doc_8gedlibpy_6GEDEnv_56get_upper_bound[] = "\n\t\t\tReturns the upper bound of the edit distance cost between two graphs g and h. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The upper bound of the edit distance cost\n\t\t\t:rtype: double\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_lower_bound(), get_forward_map(), get_backward_map(), get_runtime(), quasimetric_cost()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: The upper bound is equivalent to the result of the pessimist edit distance cost. Methods are heuristics so the library can't compute the real perfect result because it's NP-Hard problem.\n\t\t";
  5713. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5714. PyObject *__pyx_v_g = 0;
  5715. PyObject *__pyx_v_h = 0;
  5716. PyObject *__pyx_r = 0;
  5717. __Pyx_RefNannyDeclarations
  5718. __Pyx_RefNannySetupContext("get_upper_bound (wrapper)", 0);
  5719. {
  5720. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5721. PyObject* values[2] = {0,0};
  5722. if (unlikely(__pyx_kwds)) {
  5723. Py_ssize_t kw_args;
  5724. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5725. switch (pos_args) {
  5726. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5727. CYTHON_FALLTHROUGH;
  5728. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5729. CYTHON_FALLTHROUGH;
  5730. case 0: break;
  5731. default: goto __pyx_L5_argtuple_error;
  5732. }
  5733. kw_args = PyDict_Size(__pyx_kwds);
  5734. switch (pos_args) {
  5735. case 0:
  5736. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5737. else goto __pyx_L5_argtuple_error;
  5738. CYTHON_FALLTHROUGH;
  5739. case 1:
  5740. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5741. else {
  5742. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 587, __pyx_L3_error)
  5743. }
  5744. }
  5745. if (unlikely(kw_args > 0)) {
  5746. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 587, __pyx_L3_error)
  5747. }
  5748. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5749. goto __pyx_L5_argtuple_error;
  5750. } else {
  5751. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5752. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5753. }
  5754. __pyx_v_g = values[0];
  5755. __pyx_v_h = values[1];
  5756. }
  5757. goto __pyx_L4_argument_unpacking_done;
  5758. __pyx_L5_argtuple_error:;
  5759. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 587, __pyx_L3_error)
  5760. __pyx_L3_error:;
  5761. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5762. __Pyx_RefNannyFinishContext();
  5763. return NULL;
  5764. __pyx_L4_argument_unpacking_done:;
  5765. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5766. /* function exit code */
  5767. __Pyx_RefNannyFinishContext();
  5768. return __pyx_r;
  5769. }
  5770. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5771. PyObject *__pyx_r = NULL;
  5772. __Pyx_RefNannyDeclarations
  5773. size_t __pyx_t_1;
  5774. size_t __pyx_t_2;
  5775. double __pyx_t_3;
  5776. PyObject *__pyx_t_4 = NULL;
  5777. __Pyx_RefNannySetupContext("get_upper_bound", 0);
  5778. /* "gedlibpy.pyx":602
  5779. * .. note:: The upper bound is equivalent to the result of the pessimist edit distance cost. Methods are heuristics so the library can't compute the real perfect result because it's NP-Hard problem.
  5780. * """
  5781. * return self.c_env.getUpperBound(g, h) # <<<<<<<<<<<<<<
  5782. *
  5783. *
  5784. */
  5785. __Pyx_XDECREF(__pyx_r);
  5786. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error)
  5787. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 602, __pyx_L1_error)
  5788. try {
  5789. __pyx_t_3 = __pyx_v_self->c_env->getUpperBound(__pyx_t_1, __pyx_t_2);
  5790. } catch(...) {
  5791. __Pyx_CppExn2PyErr();
  5792. __PYX_ERR(0, 602, __pyx_L1_error)
  5793. }
  5794. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 602, __pyx_L1_error)
  5795. __Pyx_GOTREF(__pyx_t_4);
  5796. __pyx_r = __pyx_t_4;
  5797. __pyx_t_4 = 0;
  5798. goto __pyx_L0;
  5799. /* "gedlibpy.pyx":587
  5800. *
  5801. *
  5802. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5803. * """
  5804. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5805. */
  5806. /* function exit code */
  5807. __pyx_L1_error:;
  5808. __Pyx_XDECREF(__pyx_t_4);
  5809. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5810. __pyx_r = NULL;
  5811. __pyx_L0:;
  5812. __Pyx_XGIVEREF(__pyx_r);
  5813. __Pyx_RefNannyFinishContext();
  5814. return __pyx_r;
  5815. }
  5816. /* "gedlibpy.pyx":605
  5817. *
  5818. *
  5819. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5820. * """
  5821. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5822. */
  5823. /* Python wrapper */
  5824. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5825. static char __pyx_doc_8gedlibpy_6GEDEnv_58get_lower_bound[] = "\n\t\t\t Returns the lower bound of the edit distance cost between two graphs g and h. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The lower bound of the edit distance cost\n\t\t\t:rtype: double\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_forward_map(), get_backward_map(), get_runtime(), quasimetric_cost()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function can be ignored, because lower bound doesn't have a crucial utility.\t\n\t\t";
  5826. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5827. PyObject *__pyx_v_g = 0;
  5828. PyObject *__pyx_v_h = 0;
  5829. PyObject *__pyx_r = 0;
  5830. __Pyx_RefNannyDeclarations
  5831. __Pyx_RefNannySetupContext("get_lower_bound (wrapper)", 0);
  5832. {
  5833. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5834. PyObject* values[2] = {0,0};
  5835. if (unlikely(__pyx_kwds)) {
  5836. Py_ssize_t kw_args;
  5837. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5838. switch (pos_args) {
  5839. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5840. CYTHON_FALLTHROUGH;
  5841. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5842. CYTHON_FALLTHROUGH;
  5843. case 0: break;
  5844. default: goto __pyx_L5_argtuple_error;
  5845. }
  5846. kw_args = PyDict_Size(__pyx_kwds);
  5847. switch (pos_args) {
  5848. case 0:
  5849. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5850. else goto __pyx_L5_argtuple_error;
  5851. CYTHON_FALLTHROUGH;
  5852. case 1:
  5853. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5854. else {
  5855. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 605, __pyx_L3_error)
  5856. }
  5857. }
  5858. if (unlikely(kw_args > 0)) {
  5859. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 605, __pyx_L3_error)
  5860. }
  5861. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5862. goto __pyx_L5_argtuple_error;
  5863. } else {
  5864. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5865. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5866. }
  5867. __pyx_v_g = values[0];
  5868. __pyx_v_h = values[1];
  5869. }
  5870. goto __pyx_L4_argument_unpacking_done;
  5871. __pyx_L5_argtuple_error:;
  5872. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 605, __pyx_L3_error)
  5873. __pyx_L3_error:;
  5874. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5875. __Pyx_RefNannyFinishContext();
  5876. return NULL;
  5877. __pyx_L4_argument_unpacking_done:;
  5878. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5879. /* function exit code */
  5880. __Pyx_RefNannyFinishContext();
  5881. return __pyx_r;
  5882. }
  5883. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5884. PyObject *__pyx_r = NULL;
  5885. __Pyx_RefNannyDeclarations
  5886. size_t __pyx_t_1;
  5887. size_t __pyx_t_2;
  5888. double __pyx_t_3;
  5889. PyObject *__pyx_t_4 = NULL;
  5890. __Pyx_RefNannySetupContext("get_lower_bound", 0);
  5891. /* "gedlibpy.pyx":620
  5892. * .. note:: This function can be ignored, because lower bound doesn't have a crucial utility.
  5893. * """
  5894. * return self.c_env.getLowerBound(g, h) # <<<<<<<<<<<<<<
  5895. *
  5896. *
  5897. */
  5898. __Pyx_XDECREF(__pyx_r);
  5899. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error)
  5900. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 620, __pyx_L1_error)
  5901. try {
  5902. __pyx_t_3 = __pyx_v_self->c_env->getLowerBound(__pyx_t_1, __pyx_t_2);
  5903. } catch(...) {
  5904. __Pyx_CppExn2PyErr();
  5905. __PYX_ERR(0, 620, __pyx_L1_error)
  5906. }
  5907. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 620, __pyx_L1_error)
  5908. __Pyx_GOTREF(__pyx_t_4);
  5909. __pyx_r = __pyx_t_4;
  5910. __pyx_t_4 = 0;
  5911. goto __pyx_L0;
  5912. /* "gedlibpy.pyx":605
  5913. *
  5914. *
  5915. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5916. * """
  5917. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5918. */
  5919. /* function exit code */
  5920. __pyx_L1_error:;
  5921. __Pyx_XDECREF(__pyx_t_4);
  5922. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5923. __pyx_r = NULL;
  5924. __pyx_L0:;
  5925. __Pyx_XGIVEREF(__pyx_r);
  5926. __Pyx_RefNannyFinishContext();
  5927. return __pyx_r;
  5928. }
  5929. /* "gedlibpy.pyx":623
  5930. *
  5931. *
  5932. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  5933. * """
  5934. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  5935. */
  5936. /* Python wrapper */
  5937. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5938. static char __pyx_doc_8gedlibpy_6GEDEnv_60get_forward_map[] = "\n\t\t\tReturns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The forward map to the adjacence matrix between nodes of the two graphs\n\t\t\t:rtype: list[npy_uint32]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_lower_bound(), get_backward_map(), get_runtime(), quasimetric_cost(), get_node_map(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! \n\t\t";
  5939. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5940. PyObject *__pyx_v_g = 0;
  5941. PyObject *__pyx_v_h = 0;
  5942. PyObject *__pyx_r = 0;
  5943. __Pyx_RefNannyDeclarations
  5944. __Pyx_RefNannySetupContext("get_forward_map (wrapper)", 0);
  5945. {
  5946. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5947. PyObject* values[2] = {0,0};
  5948. if (unlikely(__pyx_kwds)) {
  5949. Py_ssize_t kw_args;
  5950. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5951. switch (pos_args) {
  5952. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5953. CYTHON_FALLTHROUGH;
  5954. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5955. CYTHON_FALLTHROUGH;
  5956. case 0: break;
  5957. default: goto __pyx_L5_argtuple_error;
  5958. }
  5959. kw_args = PyDict_Size(__pyx_kwds);
  5960. switch (pos_args) {
  5961. case 0:
  5962. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5963. else goto __pyx_L5_argtuple_error;
  5964. CYTHON_FALLTHROUGH;
  5965. case 1:
  5966. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5967. else {
  5968. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 623, __pyx_L3_error)
  5969. }
  5970. }
  5971. if (unlikely(kw_args > 0)) {
  5972. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 623, __pyx_L3_error)
  5973. }
  5974. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5975. goto __pyx_L5_argtuple_error;
  5976. } else {
  5977. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5978. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5979. }
  5980. __pyx_v_g = values[0];
  5981. __pyx_v_h = values[1];
  5982. }
  5983. goto __pyx_L4_argument_unpacking_done;
  5984. __pyx_L5_argtuple_error:;
  5985. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 623, __pyx_L3_error)
  5986. __pyx_L3_error:;
  5987. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5988. __Pyx_RefNannyFinishContext();
  5989. return NULL;
  5990. __pyx_L4_argument_unpacking_done:;
  5991. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5992. /* function exit code */
  5993. __Pyx_RefNannyFinishContext();
  5994. return __pyx_r;
  5995. }
  5996. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5997. PyObject *__pyx_r = NULL;
  5998. __Pyx_RefNannyDeclarations
  5999. size_t __pyx_t_1;
  6000. size_t __pyx_t_2;
  6001. std::vector<npy_uint64> __pyx_t_3;
  6002. PyObject *__pyx_t_4 = NULL;
  6003. __Pyx_RefNannySetupContext("get_forward_map", 0);
  6004. /* "gedlibpy.pyx":638
  6005. * .. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work !
  6006. * """
  6007. * return self.c_env.getForwardMap(g, h) # <<<<<<<<<<<<<<
  6008. *
  6009. *
  6010. */
  6011. __Pyx_XDECREF(__pyx_r);
  6012. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error)
  6013. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error)
  6014. try {
  6015. __pyx_t_3 = __pyx_v_self->c_env->getForwardMap(__pyx_t_1, __pyx_t_2);
  6016. } catch(...) {
  6017. __Pyx_CppExn2PyErr();
  6018. __PYX_ERR(0, 638, __pyx_L1_error)
  6019. }
  6020. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 638, __pyx_L1_error)
  6021. __Pyx_GOTREF(__pyx_t_4);
  6022. __pyx_r = __pyx_t_4;
  6023. __pyx_t_4 = 0;
  6024. goto __pyx_L0;
  6025. /* "gedlibpy.pyx":623
  6026. *
  6027. *
  6028. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  6029. * """
  6030. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6031. */
  6032. /* function exit code */
  6033. __pyx_L1_error:;
  6034. __Pyx_XDECREF(__pyx_t_4);
  6035. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6036. __pyx_r = NULL;
  6037. __pyx_L0:;
  6038. __Pyx_XGIVEREF(__pyx_r);
  6039. __Pyx_RefNannyFinishContext();
  6040. return __pyx_r;
  6041. }
  6042. /* "gedlibpy.pyx":641
  6043. *
  6044. *
  6045. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6046. * """
  6047. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6048. */
  6049. /* Python wrapper */
  6050. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6051. static char __pyx_doc_8gedlibpy_6GEDEnv_62get_backward_map[] = "\n\t\t\tReturns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The backward map to the adjacence matrix between nodes of the two graphs\n\t\t\t:rtype: list[npy_uint32]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_lower_bound(), get_forward_map(), get_runtime(), quasimetric_cost(), get_node_map(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! \n\t\t";
  6052. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6053. PyObject *__pyx_v_g = 0;
  6054. PyObject *__pyx_v_h = 0;
  6055. PyObject *__pyx_r = 0;
  6056. __Pyx_RefNannyDeclarations
  6057. __Pyx_RefNannySetupContext("get_backward_map (wrapper)", 0);
  6058. {
  6059. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6060. PyObject* values[2] = {0,0};
  6061. if (unlikely(__pyx_kwds)) {
  6062. Py_ssize_t kw_args;
  6063. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6064. switch (pos_args) {
  6065. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6066. CYTHON_FALLTHROUGH;
  6067. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6068. CYTHON_FALLTHROUGH;
  6069. case 0: break;
  6070. default: goto __pyx_L5_argtuple_error;
  6071. }
  6072. kw_args = PyDict_Size(__pyx_kwds);
  6073. switch (pos_args) {
  6074. case 0:
  6075. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6076. else goto __pyx_L5_argtuple_error;
  6077. CYTHON_FALLTHROUGH;
  6078. case 1:
  6079. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6080. else {
  6081. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 641, __pyx_L3_error)
  6082. }
  6083. }
  6084. if (unlikely(kw_args > 0)) {
  6085. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 641, __pyx_L3_error)
  6086. }
  6087. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6088. goto __pyx_L5_argtuple_error;
  6089. } else {
  6090. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6091. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6092. }
  6093. __pyx_v_g = values[0];
  6094. __pyx_v_h = values[1];
  6095. }
  6096. goto __pyx_L4_argument_unpacking_done;
  6097. __pyx_L5_argtuple_error:;
  6098. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 641, __pyx_L3_error)
  6099. __pyx_L3_error:;
  6100. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6101. __Pyx_RefNannyFinishContext();
  6102. return NULL;
  6103. __pyx_L4_argument_unpacking_done:;
  6104. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6105. /* function exit code */
  6106. __Pyx_RefNannyFinishContext();
  6107. return __pyx_r;
  6108. }
  6109. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6110. PyObject *__pyx_r = NULL;
  6111. __Pyx_RefNannyDeclarations
  6112. size_t __pyx_t_1;
  6113. size_t __pyx_t_2;
  6114. std::vector<npy_uint64> __pyx_t_3;
  6115. PyObject *__pyx_t_4 = NULL;
  6116. __Pyx_RefNannySetupContext("get_backward_map", 0);
  6117. /* "gedlibpy.pyx":656
  6118. * .. note:: I don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work !
  6119. * """
  6120. * return self.c_env.getBackwardMap(g, h) # <<<<<<<<<<<<<<
  6121. *
  6122. *
  6123. */
  6124. __Pyx_XDECREF(__pyx_r);
  6125. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
  6126. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 656, __pyx_L1_error)
  6127. try {
  6128. __pyx_t_3 = __pyx_v_self->c_env->getBackwardMap(__pyx_t_1, __pyx_t_2);
  6129. } catch(...) {
  6130. __Pyx_CppExn2PyErr();
  6131. __PYX_ERR(0, 656, __pyx_L1_error)
  6132. }
  6133. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 656, __pyx_L1_error)
  6134. __Pyx_GOTREF(__pyx_t_4);
  6135. __pyx_r = __pyx_t_4;
  6136. __pyx_t_4 = 0;
  6137. goto __pyx_L0;
  6138. /* "gedlibpy.pyx":641
  6139. *
  6140. *
  6141. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6142. * """
  6143. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6144. */
  6145. /* function exit code */
  6146. __pyx_L1_error:;
  6147. __Pyx_XDECREF(__pyx_t_4);
  6148. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6149. __pyx_r = NULL;
  6150. __pyx_L0:;
  6151. __Pyx_XGIVEREF(__pyx_r);
  6152. __Pyx_RefNannyFinishContext();
  6153. return __pyx_r;
  6154. }
  6155. /* "gedlibpy.pyx":659
  6156. *
  6157. *
  6158. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6159. * """
  6160. * Returns the node's image in the adjacence matrix, if it exists.
  6161. */
  6162. /* Python wrapper */
  6163. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6164. static char __pyx_doc_8gedlibpy_6GEDEnv_64get_node_image[] = "\n\t\t\tReturns the node's image in the adjacence matrix, if it exists. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:param node_id: The ID of the node which you want to see the image\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:type node_id: size_t\n\t\t\t:return: The ID of the image node\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_pre_image(), get_node_map(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: Use BackwardMap's Node to find its images ! You can also use get_forward_map() and get_backward_map().\t \n\t\n\t\t";
  6165. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6166. PyObject *__pyx_v_g = 0;
  6167. PyObject *__pyx_v_h = 0;
  6168. PyObject *__pyx_v_node_id = 0;
  6169. PyObject *__pyx_r = 0;
  6170. __Pyx_RefNannyDeclarations
  6171. __Pyx_RefNannySetupContext("get_node_image (wrapper)", 0);
  6172. {
  6173. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6174. PyObject* values[3] = {0,0,0};
  6175. if (unlikely(__pyx_kwds)) {
  6176. Py_ssize_t kw_args;
  6177. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6178. switch (pos_args) {
  6179. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6180. CYTHON_FALLTHROUGH;
  6181. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6182. CYTHON_FALLTHROUGH;
  6183. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6184. CYTHON_FALLTHROUGH;
  6185. case 0: break;
  6186. default: goto __pyx_L5_argtuple_error;
  6187. }
  6188. kw_args = PyDict_Size(__pyx_kwds);
  6189. switch (pos_args) {
  6190. case 0:
  6191. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6192. else goto __pyx_L5_argtuple_error;
  6193. CYTHON_FALLTHROUGH;
  6194. case 1:
  6195. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6196. else {
  6197. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 659, __pyx_L3_error)
  6198. }
  6199. CYTHON_FALLTHROUGH;
  6200. case 2:
  6201. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6202. else {
  6203. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 659, __pyx_L3_error)
  6204. }
  6205. }
  6206. if (unlikely(kw_args > 0)) {
  6207. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 659, __pyx_L3_error)
  6208. }
  6209. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6210. goto __pyx_L5_argtuple_error;
  6211. } else {
  6212. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6213. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6214. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6215. }
  6216. __pyx_v_g = values[0];
  6217. __pyx_v_h = values[1];
  6218. __pyx_v_node_id = values[2];
  6219. }
  6220. goto __pyx_L4_argument_unpacking_done;
  6221. __pyx_L5_argtuple_error:;
  6222. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 659, __pyx_L3_error)
  6223. __pyx_L3_error:;
  6224. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6225. __Pyx_RefNannyFinishContext();
  6226. return NULL;
  6227. __pyx_L4_argument_unpacking_done:;
  6228. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h, __pyx_v_node_id);
  6229. /* function exit code */
  6230. __Pyx_RefNannyFinishContext();
  6231. return __pyx_r;
  6232. }
  6233. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_64get_node_image(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h, PyObject *__pyx_v_node_id) {
  6234. PyObject *__pyx_r = NULL;
  6235. __Pyx_RefNannyDeclarations
  6236. size_t __pyx_t_1;
  6237. size_t __pyx_t_2;
  6238. size_t __pyx_t_3;
  6239. size_t __pyx_t_4;
  6240. PyObject *__pyx_t_5 = NULL;
  6241. __Pyx_RefNannySetupContext("get_node_image", 0);
  6242. /* "gedlibpy.pyx":677
  6243. *
  6244. * """
  6245. * return self.c_env.getNodeImage(g, h, node_id) # <<<<<<<<<<<<<<
  6246. *
  6247. *
  6248. */
  6249. __Pyx_XDECREF(__pyx_r);
  6250. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
  6251. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
  6252. __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 677, __pyx_L1_error)
  6253. try {
  6254. __pyx_t_4 = __pyx_v_self->c_env->getNodeImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6255. } catch(...) {
  6256. __Pyx_CppExn2PyErr();
  6257. __PYX_ERR(0, 677, __pyx_L1_error)
  6258. }
  6259. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 677, __pyx_L1_error)
  6260. __Pyx_GOTREF(__pyx_t_5);
  6261. __pyx_r = __pyx_t_5;
  6262. __pyx_t_5 = 0;
  6263. goto __pyx_L0;
  6264. /* "gedlibpy.pyx":659
  6265. *
  6266. *
  6267. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6268. * """
  6269. * Returns the node's image in the adjacence matrix, if it exists.
  6270. */
  6271. /* function exit code */
  6272. __pyx_L1_error:;
  6273. __Pyx_XDECREF(__pyx_t_5);
  6274. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6275. __pyx_r = NULL;
  6276. __pyx_L0:;
  6277. __Pyx_XGIVEREF(__pyx_r);
  6278. __Pyx_RefNannyFinishContext();
  6279. return __pyx_r;
  6280. }
  6281. /* "gedlibpy.pyx":680
  6282. *
  6283. *
  6284. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6285. * """
  6286. * Returns the node's preimage in the adjacence matrix, if it exists.
  6287. */
  6288. /* Python wrapper */
  6289. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6290. static char __pyx_doc_8gedlibpy_6GEDEnv_66get_node_pre_image[] = "\n\t\t\tReturns the node's preimage in the adjacence matrix, if it exists. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:param node_id: The ID of the node which you want to see the preimage\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:type node_id: size_t\n\t\t\t:return: The ID of the preimage node\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_map(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: Use ForwardMap's Node to find its images ! You can also use get_forward_map() and get_backward_map().\t \n\t\n\t\t";
  6291. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6292. PyObject *__pyx_v_g = 0;
  6293. PyObject *__pyx_v_h = 0;
  6294. PyObject *__pyx_v_node_id = 0;
  6295. PyObject *__pyx_r = 0;
  6296. __Pyx_RefNannyDeclarations
  6297. __Pyx_RefNannySetupContext("get_node_pre_image (wrapper)", 0);
  6298. {
  6299. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6300. PyObject* values[3] = {0,0,0};
  6301. if (unlikely(__pyx_kwds)) {
  6302. Py_ssize_t kw_args;
  6303. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6304. switch (pos_args) {
  6305. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6306. CYTHON_FALLTHROUGH;
  6307. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6308. CYTHON_FALLTHROUGH;
  6309. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6310. CYTHON_FALLTHROUGH;
  6311. case 0: break;
  6312. default: goto __pyx_L5_argtuple_error;
  6313. }
  6314. kw_args = PyDict_Size(__pyx_kwds);
  6315. switch (pos_args) {
  6316. case 0:
  6317. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6318. else goto __pyx_L5_argtuple_error;
  6319. CYTHON_FALLTHROUGH;
  6320. case 1:
  6321. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6322. else {
  6323. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 680, __pyx_L3_error)
  6324. }
  6325. CYTHON_FALLTHROUGH;
  6326. case 2:
  6327. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6328. else {
  6329. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 680, __pyx_L3_error)
  6330. }
  6331. }
  6332. if (unlikely(kw_args > 0)) {
  6333. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 680, __pyx_L3_error)
  6334. }
  6335. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6336. goto __pyx_L5_argtuple_error;
  6337. } else {
  6338. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6339. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6340. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6341. }
  6342. __pyx_v_g = values[0];
  6343. __pyx_v_h = values[1];
  6344. __pyx_v_node_id = values[2];
  6345. }
  6346. goto __pyx_L4_argument_unpacking_done;
  6347. __pyx_L5_argtuple_error:;
  6348. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 680, __pyx_L3_error)
  6349. __pyx_L3_error:;
  6350. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6351. __Pyx_RefNannyFinishContext();
  6352. return NULL;
  6353. __pyx_L4_argument_unpacking_done:;
  6354. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h, __pyx_v_node_id);
  6355. /* function exit code */
  6356. __Pyx_RefNannyFinishContext();
  6357. return __pyx_r;
  6358. }
  6359. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_66get_node_pre_image(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h, PyObject *__pyx_v_node_id) {
  6360. PyObject *__pyx_r = NULL;
  6361. __Pyx_RefNannyDeclarations
  6362. size_t __pyx_t_1;
  6363. size_t __pyx_t_2;
  6364. size_t __pyx_t_3;
  6365. size_t __pyx_t_4;
  6366. PyObject *__pyx_t_5 = NULL;
  6367. __Pyx_RefNannySetupContext("get_node_pre_image", 0);
  6368. /* "gedlibpy.pyx":698
  6369. *
  6370. * """
  6371. * return self.c_env.getNodePreImage(g, h, node_id) # <<<<<<<<<<<<<<
  6372. *
  6373. *
  6374. */
  6375. __Pyx_XDECREF(__pyx_r);
  6376. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error)
  6377. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error)
  6378. __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_node_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 698, __pyx_L1_error)
  6379. try {
  6380. __pyx_t_4 = __pyx_v_self->c_env->getNodePreImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6381. } catch(...) {
  6382. __Pyx_CppExn2PyErr();
  6383. __PYX_ERR(0, 698, __pyx_L1_error)
  6384. }
  6385. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
  6386. __Pyx_GOTREF(__pyx_t_5);
  6387. __pyx_r = __pyx_t_5;
  6388. __pyx_t_5 = 0;
  6389. goto __pyx_L0;
  6390. /* "gedlibpy.pyx":680
  6391. *
  6392. *
  6393. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6394. * """
  6395. * Returns the node's preimage in the adjacence matrix, if it exists.
  6396. */
  6397. /* function exit code */
  6398. __pyx_L1_error:;
  6399. __Pyx_XDECREF(__pyx_t_5);
  6400. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6401. __pyx_r = NULL;
  6402. __pyx_L0:;
  6403. __Pyx_XGIVEREF(__pyx_r);
  6404. __Pyx_RefNannyFinishContext();
  6405. return __pyx_r;
  6406. }
  6407. /* "gedlibpy.pyx":701
  6408. *
  6409. *
  6410. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6411. * """
  6412. * Returns the induced cost between the two indicated graphs.
  6413. */
  6414. /* Python wrapper */
  6415. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6416. static char __pyx_doc_8gedlibpy_6GEDEnv_68get_induced_cost[] = "\n\t\t\tReturns the induced cost between the two indicated graphs.\t\n\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The induced cost between the two indicated graphs\n\t\t\t:rtype: double\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_map(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: Use ForwardMap's Node to find its images ! You can also use get_forward_map() and get_backward_map().\t \n\t\n\t\t";
  6417. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6418. PyObject *__pyx_v_g = 0;
  6419. PyObject *__pyx_v_h = 0;
  6420. PyObject *__pyx_r = 0;
  6421. __Pyx_RefNannyDeclarations
  6422. __Pyx_RefNannySetupContext("get_induced_cost (wrapper)", 0);
  6423. {
  6424. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6425. PyObject* values[2] = {0,0};
  6426. if (unlikely(__pyx_kwds)) {
  6427. Py_ssize_t kw_args;
  6428. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6429. switch (pos_args) {
  6430. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6431. CYTHON_FALLTHROUGH;
  6432. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6433. CYTHON_FALLTHROUGH;
  6434. case 0: break;
  6435. default: goto __pyx_L5_argtuple_error;
  6436. }
  6437. kw_args = PyDict_Size(__pyx_kwds);
  6438. switch (pos_args) {
  6439. case 0:
  6440. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6441. else goto __pyx_L5_argtuple_error;
  6442. CYTHON_FALLTHROUGH;
  6443. case 1:
  6444. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6445. else {
  6446. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 701, __pyx_L3_error)
  6447. }
  6448. }
  6449. if (unlikely(kw_args > 0)) {
  6450. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 701, __pyx_L3_error)
  6451. }
  6452. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6453. goto __pyx_L5_argtuple_error;
  6454. } else {
  6455. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6456. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6457. }
  6458. __pyx_v_g = values[0];
  6459. __pyx_v_h = values[1];
  6460. }
  6461. goto __pyx_L4_argument_unpacking_done;
  6462. __pyx_L5_argtuple_error:;
  6463. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 701, __pyx_L3_error)
  6464. __pyx_L3_error:;
  6465. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6466. __Pyx_RefNannyFinishContext();
  6467. return NULL;
  6468. __pyx_L4_argument_unpacking_done:;
  6469. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6470. /* function exit code */
  6471. __Pyx_RefNannyFinishContext();
  6472. return __pyx_r;
  6473. }
  6474. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6475. PyObject *__pyx_r = NULL;
  6476. __Pyx_RefNannyDeclarations
  6477. size_t __pyx_t_1;
  6478. size_t __pyx_t_2;
  6479. double __pyx_t_3;
  6480. PyObject *__pyx_t_4 = NULL;
  6481. __Pyx_RefNannySetupContext("get_induced_cost", 0);
  6482. /* "gedlibpy.pyx":717
  6483. *
  6484. * """
  6485. * return self.c_env.getInducedCost(g, h) # <<<<<<<<<<<<<<
  6486. *
  6487. *
  6488. */
  6489. __Pyx_XDECREF(__pyx_r);
  6490. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L1_error)
  6491. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 717, __pyx_L1_error)
  6492. try {
  6493. __pyx_t_3 = __pyx_v_self->c_env->getInducedCost(__pyx_t_1, __pyx_t_2);
  6494. } catch(...) {
  6495. __Pyx_CppExn2PyErr();
  6496. __PYX_ERR(0, 717, __pyx_L1_error)
  6497. }
  6498. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 717, __pyx_L1_error)
  6499. __Pyx_GOTREF(__pyx_t_4);
  6500. __pyx_r = __pyx_t_4;
  6501. __pyx_t_4 = 0;
  6502. goto __pyx_L0;
  6503. /* "gedlibpy.pyx":701
  6504. *
  6505. *
  6506. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6507. * """
  6508. * Returns the induced cost between the two indicated graphs.
  6509. */
  6510. /* function exit code */
  6511. __pyx_L1_error:;
  6512. __Pyx_XDECREF(__pyx_t_4);
  6513. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6514. __pyx_r = NULL;
  6515. __pyx_L0:;
  6516. __Pyx_XGIVEREF(__pyx_r);
  6517. __Pyx_RefNannyFinishContext();
  6518. return __pyx_r;
  6519. }
  6520. /* "gedlibpy.pyx":720
  6521. *
  6522. *
  6523. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  6524. * """
  6525. * Returns the Node Map, like C++ NodeMap.
  6526. */
  6527. /* Python wrapper */
  6528. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6529. static char __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map[] = "\n\t\t\tReturns the Node Map, like C++ NodeMap. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The Node Map between the two selected graph. \n\t\t\t:rtype: list[tuple(size_t, size_t)]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_pre_image(), get_assignment_matrix()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.\t \n\t\t";
  6530. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6531. PyObject *__pyx_v_g = 0;
  6532. PyObject *__pyx_v_h = 0;
  6533. PyObject *__pyx_r = 0;
  6534. __Pyx_RefNannyDeclarations
  6535. __Pyx_RefNannySetupContext("get_node_map (wrapper)", 0);
  6536. {
  6537. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6538. PyObject* values[2] = {0,0};
  6539. if (unlikely(__pyx_kwds)) {
  6540. Py_ssize_t kw_args;
  6541. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6542. switch (pos_args) {
  6543. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6544. CYTHON_FALLTHROUGH;
  6545. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6546. CYTHON_FALLTHROUGH;
  6547. case 0: break;
  6548. default: goto __pyx_L5_argtuple_error;
  6549. }
  6550. kw_args = PyDict_Size(__pyx_kwds);
  6551. switch (pos_args) {
  6552. case 0:
  6553. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6554. else goto __pyx_L5_argtuple_error;
  6555. CYTHON_FALLTHROUGH;
  6556. case 1:
  6557. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6558. else {
  6559. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 720, __pyx_L3_error)
  6560. }
  6561. }
  6562. if (unlikely(kw_args > 0)) {
  6563. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 720, __pyx_L3_error)
  6564. }
  6565. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6566. goto __pyx_L5_argtuple_error;
  6567. } else {
  6568. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6569. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6570. }
  6571. __pyx_v_g = values[0];
  6572. __pyx_v_h = values[1];
  6573. }
  6574. goto __pyx_L4_argument_unpacking_done;
  6575. __pyx_L5_argtuple_error:;
  6576. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 720, __pyx_L3_error)
  6577. __pyx_L3_error:;
  6578. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6579. __Pyx_RefNannyFinishContext();
  6580. return NULL;
  6581. __pyx_L4_argument_unpacking_done:;
  6582. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6583. /* function exit code */
  6584. __Pyx_RefNannyFinishContext();
  6585. return __pyx_r;
  6586. }
  6587. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6588. PyObject *__pyx_r = NULL;
  6589. __Pyx_RefNannyDeclarations
  6590. size_t __pyx_t_1;
  6591. size_t __pyx_t_2;
  6592. std::vector<std::pair<size_t,size_t> > __pyx_t_3;
  6593. PyObject *__pyx_t_4 = NULL;
  6594. __Pyx_RefNannySetupContext("get_node_map", 0);
  6595. /* "gedlibpy.pyx":735
  6596. * .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.
  6597. * """
  6598. * return self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<<
  6599. *
  6600. *
  6601. */
  6602. __Pyx_XDECREF(__pyx_r);
  6603. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
  6604. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 735, __pyx_L1_error)
  6605. try {
  6606. __pyx_t_3 = __pyx_v_self->c_env->getNodeMap(__pyx_t_1, __pyx_t_2);
  6607. } catch(...) {
  6608. __Pyx_CppExn2PyErr();
  6609. __PYX_ERR(0, 735, __pyx_L1_error)
  6610. }
  6611. __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 735, __pyx_L1_error)
  6612. __Pyx_GOTREF(__pyx_t_4);
  6613. __pyx_r = __pyx_t_4;
  6614. __pyx_t_4 = 0;
  6615. goto __pyx_L0;
  6616. /* "gedlibpy.pyx":720
  6617. *
  6618. *
  6619. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  6620. * """
  6621. * Returns the Node Map, like C++ NodeMap.
  6622. */
  6623. /* function exit code */
  6624. __pyx_L1_error:;
  6625. __Pyx_XDECREF(__pyx_t_4);
  6626. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6627. __pyx_r = NULL;
  6628. __pyx_L0:;
  6629. __Pyx_XGIVEREF(__pyx_r);
  6630. __Pyx_RefNannyFinishContext();
  6631. return __pyx_r;
  6632. }
  6633. /* "gedlibpy.pyx":738
  6634. *
  6635. *
  6636. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  6637. * """
  6638. * Returns the Assignment Matrix between two selected graphs g and h.
  6639. */
  6640. /* Python wrapper */
  6641. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6642. static char __pyx_doc_8gedlibpy_6GEDEnv_72get_assignment_matrix[] = "\n\t\t\tReturns the Assignment Matrix between two selected graphs g and h. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The Assignment Matrix between the two selected graph. \n\t\t\t:rtype: list[list[int]]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_forward_map(), get_backward_map(), get_node_image(), get_node_pre_image(), get_node_map()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function creates datas so use it if necessary.\t \n\t\t";
  6643. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6644. PyObject *__pyx_v_g = 0;
  6645. PyObject *__pyx_v_h = 0;
  6646. PyObject *__pyx_r = 0;
  6647. __Pyx_RefNannyDeclarations
  6648. __Pyx_RefNannySetupContext("get_assignment_matrix (wrapper)", 0);
  6649. {
  6650. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6651. PyObject* values[2] = {0,0};
  6652. if (unlikely(__pyx_kwds)) {
  6653. Py_ssize_t kw_args;
  6654. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6655. switch (pos_args) {
  6656. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6657. CYTHON_FALLTHROUGH;
  6658. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6659. CYTHON_FALLTHROUGH;
  6660. case 0: break;
  6661. default: goto __pyx_L5_argtuple_error;
  6662. }
  6663. kw_args = PyDict_Size(__pyx_kwds);
  6664. switch (pos_args) {
  6665. case 0:
  6666. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6667. else goto __pyx_L5_argtuple_error;
  6668. CYTHON_FALLTHROUGH;
  6669. case 1:
  6670. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6671. else {
  6672. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 738, __pyx_L3_error)
  6673. }
  6674. }
  6675. if (unlikely(kw_args > 0)) {
  6676. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 738, __pyx_L3_error)
  6677. }
  6678. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6679. goto __pyx_L5_argtuple_error;
  6680. } else {
  6681. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6682. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6683. }
  6684. __pyx_v_g = values[0];
  6685. __pyx_v_h = values[1];
  6686. }
  6687. goto __pyx_L4_argument_unpacking_done;
  6688. __pyx_L5_argtuple_error:;
  6689. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 738, __pyx_L3_error)
  6690. __pyx_L3_error:;
  6691. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6692. __Pyx_RefNannyFinishContext();
  6693. return NULL;
  6694. __pyx_L4_argument_unpacking_done:;
  6695. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6696. /* function exit code */
  6697. __Pyx_RefNannyFinishContext();
  6698. return __pyx_r;
  6699. }
  6700. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6701. PyObject *__pyx_r = NULL;
  6702. __Pyx_RefNannyDeclarations
  6703. size_t __pyx_t_1;
  6704. size_t __pyx_t_2;
  6705. std::vector<std::vector<int> > __pyx_t_3;
  6706. PyObject *__pyx_t_4 = NULL;
  6707. __Pyx_RefNannySetupContext("get_assignment_matrix", 0);
  6708. /* "gedlibpy.pyx":753
  6709. * .. note:: This function creates datas so use it if necessary.
  6710. * """
  6711. * return self.c_env.getAssignmentMatrix(g, h) # <<<<<<<<<<<<<<
  6712. *
  6713. *
  6714. */
  6715. __Pyx_XDECREF(__pyx_r);
  6716. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
  6717. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
  6718. try {
  6719. __pyx_t_3 = __pyx_v_self->c_env->getAssignmentMatrix(__pyx_t_1, __pyx_t_2);
  6720. } catch(...) {
  6721. __Pyx_CppExn2PyErr();
  6722. __PYX_ERR(0, 753, __pyx_L1_error)
  6723. }
  6724. __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 753, __pyx_L1_error)
  6725. __Pyx_GOTREF(__pyx_t_4);
  6726. __pyx_r = __pyx_t_4;
  6727. __pyx_t_4 = 0;
  6728. goto __pyx_L0;
  6729. /* "gedlibpy.pyx":738
  6730. *
  6731. *
  6732. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  6733. * """
  6734. * Returns the Assignment Matrix between two selected graphs g and h.
  6735. */
  6736. /* function exit code */
  6737. __pyx_L1_error:;
  6738. __Pyx_XDECREF(__pyx_t_4);
  6739. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6740. __pyx_r = NULL;
  6741. __pyx_L0:;
  6742. __Pyx_XGIVEREF(__pyx_r);
  6743. __Pyx_RefNannyFinishContext();
  6744. return __pyx_r;
  6745. }
  6746. /* "gedlibpy.pyx":756
  6747. *
  6748. *
  6749. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  6750. * """
  6751. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  6752. */
  6753. /* Python wrapper */
  6754. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6755. static char __pyx_doc_8gedlibpy_6GEDEnv_74get_all_map[] = "\n\t\t\tReturns a vector which contains the forward and the backward maps between nodes of the two indicated graphs. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The forward and backward maps to the adjacence matrix between nodes of the two graphs\n\t\t\t:rtype: list[list[npy_uint32]]\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_lower_bound(), get_forward_map(), get_backward_map(), get_runtime(), quasimetric_cost()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: This function duplicates data so please don't use it. I also don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work ! \n\t\t";
  6756. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6757. PyObject *__pyx_v_g = 0;
  6758. PyObject *__pyx_v_h = 0;
  6759. PyObject *__pyx_r = 0;
  6760. __Pyx_RefNannyDeclarations
  6761. __Pyx_RefNannySetupContext("get_all_map (wrapper)", 0);
  6762. {
  6763. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6764. PyObject* values[2] = {0,0};
  6765. if (unlikely(__pyx_kwds)) {
  6766. Py_ssize_t kw_args;
  6767. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6768. switch (pos_args) {
  6769. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6770. CYTHON_FALLTHROUGH;
  6771. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6772. CYTHON_FALLTHROUGH;
  6773. case 0: break;
  6774. default: goto __pyx_L5_argtuple_error;
  6775. }
  6776. kw_args = PyDict_Size(__pyx_kwds);
  6777. switch (pos_args) {
  6778. case 0:
  6779. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6780. else goto __pyx_L5_argtuple_error;
  6781. CYTHON_FALLTHROUGH;
  6782. case 1:
  6783. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6784. else {
  6785. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 756, __pyx_L3_error)
  6786. }
  6787. }
  6788. if (unlikely(kw_args > 0)) {
  6789. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 756, __pyx_L3_error)
  6790. }
  6791. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6792. goto __pyx_L5_argtuple_error;
  6793. } else {
  6794. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6795. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6796. }
  6797. __pyx_v_g = values[0];
  6798. __pyx_v_h = values[1];
  6799. }
  6800. goto __pyx_L4_argument_unpacking_done;
  6801. __pyx_L5_argtuple_error:;
  6802. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 756, __pyx_L3_error)
  6803. __pyx_L3_error:;
  6804. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6805. __Pyx_RefNannyFinishContext();
  6806. return NULL;
  6807. __pyx_L4_argument_unpacking_done:;
  6808. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6809. /* function exit code */
  6810. __Pyx_RefNannyFinishContext();
  6811. return __pyx_r;
  6812. }
  6813. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6814. PyObject *__pyx_r = NULL;
  6815. __Pyx_RefNannyDeclarations
  6816. size_t __pyx_t_1;
  6817. size_t __pyx_t_2;
  6818. std::vector<std::vector<npy_uint64> > __pyx_t_3;
  6819. PyObject *__pyx_t_4 = NULL;
  6820. __Pyx_RefNannySetupContext("get_all_map", 0);
  6821. /* "gedlibpy.pyx":771
  6822. * .. note:: This function duplicates data so please don't use it. I also don't know how to connect the two map to reconstruct the adjacence matrix. Please come back when I know how it's work !
  6823. * """
  6824. * return self.c_env.getAllMap(g, h) # <<<<<<<<<<<<<<
  6825. *
  6826. *
  6827. */
  6828. __Pyx_XDECREF(__pyx_r);
  6829. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error)
  6830. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 771, __pyx_L1_error)
  6831. try {
  6832. __pyx_t_3 = __pyx_v_self->c_env->getAllMap(__pyx_t_1, __pyx_t_2);
  6833. } catch(...) {
  6834. __Pyx_CppExn2PyErr();
  6835. __PYX_ERR(0, 771, __pyx_L1_error)
  6836. }
  6837. __pyx_t_4 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 771, __pyx_L1_error)
  6838. __Pyx_GOTREF(__pyx_t_4);
  6839. __pyx_r = __pyx_t_4;
  6840. __pyx_t_4 = 0;
  6841. goto __pyx_L0;
  6842. /* "gedlibpy.pyx":756
  6843. *
  6844. *
  6845. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  6846. * """
  6847. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  6848. */
  6849. /* function exit code */
  6850. __pyx_L1_error:;
  6851. __Pyx_XDECREF(__pyx_t_4);
  6852. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6853. __pyx_r = NULL;
  6854. __pyx_L0:;
  6855. __Pyx_XGIVEREF(__pyx_r);
  6856. __Pyx_RefNannyFinishContext();
  6857. return __pyx_r;
  6858. }
  6859. /* "gedlibpy.pyx":774
  6860. *
  6861. *
  6862. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  6863. * """
  6864. * Returns the runtime to compute the edit distance cost between two graphs g and h
  6865. */
  6866. /* Python wrapper */
  6867. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6868. static char __pyx_doc_8gedlibpy_6GEDEnv_76get_runtime[] = "\n\t\t\tReturns the runtime to compute the edit distance cost between two graphs g and h \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: The runtime of the computation of edit distance cost between the two selected graphs\n\t\t\t:rtype: double\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_lower_bound(), get_forward_map(), get_backward_map(), quasimetric_cost()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t\t.. note:: Python is a bit longer than C++ due to the functions's encapsulate.\t\n\t\t";
  6869. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6870. PyObject *__pyx_v_g = 0;
  6871. PyObject *__pyx_v_h = 0;
  6872. PyObject *__pyx_r = 0;
  6873. __Pyx_RefNannyDeclarations
  6874. __Pyx_RefNannySetupContext("get_runtime (wrapper)", 0);
  6875. {
  6876. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6877. PyObject* values[2] = {0,0};
  6878. if (unlikely(__pyx_kwds)) {
  6879. Py_ssize_t kw_args;
  6880. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6881. switch (pos_args) {
  6882. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6883. CYTHON_FALLTHROUGH;
  6884. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6885. CYTHON_FALLTHROUGH;
  6886. case 0: break;
  6887. default: goto __pyx_L5_argtuple_error;
  6888. }
  6889. kw_args = PyDict_Size(__pyx_kwds);
  6890. switch (pos_args) {
  6891. case 0:
  6892. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6893. else goto __pyx_L5_argtuple_error;
  6894. CYTHON_FALLTHROUGH;
  6895. case 1:
  6896. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6897. else {
  6898. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 774, __pyx_L3_error)
  6899. }
  6900. }
  6901. if (unlikely(kw_args > 0)) {
  6902. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 774, __pyx_L3_error)
  6903. }
  6904. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6905. goto __pyx_L5_argtuple_error;
  6906. } else {
  6907. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6908. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6909. }
  6910. __pyx_v_g = values[0];
  6911. __pyx_v_h = values[1];
  6912. }
  6913. goto __pyx_L4_argument_unpacking_done;
  6914. __pyx_L5_argtuple_error:;
  6915. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 774, __pyx_L3_error)
  6916. __pyx_L3_error:;
  6917. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6918. __Pyx_RefNannyFinishContext();
  6919. return NULL;
  6920. __pyx_L4_argument_unpacking_done:;
  6921. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6922. /* function exit code */
  6923. __Pyx_RefNannyFinishContext();
  6924. return __pyx_r;
  6925. }
  6926. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  6927. PyObject *__pyx_r = NULL;
  6928. __Pyx_RefNannyDeclarations
  6929. size_t __pyx_t_1;
  6930. size_t __pyx_t_2;
  6931. double __pyx_t_3;
  6932. PyObject *__pyx_t_4 = NULL;
  6933. __Pyx_RefNannySetupContext("get_runtime", 0);
  6934. /* "gedlibpy.pyx":789
  6935. * .. note:: Python is a bit longer than C++ due to the functions's encapsulate.
  6936. * """
  6937. * return self.c_env.getRuntime(g,h) # <<<<<<<<<<<<<<
  6938. *
  6939. *
  6940. */
  6941. __Pyx_XDECREF(__pyx_r);
  6942. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error)
  6943. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 789, __pyx_L1_error)
  6944. try {
  6945. __pyx_t_3 = __pyx_v_self->c_env->getRuntime(__pyx_t_1, __pyx_t_2);
  6946. } catch(...) {
  6947. __Pyx_CppExn2PyErr();
  6948. __PYX_ERR(0, 789, __pyx_L1_error)
  6949. }
  6950. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 789, __pyx_L1_error)
  6951. __Pyx_GOTREF(__pyx_t_4);
  6952. __pyx_r = __pyx_t_4;
  6953. __pyx_t_4 = 0;
  6954. goto __pyx_L0;
  6955. /* "gedlibpy.pyx":774
  6956. *
  6957. *
  6958. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  6959. * """
  6960. * Returns the runtime to compute the edit distance cost between two graphs g and h
  6961. */
  6962. /* function exit code */
  6963. __pyx_L1_error:;
  6964. __Pyx_XDECREF(__pyx_t_4);
  6965. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6966. __pyx_r = NULL;
  6967. __pyx_L0:;
  6968. __Pyx_XGIVEREF(__pyx_r);
  6969. __Pyx_RefNannyFinishContext();
  6970. return __pyx_r;
  6971. }
  6972. /* "gedlibpy.pyx":792
  6973. *
  6974. *
  6975. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  6976. * """
  6977. * Checks and returns if the edit costs are quasimetric.
  6978. */
  6979. /* Python wrapper */
  6980. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  6981. static char __pyx_doc_8gedlibpy_6GEDEnv_78quasimetric_cost[] = "\n\t\t\tChecks and returns if the edit costs are quasimetric. \n\t\n\t\t\t:param g: The Id of the first compared graph \n\t\t\t:param h: The Id of the second compared graph\n\t\t\t:type g: size_t\n\t\t\t:type h: size_t\n\t\t\t:return: True if it's verified, False otherwise\n\t\t\t:rtype: bool\n\t\t\t\n\t\t\t.. seealso:: run_method(), get_upper_bound(), get_lower_bound(), get_forward_map(), get_backward_map(), get_runtime()\n\t\t\t.. warning:: run_method() between the same two graph must be called before this function. \n\t\t";
  6982. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  6983. PyObject *__pyx_r = 0;
  6984. __Pyx_RefNannyDeclarations
  6985. __Pyx_RefNannySetupContext("quasimetric_cost (wrapper)", 0);
  6986. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  6987. /* function exit code */
  6988. __Pyx_RefNannyFinishContext();
  6989. return __pyx_r;
  6990. }
  6991. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  6992. PyObject *__pyx_r = NULL;
  6993. __Pyx_RefNannyDeclarations
  6994. bool __pyx_t_1;
  6995. PyObject *__pyx_t_2 = NULL;
  6996. __Pyx_RefNannySetupContext("quasimetric_cost", 0);
  6997. /* "gedlibpy.pyx":806
  6998. * .. warning:: run_method() between the same two graph must be called before this function.
  6999. * """
  7000. * return self.c_env.quasimetricCosts() # <<<<<<<<<<<<<<
  7001. *
  7002. *
  7003. */
  7004. __Pyx_XDECREF(__pyx_r);
  7005. try {
  7006. __pyx_t_1 = __pyx_v_self->c_env->quasimetricCosts();
  7007. } catch(...) {
  7008. __Pyx_CppExn2PyErr();
  7009. __PYX_ERR(0, 806, __pyx_L1_error)
  7010. }
  7011. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 806, __pyx_L1_error)
  7012. __Pyx_GOTREF(__pyx_t_2);
  7013. __pyx_r = __pyx_t_2;
  7014. __pyx_t_2 = 0;
  7015. goto __pyx_L0;
  7016. /* "gedlibpy.pyx":792
  7017. *
  7018. *
  7019. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7020. * """
  7021. * Checks and returns if the edit costs are quasimetric.
  7022. */
  7023. /* function exit code */
  7024. __pyx_L1_error:;
  7025. __Pyx_XDECREF(__pyx_t_2);
  7026. __Pyx_AddTraceback("gedlibpy.GEDEnv.quasimetric_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7027. __pyx_r = NULL;
  7028. __pyx_L0:;
  7029. __Pyx_XGIVEREF(__pyx_r);
  7030. __Pyx_RefNannyFinishContext();
  7031. return __pyx_r;
  7032. }
  7033. /* "gedlibpy.pyx":809
  7034. *
  7035. *
  7036. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7037. * """
  7038. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7039. */
  7040. /* Python wrapper */
  7041. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7042. static char __pyx_doc_8gedlibpy_6GEDEnv_80hungarian_LSAP[] = "\n\t\t\tApplies the hungarian algorithm (LSAP) on a matrix Cost. \n\t\n\t\t\t:param matrix_cost: The matrix Cost \n\t\t\t:type matrix_cost: vector[vector[size_t]]\n\t\t\t:return: The values of rho, varrho, u and v, in this order\n\t\t\t:rtype: vector[vector[size_t]]\n\t\t\t\n\t\t\t.. seealso:: hungarian_LSAPE() \n\t\t";
  7043. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7044. PyObject *__pyx_r = 0;
  7045. __Pyx_RefNannyDeclarations
  7046. __Pyx_RefNannySetupContext("hungarian_LSAP (wrapper)", 0);
  7047. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7048. /* function exit code */
  7049. __Pyx_RefNannyFinishContext();
  7050. return __pyx_r;
  7051. }
  7052. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7053. PyObject *__pyx_r = NULL;
  7054. __Pyx_RefNannyDeclarations
  7055. std::vector<std::vector<size_t> > __pyx_t_1;
  7056. std::vector<std::vector<size_t> > __pyx_t_2;
  7057. PyObject *__pyx_t_3 = NULL;
  7058. __Pyx_RefNannySetupContext("hungarian_LSAP", 0);
  7059. /* "gedlibpy.pyx":820
  7060. * .. seealso:: hungarian_LSAPE()
  7061. * """
  7062. * return self.c_env.hungarianLSAP(matrix_cost) # <<<<<<<<<<<<<<
  7063. *
  7064. *
  7065. */
  7066. __Pyx_XDECREF(__pyx_r);
  7067. __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 820, __pyx_L1_error)
  7068. try {
  7069. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAP(__pyx_t_1);
  7070. } catch(...) {
  7071. __Pyx_CppExn2PyErr();
  7072. __PYX_ERR(0, 820, __pyx_L1_error)
  7073. }
  7074. __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 820, __pyx_L1_error)
  7075. __Pyx_GOTREF(__pyx_t_3);
  7076. __pyx_r = __pyx_t_3;
  7077. __pyx_t_3 = 0;
  7078. goto __pyx_L0;
  7079. /* "gedlibpy.pyx":809
  7080. *
  7081. *
  7082. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7083. * """
  7084. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7085. */
  7086. /* function exit code */
  7087. __pyx_L1_error:;
  7088. __Pyx_XDECREF(__pyx_t_3);
  7089. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7090. __pyx_r = NULL;
  7091. __pyx_L0:;
  7092. __Pyx_XGIVEREF(__pyx_r);
  7093. __Pyx_RefNannyFinishContext();
  7094. return __pyx_r;
  7095. }
  7096. /* "gedlibpy.pyx":823
  7097. *
  7098. *
  7099. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7100. * """
  7101. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7102. */
  7103. /* Python wrapper */
  7104. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7105. static char __pyx_doc_8gedlibpy_6GEDEnv_82hungarian_LSAPE[] = "\n\t\t\tApplies the hungarian algorithm (LSAPE) on a matrix Cost. \n\t\n\t\t\t:param matrix_cost: The matrix Cost \n\t\t\t:type matrix_cost: vector[vector[double]]\n\t\t\t:return: The values of rho, varrho, u and v, in this order\n\t\t\t:rtype: vector[vector[double]]\n\t\t\t\n\t\t\t.. seealso:: hungarian_LSAP() \n\t\t";
  7106. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7107. PyObject *__pyx_r = 0;
  7108. __Pyx_RefNannyDeclarations
  7109. __Pyx_RefNannySetupContext("hungarian_LSAPE (wrapper)", 0);
  7110. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7111. /* function exit code */
  7112. __Pyx_RefNannyFinishContext();
  7113. return __pyx_r;
  7114. }
  7115. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7116. PyObject *__pyx_r = NULL;
  7117. __Pyx_RefNannyDeclarations
  7118. std::vector<std::vector<double> > __pyx_t_1;
  7119. std::vector<std::vector<double> > __pyx_t_2;
  7120. PyObject *__pyx_t_3 = NULL;
  7121. __Pyx_RefNannySetupContext("hungarian_LSAPE", 0);
  7122. /* "gedlibpy.pyx":834
  7123. * .. seealso:: hungarian_LSAP()
  7124. * """
  7125. * return self.c_env.hungarianLSAPE(matrix_cost) # <<<<<<<<<<<<<<
  7126. *
  7127. *
  7128. */
  7129. __Pyx_XDECREF(__pyx_r);
  7130. __pyx_t_1 = __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(__pyx_v_matrix_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 834, __pyx_L1_error)
  7131. try {
  7132. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAPE(__pyx_t_1);
  7133. } catch(...) {
  7134. __Pyx_CppExn2PyErr();
  7135. __PYX_ERR(0, 834, __pyx_L1_error)
  7136. }
  7137. __pyx_t_3 = __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 834, __pyx_L1_error)
  7138. __Pyx_GOTREF(__pyx_t_3);
  7139. __pyx_r = __pyx_t_3;
  7140. __pyx_t_3 = 0;
  7141. goto __pyx_L0;
  7142. /* "gedlibpy.pyx":823
  7143. *
  7144. *
  7145. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7146. * """
  7147. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7148. */
  7149. /* function exit code */
  7150. __pyx_L1_error:;
  7151. __Pyx_XDECREF(__pyx_t_3);
  7152. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7153. __pyx_r = NULL;
  7154. __pyx_L0:;
  7155. __Pyx_XGIVEREF(__pyx_r);
  7156. __Pyx_RefNannyFinishContext();
  7157. return __pyx_r;
  7158. }
  7159. /* "gedlibpy.pyx":837
  7160. *
  7161. *
  7162. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7163. * """
  7164. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7165. */
  7166. /* Python wrapper */
  7167. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7168. static char __pyx_doc_8gedlibpy_6GEDEnv_84add_random_graph[] = "\n\t\t\tAdd a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges. \n\t\n\t\t\t:param name: The name of the graph to add, can be an empty string\n\t\t\t:param classe: The classe of the graph to add, can be an empty string\n\t\t\t:param list_of_nodes: The list of nodes to add\n\t\t\t:param list_of_edges: The list of edges to add\n\t\t\t:param ignore_duplicates: If True, duplicate edges are ignored, otherwise it's raise an error if an existing edge is added. True by default\n\t\t\t:type name: string\n\t\t\t:type classe: string\n\t\t\t:type list_of_nodes: list[tuple(size_t, dict{string : string})]\n\t\t\t:type list_of_edges: list[tuple(tuple(size_t,size_t), dict{string : string})]\n\t\t\t:type ignore_duplicates: bool\n\t\t\t:return: The ID of the newly added graphe\n\t\t\t:rtype: size_t\n\t\n\t\t\t.. note:: The graph must respect the GXL structure. Please see how a GXL graph is construct. \n\t\t\t\n\t\t";
  7169. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7170. PyObject *__pyx_v_name = 0;
  7171. PyObject *__pyx_v_classe = 0;
  7172. PyObject *__pyx_v_list_of_nodes = 0;
  7173. PyObject *__pyx_v_list_of_edges = 0;
  7174. PyObject *__pyx_v_ignore_duplicates = 0;
  7175. PyObject *__pyx_r = 0;
  7176. __Pyx_RefNannyDeclarations
  7177. __Pyx_RefNannySetupContext("add_random_graph (wrapper)", 0);
  7178. {
  7179. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_classe,&__pyx_n_s_list_of_nodes,&__pyx_n_s_list_of_edges,&__pyx_n_s_ignore_duplicates,0};
  7180. PyObject* values[5] = {0,0,0,0,0};
  7181. values[4] = ((PyObject *)Py_True);
  7182. if (unlikely(__pyx_kwds)) {
  7183. Py_ssize_t kw_args;
  7184. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7185. switch (pos_args) {
  7186. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7187. CYTHON_FALLTHROUGH;
  7188. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7189. CYTHON_FALLTHROUGH;
  7190. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7191. CYTHON_FALLTHROUGH;
  7192. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7193. CYTHON_FALLTHROUGH;
  7194. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7195. CYTHON_FALLTHROUGH;
  7196. case 0: break;
  7197. default: goto __pyx_L5_argtuple_error;
  7198. }
  7199. kw_args = PyDict_Size(__pyx_kwds);
  7200. switch (pos_args) {
  7201. case 0:
  7202. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
  7203. else goto __pyx_L5_argtuple_error;
  7204. CYTHON_FALLTHROUGH;
  7205. case 1:
  7206. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  7207. else {
  7208. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 837, __pyx_L3_error)
  7209. }
  7210. CYTHON_FALLTHROUGH;
  7211. case 2:
  7212. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_nodes)) != 0)) kw_args--;
  7213. else {
  7214. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 837, __pyx_L3_error)
  7215. }
  7216. CYTHON_FALLTHROUGH;
  7217. case 3:
  7218. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_edges)) != 0)) kw_args--;
  7219. else {
  7220. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 837, __pyx_L3_error)
  7221. }
  7222. CYTHON_FALLTHROUGH;
  7223. case 4:
  7224. if (kw_args > 0) {
  7225. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  7226. if (value) { values[4] = value; kw_args--; }
  7227. }
  7228. }
  7229. if (unlikely(kw_args > 0)) {
  7230. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 837, __pyx_L3_error)
  7231. }
  7232. } else {
  7233. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7234. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7235. CYTHON_FALLTHROUGH;
  7236. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7237. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7238. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7239. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7240. break;
  7241. default: goto __pyx_L5_argtuple_error;
  7242. }
  7243. }
  7244. __pyx_v_name = values[0];
  7245. __pyx_v_classe = values[1];
  7246. __pyx_v_list_of_nodes = values[2];
  7247. __pyx_v_list_of_edges = values[3];
  7248. __pyx_v_ignore_duplicates = values[4];
  7249. }
  7250. goto __pyx_L4_argument_unpacking_done;
  7251. __pyx_L5_argtuple_error:;
  7252. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 837, __pyx_L3_error)
  7253. __pyx_L3_error:;
  7254. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7255. __Pyx_RefNannyFinishContext();
  7256. return NULL;
  7257. __pyx_L4_argument_unpacking_done:;
  7258. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_name, __pyx_v_classe, __pyx_v_list_of_nodes, __pyx_v_list_of_edges, __pyx_v_ignore_duplicates);
  7259. /* function exit code */
  7260. __Pyx_RefNannyFinishContext();
  7261. return __pyx_r;
  7262. }
  7263. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_84add_random_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe, PyObject *__pyx_v_list_of_nodes, PyObject *__pyx_v_list_of_edges, PyObject *__pyx_v_ignore_duplicates) {
  7264. PyObject *__pyx_v_id = NULL;
  7265. PyObject *__pyx_v_node = NULL;
  7266. PyObject *__pyx_v_edge = NULL;
  7267. PyObject *__pyx_r = NULL;
  7268. __Pyx_RefNannyDeclarations
  7269. PyObject *__pyx_t_1 = NULL;
  7270. PyObject *__pyx_t_2 = NULL;
  7271. PyObject *__pyx_t_3 = NULL;
  7272. int __pyx_t_4;
  7273. PyObject *__pyx_t_5 = NULL;
  7274. Py_ssize_t __pyx_t_6;
  7275. PyObject *(*__pyx_t_7)(PyObject *);
  7276. PyObject *__pyx_t_8 = NULL;
  7277. PyObject *__pyx_t_9 = NULL;
  7278. PyObject *__pyx_t_10 = NULL;
  7279. PyObject *__pyx_t_11 = NULL;
  7280. __Pyx_RefNannySetupContext("add_random_graph", 0);
  7281. /* "gedlibpy.pyx":857
  7282. *
  7283. * """
  7284. * id = self.add_graph(name, classe) # <<<<<<<<<<<<<<
  7285. * for node in list_of_nodes:
  7286. * self.add_node(id, node[0], node[1])
  7287. */
  7288. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
  7289. __Pyx_GOTREF(__pyx_t_2);
  7290. __pyx_t_3 = NULL;
  7291. __pyx_t_4 = 0;
  7292. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  7293. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  7294. if (likely(__pyx_t_3)) {
  7295. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  7296. __Pyx_INCREF(__pyx_t_3);
  7297. __Pyx_INCREF(function);
  7298. __Pyx_DECREF_SET(__pyx_t_2, function);
  7299. __pyx_t_4 = 1;
  7300. }
  7301. }
  7302. #if CYTHON_FAST_PYCALL
  7303. if (PyFunction_Check(__pyx_t_2)) {
  7304. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7305. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  7306. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7307. __Pyx_GOTREF(__pyx_t_1);
  7308. } else
  7309. #endif
  7310. #if CYTHON_FAST_PYCCALL
  7311. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  7312. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7313. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  7314. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7315. __Pyx_GOTREF(__pyx_t_1);
  7316. } else
  7317. #endif
  7318. {
  7319. __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 857, __pyx_L1_error)
  7320. __Pyx_GOTREF(__pyx_t_5);
  7321. if (__pyx_t_3) {
  7322. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  7323. }
  7324. __Pyx_INCREF(__pyx_v_name);
  7325. __Pyx_GIVEREF(__pyx_v_name);
  7326. PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  7327. __Pyx_INCREF(__pyx_v_classe);
  7328. __Pyx_GIVEREF(__pyx_v_classe);
  7329. PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_classe);
  7330. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 857, __pyx_L1_error)
  7331. __Pyx_GOTREF(__pyx_t_1);
  7332. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7333. }
  7334. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7335. __pyx_v_id = __pyx_t_1;
  7336. __pyx_t_1 = 0;
  7337. /* "gedlibpy.pyx":858
  7338. * """
  7339. * id = self.add_graph(name, classe)
  7340. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7341. * self.add_node(id, node[0], node[1])
  7342. * for edge in list_of_edges:
  7343. */
  7344. if (likely(PyList_CheckExact(__pyx_v_list_of_nodes)) || PyTuple_CheckExact(__pyx_v_list_of_nodes)) {
  7345. __pyx_t_1 = __pyx_v_list_of_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7346. __pyx_t_7 = NULL;
  7347. } else {
  7348. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 858, __pyx_L1_error)
  7349. __Pyx_GOTREF(__pyx_t_1);
  7350. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 858, __pyx_L1_error)
  7351. }
  7352. for (;;) {
  7353. if (likely(!__pyx_t_7)) {
  7354. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7355. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7356. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7357. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 858, __pyx_L1_error)
  7358. #else
  7359. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
  7360. __Pyx_GOTREF(__pyx_t_2);
  7361. #endif
  7362. } else {
  7363. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7364. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7365. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 858, __pyx_L1_error)
  7366. #else
  7367. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
  7368. __Pyx_GOTREF(__pyx_t_2);
  7369. #endif
  7370. }
  7371. } else {
  7372. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7373. if (unlikely(!__pyx_t_2)) {
  7374. PyObject* exc_type = PyErr_Occurred();
  7375. if (exc_type) {
  7376. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7377. else __PYX_ERR(0, 858, __pyx_L1_error)
  7378. }
  7379. break;
  7380. }
  7381. __Pyx_GOTREF(__pyx_t_2);
  7382. }
  7383. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_2);
  7384. __pyx_t_2 = 0;
  7385. /* "gedlibpy.pyx":859
  7386. * id = self.add_graph(name, classe)
  7387. * for node in list_of_nodes:
  7388. * self.add_node(id, node[0], node[1]) # <<<<<<<<<<<<<<
  7389. * for edge in list_of_edges:
  7390. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7391. */
  7392. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 859, __pyx_L1_error)
  7393. __Pyx_GOTREF(__pyx_t_5);
  7394. __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_node, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
  7395. __Pyx_GOTREF(__pyx_t_3);
  7396. __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_node, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 859, __pyx_L1_error)
  7397. __Pyx_GOTREF(__pyx_t_8);
  7398. __pyx_t_9 = NULL;
  7399. __pyx_t_4 = 0;
  7400. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7401. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7402. if (likely(__pyx_t_9)) {
  7403. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7404. __Pyx_INCREF(__pyx_t_9);
  7405. __Pyx_INCREF(function);
  7406. __Pyx_DECREF_SET(__pyx_t_5, function);
  7407. __pyx_t_4 = 1;
  7408. }
  7409. }
  7410. #if CYTHON_FAST_PYCALL
  7411. if (PyFunction_Check(__pyx_t_5)) {
  7412. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7413. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
  7414. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7415. __Pyx_GOTREF(__pyx_t_2);
  7416. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7417. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7418. } else
  7419. #endif
  7420. #if CYTHON_FAST_PYCCALL
  7421. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7422. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7423. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
  7424. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7425. __Pyx_GOTREF(__pyx_t_2);
  7426. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7427. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7428. } else
  7429. #endif
  7430. {
  7431. __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 859, __pyx_L1_error)
  7432. __Pyx_GOTREF(__pyx_t_10);
  7433. if (__pyx_t_9) {
  7434. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7435. }
  7436. __Pyx_INCREF(__pyx_v_id);
  7437. __Pyx_GIVEREF(__pyx_v_id);
  7438. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_id);
  7439. __Pyx_GIVEREF(__pyx_t_3);
  7440. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_3);
  7441. __Pyx_GIVEREF(__pyx_t_8);
  7442. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8);
  7443. __pyx_t_3 = 0;
  7444. __pyx_t_8 = 0;
  7445. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
  7446. __Pyx_GOTREF(__pyx_t_2);
  7447. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7448. }
  7449. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7450. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7451. /* "gedlibpy.pyx":858
  7452. * """
  7453. * id = self.add_graph(name, classe)
  7454. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7455. * self.add_node(id, node[0], node[1])
  7456. * for edge in list_of_edges:
  7457. */
  7458. }
  7459. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7460. /* "gedlibpy.pyx":860
  7461. * for node in list_of_nodes:
  7462. * self.add_node(id, node[0], node[1])
  7463. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  7464. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7465. * return id
  7466. */
  7467. if (likely(PyList_CheckExact(__pyx_v_list_of_edges)) || PyTuple_CheckExact(__pyx_v_list_of_edges)) {
  7468. __pyx_t_1 = __pyx_v_list_of_edges; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7469. __pyx_t_7 = NULL;
  7470. } else {
  7471. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 860, __pyx_L1_error)
  7472. __Pyx_GOTREF(__pyx_t_1);
  7473. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 860, __pyx_L1_error)
  7474. }
  7475. for (;;) {
  7476. if (likely(!__pyx_t_7)) {
  7477. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7478. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7479. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7480. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error)
  7481. #else
  7482. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
  7483. __Pyx_GOTREF(__pyx_t_2);
  7484. #endif
  7485. } else {
  7486. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7487. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7488. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 860, __pyx_L1_error)
  7489. #else
  7490. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 860, __pyx_L1_error)
  7491. __Pyx_GOTREF(__pyx_t_2);
  7492. #endif
  7493. }
  7494. } else {
  7495. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7496. if (unlikely(!__pyx_t_2)) {
  7497. PyObject* exc_type = PyErr_Occurred();
  7498. if (exc_type) {
  7499. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7500. else __PYX_ERR(0, 860, __pyx_L1_error)
  7501. }
  7502. break;
  7503. }
  7504. __Pyx_GOTREF(__pyx_t_2);
  7505. }
  7506. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  7507. __pyx_t_2 = 0;
  7508. /* "gedlibpy.pyx":861
  7509. * self.add_node(id, node[0], node[1])
  7510. * for edge in list_of_edges:
  7511. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) # <<<<<<<<<<<<<<
  7512. * return id
  7513. *
  7514. */
  7515. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 861, __pyx_L1_error)
  7516. __Pyx_GOTREF(__pyx_t_5);
  7517. __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 861, __pyx_L1_error)
  7518. __Pyx_GOTREF(__pyx_t_10);
  7519. __pyx_t_8 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 861, __pyx_L1_error)
  7520. __Pyx_GOTREF(__pyx_t_8);
  7521. __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_edge, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
  7522. __Pyx_GOTREF(__pyx_t_3);
  7523. __pyx_t_9 = NULL;
  7524. __pyx_t_4 = 0;
  7525. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7526. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7527. if (likely(__pyx_t_9)) {
  7528. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7529. __Pyx_INCREF(__pyx_t_9);
  7530. __Pyx_INCREF(function);
  7531. __Pyx_DECREF_SET(__pyx_t_5, function);
  7532. __pyx_t_4 = 1;
  7533. }
  7534. }
  7535. #if CYTHON_FAST_PYCALL
  7536. if (PyFunction_Check(__pyx_t_5)) {
  7537. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7538. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
  7539. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7540. __Pyx_GOTREF(__pyx_t_2);
  7541. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7542. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7543. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7544. } else
  7545. #endif
  7546. #if CYTHON_FAST_PYCCALL
  7547. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7548. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7549. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_4, 5+__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
  7550. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7551. __Pyx_GOTREF(__pyx_t_2);
  7552. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7553. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7554. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7555. } else
  7556. #endif
  7557. {
  7558. __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 861, __pyx_L1_error)
  7559. __Pyx_GOTREF(__pyx_t_11);
  7560. if (__pyx_t_9) {
  7561. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7562. }
  7563. __Pyx_INCREF(__pyx_v_id);
  7564. __Pyx_GIVEREF(__pyx_v_id);
  7565. PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_id);
  7566. __Pyx_GIVEREF(__pyx_t_10);
  7567. PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
  7568. __Pyx_GIVEREF(__pyx_t_8);
  7569. PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_4, __pyx_t_8);
  7570. __Pyx_GIVEREF(__pyx_t_3);
  7571. PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_4, __pyx_t_3);
  7572. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  7573. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  7574. PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_4, __pyx_v_ignore_duplicates);
  7575. __pyx_t_10 = 0;
  7576. __pyx_t_8 = 0;
  7577. __pyx_t_3 = 0;
  7578. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
  7579. __Pyx_GOTREF(__pyx_t_2);
  7580. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  7581. }
  7582. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7583. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7584. /* "gedlibpy.pyx":860
  7585. * for node in list_of_nodes:
  7586. * self.add_node(id, node[0], node[1])
  7587. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  7588. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7589. * return id
  7590. */
  7591. }
  7592. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7593. /* "gedlibpy.pyx":862
  7594. * for edge in list_of_edges:
  7595. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7596. * return id # <<<<<<<<<<<<<<
  7597. *
  7598. *
  7599. */
  7600. __Pyx_XDECREF(__pyx_r);
  7601. __Pyx_INCREF(__pyx_v_id);
  7602. __pyx_r = __pyx_v_id;
  7603. goto __pyx_L0;
  7604. /* "gedlibpy.pyx":837
  7605. *
  7606. *
  7607. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7608. * """
  7609. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7610. */
  7611. /* function exit code */
  7612. __pyx_L1_error:;
  7613. __Pyx_XDECREF(__pyx_t_1);
  7614. __Pyx_XDECREF(__pyx_t_2);
  7615. __Pyx_XDECREF(__pyx_t_3);
  7616. __Pyx_XDECREF(__pyx_t_5);
  7617. __Pyx_XDECREF(__pyx_t_8);
  7618. __Pyx_XDECREF(__pyx_t_9);
  7619. __Pyx_XDECREF(__pyx_t_10);
  7620. __Pyx_XDECREF(__pyx_t_11);
  7621. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7622. __pyx_r = NULL;
  7623. __pyx_L0:;
  7624. __Pyx_XDECREF(__pyx_v_id);
  7625. __Pyx_XDECREF(__pyx_v_node);
  7626. __Pyx_XDECREF(__pyx_v_edge);
  7627. __Pyx_XGIVEREF(__pyx_r);
  7628. __Pyx_RefNannyFinishContext();
  7629. return __pyx_r;
  7630. }
  7631. /* "gedlibpy.pyx":865
  7632. *
  7633. *
  7634. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7635. * """
  7636. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7637. */
  7638. /* Python wrapper */
  7639. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7640. static char __pyx_doc_8gedlibpy_6GEDEnv_86add_nx_graph[] = "\n\t\t\tAdd a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges. \n\t\n\t\t\t:param g: The graph to add (networkx graph)\n\t\t\t:param ignore_duplicates: If True, duplicate edges are ignored, otherwise it's raise an error if an existing edge is added. True by default\n\t\t\t:type g: networkx.graph\n\t\t\t:type ignore_duplicates: bool\n\t\t\t:return: The ID of the newly added graphe\n\t\t\t:rtype: size_t\n\t\n\t\t\t.. note:: The NX graph must respect the GXL structure. Please see how a GXL graph is construct. \n\t\t\t\n\t\t";
  7641. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7642. PyObject *__pyx_v_g = 0;
  7643. PyObject *__pyx_v_classe = 0;
  7644. PyObject *__pyx_v_ignore_duplicates = 0;
  7645. PyObject *__pyx_r = 0;
  7646. __Pyx_RefNannyDeclarations
  7647. __Pyx_RefNannySetupContext("add_nx_graph (wrapper)", 0);
  7648. {
  7649. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_classe,&__pyx_n_s_ignore_duplicates,0};
  7650. PyObject* values[3] = {0,0,0};
  7651. values[2] = ((PyObject *)Py_True);
  7652. if (unlikely(__pyx_kwds)) {
  7653. Py_ssize_t kw_args;
  7654. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7655. switch (pos_args) {
  7656. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7657. CYTHON_FALLTHROUGH;
  7658. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7659. CYTHON_FALLTHROUGH;
  7660. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7661. CYTHON_FALLTHROUGH;
  7662. case 0: break;
  7663. default: goto __pyx_L5_argtuple_error;
  7664. }
  7665. kw_args = PyDict_Size(__pyx_kwds);
  7666. switch (pos_args) {
  7667. case 0:
  7668. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7669. else goto __pyx_L5_argtuple_error;
  7670. CYTHON_FALLTHROUGH;
  7671. case 1:
  7672. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  7673. else {
  7674. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 865, __pyx_L3_error)
  7675. }
  7676. CYTHON_FALLTHROUGH;
  7677. case 2:
  7678. if (kw_args > 0) {
  7679. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  7680. if (value) { values[2] = value; kw_args--; }
  7681. }
  7682. }
  7683. if (unlikely(kw_args > 0)) {
  7684. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 865, __pyx_L3_error)
  7685. }
  7686. } else {
  7687. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7688. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7689. CYTHON_FALLTHROUGH;
  7690. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7691. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7692. break;
  7693. default: goto __pyx_L5_argtuple_error;
  7694. }
  7695. }
  7696. __pyx_v_g = values[0];
  7697. __pyx_v_classe = values[1];
  7698. __pyx_v_ignore_duplicates = values[2];
  7699. }
  7700. goto __pyx_L4_argument_unpacking_done;
  7701. __pyx_L5_argtuple_error:;
  7702. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 865, __pyx_L3_error)
  7703. __pyx_L3_error:;
  7704. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7705. __Pyx_RefNannyFinishContext();
  7706. return NULL;
  7707. __pyx_L4_argument_unpacking_done:;
  7708. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_classe, __pyx_v_ignore_duplicates);
  7709. /* function exit code */
  7710. __Pyx_RefNannyFinishContext();
  7711. return __pyx_r;
  7712. }
  7713. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_86add_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_classe, PyObject *__pyx_v_ignore_duplicates) {
  7714. PyObject *__pyx_v_id = NULL;
  7715. PyObject *__pyx_v_node = NULL;
  7716. PyObject *__pyx_v_edge = NULL;
  7717. PyObject *__pyx_r = NULL;
  7718. __Pyx_RefNannyDeclarations
  7719. PyObject *__pyx_t_1 = NULL;
  7720. PyObject *__pyx_t_2 = NULL;
  7721. PyObject *__pyx_t_3 = NULL;
  7722. PyObject *__pyx_t_4 = NULL;
  7723. int __pyx_t_5;
  7724. PyObject *__pyx_t_6 = NULL;
  7725. Py_ssize_t __pyx_t_7;
  7726. PyObject *(*__pyx_t_8)(PyObject *);
  7727. PyObject *__pyx_t_9 = NULL;
  7728. PyObject *__pyx_t_10 = NULL;
  7729. PyObject *__pyx_t_11 = NULL;
  7730. PyObject *__pyx_t_12 = NULL;
  7731. PyObject *__pyx_t_13 = NULL;
  7732. PyObject *__pyx_t_14 = NULL;
  7733. __Pyx_RefNannySetupContext("add_nx_graph", 0);
  7734. /* "gedlibpy.pyx":879
  7735. *
  7736. * """
  7737. * id = self.add_graph(g.name, classe) # <<<<<<<<<<<<<<
  7738. * for node in g.nodes:
  7739. * self.add_node(id, str(node), g.nodes[node])
  7740. */
  7741. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
  7742. __Pyx_GOTREF(__pyx_t_2);
  7743. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 879, __pyx_L1_error)
  7744. __Pyx_GOTREF(__pyx_t_3);
  7745. __pyx_t_4 = NULL;
  7746. __pyx_t_5 = 0;
  7747. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  7748. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
  7749. if (likely(__pyx_t_4)) {
  7750. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  7751. __Pyx_INCREF(__pyx_t_4);
  7752. __Pyx_INCREF(function);
  7753. __Pyx_DECREF_SET(__pyx_t_2, function);
  7754. __pyx_t_5 = 1;
  7755. }
  7756. }
  7757. #if CYTHON_FAST_PYCALL
  7758. if (PyFunction_Check(__pyx_t_2)) {
  7759. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  7760. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
  7761. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7762. __Pyx_GOTREF(__pyx_t_1);
  7763. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7764. } else
  7765. #endif
  7766. #if CYTHON_FAST_PYCCALL
  7767. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  7768. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  7769. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
  7770. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7771. __Pyx_GOTREF(__pyx_t_1);
  7772. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7773. } else
  7774. #endif
  7775. {
  7776. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 879, __pyx_L1_error)
  7777. __Pyx_GOTREF(__pyx_t_6);
  7778. if (__pyx_t_4) {
  7779. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  7780. }
  7781. __Pyx_GIVEREF(__pyx_t_3);
  7782. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
  7783. __Pyx_INCREF(__pyx_v_classe);
  7784. __Pyx_GIVEREF(__pyx_v_classe);
  7785. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_classe);
  7786. __pyx_t_3 = 0;
  7787. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
  7788. __Pyx_GOTREF(__pyx_t_1);
  7789. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7790. }
  7791. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7792. __pyx_v_id = __pyx_t_1;
  7793. __pyx_t_1 = 0;
  7794. /* "gedlibpy.pyx":880
  7795. * """
  7796. * id = self.add_graph(g.name, classe)
  7797. * for node in g.nodes: # <<<<<<<<<<<<<<
  7798. * self.add_node(id, str(node), g.nodes[node])
  7799. * for edge in g.edges:
  7800. */
  7801. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  7802. __Pyx_GOTREF(__pyx_t_1);
  7803. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  7804. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
  7805. __pyx_t_8 = NULL;
  7806. } else {
  7807. __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error)
  7808. __Pyx_GOTREF(__pyx_t_2);
  7809. __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 880, __pyx_L1_error)
  7810. }
  7811. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7812. for (;;) {
  7813. if (likely(!__pyx_t_8)) {
  7814. if (likely(PyList_CheckExact(__pyx_t_2))) {
  7815. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
  7816. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7817. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 880, __pyx_L1_error)
  7818. #else
  7819. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  7820. __Pyx_GOTREF(__pyx_t_1);
  7821. #endif
  7822. } else {
  7823. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  7824. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7825. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 880, __pyx_L1_error)
  7826. #else
  7827. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 880, __pyx_L1_error)
  7828. __Pyx_GOTREF(__pyx_t_1);
  7829. #endif
  7830. }
  7831. } else {
  7832. __pyx_t_1 = __pyx_t_8(__pyx_t_2);
  7833. if (unlikely(!__pyx_t_1)) {
  7834. PyObject* exc_type = PyErr_Occurred();
  7835. if (exc_type) {
  7836. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7837. else __PYX_ERR(0, 880, __pyx_L1_error)
  7838. }
  7839. break;
  7840. }
  7841. __Pyx_GOTREF(__pyx_t_1);
  7842. }
  7843. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
  7844. __pyx_t_1 = 0;
  7845. /* "gedlibpy.pyx":881
  7846. * id = self.add_graph(g.name, classe)
  7847. * for node in g.nodes:
  7848. * self.add_node(id, str(node), g.nodes[node]) # <<<<<<<<<<<<<<
  7849. * for edge in g.edges:
  7850. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  7851. */
  7852. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error)
  7853. __Pyx_GOTREF(__pyx_t_6);
  7854. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error)
  7855. __Pyx_GOTREF(__pyx_t_3);
  7856. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 881, __pyx_L1_error)
  7857. __Pyx_GOTREF(__pyx_t_4);
  7858. __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 881, __pyx_L1_error)
  7859. __Pyx_GOTREF(__pyx_t_9);
  7860. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  7861. __pyx_t_4 = NULL;
  7862. __pyx_t_5 = 0;
  7863. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  7864. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  7865. if (likely(__pyx_t_4)) {
  7866. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  7867. __Pyx_INCREF(__pyx_t_4);
  7868. __Pyx_INCREF(function);
  7869. __Pyx_DECREF_SET(__pyx_t_6, function);
  7870. __pyx_t_5 = 1;
  7871. }
  7872. }
  7873. #if CYTHON_FAST_PYCALL
  7874. if (PyFunction_Check(__pyx_t_6)) {
  7875. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  7876. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
  7877. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7878. __Pyx_GOTREF(__pyx_t_1);
  7879. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7880. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7881. } else
  7882. #endif
  7883. #if CYTHON_FAST_PYCCALL
  7884. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  7885. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  7886. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
  7887. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  7888. __Pyx_GOTREF(__pyx_t_1);
  7889. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7890. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  7891. } else
  7892. #endif
  7893. {
  7894. __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 881, __pyx_L1_error)
  7895. __Pyx_GOTREF(__pyx_t_10);
  7896. if (__pyx_t_4) {
  7897. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
  7898. }
  7899. __Pyx_INCREF(__pyx_v_id);
  7900. __Pyx_GIVEREF(__pyx_v_id);
  7901. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_id);
  7902. __Pyx_GIVEREF(__pyx_t_3);
  7903. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_3);
  7904. __Pyx_GIVEREF(__pyx_t_9);
  7905. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_9);
  7906. __pyx_t_3 = 0;
  7907. __pyx_t_9 = 0;
  7908. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
  7909. __Pyx_GOTREF(__pyx_t_1);
  7910. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7911. }
  7912. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  7913. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7914. /* "gedlibpy.pyx":880
  7915. * """
  7916. * id = self.add_graph(g.name, classe)
  7917. * for node in g.nodes: # <<<<<<<<<<<<<<
  7918. * self.add_node(id, str(node), g.nodes[node])
  7919. * for edge in g.edges:
  7920. */
  7921. }
  7922. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7923. /* "gedlibpy.pyx":882
  7924. * for node in g.nodes:
  7925. * self.add_node(id, str(node), g.nodes[node])
  7926. * for edge in g.edges: # <<<<<<<<<<<<<<
  7927. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  7928. * return id
  7929. */
  7930. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  7931. __Pyx_GOTREF(__pyx_t_2);
  7932. if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
  7933. __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
  7934. __pyx_t_8 = NULL;
  7935. } else {
  7936. __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
  7937. __Pyx_GOTREF(__pyx_t_1);
  7938. __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 882, __pyx_L1_error)
  7939. }
  7940. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7941. for (;;) {
  7942. if (likely(!__pyx_t_8)) {
  7943. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7944. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7945. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7946. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
  7947. #else
  7948. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  7949. __Pyx_GOTREF(__pyx_t_2);
  7950. #endif
  7951. } else {
  7952. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7953. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7954. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_7); __Pyx_INCREF(__pyx_t_2); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 882, __pyx_L1_error)
  7955. #else
  7956. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  7957. __Pyx_GOTREF(__pyx_t_2);
  7958. #endif
  7959. }
  7960. } else {
  7961. __pyx_t_2 = __pyx_t_8(__pyx_t_1);
  7962. if (unlikely(!__pyx_t_2)) {
  7963. PyObject* exc_type = PyErr_Occurred();
  7964. if (exc_type) {
  7965. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7966. else __PYX_ERR(0, 882, __pyx_L1_error)
  7967. }
  7968. break;
  7969. }
  7970. __Pyx_GOTREF(__pyx_t_2);
  7971. }
  7972. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  7973. __pyx_t_2 = 0;
  7974. /* "gedlibpy.pyx":883
  7975. * self.add_node(id, str(node), g.nodes[node])
  7976. * for edge in g.edges:
  7977. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) # <<<<<<<<<<<<<<
  7978. * return id
  7979. *
  7980. */
  7981. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error)
  7982. __Pyx_GOTREF(__pyx_t_6);
  7983. __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error)
  7984. __Pyx_GOTREF(__pyx_t_10);
  7985. __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 883, __pyx_L1_error)
  7986. __Pyx_GOTREF(__pyx_t_9);
  7987. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7988. __pyx_t_10 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error)
  7989. __Pyx_GOTREF(__pyx_t_10);
  7990. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error)
  7991. __Pyx_GOTREF(__pyx_t_3);
  7992. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7993. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 883, __pyx_L1_error)
  7994. __Pyx_GOTREF(__pyx_t_4);
  7995. __pyx_t_11 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 883, __pyx_L1_error)
  7996. __Pyx_GOTREF(__pyx_t_11);
  7997. __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 883, __pyx_L1_error)
  7998. __Pyx_GOTREF(__pyx_t_12);
  7999. __pyx_t_13 = NULL;
  8000. __pyx_t_5 = 0;
  8001. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  8002. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
  8003. if (likely(__pyx_t_13)) {
  8004. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  8005. __Pyx_INCREF(__pyx_t_13);
  8006. __Pyx_INCREF(function);
  8007. __Pyx_DECREF_SET(__pyx_t_4, function);
  8008. __pyx_t_5 = 1;
  8009. }
  8010. }
  8011. #if CYTHON_FAST_PYCALL
  8012. if (PyFunction_Check(__pyx_t_4)) {
  8013. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8014. __pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error)
  8015. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8016. __Pyx_GOTREF(__pyx_t_10);
  8017. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8018. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8019. } else
  8020. #endif
  8021. #if CYTHON_FAST_PYCCALL
  8022. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  8023. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8024. __pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error)
  8025. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8026. __Pyx_GOTREF(__pyx_t_10);
  8027. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8028. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8029. } else
  8030. #endif
  8031. {
  8032. __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 883, __pyx_L1_error)
  8033. __Pyx_GOTREF(__pyx_t_14);
  8034. if (__pyx_t_13) {
  8035. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
  8036. }
  8037. __Pyx_GIVEREF(__pyx_t_11);
  8038. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_t_11);
  8039. __Pyx_GIVEREF(__pyx_t_12);
  8040. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_12);
  8041. __pyx_t_11 = 0;
  8042. __pyx_t_12 = 0;
  8043. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 883, __pyx_L1_error)
  8044. __Pyx_GOTREF(__pyx_t_10);
  8045. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8046. }
  8047. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8048. __pyx_t_4 = NULL;
  8049. __pyx_t_5 = 0;
  8050. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8051. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8052. if (likely(__pyx_t_4)) {
  8053. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8054. __Pyx_INCREF(__pyx_t_4);
  8055. __Pyx_INCREF(function);
  8056. __Pyx_DECREF_SET(__pyx_t_6, function);
  8057. __pyx_t_5 = 1;
  8058. }
  8059. }
  8060. #if CYTHON_FAST_PYCALL
  8061. if (PyFunction_Check(__pyx_t_6)) {
  8062. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8063. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  8064. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8065. __Pyx_GOTREF(__pyx_t_2);
  8066. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8067. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8068. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8069. } else
  8070. #endif
  8071. #if CYTHON_FAST_PYCCALL
  8072. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8073. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8074. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 5+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  8075. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8076. __Pyx_GOTREF(__pyx_t_2);
  8077. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8078. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8079. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8080. } else
  8081. #endif
  8082. {
  8083. __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 883, __pyx_L1_error)
  8084. __Pyx_GOTREF(__pyx_t_14);
  8085. if (__pyx_t_4) {
  8086. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8087. }
  8088. __Pyx_INCREF(__pyx_v_id);
  8089. __Pyx_GIVEREF(__pyx_v_id);
  8090. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_v_id);
  8091. __Pyx_GIVEREF(__pyx_t_9);
  8092. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_9);
  8093. __Pyx_GIVEREF(__pyx_t_3);
  8094. PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_5, __pyx_t_3);
  8095. __Pyx_GIVEREF(__pyx_t_10);
  8096. PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_5, __pyx_t_10);
  8097. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8098. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8099. PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_5, __pyx_v_ignore_duplicates);
  8100. __pyx_t_9 = 0;
  8101. __pyx_t_3 = 0;
  8102. __pyx_t_10 = 0;
  8103. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  8104. __Pyx_GOTREF(__pyx_t_2);
  8105. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8106. }
  8107. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8108. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8109. /* "gedlibpy.pyx":882
  8110. * for node in g.nodes:
  8111. * self.add_node(id, str(node), g.nodes[node])
  8112. * for edge in g.edges: # <<<<<<<<<<<<<<
  8113. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8114. * return id
  8115. */
  8116. }
  8117. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8118. /* "gedlibpy.pyx":884
  8119. * for edge in g.edges:
  8120. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8121. * return id # <<<<<<<<<<<<<<
  8122. *
  8123. *
  8124. */
  8125. __Pyx_XDECREF(__pyx_r);
  8126. __Pyx_INCREF(__pyx_v_id);
  8127. __pyx_r = __pyx_v_id;
  8128. goto __pyx_L0;
  8129. /* "gedlibpy.pyx":865
  8130. *
  8131. *
  8132. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8133. * """
  8134. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8135. */
  8136. /* function exit code */
  8137. __pyx_L1_error:;
  8138. __Pyx_XDECREF(__pyx_t_1);
  8139. __Pyx_XDECREF(__pyx_t_2);
  8140. __Pyx_XDECREF(__pyx_t_3);
  8141. __Pyx_XDECREF(__pyx_t_4);
  8142. __Pyx_XDECREF(__pyx_t_6);
  8143. __Pyx_XDECREF(__pyx_t_9);
  8144. __Pyx_XDECREF(__pyx_t_10);
  8145. __Pyx_XDECREF(__pyx_t_11);
  8146. __Pyx_XDECREF(__pyx_t_12);
  8147. __Pyx_XDECREF(__pyx_t_13);
  8148. __Pyx_XDECREF(__pyx_t_14);
  8149. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8150. __pyx_r = NULL;
  8151. __pyx_L0:;
  8152. __Pyx_XDECREF(__pyx_v_id);
  8153. __Pyx_XDECREF(__pyx_v_node);
  8154. __Pyx_XDECREF(__pyx_v_edge);
  8155. __Pyx_XGIVEREF(__pyx_r);
  8156. __Pyx_RefNannyFinishContext();
  8157. return __pyx_r;
  8158. }
  8159. /* "gedlibpy.pyx":887
  8160. *
  8161. *
  8162. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8163. * """
  8164. * Computes the edit distance between two NX graphs.
  8165. */
  8166. /* Python wrapper */
  8167. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8168. static char __pyx_doc_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs[] = "\n\t\t\tComputes the edit distance between two NX graphs. \n\t\t\t\n\t\t\t:param g1: The first graph to add and compute\n\t\t\t:param g2: The second graph to add and compute\n\t\t\t:param edit_cost: The name of the edit cost function\n\t\t\t:param method: The name of the computation method\n\t\t\t:param options: The options of the method (like bash options), an empty string by default\n\t\t\t:param init_option: The name of the init option, \"EAGER_WITHOUT_SHUFFLED_COPIES\" by default\n\t\t\t:type g1: networksx.graph\n\t\t\t:type g2: networksx.graph\n\t\t\t:type edit_cost: string\n\t\t\t:type method: string\n\t\t\t:type options: string\n\t\t\t:type init_option: string\n\t\t\t:return: The edit distance between the two graphs and the nodeMap between them. \n\t\t\t:rtype: double, list[tuple(size_t, size_t)]\n\t\n\t\t\t.. seealso:: list_of_edit_cost_options, list_of_method_options, list_of_init_options \n\t\t\t.. note:: Make sure each parameter exists with your architecture and these lists : list_of_edit_cost_options, list_of_method_options, list_of_init_options. The structure of graphs must be similar as GXL. \n\t\t\t\n\t\t";
  8169. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8170. PyObject *__pyx_v_g1 = 0;
  8171. PyObject *__pyx_v_g2 = 0;
  8172. PyObject *__pyx_v_edit_cost = 0;
  8173. PyObject *__pyx_v_method = 0;
  8174. PyObject *__pyx_v_options = 0;
  8175. PyObject *__pyx_v_init_option = 0;
  8176. PyObject *__pyx_r = 0;
  8177. __Pyx_RefNannyDeclarations
  8178. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs (wrapper)", 0);
  8179. {
  8180. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g1,&__pyx_n_s_g2,&__pyx_n_s_edit_cost,&__pyx_n_s_method,&__pyx_n_s_options,&__pyx_n_s_init_option,0};
  8181. PyObject* values[6] = {0,0,0,0,0,0};
  8182. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  8183. if (unlikely(__pyx_kwds)) {
  8184. Py_ssize_t kw_args;
  8185. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8186. switch (pos_args) {
  8187. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8188. CYTHON_FALLTHROUGH;
  8189. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8190. CYTHON_FALLTHROUGH;
  8191. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8192. CYTHON_FALLTHROUGH;
  8193. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8194. CYTHON_FALLTHROUGH;
  8195. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8196. CYTHON_FALLTHROUGH;
  8197. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8198. CYTHON_FALLTHROUGH;
  8199. case 0: break;
  8200. default: goto __pyx_L5_argtuple_error;
  8201. }
  8202. kw_args = PyDict_Size(__pyx_kwds);
  8203. switch (pos_args) {
  8204. case 0:
  8205. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g1)) != 0)) kw_args--;
  8206. else goto __pyx_L5_argtuple_error;
  8207. CYTHON_FALLTHROUGH;
  8208. case 1:
  8209. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g2)) != 0)) kw_args--;
  8210. else {
  8211. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 887, __pyx_L3_error)
  8212. }
  8213. CYTHON_FALLTHROUGH;
  8214. case 2:
  8215. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  8216. else {
  8217. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 887, __pyx_L3_error)
  8218. }
  8219. CYTHON_FALLTHROUGH;
  8220. case 3:
  8221. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  8222. else {
  8223. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 887, __pyx_L3_error)
  8224. }
  8225. CYTHON_FALLTHROUGH;
  8226. case 4:
  8227. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  8228. else {
  8229. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 887, __pyx_L3_error)
  8230. }
  8231. CYTHON_FALLTHROUGH;
  8232. case 5:
  8233. if (kw_args > 0) {
  8234. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  8235. if (value) { values[5] = value; kw_args--; }
  8236. }
  8237. }
  8238. if (unlikely(kw_args > 0)) {
  8239. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ged_on_two_graphs") < 0)) __PYX_ERR(0, 887, __pyx_L3_error)
  8240. }
  8241. } else {
  8242. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8243. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8244. CYTHON_FALLTHROUGH;
  8245. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8246. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8247. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8248. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8249. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8250. break;
  8251. default: goto __pyx_L5_argtuple_error;
  8252. }
  8253. }
  8254. __pyx_v_g1 = values[0];
  8255. __pyx_v_g2 = values[1];
  8256. __pyx_v_edit_cost = values[2];
  8257. __pyx_v_method = values[3];
  8258. __pyx_v_options = values[4];
  8259. __pyx_v_init_option = values[5];
  8260. }
  8261. goto __pyx_L4_argument_unpacking_done;
  8262. __pyx_L5_argtuple_error:;
  8263. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 887, __pyx_L3_error)
  8264. __pyx_L3_error:;
  8265. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8266. __Pyx_RefNannyFinishContext();
  8267. return NULL;
  8268. __pyx_L4_argument_unpacking_done:;
  8269. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g1, __pyx_v_g2, __pyx_v_edit_cost, __pyx_v_method, __pyx_v_options, __pyx_v_init_option);
  8270. /* function exit code */
  8271. __Pyx_RefNannyFinishContext();
  8272. return __pyx_r;
  8273. }
  8274. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g1, PyObject *__pyx_v_g2, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option) {
  8275. PyObject *__pyx_v_g = NULL;
  8276. PyObject *__pyx_v_h = NULL;
  8277. PyObject *__pyx_v_resDistance = NULL;
  8278. PyObject *__pyx_v_resMapping = NULL;
  8279. PyObject *__pyx_r = NULL;
  8280. __Pyx_RefNannyDeclarations
  8281. PyObject *__pyx_t_1 = NULL;
  8282. PyObject *__pyx_t_2 = NULL;
  8283. PyObject *__pyx_t_3 = NULL;
  8284. int __pyx_t_4;
  8285. int __pyx_t_5;
  8286. PyObject *__pyx_t_6 = NULL;
  8287. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs", 0);
  8288. /* "gedlibpy.pyx":910
  8289. *
  8290. * """
  8291. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8292. * self.restart_env()
  8293. *
  8294. */
  8295. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
  8296. __Pyx_GOTREF(__pyx_t_2);
  8297. __pyx_t_3 = NULL;
  8298. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8299. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8300. if (likely(__pyx_t_3)) {
  8301. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8302. __Pyx_INCREF(__pyx_t_3);
  8303. __Pyx_INCREF(function);
  8304. __Pyx_DECREF_SET(__pyx_t_2, function);
  8305. }
  8306. }
  8307. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8308. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8309. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 910, __pyx_L1_error)
  8310. __Pyx_GOTREF(__pyx_t_1);
  8311. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8312. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 910, __pyx_L1_error)
  8313. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8314. if (__pyx_t_4) {
  8315. /* "gedlibpy.pyx":911
  8316. * """
  8317. * if self.is_initialized() :
  8318. * self.restart_env() # <<<<<<<<<<<<<<
  8319. *
  8320. * g = self.add_nx_graph(g1, "")
  8321. */
  8322. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 911, __pyx_L1_error)
  8323. __Pyx_GOTREF(__pyx_t_2);
  8324. __pyx_t_3 = NULL;
  8325. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8326. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8327. if (likely(__pyx_t_3)) {
  8328. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8329. __Pyx_INCREF(__pyx_t_3);
  8330. __Pyx_INCREF(function);
  8331. __Pyx_DECREF_SET(__pyx_t_2, function);
  8332. }
  8333. }
  8334. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8335. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8336. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 911, __pyx_L1_error)
  8337. __Pyx_GOTREF(__pyx_t_1);
  8338. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8339. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8340. /* "gedlibpy.pyx":910
  8341. *
  8342. * """
  8343. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8344. * self.restart_env()
  8345. *
  8346. */
  8347. }
  8348. /* "gedlibpy.pyx":913
  8349. * self.restart_env()
  8350. *
  8351. * g = self.add_nx_graph(g1, "") # <<<<<<<<<<<<<<
  8352. * h = self.add_nx_graph(g2, "")
  8353. *
  8354. */
  8355. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 913, __pyx_L1_error)
  8356. __Pyx_GOTREF(__pyx_t_2);
  8357. __pyx_t_3 = NULL;
  8358. __pyx_t_5 = 0;
  8359. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8360. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8361. if (likely(__pyx_t_3)) {
  8362. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8363. __Pyx_INCREF(__pyx_t_3);
  8364. __Pyx_INCREF(function);
  8365. __Pyx_DECREF_SET(__pyx_t_2, function);
  8366. __pyx_t_5 = 1;
  8367. }
  8368. }
  8369. #if CYTHON_FAST_PYCALL
  8370. if (PyFunction_Check(__pyx_t_2)) {
  8371. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8372. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  8373. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8374. __Pyx_GOTREF(__pyx_t_1);
  8375. } else
  8376. #endif
  8377. #if CYTHON_FAST_PYCCALL
  8378. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8379. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8380. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  8381. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8382. __Pyx_GOTREF(__pyx_t_1);
  8383. } else
  8384. #endif
  8385. {
  8386. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
  8387. __Pyx_GOTREF(__pyx_t_6);
  8388. if (__pyx_t_3) {
  8389. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8390. }
  8391. __Pyx_INCREF(__pyx_v_g1);
  8392. __Pyx_GIVEREF(__pyx_v_g1);
  8393. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g1);
  8394. __Pyx_INCREF(__pyx_kp_u_);
  8395. __Pyx_GIVEREF(__pyx_kp_u_);
  8396. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_u_);
  8397. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 913, __pyx_L1_error)
  8398. __Pyx_GOTREF(__pyx_t_1);
  8399. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8400. }
  8401. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8402. __pyx_v_g = __pyx_t_1;
  8403. __pyx_t_1 = 0;
  8404. /* "gedlibpy.pyx":914
  8405. *
  8406. * g = self.add_nx_graph(g1, "")
  8407. * h = self.add_nx_graph(g2, "") # <<<<<<<<<<<<<<
  8408. *
  8409. * self.set_edit_cost(edit_cost)
  8410. */
  8411. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 914, __pyx_L1_error)
  8412. __Pyx_GOTREF(__pyx_t_2);
  8413. __pyx_t_6 = NULL;
  8414. __pyx_t_5 = 0;
  8415. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8416. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8417. if (likely(__pyx_t_6)) {
  8418. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8419. __Pyx_INCREF(__pyx_t_6);
  8420. __Pyx_INCREF(function);
  8421. __Pyx_DECREF_SET(__pyx_t_2, function);
  8422. __pyx_t_5 = 1;
  8423. }
  8424. }
  8425. #if CYTHON_FAST_PYCALL
  8426. if (PyFunction_Check(__pyx_t_2)) {
  8427. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8428. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  8429. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8430. __Pyx_GOTREF(__pyx_t_1);
  8431. } else
  8432. #endif
  8433. #if CYTHON_FAST_PYCCALL
  8434. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8435. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8436. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  8437. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8438. __Pyx_GOTREF(__pyx_t_1);
  8439. } else
  8440. #endif
  8441. {
  8442. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
  8443. __Pyx_GOTREF(__pyx_t_3);
  8444. if (__pyx_t_6) {
  8445. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8446. }
  8447. __Pyx_INCREF(__pyx_v_g2);
  8448. __Pyx_GIVEREF(__pyx_v_g2);
  8449. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g2);
  8450. __Pyx_INCREF(__pyx_kp_u_);
  8451. __Pyx_GIVEREF(__pyx_kp_u_);
  8452. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_);
  8453. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 914, __pyx_L1_error)
  8454. __Pyx_GOTREF(__pyx_t_1);
  8455. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8456. }
  8457. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8458. __pyx_v_h = __pyx_t_1;
  8459. __pyx_t_1 = 0;
  8460. /* "gedlibpy.pyx":916
  8461. * h = self.add_nx_graph(g2, "")
  8462. *
  8463. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  8464. * self.init(init_option)
  8465. *
  8466. */
  8467. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 916, __pyx_L1_error)
  8468. __Pyx_GOTREF(__pyx_t_2);
  8469. __pyx_t_3 = NULL;
  8470. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8471. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8472. if (likely(__pyx_t_3)) {
  8473. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8474. __Pyx_INCREF(__pyx_t_3);
  8475. __Pyx_INCREF(function);
  8476. __Pyx_DECREF_SET(__pyx_t_2, function);
  8477. }
  8478. }
  8479. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edit_cost);
  8480. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8481. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 916, __pyx_L1_error)
  8482. __Pyx_GOTREF(__pyx_t_1);
  8483. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8484. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8485. /* "gedlibpy.pyx":917
  8486. *
  8487. * self.set_edit_cost(edit_cost)
  8488. * self.init(init_option) # <<<<<<<<<<<<<<
  8489. *
  8490. * self.set_method(method, options)
  8491. */
  8492. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 917, __pyx_L1_error)
  8493. __Pyx_GOTREF(__pyx_t_2);
  8494. __pyx_t_3 = NULL;
  8495. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8496. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8497. if (likely(__pyx_t_3)) {
  8498. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8499. __Pyx_INCREF(__pyx_t_3);
  8500. __Pyx_INCREF(function);
  8501. __Pyx_DECREF_SET(__pyx_t_2, function);
  8502. }
  8503. }
  8504. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_init_option);
  8505. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8506. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 917, __pyx_L1_error)
  8507. __Pyx_GOTREF(__pyx_t_1);
  8508. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8509. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8510. /* "gedlibpy.pyx":919
  8511. * self.init(init_option)
  8512. *
  8513. * self.set_method(method, options) # <<<<<<<<<<<<<<
  8514. * self.init_method()
  8515. *
  8516. */
  8517. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 919, __pyx_L1_error)
  8518. __Pyx_GOTREF(__pyx_t_2);
  8519. __pyx_t_3 = NULL;
  8520. __pyx_t_5 = 0;
  8521. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8522. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8523. if (likely(__pyx_t_3)) {
  8524. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8525. __Pyx_INCREF(__pyx_t_3);
  8526. __Pyx_INCREF(function);
  8527. __Pyx_DECREF_SET(__pyx_t_2, function);
  8528. __pyx_t_5 = 1;
  8529. }
  8530. }
  8531. #if CYTHON_FAST_PYCALL
  8532. if (PyFunction_Check(__pyx_t_2)) {
  8533. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8534. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
  8535. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8536. __Pyx_GOTREF(__pyx_t_1);
  8537. } else
  8538. #endif
  8539. #if CYTHON_FAST_PYCCALL
  8540. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8541. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8542. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
  8543. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8544. __Pyx_GOTREF(__pyx_t_1);
  8545. } else
  8546. #endif
  8547. {
  8548. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
  8549. __Pyx_GOTREF(__pyx_t_6);
  8550. if (__pyx_t_3) {
  8551. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8552. }
  8553. __Pyx_INCREF(__pyx_v_method);
  8554. __Pyx_GIVEREF(__pyx_v_method);
  8555. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
  8556. __Pyx_INCREF(__pyx_v_options);
  8557. __Pyx_GIVEREF(__pyx_v_options);
  8558. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_options);
  8559. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 919, __pyx_L1_error)
  8560. __Pyx_GOTREF(__pyx_t_1);
  8561. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8562. }
  8563. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8564. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8565. /* "gedlibpy.pyx":920
  8566. *
  8567. * self.set_method(method, options)
  8568. * self.init_method() # <<<<<<<<<<<<<<
  8569. *
  8570. * resDistance = 0
  8571. */
  8572. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 920, __pyx_L1_error)
  8573. __Pyx_GOTREF(__pyx_t_2);
  8574. __pyx_t_6 = NULL;
  8575. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8576. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8577. if (likely(__pyx_t_6)) {
  8578. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8579. __Pyx_INCREF(__pyx_t_6);
  8580. __Pyx_INCREF(function);
  8581. __Pyx_DECREF_SET(__pyx_t_2, function);
  8582. }
  8583. }
  8584. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8585. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8586. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 920, __pyx_L1_error)
  8587. __Pyx_GOTREF(__pyx_t_1);
  8588. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8589. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8590. /* "gedlibpy.pyx":922
  8591. * self.init_method()
  8592. *
  8593. * resDistance = 0 # <<<<<<<<<<<<<<
  8594. * resMapping = []
  8595. * self.run_method(g, h)
  8596. */
  8597. __Pyx_INCREF(__pyx_int_0);
  8598. __pyx_v_resDistance = __pyx_int_0;
  8599. /* "gedlibpy.pyx":923
  8600. *
  8601. * resDistance = 0
  8602. * resMapping = [] # <<<<<<<<<<<<<<
  8603. * self.run_method(g, h)
  8604. * resDistance = self.get_upper_bound(g, h)
  8605. */
  8606. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 923, __pyx_L1_error)
  8607. __Pyx_GOTREF(__pyx_t_1);
  8608. __pyx_v_resMapping = __pyx_t_1;
  8609. __pyx_t_1 = 0;
  8610. /* "gedlibpy.pyx":924
  8611. * resDistance = 0
  8612. * resMapping = []
  8613. * self.run_method(g, h) # <<<<<<<<<<<<<<
  8614. * resDistance = self.get_upper_bound(g, h)
  8615. * resMapping = self.get_node_map(g, h)
  8616. */
  8617. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 924, __pyx_L1_error)
  8618. __Pyx_GOTREF(__pyx_t_2);
  8619. __pyx_t_6 = NULL;
  8620. __pyx_t_5 = 0;
  8621. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8622. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8623. if (likely(__pyx_t_6)) {
  8624. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8625. __Pyx_INCREF(__pyx_t_6);
  8626. __Pyx_INCREF(function);
  8627. __Pyx_DECREF_SET(__pyx_t_2, function);
  8628. __pyx_t_5 = 1;
  8629. }
  8630. }
  8631. #if CYTHON_FAST_PYCALL
  8632. if (PyFunction_Check(__pyx_t_2)) {
  8633. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  8634. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
  8635. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8636. __Pyx_GOTREF(__pyx_t_1);
  8637. } else
  8638. #endif
  8639. #if CYTHON_FAST_PYCCALL
  8640. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8641. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  8642. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
  8643. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8644. __Pyx_GOTREF(__pyx_t_1);
  8645. } else
  8646. #endif
  8647. {
  8648. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 924, __pyx_L1_error)
  8649. __Pyx_GOTREF(__pyx_t_3);
  8650. if (__pyx_t_6) {
  8651. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8652. }
  8653. __Pyx_INCREF(__pyx_v_g);
  8654. __Pyx_GIVEREF(__pyx_v_g);
  8655. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  8656. __Pyx_INCREF(__pyx_v_h);
  8657. __Pyx_GIVEREF(__pyx_v_h);
  8658. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  8659. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 924, __pyx_L1_error)
  8660. __Pyx_GOTREF(__pyx_t_1);
  8661. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8662. }
  8663. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8664. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8665. /* "gedlibpy.pyx":925
  8666. * resMapping = []
  8667. * self.run_method(g, h)
  8668. * resDistance = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  8669. * resMapping = self.get_node_map(g, h)
  8670. *
  8671. */
  8672. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 925, __pyx_L1_error)
  8673. __Pyx_GOTREF(__pyx_t_2);
  8674. __pyx_t_3 = NULL;
  8675. __pyx_t_5 = 0;
  8676. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8677. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8678. if (likely(__pyx_t_3)) {
  8679. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8680. __Pyx_INCREF(__pyx_t_3);
  8681. __Pyx_INCREF(function);
  8682. __Pyx_DECREF_SET(__pyx_t_2, function);
  8683. __pyx_t_5 = 1;
  8684. }
  8685. }
  8686. #if CYTHON_FAST_PYCALL
  8687. if (PyFunction_Check(__pyx_t_2)) {
  8688. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  8689. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error)
  8690. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8691. __Pyx_GOTREF(__pyx_t_1);
  8692. } else
  8693. #endif
  8694. #if CYTHON_FAST_PYCCALL
  8695. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8696. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  8697. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error)
  8698. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8699. __Pyx_GOTREF(__pyx_t_1);
  8700. } else
  8701. #endif
  8702. {
  8703. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 925, __pyx_L1_error)
  8704. __Pyx_GOTREF(__pyx_t_6);
  8705. if (__pyx_t_3) {
  8706. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8707. }
  8708. __Pyx_INCREF(__pyx_v_g);
  8709. __Pyx_GIVEREF(__pyx_v_g);
  8710. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g);
  8711. __Pyx_INCREF(__pyx_v_h);
  8712. __Pyx_GIVEREF(__pyx_v_h);
  8713. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_h);
  8714. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error)
  8715. __Pyx_GOTREF(__pyx_t_1);
  8716. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8717. }
  8718. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8719. __Pyx_DECREF_SET(__pyx_v_resDistance, __pyx_t_1);
  8720. __pyx_t_1 = 0;
  8721. /* "gedlibpy.pyx":926
  8722. * self.run_method(g, h)
  8723. * resDistance = self.get_upper_bound(g, h)
  8724. * resMapping = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  8725. *
  8726. * return resDistance, resMapping
  8727. */
  8728. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 926, __pyx_L1_error)
  8729. __Pyx_GOTREF(__pyx_t_2);
  8730. __pyx_t_6 = NULL;
  8731. __pyx_t_5 = 0;
  8732. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8733. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8734. if (likely(__pyx_t_6)) {
  8735. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8736. __Pyx_INCREF(__pyx_t_6);
  8737. __Pyx_INCREF(function);
  8738. __Pyx_DECREF_SET(__pyx_t_2, function);
  8739. __pyx_t_5 = 1;
  8740. }
  8741. }
  8742. #if CYTHON_FAST_PYCALL
  8743. if (PyFunction_Check(__pyx_t_2)) {
  8744. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  8745. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
  8746. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8747. __Pyx_GOTREF(__pyx_t_1);
  8748. } else
  8749. #endif
  8750. #if CYTHON_FAST_PYCCALL
  8751. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8752. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  8753. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
  8754. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8755. __Pyx_GOTREF(__pyx_t_1);
  8756. } else
  8757. #endif
  8758. {
  8759. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
  8760. __Pyx_GOTREF(__pyx_t_3);
  8761. if (__pyx_t_6) {
  8762. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8763. }
  8764. __Pyx_INCREF(__pyx_v_g);
  8765. __Pyx_GIVEREF(__pyx_v_g);
  8766. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  8767. __Pyx_INCREF(__pyx_v_h);
  8768. __Pyx_GIVEREF(__pyx_v_h);
  8769. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  8770. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 926, __pyx_L1_error)
  8771. __Pyx_GOTREF(__pyx_t_1);
  8772. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8773. }
  8774. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8775. __Pyx_DECREF_SET(__pyx_v_resMapping, __pyx_t_1);
  8776. __pyx_t_1 = 0;
  8777. /* "gedlibpy.pyx":928
  8778. * resMapping = self.get_node_map(g, h)
  8779. *
  8780. * return resDistance, resMapping # <<<<<<<<<<<<<<
  8781. *
  8782. *
  8783. */
  8784. __Pyx_XDECREF(__pyx_r);
  8785. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
  8786. __Pyx_GOTREF(__pyx_t_1);
  8787. __Pyx_INCREF(__pyx_v_resDistance);
  8788. __Pyx_GIVEREF(__pyx_v_resDistance);
  8789. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_resDistance);
  8790. __Pyx_INCREF(__pyx_v_resMapping);
  8791. __Pyx_GIVEREF(__pyx_v_resMapping);
  8792. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_resMapping);
  8793. __pyx_r = __pyx_t_1;
  8794. __pyx_t_1 = 0;
  8795. goto __pyx_L0;
  8796. /* "gedlibpy.pyx":887
  8797. *
  8798. *
  8799. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8800. * """
  8801. * Computes the edit distance between two NX graphs.
  8802. */
  8803. /* function exit code */
  8804. __pyx_L1_error:;
  8805. __Pyx_XDECREF(__pyx_t_1);
  8806. __Pyx_XDECREF(__pyx_t_2);
  8807. __Pyx_XDECREF(__pyx_t_3);
  8808. __Pyx_XDECREF(__pyx_t_6);
  8809. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8810. __pyx_r = NULL;
  8811. __pyx_L0:;
  8812. __Pyx_XDECREF(__pyx_v_g);
  8813. __Pyx_XDECREF(__pyx_v_h);
  8814. __Pyx_XDECREF(__pyx_v_resDistance);
  8815. __Pyx_XDECREF(__pyx_v_resMapping);
  8816. __Pyx_XGIVEREF(__pyx_r);
  8817. __Pyx_RefNannyFinishContext();
  8818. return __pyx_r;
  8819. }
  8820. /* "gedlibpy.pyx":931
  8821. *
  8822. *
  8823. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8824. * """
  8825. *
  8826. */
  8827. /* Python wrapper */
  8828. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8829. static char __pyx_doc_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs[] = "\n\t\n\t\t\tComputes all the edit distance between each NX graphs on the dataset. \n\t\t\t\n\t\t\t:param dataset: The list of graphs to add and compute\n\t\t\t:param classes: The classe of all the graph, can be an empty string\n\t\t\t:param edit_cost: The name of the edit cost function\n\t\t\t:param method: The name of the computation method\n\t\t\t:param options: The options of the method (like bash options), an empty string by default\n\t\t\t:param init_option: The name of the init option, \"EAGER_WITHOUT_SHUFFLED_COPIES\" by default\n\t\t\t:type dataset: list[networksx.graph]\n\t\t\t:type classes: string\n\t\t\t:type edit_cost: string\n\t\t\t:type method: string\n\t\t\t:type options: string\n\t\t\t:type init_option: string\n\t\t\t:return: Two matrix, the first with edit distances between graphs and the second the nodeMap between graphs. The result between g and h is one the [g][h] coordinates.\n\t\t\t:rtype: list[list[double]], list[list[list[tuple(size_t, size_t)]]]\n\t\n\t\t\t.. seealso:: list_of_edit_cost_options, list_of_method_options, list_of_init_options\n\t\t\t.. note:: Make sure each parameter exists with your architecture and these lists : list_of_edit_cost_options, list_of_method_options, list_of_init_options. The structure of graphs must be similar as GXL. \n\t\t\t\n\t\t";
  8830. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8831. PyObject *__pyx_v_dataset = 0;
  8832. PyObject *__pyx_v_classes = 0;
  8833. PyObject *__pyx_v_edit_cost = 0;
  8834. PyObject *__pyx_v_method = 0;
  8835. PyObject *__pyx_v_options = 0;
  8836. PyObject *__pyx_v_init_option = 0;
  8837. PyObject *__pyx_r = 0;
  8838. __Pyx_RefNannyDeclarations
  8839. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs (wrapper)", 0);
  8840. {
  8841. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dataset,&__pyx_n_s_classes,&__pyx_n_s_edit_cost,&__pyx_n_s_method,&__pyx_n_s_options,&__pyx_n_s_init_option,0};
  8842. PyObject* values[6] = {0,0,0,0,0,0};
  8843. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  8844. if (unlikely(__pyx_kwds)) {
  8845. Py_ssize_t kw_args;
  8846. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8847. switch (pos_args) {
  8848. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8849. CYTHON_FALLTHROUGH;
  8850. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8851. CYTHON_FALLTHROUGH;
  8852. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8853. CYTHON_FALLTHROUGH;
  8854. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8855. CYTHON_FALLTHROUGH;
  8856. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8857. CYTHON_FALLTHROUGH;
  8858. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8859. CYTHON_FALLTHROUGH;
  8860. case 0: break;
  8861. default: goto __pyx_L5_argtuple_error;
  8862. }
  8863. kw_args = PyDict_Size(__pyx_kwds);
  8864. switch (pos_args) {
  8865. case 0:
  8866. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dataset)) != 0)) kw_args--;
  8867. else goto __pyx_L5_argtuple_error;
  8868. CYTHON_FALLTHROUGH;
  8869. case 1:
  8870. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classes)) != 0)) kw_args--;
  8871. else {
  8872. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 931, __pyx_L3_error)
  8873. }
  8874. CYTHON_FALLTHROUGH;
  8875. case 2:
  8876. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  8877. else {
  8878. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 931, __pyx_L3_error)
  8879. }
  8880. CYTHON_FALLTHROUGH;
  8881. case 3:
  8882. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  8883. else {
  8884. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 931, __pyx_L3_error)
  8885. }
  8886. CYTHON_FALLTHROUGH;
  8887. case 4:
  8888. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  8889. else {
  8890. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 931, __pyx_L3_error)
  8891. }
  8892. CYTHON_FALLTHROUGH;
  8893. case 5:
  8894. if (kw_args > 0) {
  8895. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  8896. if (value) { values[5] = value; kw_args--; }
  8897. }
  8898. }
  8899. if (unlikely(kw_args > 0)) {
  8900. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_nx_graphs") < 0)) __PYX_ERR(0, 931, __pyx_L3_error)
  8901. }
  8902. } else {
  8903. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8904. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8905. CYTHON_FALLTHROUGH;
  8906. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8907. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8908. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8909. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8910. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8911. break;
  8912. default: goto __pyx_L5_argtuple_error;
  8913. }
  8914. }
  8915. __pyx_v_dataset = values[0];
  8916. __pyx_v_classes = values[1];
  8917. __pyx_v_edit_cost = values[2];
  8918. __pyx_v_method = values[3];
  8919. __pyx_v_options = values[4];
  8920. __pyx_v_init_option = values[5];
  8921. }
  8922. goto __pyx_L4_argument_unpacking_done;
  8923. __pyx_L5_argtuple_error:;
  8924. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 931, __pyx_L3_error)
  8925. __pyx_L3_error:;
  8926. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8927. __Pyx_RefNannyFinishContext();
  8928. return NULL;
  8929. __pyx_L4_argument_unpacking_done:;
  8930. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_dataset, __pyx_v_classes, __pyx_v_edit_cost, __pyx_v_method, __pyx_v_options, __pyx_v_init_option);
  8931. /* function exit code */
  8932. __Pyx_RefNannyFinishContext();
  8933. return __pyx_r;
  8934. }
  8935. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_dataset, PyObject *__pyx_v_classes, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option) {
  8936. PyObject *__pyx_v_graph = NULL;
  8937. PyObject *__pyx_v_listID = NULL;
  8938. PyObject *__pyx_v_resDistance = NULL;
  8939. PyObject *__pyx_v_resMapping = NULL;
  8940. PyObject *__pyx_v_g = NULL;
  8941. PyObject *__pyx_v_h = NULL;
  8942. PyObject *__pyx_r = NULL;
  8943. __Pyx_RefNannyDeclarations
  8944. PyObject *__pyx_t_1 = NULL;
  8945. PyObject *__pyx_t_2 = NULL;
  8946. PyObject *__pyx_t_3 = NULL;
  8947. int __pyx_t_4;
  8948. Py_ssize_t __pyx_t_5;
  8949. PyObject *(*__pyx_t_6)(PyObject *);
  8950. PyObject *__pyx_t_7 = NULL;
  8951. int __pyx_t_8;
  8952. PyObject *__pyx_t_9 = NULL;
  8953. Py_ssize_t __pyx_t_10;
  8954. PyObject *(*__pyx_t_11)(PyObject *);
  8955. PyObject *__pyx_t_12 = NULL;
  8956. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs", 0);
  8957. /* "gedlibpy.pyx":955
  8958. *
  8959. * """
  8960. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8961. * self.restart_env()
  8962. *
  8963. */
  8964. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 955, __pyx_L1_error)
  8965. __Pyx_GOTREF(__pyx_t_2);
  8966. __pyx_t_3 = NULL;
  8967. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8968. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8969. if (likely(__pyx_t_3)) {
  8970. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8971. __Pyx_INCREF(__pyx_t_3);
  8972. __Pyx_INCREF(function);
  8973. __Pyx_DECREF_SET(__pyx_t_2, function);
  8974. }
  8975. }
  8976. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8977. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8978. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
  8979. __Pyx_GOTREF(__pyx_t_1);
  8980. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8981. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 955, __pyx_L1_error)
  8982. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8983. if (__pyx_t_4) {
  8984. /* "gedlibpy.pyx":956
  8985. * """
  8986. * if self.is_initialized() :
  8987. * self.restart_env() # <<<<<<<<<<<<<<
  8988. *
  8989. * print("Loading graphs in progress...")
  8990. */
  8991. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error)
  8992. __Pyx_GOTREF(__pyx_t_2);
  8993. __pyx_t_3 = NULL;
  8994. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8995. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8996. if (likely(__pyx_t_3)) {
  8997. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8998. __Pyx_INCREF(__pyx_t_3);
  8999. __Pyx_INCREF(function);
  9000. __Pyx_DECREF_SET(__pyx_t_2, function);
  9001. }
  9002. }
  9003. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9004. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9005. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
  9006. __Pyx_GOTREF(__pyx_t_1);
  9007. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9008. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9009. /* "gedlibpy.pyx":955
  9010. *
  9011. * """
  9012. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9013. * self.restart_env()
  9014. *
  9015. */
  9016. }
  9017. /* "gedlibpy.pyx":958
  9018. * self.restart_env()
  9019. *
  9020. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  9021. * for graph in dataset :
  9022. * self.add_nx_graph(graph, classes)
  9023. */
  9024. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 958, __pyx_L1_error)
  9025. __Pyx_GOTREF(__pyx_t_1);
  9026. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9027. /* "gedlibpy.pyx":959
  9028. *
  9029. * print("Loading graphs in progress...")
  9030. * for graph in dataset : # <<<<<<<<<<<<<<
  9031. * self.add_nx_graph(graph, classes)
  9032. * listID = self.graph_ids()
  9033. */
  9034. if (likely(PyList_CheckExact(__pyx_v_dataset)) || PyTuple_CheckExact(__pyx_v_dataset)) {
  9035. __pyx_t_1 = __pyx_v_dataset; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  9036. __pyx_t_6 = NULL;
  9037. } else {
  9038. __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
  9039. __Pyx_GOTREF(__pyx_t_1);
  9040. __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 959, __pyx_L1_error)
  9041. }
  9042. for (;;) {
  9043. if (likely(!__pyx_t_6)) {
  9044. if (likely(PyList_CheckExact(__pyx_t_1))) {
  9045. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
  9046. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9047. __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error)
  9048. #else
  9049. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
  9050. __Pyx_GOTREF(__pyx_t_2);
  9051. #endif
  9052. } else {
  9053. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  9054. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9055. __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_5); __Pyx_INCREF(__pyx_t_2); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 959, __pyx_L1_error)
  9056. #else
  9057. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
  9058. __Pyx_GOTREF(__pyx_t_2);
  9059. #endif
  9060. }
  9061. } else {
  9062. __pyx_t_2 = __pyx_t_6(__pyx_t_1);
  9063. if (unlikely(!__pyx_t_2)) {
  9064. PyObject* exc_type = PyErr_Occurred();
  9065. if (exc_type) {
  9066. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9067. else __PYX_ERR(0, 959, __pyx_L1_error)
  9068. }
  9069. break;
  9070. }
  9071. __Pyx_GOTREF(__pyx_t_2);
  9072. }
  9073. __Pyx_XDECREF_SET(__pyx_v_graph, __pyx_t_2);
  9074. __pyx_t_2 = 0;
  9075. /* "gedlibpy.pyx":960
  9076. * print("Loading graphs in progress...")
  9077. * for graph in dataset :
  9078. * self.add_nx_graph(graph, classes) # <<<<<<<<<<<<<<
  9079. * listID = self.graph_ids()
  9080. * print("Graphs loaded ! ")
  9081. */
  9082. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 960, __pyx_L1_error)
  9083. __Pyx_GOTREF(__pyx_t_3);
  9084. __pyx_t_7 = NULL;
  9085. __pyx_t_8 = 0;
  9086. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  9087. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
  9088. if (likely(__pyx_t_7)) {
  9089. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  9090. __Pyx_INCREF(__pyx_t_7);
  9091. __Pyx_INCREF(function);
  9092. __Pyx_DECREF_SET(__pyx_t_3, function);
  9093. __pyx_t_8 = 1;
  9094. }
  9095. }
  9096. #if CYTHON_FAST_PYCALL
  9097. if (PyFunction_Check(__pyx_t_3)) {
  9098. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9099. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
  9100. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9101. __Pyx_GOTREF(__pyx_t_2);
  9102. } else
  9103. #endif
  9104. #if CYTHON_FAST_PYCCALL
  9105. if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
  9106. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9107. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
  9108. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9109. __Pyx_GOTREF(__pyx_t_2);
  9110. } else
  9111. #endif
  9112. {
  9113. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 960, __pyx_L1_error)
  9114. __Pyx_GOTREF(__pyx_t_9);
  9115. if (__pyx_t_7) {
  9116. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9117. }
  9118. __Pyx_INCREF(__pyx_v_graph);
  9119. __Pyx_GIVEREF(__pyx_v_graph);
  9120. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_graph);
  9121. __Pyx_INCREF(__pyx_v_classes);
  9122. __Pyx_GIVEREF(__pyx_v_classes);
  9123. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_classes);
  9124. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 960, __pyx_L1_error)
  9125. __Pyx_GOTREF(__pyx_t_2);
  9126. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9127. }
  9128. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9129. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9130. /* "gedlibpy.pyx":959
  9131. *
  9132. * print("Loading graphs in progress...")
  9133. * for graph in dataset : # <<<<<<<<<<<<<<
  9134. * self.add_nx_graph(graph, classes)
  9135. * listID = self.graph_ids()
  9136. */
  9137. }
  9138. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9139. /* "gedlibpy.pyx":961
  9140. * for graph in dataset :
  9141. * self.add_nx_graph(graph, classes)
  9142. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  9143. * print("Graphs loaded ! ")
  9144. * print("Number of graphs = " + str(listID[1]))
  9145. */
  9146. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
  9147. __Pyx_GOTREF(__pyx_t_2);
  9148. __pyx_t_3 = NULL;
  9149. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9150. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9151. if (likely(__pyx_t_3)) {
  9152. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9153. __Pyx_INCREF(__pyx_t_3);
  9154. __Pyx_INCREF(function);
  9155. __Pyx_DECREF_SET(__pyx_t_2, function);
  9156. }
  9157. }
  9158. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9159. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9160. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
  9161. __Pyx_GOTREF(__pyx_t_1);
  9162. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9163. __pyx_v_listID = __pyx_t_1;
  9164. __pyx_t_1 = 0;
  9165. /* "gedlibpy.pyx":962
  9166. * self.add_nx_graph(graph, classes)
  9167. * listID = self.graph_ids()
  9168. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  9169. * print("Number of graphs = " + str(listID[1]))
  9170. *
  9171. */
  9172. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error)
  9173. __Pyx_GOTREF(__pyx_t_1);
  9174. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9175. /* "gedlibpy.pyx":963
  9176. * listID = self.graph_ids()
  9177. * print("Graphs loaded ! ")
  9178. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  9179. *
  9180. * self.set_edit_cost(edit_cost)
  9181. */
  9182. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
  9183. __Pyx_GOTREF(__pyx_t_1);
  9184. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  9185. __Pyx_GOTREF(__pyx_t_2);
  9186. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9187. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
  9188. __Pyx_GOTREF(__pyx_t_1);
  9189. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9190. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  9191. __Pyx_GOTREF(__pyx_t_2);
  9192. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9193. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9194. /* "gedlibpy.pyx":965
  9195. * print("Number of graphs = " + str(listID[1]))
  9196. *
  9197. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  9198. * print("Initialization in progress...")
  9199. * self.init(init_option)
  9200. */
  9201. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 965, __pyx_L1_error)
  9202. __Pyx_GOTREF(__pyx_t_1);
  9203. __pyx_t_3 = NULL;
  9204. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9205. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9206. if (likely(__pyx_t_3)) {
  9207. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9208. __Pyx_INCREF(__pyx_t_3);
  9209. __Pyx_INCREF(function);
  9210. __Pyx_DECREF_SET(__pyx_t_1, function);
  9211. }
  9212. }
  9213. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_edit_cost);
  9214. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9215. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
  9216. __Pyx_GOTREF(__pyx_t_2);
  9217. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9218. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9219. /* "gedlibpy.pyx":966
  9220. *
  9221. * self.set_edit_cost(edit_cost)
  9222. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  9223. * self.init(init_option)
  9224. * print("Initialization terminated !")
  9225. */
  9226. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
  9227. __Pyx_GOTREF(__pyx_t_2);
  9228. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9229. /* "gedlibpy.pyx":967
  9230. * self.set_edit_cost(edit_cost)
  9231. * print("Initialization in progress...")
  9232. * self.init(init_option) # <<<<<<<<<<<<<<
  9233. * print("Initialization terminated !")
  9234. *
  9235. */
  9236. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
  9237. __Pyx_GOTREF(__pyx_t_1);
  9238. __pyx_t_3 = NULL;
  9239. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9240. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9241. if (likely(__pyx_t_3)) {
  9242. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9243. __Pyx_INCREF(__pyx_t_3);
  9244. __Pyx_INCREF(function);
  9245. __Pyx_DECREF_SET(__pyx_t_1, function);
  9246. }
  9247. }
  9248. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_3, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_init_option);
  9249. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9250. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error)
  9251. __Pyx_GOTREF(__pyx_t_2);
  9252. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9253. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9254. /* "gedlibpy.pyx":968
  9255. * print("Initialization in progress...")
  9256. * self.init(init_option)
  9257. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  9258. *
  9259. * self.set_method(method, options)
  9260. */
  9261. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
  9262. __Pyx_GOTREF(__pyx_t_2);
  9263. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9264. /* "gedlibpy.pyx":970
  9265. * print("Initialization terminated !")
  9266. *
  9267. * self.set_method(method, options) # <<<<<<<<<<<<<<
  9268. * self.init_method()
  9269. *
  9270. */
  9271. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
  9272. __Pyx_GOTREF(__pyx_t_1);
  9273. __pyx_t_3 = NULL;
  9274. __pyx_t_8 = 0;
  9275. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9276. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9277. if (likely(__pyx_t_3)) {
  9278. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9279. __Pyx_INCREF(__pyx_t_3);
  9280. __Pyx_INCREF(function);
  9281. __Pyx_DECREF_SET(__pyx_t_1, function);
  9282. __pyx_t_8 = 1;
  9283. }
  9284. }
  9285. #if CYTHON_FAST_PYCALL
  9286. if (PyFunction_Check(__pyx_t_1)) {
  9287. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9288. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
  9289. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9290. __Pyx_GOTREF(__pyx_t_2);
  9291. } else
  9292. #endif
  9293. #if CYTHON_FAST_PYCCALL
  9294. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  9295. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9296. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
  9297. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9298. __Pyx_GOTREF(__pyx_t_2);
  9299. } else
  9300. #endif
  9301. {
  9302. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 970, __pyx_L1_error)
  9303. __Pyx_GOTREF(__pyx_t_9);
  9304. if (__pyx_t_3) {
  9305. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9306. }
  9307. __Pyx_INCREF(__pyx_v_method);
  9308. __Pyx_GIVEREF(__pyx_v_method);
  9309. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_method);
  9310. __Pyx_INCREF(__pyx_v_options);
  9311. __Pyx_GIVEREF(__pyx_v_options);
  9312. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_options);
  9313. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
  9314. __Pyx_GOTREF(__pyx_t_2);
  9315. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9316. }
  9317. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9318. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9319. /* "gedlibpy.pyx":971
  9320. *
  9321. * self.set_method(method, options)
  9322. * self.init_method() # <<<<<<<<<<<<<<
  9323. *
  9324. * resDistance = [[]]
  9325. */
  9326. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 971, __pyx_L1_error)
  9327. __Pyx_GOTREF(__pyx_t_1);
  9328. __pyx_t_9 = NULL;
  9329. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9330. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
  9331. if (likely(__pyx_t_9)) {
  9332. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9333. __Pyx_INCREF(__pyx_t_9);
  9334. __Pyx_INCREF(function);
  9335. __Pyx_DECREF_SET(__pyx_t_1, function);
  9336. }
  9337. }
  9338. __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  9339. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  9340. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 971, __pyx_L1_error)
  9341. __Pyx_GOTREF(__pyx_t_2);
  9342. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9343. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9344. /* "gedlibpy.pyx":973
  9345. * self.init_method()
  9346. *
  9347. * resDistance = [[]] # <<<<<<<<<<<<<<
  9348. * resMapping = [[]]
  9349. * for g in range(listID[0], listID[1]) :
  9350. */
  9351. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
  9352. __Pyx_GOTREF(__pyx_t_2);
  9353. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
  9354. __Pyx_GOTREF(__pyx_t_1);
  9355. __Pyx_GIVEREF(__pyx_t_2);
  9356. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  9357. __pyx_t_2 = 0;
  9358. __pyx_v_resDistance = ((PyObject*)__pyx_t_1);
  9359. __pyx_t_1 = 0;
  9360. /* "gedlibpy.pyx":974
  9361. *
  9362. * resDistance = [[]]
  9363. * resMapping = [[]] # <<<<<<<<<<<<<<
  9364. * for g in range(listID[0], listID[1]) :
  9365. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9366. */
  9367. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  9368. __Pyx_GOTREF(__pyx_t_1);
  9369. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  9370. __Pyx_GOTREF(__pyx_t_2);
  9371. __Pyx_GIVEREF(__pyx_t_1);
  9372. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  9373. __pyx_t_1 = 0;
  9374. __pyx_v_resMapping = ((PyObject*)__pyx_t_2);
  9375. __pyx_t_2 = 0;
  9376. /* "gedlibpy.pyx":975
  9377. * resDistance = [[]]
  9378. * resMapping = [[]]
  9379. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9380. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9381. * for h in range(listID[0], listID[1]) :
  9382. */
  9383. __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error)
  9384. __Pyx_GOTREF(__pyx_t_2);
  9385. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9386. __Pyx_GOTREF(__pyx_t_1);
  9387. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error)
  9388. __Pyx_GOTREF(__pyx_t_9);
  9389. __Pyx_GIVEREF(__pyx_t_2);
  9390. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  9391. __Pyx_GIVEREF(__pyx_t_1);
  9392. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  9393. __pyx_t_2 = 0;
  9394. __pyx_t_1 = 0;
  9395. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9396. __Pyx_GOTREF(__pyx_t_1);
  9397. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9398. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9399. __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
  9400. __pyx_t_6 = NULL;
  9401. } else {
  9402. __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 975, __pyx_L1_error)
  9403. __Pyx_GOTREF(__pyx_t_9);
  9404. __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 975, __pyx_L1_error)
  9405. }
  9406. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9407. for (;;) {
  9408. if (likely(!__pyx_t_6)) {
  9409. if (likely(PyList_CheckExact(__pyx_t_9))) {
  9410. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
  9411. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9412. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
  9413. #else
  9414. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9415. __Pyx_GOTREF(__pyx_t_1);
  9416. #endif
  9417. } else {
  9418. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
  9419. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9420. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 975, __pyx_L1_error)
  9421. #else
  9422. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9423. __Pyx_GOTREF(__pyx_t_1);
  9424. #endif
  9425. }
  9426. } else {
  9427. __pyx_t_1 = __pyx_t_6(__pyx_t_9);
  9428. if (unlikely(!__pyx_t_1)) {
  9429. PyObject* exc_type = PyErr_Occurred();
  9430. if (exc_type) {
  9431. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9432. else __PYX_ERR(0, 975, __pyx_L1_error)
  9433. }
  9434. break;
  9435. }
  9436. __Pyx_GOTREF(__pyx_t_1);
  9437. }
  9438. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  9439. __pyx_t_1 = 0;
  9440. /* "gedlibpy.pyx":976
  9441. * resMapping = [[]]
  9442. * for g in range(listID[0], listID[1]) :
  9443. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  9444. * for h in range(listID[0], listID[1]) :
  9445. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9446. */
  9447. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
  9448. __Pyx_GOTREF(__pyx_t_1);
  9449. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
  9450. __Pyx_GOTREF(__pyx_t_2);
  9451. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9452. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
  9453. __Pyx_GOTREF(__pyx_t_1);
  9454. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9455. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
  9456. __Pyx_GOTREF(__pyx_t_2);
  9457. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9458. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9459. /* "gedlibpy.pyx":977
  9460. * for g in range(listID[0], listID[1]) :
  9461. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9462. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9463. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9464. * self.run_method(g, h)
  9465. */
  9466. __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 977, __pyx_L1_error)
  9467. __Pyx_GOTREF(__pyx_t_2);
  9468. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
  9469. __Pyx_GOTREF(__pyx_t_1);
  9470. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
  9471. __Pyx_GOTREF(__pyx_t_3);
  9472. __Pyx_GIVEREF(__pyx_t_2);
  9473. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9474. __Pyx_GIVEREF(__pyx_t_1);
  9475. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  9476. __pyx_t_2 = 0;
  9477. __pyx_t_1 = 0;
  9478. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
  9479. __Pyx_GOTREF(__pyx_t_1);
  9480. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9481. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9482. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
  9483. __pyx_t_11 = NULL;
  9484. } else {
  9485. __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 977, __pyx_L1_error)
  9486. __Pyx_GOTREF(__pyx_t_3);
  9487. __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 977, __pyx_L1_error)
  9488. }
  9489. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9490. for (;;) {
  9491. if (likely(!__pyx_t_11)) {
  9492. if (likely(PyList_CheckExact(__pyx_t_3))) {
  9493. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
  9494. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9495. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error)
  9496. #else
  9497. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
  9498. __Pyx_GOTREF(__pyx_t_1);
  9499. #endif
  9500. } else {
  9501. if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  9502. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9503. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_10); __Pyx_INCREF(__pyx_t_1); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 977, __pyx_L1_error)
  9504. #else
  9505. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
  9506. __Pyx_GOTREF(__pyx_t_1);
  9507. #endif
  9508. }
  9509. } else {
  9510. __pyx_t_1 = __pyx_t_11(__pyx_t_3);
  9511. if (unlikely(!__pyx_t_1)) {
  9512. PyObject* exc_type = PyErr_Occurred();
  9513. if (exc_type) {
  9514. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9515. else __PYX_ERR(0, 977, __pyx_L1_error)
  9516. }
  9517. break;
  9518. }
  9519. __Pyx_GOTREF(__pyx_t_1);
  9520. }
  9521. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  9522. __pyx_t_1 = 0;
  9523. /* "gedlibpy.pyx":979
  9524. * for h in range(listID[0], listID[1]) :
  9525. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9526. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9527. * resDistance[g][h] = self.get_upper_bound(g, h)
  9528. * resMapping[g][h] = self.get_node_map(g, h)
  9529. */
  9530. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
  9531. __Pyx_GOTREF(__pyx_t_2);
  9532. __pyx_t_7 = NULL;
  9533. __pyx_t_8 = 0;
  9534. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9535. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  9536. if (likely(__pyx_t_7)) {
  9537. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9538. __Pyx_INCREF(__pyx_t_7);
  9539. __Pyx_INCREF(function);
  9540. __Pyx_DECREF_SET(__pyx_t_2, function);
  9541. __pyx_t_8 = 1;
  9542. }
  9543. }
  9544. #if CYTHON_FAST_PYCALL
  9545. if (PyFunction_Check(__pyx_t_2)) {
  9546. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9547. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  9548. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9549. __Pyx_GOTREF(__pyx_t_1);
  9550. } else
  9551. #endif
  9552. #if CYTHON_FAST_PYCCALL
  9553. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9554. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9555. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  9556. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9557. __Pyx_GOTREF(__pyx_t_1);
  9558. } else
  9559. #endif
  9560. {
  9561. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 979, __pyx_L1_error)
  9562. __Pyx_GOTREF(__pyx_t_12);
  9563. if (__pyx_t_7) {
  9564. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9565. }
  9566. __Pyx_INCREF(__pyx_v_g);
  9567. __Pyx_GIVEREF(__pyx_v_g);
  9568. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  9569. __Pyx_INCREF(__pyx_v_h);
  9570. __Pyx_GIVEREF(__pyx_v_h);
  9571. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  9572. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 979, __pyx_L1_error)
  9573. __Pyx_GOTREF(__pyx_t_1);
  9574. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  9575. }
  9576. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9577. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9578. /* "gedlibpy.pyx":980
  9579. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9580. * self.run_method(g, h)
  9581. * resDistance[g][h] = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  9582. * resMapping[g][h] = self.get_node_map(g, h)
  9583. *
  9584. */
  9585. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error)
  9586. __Pyx_GOTREF(__pyx_t_2);
  9587. __pyx_t_12 = NULL;
  9588. __pyx_t_8 = 0;
  9589. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9590. __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
  9591. if (likely(__pyx_t_12)) {
  9592. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9593. __Pyx_INCREF(__pyx_t_12);
  9594. __Pyx_INCREF(function);
  9595. __Pyx_DECREF_SET(__pyx_t_2, function);
  9596. __pyx_t_8 = 1;
  9597. }
  9598. }
  9599. #if CYTHON_FAST_PYCALL
  9600. if (PyFunction_Check(__pyx_t_2)) {
  9601. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  9602. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  9603. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  9604. __Pyx_GOTREF(__pyx_t_1);
  9605. } else
  9606. #endif
  9607. #if CYTHON_FAST_PYCCALL
  9608. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9609. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  9610. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  9611. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  9612. __Pyx_GOTREF(__pyx_t_1);
  9613. } else
  9614. #endif
  9615. {
  9616. __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 980, __pyx_L1_error)
  9617. __Pyx_GOTREF(__pyx_t_7);
  9618. if (__pyx_t_12) {
  9619. __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
  9620. }
  9621. __Pyx_INCREF(__pyx_v_g);
  9622. __Pyx_GIVEREF(__pyx_v_g);
  9623. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_g);
  9624. __Pyx_INCREF(__pyx_v_h);
  9625. __Pyx_GIVEREF(__pyx_v_h);
  9626. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_h);
  9627. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  9628. __Pyx_GOTREF(__pyx_t_1);
  9629. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  9630. }
  9631. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9632. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error)
  9633. __Pyx_GOTREF(__pyx_t_2);
  9634. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 980, __pyx_L1_error)
  9635. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9636. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9637. /* "gedlibpy.pyx":981
  9638. * self.run_method(g, h)
  9639. * resDistance[g][h] = self.get_upper_bound(g, h)
  9640. * resMapping[g][h] = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  9641. *
  9642. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  9643. */
  9644. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  9645. __Pyx_GOTREF(__pyx_t_2);
  9646. __pyx_t_7 = NULL;
  9647. __pyx_t_8 = 0;
  9648. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9649. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  9650. if (likely(__pyx_t_7)) {
  9651. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9652. __Pyx_INCREF(__pyx_t_7);
  9653. __Pyx_INCREF(function);
  9654. __Pyx_DECREF_SET(__pyx_t_2, function);
  9655. __pyx_t_8 = 1;
  9656. }
  9657. }
  9658. #if CYTHON_FAST_PYCALL
  9659. if (PyFunction_Check(__pyx_t_2)) {
  9660. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9661. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  9662. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9663. __Pyx_GOTREF(__pyx_t_1);
  9664. } else
  9665. #endif
  9666. #if CYTHON_FAST_PYCCALL
  9667. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9668. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9669. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  9670. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9671. __Pyx_GOTREF(__pyx_t_1);
  9672. } else
  9673. #endif
  9674. {
  9675. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 981, __pyx_L1_error)
  9676. __Pyx_GOTREF(__pyx_t_12);
  9677. if (__pyx_t_7) {
  9678. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9679. }
  9680. __Pyx_INCREF(__pyx_v_g);
  9681. __Pyx_GIVEREF(__pyx_v_g);
  9682. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  9683. __Pyx_INCREF(__pyx_v_h);
  9684. __Pyx_GIVEREF(__pyx_v_h);
  9685. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  9686. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  9687. __Pyx_GOTREF(__pyx_t_1);
  9688. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  9689. }
  9690. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9691. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  9692. __Pyx_GOTREF(__pyx_t_2);
  9693. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
  9694. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9695. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9696. /* "gedlibpy.pyx":977
  9697. * for g in range(listID[0], listID[1]) :
  9698. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9699. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9700. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9701. * self.run_method(g, h)
  9702. */
  9703. }
  9704. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9705. /* "gedlibpy.pyx":975
  9706. * resDistance = [[]]
  9707. * resMapping = [[]]
  9708. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9709. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9710. * for h in range(listID[0], listID[1]) :
  9711. */
  9712. }
  9713. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9714. /* "gedlibpy.pyx":983
  9715. * resMapping[g][h] = self.get_node_map(g, h)
  9716. *
  9717. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  9718. * return resDistance, resMapping
  9719. *
  9720. */
  9721. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 983, __pyx_L1_error)
  9722. __Pyx_GOTREF(__pyx_t_9);
  9723. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9724. /* "gedlibpy.pyx":984
  9725. *
  9726. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  9727. * return resDistance, resMapping # <<<<<<<<<<<<<<
  9728. *
  9729. *
  9730. */
  9731. __Pyx_XDECREF(__pyx_r);
  9732. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 984, __pyx_L1_error)
  9733. __Pyx_GOTREF(__pyx_t_9);
  9734. __Pyx_INCREF(__pyx_v_resDistance);
  9735. __Pyx_GIVEREF(__pyx_v_resDistance);
  9736. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_resDistance);
  9737. __Pyx_INCREF(__pyx_v_resMapping);
  9738. __Pyx_GIVEREF(__pyx_v_resMapping);
  9739. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_resMapping);
  9740. __pyx_r = __pyx_t_9;
  9741. __pyx_t_9 = 0;
  9742. goto __pyx_L0;
  9743. /* "gedlibpy.pyx":931
  9744. *
  9745. *
  9746. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9747. * """
  9748. *
  9749. */
  9750. /* function exit code */
  9751. __pyx_L1_error:;
  9752. __Pyx_XDECREF(__pyx_t_1);
  9753. __Pyx_XDECREF(__pyx_t_2);
  9754. __Pyx_XDECREF(__pyx_t_3);
  9755. __Pyx_XDECREF(__pyx_t_7);
  9756. __Pyx_XDECREF(__pyx_t_9);
  9757. __Pyx_XDECREF(__pyx_t_12);
  9758. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9759. __pyx_r = NULL;
  9760. __pyx_L0:;
  9761. __Pyx_XDECREF(__pyx_v_graph);
  9762. __Pyx_XDECREF(__pyx_v_listID);
  9763. __Pyx_XDECREF(__pyx_v_resDistance);
  9764. __Pyx_XDECREF(__pyx_v_resMapping);
  9765. __Pyx_XDECREF(__pyx_v_g);
  9766. __Pyx_XDECREF(__pyx_v_h);
  9767. __Pyx_XGIVEREF(__pyx_r);
  9768. __Pyx_RefNannyFinishContext();
  9769. return __pyx_r;
  9770. }
  9771. /* "gedlibpy.pyx":987
  9772. *
  9773. *
  9774. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9775. * """
  9776. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  9777. */
  9778. /* Python wrapper */
  9779. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9780. static char __pyx_doc_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graphs[] = "\n\t\t\tComputes all the edit distance between each GXL graphs on the folder and the XMl file. \n\t\t\t\n\t\t\t:param path_folder: The folder's path which contains GXL graphs\n\t\t\t:param path_XML: The XML's path which indicates which graphes you want to load\n\t\t\t:param edit_cost: The name of the edit cost function\n\t\t\t:param method: The name of the computation method\n\t\t\t:param options: The options of the method (like bash options), an empty string by default\n\t\t\t:param init_option: The name of the init option, \"EAGER_WITHOUT_SHUFFLED_COPIES\" by default\n\t\t\t:type path_folder: string\n\t\t\t:type path_XML: string\n\t\t\t:type edit_cost: string\n\t\t\t:type method: string\n\t\t\t:type options: string\n\t\t\t:type init_option: string\n\t\t\t:return: The list of the first and last-1 ID of graphs\n\t\t\t:rtype: tuple(size_t, size_t)\n\t\n\t\t\t.. seealso:: list_of_edit_cost_options, list_of_method_options, list_of_init_options\n\t\t\t.. note:: Make sure each parameter exists with your architecture and these lists : list_of_edit_cost_options, list_of_method_options, list_of_init_options. \n\t\t\t\n\t\t";
  9781. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9782. PyObject *__pyx_v_path_folder = 0;
  9783. PyObject *__pyx_v_path_XML = 0;
  9784. PyObject *__pyx_v_edit_cost = 0;
  9785. PyObject *__pyx_v_method = 0;
  9786. PyObject *__pyx_v_options = 0;
  9787. PyObject *__pyx_v_init_option = 0;
  9788. PyObject *__pyx_r = 0;
  9789. __Pyx_RefNannyDeclarations
  9790. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs (wrapper)", 0);
  9791. {
  9792. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_path_folder,&__pyx_n_s_path_XML,&__pyx_n_s_edit_cost,&__pyx_n_s_method,&__pyx_n_s_options,&__pyx_n_s_init_option,0};
  9793. PyObject* values[6] = {0,0,0,0,0,0};
  9794. values[4] = ((PyObject *)__pyx_kp_u_);
  9795. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  9796. if (unlikely(__pyx_kwds)) {
  9797. Py_ssize_t kw_args;
  9798. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  9799. switch (pos_args) {
  9800. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9801. CYTHON_FALLTHROUGH;
  9802. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9803. CYTHON_FALLTHROUGH;
  9804. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9805. CYTHON_FALLTHROUGH;
  9806. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9807. CYTHON_FALLTHROUGH;
  9808. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9809. CYTHON_FALLTHROUGH;
  9810. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9811. CYTHON_FALLTHROUGH;
  9812. case 0: break;
  9813. default: goto __pyx_L5_argtuple_error;
  9814. }
  9815. kw_args = PyDict_Size(__pyx_kwds);
  9816. switch (pos_args) {
  9817. case 0:
  9818. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  9819. else goto __pyx_L5_argtuple_error;
  9820. CYTHON_FALLTHROUGH;
  9821. case 1:
  9822. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  9823. else {
  9824. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 987, __pyx_L3_error)
  9825. }
  9826. CYTHON_FALLTHROUGH;
  9827. case 2:
  9828. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  9829. else {
  9830. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 987, __pyx_L3_error)
  9831. }
  9832. CYTHON_FALLTHROUGH;
  9833. case 3:
  9834. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  9835. else {
  9836. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 987, __pyx_L3_error)
  9837. }
  9838. CYTHON_FALLTHROUGH;
  9839. case 4:
  9840. if (kw_args > 0) {
  9841. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  9842. if (value) { values[4] = value; kw_args--; }
  9843. }
  9844. CYTHON_FALLTHROUGH;
  9845. case 5:
  9846. if (kw_args > 0) {
  9847. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  9848. if (value) { values[5] = value; kw_args--; }
  9849. }
  9850. }
  9851. if (unlikely(kw_args > 0)) {
  9852. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_GXl_graphs") < 0)) __PYX_ERR(0, 987, __pyx_L3_error)
  9853. }
  9854. } else {
  9855. switch (PyTuple_GET_SIZE(__pyx_args)) {
  9856. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9857. CYTHON_FALLTHROUGH;
  9858. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9859. CYTHON_FALLTHROUGH;
  9860. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9861. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9862. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9863. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9864. break;
  9865. default: goto __pyx_L5_argtuple_error;
  9866. }
  9867. }
  9868. __pyx_v_path_folder = values[0];
  9869. __pyx_v_path_XML = values[1];
  9870. __pyx_v_edit_cost = values[2];
  9871. __pyx_v_method = values[3];
  9872. __pyx_v_options = values[4];
  9873. __pyx_v_init_option = values[5];
  9874. }
  9875. goto __pyx_L4_argument_unpacking_done;
  9876. __pyx_L5_argtuple_error:;
  9877. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 987, __pyx_L3_error)
  9878. __pyx_L3_error:;
  9879. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9880. __Pyx_RefNannyFinishContext();
  9881. return NULL;
  9882. __pyx_L4_argument_unpacking_done:;
  9883. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graphs(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_path_folder, __pyx_v_path_XML, __pyx_v_edit_cost, __pyx_v_method, __pyx_v_options, __pyx_v_init_option);
  9884. /* function exit code */
  9885. __Pyx_RefNannyFinishContext();
  9886. return __pyx_r;
  9887. }
  9888. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graphs(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_path_folder, PyObject *__pyx_v_path_XML, PyObject *__pyx_v_edit_cost, PyObject *__pyx_v_method, PyObject *__pyx_v_options, PyObject *__pyx_v_init_option) {
  9889. PyObject *__pyx_v_listID = NULL;
  9890. PyObject *__pyx_v_g = NULL;
  9891. PyObject *__pyx_v_h = NULL;
  9892. PyObject *__pyx_r = NULL;
  9893. __Pyx_RefNannyDeclarations
  9894. PyObject *__pyx_t_1 = NULL;
  9895. PyObject *__pyx_t_2 = NULL;
  9896. PyObject *__pyx_t_3 = NULL;
  9897. int __pyx_t_4;
  9898. int __pyx_t_5;
  9899. PyObject *__pyx_t_6 = NULL;
  9900. Py_ssize_t __pyx_t_7;
  9901. PyObject *(*__pyx_t_8)(PyObject *);
  9902. Py_ssize_t __pyx_t_9;
  9903. PyObject *(*__pyx_t_10)(PyObject *);
  9904. PyObject *__pyx_t_11 = NULL;
  9905. PyObject *__pyx_t_12 = NULL;
  9906. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs", 0);
  9907. /* "gedlibpy.pyx":1011
  9908. * """
  9909. *
  9910. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9911. * self.restart_env()
  9912. *
  9913. */
  9914. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1011, __pyx_L1_error)
  9915. __Pyx_GOTREF(__pyx_t_2);
  9916. __pyx_t_3 = NULL;
  9917. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9918. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9919. if (likely(__pyx_t_3)) {
  9920. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9921. __Pyx_INCREF(__pyx_t_3);
  9922. __Pyx_INCREF(function);
  9923. __Pyx_DECREF_SET(__pyx_t_2, function);
  9924. }
  9925. }
  9926. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9927. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9928. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1011, __pyx_L1_error)
  9929. __Pyx_GOTREF(__pyx_t_1);
  9930. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9931. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1011, __pyx_L1_error)
  9932. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9933. if (__pyx_t_4) {
  9934. /* "gedlibpy.pyx":1012
  9935. *
  9936. * if self.is_initialized() :
  9937. * self.restart_env() # <<<<<<<<<<<<<<
  9938. *
  9939. * print("Loading graphs in progress...")
  9940. */
  9941. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1012, __pyx_L1_error)
  9942. __Pyx_GOTREF(__pyx_t_2);
  9943. __pyx_t_3 = NULL;
  9944. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9945. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9946. if (likely(__pyx_t_3)) {
  9947. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9948. __Pyx_INCREF(__pyx_t_3);
  9949. __Pyx_INCREF(function);
  9950. __Pyx_DECREF_SET(__pyx_t_2, function);
  9951. }
  9952. }
  9953. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9954. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9955. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1012, __pyx_L1_error)
  9956. __Pyx_GOTREF(__pyx_t_1);
  9957. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9958. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9959. /* "gedlibpy.pyx":1011
  9960. * """
  9961. *
  9962. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9963. * self.restart_env()
  9964. *
  9965. */
  9966. }
  9967. /* "gedlibpy.pyx":1014
  9968. * self.restart_env()
  9969. *
  9970. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  9971. * self.load_GXL_graphs(path_folder, path_XML)
  9972. * listID = self.graph_ids()
  9973. */
  9974. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1014, __pyx_L1_error)
  9975. __Pyx_GOTREF(__pyx_t_1);
  9976. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9977. /* "gedlibpy.pyx":1015
  9978. *
  9979. * print("Loading graphs in progress...")
  9980. * self.load_GXL_graphs(path_folder, path_XML) # <<<<<<<<<<<<<<
  9981. * listID = self.graph_ids()
  9982. * print("Graphs loaded ! ")
  9983. */
  9984. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_GXL_graphs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1015, __pyx_L1_error)
  9985. __Pyx_GOTREF(__pyx_t_2);
  9986. __pyx_t_3 = NULL;
  9987. __pyx_t_5 = 0;
  9988. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9989. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9990. if (likely(__pyx_t_3)) {
  9991. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9992. __Pyx_INCREF(__pyx_t_3);
  9993. __Pyx_INCREF(function);
  9994. __Pyx_DECREF_SET(__pyx_t_2, function);
  9995. __pyx_t_5 = 1;
  9996. }
  9997. }
  9998. #if CYTHON_FAST_PYCALL
  9999. if (PyFunction_Check(__pyx_t_2)) {
  10000. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10001. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  10002. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10003. __Pyx_GOTREF(__pyx_t_1);
  10004. } else
  10005. #endif
  10006. #if CYTHON_FAST_PYCCALL
  10007. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10008. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10009. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  10010. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10011. __Pyx_GOTREF(__pyx_t_1);
  10012. } else
  10013. #endif
  10014. {
  10015. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1015, __pyx_L1_error)
  10016. __Pyx_GOTREF(__pyx_t_6);
  10017. if (__pyx_t_3) {
  10018. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  10019. }
  10020. __Pyx_INCREF(__pyx_v_path_folder);
  10021. __Pyx_GIVEREF(__pyx_v_path_folder);
  10022. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_path_folder);
  10023. __Pyx_INCREF(__pyx_v_path_XML);
  10024. __Pyx_GIVEREF(__pyx_v_path_XML);
  10025. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_path_XML);
  10026. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1015, __pyx_L1_error)
  10027. __Pyx_GOTREF(__pyx_t_1);
  10028. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10029. }
  10030. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10031. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10032. /* "gedlibpy.pyx":1016
  10033. * print("Loading graphs in progress...")
  10034. * self.load_GXL_graphs(path_folder, path_XML)
  10035. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  10036. * print("Graphs loaded ! ")
  10037. * print("Number of graphs = " + str(listID[1]))
  10038. */
  10039. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1016, __pyx_L1_error)
  10040. __Pyx_GOTREF(__pyx_t_2);
  10041. __pyx_t_6 = NULL;
  10042. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10043. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10044. if (likely(__pyx_t_6)) {
  10045. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10046. __Pyx_INCREF(__pyx_t_6);
  10047. __Pyx_INCREF(function);
  10048. __Pyx_DECREF_SET(__pyx_t_2, function);
  10049. }
  10050. }
  10051. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10052. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10053. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1016, __pyx_L1_error)
  10054. __Pyx_GOTREF(__pyx_t_1);
  10055. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10056. __pyx_v_listID = __pyx_t_1;
  10057. __pyx_t_1 = 0;
  10058. /* "gedlibpy.pyx":1017
  10059. * self.load_GXL_graphs(path_folder, path_XML)
  10060. * listID = self.graph_ids()
  10061. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  10062. * print("Number of graphs = " + str(listID[1]))
  10063. *
  10064. */
  10065. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1017, __pyx_L1_error)
  10066. __Pyx_GOTREF(__pyx_t_1);
  10067. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10068. /* "gedlibpy.pyx":1018
  10069. * listID = self.graph_ids()
  10070. * print("Graphs loaded ! ")
  10071. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  10072. *
  10073. * self.set_edit_cost(edit_cost)
  10074. */
  10075. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
  10076. __Pyx_GOTREF(__pyx_t_1);
  10077. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  10078. __Pyx_GOTREF(__pyx_t_2);
  10079. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10080. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1018, __pyx_L1_error)
  10081. __Pyx_GOTREF(__pyx_t_1);
  10082. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10083. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1018, __pyx_L1_error)
  10084. __Pyx_GOTREF(__pyx_t_2);
  10085. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10086. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10087. /* "gedlibpy.pyx":1020
  10088. * print("Number of graphs = " + str(listID[1]))
  10089. *
  10090. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  10091. * print("Initialization in progress...")
  10092. * self.init(init_option)
  10093. */
  10094. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1020, __pyx_L1_error)
  10095. __Pyx_GOTREF(__pyx_t_1);
  10096. __pyx_t_6 = NULL;
  10097. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10098. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10099. if (likely(__pyx_t_6)) {
  10100. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10101. __Pyx_INCREF(__pyx_t_6);
  10102. __Pyx_INCREF(function);
  10103. __Pyx_DECREF_SET(__pyx_t_1, function);
  10104. }
  10105. }
  10106. __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_edit_cost) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_edit_cost);
  10107. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10108. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1020, __pyx_L1_error)
  10109. __Pyx_GOTREF(__pyx_t_2);
  10110. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10111. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10112. /* "gedlibpy.pyx":1021
  10113. *
  10114. * self.set_edit_cost(edit_cost)
  10115. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  10116. * self.init(init_option)
  10117. * print("Initialization terminated !")
  10118. */
  10119. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1021, __pyx_L1_error)
  10120. __Pyx_GOTREF(__pyx_t_2);
  10121. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10122. /* "gedlibpy.pyx":1022
  10123. * self.set_edit_cost(edit_cost)
  10124. * print("Initialization in progress...")
  10125. * self.init(init_option) # <<<<<<<<<<<<<<
  10126. * print("Initialization terminated !")
  10127. *
  10128. */
  10129. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1022, __pyx_L1_error)
  10130. __Pyx_GOTREF(__pyx_t_1);
  10131. __pyx_t_6 = NULL;
  10132. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10133. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10134. if (likely(__pyx_t_6)) {
  10135. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10136. __Pyx_INCREF(__pyx_t_6);
  10137. __Pyx_INCREF(function);
  10138. __Pyx_DECREF_SET(__pyx_t_1, function);
  10139. }
  10140. }
  10141. __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_6, __pyx_v_init_option) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_init_option);
  10142. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10143. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1022, __pyx_L1_error)
  10144. __Pyx_GOTREF(__pyx_t_2);
  10145. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10146. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10147. /* "gedlibpy.pyx":1023
  10148. * print("Initialization in progress...")
  10149. * self.init(init_option)
  10150. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  10151. *
  10152. * self.set_method(method, options)
  10153. */
  10154. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1023, __pyx_L1_error)
  10155. __Pyx_GOTREF(__pyx_t_2);
  10156. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10157. /* "gedlibpy.pyx":1025
  10158. * print("Initialization terminated !")
  10159. *
  10160. * self.set_method(method, options) # <<<<<<<<<<<<<<
  10161. * self.init_method()
  10162. *
  10163. */
  10164. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
  10165. __Pyx_GOTREF(__pyx_t_1);
  10166. __pyx_t_6 = NULL;
  10167. __pyx_t_5 = 0;
  10168. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10169. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10170. if (likely(__pyx_t_6)) {
  10171. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10172. __Pyx_INCREF(__pyx_t_6);
  10173. __Pyx_INCREF(function);
  10174. __Pyx_DECREF_SET(__pyx_t_1, function);
  10175. __pyx_t_5 = 1;
  10176. }
  10177. }
  10178. #if CYTHON_FAST_PYCALL
  10179. if (PyFunction_Check(__pyx_t_1)) {
  10180. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10181. __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  10182. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10183. __Pyx_GOTREF(__pyx_t_2);
  10184. } else
  10185. #endif
  10186. #if CYTHON_FAST_PYCCALL
  10187. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  10188. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10189. __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  10190. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10191. __Pyx_GOTREF(__pyx_t_2);
  10192. } else
  10193. #endif
  10194. {
  10195. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1025, __pyx_L1_error)
  10196. __Pyx_GOTREF(__pyx_t_3);
  10197. if (__pyx_t_6) {
  10198. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  10199. }
  10200. __Pyx_INCREF(__pyx_v_method);
  10201. __Pyx_GIVEREF(__pyx_v_method);
  10202. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_method);
  10203. __Pyx_INCREF(__pyx_v_options);
  10204. __Pyx_GIVEREF(__pyx_v_options);
  10205. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_options);
  10206. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  10207. __Pyx_GOTREF(__pyx_t_2);
  10208. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10209. }
  10210. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10211. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10212. /* "gedlibpy.pyx":1026
  10213. *
  10214. * self.set_method(method, options)
  10215. * self.init_method() # <<<<<<<<<<<<<<
  10216. *
  10217. * #res = []
  10218. */
  10219. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1026, __pyx_L1_error)
  10220. __Pyx_GOTREF(__pyx_t_1);
  10221. __pyx_t_3 = NULL;
  10222. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10223. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  10224. if (likely(__pyx_t_3)) {
  10225. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10226. __Pyx_INCREF(__pyx_t_3);
  10227. __Pyx_INCREF(function);
  10228. __Pyx_DECREF_SET(__pyx_t_1, function);
  10229. }
  10230. }
  10231. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  10232. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10233. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1026, __pyx_L1_error)
  10234. __Pyx_GOTREF(__pyx_t_2);
  10235. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10236. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10237. /* "gedlibpy.pyx":1029
  10238. *
  10239. * #res = []
  10240. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10241. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10242. * for h in range(listID[0], listID[1]) :
  10243. */
  10244. __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10245. __Pyx_GOTREF(__pyx_t_2);
  10246. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10247. __Pyx_GOTREF(__pyx_t_1);
  10248. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10249. __Pyx_GOTREF(__pyx_t_3);
  10250. __Pyx_GIVEREF(__pyx_t_2);
  10251. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10252. __Pyx_GIVEREF(__pyx_t_1);
  10253. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  10254. __pyx_t_2 = 0;
  10255. __pyx_t_1 = 0;
  10256. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10257. __Pyx_GOTREF(__pyx_t_1);
  10258. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10259. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10260. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
  10261. __pyx_t_8 = NULL;
  10262. } else {
  10263. __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10264. __Pyx_GOTREF(__pyx_t_3);
  10265. __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10266. }
  10267. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10268. for (;;) {
  10269. if (likely(!__pyx_t_8)) {
  10270. if (likely(PyList_CheckExact(__pyx_t_3))) {
  10271. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10272. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10273. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10274. #else
  10275. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10276. __Pyx_GOTREF(__pyx_t_1);
  10277. #endif
  10278. } else {
  10279. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  10280. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10281. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_1); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10282. #else
  10283. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1029, __pyx_L1_error)
  10284. __Pyx_GOTREF(__pyx_t_1);
  10285. #endif
  10286. }
  10287. } else {
  10288. __pyx_t_1 = __pyx_t_8(__pyx_t_3);
  10289. if (unlikely(!__pyx_t_1)) {
  10290. PyObject* exc_type = PyErr_Occurred();
  10291. if (exc_type) {
  10292. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10293. else __PYX_ERR(0, 1029, __pyx_L1_error)
  10294. }
  10295. break;
  10296. }
  10297. __Pyx_GOTREF(__pyx_t_1);
  10298. }
  10299. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  10300. __pyx_t_1 = 0;
  10301. /* "gedlibpy.pyx":1030
  10302. * #res = []
  10303. * for g in range(listID[0], listID[1]) :
  10304. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  10305. * for h in range(listID[0], listID[1]) :
  10306. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10307. */
  10308. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10309. __Pyx_GOTREF(__pyx_t_1);
  10310. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10311. __Pyx_GOTREF(__pyx_t_2);
  10312. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10313. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_t_2, __pyx_kp_u_with_all_the_others_including_h); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10314. __Pyx_GOTREF(__pyx_t_1);
  10315. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10316. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10317. __Pyx_GOTREF(__pyx_t_2);
  10318. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10319. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10320. /* "gedlibpy.pyx":1031
  10321. * for g in range(listID[0], listID[1]) :
  10322. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10323. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10324. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10325. * self.run_method(g,h)
  10326. */
  10327. __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_listID, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10328. __Pyx_GOTREF(__pyx_t_2);
  10329. __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_listID, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10330. __Pyx_GOTREF(__pyx_t_1);
  10331. __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10332. __Pyx_GOTREF(__pyx_t_6);
  10333. __Pyx_GIVEREF(__pyx_t_2);
  10334. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  10335. __Pyx_GIVEREF(__pyx_t_1);
  10336. PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  10337. __pyx_t_2 = 0;
  10338. __pyx_t_1 = 0;
  10339. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10340. __Pyx_GOTREF(__pyx_t_1);
  10341. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10342. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10343. __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
  10344. __pyx_t_10 = NULL;
  10345. } else {
  10346. __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10347. __Pyx_GOTREF(__pyx_t_6);
  10348. __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10349. }
  10350. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10351. for (;;) {
  10352. if (likely(!__pyx_t_10)) {
  10353. if (likely(PyList_CheckExact(__pyx_t_6))) {
  10354. if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
  10355. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10356. __pyx_t_1 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10357. #else
  10358. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10359. __Pyx_GOTREF(__pyx_t_1);
  10360. #endif
  10361. } else {
  10362. if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
  10363. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10364. __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_9); __Pyx_INCREF(__pyx_t_1); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10365. #else
  10366. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10367. __Pyx_GOTREF(__pyx_t_1);
  10368. #endif
  10369. }
  10370. } else {
  10371. __pyx_t_1 = __pyx_t_10(__pyx_t_6);
  10372. if (unlikely(!__pyx_t_1)) {
  10373. PyObject* exc_type = PyErr_Occurred();
  10374. if (exc_type) {
  10375. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10376. else __PYX_ERR(0, 1031, __pyx_L1_error)
  10377. }
  10378. break;
  10379. }
  10380. __Pyx_GOTREF(__pyx_t_1);
  10381. }
  10382. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  10383. __pyx_t_1 = 0;
  10384. /* "gedlibpy.pyx":1033
  10385. * for h in range(listID[0], listID[1]) :
  10386. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10387. * self.run_method(g,h) # <<<<<<<<<<<<<<
  10388. * #res.append((get_upper_bound(g,h), get_node_map(g,h), get_runtime(g,h)))
  10389. *
  10390. */
  10391. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10392. __Pyx_GOTREF(__pyx_t_2);
  10393. __pyx_t_11 = NULL;
  10394. __pyx_t_5 = 0;
  10395. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10396. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
  10397. if (likely(__pyx_t_11)) {
  10398. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10399. __Pyx_INCREF(__pyx_t_11);
  10400. __Pyx_INCREF(function);
  10401. __Pyx_DECREF_SET(__pyx_t_2, function);
  10402. __pyx_t_5 = 1;
  10403. }
  10404. }
  10405. #if CYTHON_FAST_PYCALL
  10406. if (PyFunction_Check(__pyx_t_2)) {
  10407. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10408. __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10409. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10410. __Pyx_GOTREF(__pyx_t_1);
  10411. } else
  10412. #endif
  10413. #if CYTHON_FAST_PYCCALL
  10414. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10415. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10416. __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10417. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10418. __Pyx_GOTREF(__pyx_t_1);
  10419. } else
  10420. #endif
  10421. {
  10422. __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10423. __Pyx_GOTREF(__pyx_t_12);
  10424. if (__pyx_t_11) {
  10425. __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
  10426. }
  10427. __Pyx_INCREF(__pyx_v_g);
  10428. __Pyx_GIVEREF(__pyx_v_g);
  10429. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_g);
  10430. __Pyx_INCREF(__pyx_v_h);
  10431. __Pyx_GIVEREF(__pyx_v_h);
  10432. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_h);
  10433. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10434. __Pyx_GOTREF(__pyx_t_1);
  10435. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10436. }
  10437. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10438. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10439. /* "gedlibpy.pyx":1031
  10440. * for g in range(listID[0], listID[1]) :
  10441. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10442. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10443. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10444. * self.run_method(g,h)
  10445. */
  10446. }
  10447. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10448. /* "gedlibpy.pyx":1029
  10449. *
  10450. * #res = []
  10451. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10452. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10453. * for h in range(listID[0], listID[1]) :
  10454. */
  10455. }
  10456. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10457. /* "gedlibpy.pyx":1038
  10458. * #return res
  10459. *
  10460. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  10461. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10462. * return listID
  10463. */
  10464. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1038, __pyx_L1_error)
  10465. __Pyx_GOTREF(__pyx_t_3);
  10466. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10467. /* "gedlibpy.pyx":1039
  10468. *
  10469. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10470. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  10471. * return listID
  10472. *
  10473. */
  10474. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10475. __Pyx_GOTREF(__pyx_t_3);
  10476. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10477. /* "gedlibpy.pyx":1040
  10478. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10479. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10480. * return listID # <<<<<<<<<<<<<<
  10481. *
  10482. *
  10483. */
  10484. __Pyx_XDECREF(__pyx_r);
  10485. __Pyx_INCREF(__pyx_v_listID);
  10486. __pyx_r = __pyx_v_listID;
  10487. goto __pyx_L0;
  10488. /* "gedlibpy.pyx":987
  10489. *
  10490. *
  10491. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10492. * """
  10493. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10494. */
  10495. /* function exit code */
  10496. __pyx_L1_error:;
  10497. __Pyx_XDECREF(__pyx_t_1);
  10498. __Pyx_XDECREF(__pyx_t_2);
  10499. __Pyx_XDECREF(__pyx_t_3);
  10500. __Pyx_XDECREF(__pyx_t_6);
  10501. __Pyx_XDECREF(__pyx_t_11);
  10502. __Pyx_XDECREF(__pyx_t_12);
  10503. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10504. __pyx_r = NULL;
  10505. __pyx_L0:;
  10506. __Pyx_XDECREF(__pyx_v_listID);
  10507. __Pyx_XDECREF(__pyx_v_g);
  10508. __Pyx_XDECREF(__pyx_v_h);
  10509. __Pyx_XGIVEREF(__pyx_r);
  10510. __Pyx_RefNannyFinishContext();
  10511. return __pyx_r;
  10512. }
  10513. /* "gedlibpy.pyx":1043
  10514. *
  10515. *
  10516. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10517. * """
  10518. * Returns the number of node labels.
  10519. */
  10520. /* Python wrapper */
  10521. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10522. static char __pyx_doc_8gedlibpy_6GEDEnv_94get_num_node_labels[] = "\n\t\t\tReturns the number of node labels.\n\t\t\t\n\t\t\t:return: Number of pairwise different node labels contained in the environment.\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. note:: If 1 is returned, the nodes are unlabeled.\n\t\t";
  10523. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10524. PyObject *__pyx_r = 0;
  10525. __Pyx_RefNannyDeclarations
  10526. __Pyx_RefNannySetupContext("get_num_node_labels (wrapper)", 0);
  10527. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10528. /* function exit code */
  10529. __Pyx_RefNannyFinishContext();
  10530. return __pyx_r;
  10531. }
  10532. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10533. PyObject *__pyx_r = NULL;
  10534. __Pyx_RefNannyDeclarations
  10535. size_t __pyx_t_1;
  10536. PyObject *__pyx_t_2 = NULL;
  10537. __Pyx_RefNannySetupContext("get_num_node_labels", 0);
  10538. /* "gedlibpy.pyx":1052
  10539. * .. note:: If 1 is returned, the nodes are unlabeled.
  10540. * """
  10541. * return self.c_env.getNumNodeLabels() # <<<<<<<<<<<<<<
  10542. *
  10543. *
  10544. */
  10545. __Pyx_XDECREF(__pyx_r);
  10546. try {
  10547. __pyx_t_1 = __pyx_v_self->c_env->getNumNodeLabels();
  10548. } catch(...) {
  10549. __Pyx_CppExn2PyErr();
  10550. __PYX_ERR(0, 1052, __pyx_L1_error)
  10551. }
  10552. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10553. __Pyx_GOTREF(__pyx_t_2);
  10554. __pyx_r = __pyx_t_2;
  10555. __pyx_t_2 = 0;
  10556. goto __pyx_L0;
  10557. /* "gedlibpy.pyx":1043
  10558. *
  10559. *
  10560. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10561. * """
  10562. * Returns the number of node labels.
  10563. */
  10564. /* function exit code */
  10565. __pyx_L1_error:;
  10566. __Pyx_XDECREF(__pyx_t_2);
  10567. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10568. __pyx_r = NULL;
  10569. __pyx_L0:;
  10570. __Pyx_XGIVEREF(__pyx_r);
  10571. __Pyx_RefNannyFinishContext();
  10572. return __pyx_r;
  10573. }
  10574. /* "gedlibpy.pyx":1055
  10575. *
  10576. *
  10577. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  10578. * """
  10579. * Returns node label.
  10580. */
  10581. /* Python wrapper */
  10582. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  10583. static char __pyx_doc_8gedlibpy_6GEDEnv_96get_node_label[] = "\n\t\t\tReturns node label.\n\t\t\t\n\t\t\t:param label_id: ID of node label that should be returned. Must be between 1 and get_num_node_labels().\n\t\t\t:type label_id: size_t\n\t\t\t:return: Node label for selected label ID.\n\t\t\t:rtype: dict{string : string}\n\t \t";
  10584. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  10585. PyObject *__pyx_r = 0;
  10586. __Pyx_RefNannyDeclarations
  10587. __Pyx_RefNannySetupContext("get_node_label (wrapper)", 0);
  10588. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  10589. /* function exit code */
  10590. __Pyx_RefNannyFinishContext();
  10591. return __pyx_r;
  10592. }
  10593. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  10594. PyObject *__pyx_r = NULL;
  10595. __Pyx_RefNannyDeclarations
  10596. PyObject *__pyx_t_1 = NULL;
  10597. PyObject *__pyx_t_2 = NULL;
  10598. size_t __pyx_t_3;
  10599. std::map<std::string,std::string> __pyx_t_4;
  10600. PyObject *__pyx_t_5 = NULL;
  10601. PyObject *__pyx_t_6 = NULL;
  10602. __Pyx_RefNannySetupContext("get_node_label", 0);
  10603. /* "gedlibpy.pyx":1064
  10604. * :rtype: dict{string : string}
  10605. * """
  10606. * return decode_your_map(self.c_env.getNodeLabel(label_id)) # <<<<<<<<<<<<<<
  10607. *
  10608. *
  10609. */
  10610. __Pyx_XDECREF(__pyx_r);
  10611. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
  10612. __Pyx_GOTREF(__pyx_t_2);
  10613. __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1064, __pyx_L1_error)
  10614. try {
  10615. __pyx_t_4 = __pyx_v_self->c_env->getNodeLabel(__pyx_t_3);
  10616. } catch(...) {
  10617. __Pyx_CppExn2PyErr();
  10618. __PYX_ERR(0, 1064, __pyx_L1_error)
  10619. }
  10620. __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1064, __pyx_L1_error)
  10621. __Pyx_GOTREF(__pyx_t_5);
  10622. __pyx_t_6 = NULL;
  10623. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  10624. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10625. if (likely(__pyx_t_6)) {
  10626. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10627. __Pyx_INCREF(__pyx_t_6);
  10628. __Pyx_INCREF(function);
  10629. __Pyx_DECREF_SET(__pyx_t_2, function);
  10630. }
  10631. }
  10632. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  10633. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10634. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  10635. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1064, __pyx_L1_error)
  10636. __Pyx_GOTREF(__pyx_t_1);
  10637. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10638. __pyx_r = __pyx_t_1;
  10639. __pyx_t_1 = 0;
  10640. goto __pyx_L0;
  10641. /* "gedlibpy.pyx":1055
  10642. *
  10643. *
  10644. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  10645. * """
  10646. * Returns node label.
  10647. */
  10648. /* function exit code */
  10649. __pyx_L1_error:;
  10650. __Pyx_XDECREF(__pyx_t_1);
  10651. __Pyx_XDECREF(__pyx_t_2);
  10652. __Pyx_XDECREF(__pyx_t_5);
  10653. __Pyx_XDECREF(__pyx_t_6);
  10654. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10655. __pyx_r = NULL;
  10656. __pyx_L0:;
  10657. __Pyx_XGIVEREF(__pyx_r);
  10658. __Pyx_RefNannyFinishContext();
  10659. return __pyx_r;
  10660. }
  10661. /* "gedlibpy.pyx":1067
  10662. *
  10663. *
  10664. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  10665. * """
  10666. * Returns the number of edge labels.
  10667. */
  10668. /* Python wrapper */
  10669. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10670. static char __pyx_doc_8gedlibpy_6GEDEnv_98get_num_edge_labels[] = "\n\t\t\tReturns the number of edge labels.\n\t\t\t\n\t\t\t:return: Number of pairwise different edge labels contained in the environment.\n\t\t\t:rtype: size_t\n\t\t\t\n\t\t\t.. note:: If 1 is returned, the edges are unlabeled.\n\t \t";
  10671. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10672. PyObject *__pyx_r = 0;
  10673. __Pyx_RefNannyDeclarations
  10674. __Pyx_RefNannySetupContext("get_num_edge_labels (wrapper)", 0);
  10675. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10676. /* function exit code */
  10677. __Pyx_RefNannyFinishContext();
  10678. return __pyx_r;
  10679. }
  10680. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10681. PyObject *__pyx_r = NULL;
  10682. __Pyx_RefNannyDeclarations
  10683. size_t __pyx_t_1;
  10684. PyObject *__pyx_t_2 = NULL;
  10685. __Pyx_RefNannySetupContext("get_num_edge_labels", 0);
  10686. /* "gedlibpy.pyx":1076
  10687. * .. note:: If 1 is returned, the edges are unlabeled.
  10688. * """
  10689. * return self.c_env.getNumEdgeLabels() # <<<<<<<<<<<<<<
  10690. *
  10691. *
  10692. */
  10693. __Pyx_XDECREF(__pyx_r);
  10694. try {
  10695. __pyx_t_1 = __pyx_v_self->c_env->getNumEdgeLabels();
  10696. } catch(...) {
  10697. __Pyx_CppExn2PyErr();
  10698. __PYX_ERR(0, 1076, __pyx_L1_error)
  10699. }
  10700. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
  10701. __Pyx_GOTREF(__pyx_t_2);
  10702. __pyx_r = __pyx_t_2;
  10703. __pyx_t_2 = 0;
  10704. goto __pyx_L0;
  10705. /* "gedlibpy.pyx":1067
  10706. *
  10707. *
  10708. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  10709. * """
  10710. * Returns the number of edge labels.
  10711. */
  10712. /* function exit code */
  10713. __pyx_L1_error:;
  10714. __Pyx_XDECREF(__pyx_t_2);
  10715. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_edge_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10716. __pyx_r = NULL;
  10717. __pyx_L0:;
  10718. __Pyx_XGIVEREF(__pyx_r);
  10719. __Pyx_RefNannyFinishContext();
  10720. return __pyx_r;
  10721. }
  10722. /* "gedlibpy.pyx":1079
  10723. *
  10724. *
  10725. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  10726. * """
  10727. * Returns edge label.
  10728. */
  10729. /* Python wrapper */
  10730. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  10731. static char __pyx_doc_8gedlibpy_6GEDEnv_100get_edge_label[] = "\n\t\t\tReturns edge label.\n\t\t\t\n\t\t\t:param label_id: ID of edge label that should be returned. Must be between 1 and get_num_edge_labels().\n\t\t\t:type label_id: size_t\n\t\t\t:return: Edge label for selected label ID.\n\t\t\t:rtype: dict{string : string}\n\t \t";
  10732. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  10733. PyObject *__pyx_r = 0;
  10734. __Pyx_RefNannyDeclarations
  10735. __Pyx_RefNannySetupContext("get_edge_label (wrapper)", 0);
  10736. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  10737. /* function exit code */
  10738. __Pyx_RefNannyFinishContext();
  10739. return __pyx_r;
  10740. }
  10741. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  10742. PyObject *__pyx_r = NULL;
  10743. __Pyx_RefNannyDeclarations
  10744. PyObject *__pyx_t_1 = NULL;
  10745. PyObject *__pyx_t_2 = NULL;
  10746. size_t __pyx_t_3;
  10747. std::map<std::string,std::string> __pyx_t_4;
  10748. PyObject *__pyx_t_5 = NULL;
  10749. PyObject *__pyx_t_6 = NULL;
  10750. __Pyx_RefNannySetupContext("get_edge_label", 0);
  10751. /* "gedlibpy.pyx":1088
  10752. * :rtype: dict{string : string}
  10753. * """
  10754. * return decode_your_map(self.c_env.getEdgeLabel(label_id)) # <<<<<<<<<<<<<<
  10755. *
  10756. *
  10757. */
  10758. __Pyx_XDECREF(__pyx_r);
  10759. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1088, __pyx_L1_error)
  10760. __Pyx_GOTREF(__pyx_t_2);
  10761. __pyx_t_3 = __Pyx_PyInt_As_size_t(__pyx_v_label_id); if (unlikely((__pyx_t_3 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
  10762. try {
  10763. __pyx_t_4 = __pyx_v_self->c_env->getEdgeLabel(__pyx_t_3);
  10764. } catch(...) {
  10765. __Pyx_CppExn2PyErr();
  10766. __PYX_ERR(0, 1088, __pyx_L1_error)
  10767. }
  10768. __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1088, __pyx_L1_error)
  10769. __Pyx_GOTREF(__pyx_t_5);
  10770. __pyx_t_6 = NULL;
  10771. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  10772. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10773. if (likely(__pyx_t_6)) {
  10774. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10775. __Pyx_INCREF(__pyx_t_6);
  10776. __Pyx_INCREF(function);
  10777. __Pyx_DECREF_SET(__pyx_t_2, function);
  10778. }
  10779. }
  10780. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  10781. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10782. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  10783. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error)
  10784. __Pyx_GOTREF(__pyx_t_1);
  10785. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10786. __pyx_r = __pyx_t_1;
  10787. __pyx_t_1 = 0;
  10788. goto __pyx_L0;
  10789. /* "gedlibpy.pyx":1079
  10790. *
  10791. *
  10792. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  10793. * """
  10794. * Returns edge label.
  10795. */
  10796. /* function exit code */
  10797. __pyx_L1_error:;
  10798. __Pyx_XDECREF(__pyx_t_1);
  10799. __Pyx_XDECREF(__pyx_t_2);
  10800. __Pyx_XDECREF(__pyx_t_5);
  10801. __Pyx_XDECREF(__pyx_t_6);
  10802. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10803. __pyx_r = NULL;
  10804. __pyx_L0:;
  10805. __Pyx_XGIVEREF(__pyx_r);
  10806. __Pyx_RefNannyFinishContext();
  10807. return __pyx_r;
  10808. }
  10809. /* "gedlibpy.pyx":1102
  10810. * # return self.c_env.getNumNodes(graph_id)
  10811. *
  10812. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  10813. * """
  10814. * Returns average number of nodes.
  10815. */
  10816. /* Python wrapper */
  10817. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10818. static char __pyx_doc_8gedlibpy_6GEDEnv_102get_avg_num_nodes[] = "\n\t\t\tReturns average number of nodes.\n\t\t\t \n\t\t\t:return: Average number of nodes of the graphs contained in the environment.\n\t\t\t:rtype: double\n\t\t";
  10819. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10820. PyObject *__pyx_r = 0;
  10821. __Pyx_RefNannyDeclarations
  10822. __Pyx_RefNannySetupContext("get_avg_num_nodes (wrapper)", 0);
  10823. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10824. /* function exit code */
  10825. __Pyx_RefNannyFinishContext();
  10826. return __pyx_r;
  10827. }
  10828. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10829. PyObject *__pyx_r = NULL;
  10830. __Pyx_RefNannyDeclarations
  10831. double __pyx_t_1;
  10832. PyObject *__pyx_t_2 = NULL;
  10833. __Pyx_RefNannySetupContext("get_avg_num_nodes", 0);
  10834. /* "gedlibpy.pyx":1109
  10835. * :rtype: double
  10836. * """
  10837. * return self.c_env.getAvgNumNodes() # <<<<<<<<<<<<<<
  10838. *
  10839. * def get_node_rel_cost(self, node_label_1, node_label_2):
  10840. */
  10841. __Pyx_XDECREF(__pyx_r);
  10842. try {
  10843. __pyx_t_1 = __pyx_v_self->c_env->getAvgNumNodes();
  10844. } catch(...) {
  10845. __Pyx_CppExn2PyErr();
  10846. __PYX_ERR(0, 1109, __pyx_L1_error)
  10847. }
  10848. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
  10849. __Pyx_GOTREF(__pyx_t_2);
  10850. __pyx_r = __pyx_t_2;
  10851. __pyx_t_2 = 0;
  10852. goto __pyx_L0;
  10853. /* "gedlibpy.pyx":1102
  10854. * # return self.c_env.getNumNodes(graph_id)
  10855. *
  10856. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  10857. * """
  10858. * Returns average number of nodes.
  10859. */
  10860. /* function exit code */
  10861. __pyx_L1_error:;
  10862. __Pyx_XDECREF(__pyx_t_2);
  10863. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_avg_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10864. __pyx_r = NULL;
  10865. __pyx_L0:;
  10866. __Pyx_XGIVEREF(__pyx_r);
  10867. __Pyx_RefNannyFinishContext();
  10868. return __pyx_r;
  10869. }
  10870. /* "gedlibpy.pyx":1111
  10871. * return self.c_env.getAvgNumNodes()
  10872. *
  10873. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  10874. * """
  10875. * Returns node relabeling cost.
  10876. */
  10877. /* Python wrapper */
  10878. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10879. static char __pyx_doc_8gedlibpy_6GEDEnv_104get_node_rel_cost[] = "\n\t\t\tReturns node relabeling cost.\n\t\t\t\n\t\t\t:param node_label_1: First node label.\n\t\t\t:param node_label_2: Second node label.\n\t\t\t:type node_label_1: dict{string : string}\n\t\t\t:type node_label_2: dict{string : string}\n\t\t\t:return: Node relabeling cost for the given node labels.\n\t\t\t:rtype: double\n\t \t";
  10880. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10881. PyObject *__pyx_v_node_label_1 = 0;
  10882. PyObject *__pyx_v_node_label_2 = 0;
  10883. PyObject *__pyx_r = 0;
  10884. __Pyx_RefNannyDeclarations
  10885. __Pyx_RefNannySetupContext("get_node_rel_cost (wrapper)", 0);
  10886. {
  10887. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_label_1,&__pyx_n_s_node_label_2,0};
  10888. PyObject* values[2] = {0,0};
  10889. if (unlikely(__pyx_kwds)) {
  10890. Py_ssize_t kw_args;
  10891. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  10892. switch (pos_args) {
  10893. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10894. CYTHON_FALLTHROUGH;
  10895. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10896. CYTHON_FALLTHROUGH;
  10897. case 0: break;
  10898. default: goto __pyx_L5_argtuple_error;
  10899. }
  10900. kw_args = PyDict_Size(__pyx_kwds);
  10901. switch (pos_args) {
  10902. case 0:
  10903. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_1)) != 0)) kw_args--;
  10904. else goto __pyx_L5_argtuple_error;
  10905. CYTHON_FALLTHROUGH;
  10906. case 1:
  10907. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_2)) != 0)) kw_args--;
  10908. else {
  10909. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1111, __pyx_L3_error)
  10910. }
  10911. }
  10912. if (unlikely(kw_args > 0)) {
  10913. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1111, __pyx_L3_error)
  10914. }
  10915. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  10916. goto __pyx_L5_argtuple_error;
  10917. } else {
  10918. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10919. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10920. }
  10921. __pyx_v_node_label_1 = values[0];
  10922. __pyx_v_node_label_2 = values[1];
  10923. }
  10924. goto __pyx_L4_argument_unpacking_done;
  10925. __pyx_L5_argtuple_error:;
  10926. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1111, __pyx_L3_error)
  10927. __pyx_L3_error:;
  10928. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10929. __Pyx_RefNannyFinishContext();
  10930. return NULL;
  10931. __pyx_L4_argument_unpacking_done:;
  10932. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_node_label_1, __pyx_v_node_label_2);
  10933. /* function exit code */
  10934. __Pyx_RefNannyFinishContext();
  10935. return __pyx_r;
  10936. }
  10937. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_104get_node_rel_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label_1, PyObject *__pyx_v_node_label_2) {
  10938. PyObject *__pyx_r = NULL;
  10939. __Pyx_RefNannyDeclarations
  10940. PyObject *__pyx_t_1 = NULL;
  10941. PyObject *__pyx_t_2 = NULL;
  10942. PyObject *__pyx_t_3 = NULL;
  10943. std::map<std::string,std::string> __pyx_t_4;
  10944. std::map<std::string,std::string> __pyx_t_5;
  10945. double __pyx_t_6;
  10946. __Pyx_RefNannySetupContext("get_node_rel_cost", 0);
  10947. /* "gedlibpy.pyx":1122
  10948. * :rtype: double
  10949. * """
  10950. * return self.c_env.getNodeRelCost(encode_your_map(node_label_1), encode_your_map(node_label_2)) # <<<<<<<<<<<<<<
  10951. *
  10952. *
  10953. */
  10954. __Pyx_XDECREF(__pyx_r);
  10955. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error)
  10956. __Pyx_GOTREF(__pyx_t_2);
  10957. __pyx_t_3 = NULL;
  10958. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  10959. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10960. if (likely(__pyx_t_3)) {
  10961. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10962. __Pyx_INCREF(__pyx_t_3);
  10963. __Pyx_INCREF(function);
  10964. __Pyx_DECREF_SET(__pyx_t_2, function);
  10965. }
  10966. }
  10967. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label_1);
  10968. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10969. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
  10970. __Pyx_GOTREF(__pyx_t_1);
  10971. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10972. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error)
  10973. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10974. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1122, __pyx_L1_error)
  10975. __Pyx_GOTREF(__pyx_t_2);
  10976. __pyx_t_3 = NULL;
  10977. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  10978. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10979. if (likely(__pyx_t_3)) {
  10980. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10981. __Pyx_INCREF(__pyx_t_3);
  10982. __Pyx_INCREF(function);
  10983. __Pyx_DECREF_SET(__pyx_t_2, function);
  10984. }
  10985. }
  10986. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label_2);
  10987. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10988. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
  10989. __Pyx_GOTREF(__pyx_t_1);
  10990. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10991. __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1122, __pyx_L1_error)
  10992. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10993. try {
  10994. __pyx_t_6 = __pyx_v_self->c_env->getNodeRelCost(__pyx_t_4, __pyx_t_5);
  10995. } catch(...) {
  10996. __Pyx_CppExn2PyErr();
  10997. __PYX_ERR(0, 1122, __pyx_L1_error)
  10998. }
  10999. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1122, __pyx_L1_error)
  11000. __Pyx_GOTREF(__pyx_t_1);
  11001. __pyx_r = __pyx_t_1;
  11002. __pyx_t_1 = 0;
  11003. goto __pyx_L0;
  11004. /* "gedlibpy.pyx":1111
  11005. * return self.c_env.getAvgNumNodes()
  11006. *
  11007. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11008. * """
  11009. * Returns node relabeling cost.
  11010. */
  11011. /* function exit code */
  11012. __pyx_L1_error:;
  11013. __Pyx_XDECREF(__pyx_t_1);
  11014. __Pyx_XDECREF(__pyx_t_2);
  11015. __Pyx_XDECREF(__pyx_t_3);
  11016. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11017. __pyx_r = NULL;
  11018. __pyx_L0:;
  11019. __Pyx_XGIVEREF(__pyx_r);
  11020. __Pyx_RefNannyFinishContext();
  11021. return __pyx_r;
  11022. }
  11023. /* "gedlibpy.pyx":1125
  11024. *
  11025. *
  11026. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11027. * """
  11028. * Returns node deletion cost.
  11029. */
  11030. /* Python wrapper */
  11031. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11032. static char __pyx_doc_8gedlibpy_6GEDEnv_106get_node_del_cost[] = "\n\t\t\tReturns node deletion cost.\n\t\t\t\n\t\t\t:param node_label: Node label.\n\t\t\t:type node_label: dict{string : string}\n\t\t\t:return: Cost of deleting node with given label.\n\t\t\t:rtype: double\n\t \t";
  11033. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11034. PyObject *__pyx_r = 0;
  11035. __Pyx_RefNannyDeclarations
  11036. __Pyx_RefNannySetupContext("get_node_del_cost (wrapper)", 0);
  11037. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11038. /* function exit code */
  11039. __Pyx_RefNannyFinishContext();
  11040. return __pyx_r;
  11041. }
  11042. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11043. PyObject *__pyx_r = NULL;
  11044. __Pyx_RefNannyDeclarations
  11045. PyObject *__pyx_t_1 = NULL;
  11046. PyObject *__pyx_t_2 = NULL;
  11047. PyObject *__pyx_t_3 = NULL;
  11048. std::map<std::string,std::string> __pyx_t_4;
  11049. double __pyx_t_5;
  11050. __Pyx_RefNannySetupContext("get_node_del_cost", 0);
  11051. /* "gedlibpy.pyx":1134
  11052. * :rtype: double
  11053. * """
  11054. * return self.c_env.getNodeDelCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11055. *
  11056. *
  11057. */
  11058. __Pyx_XDECREF(__pyx_r);
  11059. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1134, __pyx_L1_error)
  11060. __Pyx_GOTREF(__pyx_t_2);
  11061. __pyx_t_3 = NULL;
  11062. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11063. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11064. if (likely(__pyx_t_3)) {
  11065. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11066. __Pyx_INCREF(__pyx_t_3);
  11067. __Pyx_INCREF(function);
  11068. __Pyx_DECREF_SET(__pyx_t_2, function);
  11069. }
  11070. }
  11071. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label);
  11072. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11073. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
  11074. __Pyx_GOTREF(__pyx_t_1);
  11075. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11076. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
  11077. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11078. try {
  11079. __pyx_t_5 = __pyx_v_self->c_env->getNodeDelCost(__pyx_t_4);
  11080. } catch(...) {
  11081. __Pyx_CppExn2PyErr();
  11082. __PYX_ERR(0, 1134, __pyx_L1_error)
  11083. }
  11084. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1134, __pyx_L1_error)
  11085. __Pyx_GOTREF(__pyx_t_1);
  11086. __pyx_r = __pyx_t_1;
  11087. __pyx_t_1 = 0;
  11088. goto __pyx_L0;
  11089. /* "gedlibpy.pyx":1125
  11090. *
  11091. *
  11092. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11093. * """
  11094. * Returns node deletion cost.
  11095. */
  11096. /* function exit code */
  11097. __pyx_L1_error:;
  11098. __Pyx_XDECREF(__pyx_t_1);
  11099. __Pyx_XDECREF(__pyx_t_2);
  11100. __Pyx_XDECREF(__pyx_t_3);
  11101. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11102. __pyx_r = NULL;
  11103. __pyx_L0:;
  11104. __Pyx_XGIVEREF(__pyx_r);
  11105. __Pyx_RefNannyFinishContext();
  11106. return __pyx_r;
  11107. }
  11108. /* "gedlibpy.pyx":1137
  11109. *
  11110. *
  11111. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11112. * """
  11113. * Returns node insertion cost.
  11114. */
  11115. /* Python wrapper */
  11116. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11117. static char __pyx_doc_8gedlibpy_6GEDEnv_108get_node_ins_cost[] = "\n\t\t\tReturns node insertion cost.\n\t\t\t\n\t\t\t:param node_label: Node label.\n\t\t\t:type node_label: dict{string : string}\n\t\t\t:return: Cost of inserting node with given label.\n\t\t\t:rtype: double\n\t \t";
  11118. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11119. PyObject *__pyx_r = 0;
  11120. __Pyx_RefNannyDeclarations
  11121. __Pyx_RefNannySetupContext("get_node_ins_cost (wrapper)", 0);
  11122. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11123. /* function exit code */
  11124. __Pyx_RefNannyFinishContext();
  11125. return __pyx_r;
  11126. }
  11127. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11128. PyObject *__pyx_r = NULL;
  11129. __Pyx_RefNannyDeclarations
  11130. PyObject *__pyx_t_1 = NULL;
  11131. PyObject *__pyx_t_2 = NULL;
  11132. PyObject *__pyx_t_3 = NULL;
  11133. std::map<std::string,std::string> __pyx_t_4;
  11134. double __pyx_t_5;
  11135. __Pyx_RefNannySetupContext("get_node_ins_cost", 0);
  11136. /* "gedlibpy.pyx":1146
  11137. * :rtype: double
  11138. * """
  11139. * return self.c_env.getNodeInsCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11140. *
  11141. *
  11142. */
  11143. __Pyx_XDECREF(__pyx_r);
  11144. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1146, __pyx_L1_error)
  11145. __Pyx_GOTREF(__pyx_t_2);
  11146. __pyx_t_3 = NULL;
  11147. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11148. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11149. if (likely(__pyx_t_3)) {
  11150. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11151. __Pyx_INCREF(__pyx_t_3);
  11152. __Pyx_INCREF(function);
  11153. __Pyx_DECREF_SET(__pyx_t_2, function);
  11154. }
  11155. }
  11156. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_node_label);
  11157. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11158. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
  11159. __Pyx_GOTREF(__pyx_t_1);
  11160. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11161. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1146, __pyx_L1_error)
  11162. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11163. try {
  11164. __pyx_t_5 = __pyx_v_self->c_env->getNodeInsCost(__pyx_t_4);
  11165. } catch(...) {
  11166. __Pyx_CppExn2PyErr();
  11167. __PYX_ERR(0, 1146, __pyx_L1_error)
  11168. }
  11169. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1146, __pyx_L1_error)
  11170. __Pyx_GOTREF(__pyx_t_1);
  11171. __pyx_r = __pyx_t_1;
  11172. __pyx_t_1 = 0;
  11173. goto __pyx_L0;
  11174. /* "gedlibpy.pyx":1137
  11175. *
  11176. *
  11177. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11178. * """
  11179. * Returns node insertion cost.
  11180. */
  11181. /* function exit code */
  11182. __pyx_L1_error:;
  11183. __Pyx_XDECREF(__pyx_t_1);
  11184. __Pyx_XDECREF(__pyx_t_2);
  11185. __Pyx_XDECREF(__pyx_t_3);
  11186. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11187. __pyx_r = NULL;
  11188. __pyx_L0:;
  11189. __Pyx_XGIVEREF(__pyx_r);
  11190. __Pyx_RefNannyFinishContext();
  11191. return __pyx_r;
  11192. }
  11193. /* "gedlibpy.pyx":1149
  11194. *
  11195. *
  11196. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11197. * """
  11198. * Computes median node label.
  11199. */
  11200. /* Python wrapper */
  11201. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels); /*proto*/
  11202. static char __pyx_doc_8gedlibpy_6GEDEnv_110get_median_node_label[] = "\n\t\t\tComputes median node label.\n\t\t\t\n\t\t\t:param node_labels: The node labels whose median should be computed.\n\t\t\t:type node_labels: list[dict{string : string}]\n\t\t\t:return: Median of the given node labels.\n\t\t\t:rtype: dict{string : string}\n\t\t";
  11203. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11204. PyObject *__pyx_r = 0;
  11205. __Pyx_RefNannyDeclarations
  11206. __Pyx_RefNannySetupContext("get_median_node_label (wrapper)", 0);
  11207. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_labels));
  11208. /* function exit code */
  11209. __Pyx_RefNannyFinishContext();
  11210. return __pyx_r;
  11211. }
  11212. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11213. PyObject *__pyx_v_node_labels_b = NULL;
  11214. PyObject *__pyx_8genexpr5__pyx_v_node_label = NULL;
  11215. PyObject *__pyx_r = NULL;
  11216. __Pyx_RefNannyDeclarations
  11217. PyObject *__pyx_t_1 = NULL;
  11218. PyObject *__pyx_t_2 = NULL;
  11219. Py_ssize_t __pyx_t_3;
  11220. PyObject *(*__pyx_t_4)(PyObject *);
  11221. PyObject *__pyx_t_5 = NULL;
  11222. PyObject *__pyx_t_6 = NULL;
  11223. PyObject *__pyx_t_7 = NULL;
  11224. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  11225. std::map<std::string,std::string> __pyx_t_9;
  11226. __Pyx_RefNannySetupContext("get_median_node_label", 0);
  11227. /* "gedlibpy.pyx":1158
  11228. * :rtype: dict{string : string}
  11229. * """
  11230. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] # <<<<<<<<<<<<<<
  11231. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b))
  11232. *
  11233. */
  11234. { /* enter inner scope */
  11235. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11236. __Pyx_GOTREF(__pyx_t_1);
  11237. if (likely(PyList_CheckExact(__pyx_v_node_labels)) || PyTuple_CheckExact(__pyx_v_node_labels)) {
  11238. __pyx_t_2 = __pyx_v_node_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  11239. __pyx_t_4 = NULL;
  11240. } else {
  11241. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_node_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11242. __Pyx_GOTREF(__pyx_t_2);
  11243. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11244. }
  11245. for (;;) {
  11246. if (likely(!__pyx_t_4)) {
  11247. if (likely(PyList_CheckExact(__pyx_t_2))) {
  11248. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  11249. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11250. __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11251. #else
  11252. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11253. __Pyx_GOTREF(__pyx_t_5);
  11254. #endif
  11255. } else {
  11256. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  11257. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11258. __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11259. #else
  11260. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11261. __Pyx_GOTREF(__pyx_t_5);
  11262. #endif
  11263. }
  11264. } else {
  11265. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  11266. if (unlikely(!__pyx_t_5)) {
  11267. PyObject* exc_type = PyErr_Occurred();
  11268. if (exc_type) {
  11269. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11270. else __PYX_ERR(0, 1158, __pyx_L5_error)
  11271. }
  11272. break;
  11273. }
  11274. __Pyx_GOTREF(__pyx_t_5);
  11275. }
  11276. __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_node_label, __pyx_t_5);
  11277. __pyx_t_5 = 0;
  11278. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11279. __Pyx_GOTREF(__pyx_t_6);
  11280. __pyx_t_7 = NULL;
  11281. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  11282. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  11283. if (likely(__pyx_t_7)) {
  11284. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  11285. __Pyx_INCREF(__pyx_t_7);
  11286. __Pyx_INCREF(function);
  11287. __Pyx_DECREF_SET(__pyx_t_6, function);
  11288. }
  11289. }
  11290. __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr5__pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr5__pyx_v_node_label);
  11291. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  11292. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1158, __pyx_L5_error)
  11293. __Pyx_GOTREF(__pyx_t_5);
  11294. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  11295. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1158, __pyx_L5_error)
  11296. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11297. }
  11298. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11299. __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label); __pyx_8genexpr5__pyx_v_node_label = 0;
  11300. goto __pyx_L8_exit_scope;
  11301. __pyx_L5_error:;
  11302. __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label); __pyx_8genexpr5__pyx_v_node_label = 0;
  11303. goto __pyx_L1_error;
  11304. __pyx_L8_exit_scope:;
  11305. } /* exit inner scope */
  11306. __pyx_v_node_labels_b = ((PyObject*)__pyx_t_1);
  11307. __pyx_t_1 = 0;
  11308. /* "gedlibpy.pyx":1159
  11309. * """
  11310. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels]
  11311. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b)) # <<<<<<<<<<<<<<
  11312. *
  11313. *
  11314. */
  11315. __Pyx_XDECREF(__pyx_r);
  11316. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error)
  11317. __Pyx_GOTREF(__pyx_t_2);
  11318. __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_v_node_labels_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1159, __pyx_L1_error)
  11319. try {
  11320. __pyx_t_9 = __pyx_v_self->c_env->getMedianNodeLabel(__pyx_t_8);
  11321. } catch(...) {
  11322. __Pyx_CppExn2PyErr();
  11323. __PYX_ERR(0, 1159, __pyx_L1_error)
  11324. }
  11325. __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error)
  11326. __Pyx_GOTREF(__pyx_t_5);
  11327. __pyx_t_6 = NULL;
  11328. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11329. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11330. if (likely(__pyx_t_6)) {
  11331. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11332. __Pyx_INCREF(__pyx_t_6);
  11333. __Pyx_INCREF(function);
  11334. __Pyx_DECREF_SET(__pyx_t_2, function);
  11335. }
  11336. }
  11337. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  11338. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11339. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11340. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
  11341. __Pyx_GOTREF(__pyx_t_1);
  11342. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11343. __pyx_r = __pyx_t_1;
  11344. __pyx_t_1 = 0;
  11345. goto __pyx_L0;
  11346. /* "gedlibpy.pyx":1149
  11347. *
  11348. *
  11349. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11350. * """
  11351. * Computes median node label.
  11352. */
  11353. /* function exit code */
  11354. __pyx_L1_error:;
  11355. __Pyx_XDECREF(__pyx_t_1);
  11356. __Pyx_XDECREF(__pyx_t_2);
  11357. __Pyx_XDECREF(__pyx_t_5);
  11358. __Pyx_XDECREF(__pyx_t_6);
  11359. __Pyx_XDECREF(__pyx_t_7);
  11360. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11361. __pyx_r = NULL;
  11362. __pyx_L0:;
  11363. __Pyx_XDECREF(__pyx_v_node_labels_b);
  11364. __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_node_label);
  11365. __Pyx_XGIVEREF(__pyx_r);
  11366. __Pyx_RefNannyFinishContext();
  11367. return __pyx_r;
  11368. }
  11369. /* "gedlibpy.pyx":1162
  11370. *
  11371. *
  11372. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11373. * """
  11374. * Returns edge relabeling cost.
  11375. */
  11376. /* Python wrapper */
  11377. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11378. static char __pyx_doc_8gedlibpy_6GEDEnv_112get_edge_rel_cost[] = "\n\t\t\tReturns edge relabeling cost.\n\t\t\t\n\t\t\t:param edge_label_1: First edge label.\n\t\t\t:param edge_label_2: Second edge label.\n\t\t\t:type edge_label_1: dict{string : string}\n\t\t\t:type edge_label_2: dict{string : string}\n\t\t\t:return: Edge relabeling cost for the given edge labels.\n\t\t\t:rtype: double\n\t \t";
  11379. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11380. PyObject *__pyx_v_edge_label_1 = 0;
  11381. PyObject *__pyx_v_edge_label_2 = 0;
  11382. PyObject *__pyx_r = 0;
  11383. __Pyx_RefNannyDeclarations
  11384. __Pyx_RefNannySetupContext("get_edge_rel_cost (wrapper)", 0);
  11385. {
  11386. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_label_1,&__pyx_n_s_edge_label_2,0};
  11387. PyObject* values[2] = {0,0};
  11388. if (unlikely(__pyx_kwds)) {
  11389. Py_ssize_t kw_args;
  11390. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11391. switch (pos_args) {
  11392. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11393. CYTHON_FALLTHROUGH;
  11394. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11395. CYTHON_FALLTHROUGH;
  11396. case 0: break;
  11397. default: goto __pyx_L5_argtuple_error;
  11398. }
  11399. kw_args = PyDict_Size(__pyx_kwds);
  11400. switch (pos_args) {
  11401. case 0:
  11402. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_1)) != 0)) kw_args--;
  11403. else goto __pyx_L5_argtuple_error;
  11404. CYTHON_FALLTHROUGH;
  11405. case 1:
  11406. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_2)) != 0)) kw_args--;
  11407. else {
  11408. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1162, __pyx_L3_error)
  11409. }
  11410. }
  11411. if (unlikely(kw_args > 0)) {
  11412. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1162, __pyx_L3_error)
  11413. }
  11414. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11415. goto __pyx_L5_argtuple_error;
  11416. } else {
  11417. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11418. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11419. }
  11420. __pyx_v_edge_label_1 = values[0];
  11421. __pyx_v_edge_label_2 = values[1];
  11422. }
  11423. goto __pyx_L4_argument_unpacking_done;
  11424. __pyx_L5_argtuple_error:;
  11425. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1162, __pyx_L3_error)
  11426. __pyx_L3_error:;
  11427. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11428. __Pyx_RefNannyFinishContext();
  11429. return NULL;
  11430. __pyx_L4_argument_unpacking_done:;
  11431. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edge_label_1, __pyx_v_edge_label_2);
  11432. /* function exit code */
  11433. __Pyx_RefNannyFinishContext();
  11434. return __pyx_r;
  11435. }
  11436. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_112get_edge_rel_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label_1, PyObject *__pyx_v_edge_label_2) {
  11437. PyObject *__pyx_r = NULL;
  11438. __Pyx_RefNannyDeclarations
  11439. PyObject *__pyx_t_1 = NULL;
  11440. PyObject *__pyx_t_2 = NULL;
  11441. PyObject *__pyx_t_3 = NULL;
  11442. std::map<std::string,std::string> __pyx_t_4;
  11443. std::map<std::string,std::string> __pyx_t_5;
  11444. double __pyx_t_6;
  11445. __Pyx_RefNannySetupContext("get_edge_rel_cost", 0);
  11446. /* "gedlibpy.pyx":1173
  11447. * :rtype: double
  11448. * """
  11449. * return self.c_env.getEdgeRelCost(encode_your_map(edge_label_1), encode_your_map(edge_label_2)) # <<<<<<<<<<<<<<
  11450. *
  11451. *
  11452. */
  11453. __Pyx_XDECREF(__pyx_r);
  11454. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11455. __Pyx_GOTREF(__pyx_t_2);
  11456. __pyx_t_3 = NULL;
  11457. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11458. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11459. if (likely(__pyx_t_3)) {
  11460. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11461. __Pyx_INCREF(__pyx_t_3);
  11462. __Pyx_INCREF(function);
  11463. __Pyx_DECREF_SET(__pyx_t_2, function);
  11464. }
  11465. }
  11466. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label_1);
  11467. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11468. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11469. __Pyx_GOTREF(__pyx_t_1);
  11470. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11471. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error)
  11472. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11473. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11474. __Pyx_GOTREF(__pyx_t_2);
  11475. __pyx_t_3 = NULL;
  11476. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11477. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11478. if (likely(__pyx_t_3)) {
  11479. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11480. __Pyx_INCREF(__pyx_t_3);
  11481. __Pyx_INCREF(function);
  11482. __Pyx_DECREF_SET(__pyx_t_2, function);
  11483. }
  11484. }
  11485. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label_2) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label_2);
  11486. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11487. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11488. __Pyx_GOTREF(__pyx_t_1);
  11489. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11490. __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error)
  11491. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11492. try {
  11493. __pyx_t_6 = __pyx_v_self->c_env->getEdgeRelCost(__pyx_t_4, __pyx_t_5);
  11494. } catch(...) {
  11495. __Pyx_CppExn2PyErr();
  11496. __PYX_ERR(0, 1173, __pyx_L1_error)
  11497. }
  11498. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11499. __Pyx_GOTREF(__pyx_t_1);
  11500. __pyx_r = __pyx_t_1;
  11501. __pyx_t_1 = 0;
  11502. goto __pyx_L0;
  11503. /* "gedlibpy.pyx":1162
  11504. *
  11505. *
  11506. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11507. * """
  11508. * Returns edge relabeling cost.
  11509. */
  11510. /* function exit code */
  11511. __pyx_L1_error:;
  11512. __Pyx_XDECREF(__pyx_t_1);
  11513. __Pyx_XDECREF(__pyx_t_2);
  11514. __Pyx_XDECREF(__pyx_t_3);
  11515. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11516. __pyx_r = NULL;
  11517. __pyx_L0:;
  11518. __Pyx_XGIVEREF(__pyx_r);
  11519. __Pyx_RefNannyFinishContext();
  11520. return __pyx_r;
  11521. }
  11522. /* "gedlibpy.pyx":1176
  11523. *
  11524. *
  11525. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  11526. * """
  11527. * Returns edge deletion cost.
  11528. */
  11529. /* Python wrapper */
  11530. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  11531. static char __pyx_doc_8gedlibpy_6GEDEnv_114get_edge_del_cost[] = "\n\t\t\tReturns edge deletion cost.\n\t\t\t\n\t\t\t:param edge_label: Edge label.\n\t\t\t:type edge_label: dict{string : string}\n\t\t\t:return: Cost of deleting edge with given label.\n\t\t\t:rtype: double\n\t \t";
  11532. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11533. PyObject *__pyx_r = 0;
  11534. __Pyx_RefNannyDeclarations
  11535. __Pyx_RefNannySetupContext("get_edge_del_cost (wrapper)", 0);
  11536. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  11537. /* function exit code */
  11538. __Pyx_RefNannyFinishContext();
  11539. return __pyx_r;
  11540. }
  11541. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11542. PyObject *__pyx_r = NULL;
  11543. __Pyx_RefNannyDeclarations
  11544. PyObject *__pyx_t_1 = NULL;
  11545. PyObject *__pyx_t_2 = NULL;
  11546. PyObject *__pyx_t_3 = NULL;
  11547. std::map<std::string,std::string> __pyx_t_4;
  11548. double __pyx_t_5;
  11549. __Pyx_RefNannySetupContext("get_edge_del_cost", 0);
  11550. /* "gedlibpy.pyx":1185
  11551. * :rtype: double
  11552. * """
  11553. * return self.c_env.getEdgeDelCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  11554. *
  11555. *
  11556. */
  11557. __Pyx_XDECREF(__pyx_r);
  11558. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
  11559. __Pyx_GOTREF(__pyx_t_2);
  11560. __pyx_t_3 = NULL;
  11561. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11562. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11563. if (likely(__pyx_t_3)) {
  11564. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11565. __Pyx_INCREF(__pyx_t_3);
  11566. __Pyx_INCREF(function);
  11567. __Pyx_DECREF_SET(__pyx_t_2, function);
  11568. }
  11569. }
  11570. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label);
  11571. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11572. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
  11573. __Pyx_GOTREF(__pyx_t_1);
  11574. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11575. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1185, __pyx_L1_error)
  11576. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11577. try {
  11578. __pyx_t_5 = __pyx_v_self->c_env->getEdgeDelCost(__pyx_t_4);
  11579. } catch(...) {
  11580. __Pyx_CppExn2PyErr();
  11581. __PYX_ERR(0, 1185, __pyx_L1_error)
  11582. }
  11583. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
  11584. __Pyx_GOTREF(__pyx_t_1);
  11585. __pyx_r = __pyx_t_1;
  11586. __pyx_t_1 = 0;
  11587. goto __pyx_L0;
  11588. /* "gedlibpy.pyx":1176
  11589. *
  11590. *
  11591. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  11592. * """
  11593. * Returns edge deletion cost.
  11594. */
  11595. /* function exit code */
  11596. __pyx_L1_error:;
  11597. __Pyx_XDECREF(__pyx_t_1);
  11598. __Pyx_XDECREF(__pyx_t_2);
  11599. __Pyx_XDECREF(__pyx_t_3);
  11600. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11601. __pyx_r = NULL;
  11602. __pyx_L0:;
  11603. __Pyx_XGIVEREF(__pyx_r);
  11604. __Pyx_RefNannyFinishContext();
  11605. return __pyx_r;
  11606. }
  11607. /* "gedlibpy.pyx":1188
  11608. *
  11609. *
  11610. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  11611. * """
  11612. * Returns edge insertion cost.
  11613. */
  11614. /* Python wrapper */
  11615. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  11616. static char __pyx_doc_8gedlibpy_6GEDEnv_116get_edge_ins_cost[] = "\n\t\t\tReturns edge insertion cost.\n\t\t\t\n\t\t\t:param edge_label: Edge label.\n\t\t\t:type edge_label: dict{string : string}\n\t\t\t:return: Cost of inserting edge with given label.\n\t\t\t:rtype: double\n\t \t";
  11617. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11618. PyObject *__pyx_r = 0;
  11619. __Pyx_RefNannyDeclarations
  11620. __Pyx_RefNannySetupContext("get_edge_ins_cost (wrapper)", 0);
  11621. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  11622. /* function exit code */
  11623. __Pyx_RefNannyFinishContext();
  11624. return __pyx_r;
  11625. }
  11626. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11627. PyObject *__pyx_r = NULL;
  11628. __Pyx_RefNannyDeclarations
  11629. PyObject *__pyx_t_1 = NULL;
  11630. PyObject *__pyx_t_2 = NULL;
  11631. PyObject *__pyx_t_3 = NULL;
  11632. std::map<std::string,std::string> __pyx_t_4;
  11633. double __pyx_t_5;
  11634. __Pyx_RefNannySetupContext("get_edge_ins_cost", 0);
  11635. /* "gedlibpy.pyx":1197
  11636. * :rtype: double
  11637. * """
  11638. * return self.c_env.getEdgeInsCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  11639. *
  11640. *
  11641. */
  11642. __Pyx_XDECREF(__pyx_r);
  11643. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1197, __pyx_L1_error)
  11644. __Pyx_GOTREF(__pyx_t_2);
  11645. __pyx_t_3 = NULL;
  11646. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11647. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11648. if (likely(__pyx_t_3)) {
  11649. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11650. __Pyx_INCREF(__pyx_t_3);
  11651. __Pyx_INCREF(function);
  11652. __Pyx_DECREF_SET(__pyx_t_2, function);
  11653. }
  11654. }
  11655. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_edge_label);
  11656. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11657. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
  11658. __Pyx_GOTREF(__pyx_t_1);
  11659. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11660. __pyx_t_4 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1197, __pyx_L1_error)
  11661. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11662. try {
  11663. __pyx_t_5 = __pyx_v_self->c_env->getEdgeInsCost(__pyx_t_4);
  11664. } catch(...) {
  11665. __Pyx_CppExn2PyErr();
  11666. __PYX_ERR(0, 1197, __pyx_L1_error)
  11667. }
  11668. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
  11669. __Pyx_GOTREF(__pyx_t_1);
  11670. __pyx_r = __pyx_t_1;
  11671. __pyx_t_1 = 0;
  11672. goto __pyx_L0;
  11673. /* "gedlibpy.pyx":1188
  11674. *
  11675. *
  11676. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  11677. * """
  11678. * Returns edge insertion cost.
  11679. */
  11680. /* function exit code */
  11681. __pyx_L1_error:;
  11682. __Pyx_XDECREF(__pyx_t_1);
  11683. __Pyx_XDECREF(__pyx_t_2);
  11684. __Pyx_XDECREF(__pyx_t_3);
  11685. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11686. __pyx_r = NULL;
  11687. __pyx_L0:;
  11688. __Pyx_XGIVEREF(__pyx_r);
  11689. __Pyx_RefNannyFinishContext();
  11690. return __pyx_r;
  11691. }
  11692. /* "gedlibpy.pyx":1200
  11693. *
  11694. *
  11695. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  11696. * """
  11697. * Computes median edge label.
  11698. */
  11699. /* Python wrapper */
  11700. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels); /*proto*/
  11701. static char __pyx_doc_8gedlibpy_6GEDEnv_118get_median_edge_label[] = "\n\t\t\tComputes median edge label.\n\t\t\t\n\t\t\t:param edge_labels: The edge labels whose median should be computed.\n\t\t\t:type edge_labels: list[dict{string : string}]\n\t\t\t:return: Median of the given edge labels.\n\t\t\t:rtype: dict{string : string}\n\t\t";
  11702. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  11703. PyObject *__pyx_r = 0;
  11704. __Pyx_RefNannyDeclarations
  11705. __Pyx_RefNannySetupContext("get_median_edge_label (wrapper)", 0);
  11706. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_labels));
  11707. /* function exit code */
  11708. __Pyx_RefNannyFinishContext();
  11709. return __pyx_r;
  11710. }
  11711. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  11712. CYTHON_UNUSED PyObject *__pyx_v_edge_labels_b = NULL;
  11713. PyObject *__pyx_8genexpr6__pyx_v_edge_label = NULL;
  11714. PyObject *__pyx_r = NULL;
  11715. __Pyx_RefNannyDeclarations
  11716. PyObject *__pyx_t_1 = NULL;
  11717. PyObject *__pyx_t_2 = NULL;
  11718. Py_ssize_t __pyx_t_3;
  11719. PyObject *(*__pyx_t_4)(PyObject *);
  11720. PyObject *__pyx_t_5 = NULL;
  11721. PyObject *__pyx_t_6 = NULL;
  11722. PyObject *__pyx_t_7 = NULL;
  11723. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  11724. std::map<std::string,std::string> __pyx_t_9;
  11725. __Pyx_RefNannySetupContext("get_median_edge_label", 0);
  11726. /* "gedlibpy.pyx":1209
  11727. * :rtype: dict{string : string}
  11728. * """
  11729. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] # <<<<<<<<<<<<<<
  11730. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b))
  11731. *
  11732. */
  11733. { /* enter inner scope */
  11734. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11735. __Pyx_GOTREF(__pyx_t_1);
  11736. if (likely(PyList_CheckExact(__pyx_v_edge_labels)) || PyTuple_CheckExact(__pyx_v_edge_labels)) {
  11737. __pyx_t_2 = __pyx_v_edge_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  11738. __pyx_t_4 = NULL;
  11739. } else {
  11740. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_edge_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11741. __Pyx_GOTREF(__pyx_t_2);
  11742. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11743. }
  11744. for (;;) {
  11745. if (likely(!__pyx_t_4)) {
  11746. if (likely(PyList_CheckExact(__pyx_t_2))) {
  11747. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  11748. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11749. __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11750. #else
  11751. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11752. __Pyx_GOTREF(__pyx_t_5);
  11753. #endif
  11754. } else {
  11755. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  11756. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11757. __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11758. #else
  11759. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11760. __Pyx_GOTREF(__pyx_t_5);
  11761. #endif
  11762. }
  11763. } else {
  11764. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  11765. if (unlikely(!__pyx_t_5)) {
  11766. PyObject* exc_type = PyErr_Occurred();
  11767. if (exc_type) {
  11768. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11769. else __PYX_ERR(0, 1209, __pyx_L5_error)
  11770. }
  11771. break;
  11772. }
  11773. __Pyx_GOTREF(__pyx_t_5);
  11774. }
  11775. __Pyx_XDECREF_SET(__pyx_8genexpr6__pyx_v_edge_label, __pyx_t_5);
  11776. __pyx_t_5 = 0;
  11777. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11778. __Pyx_GOTREF(__pyx_t_6);
  11779. __pyx_t_7 = NULL;
  11780. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  11781. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  11782. if (likely(__pyx_t_7)) {
  11783. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  11784. __Pyx_INCREF(__pyx_t_7);
  11785. __Pyx_INCREF(function);
  11786. __Pyx_DECREF_SET(__pyx_t_6, function);
  11787. }
  11788. }
  11789. __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr6__pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr6__pyx_v_edge_label);
  11790. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  11791. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1209, __pyx_L5_error)
  11792. __Pyx_GOTREF(__pyx_t_5);
  11793. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  11794. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1209, __pyx_L5_error)
  11795. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11796. }
  11797. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11798. __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label); __pyx_8genexpr6__pyx_v_edge_label = 0;
  11799. goto __pyx_L8_exit_scope;
  11800. __pyx_L5_error:;
  11801. __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label); __pyx_8genexpr6__pyx_v_edge_label = 0;
  11802. goto __pyx_L1_error;
  11803. __pyx_L8_exit_scope:;
  11804. } /* exit inner scope */
  11805. __pyx_v_edge_labels_b = ((PyObject*)__pyx_t_1);
  11806. __pyx_t_1 = 0;
  11807. /* "gedlibpy.pyx":1210
  11808. * """
  11809. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels]
  11810. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b)) # <<<<<<<<<<<<<<
  11811. *
  11812. *
  11813. */
  11814. __Pyx_XDECREF(__pyx_r);
  11815. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1210, __pyx_L1_error)
  11816. __Pyx_GOTREF(__pyx_t_2);
  11817. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
  11818. __Pyx_GOTREF(__pyx_t_5);
  11819. __pyx_t_8 = __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1210, __pyx_L1_error)
  11820. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11821. try {
  11822. __pyx_t_9 = __pyx_v_self->c_env->getMedianEdgeLabel(__pyx_t_8);
  11823. } catch(...) {
  11824. __Pyx_CppExn2PyErr();
  11825. __PYX_ERR(0, 1210, __pyx_L1_error)
  11826. }
  11827. __pyx_t_5 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1210, __pyx_L1_error)
  11828. __Pyx_GOTREF(__pyx_t_5);
  11829. __pyx_t_6 = NULL;
  11830. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11831. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11832. if (likely(__pyx_t_6)) {
  11833. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11834. __Pyx_INCREF(__pyx_t_6);
  11835. __Pyx_INCREF(function);
  11836. __Pyx_DECREF_SET(__pyx_t_2, function);
  11837. }
  11838. }
  11839. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5);
  11840. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11841. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11842. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1210, __pyx_L1_error)
  11843. __Pyx_GOTREF(__pyx_t_1);
  11844. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11845. __pyx_r = __pyx_t_1;
  11846. __pyx_t_1 = 0;
  11847. goto __pyx_L0;
  11848. /* "gedlibpy.pyx":1200
  11849. *
  11850. *
  11851. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  11852. * """
  11853. * Computes median edge label.
  11854. */
  11855. /* function exit code */
  11856. __pyx_L1_error:;
  11857. __Pyx_XDECREF(__pyx_t_1);
  11858. __Pyx_XDECREF(__pyx_t_2);
  11859. __Pyx_XDECREF(__pyx_t_5);
  11860. __Pyx_XDECREF(__pyx_t_6);
  11861. __Pyx_XDECREF(__pyx_t_7);
  11862. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11863. __pyx_r = NULL;
  11864. __pyx_L0:;
  11865. __Pyx_XDECREF(__pyx_v_edge_labels_b);
  11866. __Pyx_XDECREF(__pyx_8genexpr6__pyx_v_edge_label);
  11867. __Pyx_XGIVEREF(__pyx_r);
  11868. __Pyx_RefNannyFinishContext();
  11869. return __pyx_r;
  11870. }
  11871. /* "gedlibpy.pyx":1213
  11872. *
  11873. *
  11874. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  11875. * """
  11876. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  11877. */
  11878. /* Python wrapper */
  11879. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11880. static char __pyx_doc_8gedlibpy_6GEDEnv_120get_nx_graph[] = "\n\t\tGet graph with id `graph_id` in the form of the NetworkX Graph.\n\n\t\tParameters\n\t\t----------\n\t\tgraph_id : int\n\t\t\tID of the selected graph.\n\t\t\t\n\t\tadj_matrix : bool\n\t\t\tSet to `True` to construct an adjacency matrix `adj_matrix` and a hash-map `edge_labels`, which has a key for each pair `(i,j)` such that `adj_matrix[i][j]` equals 1. No effect for now.\n\t\t\t\n\t\tadj_lists : bool\n\t\t\tNo effect for now.\n\t\t\t\n\t\tedge_list : bool\n\t\t\tNo effect for now.\n\n\t\tReturns\n\t\t-------\n\t\tNetworkX Graph object\n\t\t\tThe obtained graph.\n\t\t";
  11881. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11882. PyObject *__pyx_v_graph_id = 0;
  11883. CYTHON_UNUSED PyObject *__pyx_v_adj_matrix = 0;
  11884. CYTHON_UNUSED PyObject *__pyx_v_adj_lists = 0;
  11885. CYTHON_UNUSED PyObject *__pyx_v_edge_list = 0;
  11886. PyObject *__pyx_r = 0;
  11887. __Pyx_RefNannyDeclarations
  11888. __Pyx_RefNannySetupContext("get_nx_graph (wrapper)", 0);
  11889. {
  11890. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_adj_matrix,&__pyx_n_s_adj_lists,&__pyx_n_s_edge_list,0};
  11891. PyObject* values[4] = {0,0,0,0};
  11892. values[1] = ((PyObject *)Py_True);
  11893. values[2] = ((PyObject *)Py_False);
  11894. values[3] = ((PyObject *)Py_False);
  11895. if (unlikely(__pyx_kwds)) {
  11896. Py_ssize_t kw_args;
  11897. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11898. switch (pos_args) {
  11899. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  11900. CYTHON_FALLTHROUGH;
  11901. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  11902. CYTHON_FALLTHROUGH;
  11903. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11904. CYTHON_FALLTHROUGH;
  11905. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11906. CYTHON_FALLTHROUGH;
  11907. case 0: break;
  11908. default: goto __pyx_L5_argtuple_error;
  11909. }
  11910. kw_args = PyDict_Size(__pyx_kwds);
  11911. switch (pos_args) {
  11912. case 0:
  11913. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  11914. else goto __pyx_L5_argtuple_error;
  11915. CYTHON_FALLTHROUGH;
  11916. case 1:
  11917. if (kw_args > 0) {
  11918. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_matrix);
  11919. if (value) { values[1] = value; kw_args--; }
  11920. }
  11921. CYTHON_FALLTHROUGH;
  11922. case 2:
  11923. if (kw_args > 0) {
  11924. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_lists);
  11925. if (value) { values[2] = value; kw_args--; }
  11926. }
  11927. CYTHON_FALLTHROUGH;
  11928. case 3:
  11929. if (kw_args > 0) {
  11930. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_list);
  11931. if (value) { values[3] = value; kw_args--; }
  11932. }
  11933. }
  11934. if (unlikely(kw_args > 0)) {
  11935. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1213, __pyx_L3_error)
  11936. }
  11937. } else {
  11938. switch (PyTuple_GET_SIZE(__pyx_args)) {
  11939. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  11940. CYTHON_FALLTHROUGH;
  11941. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  11942. CYTHON_FALLTHROUGH;
  11943. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11944. CYTHON_FALLTHROUGH;
  11945. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11946. break;
  11947. default: goto __pyx_L5_argtuple_error;
  11948. }
  11949. }
  11950. __pyx_v_graph_id = values[0];
  11951. __pyx_v_adj_matrix = values[1];
  11952. __pyx_v_adj_lists = values[2];
  11953. __pyx_v_edge_list = values[3];
  11954. }
  11955. goto __pyx_L4_argument_unpacking_done;
  11956. __pyx_L5_argtuple_error:;
  11957. __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1213, __pyx_L3_error)
  11958. __pyx_L3_error:;
  11959. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11960. __Pyx_RefNannyFinishContext();
  11961. return NULL;
  11962. __pyx_L4_argument_unpacking_done:;
  11963. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_graph_id, __pyx_v_adj_matrix, __pyx_v_adj_lists, __pyx_v_edge_list);
  11964. /* function exit code */
  11965. __Pyx_RefNannyFinishContext();
  11966. return __pyx_r;
  11967. }
  11968. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_120get_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id, CYTHON_UNUSED PyObject *__pyx_v_adj_matrix, CYTHON_UNUSED PyObject *__pyx_v_adj_lists, CYTHON_UNUSED PyObject *__pyx_v_edge_list) {
  11969. PyObject *__pyx_v_graph = NULL;
  11970. PyObject *__pyx_v_nb_nodes = NULL;
  11971. PyObject *__pyx_v_original_node_ids = NULL;
  11972. PyObject *__pyx_v_node_labels = NULL;
  11973. PyObject *__pyx_v_node_id = NULL;
  11974. PyObject *__pyx_v_edges = NULL;
  11975. PyObject *__pyx_v_head = NULL;
  11976. PyObject *__pyx_v_tail = NULL;
  11977. PyObject *__pyx_v_labels = NULL;
  11978. PyObject *__pyx_r = NULL;
  11979. __Pyx_RefNannyDeclarations
  11980. PyObject *__pyx_t_1 = NULL;
  11981. PyObject *__pyx_t_2 = NULL;
  11982. PyObject *__pyx_t_3 = NULL;
  11983. Py_ssize_t __pyx_t_4;
  11984. PyObject *(*__pyx_t_5)(PyObject *);
  11985. PyObject *__pyx_t_6 = NULL;
  11986. PyObject *__pyx_t_7 = NULL;
  11987. Py_ssize_t __pyx_t_8;
  11988. int __pyx_t_9;
  11989. int __pyx_t_10;
  11990. PyObject *__pyx_t_11 = NULL;
  11991. PyObject *(*__pyx_t_12)(PyObject *);
  11992. __Pyx_RefNannySetupContext("get_nx_graph", 0);
  11993. /* "gedlibpy.pyx":1236
  11994. * The obtained graph.
  11995. * """
  11996. * graph = nx.Graph() # <<<<<<<<<<<<<<
  11997. * graph.graph['id'] = graph_id
  11998. *
  11999. */
  12000. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L1_error)
  12001. __Pyx_GOTREF(__pyx_t_2);
  12002. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1236, __pyx_L1_error)
  12003. __Pyx_GOTREF(__pyx_t_3);
  12004. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12005. __pyx_t_2 = NULL;
  12006. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  12007. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12008. if (likely(__pyx_t_2)) {
  12009. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12010. __Pyx_INCREF(__pyx_t_2);
  12011. __Pyx_INCREF(function);
  12012. __Pyx_DECREF_SET(__pyx_t_3, function);
  12013. }
  12014. }
  12015. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  12016. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12017. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L1_error)
  12018. __Pyx_GOTREF(__pyx_t_1);
  12019. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12020. __pyx_v_graph = __pyx_t_1;
  12021. __pyx_t_1 = 0;
  12022. /* "gedlibpy.pyx":1237
  12023. * """
  12024. * graph = nx.Graph()
  12025. * graph.graph['id'] = graph_id # <<<<<<<<<<<<<<
  12026. *
  12027. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12028. */
  12029. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error)
  12030. __Pyx_GOTREF(__pyx_t_1);
  12031. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1237, __pyx_L1_error)
  12032. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12033. /* "gedlibpy.pyx":1239
  12034. * graph.graph['id'] = graph_id
  12035. *
  12036. * nb_nodes = self.get_graph_num_nodes(graph_id) # <<<<<<<<<<<<<<
  12037. * original_node_ids = self.get_original_node_ids(graph_id)
  12038. * node_labels = self.get_graph_node_labels(graph_id)
  12039. */
  12040. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_num_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1239, __pyx_L1_error)
  12041. __Pyx_GOTREF(__pyx_t_3);
  12042. __pyx_t_2 = NULL;
  12043. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12044. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12045. if (likely(__pyx_t_2)) {
  12046. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12047. __Pyx_INCREF(__pyx_t_2);
  12048. __Pyx_INCREF(function);
  12049. __Pyx_DECREF_SET(__pyx_t_3, function);
  12050. }
  12051. }
  12052. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id);
  12053. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12054. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1239, __pyx_L1_error)
  12055. __Pyx_GOTREF(__pyx_t_1);
  12056. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12057. __pyx_v_nb_nodes = __pyx_t_1;
  12058. __pyx_t_1 = 0;
  12059. /* "gedlibpy.pyx":1240
  12060. *
  12061. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12062. * original_node_ids = self.get_original_node_ids(graph_id) # <<<<<<<<<<<<<<
  12063. * node_labels = self.get_graph_node_labels(graph_id)
  12064. * # print(original_node_ids)
  12065. */
  12066. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_original_node_ids); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1240, __pyx_L1_error)
  12067. __Pyx_GOTREF(__pyx_t_3);
  12068. __pyx_t_2 = NULL;
  12069. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12070. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12071. if (likely(__pyx_t_2)) {
  12072. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12073. __Pyx_INCREF(__pyx_t_2);
  12074. __Pyx_INCREF(function);
  12075. __Pyx_DECREF_SET(__pyx_t_3, function);
  12076. }
  12077. }
  12078. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id);
  12079. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12080. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1240, __pyx_L1_error)
  12081. __Pyx_GOTREF(__pyx_t_1);
  12082. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12083. __pyx_v_original_node_ids = __pyx_t_1;
  12084. __pyx_t_1 = 0;
  12085. /* "gedlibpy.pyx":1241
  12086. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12087. * original_node_ids = self.get_original_node_ids(graph_id)
  12088. * node_labels = self.get_graph_node_labels(graph_id) # <<<<<<<<<<<<<<
  12089. * # print(original_node_ids)
  12090. * # print(node_labels)
  12091. */
  12092. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_node_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1241, __pyx_L1_error)
  12093. __Pyx_GOTREF(__pyx_t_3);
  12094. __pyx_t_2 = NULL;
  12095. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12096. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12097. if (likely(__pyx_t_2)) {
  12098. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12099. __Pyx_INCREF(__pyx_t_2);
  12100. __Pyx_INCREF(function);
  12101. __Pyx_DECREF_SET(__pyx_t_3, function);
  12102. }
  12103. }
  12104. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_graph_id);
  12105. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12106. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1241, __pyx_L1_error)
  12107. __Pyx_GOTREF(__pyx_t_1);
  12108. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12109. __pyx_v_node_labels = __pyx_t_1;
  12110. __pyx_t_1 = 0;
  12111. /* "gedlibpy.pyx":1244
  12112. * # print(original_node_ids)
  12113. * # print(node_labels)
  12114. * graph.graph['original_node_ids'] = original_node_ids # <<<<<<<<<<<<<<
  12115. *
  12116. * for node_id in range(0, nb_nodes):
  12117. */
  12118. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1244, __pyx_L1_error)
  12119. __Pyx_GOTREF(__pyx_t_1);
  12120. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_original_node_ids, __pyx_v_original_node_ids) < 0)) __PYX_ERR(0, 1244, __pyx_L1_error)
  12121. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12122. /* "gedlibpy.pyx":1246
  12123. * graph.graph['original_node_ids'] = original_node_ids
  12124. *
  12125. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12126. * graph.add_node(node_id, **node_labels[node_id])
  12127. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12128. */
  12129. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12130. __Pyx_GOTREF(__pyx_t_1);
  12131. __Pyx_INCREF(__pyx_int_0);
  12132. __Pyx_GIVEREF(__pyx_int_0);
  12133. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  12134. __Pyx_INCREF(__pyx_v_nb_nodes);
  12135. __Pyx_GIVEREF(__pyx_v_nb_nodes);
  12136. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nb_nodes);
  12137. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12138. __Pyx_GOTREF(__pyx_t_3);
  12139. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12140. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  12141. __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  12142. __pyx_t_5 = NULL;
  12143. } else {
  12144. __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12145. __Pyx_GOTREF(__pyx_t_1);
  12146. __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12147. }
  12148. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12149. for (;;) {
  12150. if (likely(!__pyx_t_5)) {
  12151. if (likely(PyList_CheckExact(__pyx_t_1))) {
  12152. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
  12153. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12154. __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12155. #else
  12156. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12157. __Pyx_GOTREF(__pyx_t_3);
  12158. #endif
  12159. } else {
  12160. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  12161. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12162. __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12163. #else
  12164. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1246, __pyx_L1_error)
  12165. __Pyx_GOTREF(__pyx_t_3);
  12166. #endif
  12167. }
  12168. } else {
  12169. __pyx_t_3 = __pyx_t_5(__pyx_t_1);
  12170. if (unlikely(!__pyx_t_3)) {
  12171. PyObject* exc_type = PyErr_Occurred();
  12172. if (exc_type) {
  12173. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12174. else __PYX_ERR(0, 1246, __pyx_L1_error)
  12175. }
  12176. break;
  12177. }
  12178. __Pyx_GOTREF(__pyx_t_3);
  12179. }
  12180. __Pyx_XDECREF_SET(__pyx_v_node_id, __pyx_t_3);
  12181. __pyx_t_3 = 0;
  12182. /* "gedlibpy.pyx":1247
  12183. *
  12184. * for node_id in range(0, nb_nodes):
  12185. * graph.add_node(node_id, **node_labels[node_id]) # <<<<<<<<<<<<<<
  12186. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12187. *
  12188. */
  12189. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12190. __Pyx_GOTREF(__pyx_t_3);
  12191. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12192. __Pyx_GOTREF(__pyx_t_2);
  12193. __Pyx_INCREF(__pyx_v_node_id);
  12194. __Pyx_GIVEREF(__pyx_v_node_id);
  12195. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node_id);
  12196. __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_node_labels, __pyx_v_node_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12197. __Pyx_GOTREF(__pyx_t_7);
  12198. if (unlikely(__pyx_t_7 == Py_None)) {
  12199. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12200. __PYX_ERR(0, 1247, __pyx_L1_error)
  12201. }
  12202. if (likely(PyDict_CheckExact(__pyx_t_7))) {
  12203. __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12204. __Pyx_GOTREF(__pyx_t_6);
  12205. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12206. } else {
  12207. __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12208. __Pyx_GOTREF(__pyx_t_6);
  12209. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12210. }
  12211. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1247, __pyx_L1_error)
  12212. __Pyx_GOTREF(__pyx_t_7);
  12213. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12214. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12215. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12216. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12217. /* "gedlibpy.pyx":1246
  12218. * graph.graph['original_node_ids'] = original_node_ids
  12219. *
  12220. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12221. * graph.add_node(node_id, **node_labels[node_id])
  12222. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12223. */
  12224. }
  12225. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12226. /* "gedlibpy.pyx":1250
  12227. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12228. *
  12229. * edges = self.get_graph_edges(graph_id) # <<<<<<<<<<<<<<
  12230. * for (head, tail), labels in edges.items():
  12231. * graph.add_edge(head, tail, **labels)
  12232. */
  12233. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1250, __pyx_L1_error)
  12234. __Pyx_GOTREF(__pyx_t_7);
  12235. __pyx_t_6 = NULL;
  12236. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12237. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
  12238. if (likely(__pyx_t_6)) {
  12239. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12240. __Pyx_INCREF(__pyx_t_6);
  12241. __Pyx_INCREF(function);
  12242. __Pyx_DECREF_SET(__pyx_t_7, function);
  12243. }
  12244. }
  12245. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_6, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_graph_id);
  12246. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12247. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
  12248. __Pyx_GOTREF(__pyx_t_1);
  12249. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12250. __pyx_v_edges = __pyx_t_1;
  12251. __pyx_t_1 = 0;
  12252. /* "gedlibpy.pyx":1251
  12253. *
  12254. * edges = self.get_graph_edges(graph_id)
  12255. * for (head, tail), labels in edges.items(): # <<<<<<<<<<<<<<
  12256. * graph.add_edge(head, tail, **labels)
  12257. * # print(edges)
  12258. */
  12259. __pyx_t_4 = 0;
  12260. if (unlikely(__pyx_v_edges == Py_None)) {
  12261. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  12262. __PYX_ERR(0, 1251, __pyx_L1_error)
  12263. }
  12264. __pyx_t_7 = __Pyx_dict_iterator(__pyx_v_edges, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1251, __pyx_L1_error)
  12265. __Pyx_GOTREF(__pyx_t_7);
  12266. __Pyx_XDECREF(__pyx_t_1);
  12267. __pyx_t_1 = __pyx_t_7;
  12268. __pyx_t_7 = 0;
  12269. while (1) {
  12270. __pyx_t_10 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_8, &__pyx_t_4, &__pyx_t_7, &__pyx_t_6, NULL, __pyx_t_9);
  12271. if (unlikely(__pyx_t_10 == 0)) break;
  12272. if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1251, __pyx_L1_error)
  12273. __Pyx_GOTREF(__pyx_t_7);
  12274. __Pyx_GOTREF(__pyx_t_6);
  12275. if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
  12276. PyObject* sequence = __pyx_t_7;
  12277. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  12278. if (unlikely(size != 2)) {
  12279. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  12280. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  12281. __PYX_ERR(0, 1251, __pyx_L1_error)
  12282. }
  12283. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12284. if (likely(PyTuple_CheckExact(sequence))) {
  12285. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  12286. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  12287. } else {
  12288. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  12289. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  12290. }
  12291. __Pyx_INCREF(__pyx_t_2);
  12292. __Pyx_INCREF(__pyx_t_3);
  12293. #else
  12294. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1251, __pyx_L1_error)
  12295. __Pyx_GOTREF(__pyx_t_2);
  12296. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1251, __pyx_L1_error)
  12297. __Pyx_GOTREF(__pyx_t_3);
  12298. #endif
  12299. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12300. } else {
  12301. Py_ssize_t index = -1;
  12302. __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1251, __pyx_L1_error)
  12303. __Pyx_GOTREF(__pyx_t_11);
  12304. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12305. __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
  12306. index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
  12307. __Pyx_GOTREF(__pyx_t_2);
  12308. index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  12309. __Pyx_GOTREF(__pyx_t_3);
  12310. if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1251, __pyx_L1_error)
  12311. __pyx_t_12 = NULL;
  12312. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12313. goto __pyx_L8_unpacking_done;
  12314. __pyx_L7_unpacking_failed:;
  12315. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12316. __pyx_t_12 = NULL;
  12317. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  12318. __PYX_ERR(0, 1251, __pyx_L1_error)
  12319. __pyx_L8_unpacking_done:;
  12320. }
  12321. __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
  12322. __pyx_t_2 = 0;
  12323. __Pyx_XDECREF_SET(__pyx_v_tail, __pyx_t_3);
  12324. __pyx_t_3 = 0;
  12325. __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_6);
  12326. __pyx_t_6 = 0;
  12327. /* "gedlibpy.pyx":1252
  12328. * edges = self.get_graph_edges(graph_id)
  12329. * for (head, tail), labels in edges.items():
  12330. * graph.add_edge(head, tail, **labels) # <<<<<<<<<<<<<<
  12331. * # print(edges)
  12332. *
  12333. */
  12334. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1252, __pyx_L1_error)
  12335. __Pyx_GOTREF(__pyx_t_6);
  12336. __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1252, __pyx_L1_error)
  12337. __Pyx_GOTREF(__pyx_t_7);
  12338. __Pyx_INCREF(__pyx_v_head);
  12339. __Pyx_GIVEREF(__pyx_v_head);
  12340. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_head);
  12341. __Pyx_INCREF(__pyx_v_tail);
  12342. __Pyx_GIVEREF(__pyx_v_tail);
  12343. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_tail);
  12344. if (unlikely(__pyx_v_labels == Py_None)) {
  12345. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12346. __PYX_ERR(0, 1252, __pyx_L1_error)
  12347. }
  12348. if (likely(PyDict_CheckExact(__pyx_v_labels))) {
  12349. __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error)
  12350. __Pyx_GOTREF(__pyx_t_3);
  12351. } else {
  12352. __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1252, __pyx_L1_error)
  12353. __Pyx_GOTREF(__pyx_t_3);
  12354. }
  12355. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error)
  12356. __Pyx_GOTREF(__pyx_t_2);
  12357. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12358. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12359. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12360. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12361. }
  12362. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12363. /* "gedlibpy.pyx":1255
  12364. * # print(edges)
  12365. *
  12366. * return graph # <<<<<<<<<<<<<<
  12367. *
  12368. *
  12369. */
  12370. __Pyx_XDECREF(__pyx_r);
  12371. __Pyx_INCREF(__pyx_v_graph);
  12372. __pyx_r = __pyx_v_graph;
  12373. goto __pyx_L0;
  12374. /* "gedlibpy.pyx":1213
  12375. *
  12376. *
  12377. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12378. * """
  12379. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12380. */
  12381. /* function exit code */
  12382. __pyx_L1_error:;
  12383. __Pyx_XDECREF(__pyx_t_1);
  12384. __Pyx_XDECREF(__pyx_t_2);
  12385. __Pyx_XDECREF(__pyx_t_3);
  12386. __Pyx_XDECREF(__pyx_t_6);
  12387. __Pyx_XDECREF(__pyx_t_7);
  12388. __Pyx_XDECREF(__pyx_t_11);
  12389. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12390. __pyx_r = NULL;
  12391. __pyx_L0:;
  12392. __Pyx_XDECREF(__pyx_v_graph);
  12393. __Pyx_XDECREF(__pyx_v_nb_nodes);
  12394. __Pyx_XDECREF(__pyx_v_original_node_ids);
  12395. __Pyx_XDECREF(__pyx_v_node_labels);
  12396. __Pyx_XDECREF(__pyx_v_node_id);
  12397. __Pyx_XDECREF(__pyx_v_edges);
  12398. __Pyx_XDECREF(__pyx_v_head);
  12399. __Pyx_XDECREF(__pyx_v_tail);
  12400. __Pyx_XDECREF(__pyx_v_labels);
  12401. __Pyx_XGIVEREF(__pyx_r);
  12402. __Pyx_RefNannyFinishContext();
  12403. return __pyx_r;
  12404. }
  12405. /* "gedlibpy.pyx":1258
  12406. *
  12407. *
  12408. * def get_init_type(self): # <<<<<<<<<<<<<<
  12409. * """
  12410. * Returns the initialization type of the last initialization in string.
  12411. */
  12412. /* Python wrapper */
  12413. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  12414. static char __pyx_doc_8gedlibpy_6GEDEnv_122get_init_type[] = "\n\t\tReturns the initialization type of the last initialization in string.\n\n\t\tReturns\n\t\t-------\n\t\tstring\n\t\t\tInitialization type in string.\n\t\t";
  12415. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  12416. PyObject *__pyx_r = 0;
  12417. __Pyx_RefNannyDeclarations
  12418. __Pyx_RefNannySetupContext("get_init_type (wrapper)", 0);
  12419. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  12420. /* function exit code */
  12421. __Pyx_RefNannyFinishContext();
  12422. return __pyx_r;
  12423. }
  12424. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  12425. PyObject *__pyx_r = NULL;
  12426. __Pyx_RefNannyDeclarations
  12427. std::string __pyx_t_1;
  12428. PyObject *__pyx_t_2 = NULL;
  12429. __Pyx_RefNannySetupContext("get_init_type", 0);
  12430. /* "gedlibpy.pyx":1267
  12431. * Initialization type in string.
  12432. * """
  12433. * return self.c_env.getInitType().decode('utf-8') # <<<<<<<<<<<<<<
  12434. *
  12435. *
  12436. */
  12437. __Pyx_XDECREF(__pyx_r);
  12438. try {
  12439. __pyx_t_1 = __pyx_v_self->c_env->getInitType();
  12440. } catch(...) {
  12441. __Pyx_CppExn2PyErr();
  12442. __PYX_ERR(0, 1267, __pyx_L1_error)
  12443. }
  12444. __pyx_t_2 = __Pyx_decode_cpp_string(__pyx_t_1, 0, PY_SSIZE_T_MAX, NULL, NULL, PyUnicode_DecodeUTF8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  12445. __Pyx_GOTREF(__pyx_t_2);
  12446. __pyx_r = __pyx_t_2;
  12447. __pyx_t_2 = 0;
  12448. goto __pyx_L0;
  12449. /* "gedlibpy.pyx":1258
  12450. *
  12451. *
  12452. * def get_init_type(self): # <<<<<<<<<<<<<<
  12453. * """
  12454. * Returns the initialization type of the last initialization in string.
  12455. */
  12456. /* function exit code */
  12457. __pyx_L1_error:;
  12458. __Pyx_XDECREF(__pyx_t_2);
  12459. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12460. __pyx_r = NULL;
  12461. __pyx_L0:;
  12462. __Pyx_XGIVEREF(__pyx_r);
  12463. __Pyx_RefNannyFinishContext();
  12464. return __pyx_r;
  12465. }
  12466. /* "gedlibpy.pyx":1289
  12467. *
  12468. *
  12469. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  12470. * """
  12471. * Loads NetworkX Graph into the GED environment.
  12472. */
  12473. /* Python wrapper */
  12474. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12475. static char __pyx_doc_8gedlibpy_6GEDEnv_124load_nx_graph[] = "\n\t\tLoads NetworkX Graph into the GED environment.\n\n\t\tParameters\n\t\t----------\n\t\tnx_graph : NetworkX Graph object\n\t\t\tThe graph that should be loaded.\n\t\t\t\n\t\tgraph_id : int or None\n\t\t\tThe ID of a graph contained the environment (overwrite existing graph) or add new graph if `None`.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\tgraph_name : string, optional\n\t\t\tThe name of newly added graph. The default is ''. Has no effect unless `graph_id` equals `None`.\n\t\t\t\n\t\tgraph_class : string, optional\n\t\t\tThe class of newly added graph. The default is ''. Has no effect unless `graph_id` equals `None`.\n\n\t\tReturns\n\t\t-------\n\t\tint\n\t\t\tThe ID of the newly loaded graph.\n\t\t";
  12476. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12477. PyObject *__pyx_v_nx_graph = 0;
  12478. PyObject *__pyx_v_graph_id = 0;
  12479. PyObject *__pyx_v_graph_name = 0;
  12480. PyObject *__pyx_v_graph_class = 0;
  12481. PyObject *__pyx_r = 0;
  12482. __Pyx_RefNannyDeclarations
  12483. __Pyx_RefNannySetupContext("load_nx_graph (wrapper)", 0);
  12484. {
  12485. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nx_graph,&__pyx_n_s_graph_id,&__pyx_n_s_graph_name,&__pyx_n_s_graph_class,0};
  12486. PyObject* values[4] = {0,0,0,0};
  12487. values[2] = ((PyObject *)__pyx_kp_u_);
  12488. values[3] = ((PyObject *)__pyx_kp_u_);
  12489. if (unlikely(__pyx_kwds)) {
  12490. Py_ssize_t kw_args;
  12491. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12492. switch (pos_args) {
  12493. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12494. CYTHON_FALLTHROUGH;
  12495. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12496. CYTHON_FALLTHROUGH;
  12497. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12498. CYTHON_FALLTHROUGH;
  12499. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12500. CYTHON_FALLTHROUGH;
  12501. case 0: break;
  12502. default: goto __pyx_L5_argtuple_error;
  12503. }
  12504. kw_args = PyDict_Size(__pyx_kwds);
  12505. switch (pos_args) {
  12506. case 0:
  12507. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nx_graph)) != 0)) kw_args--;
  12508. else goto __pyx_L5_argtuple_error;
  12509. CYTHON_FALLTHROUGH;
  12510. case 1:
  12511. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12512. else {
  12513. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1289, __pyx_L3_error)
  12514. }
  12515. CYTHON_FALLTHROUGH;
  12516. case 2:
  12517. if (kw_args > 0) {
  12518. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_name);
  12519. if (value) { values[2] = value; kw_args--; }
  12520. }
  12521. CYTHON_FALLTHROUGH;
  12522. case 3:
  12523. if (kw_args > 0) {
  12524. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_class);
  12525. if (value) { values[3] = value; kw_args--; }
  12526. }
  12527. }
  12528. if (unlikely(kw_args > 0)) {
  12529. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1289, __pyx_L3_error)
  12530. }
  12531. } else {
  12532. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12533. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12534. CYTHON_FALLTHROUGH;
  12535. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12536. CYTHON_FALLTHROUGH;
  12537. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12538. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12539. break;
  12540. default: goto __pyx_L5_argtuple_error;
  12541. }
  12542. }
  12543. __pyx_v_nx_graph = values[0];
  12544. __pyx_v_graph_id = values[1];
  12545. __pyx_v_graph_name = values[2];
  12546. __pyx_v_graph_class = values[3];
  12547. }
  12548. goto __pyx_L4_argument_unpacking_done;
  12549. __pyx_L5_argtuple_error:;
  12550. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1289, __pyx_L3_error)
  12551. __pyx_L3_error:;
  12552. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12553. __Pyx_RefNannyFinishContext();
  12554. return NULL;
  12555. __pyx_L4_argument_unpacking_done:;
  12556. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_nx_graph, __pyx_v_graph_id, __pyx_v_graph_name, __pyx_v_graph_class);
  12557. /* function exit code */
  12558. __Pyx_RefNannyFinishContext();
  12559. return __pyx_r;
  12560. }
  12561. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_124load_nx_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_nx_graph, PyObject *__pyx_v_graph_id, PyObject *__pyx_v_graph_name, PyObject *__pyx_v_graph_class) {
  12562. PyObject *__pyx_v_node = NULL;
  12563. PyObject *__pyx_v_edge = NULL;
  12564. PyObject *__pyx_r = NULL;
  12565. __Pyx_RefNannyDeclarations
  12566. int __pyx_t_1;
  12567. int __pyx_t_2;
  12568. PyObject *__pyx_t_3 = NULL;
  12569. PyObject *__pyx_t_4 = NULL;
  12570. PyObject *__pyx_t_5 = NULL;
  12571. int __pyx_t_6;
  12572. PyObject *__pyx_t_7 = NULL;
  12573. Py_ssize_t __pyx_t_8;
  12574. PyObject *(*__pyx_t_9)(PyObject *);
  12575. PyObject *__pyx_t_10 = NULL;
  12576. PyObject *__pyx_t_11 = NULL;
  12577. PyObject *__pyx_t_12 = NULL;
  12578. PyObject *__pyx_t_13 = NULL;
  12579. PyObject *__pyx_t_14 = NULL;
  12580. PyObject *__pyx_t_15 = NULL;
  12581. PyObject *__pyx_t_16 = NULL;
  12582. __Pyx_RefNannySetupContext("load_nx_graph", 0);
  12583. __Pyx_INCREF(__pyx_v_graph_id);
  12584. /* "gedlibpy.pyx":1312
  12585. * The ID of the newly loaded graph.
  12586. * """
  12587. * if graph_id is None: # <<<<<<<<<<<<<<
  12588. * graph_id = self.add_graph(graph_name, graph_class)
  12589. * else:
  12590. */
  12591. __pyx_t_1 = (__pyx_v_graph_id == Py_None);
  12592. __pyx_t_2 = (__pyx_t_1 != 0);
  12593. if (__pyx_t_2) {
  12594. /* "gedlibpy.pyx":1313
  12595. * """
  12596. * if graph_id is None:
  12597. * graph_id = self.add_graph(graph_name, graph_class) # <<<<<<<<<<<<<<
  12598. * else:
  12599. * self.clear_graph(graph_id)
  12600. */
  12601. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1313, __pyx_L1_error)
  12602. __Pyx_GOTREF(__pyx_t_4);
  12603. __pyx_t_5 = NULL;
  12604. __pyx_t_6 = 0;
  12605. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  12606. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  12607. if (likely(__pyx_t_5)) {
  12608. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  12609. __Pyx_INCREF(__pyx_t_5);
  12610. __Pyx_INCREF(function);
  12611. __Pyx_DECREF_SET(__pyx_t_4, function);
  12612. __pyx_t_6 = 1;
  12613. }
  12614. }
  12615. #if CYTHON_FAST_PYCALL
  12616. if (PyFunction_Check(__pyx_t_4)) {
  12617. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  12618. __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error)
  12619. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  12620. __Pyx_GOTREF(__pyx_t_3);
  12621. } else
  12622. #endif
  12623. #if CYTHON_FAST_PYCCALL
  12624. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  12625. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  12626. __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error)
  12627. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  12628. __Pyx_GOTREF(__pyx_t_3);
  12629. } else
  12630. #endif
  12631. {
  12632. __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1313, __pyx_L1_error)
  12633. __Pyx_GOTREF(__pyx_t_7);
  12634. if (__pyx_t_5) {
  12635. __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  12636. }
  12637. __Pyx_INCREF(__pyx_v_graph_name);
  12638. __Pyx_GIVEREF(__pyx_v_graph_name);
  12639. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_graph_name);
  12640. __Pyx_INCREF(__pyx_v_graph_class);
  12641. __Pyx_GIVEREF(__pyx_v_graph_class);
  12642. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graph_class);
  12643. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1313, __pyx_L1_error)
  12644. __Pyx_GOTREF(__pyx_t_3);
  12645. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12646. }
  12647. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  12648. __Pyx_DECREF_SET(__pyx_v_graph_id, __pyx_t_3);
  12649. __pyx_t_3 = 0;
  12650. /* "gedlibpy.pyx":1312
  12651. * The ID of the newly loaded graph.
  12652. * """
  12653. * if graph_id is None: # <<<<<<<<<<<<<<
  12654. * graph_id = self.add_graph(graph_name, graph_class)
  12655. * else:
  12656. */
  12657. goto __pyx_L3;
  12658. }
  12659. /* "gedlibpy.pyx":1315
  12660. * graph_id = self.add_graph(graph_name, graph_class)
  12661. * else:
  12662. * self.clear_graph(graph_id) # <<<<<<<<<<<<<<
  12663. * for node in nx_graph.nodes:
  12664. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  12665. */
  12666. /*else*/ {
  12667. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1315, __pyx_L1_error)
  12668. __Pyx_GOTREF(__pyx_t_4);
  12669. __pyx_t_7 = NULL;
  12670. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  12671. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
  12672. if (likely(__pyx_t_7)) {
  12673. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  12674. __Pyx_INCREF(__pyx_t_7);
  12675. __Pyx_INCREF(function);
  12676. __Pyx_DECREF_SET(__pyx_t_4, function);
  12677. }
  12678. }
  12679. __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_7, __pyx_v_graph_id) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_graph_id);
  12680. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  12681. if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1315, __pyx_L1_error)
  12682. __Pyx_GOTREF(__pyx_t_3);
  12683. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  12684. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12685. }
  12686. __pyx_L3:;
  12687. /* "gedlibpy.pyx":1316
  12688. * else:
  12689. * self.clear_graph(graph_id)
  12690. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  12691. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  12692. * for edge in nx_graph.edges:
  12693. */
  12694. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12695. __Pyx_GOTREF(__pyx_t_3);
  12696. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  12697. __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
  12698. __pyx_t_9 = NULL;
  12699. } else {
  12700. __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12701. __Pyx_GOTREF(__pyx_t_4);
  12702. __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12703. }
  12704. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12705. for (;;) {
  12706. if (likely(!__pyx_t_9)) {
  12707. if (likely(PyList_CheckExact(__pyx_t_4))) {
  12708. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
  12709. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12710. __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12711. #else
  12712. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12713. __Pyx_GOTREF(__pyx_t_3);
  12714. #endif
  12715. } else {
  12716. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  12717. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12718. __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12719. #else
  12720. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1316, __pyx_L1_error)
  12721. __Pyx_GOTREF(__pyx_t_3);
  12722. #endif
  12723. }
  12724. } else {
  12725. __pyx_t_3 = __pyx_t_9(__pyx_t_4);
  12726. if (unlikely(!__pyx_t_3)) {
  12727. PyObject* exc_type = PyErr_Occurred();
  12728. if (exc_type) {
  12729. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12730. else __PYX_ERR(0, 1316, __pyx_L1_error)
  12731. }
  12732. break;
  12733. }
  12734. __Pyx_GOTREF(__pyx_t_3);
  12735. }
  12736. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
  12737. __pyx_t_3 = 0;
  12738. /* "gedlibpy.pyx":1317
  12739. * self.clear_graph(graph_id)
  12740. * for node in nx_graph.nodes:
  12741. * self.add_node(graph_id, str(node), nx_graph.nodes[node]) # <<<<<<<<<<<<<<
  12742. * for edge in nx_graph.edges:
  12743. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  12744. */
  12745. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12746. __Pyx_GOTREF(__pyx_t_7);
  12747. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12748. __Pyx_GOTREF(__pyx_t_5);
  12749. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12750. __Pyx_GOTREF(__pyx_t_10);
  12751. __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12752. __Pyx_GOTREF(__pyx_t_11);
  12753. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  12754. __pyx_t_10 = NULL;
  12755. __pyx_t_6 = 0;
  12756. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12757. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  12758. if (likely(__pyx_t_10)) {
  12759. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12760. __Pyx_INCREF(__pyx_t_10);
  12761. __Pyx_INCREF(function);
  12762. __Pyx_DECREF_SET(__pyx_t_7, function);
  12763. __pyx_t_6 = 1;
  12764. }
  12765. }
  12766. #if CYTHON_FAST_PYCALL
  12767. if (PyFunction_Check(__pyx_t_7)) {
  12768. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  12769. __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12770. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  12771. __Pyx_GOTREF(__pyx_t_3);
  12772. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12773. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12774. } else
  12775. #endif
  12776. #if CYTHON_FAST_PYCCALL
  12777. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  12778. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  12779. __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12780. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  12781. __Pyx_GOTREF(__pyx_t_3);
  12782. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12783. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12784. } else
  12785. #endif
  12786. {
  12787. __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12788. __Pyx_GOTREF(__pyx_t_12);
  12789. if (__pyx_t_10) {
  12790. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
  12791. }
  12792. __Pyx_INCREF(__pyx_v_graph_id);
  12793. __Pyx_GIVEREF(__pyx_v_graph_id);
  12794. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_graph_id);
  12795. __Pyx_GIVEREF(__pyx_t_5);
  12796. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_5);
  12797. __Pyx_GIVEREF(__pyx_t_11);
  12798. PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_6, __pyx_t_11);
  12799. __pyx_t_5 = 0;
  12800. __pyx_t_11 = 0;
  12801. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error)
  12802. __Pyx_GOTREF(__pyx_t_3);
  12803. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  12804. }
  12805. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12806. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12807. /* "gedlibpy.pyx":1316
  12808. * else:
  12809. * self.clear_graph(graph_id)
  12810. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  12811. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  12812. * for edge in nx_graph.edges:
  12813. */
  12814. }
  12815. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  12816. /* "gedlibpy.pyx":1318
  12817. * for node in nx_graph.nodes:
  12818. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  12819. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  12820. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  12821. * return graph_id
  12822. */
  12823. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12824. __Pyx_GOTREF(__pyx_t_4);
  12825. if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
  12826. __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
  12827. __pyx_t_9 = NULL;
  12828. } else {
  12829. __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12830. __Pyx_GOTREF(__pyx_t_3);
  12831. __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12832. }
  12833. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  12834. for (;;) {
  12835. if (likely(!__pyx_t_9)) {
  12836. if (likely(PyList_CheckExact(__pyx_t_3))) {
  12837. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
  12838. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12839. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12840. #else
  12841. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12842. __Pyx_GOTREF(__pyx_t_4);
  12843. #endif
  12844. } else {
  12845. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  12846. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12847. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12848. #else
  12849. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1318, __pyx_L1_error)
  12850. __Pyx_GOTREF(__pyx_t_4);
  12851. #endif
  12852. }
  12853. } else {
  12854. __pyx_t_4 = __pyx_t_9(__pyx_t_3);
  12855. if (unlikely(!__pyx_t_4)) {
  12856. PyObject* exc_type = PyErr_Occurred();
  12857. if (exc_type) {
  12858. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12859. else __PYX_ERR(0, 1318, __pyx_L1_error)
  12860. }
  12861. break;
  12862. }
  12863. __Pyx_GOTREF(__pyx_t_4);
  12864. }
  12865. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4);
  12866. __pyx_t_4 = 0;
  12867. /* "gedlibpy.pyx":1319
  12868. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  12869. * for edge in nx_graph.edges:
  12870. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) # <<<<<<<<<<<<<<
  12871. * return graph_id
  12872. *
  12873. */
  12874. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12875. __Pyx_GOTREF(__pyx_t_7);
  12876. __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12877. __Pyx_GOTREF(__pyx_t_12);
  12878. __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12879. __Pyx_GOTREF(__pyx_t_11);
  12880. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  12881. __pyx_t_12 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12882. __Pyx_GOTREF(__pyx_t_12);
  12883. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12884. __Pyx_GOTREF(__pyx_t_5);
  12885. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  12886. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12887. __Pyx_GOTREF(__pyx_t_10);
  12888. __pyx_t_13 = __Pyx_GetItemInt(__pyx_v_edge, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12889. __Pyx_GOTREF(__pyx_t_13);
  12890. __pyx_t_14 = __Pyx_GetItemInt(__pyx_v_edge, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12891. __Pyx_GOTREF(__pyx_t_14);
  12892. __pyx_t_15 = NULL;
  12893. __pyx_t_6 = 0;
  12894. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
  12895. __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
  12896. if (likely(__pyx_t_15)) {
  12897. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
  12898. __Pyx_INCREF(__pyx_t_15);
  12899. __Pyx_INCREF(function);
  12900. __Pyx_DECREF_SET(__pyx_t_10, function);
  12901. __pyx_t_6 = 1;
  12902. }
  12903. }
  12904. #if CYTHON_FAST_PYCALL
  12905. if (PyFunction_Check(__pyx_t_10)) {
  12906. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  12907. __pyx_t_12 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12908. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  12909. __Pyx_GOTREF(__pyx_t_12);
  12910. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  12911. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  12912. } else
  12913. #endif
  12914. #if CYTHON_FAST_PYCCALL
  12915. if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
  12916. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  12917. __pyx_t_12 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12918. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  12919. __Pyx_GOTREF(__pyx_t_12);
  12920. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  12921. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  12922. } else
  12923. #endif
  12924. {
  12925. __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12926. __Pyx_GOTREF(__pyx_t_16);
  12927. if (__pyx_t_15) {
  12928. __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
  12929. }
  12930. __Pyx_GIVEREF(__pyx_t_13);
  12931. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
  12932. __Pyx_GIVEREF(__pyx_t_14);
  12933. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_14);
  12934. __pyx_t_13 = 0;
  12935. __pyx_t_14 = 0;
  12936. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12937. __Pyx_GOTREF(__pyx_t_12);
  12938. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  12939. }
  12940. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  12941. __pyx_t_10 = NULL;
  12942. __pyx_t_6 = 0;
  12943. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12944. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  12945. if (likely(__pyx_t_10)) {
  12946. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12947. __Pyx_INCREF(__pyx_t_10);
  12948. __Pyx_INCREF(function);
  12949. __Pyx_DECREF_SET(__pyx_t_7, function);
  12950. __pyx_t_6 = 1;
  12951. }
  12952. }
  12953. #if CYTHON_FAST_PYCALL
  12954. if (PyFunction_Check(__pyx_t_7)) {
  12955. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  12956. __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12957. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  12958. __Pyx_GOTREF(__pyx_t_4);
  12959. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12960. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12961. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  12962. } else
  12963. #endif
  12964. #if CYTHON_FAST_PYCCALL
  12965. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  12966. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  12967. __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12968. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  12969. __Pyx_GOTREF(__pyx_t_4);
  12970. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12971. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12972. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  12973. } else
  12974. #endif
  12975. {
  12976. __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12977. __Pyx_GOTREF(__pyx_t_16);
  12978. if (__pyx_t_10) {
  12979. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
  12980. }
  12981. __Pyx_INCREF(__pyx_v_graph_id);
  12982. __Pyx_GIVEREF(__pyx_v_graph_id);
  12983. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_v_graph_id);
  12984. __Pyx_GIVEREF(__pyx_t_11);
  12985. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
  12986. __Pyx_GIVEREF(__pyx_t_5);
  12987. PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_6, __pyx_t_5);
  12988. __Pyx_GIVEREF(__pyx_t_12);
  12989. PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_6, __pyx_t_12);
  12990. __pyx_t_11 = 0;
  12991. __pyx_t_5 = 0;
  12992. __pyx_t_12 = 0;
  12993. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1319, __pyx_L1_error)
  12994. __Pyx_GOTREF(__pyx_t_4);
  12995. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  12996. }
  12997. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12998. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  12999. /* "gedlibpy.pyx":1318
  13000. * for node in nx_graph.nodes:
  13001. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13002. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13003. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13004. * return graph_id
  13005. */
  13006. }
  13007. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13008. /* "gedlibpy.pyx":1320
  13009. * for edge in nx_graph.edges:
  13010. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13011. * return graph_id # <<<<<<<<<<<<<<
  13012. *
  13013. *
  13014. */
  13015. __Pyx_XDECREF(__pyx_r);
  13016. __Pyx_INCREF(__pyx_v_graph_id);
  13017. __pyx_r = __pyx_v_graph_id;
  13018. goto __pyx_L0;
  13019. /* "gedlibpy.pyx":1289
  13020. *
  13021. *
  13022. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  13023. * """
  13024. * Loads NetworkX Graph into the GED environment.
  13025. */
  13026. /* function exit code */
  13027. __pyx_L1_error:;
  13028. __Pyx_XDECREF(__pyx_t_3);
  13029. __Pyx_XDECREF(__pyx_t_4);
  13030. __Pyx_XDECREF(__pyx_t_5);
  13031. __Pyx_XDECREF(__pyx_t_7);
  13032. __Pyx_XDECREF(__pyx_t_10);
  13033. __Pyx_XDECREF(__pyx_t_11);
  13034. __Pyx_XDECREF(__pyx_t_12);
  13035. __Pyx_XDECREF(__pyx_t_13);
  13036. __Pyx_XDECREF(__pyx_t_14);
  13037. __Pyx_XDECREF(__pyx_t_15);
  13038. __Pyx_XDECREF(__pyx_t_16);
  13039. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13040. __pyx_r = NULL;
  13041. __pyx_L0:;
  13042. __Pyx_XDECREF(__pyx_v_node);
  13043. __Pyx_XDECREF(__pyx_v_edge);
  13044. __Pyx_XDECREF(__pyx_v_graph_id);
  13045. __Pyx_XGIVEREF(__pyx_r);
  13046. __Pyx_RefNannyFinishContext();
  13047. return __pyx_r;
  13048. }
  13049. /* "gedlibpy.pyx":1323
  13050. *
  13051. *
  13052. * def compute_induced_cost(self, g_id, h_id): # <<<<<<<<<<<<<<
  13053. * """
  13054. * Computes the edit cost between two graphs induced by a node map.
  13055. */
  13056. /* Python wrapper */
  13057. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13058. static char __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost[] = "\n\t\tComputes the edit cost between two graphs induced by a node map.\n\n\t\tParameters\n\t\t----------\n\t\tg_id : int\n\t\t\tID of input graph.\n\t\th_id : int\n\t\t\tID of input graph.\n\n\t\tReturns\n\t\t-------\n\t\tNone.\n\t\t\n\t\tNotes\n\t\t-----\n\t\tThe induced edit cost of the node map between `g_id` and `h_id` is implictly computed and stored in `GEDEnv::node_maps_`.\n\n\t\t";
  13059. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13060. PyObject *__pyx_v_g_id = 0;
  13061. PyObject *__pyx_v_h_id = 0;
  13062. PyObject *__pyx_r = 0;
  13063. __Pyx_RefNannyDeclarations
  13064. __Pyx_RefNannySetupContext("compute_induced_cost (wrapper)", 0);
  13065. {
  13066. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,0};
  13067. PyObject* values[2] = {0,0};
  13068. if (unlikely(__pyx_kwds)) {
  13069. Py_ssize_t kw_args;
  13070. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13071. switch (pos_args) {
  13072. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13073. CYTHON_FALLTHROUGH;
  13074. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13075. CYTHON_FALLTHROUGH;
  13076. case 0: break;
  13077. default: goto __pyx_L5_argtuple_error;
  13078. }
  13079. kw_args = PyDict_Size(__pyx_kwds);
  13080. switch (pos_args) {
  13081. case 0:
  13082. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g_id)) != 0)) kw_args--;
  13083. else goto __pyx_L5_argtuple_error;
  13084. CYTHON_FALLTHROUGH;
  13085. case 1:
  13086. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h_id)) != 0)) kw_args--;
  13087. else {
  13088. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 1323, __pyx_L3_error)
  13089. }
  13090. }
  13091. if (unlikely(kw_args > 0)) {
  13092. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1323, __pyx_L3_error)
  13093. }
  13094. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13095. goto __pyx_L5_argtuple_error;
  13096. } else {
  13097. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13098. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13099. }
  13100. __pyx_v_g_id = values[0];
  13101. __pyx_v_h_id = values[1];
  13102. }
  13103. goto __pyx_L4_argument_unpacking_done;
  13104. __pyx_L5_argtuple_error:;
  13105. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1323, __pyx_L3_error)
  13106. __pyx_L3_error:;
  13107. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13108. __Pyx_RefNannyFinishContext();
  13109. return NULL;
  13110. __pyx_L4_argument_unpacking_done:;
  13111. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g_id, __pyx_v_h_id);
  13112. /* function exit code */
  13113. __Pyx_RefNannyFinishContext();
  13114. return __pyx_r;
  13115. }
  13116. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_126compute_induced_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g_id, PyObject *__pyx_v_h_id) {
  13117. CYTHON_UNUSED double __pyx_v_cost;
  13118. PyObject *__pyx_r = NULL;
  13119. __Pyx_RefNannyDeclarations
  13120. size_t __pyx_t_1;
  13121. size_t __pyx_t_2;
  13122. __Pyx_RefNannySetupContext("compute_induced_cost", 0);
  13123. /* "gedlibpy.pyx":1344
  13124. * """
  13125. *
  13126. * cost = 0.0 # <<<<<<<<<<<<<<
  13127. * self.c_env.computeInducedCost(g_id, h_id)
  13128. *
  13129. */
  13130. __pyx_v_cost = 0.0;
  13131. /* "gedlibpy.pyx":1345
  13132. *
  13133. * cost = 0.0
  13134. * self.c_env.computeInducedCost(g_id, h_id) # <<<<<<<<<<<<<<
  13135. *
  13136. *
  13137. */
  13138. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1345, __pyx_L1_error)
  13139. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h_id); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1345, __pyx_L1_error)
  13140. try {
  13141. __pyx_v_self->c_env->computeInducedCost(__pyx_t_1, __pyx_t_2);
  13142. } catch(...) {
  13143. __Pyx_CppExn2PyErr();
  13144. __PYX_ERR(0, 1345, __pyx_L1_error)
  13145. }
  13146. /* "gedlibpy.pyx":1323
  13147. *
  13148. *
  13149. * def compute_induced_cost(self, g_id, h_id): # <<<<<<<<<<<<<<
  13150. * """
  13151. * Computes the edit cost between two graphs induced by a node map.
  13152. */
  13153. /* function exit code */
  13154. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13155. goto __pyx_L0;
  13156. __pyx_L1_error:;
  13157. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13158. __pyx_r = NULL;
  13159. __pyx_L0:;
  13160. __Pyx_XGIVEREF(__pyx_r);
  13161. __Pyx_RefNannyFinishContext();
  13162. return __pyx_r;
  13163. }
  13164. /* "(tree fragment)":1
  13165. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13166. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13167. * def __setstate_cython__(self, __pyx_state):
  13168. */
  13169. /* Python wrapper */
  13170. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  13171. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  13172. PyObject *__pyx_r = 0;
  13173. __Pyx_RefNannyDeclarations
  13174. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  13175. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  13176. /* function exit code */
  13177. __Pyx_RefNannyFinishContext();
  13178. return __pyx_r;
  13179. }
  13180. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  13181. PyObject *__pyx_r = NULL;
  13182. __Pyx_RefNannyDeclarations
  13183. PyObject *__pyx_t_1 = NULL;
  13184. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  13185. /* "(tree fragment)":2
  13186. * def __reduce_cython__(self):
  13187. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13188. * def __setstate_cython__(self, __pyx_state):
  13189. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13190. */
  13191. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  13192. __Pyx_GOTREF(__pyx_t_1);
  13193. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13194. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13195. __PYX_ERR(1, 2, __pyx_L1_error)
  13196. /* "(tree fragment)":1
  13197. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13198. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13199. * def __setstate_cython__(self, __pyx_state):
  13200. */
  13201. /* function exit code */
  13202. __pyx_L1_error:;
  13203. __Pyx_XDECREF(__pyx_t_1);
  13204. __Pyx_AddTraceback("gedlibpy.GEDEnv.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13205. __pyx_r = NULL;
  13206. __Pyx_XGIVEREF(__pyx_r);
  13207. __Pyx_RefNannyFinishContext();
  13208. return __pyx_r;
  13209. }
  13210. /* "(tree fragment)":3
  13211. * def __reduce_cython__(self):
  13212. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13213. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13214. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13215. */
  13216. /* Python wrapper */
  13217. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  13218. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  13219. PyObject *__pyx_r = 0;
  13220. __Pyx_RefNannyDeclarations
  13221. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  13222. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  13223. /* function exit code */
  13224. __Pyx_RefNannyFinishContext();
  13225. return __pyx_r;
  13226. }
  13227. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  13228. PyObject *__pyx_r = NULL;
  13229. __Pyx_RefNannyDeclarations
  13230. PyObject *__pyx_t_1 = NULL;
  13231. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  13232. /* "(tree fragment)":4
  13233. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13234. * def __setstate_cython__(self, __pyx_state):
  13235. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13236. */
  13237. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  13238. __Pyx_GOTREF(__pyx_t_1);
  13239. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13240. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13241. __PYX_ERR(1, 4, __pyx_L1_error)
  13242. /* "(tree fragment)":3
  13243. * def __reduce_cython__(self):
  13244. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13245. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13246. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13247. */
  13248. /* function exit code */
  13249. __pyx_L1_error:;
  13250. __Pyx_XDECREF(__pyx_t_1);
  13251. __Pyx_AddTraceback("gedlibpy.GEDEnv.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13252. __pyx_r = NULL;
  13253. __Pyx_XGIVEREF(__pyx_r);
  13254. __Pyx_RefNannyFinishContext();
  13255. return __pyx_r;
  13256. }
  13257. /* "gedlibpy.pyx":1375
  13258. * :type message: string
  13259. * """
  13260. * def __init__(self, message): # <<<<<<<<<<<<<<
  13261. * """
  13262. * Inits the error with its message.
  13263. */
  13264. /* Python wrapper */
  13265. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13266. static char __pyx_doc_8gedlibpy_13EditCostError___init__[] = "\n\t\t\tInits the error with its message. \n\n\t\t\t:param message: The message to print when the error is detected\n\t\t\t:type message: string\n\t\t";
  13267. static PyMethodDef __pyx_mdef_8gedlibpy_13EditCostError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_13EditCostError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_13EditCostError___init__};
  13268. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13269. PyObject *__pyx_v_self = 0;
  13270. PyObject *__pyx_v_message = 0;
  13271. PyObject *__pyx_r = 0;
  13272. __Pyx_RefNannyDeclarations
  13273. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13274. {
  13275. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13276. PyObject* values[2] = {0,0};
  13277. if (unlikely(__pyx_kwds)) {
  13278. Py_ssize_t kw_args;
  13279. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13280. switch (pos_args) {
  13281. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13282. CYTHON_FALLTHROUGH;
  13283. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13284. CYTHON_FALLTHROUGH;
  13285. case 0: break;
  13286. default: goto __pyx_L5_argtuple_error;
  13287. }
  13288. kw_args = PyDict_Size(__pyx_kwds);
  13289. switch (pos_args) {
  13290. case 0:
  13291. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13292. else goto __pyx_L5_argtuple_error;
  13293. CYTHON_FALLTHROUGH;
  13294. case 1:
  13295. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13296. else {
  13297. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1375, __pyx_L3_error)
  13298. }
  13299. }
  13300. if (unlikely(kw_args > 0)) {
  13301. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1375, __pyx_L3_error)
  13302. }
  13303. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13304. goto __pyx_L5_argtuple_error;
  13305. } else {
  13306. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13307. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13308. }
  13309. __pyx_v_self = values[0];
  13310. __pyx_v_message = values[1];
  13311. }
  13312. goto __pyx_L4_argument_unpacking_done;
  13313. __pyx_L5_argtuple_error:;
  13314. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1375, __pyx_L3_error)
  13315. __pyx_L3_error:;
  13316. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13317. __Pyx_RefNannyFinishContext();
  13318. return NULL;
  13319. __pyx_L4_argument_unpacking_done:;
  13320. __pyx_r = __pyx_pf_8gedlibpy_13EditCostError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13321. /* function exit code */
  13322. __Pyx_RefNannyFinishContext();
  13323. return __pyx_r;
  13324. }
  13325. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13326. PyObject *__pyx_r = NULL;
  13327. __Pyx_RefNannyDeclarations
  13328. __Pyx_RefNannySetupContext("__init__", 0);
  13329. /* "gedlibpy.pyx":1382
  13330. * :type message: string
  13331. * """
  13332. * self.message = message # <<<<<<<<<<<<<<
  13333. *
  13334. *
  13335. */
  13336. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1382, __pyx_L1_error)
  13337. /* "gedlibpy.pyx":1375
  13338. * :type message: string
  13339. * """
  13340. * def __init__(self, message): # <<<<<<<<<<<<<<
  13341. * """
  13342. * Inits the error with its message.
  13343. */
  13344. /* function exit code */
  13345. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13346. goto __pyx_L0;
  13347. __pyx_L1_error:;
  13348. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13349. __pyx_r = NULL;
  13350. __pyx_L0:;
  13351. __Pyx_XGIVEREF(__pyx_r);
  13352. __Pyx_RefNannyFinishContext();
  13353. return __pyx_r;
  13354. }
  13355. /* "gedlibpy.pyx":1392
  13356. * :type message: string
  13357. * """
  13358. * def __init__(self, message): # <<<<<<<<<<<<<<
  13359. * """
  13360. * Inits the error with its message.
  13361. */
  13362. /* Python wrapper */
  13363. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13364. static char __pyx_doc_8gedlibpy_11MethodError___init__[] = "\n\t\t\tInits the error with its message. \n\n\t\t\t:param message: The message to print when the error is detected\n\t\t\t:type message: string\n\t\t";
  13365. static PyMethodDef __pyx_mdef_8gedlibpy_11MethodError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_11MethodError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_11MethodError___init__};
  13366. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13367. PyObject *__pyx_v_self = 0;
  13368. PyObject *__pyx_v_message = 0;
  13369. PyObject *__pyx_r = 0;
  13370. __Pyx_RefNannyDeclarations
  13371. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13372. {
  13373. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13374. PyObject* values[2] = {0,0};
  13375. if (unlikely(__pyx_kwds)) {
  13376. Py_ssize_t kw_args;
  13377. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13378. switch (pos_args) {
  13379. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13380. CYTHON_FALLTHROUGH;
  13381. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13382. CYTHON_FALLTHROUGH;
  13383. case 0: break;
  13384. default: goto __pyx_L5_argtuple_error;
  13385. }
  13386. kw_args = PyDict_Size(__pyx_kwds);
  13387. switch (pos_args) {
  13388. case 0:
  13389. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13390. else goto __pyx_L5_argtuple_error;
  13391. CYTHON_FALLTHROUGH;
  13392. case 1:
  13393. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13394. else {
  13395. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1392, __pyx_L3_error)
  13396. }
  13397. }
  13398. if (unlikely(kw_args > 0)) {
  13399. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1392, __pyx_L3_error)
  13400. }
  13401. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13402. goto __pyx_L5_argtuple_error;
  13403. } else {
  13404. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13405. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13406. }
  13407. __pyx_v_self = values[0];
  13408. __pyx_v_message = values[1];
  13409. }
  13410. goto __pyx_L4_argument_unpacking_done;
  13411. __pyx_L5_argtuple_error:;
  13412. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1392, __pyx_L3_error)
  13413. __pyx_L3_error:;
  13414. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13415. __Pyx_RefNannyFinishContext();
  13416. return NULL;
  13417. __pyx_L4_argument_unpacking_done:;
  13418. __pyx_r = __pyx_pf_8gedlibpy_11MethodError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13419. /* function exit code */
  13420. __Pyx_RefNannyFinishContext();
  13421. return __pyx_r;
  13422. }
  13423. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13424. PyObject *__pyx_r = NULL;
  13425. __Pyx_RefNannyDeclarations
  13426. __Pyx_RefNannySetupContext("__init__", 0);
  13427. /* "gedlibpy.pyx":1399
  13428. * :type message: string
  13429. * """
  13430. * self.message = message # <<<<<<<<<<<<<<
  13431. *
  13432. *
  13433. */
  13434. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1399, __pyx_L1_error)
  13435. /* "gedlibpy.pyx":1392
  13436. * :type message: string
  13437. * """
  13438. * def __init__(self, message): # <<<<<<<<<<<<<<
  13439. * """
  13440. * Inits the error with its message.
  13441. */
  13442. /* function exit code */
  13443. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13444. goto __pyx_L0;
  13445. __pyx_L1_error:;
  13446. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13447. __pyx_r = NULL;
  13448. __pyx_L0:;
  13449. __Pyx_XGIVEREF(__pyx_r);
  13450. __Pyx_RefNannyFinishContext();
  13451. return __pyx_r;
  13452. }
  13453. /* "gedlibpy.pyx":1409
  13454. * :type message: string
  13455. * """
  13456. * def __init__(self, message): # <<<<<<<<<<<<<<
  13457. * """
  13458. * Inits the error with its message.
  13459. */
  13460. /* Python wrapper */
  13461. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13462. static char __pyx_doc_8gedlibpy_9InitError___init__[] = "\n\t\t\tInits the error with its message. \n\n\t\t\t:param message: The message to print when the error is detected\n\t\t\t:type message: string\n\t\t";
  13463. static PyMethodDef __pyx_mdef_8gedlibpy_9InitError_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_9InitError_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_9InitError___init__};
  13464. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13465. PyObject *__pyx_v_self = 0;
  13466. PyObject *__pyx_v_message = 0;
  13467. PyObject *__pyx_r = 0;
  13468. __Pyx_RefNannyDeclarations
  13469. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13470. {
  13471. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13472. PyObject* values[2] = {0,0};
  13473. if (unlikely(__pyx_kwds)) {
  13474. Py_ssize_t kw_args;
  13475. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13476. switch (pos_args) {
  13477. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13478. CYTHON_FALLTHROUGH;
  13479. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13480. CYTHON_FALLTHROUGH;
  13481. case 0: break;
  13482. default: goto __pyx_L5_argtuple_error;
  13483. }
  13484. kw_args = PyDict_Size(__pyx_kwds);
  13485. switch (pos_args) {
  13486. case 0:
  13487. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13488. else goto __pyx_L5_argtuple_error;
  13489. CYTHON_FALLTHROUGH;
  13490. case 1:
  13491. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13492. else {
  13493. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1409, __pyx_L3_error)
  13494. }
  13495. }
  13496. if (unlikely(kw_args > 0)) {
  13497. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1409, __pyx_L3_error)
  13498. }
  13499. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13500. goto __pyx_L5_argtuple_error;
  13501. } else {
  13502. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13503. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13504. }
  13505. __pyx_v_self = values[0];
  13506. __pyx_v_message = values[1];
  13507. }
  13508. goto __pyx_L4_argument_unpacking_done;
  13509. __pyx_L5_argtuple_error:;
  13510. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1409, __pyx_L3_error)
  13511. __pyx_L3_error:;
  13512. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13513. __Pyx_RefNannyFinishContext();
  13514. return NULL;
  13515. __pyx_L4_argument_unpacking_done:;
  13516. __pyx_r = __pyx_pf_8gedlibpy_9InitError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13517. /* function exit code */
  13518. __Pyx_RefNannyFinishContext();
  13519. return __pyx_r;
  13520. }
  13521. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13522. PyObject *__pyx_r = NULL;
  13523. __Pyx_RefNannyDeclarations
  13524. __Pyx_RefNannySetupContext("__init__", 0);
  13525. /* "gedlibpy.pyx":1416
  13526. * :type message: string
  13527. * """
  13528. * self.message = message # <<<<<<<<<<<<<<
  13529. *
  13530. *
  13531. */
  13532. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1416, __pyx_L1_error)
  13533. /* "gedlibpy.pyx":1409
  13534. * :type message: string
  13535. * """
  13536. * def __init__(self, message): # <<<<<<<<<<<<<<
  13537. * """
  13538. * Inits the error with its message.
  13539. */
  13540. /* function exit code */
  13541. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13542. goto __pyx_L0;
  13543. __pyx_L1_error:;
  13544. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13545. __pyx_r = NULL;
  13546. __pyx_L0:;
  13547. __Pyx_XGIVEREF(__pyx_r);
  13548. __Pyx_RefNannyFinishContext();
  13549. return __pyx_r;
  13550. }
  13551. /* "gedlibpy.pyx":1423
  13552. * #########################################
  13553. *
  13554. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  13555. * """
  13556. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  13557. */
  13558. /* Python wrapper */
  13559. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u); /*proto*/
  13560. static char __pyx_doc_8gedlibpy_8encode_your_map[] = "\n\t\tEncodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.\n\n\t\t:param map_b: The map to encode\n\t\t:type map_b: dict{string : string}\n\t\t:return: The encoded map\n\t\t:rtype: dict{'b'string : 'b'string}\n\n\t\t.. note:: This function is used for type connection. \n\t\t\n\t";
  13561. static PyMethodDef __pyx_mdef_8gedlibpy_9encode_your_map = {"encode_your_map", (PyCFunction)__pyx_pw_8gedlibpy_9encode_your_map, METH_O, __pyx_doc_8gedlibpy_8encode_your_map};
  13562. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  13563. PyObject *__pyx_r = 0;
  13564. __Pyx_RefNannyDeclarations
  13565. __Pyx_RefNannySetupContext("encode_your_map (wrapper)", 0);
  13566. __pyx_r = __pyx_pf_8gedlibpy_8encode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_u));
  13567. /* function exit code */
  13568. __Pyx_RefNannyFinishContext();
  13569. return __pyx_r;
  13570. }
  13571. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  13572. PyObject *__pyx_v_res = NULL;
  13573. PyObject *__pyx_v_key = NULL;
  13574. PyObject *__pyx_v_value = NULL;
  13575. PyObject *__pyx_r = NULL;
  13576. __Pyx_RefNannyDeclarations
  13577. PyObject *__pyx_t_1 = NULL;
  13578. Py_ssize_t __pyx_t_2;
  13579. Py_ssize_t __pyx_t_3;
  13580. int __pyx_t_4;
  13581. PyObject *__pyx_t_5 = NULL;
  13582. PyObject *__pyx_t_6 = NULL;
  13583. int __pyx_t_7;
  13584. PyObject *__pyx_t_8 = NULL;
  13585. PyObject *__pyx_t_9 = NULL;
  13586. __Pyx_RefNannySetupContext("encode_your_map", 0);
  13587. /* "gedlibpy.pyx":1435
  13588. *
  13589. * """
  13590. * res = {} # <<<<<<<<<<<<<<
  13591. * for key, value in map_u.items():
  13592. * res[key.encode('utf-8')] = value.encode('utf-8')
  13593. */
  13594. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  13595. __Pyx_GOTREF(__pyx_t_1);
  13596. __pyx_v_res = ((PyObject*)__pyx_t_1);
  13597. __pyx_t_1 = 0;
  13598. /* "gedlibpy.pyx":1436
  13599. * """
  13600. * res = {}
  13601. * for key, value in map_u.items(): # <<<<<<<<<<<<<<
  13602. * res[key.encode('utf-8')] = value.encode('utf-8')
  13603. * return res
  13604. */
  13605. __pyx_t_2 = 0;
  13606. if (unlikely(__pyx_v_map_u == Py_None)) {
  13607. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  13608. __PYX_ERR(0, 1436, __pyx_L1_error)
  13609. }
  13610. __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_u, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1436, __pyx_L1_error)
  13611. __Pyx_GOTREF(__pyx_t_5);
  13612. __Pyx_XDECREF(__pyx_t_1);
  13613. __pyx_t_1 = __pyx_t_5;
  13614. __pyx_t_5 = 0;
  13615. while (1) {
  13616. __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
  13617. if (unlikely(__pyx_t_7 == 0)) break;
  13618. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1436, __pyx_L1_error)
  13619. __Pyx_GOTREF(__pyx_t_5);
  13620. __Pyx_GOTREF(__pyx_t_6);
  13621. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  13622. __pyx_t_5 = 0;
  13623. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  13624. __pyx_t_6 = 0;
  13625. /* "gedlibpy.pyx":1437
  13626. * res = {}
  13627. * for key, value in map_u.items():
  13628. * res[key.encode('utf-8')] = value.encode('utf-8') # <<<<<<<<<<<<<<
  13629. * return res
  13630. *
  13631. */
  13632. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error)
  13633. __Pyx_GOTREF(__pyx_t_5);
  13634. __pyx_t_8 = NULL;
  13635. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  13636. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  13637. if (likely(__pyx_t_8)) {
  13638. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  13639. __Pyx_INCREF(__pyx_t_8);
  13640. __Pyx_INCREF(function);
  13641. __Pyx_DECREF_SET(__pyx_t_5, function);
  13642. }
  13643. }
  13644. __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_utf_8);
  13645. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  13646. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1437, __pyx_L1_error)
  13647. __Pyx_GOTREF(__pyx_t_6);
  13648. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13649. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1437, __pyx_L1_error)
  13650. __Pyx_GOTREF(__pyx_t_8);
  13651. __pyx_t_9 = NULL;
  13652. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  13653. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  13654. if (likely(__pyx_t_9)) {
  13655. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  13656. __Pyx_INCREF(__pyx_t_9);
  13657. __Pyx_INCREF(function);
  13658. __Pyx_DECREF_SET(__pyx_t_8, function);
  13659. }
  13660. }
  13661. __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_u_utf_8);
  13662. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  13663. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1437, __pyx_L1_error)
  13664. __Pyx_GOTREF(__pyx_t_5);
  13665. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  13666. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1437, __pyx_L1_error)
  13667. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13668. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13669. }
  13670. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13671. /* "gedlibpy.pyx":1438
  13672. * for key, value in map_u.items():
  13673. * res[key.encode('utf-8')] = value.encode('utf-8')
  13674. * return res # <<<<<<<<<<<<<<
  13675. *
  13676. *
  13677. */
  13678. __Pyx_XDECREF(__pyx_r);
  13679. __Pyx_INCREF(__pyx_v_res);
  13680. __pyx_r = __pyx_v_res;
  13681. goto __pyx_L0;
  13682. /* "gedlibpy.pyx":1423
  13683. * #########################################
  13684. *
  13685. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  13686. * """
  13687. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  13688. */
  13689. /* function exit code */
  13690. __pyx_L1_error:;
  13691. __Pyx_XDECREF(__pyx_t_1);
  13692. __Pyx_XDECREF(__pyx_t_5);
  13693. __Pyx_XDECREF(__pyx_t_6);
  13694. __Pyx_XDECREF(__pyx_t_8);
  13695. __Pyx_XDECREF(__pyx_t_9);
  13696. __Pyx_AddTraceback("gedlibpy.encode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13697. __pyx_r = NULL;
  13698. __pyx_L0:;
  13699. __Pyx_XDECREF(__pyx_v_res);
  13700. __Pyx_XDECREF(__pyx_v_key);
  13701. __Pyx_XDECREF(__pyx_v_value);
  13702. __Pyx_XGIVEREF(__pyx_r);
  13703. __Pyx_RefNannyFinishContext();
  13704. return __pyx_r;
  13705. }
  13706. /* "gedlibpy.pyx":1441
  13707. *
  13708. *
  13709. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  13710. * """
  13711. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  13712. */
  13713. /* Python wrapper */
  13714. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b); /*proto*/
  13715. static char __pyx_doc_8gedlibpy_10decode_your_map[] = "\n\t\tDecodes utf-8 byte strings in `map` from C++ functions to Python unicode strings. \n\n\t\t:param map_b: The map to decode\n\t\t:type map_b: dict{'b'string : 'b'string}\n\t\t:return: The decoded map\n\t\t:rtype: dict{string : string}\n\n\t\t.. note:: This function is used for type connection. \n\t\t\n\t";
  13716. static PyMethodDef __pyx_mdef_8gedlibpy_11decode_your_map = {"decode_your_map", (PyCFunction)__pyx_pw_8gedlibpy_11decode_your_map, METH_O, __pyx_doc_8gedlibpy_10decode_your_map};
  13717. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  13718. PyObject *__pyx_r = 0;
  13719. __Pyx_RefNannyDeclarations
  13720. __Pyx_RefNannySetupContext("decode_your_map (wrapper)", 0);
  13721. __pyx_r = __pyx_pf_8gedlibpy_10decode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_b));
  13722. /* function exit code */
  13723. __Pyx_RefNannyFinishContext();
  13724. return __pyx_r;
  13725. }
  13726. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  13727. PyObject *__pyx_v_res = NULL;
  13728. PyObject *__pyx_v_key = NULL;
  13729. PyObject *__pyx_v_value = NULL;
  13730. PyObject *__pyx_r = NULL;
  13731. __Pyx_RefNannyDeclarations
  13732. PyObject *__pyx_t_1 = NULL;
  13733. Py_ssize_t __pyx_t_2;
  13734. Py_ssize_t __pyx_t_3;
  13735. int __pyx_t_4;
  13736. PyObject *__pyx_t_5 = NULL;
  13737. PyObject *__pyx_t_6 = NULL;
  13738. int __pyx_t_7;
  13739. PyObject *__pyx_t_8 = NULL;
  13740. PyObject *__pyx_t_9 = NULL;
  13741. __Pyx_RefNannySetupContext("decode_your_map", 0);
  13742. /* "gedlibpy.pyx":1453
  13743. *
  13744. * """
  13745. * res = {} # <<<<<<<<<<<<<<
  13746. * for key, value in map_b.items():
  13747. * res[key.decode('utf-8')] = value.decode('utf-8')
  13748. */
  13749. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1453, __pyx_L1_error)
  13750. __Pyx_GOTREF(__pyx_t_1);
  13751. __pyx_v_res = ((PyObject*)__pyx_t_1);
  13752. __pyx_t_1 = 0;
  13753. /* "gedlibpy.pyx":1454
  13754. * """
  13755. * res = {}
  13756. * for key, value in map_b.items(): # <<<<<<<<<<<<<<
  13757. * res[key.decode('utf-8')] = value.decode('utf-8')
  13758. * return res
  13759. */
  13760. __pyx_t_2 = 0;
  13761. if (unlikely(__pyx_v_map_b == Py_None)) {
  13762. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  13763. __PYX_ERR(0, 1454, __pyx_L1_error)
  13764. }
  13765. __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1454, __pyx_L1_error)
  13766. __Pyx_GOTREF(__pyx_t_5);
  13767. __Pyx_XDECREF(__pyx_t_1);
  13768. __pyx_t_1 = __pyx_t_5;
  13769. __pyx_t_5 = 0;
  13770. while (1) {
  13771. __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
  13772. if (unlikely(__pyx_t_7 == 0)) break;
  13773. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1454, __pyx_L1_error)
  13774. __Pyx_GOTREF(__pyx_t_5);
  13775. __Pyx_GOTREF(__pyx_t_6);
  13776. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  13777. __pyx_t_5 = 0;
  13778. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  13779. __pyx_t_6 = 0;
  13780. /* "gedlibpy.pyx":1455
  13781. * res = {}
  13782. * for key, value in map_b.items():
  13783. * res[key.decode('utf-8')] = value.decode('utf-8') # <<<<<<<<<<<<<<
  13784. * return res
  13785. *
  13786. */
  13787. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
  13788. __Pyx_GOTREF(__pyx_t_5);
  13789. __pyx_t_8 = NULL;
  13790. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  13791. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  13792. if (likely(__pyx_t_8)) {
  13793. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  13794. __Pyx_INCREF(__pyx_t_8);
  13795. __Pyx_INCREF(function);
  13796. __Pyx_DECREF_SET(__pyx_t_5, function);
  13797. }
  13798. }
  13799. __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_kp_u_utf_8);
  13800. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  13801. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1455, __pyx_L1_error)
  13802. __Pyx_GOTREF(__pyx_t_6);
  13803. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13804. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1455, __pyx_L1_error)
  13805. __Pyx_GOTREF(__pyx_t_8);
  13806. __pyx_t_9 = NULL;
  13807. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  13808. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  13809. if (likely(__pyx_t_9)) {
  13810. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  13811. __Pyx_INCREF(__pyx_t_9);
  13812. __Pyx_INCREF(function);
  13813. __Pyx_DECREF_SET(__pyx_t_8, function);
  13814. }
  13815. }
  13816. __pyx_t_5 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_kp_u_utf_8) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_kp_u_utf_8);
  13817. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  13818. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1455, __pyx_L1_error)
  13819. __Pyx_GOTREF(__pyx_t_5);
  13820. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  13821. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1455, __pyx_L1_error)
  13822. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13823. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13824. }
  13825. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13826. /* "gedlibpy.pyx":1456
  13827. * for key, value in map_b.items():
  13828. * res[key.decode('utf-8')] = value.decode('utf-8')
  13829. * return res # <<<<<<<<<<<<<<
  13830. *
  13831. *
  13832. */
  13833. __Pyx_XDECREF(__pyx_r);
  13834. __Pyx_INCREF(__pyx_v_res);
  13835. __pyx_r = __pyx_v_res;
  13836. goto __pyx_L0;
  13837. /* "gedlibpy.pyx":1441
  13838. *
  13839. *
  13840. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  13841. * """
  13842. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  13843. */
  13844. /* function exit code */
  13845. __pyx_L1_error:;
  13846. __Pyx_XDECREF(__pyx_t_1);
  13847. __Pyx_XDECREF(__pyx_t_5);
  13848. __Pyx_XDECREF(__pyx_t_6);
  13849. __Pyx_XDECREF(__pyx_t_8);
  13850. __Pyx_XDECREF(__pyx_t_9);
  13851. __Pyx_AddTraceback("gedlibpy.decode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13852. __pyx_r = NULL;
  13853. __pyx_L0:;
  13854. __Pyx_XDECREF(__pyx_v_res);
  13855. __Pyx_XDECREF(__pyx_v_key);
  13856. __Pyx_XDECREF(__pyx_v_value);
  13857. __Pyx_XGIVEREF(__pyx_r);
  13858. __Pyx_RefNannyFinishContext();
  13859. return __pyx_r;
  13860. }
  13861. /* "gedlibpy.pyx":1459
  13862. *
  13863. *
  13864. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  13865. * """
  13866. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  13867. */
  13868. /* Python wrapper */
  13869. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /*proto*/
  13870. static char __pyx_doc_8gedlibpy_12decode_graph_edges[] = "\n\tDecode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings. \n\n\tParameters\n\t----------\n\tmap_edge_b : dict{tuple(size_t, size_t) : dict{'b'string : 'b'string}}\n\t\tThe map to decode.\n\n\tReturns\n\t-------\n\tdict{tuple(size_t, size_t) : dict{string : string}}\n\t\tThe decoded map.\n\t\n\tNotes\n\t-----\n\tThis is a helper function for function `GEDEnv.get_graph_edges()`.\n\t";
  13871. static PyMethodDef __pyx_mdef_8gedlibpy_13decode_graph_edges = {"decode_graph_edges", (PyCFunction)__pyx_pw_8gedlibpy_13decode_graph_edges, METH_O, __pyx_doc_8gedlibpy_12decode_graph_edges};
  13872. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  13873. PyObject *__pyx_r = 0;
  13874. __Pyx_RefNannyDeclarations
  13875. __Pyx_RefNannySetupContext("decode_graph_edges (wrapper)", 0);
  13876. __pyx_r = __pyx_pf_8gedlibpy_12decode_graph_edges(__pyx_self, ((PyObject *)__pyx_v_map_edge_b));
  13877. /* function exit code */
  13878. __Pyx_RefNannyFinishContext();
  13879. return __pyx_r;
  13880. }
  13881. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  13882. PyObject *__pyx_v_map_edges = NULL;
  13883. PyObject *__pyx_v_key = NULL;
  13884. PyObject *__pyx_v_value = NULL;
  13885. PyObject *__pyx_r = NULL;
  13886. __Pyx_RefNannyDeclarations
  13887. PyObject *__pyx_t_1 = NULL;
  13888. Py_ssize_t __pyx_t_2;
  13889. Py_ssize_t __pyx_t_3;
  13890. int __pyx_t_4;
  13891. PyObject *__pyx_t_5 = NULL;
  13892. PyObject *__pyx_t_6 = NULL;
  13893. int __pyx_t_7;
  13894. PyObject *__pyx_t_8 = NULL;
  13895. __Pyx_RefNannySetupContext("decode_graph_edges", 0);
  13896. /* "gedlibpy.pyx":1477
  13897. * This is a helper function for function `GEDEnv.get_graph_edges()`.
  13898. * """
  13899. * map_edges = {} # <<<<<<<<<<<<<<
  13900. * for key, value in map_edge_b.items():
  13901. * map_edges[key] = decode_your_map(value)
  13902. */
  13903. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1477, __pyx_L1_error)
  13904. __Pyx_GOTREF(__pyx_t_1);
  13905. __pyx_v_map_edges = ((PyObject*)__pyx_t_1);
  13906. __pyx_t_1 = 0;
  13907. /* "gedlibpy.pyx":1478
  13908. * """
  13909. * map_edges = {}
  13910. * for key, value in map_edge_b.items(): # <<<<<<<<<<<<<<
  13911. * map_edges[key] = decode_your_map(value)
  13912. * return map_edges
  13913. */
  13914. __pyx_t_2 = 0;
  13915. if (unlikely(__pyx_v_map_edge_b == Py_None)) {
  13916. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  13917. __PYX_ERR(0, 1478, __pyx_L1_error)
  13918. }
  13919. __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_map_edge_b, 0, __pyx_n_s_items, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1478, __pyx_L1_error)
  13920. __Pyx_GOTREF(__pyx_t_5);
  13921. __Pyx_XDECREF(__pyx_t_1);
  13922. __pyx_t_1 = __pyx_t_5;
  13923. __pyx_t_5 = 0;
  13924. while (1) {
  13925. __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
  13926. if (unlikely(__pyx_t_7 == 0)) break;
  13927. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1478, __pyx_L1_error)
  13928. __Pyx_GOTREF(__pyx_t_5);
  13929. __Pyx_GOTREF(__pyx_t_6);
  13930. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  13931. __pyx_t_5 = 0;
  13932. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  13933. __pyx_t_6 = 0;
  13934. /* "gedlibpy.pyx":1479
  13935. * map_edges = {}
  13936. * for key, value in map_edge_b.items():
  13937. * map_edges[key] = decode_your_map(value) # <<<<<<<<<<<<<<
  13938. * return map_edges
  13939. *
  13940. */
  13941. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1479, __pyx_L1_error)
  13942. __Pyx_GOTREF(__pyx_t_5);
  13943. __pyx_t_8 = NULL;
  13944. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
  13945. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  13946. if (likely(__pyx_t_8)) {
  13947. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  13948. __Pyx_INCREF(__pyx_t_8);
  13949. __Pyx_INCREF(function);
  13950. __Pyx_DECREF_SET(__pyx_t_5, function);
  13951. }
  13952. }
  13953. __pyx_t_6 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_8, __pyx_v_value) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_value);
  13954. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  13955. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1479, __pyx_L1_error)
  13956. __Pyx_GOTREF(__pyx_t_6);
  13957. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13958. if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1479, __pyx_L1_error)
  13959. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13960. }
  13961. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13962. /* "gedlibpy.pyx":1480
  13963. * for key, value in map_edge_b.items():
  13964. * map_edges[key] = decode_your_map(value)
  13965. * return map_edges # <<<<<<<<<<<<<<
  13966. *
  13967. *
  13968. */
  13969. __Pyx_XDECREF(__pyx_r);
  13970. __Pyx_INCREF(__pyx_v_map_edges);
  13971. __pyx_r = __pyx_v_map_edges;
  13972. goto __pyx_L0;
  13973. /* "gedlibpy.pyx":1459
  13974. *
  13975. *
  13976. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  13977. * """
  13978. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  13979. */
  13980. /* function exit code */
  13981. __pyx_L1_error:;
  13982. __Pyx_XDECREF(__pyx_t_1);
  13983. __Pyx_XDECREF(__pyx_t_5);
  13984. __Pyx_XDECREF(__pyx_t_6);
  13985. __Pyx_XDECREF(__pyx_t_8);
  13986. __Pyx_AddTraceback("gedlibpy.decode_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13987. __pyx_r = NULL;
  13988. __pyx_L0:;
  13989. __Pyx_XDECREF(__pyx_v_map_edges);
  13990. __Pyx_XDECREF(__pyx_v_key);
  13991. __Pyx_XDECREF(__pyx_v_value);
  13992. __Pyx_XGIVEREF(__pyx_r);
  13993. __Pyx_RefNannyFinishContext();
  13994. return __pyx_r;
  13995. }
  13996. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  13997. * # experimental exception made for __getbuffer__ and __releasebuffer__
  13998. * # -- the details of this may change.
  13999. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  14000. * # This implementation of getbuffer is geared towards Cython
  14001. * # requirements, and does not yet fulfill the PEP.
  14002. */
  14003. /* Python wrapper */
  14004. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  14005. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14006. int __pyx_r;
  14007. __Pyx_RefNannyDeclarations
  14008. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  14009. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  14010. /* function exit code */
  14011. __Pyx_RefNannyFinishContext();
  14012. return __pyx_r;
  14013. }
  14014. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14015. int __pyx_v_i;
  14016. int __pyx_v_ndim;
  14017. int __pyx_v_endian_detector;
  14018. int __pyx_v_little_endian;
  14019. int __pyx_v_t;
  14020. char *__pyx_v_f;
  14021. PyArray_Descr *__pyx_v_descr = 0;
  14022. int __pyx_v_offset;
  14023. int __pyx_r;
  14024. __Pyx_RefNannyDeclarations
  14025. int __pyx_t_1;
  14026. int __pyx_t_2;
  14027. PyObject *__pyx_t_3 = NULL;
  14028. int __pyx_t_4;
  14029. int __pyx_t_5;
  14030. int __pyx_t_6;
  14031. PyArray_Descr *__pyx_t_7;
  14032. PyObject *__pyx_t_8 = NULL;
  14033. char *__pyx_t_9;
  14034. if (__pyx_v_info == NULL) {
  14035. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  14036. return -1;
  14037. }
  14038. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  14039. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  14040. __Pyx_GIVEREF(__pyx_v_info->obj);
  14041. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
  14042. *
  14043. * cdef int i, ndim
  14044. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  14045. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14046. *
  14047. */
  14048. __pyx_v_endian_detector = 1;
  14049. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
  14050. * cdef int i, ndim
  14051. * cdef int endian_detector = 1
  14052. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  14053. *
  14054. * ndim = PyArray_NDIM(self)
  14055. */
  14056. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  14057. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
  14058. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14059. *
  14060. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  14061. *
  14062. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14063. */
  14064. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  14065. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14066. * ndim = PyArray_NDIM(self)
  14067. *
  14068. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14069. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14070. * raise ValueError(u"ndarray is not C contiguous")
  14071. */
  14072. __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  14073. if (__pyx_t_2) {
  14074. } else {
  14075. __pyx_t_1 = __pyx_t_2;
  14076. goto __pyx_L4_bool_binop_done;
  14077. }
  14078. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
  14079. *
  14080. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14081. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14082. * raise ValueError(u"ndarray is not C contiguous")
  14083. *
  14084. */
  14085. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  14086. __pyx_t_1 = __pyx_t_2;
  14087. __pyx_L4_bool_binop_done:;
  14088. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14089. * ndim = PyArray_NDIM(self)
  14090. *
  14091. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14092. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14093. * raise ValueError(u"ndarray is not C contiguous")
  14094. */
  14095. if (unlikely(__pyx_t_1)) {
  14096. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  14097. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14098. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14099. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  14100. *
  14101. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14102. */
  14103. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 272, __pyx_L1_error)
  14104. __Pyx_GOTREF(__pyx_t_3);
  14105. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14106. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14107. __PYX_ERR(2, 272, __pyx_L1_error)
  14108. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14109. * ndim = PyArray_NDIM(self)
  14110. *
  14111. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14112. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14113. * raise ValueError(u"ndarray is not C contiguous")
  14114. */
  14115. }
  14116. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14117. * raise ValueError(u"ndarray is not C contiguous")
  14118. *
  14119. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14120. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14121. * raise ValueError(u"ndarray is not Fortran contiguous")
  14122. */
  14123. __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  14124. if (__pyx_t_2) {
  14125. } else {
  14126. __pyx_t_1 = __pyx_t_2;
  14127. goto __pyx_L7_bool_binop_done;
  14128. }
  14129. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
  14130. *
  14131. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14132. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14133. * raise ValueError(u"ndarray is not Fortran contiguous")
  14134. *
  14135. */
  14136. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  14137. __pyx_t_1 = __pyx_t_2;
  14138. __pyx_L7_bool_binop_done:;
  14139. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14140. * raise ValueError(u"ndarray is not C contiguous")
  14141. *
  14142. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14143. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14144. * raise ValueError(u"ndarray is not Fortran contiguous")
  14145. */
  14146. if (unlikely(__pyx_t_1)) {
  14147. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  14148. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14149. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14150. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  14151. *
  14152. * info.buf = PyArray_DATA(self)
  14153. */
  14154. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 276, __pyx_L1_error)
  14155. __Pyx_GOTREF(__pyx_t_3);
  14156. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14157. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14158. __PYX_ERR(2, 276, __pyx_L1_error)
  14159. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14160. * raise ValueError(u"ndarray is not C contiguous")
  14161. *
  14162. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14163. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14164. * raise ValueError(u"ndarray is not Fortran contiguous")
  14165. */
  14166. }
  14167. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
  14168. * raise ValueError(u"ndarray is not Fortran contiguous")
  14169. *
  14170. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  14171. * info.ndim = ndim
  14172. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14173. */
  14174. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  14175. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
  14176. *
  14177. * info.buf = PyArray_DATA(self)
  14178. * info.ndim = ndim # <<<<<<<<<<<<<<
  14179. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14180. * # Allocate new buffer for strides and shape info.
  14181. */
  14182. __pyx_v_info->ndim = __pyx_v_ndim;
  14183. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14184. * info.buf = PyArray_DATA(self)
  14185. * info.ndim = ndim
  14186. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14187. * # Allocate new buffer for strides and shape info.
  14188. * # This is allocated as one block, strides first.
  14189. */
  14190. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  14191. if (__pyx_t_1) {
  14192. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
  14193. * # Allocate new buffer for strides and shape info.
  14194. * # This is allocated as one block, strides first.
  14195. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
  14196. * info.shape = info.strides + ndim
  14197. * for i in range(ndim):
  14198. */
  14199. __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
  14200. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
  14201. * # This is allocated as one block, strides first.
  14202. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14203. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  14204. * for i in range(ndim):
  14205. * info.strides[i] = PyArray_STRIDES(self)[i]
  14206. */
  14207. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  14208. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
  14209. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14210. * info.shape = info.strides + ndim
  14211. * for i in range(ndim): # <<<<<<<<<<<<<<
  14212. * info.strides[i] = PyArray_STRIDES(self)[i]
  14213. * info.shape[i] = PyArray_DIMS(self)[i]
  14214. */
  14215. __pyx_t_4 = __pyx_v_ndim;
  14216. __pyx_t_5 = __pyx_t_4;
  14217. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  14218. __pyx_v_i = __pyx_t_6;
  14219. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
  14220. * info.shape = info.strides + ndim
  14221. * for i in range(ndim):
  14222. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  14223. * info.shape[i] = PyArray_DIMS(self)[i]
  14224. * else:
  14225. */
  14226. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  14227. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
  14228. * for i in range(ndim):
  14229. * info.strides[i] = PyArray_STRIDES(self)[i]
  14230. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  14231. * else:
  14232. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14233. */
  14234. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  14235. }
  14236. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14237. * info.buf = PyArray_DATA(self)
  14238. * info.ndim = ndim
  14239. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14240. * # Allocate new buffer for strides and shape info.
  14241. * # This is allocated as one block, strides first.
  14242. */
  14243. goto __pyx_L9;
  14244. }
  14245. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
  14246. * info.shape[i] = PyArray_DIMS(self)[i]
  14247. * else:
  14248. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  14249. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14250. * info.suboffsets = NULL
  14251. */
  14252. /*else*/ {
  14253. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  14254. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
  14255. * else:
  14256. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14257. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  14258. * info.suboffsets = NULL
  14259. * info.itemsize = PyArray_ITEMSIZE(self)
  14260. */
  14261. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  14262. }
  14263. __pyx_L9:;
  14264. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
  14265. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14266. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14267. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  14268. * info.itemsize = PyArray_ITEMSIZE(self)
  14269. * info.readonly = not PyArray_ISWRITEABLE(self)
  14270. */
  14271. __pyx_v_info->suboffsets = NULL;
  14272. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
  14273. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14274. * info.suboffsets = NULL
  14275. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  14276. * info.readonly = not PyArray_ISWRITEABLE(self)
  14277. *
  14278. */
  14279. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  14280. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
  14281. * info.suboffsets = NULL
  14282. * info.itemsize = PyArray_ITEMSIZE(self)
  14283. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  14284. *
  14285. * cdef int t
  14286. */
  14287. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  14288. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
  14289. *
  14290. * cdef int t
  14291. * cdef char* f = NULL # <<<<<<<<<<<<<<
  14292. * cdef dtype descr = <dtype>PyArray_DESCR(self)
  14293. * cdef int offset
  14294. */
  14295. __pyx_v_f = NULL;
  14296. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
  14297. * cdef int t
  14298. * cdef char* f = NULL
  14299. * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
  14300. * cdef int offset
  14301. *
  14302. */
  14303. __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  14304. __pyx_t_3 = ((PyObject *)__pyx_t_7);
  14305. __Pyx_INCREF(__pyx_t_3);
  14306. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  14307. __pyx_t_3 = 0;
  14308. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
  14309. * cdef int offset
  14310. *
  14311. * info.obj = self # <<<<<<<<<<<<<<
  14312. *
  14313. * if not PyDataType_HASFIELDS(descr):
  14314. */
  14315. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  14316. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  14317. __Pyx_GOTREF(__pyx_v_info->obj);
  14318. __Pyx_DECREF(__pyx_v_info->obj);
  14319. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  14320. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  14321. * info.obj = self
  14322. *
  14323. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  14324. * t = descr.type_num
  14325. * if ((descr.byteorder == c'>' and little_endian) or
  14326. */
  14327. __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  14328. if (__pyx_t_1) {
  14329. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
  14330. *
  14331. * if not PyDataType_HASFIELDS(descr):
  14332. * t = descr.type_num # <<<<<<<<<<<<<<
  14333. * if ((descr.byteorder == c'>' and little_endian) or
  14334. * (descr.byteorder == c'<' and not little_endian)):
  14335. */
  14336. __pyx_t_4 = __pyx_v_descr->type_num;
  14337. __pyx_v_t = __pyx_t_4;
  14338. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14339. * if not PyDataType_HASFIELDS(descr):
  14340. * t = descr.type_num
  14341. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14342. * (descr.byteorder == c'<' and not little_endian)):
  14343. * raise ValueError(u"Non-native byte order not supported")
  14344. */
  14345. __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
  14346. if (!__pyx_t_2) {
  14347. goto __pyx_L15_next_or;
  14348. } else {
  14349. }
  14350. __pyx_t_2 = (__pyx_v_little_endian != 0);
  14351. if (!__pyx_t_2) {
  14352. } else {
  14353. __pyx_t_1 = __pyx_t_2;
  14354. goto __pyx_L14_bool_binop_done;
  14355. }
  14356. __pyx_L15_next_or:;
  14357. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
  14358. * t = descr.type_num
  14359. * if ((descr.byteorder == c'>' and little_endian) or
  14360. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  14361. * raise ValueError(u"Non-native byte order not supported")
  14362. * if t == NPY_BYTE: f = "b"
  14363. */
  14364. __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
  14365. if (__pyx_t_2) {
  14366. } else {
  14367. __pyx_t_1 = __pyx_t_2;
  14368. goto __pyx_L14_bool_binop_done;
  14369. }
  14370. __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
  14371. __pyx_t_1 = __pyx_t_2;
  14372. __pyx_L14_bool_binop_done:;
  14373. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14374. * if not PyDataType_HASFIELDS(descr):
  14375. * t = descr.type_num
  14376. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14377. * (descr.byteorder == c'<' and not little_endian)):
  14378. * raise ValueError(u"Non-native byte order not supported")
  14379. */
  14380. if (unlikely(__pyx_t_1)) {
  14381. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  14382. * if ((descr.byteorder == c'>' and little_endian) or
  14383. * (descr.byteorder == c'<' and not little_endian)):
  14384. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  14385. * if t == NPY_BYTE: f = "b"
  14386. * elif t == NPY_UBYTE: f = "B"
  14387. */
  14388. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 306, __pyx_L1_error)
  14389. __Pyx_GOTREF(__pyx_t_3);
  14390. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14391. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14392. __PYX_ERR(2, 306, __pyx_L1_error)
  14393. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  14394. * if not PyDataType_HASFIELDS(descr):
  14395. * t = descr.type_num
  14396. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  14397. * (descr.byteorder == c'<' and not little_endian)):
  14398. * raise ValueError(u"Non-native byte order not supported")
  14399. */
  14400. }
  14401. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
  14402. * (descr.byteorder == c'<' and not little_endian)):
  14403. * raise ValueError(u"Non-native byte order not supported")
  14404. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  14405. * elif t == NPY_UBYTE: f = "B"
  14406. * elif t == NPY_SHORT: f = "h"
  14407. */
  14408. switch (__pyx_v_t) {
  14409. case NPY_BYTE:
  14410. __pyx_v_f = ((char *)"b");
  14411. break;
  14412. case NPY_UBYTE:
  14413. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
  14414. * raise ValueError(u"Non-native byte order not supported")
  14415. * if t == NPY_BYTE: f = "b"
  14416. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  14417. * elif t == NPY_SHORT: f = "h"
  14418. * elif t == NPY_USHORT: f = "H"
  14419. */
  14420. __pyx_v_f = ((char *)"B");
  14421. break;
  14422. case NPY_SHORT:
  14423. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
  14424. * if t == NPY_BYTE: f = "b"
  14425. * elif t == NPY_UBYTE: f = "B"
  14426. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  14427. * elif t == NPY_USHORT: f = "H"
  14428. * elif t == NPY_INT: f = "i"
  14429. */
  14430. __pyx_v_f = ((char *)"h");
  14431. break;
  14432. case NPY_USHORT:
  14433. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
  14434. * elif t == NPY_UBYTE: f = "B"
  14435. * elif t == NPY_SHORT: f = "h"
  14436. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  14437. * elif t == NPY_INT: f = "i"
  14438. * elif t == NPY_UINT: f = "I"
  14439. */
  14440. __pyx_v_f = ((char *)"H");
  14441. break;
  14442. case NPY_INT:
  14443. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
  14444. * elif t == NPY_SHORT: f = "h"
  14445. * elif t == NPY_USHORT: f = "H"
  14446. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  14447. * elif t == NPY_UINT: f = "I"
  14448. * elif t == NPY_LONG: f = "l"
  14449. */
  14450. __pyx_v_f = ((char *)"i");
  14451. break;
  14452. case NPY_UINT:
  14453. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
  14454. * elif t == NPY_USHORT: f = "H"
  14455. * elif t == NPY_INT: f = "i"
  14456. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  14457. * elif t == NPY_LONG: f = "l"
  14458. * elif t == NPY_ULONG: f = "L"
  14459. */
  14460. __pyx_v_f = ((char *)"I");
  14461. break;
  14462. case NPY_LONG:
  14463. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
  14464. * elif t == NPY_INT: f = "i"
  14465. * elif t == NPY_UINT: f = "I"
  14466. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  14467. * elif t == NPY_ULONG: f = "L"
  14468. * elif t == NPY_LONGLONG: f = "q"
  14469. */
  14470. __pyx_v_f = ((char *)"l");
  14471. break;
  14472. case NPY_ULONG:
  14473. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
  14474. * elif t == NPY_UINT: f = "I"
  14475. * elif t == NPY_LONG: f = "l"
  14476. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  14477. * elif t == NPY_LONGLONG: f = "q"
  14478. * elif t == NPY_ULONGLONG: f = "Q"
  14479. */
  14480. __pyx_v_f = ((char *)"L");
  14481. break;
  14482. case NPY_LONGLONG:
  14483. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
  14484. * elif t == NPY_LONG: f = "l"
  14485. * elif t == NPY_ULONG: f = "L"
  14486. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  14487. * elif t == NPY_ULONGLONG: f = "Q"
  14488. * elif t == NPY_FLOAT: f = "f"
  14489. */
  14490. __pyx_v_f = ((char *)"q");
  14491. break;
  14492. case NPY_ULONGLONG:
  14493. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
  14494. * elif t == NPY_ULONG: f = "L"
  14495. * elif t == NPY_LONGLONG: f = "q"
  14496. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  14497. * elif t == NPY_FLOAT: f = "f"
  14498. * elif t == NPY_DOUBLE: f = "d"
  14499. */
  14500. __pyx_v_f = ((char *)"Q");
  14501. break;
  14502. case NPY_FLOAT:
  14503. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
  14504. * elif t == NPY_LONGLONG: f = "q"
  14505. * elif t == NPY_ULONGLONG: f = "Q"
  14506. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  14507. * elif t == NPY_DOUBLE: f = "d"
  14508. * elif t == NPY_LONGDOUBLE: f = "g"
  14509. */
  14510. __pyx_v_f = ((char *)"f");
  14511. break;
  14512. case NPY_DOUBLE:
  14513. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
  14514. * elif t == NPY_ULONGLONG: f = "Q"
  14515. * elif t == NPY_FLOAT: f = "f"
  14516. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  14517. * elif t == NPY_LONGDOUBLE: f = "g"
  14518. * elif t == NPY_CFLOAT: f = "Zf"
  14519. */
  14520. __pyx_v_f = ((char *)"d");
  14521. break;
  14522. case NPY_LONGDOUBLE:
  14523. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
  14524. * elif t == NPY_FLOAT: f = "f"
  14525. * elif t == NPY_DOUBLE: f = "d"
  14526. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  14527. * elif t == NPY_CFLOAT: f = "Zf"
  14528. * elif t == NPY_CDOUBLE: f = "Zd"
  14529. */
  14530. __pyx_v_f = ((char *)"g");
  14531. break;
  14532. case NPY_CFLOAT:
  14533. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
  14534. * elif t == NPY_DOUBLE: f = "d"
  14535. * elif t == NPY_LONGDOUBLE: f = "g"
  14536. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  14537. * elif t == NPY_CDOUBLE: f = "Zd"
  14538. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  14539. */
  14540. __pyx_v_f = ((char *)"Zf");
  14541. break;
  14542. case NPY_CDOUBLE:
  14543. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
  14544. * elif t == NPY_LONGDOUBLE: f = "g"
  14545. * elif t == NPY_CFLOAT: f = "Zf"
  14546. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  14547. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  14548. * elif t == NPY_OBJECT: f = "O"
  14549. */
  14550. __pyx_v_f = ((char *)"Zd");
  14551. break;
  14552. case NPY_CLONGDOUBLE:
  14553. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
  14554. * elif t == NPY_CFLOAT: f = "Zf"
  14555. * elif t == NPY_CDOUBLE: f = "Zd"
  14556. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  14557. * elif t == NPY_OBJECT: f = "O"
  14558. * else:
  14559. */
  14560. __pyx_v_f = ((char *)"Zg");
  14561. break;
  14562. case NPY_OBJECT:
  14563. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
  14564. * elif t == NPY_CDOUBLE: f = "Zd"
  14565. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  14566. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  14567. * else:
  14568. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  14569. */
  14570. __pyx_v_f = ((char *)"O");
  14571. break;
  14572. default:
  14573. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
  14574. * elif t == NPY_OBJECT: f = "O"
  14575. * else:
  14576. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  14577. * info.format = f
  14578. * return
  14579. */
  14580. __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  14581. __Pyx_GOTREF(__pyx_t_3);
  14582. __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 325, __pyx_L1_error)
  14583. __Pyx_GOTREF(__pyx_t_8);
  14584. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14585. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  14586. __Pyx_GOTREF(__pyx_t_3);
  14587. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14588. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14589. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14590. __PYX_ERR(2, 325, __pyx_L1_error)
  14591. break;
  14592. }
  14593. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
  14594. * else:
  14595. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  14596. * info.format = f # <<<<<<<<<<<<<<
  14597. * return
  14598. * else:
  14599. */
  14600. __pyx_v_info->format = __pyx_v_f;
  14601. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
  14602. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  14603. * info.format = f
  14604. * return # <<<<<<<<<<<<<<
  14605. * else:
  14606. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  14607. */
  14608. __pyx_r = 0;
  14609. goto __pyx_L0;
  14610. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  14611. * info.obj = self
  14612. *
  14613. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  14614. * t = descr.type_num
  14615. * if ((descr.byteorder == c'>' and little_endian) or
  14616. */
  14617. }
  14618. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
  14619. * return
  14620. * else:
  14621. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  14622. * info.format[0] = c'^' # Native data types, manual alignment
  14623. * offset = 0
  14624. */
  14625. /*else*/ {
  14626. __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
  14627. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
  14628. * else:
  14629. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  14630. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  14631. * offset = 0
  14632. * f = _util_dtypestring(descr, info.format + 1,
  14633. */
  14634. (__pyx_v_info->format[0]) = '^';
  14635. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
  14636. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  14637. * info.format[0] = c'^' # Native data types, manual alignment
  14638. * offset = 0 # <<<<<<<<<<<<<<
  14639. * f = _util_dtypestring(descr, info.format + 1,
  14640. * info.format + _buffer_format_string_len,
  14641. */
  14642. __pyx_v_offset = 0;
  14643. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
  14644. * info.format[0] = c'^' # Native data types, manual alignment
  14645. * offset = 0
  14646. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  14647. * info.format + _buffer_format_string_len,
  14648. * &offset)
  14649. */
  14650. __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 332, __pyx_L1_error)
  14651. __pyx_v_f = __pyx_t_9;
  14652. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
  14653. * info.format + _buffer_format_string_len,
  14654. * &offset)
  14655. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  14656. *
  14657. * def __releasebuffer__(ndarray self, Py_buffer* info):
  14658. */
  14659. (__pyx_v_f[0]) = '\x00';
  14660. }
  14661. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  14662. * # experimental exception made for __getbuffer__ and __releasebuffer__
  14663. * # -- the details of this may change.
  14664. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  14665. * # This implementation of getbuffer is geared towards Cython
  14666. * # requirements, and does not yet fulfill the PEP.
  14667. */
  14668. /* function exit code */
  14669. __pyx_r = 0;
  14670. goto __pyx_L0;
  14671. __pyx_L1_error:;
  14672. __Pyx_XDECREF(__pyx_t_3);
  14673. __Pyx_XDECREF(__pyx_t_8);
  14674. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14675. __pyx_r = -1;
  14676. if (__pyx_v_info->obj != NULL) {
  14677. __Pyx_GOTREF(__pyx_v_info->obj);
  14678. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  14679. }
  14680. goto __pyx_L2;
  14681. __pyx_L0:;
  14682. if (__pyx_v_info->obj == Py_None) {
  14683. __Pyx_GOTREF(__pyx_v_info->obj);
  14684. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  14685. }
  14686. __pyx_L2:;
  14687. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  14688. __Pyx_RefNannyFinishContext();
  14689. return __pyx_r;
  14690. }
  14691. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  14692. * f[0] = c'\0' # Terminate format string
  14693. *
  14694. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  14695. * if PyArray_HASFIELDS(self):
  14696. * PyObject_Free(info.format)
  14697. */
  14698. /* Python wrapper */
  14699. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  14700. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  14701. __Pyx_RefNannyDeclarations
  14702. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  14703. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  14704. /* function exit code */
  14705. __Pyx_RefNannyFinishContext();
  14706. }
  14707. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  14708. __Pyx_RefNannyDeclarations
  14709. int __pyx_t_1;
  14710. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  14711. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  14712. *
  14713. * def __releasebuffer__(ndarray self, Py_buffer* info):
  14714. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  14715. * PyObject_Free(info.format)
  14716. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14717. */
  14718. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  14719. if (__pyx_t_1) {
  14720. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
  14721. * def __releasebuffer__(ndarray self, Py_buffer* info):
  14722. * if PyArray_HASFIELDS(self):
  14723. * PyObject_Free(info.format) # <<<<<<<<<<<<<<
  14724. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14725. * PyObject_Free(info.strides)
  14726. */
  14727. PyObject_Free(__pyx_v_info->format);
  14728. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  14729. *
  14730. * def __releasebuffer__(ndarray self, Py_buffer* info):
  14731. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  14732. * PyObject_Free(info.format)
  14733. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14734. */
  14735. }
  14736. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  14737. * if PyArray_HASFIELDS(self):
  14738. * PyObject_Free(info.format)
  14739. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14740. * PyObject_Free(info.strides)
  14741. * # info.shape was stored after info.strides in the same block
  14742. */
  14743. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  14744. if (__pyx_t_1) {
  14745. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
  14746. * PyObject_Free(info.format)
  14747. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14748. * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
  14749. * # info.shape was stored after info.strides in the same block
  14750. *
  14751. */
  14752. PyObject_Free(__pyx_v_info->strides);
  14753. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  14754. * if PyArray_HASFIELDS(self):
  14755. * PyObject_Free(info.format)
  14756. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14757. * PyObject_Free(info.strides)
  14758. * # info.shape was stored after info.strides in the same block
  14759. */
  14760. }
  14761. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  14762. * f[0] = c'\0' # Terminate format string
  14763. *
  14764. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  14765. * if PyArray_HASFIELDS(self):
  14766. * PyObject_Free(info.format)
  14767. */
  14768. /* function exit code */
  14769. __Pyx_RefNannyFinishContext();
  14770. }
  14771. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  14772. * ctypedef npy_cdouble complex_t
  14773. *
  14774. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  14775. * return PyArray_MultiIterNew(1, <void*>a)
  14776. *
  14777. */
  14778. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  14779. PyObject *__pyx_r = NULL;
  14780. __Pyx_RefNannyDeclarations
  14781. PyObject *__pyx_t_1 = NULL;
  14782. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  14783. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
  14784. *
  14785. * cdef inline object PyArray_MultiIterNew1(a):
  14786. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  14787. *
  14788. * cdef inline object PyArray_MultiIterNew2(a, b):
  14789. */
  14790. __Pyx_XDECREF(__pyx_r);
  14791. __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
  14792. __Pyx_GOTREF(__pyx_t_1);
  14793. __pyx_r = __pyx_t_1;
  14794. __pyx_t_1 = 0;
  14795. goto __pyx_L0;
  14796. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  14797. * ctypedef npy_cdouble complex_t
  14798. *
  14799. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  14800. * return PyArray_MultiIterNew(1, <void*>a)
  14801. *
  14802. */
  14803. /* function exit code */
  14804. __pyx_L1_error:;
  14805. __Pyx_XDECREF(__pyx_t_1);
  14806. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14807. __pyx_r = 0;
  14808. __pyx_L0:;
  14809. __Pyx_XGIVEREF(__pyx_r);
  14810. __Pyx_RefNannyFinishContext();
  14811. return __pyx_r;
  14812. }
  14813. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  14814. * return PyArray_MultiIterNew(1, <void*>a)
  14815. *
  14816. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  14817. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  14818. *
  14819. */
  14820. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  14821. PyObject *__pyx_r = NULL;
  14822. __Pyx_RefNannyDeclarations
  14823. PyObject *__pyx_t_1 = NULL;
  14824. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  14825. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
  14826. *
  14827. * cdef inline object PyArray_MultiIterNew2(a, b):
  14828. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  14829. *
  14830. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  14831. */
  14832. __Pyx_XDECREF(__pyx_r);
  14833. __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 825, __pyx_L1_error)
  14834. __Pyx_GOTREF(__pyx_t_1);
  14835. __pyx_r = __pyx_t_1;
  14836. __pyx_t_1 = 0;
  14837. goto __pyx_L0;
  14838. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  14839. * return PyArray_MultiIterNew(1, <void*>a)
  14840. *
  14841. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  14842. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  14843. *
  14844. */
  14845. /* function exit code */
  14846. __pyx_L1_error:;
  14847. __Pyx_XDECREF(__pyx_t_1);
  14848. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14849. __pyx_r = 0;
  14850. __pyx_L0:;
  14851. __Pyx_XGIVEREF(__pyx_r);
  14852. __Pyx_RefNannyFinishContext();
  14853. return __pyx_r;
  14854. }
  14855. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  14856. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  14857. *
  14858. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  14859. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  14860. *
  14861. */
  14862. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  14863. PyObject *__pyx_r = NULL;
  14864. __Pyx_RefNannyDeclarations
  14865. PyObject *__pyx_t_1 = NULL;
  14866. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  14867. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
  14868. *
  14869. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  14870. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  14871. *
  14872. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  14873. */
  14874. __Pyx_XDECREF(__pyx_r);
  14875. __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 828, __pyx_L1_error)
  14876. __Pyx_GOTREF(__pyx_t_1);
  14877. __pyx_r = __pyx_t_1;
  14878. __pyx_t_1 = 0;
  14879. goto __pyx_L0;
  14880. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  14881. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  14882. *
  14883. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  14884. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  14885. *
  14886. */
  14887. /* function exit code */
  14888. __pyx_L1_error:;
  14889. __Pyx_XDECREF(__pyx_t_1);
  14890. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14891. __pyx_r = 0;
  14892. __pyx_L0:;
  14893. __Pyx_XGIVEREF(__pyx_r);
  14894. __Pyx_RefNannyFinishContext();
  14895. return __pyx_r;
  14896. }
  14897. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  14898. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  14899. *
  14900. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  14901. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  14902. *
  14903. */
  14904. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
  14905. PyObject *__pyx_r = NULL;
  14906. __Pyx_RefNannyDeclarations
  14907. PyObject *__pyx_t_1 = NULL;
  14908. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  14909. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
  14910. *
  14911. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  14912. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  14913. *
  14914. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  14915. */
  14916. __Pyx_XDECREF(__pyx_r);
  14917. __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 831, __pyx_L1_error)
  14918. __Pyx_GOTREF(__pyx_t_1);
  14919. __pyx_r = __pyx_t_1;
  14920. __pyx_t_1 = 0;
  14921. goto __pyx_L0;
  14922. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  14923. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  14924. *
  14925. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  14926. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  14927. *
  14928. */
  14929. /* function exit code */
  14930. __pyx_L1_error:;
  14931. __Pyx_XDECREF(__pyx_t_1);
  14932. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14933. __pyx_r = 0;
  14934. __pyx_L0:;
  14935. __Pyx_XGIVEREF(__pyx_r);
  14936. __Pyx_RefNannyFinishContext();
  14937. return __pyx_r;
  14938. }
  14939. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  14940. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  14941. *
  14942. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  14943. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  14944. *
  14945. */
  14946. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
  14947. PyObject *__pyx_r = NULL;
  14948. __Pyx_RefNannyDeclarations
  14949. PyObject *__pyx_t_1 = NULL;
  14950. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  14951. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
  14952. *
  14953. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  14954. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  14955. *
  14956. * cdef inline tuple PyDataType_SHAPE(dtype d):
  14957. */
  14958. __Pyx_XDECREF(__pyx_r);
  14959. __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 834, __pyx_L1_error)
  14960. __Pyx_GOTREF(__pyx_t_1);
  14961. __pyx_r = __pyx_t_1;
  14962. __pyx_t_1 = 0;
  14963. goto __pyx_L0;
  14964. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  14965. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  14966. *
  14967. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  14968. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  14969. *
  14970. */
  14971. /* function exit code */
  14972. __pyx_L1_error:;
  14973. __Pyx_XDECREF(__pyx_t_1);
  14974. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14975. __pyx_r = 0;
  14976. __pyx_L0:;
  14977. __Pyx_XGIVEREF(__pyx_r);
  14978. __Pyx_RefNannyFinishContext();
  14979. return __pyx_r;
  14980. }
  14981. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  14982. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  14983. *
  14984. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  14985. * if PyDataType_HASSUBARRAY(d):
  14986. * return <tuple>d.subarray.shape
  14987. */
  14988. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  14989. PyObject *__pyx_r = NULL;
  14990. __Pyx_RefNannyDeclarations
  14991. int __pyx_t_1;
  14992. __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
  14993. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  14994. *
  14995. * cdef inline tuple PyDataType_SHAPE(dtype d):
  14996. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  14997. * return <tuple>d.subarray.shape
  14998. * else:
  14999. */
  15000. __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  15001. if (__pyx_t_1) {
  15002. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
  15003. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15004. * if PyDataType_HASSUBARRAY(d):
  15005. * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
  15006. * else:
  15007. * return ()
  15008. */
  15009. __Pyx_XDECREF(__pyx_r);
  15010. __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
  15011. __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
  15012. goto __pyx_L0;
  15013. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15014. *
  15015. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15016. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15017. * return <tuple>d.subarray.shape
  15018. * else:
  15019. */
  15020. }
  15021. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
  15022. * return <tuple>d.subarray.shape
  15023. * else:
  15024. * return () # <<<<<<<<<<<<<<
  15025. *
  15026. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  15027. */
  15028. /*else*/ {
  15029. __Pyx_XDECREF(__pyx_r);
  15030. __Pyx_INCREF(__pyx_empty_tuple);
  15031. __pyx_r = __pyx_empty_tuple;
  15032. goto __pyx_L0;
  15033. }
  15034. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15035. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15036. *
  15037. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15038. * if PyDataType_HASSUBARRAY(d):
  15039. * return <tuple>d.subarray.shape
  15040. */
  15041. /* function exit code */
  15042. __pyx_L0:;
  15043. __Pyx_XGIVEREF(__pyx_r);
  15044. __Pyx_RefNannyFinishContext();
  15045. return __pyx_r;
  15046. }
  15047. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  15048. * return ()
  15049. *
  15050. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  15051. * # Recursive utility function used in __getbuffer__ to get format
  15052. * # string. The new location in the format string is returned.
  15053. */
  15054. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  15055. PyArray_Descr *__pyx_v_child = 0;
  15056. int __pyx_v_endian_detector;
  15057. int __pyx_v_little_endian;
  15058. PyObject *__pyx_v_fields = 0;
  15059. PyObject *__pyx_v_childname = NULL;
  15060. PyObject *__pyx_v_new_offset = NULL;
  15061. PyObject *__pyx_v_t = NULL;
  15062. char *__pyx_r;
  15063. __Pyx_RefNannyDeclarations
  15064. PyObject *__pyx_t_1 = NULL;
  15065. Py_ssize_t __pyx_t_2;
  15066. PyObject *__pyx_t_3 = NULL;
  15067. PyObject *__pyx_t_4 = NULL;
  15068. int __pyx_t_5;
  15069. int __pyx_t_6;
  15070. int __pyx_t_7;
  15071. long __pyx_t_8;
  15072. char *__pyx_t_9;
  15073. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  15074. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
  15075. *
  15076. * cdef dtype child
  15077. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  15078. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  15079. * cdef tuple fields
  15080. */
  15081. __pyx_v_endian_detector = 1;
  15082. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
  15083. * cdef dtype child
  15084. * cdef int endian_detector = 1
  15085. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  15086. * cdef tuple fields
  15087. *
  15088. */
  15089. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  15090. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  15091. * cdef tuple fields
  15092. *
  15093. * for childname in descr.names: # <<<<<<<<<<<<<<
  15094. * fields = descr.fields[childname]
  15095. * child, new_offset = fields
  15096. */
  15097. if (unlikely(__pyx_v_descr->names == Py_None)) {
  15098. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  15099. __PYX_ERR(2, 851, __pyx_L1_error)
  15100. }
  15101. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  15102. for (;;) {
  15103. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  15104. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15105. __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(2, 851, __pyx_L1_error)
  15106. #else
  15107. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 851, __pyx_L1_error)
  15108. __Pyx_GOTREF(__pyx_t_3);
  15109. #endif
  15110. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  15111. __pyx_t_3 = 0;
  15112. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
  15113. *
  15114. * for childname in descr.names:
  15115. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  15116. * child, new_offset = fields
  15117. *
  15118. */
  15119. if (unlikely(__pyx_v_descr->fields == Py_None)) {
  15120. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  15121. __PYX_ERR(2, 852, __pyx_L1_error)
  15122. }
  15123. __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 852, __pyx_L1_error)
  15124. __Pyx_GOTREF(__pyx_t_3);
  15125. if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(2, 852, __pyx_L1_error)
  15126. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  15127. __pyx_t_3 = 0;
  15128. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
  15129. * for childname in descr.names:
  15130. * fields = descr.fields[childname]
  15131. * child, new_offset = fields # <<<<<<<<<<<<<<
  15132. *
  15133. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15134. */
  15135. if (likely(__pyx_v_fields != Py_None)) {
  15136. PyObject* sequence = __pyx_v_fields;
  15137. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  15138. if (unlikely(size != 2)) {
  15139. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  15140. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  15141. __PYX_ERR(2, 853, __pyx_L1_error)
  15142. }
  15143. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15144. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  15145. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  15146. __Pyx_INCREF(__pyx_t_3);
  15147. __Pyx_INCREF(__pyx_t_4);
  15148. #else
  15149. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
  15150. __Pyx_GOTREF(__pyx_t_3);
  15151. __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
  15152. __Pyx_GOTREF(__pyx_t_4);
  15153. #endif
  15154. } else {
  15155. __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
  15156. }
  15157. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
  15158. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  15159. __pyx_t_3 = 0;
  15160. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  15161. __pyx_t_4 = 0;
  15162. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15163. * child, new_offset = fields
  15164. *
  15165. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15166. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15167. *
  15168. */
  15169. __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
  15170. __Pyx_GOTREF(__pyx_t_4);
  15171. __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
  15172. __Pyx_GOTREF(__pyx_t_3);
  15173. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15174. __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 855, __pyx_L1_error)
  15175. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15176. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  15177. if (unlikely(__pyx_t_6)) {
  15178. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  15179. *
  15180. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15181. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  15182. *
  15183. * if ((child.byteorder == c'>' and little_endian) or
  15184. */
  15185. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 856, __pyx_L1_error)
  15186. __Pyx_GOTREF(__pyx_t_3);
  15187. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15188. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15189. __PYX_ERR(2, 856, __pyx_L1_error)
  15190. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15191. * child, new_offset = fields
  15192. *
  15193. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15194. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15195. *
  15196. */
  15197. }
  15198. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15199. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15200. *
  15201. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15202. * (child.byteorder == c'<' and not little_endian)):
  15203. * raise ValueError(u"Non-native byte order not supported")
  15204. */
  15205. __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
  15206. if (!__pyx_t_7) {
  15207. goto __pyx_L8_next_or;
  15208. } else {
  15209. }
  15210. __pyx_t_7 = (__pyx_v_little_endian != 0);
  15211. if (!__pyx_t_7) {
  15212. } else {
  15213. __pyx_t_6 = __pyx_t_7;
  15214. goto __pyx_L7_bool_binop_done;
  15215. }
  15216. __pyx_L8_next_or:;
  15217. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
  15218. *
  15219. * if ((child.byteorder == c'>' and little_endian) or
  15220. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15221. * raise ValueError(u"Non-native byte order not supported")
  15222. * # One could encode it in the format string and have Cython
  15223. */
  15224. __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
  15225. if (__pyx_t_7) {
  15226. } else {
  15227. __pyx_t_6 = __pyx_t_7;
  15228. goto __pyx_L7_bool_binop_done;
  15229. }
  15230. __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
  15231. __pyx_t_6 = __pyx_t_7;
  15232. __pyx_L7_bool_binop_done:;
  15233. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15234. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15235. *
  15236. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15237. * (child.byteorder == c'<' and not little_endian)):
  15238. * raise ValueError(u"Non-native byte order not supported")
  15239. */
  15240. if (unlikely(__pyx_t_6)) {
  15241. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
  15242. * if ((child.byteorder == c'>' and little_endian) or
  15243. * (child.byteorder == c'<' and not little_endian)):
  15244. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15245. * # One could encode it in the format string and have Cython
  15246. * # complain instead, BUT: < and > in format strings also imply
  15247. */
  15248. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 860, __pyx_L1_error)
  15249. __Pyx_GOTREF(__pyx_t_3);
  15250. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15251. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15252. __PYX_ERR(2, 860, __pyx_L1_error)
  15253. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15254. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15255. *
  15256. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15257. * (child.byteorder == c'<' and not little_endian)):
  15258. * raise ValueError(u"Non-native byte order not supported")
  15259. */
  15260. }
  15261. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
  15262. *
  15263. * # Output padding bytes
  15264. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  15265. * f[0] = 120 # "x"; pad byte
  15266. * f += 1
  15267. */
  15268. while (1) {
  15269. __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
  15270. __Pyx_GOTREF(__pyx_t_3);
  15271. __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 870, __pyx_L1_error)
  15272. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15273. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
  15274. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15275. if (!__pyx_t_6) break;
  15276. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
  15277. * # Output padding bytes
  15278. * while offset[0] < new_offset:
  15279. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  15280. * f += 1
  15281. * offset[0] += 1
  15282. */
  15283. (__pyx_v_f[0]) = 0x78;
  15284. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
  15285. * while offset[0] < new_offset:
  15286. * f[0] = 120 # "x"; pad byte
  15287. * f += 1 # <<<<<<<<<<<<<<
  15288. * offset[0] += 1
  15289. *
  15290. */
  15291. __pyx_v_f = (__pyx_v_f + 1);
  15292. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
  15293. * f[0] = 120 # "x"; pad byte
  15294. * f += 1
  15295. * offset[0] += 1 # <<<<<<<<<<<<<<
  15296. *
  15297. * offset[0] += child.itemsize
  15298. */
  15299. __pyx_t_8 = 0;
  15300. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
  15301. }
  15302. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
  15303. * offset[0] += 1
  15304. *
  15305. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  15306. *
  15307. * if not PyDataType_HASFIELDS(child):
  15308. */
  15309. __pyx_t_8 = 0;
  15310. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
  15311. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  15312. * offset[0] += child.itemsize
  15313. *
  15314. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  15315. * t = child.type_num
  15316. * if end - f < 5:
  15317. */
  15318. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  15319. if (__pyx_t_6) {
  15320. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
  15321. *
  15322. * if not PyDataType_HASFIELDS(child):
  15323. * t = child.type_num # <<<<<<<<<<<<<<
  15324. * if end - f < 5:
  15325. * raise RuntimeError(u"Format string allocated too short.")
  15326. */
  15327. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
  15328. __Pyx_GOTREF(__pyx_t_4);
  15329. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  15330. __pyx_t_4 = 0;
  15331. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  15332. * if not PyDataType_HASFIELDS(child):
  15333. * t = child.type_num
  15334. * if end - f < 5: # <<<<<<<<<<<<<<
  15335. * raise RuntimeError(u"Format string allocated too short.")
  15336. *
  15337. */
  15338. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  15339. if (unlikely(__pyx_t_6)) {
  15340. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  15341. * t = child.type_num
  15342. * if end - f < 5:
  15343. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  15344. *
  15345. * # Until ticket #99 is fixed, use integers to avoid warnings
  15346. */
  15347. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 880, __pyx_L1_error)
  15348. __Pyx_GOTREF(__pyx_t_4);
  15349. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  15350. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15351. __PYX_ERR(2, 880, __pyx_L1_error)
  15352. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  15353. * if not PyDataType_HASFIELDS(child):
  15354. * t = child.type_num
  15355. * if end - f < 5: # <<<<<<<<<<<<<<
  15356. * raise RuntimeError(u"Format string allocated too short.")
  15357. *
  15358. */
  15359. }
  15360. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
  15361. *
  15362. * # Until ticket #99 is fixed, use integers to avoid warnings
  15363. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  15364. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15365. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15366. */
  15367. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
  15368. __Pyx_GOTREF(__pyx_t_4);
  15369. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 883, __pyx_L1_error)
  15370. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15371. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
  15372. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15373. if (__pyx_t_6) {
  15374. (__pyx_v_f[0]) = 98;
  15375. goto __pyx_L15;
  15376. }
  15377. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
  15378. * # Until ticket #99 is fixed, use integers to avoid warnings
  15379. * if t == NPY_BYTE: f[0] = 98 #"b"
  15380. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  15381. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15382. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15383. */
  15384. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
  15385. __Pyx_GOTREF(__pyx_t_3);
  15386. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 884, __pyx_L1_error)
  15387. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15388. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
  15389. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15390. if (__pyx_t_6) {
  15391. (__pyx_v_f[0]) = 66;
  15392. goto __pyx_L15;
  15393. }
  15394. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
  15395. * if t == NPY_BYTE: f[0] = 98 #"b"
  15396. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15397. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  15398. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15399. * elif t == NPY_INT: f[0] = 105 #"i"
  15400. */
  15401. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
  15402. __Pyx_GOTREF(__pyx_t_4);
  15403. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 885, __pyx_L1_error)
  15404. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15405. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
  15406. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15407. if (__pyx_t_6) {
  15408. (__pyx_v_f[0]) = 0x68;
  15409. goto __pyx_L15;
  15410. }
  15411. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
  15412. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  15413. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15414. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  15415. * elif t == NPY_INT: f[0] = 105 #"i"
  15416. * elif t == NPY_UINT: f[0] = 73 #"I"
  15417. */
  15418. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
  15419. __Pyx_GOTREF(__pyx_t_3);
  15420. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 886, __pyx_L1_error)
  15421. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15422. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
  15423. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15424. if (__pyx_t_6) {
  15425. (__pyx_v_f[0]) = 72;
  15426. goto __pyx_L15;
  15427. }
  15428. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
  15429. * elif t == NPY_SHORT: f[0] = 104 #"h"
  15430. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15431. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  15432. * elif t == NPY_UINT: f[0] = 73 #"I"
  15433. * elif t == NPY_LONG: f[0] = 108 #"l"
  15434. */
  15435. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
  15436. __Pyx_GOTREF(__pyx_t_4);
  15437. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 887, __pyx_L1_error)
  15438. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15439. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
  15440. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15441. if (__pyx_t_6) {
  15442. (__pyx_v_f[0]) = 0x69;
  15443. goto __pyx_L15;
  15444. }
  15445. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
  15446. * elif t == NPY_USHORT: f[0] = 72 #"H"
  15447. * elif t == NPY_INT: f[0] = 105 #"i"
  15448. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  15449. * elif t == NPY_LONG: f[0] = 108 #"l"
  15450. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15451. */
  15452. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
  15453. __Pyx_GOTREF(__pyx_t_3);
  15454. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 888, __pyx_L1_error)
  15455. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15456. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
  15457. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15458. if (__pyx_t_6) {
  15459. (__pyx_v_f[0]) = 73;
  15460. goto __pyx_L15;
  15461. }
  15462. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
  15463. * elif t == NPY_INT: f[0] = 105 #"i"
  15464. * elif t == NPY_UINT: f[0] = 73 #"I"
  15465. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  15466. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15467. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15468. */
  15469. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
  15470. __Pyx_GOTREF(__pyx_t_4);
  15471. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 889, __pyx_L1_error)
  15472. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15473. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
  15474. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15475. if (__pyx_t_6) {
  15476. (__pyx_v_f[0]) = 0x6C;
  15477. goto __pyx_L15;
  15478. }
  15479. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
  15480. * elif t == NPY_UINT: f[0] = 73 #"I"
  15481. * elif t == NPY_LONG: f[0] = 108 #"l"
  15482. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  15483. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15484. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15485. */
  15486. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
  15487. __Pyx_GOTREF(__pyx_t_3);
  15488. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 890, __pyx_L1_error)
  15489. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15490. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
  15491. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15492. if (__pyx_t_6) {
  15493. (__pyx_v_f[0]) = 76;
  15494. goto __pyx_L15;
  15495. }
  15496. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
  15497. * elif t == NPY_LONG: f[0] = 108 #"l"
  15498. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15499. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  15500. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15501. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15502. */
  15503. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
  15504. __Pyx_GOTREF(__pyx_t_4);
  15505. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 891, __pyx_L1_error)
  15506. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15507. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
  15508. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15509. if (__pyx_t_6) {
  15510. (__pyx_v_f[0]) = 0x71;
  15511. goto __pyx_L15;
  15512. }
  15513. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
  15514. * elif t == NPY_ULONG: f[0] = 76 #"L"
  15515. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15516. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  15517. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15518. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15519. */
  15520. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
  15521. __Pyx_GOTREF(__pyx_t_3);
  15522. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 892, __pyx_L1_error)
  15523. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15524. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
  15525. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15526. if (__pyx_t_6) {
  15527. (__pyx_v_f[0]) = 81;
  15528. goto __pyx_L15;
  15529. }
  15530. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
  15531. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  15532. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15533. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  15534. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15535. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  15536. */
  15537. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
  15538. __Pyx_GOTREF(__pyx_t_4);
  15539. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 893, __pyx_L1_error)
  15540. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15541. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
  15542. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15543. if (__pyx_t_6) {
  15544. (__pyx_v_f[0]) = 0x66;
  15545. goto __pyx_L15;
  15546. }
  15547. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
  15548. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  15549. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15550. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  15551. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  15552. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  15553. */
  15554. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
  15555. __Pyx_GOTREF(__pyx_t_3);
  15556. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 894, __pyx_L1_error)
  15557. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15558. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
  15559. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15560. if (__pyx_t_6) {
  15561. (__pyx_v_f[0]) = 0x64;
  15562. goto __pyx_L15;
  15563. }
  15564. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
  15565. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  15566. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15567. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  15568. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  15569. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  15570. */
  15571. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
  15572. __Pyx_GOTREF(__pyx_t_4);
  15573. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 895, __pyx_L1_error)
  15574. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15575. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
  15576. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15577. if (__pyx_t_6) {
  15578. (__pyx_v_f[0]) = 0x67;
  15579. goto __pyx_L15;
  15580. }
  15581. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
  15582. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  15583. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  15584. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  15585. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  15586. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  15587. */
  15588. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
  15589. __Pyx_GOTREF(__pyx_t_3);
  15590. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 896, __pyx_L1_error)
  15591. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15592. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
  15593. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15594. if (__pyx_t_6) {
  15595. (__pyx_v_f[0]) = 90;
  15596. (__pyx_v_f[1]) = 0x66;
  15597. __pyx_v_f = (__pyx_v_f + 1);
  15598. goto __pyx_L15;
  15599. }
  15600. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
  15601. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  15602. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  15603. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  15604. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  15605. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  15606. */
  15607. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
  15608. __Pyx_GOTREF(__pyx_t_4);
  15609. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 897, __pyx_L1_error)
  15610. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15611. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
  15612. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15613. if (__pyx_t_6) {
  15614. (__pyx_v_f[0]) = 90;
  15615. (__pyx_v_f[1]) = 0x64;
  15616. __pyx_v_f = (__pyx_v_f + 1);
  15617. goto __pyx_L15;
  15618. }
  15619. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
  15620. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  15621. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  15622. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  15623. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  15624. * else:
  15625. */
  15626. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
  15627. __Pyx_GOTREF(__pyx_t_3);
  15628. __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 898, __pyx_L1_error)
  15629. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15630. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
  15631. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15632. if (__pyx_t_6) {
  15633. (__pyx_v_f[0]) = 90;
  15634. (__pyx_v_f[1]) = 0x67;
  15635. __pyx_v_f = (__pyx_v_f + 1);
  15636. goto __pyx_L15;
  15637. }
  15638. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
  15639. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  15640. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  15641. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  15642. * else:
  15643. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15644. */
  15645. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
  15646. __Pyx_GOTREF(__pyx_t_4);
  15647. __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 899, __pyx_L1_error)
  15648. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15649. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
  15650. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15651. if (likely(__pyx_t_6)) {
  15652. (__pyx_v_f[0]) = 79;
  15653. goto __pyx_L15;
  15654. }
  15655. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
  15656. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  15657. * else:
  15658. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  15659. * f += 1
  15660. * else:
  15661. */
  15662. /*else*/ {
  15663. __pyx_t_3 = __Pyx_PyUnicode_FormatSafe(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 901, __pyx_L1_error)
  15664. __Pyx_GOTREF(__pyx_t_3);
  15665. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
  15666. __Pyx_GOTREF(__pyx_t_4);
  15667. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15668. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  15669. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15670. __PYX_ERR(2, 901, __pyx_L1_error)
  15671. }
  15672. __pyx_L15:;
  15673. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
  15674. * else:
  15675. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15676. * f += 1 # <<<<<<<<<<<<<<
  15677. * else:
  15678. * # Cython ignores struct boundary information ("T{...}"),
  15679. */
  15680. __pyx_v_f = (__pyx_v_f + 1);
  15681. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  15682. * offset[0] += child.itemsize
  15683. *
  15684. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  15685. * t = child.type_num
  15686. * if end - f < 5:
  15687. */
  15688. goto __pyx_L13;
  15689. }
  15690. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
  15691. * # Cython ignores struct boundary information ("T{...}"),
  15692. * # so don't output it
  15693. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  15694. * return f
  15695. *
  15696. */
  15697. /*else*/ {
  15698. __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(2, 906, __pyx_L1_error)
  15699. __pyx_v_f = __pyx_t_9;
  15700. }
  15701. __pyx_L13:;
  15702. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  15703. * cdef tuple fields
  15704. *
  15705. * for childname in descr.names: # <<<<<<<<<<<<<<
  15706. * fields = descr.fields[childname]
  15707. * child, new_offset = fields
  15708. */
  15709. }
  15710. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  15711. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
  15712. * # so don't output it
  15713. * f = _util_dtypestring(child, f, end, offset)
  15714. * return f # <<<<<<<<<<<<<<
  15715. *
  15716. *
  15717. */
  15718. __pyx_r = __pyx_v_f;
  15719. goto __pyx_L0;
  15720. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  15721. * return ()
  15722. *
  15723. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  15724. * # Recursive utility function used in __getbuffer__ to get format
  15725. * # string. The new location in the format string is returned.
  15726. */
  15727. /* function exit code */
  15728. __pyx_L1_error:;
  15729. __Pyx_XDECREF(__pyx_t_1);
  15730. __Pyx_XDECREF(__pyx_t_3);
  15731. __Pyx_XDECREF(__pyx_t_4);
  15732. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15733. __pyx_r = NULL;
  15734. __pyx_L0:;
  15735. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  15736. __Pyx_XDECREF(__pyx_v_fields);
  15737. __Pyx_XDECREF(__pyx_v_childname);
  15738. __Pyx_XDECREF(__pyx_v_new_offset);
  15739. __Pyx_XDECREF(__pyx_v_t);
  15740. __Pyx_RefNannyFinishContext();
  15741. return __pyx_r;
  15742. }
  15743. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  15744. * int _import_umath() except -1
  15745. *
  15746. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  15747. * Py_INCREF(base) # important to do this before stealing the reference below!
  15748. * PyArray_SetBaseObject(arr, base)
  15749. */
  15750. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  15751. __Pyx_RefNannyDeclarations
  15752. __Pyx_RefNannySetupContext("set_array_base", 0);
  15753. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
  15754. *
  15755. * cdef inline void set_array_base(ndarray arr, object base):
  15756. * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
  15757. * PyArray_SetBaseObject(arr, base)
  15758. *
  15759. */
  15760. Py_INCREF(__pyx_v_base);
  15761. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
  15762. * cdef inline void set_array_base(ndarray arr, object base):
  15763. * Py_INCREF(base) # important to do this before stealing the reference below!
  15764. * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
  15765. *
  15766. * cdef inline object get_array_base(ndarray arr):
  15767. */
  15768. (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
  15769. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  15770. * int _import_umath() except -1
  15771. *
  15772. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  15773. * Py_INCREF(base) # important to do this before stealing the reference below!
  15774. * PyArray_SetBaseObject(arr, base)
  15775. */
  15776. /* function exit code */
  15777. __Pyx_RefNannyFinishContext();
  15778. }
  15779. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  15780. * PyArray_SetBaseObject(arr, base)
  15781. *
  15782. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  15783. * base = PyArray_BASE(arr)
  15784. * if base is NULL:
  15785. */
  15786. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  15787. PyObject *__pyx_v_base;
  15788. PyObject *__pyx_r = NULL;
  15789. __Pyx_RefNannyDeclarations
  15790. int __pyx_t_1;
  15791. __Pyx_RefNannySetupContext("get_array_base", 0);
  15792. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
  15793. *
  15794. * cdef inline object get_array_base(ndarray arr):
  15795. * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
  15796. * if base is NULL:
  15797. * return None
  15798. */
  15799. __pyx_v_base = PyArray_BASE(__pyx_v_arr);
  15800. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  15801. * cdef inline object get_array_base(ndarray arr):
  15802. * base = PyArray_BASE(arr)
  15803. * if base is NULL: # <<<<<<<<<<<<<<
  15804. * return None
  15805. * return <object>base
  15806. */
  15807. __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  15808. if (__pyx_t_1) {
  15809. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
  15810. * base = PyArray_BASE(arr)
  15811. * if base is NULL:
  15812. * return None # <<<<<<<<<<<<<<
  15813. * return <object>base
  15814. *
  15815. */
  15816. __Pyx_XDECREF(__pyx_r);
  15817. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  15818. goto __pyx_L0;
  15819. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  15820. * cdef inline object get_array_base(ndarray arr):
  15821. * base = PyArray_BASE(arr)
  15822. * if base is NULL: # <<<<<<<<<<<<<<
  15823. * return None
  15824. * return <object>base
  15825. */
  15826. }
  15827. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
  15828. * if base is NULL:
  15829. * return None
  15830. * return <object>base # <<<<<<<<<<<<<<
  15831. *
  15832. * # Versions of the import_* functions which are more suitable for
  15833. */
  15834. __Pyx_XDECREF(__pyx_r);
  15835. __Pyx_INCREF(((PyObject *)__pyx_v_base));
  15836. __pyx_r = ((PyObject *)__pyx_v_base);
  15837. goto __pyx_L0;
  15838. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  15839. * PyArray_SetBaseObject(arr, base)
  15840. *
  15841. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  15842. * base = PyArray_BASE(arr)
  15843. * if base is NULL:
  15844. */
  15845. /* function exit code */
  15846. __pyx_L0:;
  15847. __Pyx_XGIVEREF(__pyx_r);
  15848. __Pyx_RefNannyFinishContext();
  15849. return __pyx_r;
  15850. }
  15851. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  15852. * # Versions of the import_* functions which are more suitable for
  15853. * # Cython code.
  15854. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  15855. * try:
  15856. * _import_array()
  15857. */
  15858. static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  15859. int __pyx_r;
  15860. __Pyx_RefNannyDeclarations
  15861. PyObject *__pyx_t_1 = NULL;
  15862. PyObject *__pyx_t_2 = NULL;
  15863. PyObject *__pyx_t_3 = NULL;
  15864. int __pyx_t_4;
  15865. PyObject *__pyx_t_5 = NULL;
  15866. PyObject *__pyx_t_6 = NULL;
  15867. PyObject *__pyx_t_7 = NULL;
  15868. PyObject *__pyx_t_8 = NULL;
  15869. __Pyx_RefNannySetupContext("import_array", 0);
  15870. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  15871. * # Cython code.
  15872. * cdef inline int import_array() except -1:
  15873. * try: # <<<<<<<<<<<<<<
  15874. * _import_array()
  15875. * except Exception:
  15876. */
  15877. {
  15878. __Pyx_PyThreadState_declare
  15879. __Pyx_PyThreadState_assign
  15880. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  15881. __Pyx_XGOTREF(__pyx_t_1);
  15882. __Pyx_XGOTREF(__pyx_t_2);
  15883. __Pyx_XGOTREF(__pyx_t_3);
  15884. /*try:*/ {
  15885. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
  15886. * cdef inline int import_array() except -1:
  15887. * try:
  15888. * _import_array() # <<<<<<<<<<<<<<
  15889. * except Exception:
  15890. * raise ImportError("numpy.core.multiarray failed to import")
  15891. */
  15892. __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
  15893. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  15894. * # Cython code.
  15895. * cdef inline int import_array() except -1:
  15896. * try: # <<<<<<<<<<<<<<
  15897. * _import_array()
  15898. * except Exception:
  15899. */
  15900. }
  15901. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  15902. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  15903. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  15904. goto __pyx_L8_try_end;
  15905. __pyx_L3_error:;
  15906. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
  15907. * try:
  15908. * _import_array()
  15909. * except Exception: # <<<<<<<<<<<<<<
  15910. * raise ImportError("numpy.core.multiarray failed to import")
  15911. *
  15912. */
  15913. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  15914. if (__pyx_t_4) {
  15915. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15916. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
  15917. __Pyx_GOTREF(__pyx_t_5);
  15918. __Pyx_GOTREF(__pyx_t_6);
  15919. __Pyx_GOTREF(__pyx_t_7);
  15920. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  15921. * _import_array()
  15922. * except Exception:
  15923. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  15924. *
  15925. * cdef inline int import_umath() except -1:
  15926. */
  15927. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1038, __pyx_L5_except_error)
  15928. __Pyx_GOTREF(__pyx_t_8);
  15929. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  15930. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  15931. __PYX_ERR(2, 1038, __pyx_L5_except_error)
  15932. }
  15933. goto __pyx_L5_except_error;
  15934. __pyx_L5_except_error:;
  15935. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  15936. * # Cython code.
  15937. * cdef inline int import_array() except -1:
  15938. * try: # <<<<<<<<<<<<<<
  15939. * _import_array()
  15940. * except Exception:
  15941. */
  15942. __Pyx_XGIVEREF(__pyx_t_1);
  15943. __Pyx_XGIVEREF(__pyx_t_2);
  15944. __Pyx_XGIVEREF(__pyx_t_3);
  15945. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  15946. goto __pyx_L1_error;
  15947. __pyx_L8_try_end:;
  15948. }
  15949. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  15950. * # Versions of the import_* functions which are more suitable for
  15951. * # Cython code.
  15952. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  15953. * try:
  15954. * _import_array()
  15955. */
  15956. /* function exit code */
  15957. __pyx_r = 0;
  15958. goto __pyx_L0;
  15959. __pyx_L1_error:;
  15960. __Pyx_XDECREF(__pyx_t_5);
  15961. __Pyx_XDECREF(__pyx_t_6);
  15962. __Pyx_XDECREF(__pyx_t_7);
  15963. __Pyx_XDECREF(__pyx_t_8);
  15964. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15965. __pyx_r = -1;
  15966. __pyx_L0:;
  15967. __Pyx_RefNannyFinishContext();
  15968. return __pyx_r;
  15969. }
  15970. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  15971. * raise ImportError("numpy.core.multiarray failed to import")
  15972. *
  15973. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  15974. * try:
  15975. * _import_umath()
  15976. */
  15977. static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  15978. int __pyx_r;
  15979. __Pyx_RefNannyDeclarations
  15980. PyObject *__pyx_t_1 = NULL;
  15981. PyObject *__pyx_t_2 = NULL;
  15982. PyObject *__pyx_t_3 = NULL;
  15983. int __pyx_t_4;
  15984. PyObject *__pyx_t_5 = NULL;
  15985. PyObject *__pyx_t_6 = NULL;
  15986. PyObject *__pyx_t_7 = NULL;
  15987. PyObject *__pyx_t_8 = NULL;
  15988. __Pyx_RefNannySetupContext("import_umath", 0);
  15989. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  15990. *
  15991. * cdef inline int import_umath() except -1:
  15992. * try: # <<<<<<<<<<<<<<
  15993. * _import_umath()
  15994. * except Exception:
  15995. */
  15996. {
  15997. __Pyx_PyThreadState_declare
  15998. __Pyx_PyThreadState_assign
  15999. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16000. __Pyx_XGOTREF(__pyx_t_1);
  16001. __Pyx_XGOTREF(__pyx_t_2);
  16002. __Pyx_XGOTREF(__pyx_t_3);
  16003. /*try:*/ {
  16004. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
  16005. * cdef inline int import_umath() except -1:
  16006. * try:
  16007. * _import_umath() # <<<<<<<<<<<<<<
  16008. * except Exception:
  16009. * raise ImportError("numpy.core.umath failed to import")
  16010. */
  16011. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
  16012. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16013. *
  16014. * cdef inline int import_umath() except -1:
  16015. * try: # <<<<<<<<<<<<<<
  16016. * _import_umath()
  16017. * except Exception:
  16018. */
  16019. }
  16020. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16021. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16022. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16023. goto __pyx_L8_try_end;
  16024. __pyx_L3_error:;
  16025. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
  16026. * try:
  16027. * _import_umath()
  16028. * except Exception: # <<<<<<<<<<<<<<
  16029. * raise ImportError("numpy.core.umath failed to import")
  16030. *
  16031. */
  16032. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16033. if (__pyx_t_4) {
  16034. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16035. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
  16036. __Pyx_GOTREF(__pyx_t_5);
  16037. __Pyx_GOTREF(__pyx_t_6);
  16038. __Pyx_GOTREF(__pyx_t_7);
  16039. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  16040. * _import_umath()
  16041. * except Exception:
  16042. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16043. *
  16044. * cdef inline int import_ufunc() except -1:
  16045. */
  16046. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1044, __pyx_L5_except_error)
  16047. __Pyx_GOTREF(__pyx_t_8);
  16048. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16049. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16050. __PYX_ERR(2, 1044, __pyx_L5_except_error)
  16051. }
  16052. goto __pyx_L5_except_error;
  16053. __pyx_L5_except_error:;
  16054. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16055. *
  16056. * cdef inline int import_umath() except -1:
  16057. * try: # <<<<<<<<<<<<<<
  16058. * _import_umath()
  16059. * except Exception:
  16060. */
  16061. __Pyx_XGIVEREF(__pyx_t_1);
  16062. __Pyx_XGIVEREF(__pyx_t_2);
  16063. __Pyx_XGIVEREF(__pyx_t_3);
  16064. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16065. goto __pyx_L1_error;
  16066. __pyx_L8_try_end:;
  16067. }
  16068. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16069. * raise ImportError("numpy.core.multiarray failed to import")
  16070. *
  16071. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16072. * try:
  16073. * _import_umath()
  16074. */
  16075. /* function exit code */
  16076. __pyx_r = 0;
  16077. goto __pyx_L0;
  16078. __pyx_L1_error:;
  16079. __Pyx_XDECREF(__pyx_t_5);
  16080. __Pyx_XDECREF(__pyx_t_6);
  16081. __Pyx_XDECREF(__pyx_t_7);
  16082. __Pyx_XDECREF(__pyx_t_8);
  16083. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16084. __pyx_r = -1;
  16085. __pyx_L0:;
  16086. __Pyx_RefNannyFinishContext();
  16087. return __pyx_r;
  16088. }
  16089. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16090. * raise ImportError("numpy.core.umath failed to import")
  16091. *
  16092. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16093. * try:
  16094. * _import_umath()
  16095. */
  16096. static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  16097. int __pyx_r;
  16098. __Pyx_RefNannyDeclarations
  16099. PyObject *__pyx_t_1 = NULL;
  16100. PyObject *__pyx_t_2 = NULL;
  16101. PyObject *__pyx_t_3 = NULL;
  16102. int __pyx_t_4;
  16103. PyObject *__pyx_t_5 = NULL;
  16104. PyObject *__pyx_t_6 = NULL;
  16105. PyObject *__pyx_t_7 = NULL;
  16106. PyObject *__pyx_t_8 = NULL;
  16107. __Pyx_RefNannySetupContext("import_ufunc", 0);
  16108. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16109. *
  16110. * cdef inline int import_ufunc() except -1:
  16111. * try: # <<<<<<<<<<<<<<
  16112. * _import_umath()
  16113. * except Exception:
  16114. */
  16115. {
  16116. __Pyx_PyThreadState_declare
  16117. __Pyx_PyThreadState_assign
  16118. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16119. __Pyx_XGOTREF(__pyx_t_1);
  16120. __Pyx_XGOTREF(__pyx_t_2);
  16121. __Pyx_XGOTREF(__pyx_t_3);
  16122. /*try:*/ {
  16123. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
  16124. * cdef inline int import_ufunc() except -1:
  16125. * try:
  16126. * _import_umath() # <<<<<<<<<<<<<<
  16127. * except Exception:
  16128. * raise ImportError("numpy.core.umath failed to import")
  16129. */
  16130. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
  16131. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16132. *
  16133. * cdef inline int import_ufunc() except -1:
  16134. * try: # <<<<<<<<<<<<<<
  16135. * _import_umath()
  16136. * except Exception:
  16137. */
  16138. }
  16139. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16140. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16141. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16142. goto __pyx_L8_try_end;
  16143. __pyx_L3_error:;
  16144. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
  16145. * try:
  16146. * _import_umath()
  16147. * except Exception: # <<<<<<<<<<<<<<
  16148. * raise ImportError("numpy.core.umath failed to import")
  16149. */
  16150. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16151. if (__pyx_t_4) {
  16152. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16153. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
  16154. __Pyx_GOTREF(__pyx_t_5);
  16155. __Pyx_GOTREF(__pyx_t_6);
  16156. __Pyx_GOTREF(__pyx_t_7);
  16157. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
  16158. * _import_umath()
  16159. * except Exception:
  16160. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16161. */
  16162. __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 1050, __pyx_L5_except_error)
  16163. __Pyx_GOTREF(__pyx_t_8);
  16164. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16165. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16166. __PYX_ERR(2, 1050, __pyx_L5_except_error)
  16167. }
  16168. goto __pyx_L5_except_error;
  16169. __pyx_L5_except_error:;
  16170. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16171. *
  16172. * cdef inline int import_ufunc() except -1:
  16173. * try: # <<<<<<<<<<<<<<
  16174. * _import_umath()
  16175. * except Exception:
  16176. */
  16177. __Pyx_XGIVEREF(__pyx_t_1);
  16178. __Pyx_XGIVEREF(__pyx_t_2);
  16179. __Pyx_XGIVEREF(__pyx_t_3);
  16180. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16181. goto __pyx_L1_error;
  16182. __pyx_L8_try_end:;
  16183. }
  16184. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16185. * raise ImportError("numpy.core.umath failed to import")
  16186. *
  16187. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16188. * try:
  16189. * _import_umath()
  16190. */
  16191. /* function exit code */
  16192. __pyx_r = 0;
  16193. goto __pyx_L0;
  16194. __pyx_L1_error:;
  16195. __Pyx_XDECREF(__pyx_t_5);
  16196. __Pyx_XDECREF(__pyx_t_6);
  16197. __Pyx_XDECREF(__pyx_t_7);
  16198. __Pyx_XDECREF(__pyx_t_8);
  16199. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16200. __pyx_r = -1;
  16201. __pyx_L0:;
  16202. __Pyx_RefNannyFinishContext();
  16203. return __pyx_r;
  16204. }
  16205. /* "array.pxd":93
  16206. * __data_union data
  16207. *
  16208. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16209. * # This implementation of getbuffer is geared towards Cython
  16210. * # requirements, and does not yet fulfill the PEP.
  16211. */
  16212. /* Python wrapper */
  16213. static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  16214. static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  16215. int __pyx_r;
  16216. __Pyx_RefNannyDeclarations
  16217. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  16218. __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  16219. /* function exit code */
  16220. __Pyx_RefNannyFinishContext();
  16221. return __pyx_r;
  16222. }
  16223. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
  16224. PyObject *__pyx_v_item_count = NULL;
  16225. int __pyx_r;
  16226. __Pyx_RefNannyDeclarations
  16227. PyObject *__pyx_t_1 = NULL;
  16228. char *__pyx_t_2;
  16229. int __pyx_t_3;
  16230. PyObject *__pyx_t_4 = NULL;
  16231. Py_ssize_t __pyx_t_5;
  16232. int __pyx_t_6;
  16233. char __pyx_t_7;
  16234. if (__pyx_v_info == NULL) {
  16235. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  16236. return -1;
  16237. }
  16238. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  16239. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  16240. __Pyx_GIVEREF(__pyx_v_info->obj);
  16241. /* "array.pxd":98
  16242. * # In particular strided access is always provided regardless
  16243. * # of flags
  16244. * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
  16245. *
  16246. * info.suboffsets = NULL
  16247. */
  16248. __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
  16249. __Pyx_GOTREF(__pyx_t_1);
  16250. __pyx_v_item_count = __pyx_t_1;
  16251. __pyx_t_1 = 0;
  16252. /* "array.pxd":100
  16253. * item_count = Py_SIZE(self)
  16254. *
  16255. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  16256. * info.buf = self.data.as_chars
  16257. * info.readonly = 0
  16258. */
  16259. __pyx_v_info->suboffsets = NULL;
  16260. /* "array.pxd":101
  16261. *
  16262. * info.suboffsets = NULL
  16263. * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
  16264. * info.readonly = 0
  16265. * info.ndim = 1
  16266. */
  16267. __pyx_t_2 = __pyx_v_self->data.as_chars;
  16268. __pyx_v_info->buf = __pyx_t_2;
  16269. /* "array.pxd":102
  16270. * info.suboffsets = NULL
  16271. * info.buf = self.data.as_chars
  16272. * info.readonly = 0 # <<<<<<<<<<<<<<
  16273. * info.ndim = 1
  16274. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16275. */
  16276. __pyx_v_info->readonly = 0;
  16277. /* "array.pxd":103
  16278. * info.buf = self.data.as_chars
  16279. * info.readonly = 0
  16280. * info.ndim = 1 # <<<<<<<<<<<<<<
  16281. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16282. * info.len = info.itemsize * item_count
  16283. */
  16284. __pyx_v_info->ndim = 1;
  16285. /* "array.pxd":104
  16286. * info.readonly = 0
  16287. * info.ndim = 1
  16288. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
  16289. * info.len = info.itemsize * item_count
  16290. *
  16291. */
  16292. __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
  16293. __pyx_v_info->itemsize = __pyx_t_3;
  16294. /* "array.pxd":105
  16295. * info.ndim = 1
  16296. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16297. * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
  16298. *
  16299. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16300. */
  16301. __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  16302. __Pyx_GOTREF(__pyx_t_1);
  16303. __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 105, __pyx_L1_error)
  16304. __Pyx_GOTREF(__pyx_t_4);
  16305. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16306. __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 105, __pyx_L1_error)
  16307. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16308. __pyx_v_info->len = __pyx_t_5;
  16309. /* "array.pxd":107
  16310. * info.len = info.itemsize * item_count
  16311. *
  16312. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
  16313. * if not info.shape:
  16314. * raise MemoryError()
  16315. */
  16316. __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
  16317. /* "array.pxd":108
  16318. *
  16319. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16320. * if not info.shape: # <<<<<<<<<<<<<<
  16321. * raise MemoryError()
  16322. * info.shape[0] = item_count # constant regardless of resizing
  16323. */
  16324. __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
  16325. if (unlikely(__pyx_t_6)) {
  16326. /* "array.pxd":109
  16327. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16328. * if not info.shape:
  16329. * raise MemoryError() # <<<<<<<<<<<<<<
  16330. * info.shape[0] = item_count # constant regardless of resizing
  16331. * info.strides = &info.itemsize
  16332. */
  16333. PyErr_NoMemory(); __PYX_ERR(3, 109, __pyx_L1_error)
  16334. /* "array.pxd":108
  16335. *
  16336. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16337. * if not info.shape: # <<<<<<<<<<<<<<
  16338. * raise MemoryError()
  16339. * info.shape[0] = item_count # constant regardless of resizing
  16340. */
  16341. }
  16342. /* "array.pxd":110
  16343. * if not info.shape:
  16344. * raise MemoryError()
  16345. * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
  16346. * info.strides = &info.itemsize
  16347. *
  16348. */
  16349. __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_item_count); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 110, __pyx_L1_error)
  16350. (__pyx_v_info->shape[0]) = __pyx_t_5;
  16351. /* "array.pxd":111
  16352. * raise MemoryError()
  16353. * info.shape[0] = item_count # constant regardless of resizing
  16354. * info.strides = &info.itemsize # <<<<<<<<<<<<<<
  16355. *
  16356. * info.format = <char*> (info.shape + 1)
  16357. */
  16358. __pyx_v_info->strides = (&__pyx_v_info->itemsize);
  16359. /* "array.pxd":113
  16360. * info.strides = &info.itemsize
  16361. *
  16362. * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
  16363. * info.format[0] = self.ob_descr.typecode
  16364. * info.format[1] = 0
  16365. */
  16366. __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
  16367. /* "array.pxd":114
  16368. *
  16369. * info.format = <char*> (info.shape + 1)
  16370. * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
  16371. * info.format[1] = 0
  16372. * info.obj = self
  16373. */
  16374. __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
  16375. (__pyx_v_info->format[0]) = __pyx_t_7;
  16376. /* "array.pxd":115
  16377. * info.format = <char*> (info.shape + 1)
  16378. * info.format[0] = self.ob_descr.typecode
  16379. * info.format[1] = 0 # <<<<<<<<<<<<<<
  16380. * info.obj = self
  16381. *
  16382. */
  16383. (__pyx_v_info->format[1]) = 0;
  16384. /* "array.pxd":116
  16385. * info.format[0] = self.ob_descr.typecode
  16386. * info.format[1] = 0
  16387. * info.obj = self # <<<<<<<<<<<<<<
  16388. *
  16389. * def __releasebuffer__(self, Py_buffer* info):
  16390. */
  16391. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  16392. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  16393. __Pyx_GOTREF(__pyx_v_info->obj);
  16394. __Pyx_DECREF(__pyx_v_info->obj);
  16395. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  16396. /* "array.pxd":93
  16397. * __data_union data
  16398. *
  16399. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16400. * # This implementation of getbuffer is geared towards Cython
  16401. * # requirements, and does not yet fulfill the PEP.
  16402. */
  16403. /* function exit code */
  16404. __pyx_r = 0;
  16405. goto __pyx_L0;
  16406. __pyx_L1_error:;
  16407. __Pyx_XDECREF(__pyx_t_1);
  16408. __Pyx_XDECREF(__pyx_t_4);
  16409. __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16410. __pyx_r = -1;
  16411. if (__pyx_v_info->obj != NULL) {
  16412. __Pyx_GOTREF(__pyx_v_info->obj);
  16413. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  16414. }
  16415. goto __pyx_L2;
  16416. __pyx_L0:;
  16417. if (__pyx_v_info->obj == Py_None) {
  16418. __Pyx_GOTREF(__pyx_v_info->obj);
  16419. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  16420. }
  16421. __pyx_L2:;
  16422. __Pyx_XDECREF(__pyx_v_item_count);
  16423. __Pyx_RefNannyFinishContext();
  16424. return __pyx_r;
  16425. }
  16426. /* "array.pxd":118
  16427. * info.obj = self
  16428. *
  16429. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  16430. * PyObject_Free(info.shape)
  16431. *
  16432. */
  16433. /* Python wrapper */
  16434. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  16435. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  16436. __Pyx_RefNannyDeclarations
  16437. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  16438. __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  16439. /* function exit code */
  16440. __Pyx_RefNannyFinishContext();
  16441. }
  16442. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  16443. __Pyx_RefNannyDeclarations
  16444. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  16445. /* "array.pxd":119
  16446. *
  16447. * def __releasebuffer__(self, Py_buffer* info):
  16448. * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
  16449. *
  16450. * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
  16451. */
  16452. PyObject_Free(__pyx_v_info->shape);
  16453. /* "array.pxd":118
  16454. * info.obj = self
  16455. *
  16456. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  16457. * PyObject_Free(info.shape)
  16458. *
  16459. */
  16460. /* function exit code */
  16461. __Pyx_RefNannyFinishContext();
  16462. }
  16463. /* "array.pxd":130
  16464. *
  16465. *
  16466. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  16467. * """ fast creation of a new array, given a template array.
  16468. * type will be same as template.
  16469. */
  16470. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
  16471. arrayobject *__pyx_v_op = NULL;
  16472. arrayobject *__pyx_r = NULL;
  16473. __Pyx_RefNannyDeclarations
  16474. PyObject *__pyx_t_1 = NULL;
  16475. int __pyx_t_2;
  16476. int __pyx_t_3;
  16477. int __pyx_t_4;
  16478. __Pyx_RefNannySetupContext("clone", 0);
  16479. /* "array.pxd":134
  16480. * type will be same as template.
  16481. * if zero is true, new array will be initialized with zeroes."""
  16482. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
  16483. * if zero and op is not None:
  16484. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16485. */
  16486. __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_template)), __pyx_v_length, __pyx_v_template->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 134, __pyx_L1_error)
  16487. __Pyx_GOTREF(__pyx_t_1);
  16488. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  16489. __pyx_t_1 = 0;
  16490. /* "array.pxd":135
  16491. * if zero is true, new array will be initialized with zeroes."""
  16492. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16493. * if zero and op is not None: # <<<<<<<<<<<<<<
  16494. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16495. * return op
  16496. */
  16497. __pyx_t_3 = (__pyx_v_zero != 0);
  16498. if (__pyx_t_3) {
  16499. } else {
  16500. __pyx_t_2 = __pyx_t_3;
  16501. goto __pyx_L4_bool_binop_done;
  16502. }
  16503. __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
  16504. __pyx_t_4 = (__pyx_t_3 != 0);
  16505. __pyx_t_2 = __pyx_t_4;
  16506. __pyx_L4_bool_binop_done:;
  16507. if (__pyx_t_2) {
  16508. /* "array.pxd":136
  16509. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16510. * if zero and op is not None:
  16511. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  16512. * return op
  16513. *
  16514. */
  16515. (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
  16516. /* "array.pxd":135
  16517. * if zero is true, new array will be initialized with zeroes."""
  16518. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  16519. * if zero and op is not None: # <<<<<<<<<<<<<<
  16520. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16521. * return op
  16522. */
  16523. }
  16524. /* "array.pxd":137
  16525. * if zero and op is not None:
  16526. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  16527. * return op # <<<<<<<<<<<<<<
  16528. *
  16529. * cdef inline array copy(array self):
  16530. */
  16531. __Pyx_XDECREF(((PyObject *)__pyx_r));
  16532. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  16533. __pyx_r = __pyx_v_op;
  16534. goto __pyx_L0;
  16535. /* "array.pxd":130
  16536. *
  16537. *
  16538. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  16539. * """ fast creation of a new array, given a template array.
  16540. * type will be same as template.
  16541. */
  16542. /* function exit code */
  16543. __pyx_L1_error:;
  16544. __Pyx_XDECREF(__pyx_t_1);
  16545. __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16546. __pyx_r = 0;
  16547. __pyx_L0:;
  16548. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  16549. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  16550. __Pyx_RefNannyFinishContext();
  16551. return __pyx_r;
  16552. }
  16553. /* "array.pxd":139
  16554. * return op
  16555. *
  16556. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  16557. * """ make a copy of an array. """
  16558. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  16559. */
  16560. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
  16561. arrayobject *__pyx_v_op = NULL;
  16562. arrayobject *__pyx_r = NULL;
  16563. __Pyx_RefNannyDeclarations
  16564. PyObject *__pyx_t_1 = NULL;
  16565. __Pyx_RefNannySetupContext("copy", 0);
  16566. /* "array.pxd":141
  16567. * cdef inline array copy(array self):
  16568. * """ make a copy of an array. """
  16569. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
  16570. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  16571. * return op
  16572. */
  16573. __pyx_t_1 = ((PyObject *)newarrayobject(Py_TYPE(((PyObject *)__pyx_v_self)), Py_SIZE(((PyObject *)__pyx_v_self)), __pyx_v_self->ob_descr)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 141, __pyx_L1_error)
  16574. __Pyx_GOTREF(__pyx_t_1);
  16575. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  16576. __pyx_t_1 = 0;
  16577. /* "array.pxd":142
  16578. * """ make a copy of an array. """
  16579. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  16580. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  16581. * return op
  16582. *
  16583. */
  16584. (void)(memcpy(__pyx_v_op->data.as_chars, __pyx_v_self->data.as_chars, (Py_SIZE(((PyObject *)__pyx_v_op)) * __pyx_v_op->ob_descr->itemsize)));
  16585. /* "array.pxd":143
  16586. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  16587. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  16588. * return op # <<<<<<<<<<<<<<
  16589. *
  16590. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
  16591. */
  16592. __Pyx_XDECREF(((PyObject *)__pyx_r));
  16593. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  16594. __pyx_r = __pyx_v_op;
  16595. goto __pyx_L0;
  16596. /* "array.pxd":139
  16597. * return op
  16598. *
  16599. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  16600. * """ make a copy of an array. """
  16601. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  16602. */
  16603. /* function exit code */
  16604. __pyx_L1_error:;
  16605. __Pyx_XDECREF(__pyx_t_1);
  16606. __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16607. __pyx_r = 0;
  16608. __pyx_L0:;
  16609. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  16610. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  16611. __Pyx_RefNannyFinishContext();
  16612. return __pyx_r;
  16613. }
  16614. /* "array.pxd":145
  16615. * return op
  16616. *
  16617. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  16618. * """ efficient appending of new stuff of same type
  16619. * (e.g. of same array type)
  16620. */
  16621. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  16622. Py_ssize_t __pyx_v_itemsize;
  16623. Py_ssize_t __pyx_v_origsize;
  16624. int __pyx_r;
  16625. __Pyx_RefNannyDeclarations
  16626. int __pyx_t_1;
  16627. __Pyx_RefNannySetupContext("extend_buffer", 0);
  16628. /* "array.pxd":149
  16629. * (e.g. of same array type)
  16630. * n: number of elements (not number of bytes!) """
  16631. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
  16632. * cdef Py_ssize_t origsize = Py_SIZE(self)
  16633. * resize_smart(self, origsize + n)
  16634. */
  16635. __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
  16636. __pyx_v_itemsize = __pyx_t_1;
  16637. /* "array.pxd":150
  16638. * n: number of elements (not number of bytes!) """
  16639. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  16640. * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
  16641. * resize_smart(self, origsize + n)
  16642. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  16643. */
  16644. __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
  16645. /* "array.pxd":151
  16646. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  16647. * cdef Py_ssize_t origsize = Py_SIZE(self)
  16648. * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
  16649. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  16650. * return 0
  16651. */
  16652. __pyx_t_1 = resize_smart(__pyx_v_self, (__pyx_v_origsize + __pyx_v_n)); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(3, 151, __pyx_L1_error)
  16653. /* "array.pxd":152
  16654. * cdef Py_ssize_t origsize = Py_SIZE(self)
  16655. * resize_smart(self, origsize + n)
  16656. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
  16657. * return 0
  16658. *
  16659. */
  16660. (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
  16661. /* "array.pxd":153
  16662. * resize_smart(self, origsize + n)
  16663. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  16664. * return 0 # <<<<<<<<<<<<<<
  16665. *
  16666. * cdef inline int extend(array self, array other) except -1:
  16667. */
  16668. __pyx_r = 0;
  16669. goto __pyx_L0;
  16670. /* "array.pxd":145
  16671. * return op
  16672. *
  16673. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  16674. * """ efficient appending of new stuff of same type
  16675. * (e.g. of same array type)
  16676. */
  16677. /* function exit code */
  16678. __pyx_L1_error:;
  16679. __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16680. __pyx_r = -1;
  16681. __pyx_L0:;
  16682. __Pyx_RefNannyFinishContext();
  16683. return __pyx_r;
  16684. }
  16685. /* "array.pxd":155
  16686. * return 0
  16687. *
  16688. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  16689. * """ extend array with data from another array; types must match. """
  16690. * if self.ob_descr.typecode != other.ob_descr.typecode:
  16691. */
  16692. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  16693. int __pyx_r;
  16694. __Pyx_RefNannyDeclarations
  16695. int __pyx_t_1;
  16696. int __pyx_t_2;
  16697. __Pyx_RefNannySetupContext("extend", 0);
  16698. /* "array.pxd":157
  16699. * cdef inline int extend(array self, array other) except -1:
  16700. * """ extend array with data from another array; types must match. """
  16701. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  16702. * PyErr_BadArgument()
  16703. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  16704. */
  16705. __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
  16706. if (__pyx_t_1) {
  16707. /* "array.pxd":158
  16708. * """ extend array with data from another array; types must match. """
  16709. * if self.ob_descr.typecode != other.ob_descr.typecode:
  16710. * PyErr_BadArgument() # <<<<<<<<<<<<<<
  16711. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  16712. *
  16713. */
  16714. __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 158, __pyx_L1_error)
  16715. /* "array.pxd":157
  16716. * cdef inline int extend(array self, array other) except -1:
  16717. * """ extend array with data from another array; types must match. """
  16718. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  16719. * PyErr_BadArgument()
  16720. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  16721. */
  16722. }
  16723. /* "array.pxd":159
  16724. * if self.ob_descr.typecode != other.ob_descr.typecode:
  16725. * PyErr_BadArgument()
  16726. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
  16727. *
  16728. * cdef inline void zero(array self):
  16729. */
  16730. __pyx_t_2 = __pyx_f_7cpython_5array_extend_buffer(__pyx_v_self, __pyx_v_other->data.as_chars, Py_SIZE(((PyObject *)__pyx_v_other))); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(3, 159, __pyx_L1_error)
  16731. __pyx_r = __pyx_t_2;
  16732. goto __pyx_L0;
  16733. /* "array.pxd":155
  16734. * return 0
  16735. *
  16736. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  16737. * """ extend array with data from another array; types must match. """
  16738. * if self.ob_descr.typecode != other.ob_descr.typecode:
  16739. */
  16740. /* function exit code */
  16741. __pyx_L1_error:;
  16742. __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16743. __pyx_r = -1;
  16744. __pyx_L0:;
  16745. __Pyx_RefNannyFinishContext();
  16746. return __pyx_r;
  16747. }
  16748. /* "array.pxd":161
  16749. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  16750. *
  16751. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  16752. * """ set all elements of array to zero. """
  16753. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  16754. */
  16755. static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
  16756. __Pyx_RefNannyDeclarations
  16757. __Pyx_RefNannySetupContext("zero", 0);
  16758. /* "array.pxd":163
  16759. * cdef inline void zero(array self):
  16760. * """ set all elements of array to zero. """
  16761. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
  16762. */
  16763. (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
  16764. /* "array.pxd":161
  16765. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  16766. *
  16767. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  16768. * """ set all elements of array to zero. """
  16769. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  16770. */
  16771. /* function exit code */
  16772. __Pyx_RefNannyFinishContext();
  16773. }
  16774. /* "string.to_py":31
  16775. *
  16776. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  16777. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16778. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  16779. * cdef extern from *:
  16780. */
  16781. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  16782. PyObject *__pyx_r = NULL;
  16783. __Pyx_RefNannyDeclarations
  16784. PyObject *__pyx_t_1 = NULL;
  16785. __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
  16786. /* "string.to_py":32
  16787. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  16788. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
  16789. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  16790. * cdef extern from *:
  16791. * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
  16792. */
  16793. __Pyx_XDECREF(__pyx_r);
  16794. __pyx_t_1 = __Pyx_PyObject_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 32, __pyx_L1_error)
  16795. __Pyx_GOTREF(__pyx_t_1);
  16796. __pyx_r = __pyx_t_1;
  16797. __pyx_t_1 = 0;
  16798. goto __pyx_L0;
  16799. /* "string.to_py":31
  16800. *
  16801. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  16802. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16803. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  16804. * cdef extern from *:
  16805. */
  16806. /* function exit code */
  16807. __pyx_L1_error:;
  16808. __Pyx_XDECREF(__pyx_t_1);
  16809. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16810. __pyx_r = 0;
  16811. __pyx_L0:;
  16812. __Pyx_XGIVEREF(__pyx_r);
  16813. __Pyx_RefNannyFinishContext();
  16814. return __pyx_r;
  16815. }
  16816. /* "string.to_py":37
  16817. *
  16818. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  16819. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16820. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  16821. * cdef extern from *:
  16822. */
  16823. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  16824. PyObject *__pyx_r = NULL;
  16825. __Pyx_RefNannyDeclarations
  16826. PyObject *__pyx_t_1 = NULL;
  16827. __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
  16828. /* "string.to_py":38
  16829. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  16830. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
  16831. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  16832. * cdef extern from *:
  16833. * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
  16834. */
  16835. __Pyx_XDECREF(__pyx_r);
  16836. __pyx_t_1 = __Pyx_PyUnicode_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 38, __pyx_L1_error)
  16837. __Pyx_GOTREF(__pyx_t_1);
  16838. __pyx_r = __pyx_t_1;
  16839. __pyx_t_1 = 0;
  16840. goto __pyx_L0;
  16841. /* "string.to_py":37
  16842. *
  16843. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  16844. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16845. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  16846. * cdef extern from *:
  16847. */
  16848. /* function exit code */
  16849. __pyx_L1_error:;
  16850. __Pyx_XDECREF(__pyx_t_1);
  16851. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16852. __pyx_r = 0;
  16853. __pyx_L0:;
  16854. __Pyx_XGIVEREF(__pyx_r);
  16855. __Pyx_RefNannyFinishContext();
  16856. return __pyx_r;
  16857. }
  16858. /* "string.to_py":43
  16859. *
  16860. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  16861. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16862. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  16863. * cdef extern from *:
  16864. */
  16865. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  16866. PyObject *__pyx_r = NULL;
  16867. __Pyx_RefNannyDeclarations
  16868. PyObject *__pyx_t_1 = NULL;
  16869. __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
  16870. /* "string.to_py":44
  16871. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  16872. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
  16873. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  16874. * cdef extern from *:
  16875. * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
  16876. */
  16877. __Pyx_XDECREF(__pyx_r);
  16878. __pyx_t_1 = __Pyx_PyStr_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 44, __pyx_L1_error)
  16879. __Pyx_GOTREF(__pyx_t_1);
  16880. __pyx_r = __pyx_t_1;
  16881. __pyx_t_1 = 0;
  16882. goto __pyx_L0;
  16883. /* "string.to_py":43
  16884. *
  16885. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  16886. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16887. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  16888. * cdef extern from *:
  16889. */
  16890. /* function exit code */
  16891. __pyx_L1_error:;
  16892. __Pyx_XDECREF(__pyx_t_1);
  16893. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16894. __pyx_r = 0;
  16895. __pyx_L0:;
  16896. __Pyx_XGIVEREF(__pyx_r);
  16897. __Pyx_RefNannyFinishContext();
  16898. return __pyx_r;
  16899. }
  16900. /* "string.to_py":49
  16901. *
  16902. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  16903. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16904. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  16905. * cdef extern from *:
  16906. */
  16907. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  16908. PyObject *__pyx_r = NULL;
  16909. __Pyx_RefNannyDeclarations
  16910. PyObject *__pyx_t_1 = NULL;
  16911. __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
  16912. /* "string.to_py":50
  16913. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  16914. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
  16915. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  16916. * cdef extern from *:
  16917. * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
  16918. */
  16919. __Pyx_XDECREF(__pyx_r);
  16920. __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 50, __pyx_L1_error)
  16921. __Pyx_GOTREF(__pyx_t_1);
  16922. __pyx_r = __pyx_t_1;
  16923. __pyx_t_1 = 0;
  16924. goto __pyx_L0;
  16925. /* "string.to_py":49
  16926. *
  16927. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  16928. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16929. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  16930. * cdef extern from *:
  16931. */
  16932. /* function exit code */
  16933. __pyx_L1_error:;
  16934. __Pyx_XDECREF(__pyx_t_1);
  16935. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16936. __pyx_r = 0;
  16937. __pyx_L0:;
  16938. __Pyx_XGIVEREF(__pyx_r);
  16939. __Pyx_RefNannyFinishContext();
  16940. return __pyx_r;
  16941. }
  16942. /* "string.to_py":55
  16943. *
  16944. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  16945. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16946. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  16947. *
  16948. */
  16949. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  16950. PyObject *__pyx_r = NULL;
  16951. __Pyx_RefNannyDeclarations
  16952. PyObject *__pyx_t_1 = NULL;
  16953. __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
  16954. /* "string.to_py":56
  16955. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  16956. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
  16957. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  16958. *
  16959. */
  16960. __Pyx_XDECREF(__pyx_r);
  16961. __pyx_t_1 = __Pyx_PyByteArray_FromStringAndSize(__pyx_v_s.data(), __pyx_v_s.size()); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 56, __pyx_L1_error)
  16962. __Pyx_GOTREF(__pyx_t_1);
  16963. __pyx_r = __pyx_t_1;
  16964. __pyx_t_1 = 0;
  16965. goto __pyx_L0;
  16966. /* "string.to_py":55
  16967. *
  16968. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  16969. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  16970. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  16971. *
  16972. */
  16973. /* function exit code */
  16974. __pyx_L1_error:;
  16975. __Pyx_XDECREF(__pyx_t_1);
  16976. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16977. __pyx_r = 0;
  16978. __pyx_L0:;
  16979. __Pyx_XGIVEREF(__pyx_r);
  16980. __Pyx_RefNannyFinishContext();
  16981. return __pyx_r;
  16982. }
  16983. /* "string.from_py":13
  16984. *
  16985. * @cname("__pyx_convert_string_from_py_std__in_string")
  16986. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  16987. * cdef Py_ssize_t length = 0
  16988. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  16989. */
  16990. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  16991. Py_ssize_t __pyx_v_length;
  16992. char const *__pyx_v_data;
  16993. std::string __pyx_r;
  16994. __Pyx_RefNannyDeclarations
  16995. char const *__pyx_t_1;
  16996. __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
  16997. /* "string.from_py":14
  16998. * @cname("__pyx_convert_string_from_py_std__in_string")
  16999. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17000. * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
  17001. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17002. * return string(data, length)
  17003. */
  17004. __pyx_v_length = 0;
  17005. /* "string.from_py":15
  17006. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17007. * cdef Py_ssize_t length = 0
  17008. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
  17009. * return string(data, length)
  17010. *
  17011. */
  17012. __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(1, 15, __pyx_L1_error)
  17013. __pyx_v_data = __pyx_t_1;
  17014. /* "string.from_py":16
  17015. * cdef Py_ssize_t length = 0
  17016. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17017. * return string(data, length) # <<<<<<<<<<<<<<
  17018. *
  17019. *
  17020. */
  17021. __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  17022. goto __pyx_L0;
  17023. /* "string.from_py":13
  17024. *
  17025. * @cname("__pyx_convert_string_from_py_std__in_string")
  17026. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17027. * cdef Py_ssize_t length = 0
  17028. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17029. */
  17030. /* function exit code */
  17031. __pyx_L1_error:;
  17032. __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17033. __Pyx_pretend_to_initialize(&__pyx_r);
  17034. __pyx_L0:;
  17035. __Pyx_RefNannyFinishContext();
  17036. return __pyx_r;
  17037. }
  17038. /* "pair.to_py":158
  17039. *
  17040. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17041. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17042. * return p.first, p.second
  17043. *
  17044. */
  17045. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &__pyx_v_p) {
  17046. PyObject *__pyx_r = NULL;
  17047. __Pyx_RefNannyDeclarations
  17048. PyObject *__pyx_t_1 = NULL;
  17049. PyObject *__pyx_t_2 = NULL;
  17050. PyObject *__pyx_t_3 = NULL;
  17051. __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_size_t____size_t", 0);
  17052. /* "pair.to_py":159
  17053. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17054. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p):
  17055. * return p.first, p.second # <<<<<<<<<<<<<<
  17056. *
  17057. *
  17058. */
  17059. __Pyx_XDECREF(__pyx_r);
  17060. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
  17061. __Pyx_GOTREF(__pyx_t_1);
  17062. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error)
  17063. __Pyx_GOTREF(__pyx_t_2);
  17064. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error)
  17065. __Pyx_GOTREF(__pyx_t_3);
  17066. __Pyx_GIVEREF(__pyx_t_1);
  17067. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  17068. __Pyx_GIVEREF(__pyx_t_2);
  17069. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  17070. __pyx_t_1 = 0;
  17071. __pyx_t_2 = 0;
  17072. __pyx_r = __pyx_t_3;
  17073. __pyx_t_3 = 0;
  17074. goto __pyx_L0;
  17075. /* "pair.to_py":158
  17076. *
  17077. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17078. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17079. * return p.first, p.second
  17080. *
  17081. */
  17082. /* function exit code */
  17083. __pyx_L1_error:;
  17084. __Pyx_XDECREF(__pyx_t_1);
  17085. __Pyx_XDECREF(__pyx_t_2);
  17086. __Pyx_XDECREF(__pyx_t_3);
  17087. __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_size_t____size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17088. __pyx_r = 0;
  17089. __pyx_L0:;
  17090. __Pyx_XGIVEREF(__pyx_r);
  17091. __Pyx_RefNannyFinishContext();
  17092. return __pyx_r;
  17093. }
  17094. /* "vector.to_py":60
  17095. *
  17096. * @cname("__pyx_convert_vector_to_py_size_t")
  17097. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17098. * return [v[i] for i in range(v.size())]
  17099. *
  17100. */
  17101. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &__pyx_v_v) {
  17102. size_t __pyx_v_i;
  17103. PyObject *__pyx_r = NULL;
  17104. __Pyx_RefNannyDeclarations
  17105. PyObject *__pyx_t_1 = NULL;
  17106. size_t __pyx_t_2;
  17107. size_t __pyx_t_3;
  17108. size_t __pyx_t_4;
  17109. PyObject *__pyx_t_5 = NULL;
  17110. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_size_t", 0);
  17111. /* "vector.to_py":61
  17112. * @cname("__pyx_convert_vector_to_py_size_t")
  17113. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v):
  17114. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17115. *
  17116. *
  17117. */
  17118. __Pyx_XDECREF(__pyx_r);
  17119. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17120. __Pyx_GOTREF(__pyx_t_1);
  17121. __pyx_t_2 = __pyx_v_v.size();
  17122. __pyx_t_3 = __pyx_t_2;
  17123. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17124. __pyx_v_i = __pyx_t_4;
  17125. __pyx_t_5 = __Pyx_PyInt_FromSize_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17126. __Pyx_GOTREF(__pyx_t_5);
  17127. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17128. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17129. }
  17130. __pyx_r = __pyx_t_1;
  17131. __pyx_t_1 = 0;
  17132. goto __pyx_L0;
  17133. /* "vector.to_py":60
  17134. *
  17135. * @cname("__pyx_convert_vector_to_py_size_t")
  17136. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17137. * return [v[i] for i in range(v.size())]
  17138. *
  17139. */
  17140. /* function exit code */
  17141. __pyx_L1_error:;
  17142. __Pyx_XDECREF(__pyx_t_1);
  17143. __Pyx_XDECREF(__pyx_t_5);
  17144. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17145. __pyx_r = 0;
  17146. __pyx_L0:;
  17147. __Pyx_XGIVEREF(__pyx_r);
  17148. __Pyx_RefNannyFinishContext();
  17149. return __pyx_r;
  17150. }
  17151. /* "map.from_py":174
  17152. *
  17153. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17154. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17155. * cdef dict d = o
  17156. * cdef map[X,Y] m
  17157. */
  17158. static std::map<std::string,std::string> __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *__pyx_v_o) {
  17159. PyObject *__pyx_v_d = 0;
  17160. std::map<std::string,std::string> __pyx_v_m;
  17161. PyObject *__pyx_v_key = NULL;
  17162. PyObject *__pyx_v_value = NULL;
  17163. std::map<std::string,std::string> __pyx_r;
  17164. __Pyx_RefNannyDeclarations
  17165. PyObject *__pyx_t_1 = NULL;
  17166. Py_ssize_t __pyx_t_2;
  17167. Py_ssize_t __pyx_t_3;
  17168. int __pyx_t_4;
  17169. PyObject *__pyx_t_5 = NULL;
  17170. PyObject *__pyx_t_6 = NULL;
  17171. int __pyx_t_7;
  17172. std::string __pyx_t_8;
  17173. std::string __pyx_t_9;
  17174. __Pyx_RefNannySetupContext("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);
  17175. /* "map.from_py":175
  17176. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17177. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
  17178. * cdef dict d = o # <<<<<<<<<<<<<<
  17179. * cdef map[X,Y] m
  17180. * for key, value in d.iteritems():
  17181. */
  17182. if (!(likely(PyDict_CheckExact(__pyx_v_o))||((__pyx_v_o) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "dict", Py_TYPE(__pyx_v_o)->tp_name), 0))) __PYX_ERR(1, 175, __pyx_L1_error)
  17183. __pyx_t_1 = __pyx_v_o;
  17184. __Pyx_INCREF(__pyx_t_1);
  17185. __pyx_v_d = ((PyObject*)__pyx_t_1);
  17186. __pyx_t_1 = 0;
  17187. /* "map.from_py":177
  17188. * cdef dict d = o
  17189. * cdef map[X,Y] m
  17190. * for key, value in d.iteritems(): # <<<<<<<<<<<<<<
  17191. * m.insert(pair[X,Y](<X>key, <Y>value))
  17192. * return m
  17193. */
  17194. __pyx_t_2 = 0;
  17195. if (unlikely(__pyx_v_d == Py_None)) {
  17196. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
  17197. __PYX_ERR(1, 177, __pyx_L1_error)
  17198. }
  17199. __pyx_t_5 = __Pyx_dict_iterator(__pyx_v_d, 1, __pyx_n_s_iteritems, (&__pyx_t_3), (&__pyx_t_4)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 177, __pyx_L1_error)
  17200. __Pyx_GOTREF(__pyx_t_5);
  17201. __Pyx_XDECREF(__pyx_t_1);
  17202. __pyx_t_1 = __pyx_t_5;
  17203. __pyx_t_5 = 0;
  17204. while (1) {
  17205. __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_3, &__pyx_t_2, &__pyx_t_5, &__pyx_t_6, NULL, __pyx_t_4);
  17206. if (unlikely(__pyx_t_7 == 0)) break;
  17207. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 177, __pyx_L1_error)
  17208. __Pyx_GOTREF(__pyx_t_5);
  17209. __Pyx_GOTREF(__pyx_t_6);
  17210. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  17211. __pyx_t_5 = 0;
  17212. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  17213. __pyx_t_6 = 0;
  17214. /* "map.from_py":178
  17215. * cdef map[X,Y] m
  17216. * for key, value in d.iteritems():
  17217. * m.insert(pair[X,Y](<X>key, <Y>value)) # <<<<<<<<<<<<<<
  17218. * return m
  17219. *
  17220. */
  17221. __pyx_t_8 = __pyx_convert_string_from_py_std__in_string(__pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L1_error)
  17222. __pyx_t_9 = __pyx_convert_string_from_py_std__in_string(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 178, __pyx_L1_error)
  17223. __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  17224. }
  17225. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17226. /* "map.from_py":179
  17227. * for key, value in d.iteritems():
  17228. * m.insert(pair[X,Y](<X>key, <Y>value))
  17229. * return m # <<<<<<<<<<<<<<
  17230. *
  17231. *
  17232. */
  17233. __pyx_r = __pyx_v_m;
  17234. goto __pyx_L0;
  17235. /* "map.from_py":174
  17236. *
  17237. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17238. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17239. * cdef dict d = o
  17240. * cdef map[X,Y] m
  17241. */
  17242. /* function exit code */
  17243. __pyx_L1_error:;
  17244. __Pyx_XDECREF(__pyx_t_1);
  17245. __Pyx_XDECREF(__pyx_t_5);
  17246. __Pyx_XDECREF(__pyx_t_6);
  17247. __Pyx_AddTraceback("map.from_py.__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17248. __Pyx_pretend_to_initialize(&__pyx_r);
  17249. __pyx_L0:;
  17250. __Pyx_XDECREF(__pyx_v_d);
  17251. __Pyx_XDECREF(__pyx_v_key);
  17252. __Pyx_XDECREF(__pyx_v_value);
  17253. __Pyx_RefNannyFinishContext();
  17254. return __pyx_r;
  17255. }
  17256. /* "map.to_py":201
  17257. *
  17258. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17259. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17260. * o = {}
  17261. * cdef const map[X,Y].value_type *key_value
  17262. */
  17263. static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(std::map<std::string,std::string> const &__pyx_v_s) {
  17264. PyObject *__pyx_v_o = NULL;
  17265. std::map<std::string,std::string> ::value_type const *__pyx_v_key_value;
  17266. std::map<std::string,std::string> ::const_iterator __pyx_v_iter;
  17267. PyObject *__pyx_r = NULL;
  17268. __Pyx_RefNannyDeclarations
  17269. PyObject *__pyx_t_1 = NULL;
  17270. int __pyx_t_2;
  17271. PyObject *__pyx_t_3 = NULL;
  17272. __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", 0);
  17273. /* "map.to_py":202
  17274. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17275. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):
  17276. * o = {} # <<<<<<<<<<<<<<
  17277. * cdef const map[X,Y].value_type *key_value
  17278. * cdef map[X,Y].const_iterator iter = s.begin()
  17279. */
  17280. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17281. __Pyx_GOTREF(__pyx_t_1);
  17282. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17283. __pyx_t_1 = 0;
  17284. /* "map.to_py":204
  17285. * o = {}
  17286. * cdef const map[X,Y].value_type *key_value
  17287. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17288. * while iter != s.end():
  17289. * key_value = &cython.operator.dereference(iter)
  17290. */
  17291. __pyx_v_iter = __pyx_v_s.begin();
  17292. /* "map.to_py":205
  17293. * cdef const map[X,Y].value_type *key_value
  17294. * cdef map[X,Y].const_iterator iter = s.begin()
  17295. * while iter != s.end(): # <<<<<<<<<<<<<<
  17296. * key_value = &cython.operator.dereference(iter)
  17297. * o[key_value.first] = key_value.second
  17298. */
  17299. while (1) {
  17300. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17301. if (!__pyx_t_2) break;
  17302. /* "map.to_py":206
  17303. * cdef map[X,Y].const_iterator iter = s.begin()
  17304. * while iter != s.end():
  17305. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17306. * o[key_value.first] = key_value.second
  17307. * cython.operator.preincrement(iter)
  17308. */
  17309. __pyx_v_key_value = (&(*__pyx_v_iter));
  17310. /* "map.to_py":207
  17311. * while iter != s.end():
  17312. * key_value = &cython.operator.dereference(iter)
  17313. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17314. * cython.operator.preincrement(iter)
  17315. * return o
  17316. */
  17317. __pyx_t_1 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
  17318. __Pyx_GOTREF(__pyx_t_1);
  17319. __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error)
  17320. __Pyx_GOTREF(__pyx_t_3);
  17321. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17322. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17323. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17324. /* "map.to_py":208
  17325. * key_value = &cython.operator.dereference(iter)
  17326. * o[key_value.first] = key_value.second
  17327. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17328. * return o
  17329. *
  17330. */
  17331. (void)((++__pyx_v_iter));
  17332. }
  17333. /* "map.to_py":209
  17334. * o[key_value.first] = key_value.second
  17335. * cython.operator.preincrement(iter)
  17336. * return o # <<<<<<<<<<<<<<
  17337. *
  17338. *
  17339. */
  17340. __Pyx_XDECREF(__pyx_r);
  17341. __Pyx_INCREF(__pyx_v_o);
  17342. __pyx_r = __pyx_v_o;
  17343. goto __pyx_L0;
  17344. /* "map.to_py":201
  17345. *
  17346. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17347. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17348. * o = {}
  17349. * cdef const map[X,Y].value_type *key_value
  17350. */
  17351. /* function exit code */
  17352. __pyx_L1_error:;
  17353. __Pyx_XDECREF(__pyx_t_1);
  17354. __Pyx_XDECREF(__pyx_t_3);
  17355. __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17356. __pyx_r = 0;
  17357. __pyx_L0:;
  17358. __Pyx_XDECREF(__pyx_v_o);
  17359. __Pyx_XGIVEREF(__pyx_r);
  17360. __Pyx_RefNannyFinishContext();
  17361. return __pyx_r;
  17362. }
  17363. static PyObject *__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > const &__pyx_v_s) {
  17364. PyObject *__pyx_v_o = NULL;
  17365. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::value_type const *__pyx_v_key_value;
  17366. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::const_iterator __pyx_v_iter;
  17367. PyObject *__pyx_r = NULL;
  17368. __Pyx_RefNannyDeclarations
  17369. PyObject *__pyx_t_1 = NULL;
  17370. int __pyx_t_2;
  17371. PyObject *__pyx_t_3 = NULL;
  17372. __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);
  17373. /* "map.to_py":202
  17374. * @cname("__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  17375. * cdef object __pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const map[X,Y]& s):
  17376. * o = {} # <<<<<<<<<<<<<<
  17377. * cdef const map[X,Y].value_type *key_value
  17378. * cdef map[X,Y].const_iterator iter = s.begin()
  17379. */
  17380. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17381. __Pyx_GOTREF(__pyx_t_1);
  17382. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17383. __pyx_t_1 = 0;
  17384. /* "map.to_py":204
  17385. * o = {}
  17386. * cdef const map[X,Y].value_type *key_value
  17387. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17388. * while iter != s.end():
  17389. * key_value = &cython.operator.dereference(iter)
  17390. */
  17391. __pyx_v_iter = __pyx_v_s.begin();
  17392. /* "map.to_py":205
  17393. * cdef const map[X,Y].value_type *key_value
  17394. * cdef map[X,Y].const_iterator iter = s.begin()
  17395. * while iter != s.end(): # <<<<<<<<<<<<<<
  17396. * key_value = &cython.operator.dereference(iter)
  17397. * o[key_value.first] = key_value.second
  17398. */
  17399. while (1) {
  17400. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17401. if (!__pyx_t_2) break;
  17402. /* "map.to_py":206
  17403. * cdef map[X,Y].const_iterator iter = s.begin()
  17404. * while iter != s.end():
  17405. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17406. * o[key_value.first] = key_value.second
  17407. * cython.operator.preincrement(iter)
  17408. */
  17409. __pyx_v_key_value = (&(*__pyx_v_iter));
  17410. /* "map.to_py":207
  17411. * while iter != s.end():
  17412. * key_value = &cython.operator.dereference(iter)
  17413. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17414. * cython.operator.preincrement(iter)
  17415. * return o
  17416. */
  17417. __pyx_t_1 = __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(__pyx_v_key_value->second); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 207, __pyx_L1_error)
  17418. __Pyx_GOTREF(__pyx_t_1);
  17419. __pyx_t_3 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_v_key_value->first); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 207, __pyx_L1_error)
  17420. __Pyx_GOTREF(__pyx_t_3);
  17421. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17422. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17423. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17424. /* "map.to_py":208
  17425. * key_value = &cython.operator.dereference(iter)
  17426. * o[key_value.first] = key_value.second
  17427. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17428. * return o
  17429. *
  17430. */
  17431. (void)((++__pyx_v_iter));
  17432. }
  17433. /* "map.to_py":209
  17434. * o[key_value.first] = key_value.second
  17435. * cython.operator.preincrement(iter)
  17436. * return o # <<<<<<<<<<<<<<
  17437. *
  17438. *
  17439. */
  17440. __Pyx_XDECREF(__pyx_r);
  17441. __Pyx_INCREF(__pyx_v_o);
  17442. __pyx_r = __pyx_v_o;
  17443. goto __pyx_L0;
  17444. /* "map.to_py":201
  17445. *
  17446. * @cname("__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  17447. * cdef object __pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17448. * o = {}
  17449. * cdef const map[X,Y].value_type *key_value
  17450. */
  17451. /* function exit code */
  17452. __pyx_L1_error:;
  17453. __Pyx_XDECREF(__pyx_t_1);
  17454. __Pyx_XDECREF(__pyx_t_3);
  17455. __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e_______std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17456. __pyx_r = 0;
  17457. __pyx_L0:;
  17458. __Pyx_XDECREF(__pyx_v_o);
  17459. __Pyx_XGIVEREF(__pyx_r);
  17460. __Pyx_RefNannyFinishContext();
  17461. return __pyx_r;
  17462. }
  17463. /* "vector.to_py":60
  17464. *
  17465. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17466. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17467. * return [v[i] for i in range(v.size())]
  17468. *
  17469. */
  17470. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(const std::vector<std::vector<size_t> > &__pyx_v_v) {
  17471. size_t __pyx_v_i;
  17472. PyObject *__pyx_r = NULL;
  17473. __Pyx_RefNannyDeclarations
  17474. PyObject *__pyx_t_1 = NULL;
  17475. size_t __pyx_t_2;
  17476. size_t __pyx_t_3;
  17477. size_t __pyx_t_4;
  17478. PyObject *__pyx_t_5 = NULL;
  17479. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  17480. /* "vector.to_py":61
  17481. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17482. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v):
  17483. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17484. *
  17485. *
  17486. */
  17487. __Pyx_XDECREF(__pyx_r);
  17488. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17489. __Pyx_GOTREF(__pyx_t_1);
  17490. __pyx_t_2 = __pyx_v_v.size();
  17491. __pyx_t_3 = __pyx_t_2;
  17492. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17493. __pyx_v_i = __pyx_t_4;
  17494. __pyx_t_5 = __pyx_convert_vector_to_py_size_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17495. __Pyx_GOTREF(__pyx_t_5);
  17496. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17497. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17498. }
  17499. __pyx_r = __pyx_t_1;
  17500. __pyx_t_1 = 0;
  17501. goto __pyx_L0;
  17502. /* "vector.to_py":60
  17503. *
  17504. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  17505. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17506. * return [v[i] for i in range(v.size())]
  17507. *
  17508. */
  17509. /* function exit code */
  17510. __pyx_L1_error:;
  17511. __Pyx_XDECREF(__pyx_t_1);
  17512. __Pyx_XDECREF(__pyx_t_5);
  17513. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17514. __pyx_r = 0;
  17515. __pyx_L0:;
  17516. __Pyx_XGIVEREF(__pyx_r);
  17517. __Pyx_RefNannyFinishContext();
  17518. return __pyx_r;
  17519. }
  17520. /* "vector.from_py":45
  17521. *
  17522. * @cname("__pyx_convert_vector_from_py_double")
  17523. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  17524. * cdef vector[X] v
  17525. * for item in o:
  17526. */
  17527. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  17528. std::vector<double> __pyx_v_v;
  17529. PyObject *__pyx_v_item = NULL;
  17530. std::vector<double> __pyx_r;
  17531. __Pyx_RefNannyDeclarations
  17532. PyObject *__pyx_t_1 = NULL;
  17533. Py_ssize_t __pyx_t_2;
  17534. PyObject *(*__pyx_t_3)(PyObject *);
  17535. PyObject *__pyx_t_4 = NULL;
  17536. double __pyx_t_5;
  17537. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  17538. /* "vector.from_py":47
  17539. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  17540. * cdef vector[X] v
  17541. * for item in o: # <<<<<<<<<<<<<<
  17542. * v.push_back(<X>item)
  17543. * return v
  17544. */
  17545. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  17546. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  17547. __pyx_t_3 = NULL;
  17548. } else {
  17549. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  17550. __Pyx_GOTREF(__pyx_t_1);
  17551. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  17552. }
  17553. for (;;) {
  17554. if (likely(!__pyx_t_3)) {
  17555. if (likely(PyList_CheckExact(__pyx_t_1))) {
  17556. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  17557. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  17558. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  17559. #else
  17560. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  17561. __Pyx_GOTREF(__pyx_t_4);
  17562. #endif
  17563. } else {
  17564. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  17565. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  17566. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  17567. #else
  17568. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  17569. __Pyx_GOTREF(__pyx_t_4);
  17570. #endif
  17571. }
  17572. } else {
  17573. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  17574. if (unlikely(!__pyx_t_4)) {
  17575. PyObject* exc_type = PyErr_Occurred();
  17576. if (exc_type) {
  17577. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  17578. else __PYX_ERR(1, 47, __pyx_L1_error)
  17579. }
  17580. break;
  17581. }
  17582. __Pyx_GOTREF(__pyx_t_4);
  17583. }
  17584. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  17585. __pyx_t_4 = 0;
  17586. /* "vector.from_py":48
  17587. * cdef vector[X] v
  17588. * for item in o:
  17589. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  17590. * return v
  17591. *
  17592. */
  17593. __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  17594. __pyx_v_v.push_back(((double)__pyx_t_5));
  17595. /* "vector.from_py":47
  17596. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  17597. * cdef vector[X] v
  17598. * for item in o: # <<<<<<<<<<<<<<
  17599. * v.push_back(<X>item)
  17600. * return v
  17601. */
  17602. }
  17603. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17604. /* "vector.from_py":49
  17605. * for item in o:
  17606. * v.push_back(<X>item)
  17607. * return v # <<<<<<<<<<<<<<
  17608. *
  17609. *
  17610. */
  17611. __pyx_r = __pyx_v_v;
  17612. goto __pyx_L0;
  17613. /* "vector.from_py":45
  17614. *
  17615. * @cname("__pyx_convert_vector_from_py_double")
  17616. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  17617. * cdef vector[X] v
  17618. * for item in o:
  17619. */
  17620. /* function exit code */
  17621. __pyx_L1_error:;
  17622. __Pyx_XDECREF(__pyx_t_1);
  17623. __Pyx_XDECREF(__pyx_t_4);
  17624. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17625. __Pyx_pretend_to_initialize(&__pyx_r);
  17626. __pyx_L0:;
  17627. __Pyx_XDECREF(__pyx_v_item);
  17628. __Pyx_RefNannyFinishContext();
  17629. return __pyx_r;
  17630. }
  17631. /* "vector.to_py":60
  17632. *
  17633. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  17634. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  17635. * return [v[i] for i in range(v.size())]
  17636. *
  17637. */
  17638. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &__pyx_v_v) {
  17639. size_t __pyx_v_i;
  17640. PyObject *__pyx_r = NULL;
  17641. __Pyx_RefNannyDeclarations
  17642. PyObject *__pyx_t_1 = NULL;
  17643. size_t __pyx_t_2;
  17644. size_t __pyx_t_3;
  17645. size_t __pyx_t_4;
  17646. PyObject *__pyx_t_5 = NULL;
  17647. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_npy_uint64", 0);
  17648. /* "vector.to_py":61
  17649. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  17650. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v):
  17651. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17652. *
  17653. *
  17654. */
  17655. __Pyx_XDECREF(__pyx_r);
  17656. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17657. __Pyx_GOTREF(__pyx_t_1);
  17658. __pyx_t_2 = __pyx_v_v.size();
  17659. __pyx_t_3 = __pyx_t_2;
  17660. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17661. __pyx_v_i = __pyx_t_4;
  17662. __pyx_t_5 = __Pyx_PyInt_From_npy_uint64((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17663. __Pyx_GOTREF(__pyx_t_5);
  17664. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17665. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17666. }
  17667. __pyx_r = __pyx_t_1;
  17668. __pyx_t_1 = 0;
  17669. goto __pyx_L0;
  17670. /* "vector.to_py":60
  17671. *
  17672. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  17673. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  17674. * return [v[i] for i in range(v.size())]
  17675. *
  17676. */
  17677. /* function exit code */
  17678. __pyx_L1_error:;
  17679. __Pyx_XDECREF(__pyx_t_1);
  17680. __Pyx_XDECREF(__pyx_t_5);
  17681. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_npy_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17682. __pyx_r = 0;
  17683. __pyx_L0:;
  17684. __Pyx_XGIVEREF(__pyx_r);
  17685. __Pyx_RefNannyFinishContext();
  17686. return __pyx_r;
  17687. }
  17688. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(const std::vector<std::pair<size_t,size_t> > &__pyx_v_v) {
  17689. size_t __pyx_v_i;
  17690. PyObject *__pyx_r = NULL;
  17691. __Pyx_RefNannyDeclarations
  17692. PyObject *__pyx_t_1 = NULL;
  17693. size_t __pyx_t_2;
  17694. size_t __pyx_t_3;
  17695. size_t __pyx_t_4;
  17696. PyObject *__pyx_t_5 = NULL;
  17697. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  17698. /* "vector.to_py":61
  17699. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  17700. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v):
  17701. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17702. *
  17703. *
  17704. */
  17705. __Pyx_XDECREF(__pyx_r);
  17706. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17707. __Pyx_GOTREF(__pyx_t_1);
  17708. __pyx_t_2 = __pyx_v_v.size();
  17709. __pyx_t_3 = __pyx_t_2;
  17710. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17711. __pyx_v_i = __pyx_t_4;
  17712. __pyx_t_5 = __pyx_convert_pair_to_py_size_t____size_t((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17713. __Pyx_GOTREF(__pyx_t_5);
  17714. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17715. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17716. }
  17717. __pyx_r = __pyx_t_1;
  17718. __pyx_t_1 = 0;
  17719. goto __pyx_L0;
  17720. /* "vector.to_py":60
  17721. *
  17722. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  17723. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17724. * return [v[i] for i in range(v.size())]
  17725. *
  17726. */
  17727. /* function exit code */
  17728. __pyx_L1_error:;
  17729. __Pyx_XDECREF(__pyx_t_1);
  17730. __Pyx_XDECREF(__pyx_t_5);
  17731. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17732. __pyx_r = 0;
  17733. __pyx_L0:;
  17734. __Pyx_XGIVEREF(__pyx_r);
  17735. __Pyx_RefNannyFinishContext();
  17736. return __pyx_r;
  17737. }
  17738. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &__pyx_v_v) {
  17739. size_t __pyx_v_i;
  17740. PyObject *__pyx_r = NULL;
  17741. __Pyx_RefNannyDeclarations
  17742. PyObject *__pyx_t_1 = NULL;
  17743. size_t __pyx_t_2;
  17744. size_t __pyx_t_3;
  17745. size_t __pyx_t_4;
  17746. PyObject *__pyx_t_5 = NULL;
  17747. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0);
  17748. /* "vector.to_py":61
  17749. * @cname("__pyx_convert_vector_to_py_int")
  17750. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v):
  17751. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17752. *
  17753. *
  17754. */
  17755. __Pyx_XDECREF(__pyx_r);
  17756. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17757. __Pyx_GOTREF(__pyx_t_1);
  17758. __pyx_t_2 = __pyx_v_v.size();
  17759. __pyx_t_3 = __pyx_t_2;
  17760. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17761. __pyx_v_i = __pyx_t_4;
  17762. __pyx_t_5 = __Pyx_PyInt_From_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17763. __Pyx_GOTREF(__pyx_t_5);
  17764. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17765. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17766. }
  17767. __pyx_r = __pyx_t_1;
  17768. __pyx_t_1 = 0;
  17769. goto __pyx_L0;
  17770. /* "vector.to_py":60
  17771. *
  17772. * @cname("__pyx_convert_vector_to_py_int")
  17773. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<<
  17774. * return [v[i] for i in range(v.size())]
  17775. *
  17776. */
  17777. /* function exit code */
  17778. __pyx_L1_error:;
  17779. __Pyx_XDECREF(__pyx_t_1);
  17780. __Pyx_XDECREF(__pyx_t_5);
  17781. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17782. __pyx_r = 0;
  17783. __pyx_L0:;
  17784. __Pyx_XGIVEREF(__pyx_r);
  17785. __Pyx_RefNannyFinishContext();
  17786. return __pyx_r;
  17787. }
  17788. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &__pyx_v_v) {
  17789. size_t __pyx_v_i;
  17790. PyObject *__pyx_r = NULL;
  17791. __Pyx_RefNannyDeclarations
  17792. PyObject *__pyx_t_1 = NULL;
  17793. size_t __pyx_t_2;
  17794. size_t __pyx_t_3;
  17795. size_t __pyx_t_4;
  17796. PyObject *__pyx_t_5 = NULL;
  17797. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", 0);
  17798. /* "vector.to_py":61
  17799. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  17800. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v):
  17801. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17802. *
  17803. *
  17804. */
  17805. __Pyx_XDECREF(__pyx_r);
  17806. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17807. __Pyx_GOTREF(__pyx_t_1);
  17808. __pyx_t_2 = __pyx_v_v.size();
  17809. __pyx_t_3 = __pyx_t_2;
  17810. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17811. __pyx_v_i = __pyx_t_4;
  17812. __pyx_t_5 = __pyx_convert_vector_to_py_int((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17813. __Pyx_GOTREF(__pyx_t_5);
  17814. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17815. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17816. }
  17817. __pyx_r = __pyx_t_1;
  17818. __pyx_t_1 = 0;
  17819. goto __pyx_L0;
  17820. /* "vector.to_py":60
  17821. *
  17822. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  17823. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17824. * return [v[i] for i in range(v.size())]
  17825. *
  17826. */
  17827. /* function exit code */
  17828. __pyx_L1_error:;
  17829. __Pyx_XDECREF(__pyx_t_1);
  17830. __Pyx_XDECREF(__pyx_t_5);
  17831. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17832. __pyx_r = 0;
  17833. __pyx_L0:;
  17834. __Pyx_XGIVEREF(__pyx_r);
  17835. __Pyx_RefNannyFinishContext();
  17836. return __pyx_r;
  17837. }
  17838. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(const std::vector<std::vector<npy_uint64> > &__pyx_v_v) {
  17839. size_t __pyx_v_i;
  17840. PyObject *__pyx_r = NULL;
  17841. __Pyx_RefNannyDeclarations
  17842. PyObject *__pyx_t_1 = NULL;
  17843. size_t __pyx_t_2;
  17844. size_t __pyx_t_3;
  17845. size_t __pyx_t_4;
  17846. PyObject *__pyx_t_5 = NULL;
  17847. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", 0);
  17848. /* "vector.to_py":61
  17849. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  17850. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v):
  17851. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17852. *
  17853. *
  17854. */
  17855. __Pyx_XDECREF(__pyx_r);
  17856. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17857. __Pyx_GOTREF(__pyx_t_1);
  17858. __pyx_t_2 = __pyx_v_v.size();
  17859. __pyx_t_3 = __pyx_t_2;
  17860. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17861. __pyx_v_i = __pyx_t_4;
  17862. __pyx_t_5 = __pyx_convert_vector_to_py_npy_uint64((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  17863. __Pyx_GOTREF(__pyx_t_5);
  17864. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17865. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17866. }
  17867. __pyx_r = __pyx_t_1;
  17868. __pyx_t_1 = 0;
  17869. goto __pyx_L0;
  17870. /* "vector.to_py":60
  17871. *
  17872. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  17873. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  17874. * return [v[i] for i in range(v.size())]
  17875. *
  17876. */
  17877. /* function exit code */
  17878. __pyx_L1_error:;
  17879. __Pyx_XDECREF(__pyx_t_1);
  17880. __Pyx_XDECREF(__pyx_t_5);
  17881. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17882. __pyx_r = 0;
  17883. __pyx_L0:;
  17884. __Pyx_XGIVEREF(__pyx_r);
  17885. __Pyx_RefNannyFinishContext();
  17886. return __pyx_r;
  17887. }
  17888. /* "vector.from_py":45
  17889. *
  17890. * @cname("__pyx_convert_vector_from_py_size_t")
  17891. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  17892. * cdef vector[X] v
  17893. * for item in o:
  17894. */
  17895. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *__pyx_v_o) {
  17896. std::vector<size_t> __pyx_v_v;
  17897. PyObject *__pyx_v_item = NULL;
  17898. std::vector<size_t> __pyx_r;
  17899. __Pyx_RefNannyDeclarations
  17900. PyObject *__pyx_t_1 = NULL;
  17901. Py_ssize_t __pyx_t_2;
  17902. PyObject *(*__pyx_t_3)(PyObject *);
  17903. PyObject *__pyx_t_4 = NULL;
  17904. size_t __pyx_t_5;
  17905. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_size_t", 0);
  17906. /* "vector.from_py":47
  17907. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  17908. * cdef vector[X] v
  17909. * for item in o: # <<<<<<<<<<<<<<
  17910. * v.push_back(<X>item)
  17911. * return v
  17912. */
  17913. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  17914. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  17915. __pyx_t_3 = NULL;
  17916. } else {
  17917. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  17918. __Pyx_GOTREF(__pyx_t_1);
  17919. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  17920. }
  17921. for (;;) {
  17922. if (likely(!__pyx_t_3)) {
  17923. if (likely(PyList_CheckExact(__pyx_t_1))) {
  17924. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  17925. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  17926. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  17927. #else
  17928. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  17929. __Pyx_GOTREF(__pyx_t_4);
  17930. #endif
  17931. } else {
  17932. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  17933. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  17934. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  17935. #else
  17936. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  17937. __Pyx_GOTREF(__pyx_t_4);
  17938. #endif
  17939. }
  17940. } else {
  17941. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  17942. if (unlikely(!__pyx_t_4)) {
  17943. PyObject* exc_type = PyErr_Occurred();
  17944. if (exc_type) {
  17945. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  17946. else __PYX_ERR(1, 47, __pyx_L1_error)
  17947. }
  17948. break;
  17949. }
  17950. __Pyx_GOTREF(__pyx_t_4);
  17951. }
  17952. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  17953. __pyx_t_4 = 0;
  17954. /* "vector.from_py":48
  17955. * cdef vector[X] v
  17956. * for item in o:
  17957. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  17958. * return v
  17959. *
  17960. */
  17961. __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_item); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  17962. __pyx_v_v.push_back(((size_t)__pyx_t_5));
  17963. /* "vector.from_py":47
  17964. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  17965. * cdef vector[X] v
  17966. * for item in o: # <<<<<<<<<<<<<<
  17967. * v.push_back(<X>item)
  17968. * return v
  17969. */
  17970. }
  17971. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17972. /* "vector.from_py":49
  17973. * for item in o:
  17974. * v.push_back(<X>item)
  17975. * return v # <<<<<<<<<<<<<<
  17976. *
  17977. *
  17978. */
  17979. __pyx_r = __pyx_v_v;
  17980. goto __pyx_L0;
  17981. /* "vector.from_py":45
  17982. *
  17983. * @cname("__pyx_convert_vector_from_py_size_t")
  17984. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  17985. * cdef vector[X] v
  17986. * for item in o:
  17987. */
  17988. /* function exit code */
  17989. __pyx_L1_error:;
  17990. __Pyx_XDECREF(__pyx_t_1);
  17991. __Pyx_XDECREF(__pyx_t_4);
  17992. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17993. __Pyx_pretend_to_initialize(&__pyx_r);
  17994. __pyx_L0:;
  17995. __Pyx_XDECREF(__pyx_v_item);
  17996. __Pyx_RefNannyFinishContext();
  17997. return __pyx_r;
  17998. }
  17999. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *__pyx_v_o) {
  18000. std::vector<std::vector<size_t> > __pyx_v_v;
  18001. PyObject *__pyx_v_item = NULL;
  18002. std::vector<std::vector<size_t> > __pyx_r;
  18003. __Pyx_RefNannyDeclarations
  18004. PyObject *__pyx_t_1 = NULL;
  18005. Py_ssize_t __pyx_t_2;
  18006. PyObject *(*__pyx_t_3)(PyObject *);
  18007. PyObject *__pyx_t_4 = NULL;
  18008. std::vector<size_t> __pyx_t_5;
  18009. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18010. /* "vector.from_py":47
  18011. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18012. * cdef vector[X] v
  18013. * for item in o: # <<<<<<<<<<<<<<
  18014. * v.push_back(<X>item)
  18015. * return v
  18016. */
  18017. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18018. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18019. __pyx_t_3 = NULL;
  18020. } else {
  18021. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18022. __Pyx_GOTREF(__pyx_t_1);
  18023. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18024. }
  18025. for (;;) {
  18026. if (likely(!__pyx_t_3)) {
  18027. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18028. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18029. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18030. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18031. #else
  18032. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18033. __Pyx_GOTREF(__pyx_t_4);
  18034. #endif
  18035. } else {
  18036. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18037. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18038. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18039. #else
  18040. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18041. __Pyx_GOTREF(__pyx_t_4);
  18042. #endif
  18043. }
  18044. } else {
  18045. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18046. if (unlikely(!__pyx_t_4)) {
  18047. PyObject* exc_type = PyErr_Occurred();
  18048. if (exc_type) {
  18049. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18050. else __PYX_ERR(1, 47, __pyx_L1_error)
  18051. }
  18052. break;
  18053. }
  18054. __Pyx_GOTREF(__pyx_t_4);
  18055. }
  18056. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18057. __pyx_t_4 = 0;
  18058. /* "vector.from_py":48
  18059. * cdef vector[X] v
  18060. * for item in o:
  18061. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18062. * return v
  18063. *
  18064. */
  18065. __pyx_t_5 = __pyx_convert_vector_from_py_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18066. __pyx_v_v.push_back(((std::vector<size_t> )__pyx_t_5));
  18067. /* "vector.from_py":47
  18068. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18069. * cdef vector[X] v
  18070. * for item in o: # <<<<<<<<<<<<<<
  18071. * v.push_back(<X>item)
  18072. * return v
  18073. */
  18074. }
  18075. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18076. /* "vector.from_py":49
  18077. * for item in o:
  18078. * v.push_back(<X>item)
  18079. * return v # <<<<<<<<<<<<<<
  18080. *
  18081. *
  18082. */
  18083. __pyx_r = __pyx_v_v;
  18084. goto __pyx_L0;
  18085. /* "vector.from_py":45
  18086. *
  18087. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___")
  18088. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  18089. * cdef vector[X] v
  18090. * for item in o:
  18091. */
  18092. /* function exit code */
  18093. __pyx_L1_error:;
  18094. __Pyx_XDECREF(__pyx_t_1);
  18095. __Pyx_XDECREF(__pyx_t_4);
  18096. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18097. __Pyx_pretend_to_initialize(&__pyx_r);
  18098. __pyx_L0:;
  18099. __Pyx_XDECREF(__pyx_v_item);
  18100. __Pyx_RefNannyFinishContext();
  18101. return __pyx_r;
  18102. }
  18103. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *__pyx_v_o) {
  18104. std::vector<std::vector<double> > __pyx_v_v;
  18105. PyObject *__pyx_v_item = NULL;
  18106. std::vector<std::vector<double> > __pyx_r;
  18107. __Pyx_RefNannyDeclarations
  18108. PyObject *__pyx_t_1 = NULL;
  18109. Py_ssize_t __pyx_t_2;
  18110. PyObject *(*__pyx_t_3)(PyObject *);
  18111. PyObject *__pyx_t_4 = NULL;
  18112. std::vector<double> __pyx_t_5;
  18113. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", 0);
  18114. /* "vector.from_py":47
  18115. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18116. * cdef vector[X] v
  18117. * for item in o: # <<<<<<<<<<<<<<
  18118. * v.push_back(<X>item)
  18119. * return v
  18120. */
  18121. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18122. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18123. __pyx_t_3 = NULL;
  18124. } else {
  18125. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18126. __Pyx_GOTREF(__pyx_t_1);
  18127. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18128. }
  18129. for (;;) {
  18130. if (likely(!__pyx_t_3)) {
  18131. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18132. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18133. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18134. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18135. #else
  18136. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18137. __Pyx_GOTREF(__pyx_t_4);
  18138. #endif
  18139. } else {
  18140. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18141. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18142. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18143. #else
  18144. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18145. __Pyx_GOTREF(__pyx_t_4);
  18146. #endif
  18147. }
  18148. } else {
  18149. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18150. if (unlikely(!__pyx_t_4)) {
  18151. PyObject* exc_type = PyErr_Occurred();
  18152. if (exc_type) {
  18153. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18154. else __PYX_ERR(1, 47, __pyx_L1_error)
  18155. }
  18156. break;
  18157. }
  18158. __Pyx_GOTREF(__pyx_t_4);
  18159. }
  18160. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18161. __pyx_t_4 = 0;
  18162. /* "vector.from_py":48
  18163. * cdef vector[X] v
  18164. * for item in o:
  18165. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18166. * return v
  18167. *
  18168. */
  18169. __pyx_t_5 = __pyx_convert_vector_from_py_double(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18170. __pyx_v_v.push_back(((std::vector<double> )__pyx_t_5));
  18171. /* "vector.from_py":47
  18172. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18173. * cdef vector[X] v
  18174. * for item in o: # <<<<<<<<<<<<<<
  18175. * v.push_back(<X>item)
  18176. * return v
  18177. */
  18178. }
  18179. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18180. /* "vector.from_py":49
  18181. * for item in o:
  18182. * v.push_back(<X>item)
  18183. * return v # <<<<<<<<<<<<<<
  18184. *
  18185. *
  18186. */
  18187. __pyx_r = __pyx_v_v;
  18188. goto __pyx_L0;
  18189. /* "vector.from_py":45
  18190. *
  18191. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___")
  18192. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *: # <<<<<<<<<<<<<<
  18193. * cdef vector[X] v
  18194. * for item in o:
  18195. */
  18196. /* function exit code */
  18197. __pyx_L1_error:;
  18198. __Pyx_XDECREF(__pyx_t_1);
  18199. __Pyx_XDECREF(__pyx_t_4);
  18200. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18201. __Pyx_pretend_to_initialize(&__pyx_r);
  18202. __pyx_L0:;
  18203. __Pyx_XDECREF(__pyx_v_item);
  18204. __Pyx_RefNannyFinishContext();
  18205. return __pyx_r;
  18206. }
  18207. /* "vector.to_py":60
  18208. *
  18209. * @cname("__pyx_convert_vector_to_py_double")
  18210. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18211. * return [v[i] for i in range(v.size())]
  18212. *
  18213. */
  18214. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &__pyx_v_v) {
  18215. size_t __pyx_v_i;
  18216. PyObject *__pyx_r = NULL;
  18217. __Pyx_RefNannyDeclarations
  18218. PyObject *__pyx_t_1 = NULL;
  18219. size_t __pyx_t_2;
  18220. size_t __pyx_t_3;
  18221. size_t __pyx_t_4;
  18222. PyObject *__pyx_t_5 = NULL;
  18223. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
  18224. /* "vector.to_py":61
  18225. * @cname("__pyx_convert_vector_to_py_double")
  18226. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):
  18227. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18228. *
  18229. *
  18230. */
  18231. __Pyx_XDECREF(__pyx_r);
  18232. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18233. __Pyx_GOTREF(__pyx_t_1);
  18234. __pyx_t_2 = __pyx_v_v.size();
  18235. __pyx_t_3 = __pyx_t_2;
  18236. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18237. __pyx_v_i = __pyx_t_4;
  18238. __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  18239. __Pyx_GOTREF(__pyx_t_5);
  18240. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18241. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18242. }
  18243. __pyx_r = __pyx_t_1;
  18244. __pyx_t_1 = 0;
  18245. goto __pyx_L0;
  18246. /* "vector.to_py":60
  18247. *
  18248. * @cname("__pyx_convert_vector_to_py_double")
  18249. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18250. * return [v[i] for i in range(v.size())]
  18251. *
  18252. */
  18253. /* function exit code */
  18254. __pyx_L1_error:;
  18255. __Pyx_XDECREF(__pyx_t_1);
  18256. __Pyx_XDECREF(__pyx_t_5);
  18257. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18258. __pyx_r = 0;
  18259. __pyx_L0:;
  18260. __Pyx_XGIVEREF(__pyx_r);
  18261. __Pyx_RefNannyFinishContext();
  18262. return __pyx_r;
  18263. }
  18264. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &__pyx_v_v) {
  18265. size_t __pyx_v_i;
  18266. PyObject *__pyx_r = NULL;
  18267. __Pyx_RefNannyDeclarations
  18268. PyObject *__pyx_t_1 = NULL;
  18269. size_t __pyx_t_2;
  18270. size_t __pyx_t_3;
  18271. size_t __pyx_t_4;
  18272. PyObject *__pyx_t_5 = NULL;
  18273. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", 0);
  18274. /* "vector.to_py":61
  18275. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18276. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v):
  18277. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18278. *
  18279. *
  18280. */
  18281. __Pyx_XDECREF(__pyx_r);
  18282. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18283. __Pyx_GOTREF(__pyx_t_1);
  18284. __pyx_t_2 = __pyx_v_v.size();
  18285. __pyx_t_3 = __pyx_t_2;
  18286. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18287. __pyx_v_i = __pyx_t_4;
  18288. __pyx_t_5 = __pyx_convert_vector_to_py_double((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  18289. __Pyx_GOTREF(__pyx_t_5);
  18290. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18291. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18292. }
  18293. __pyx_r = __pyx_t_1;
  18294. __pyx_t_1 = 0;
  18295. goto __pyx_L0;
  18296. /* "vector.to_py":60
  18297. *
  18298. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18299. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18300. * return [v[i] for i in range(v.size())]
  18301. *
  18302. */
  18303. /* function exit code */
  18304. __pyx_L1_error:;
  18305. __Pyx_XDECREF(__pyx_t_1);
  18306. __Pyx_XDECREF(__pyx_t_5);
  18307. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18308. __pyx_r = 0;
  18309. __pyx_L0:;
  18310. __Pyx_XGIVEREF(__pyx_r);
  18311. __Pyx_RefNannyFinishContext();
  18312. return __pyx_r;
  18313. }
  18314. /* "vector.from_py":45
  18315. *
  18316. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18317. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *: # <<<<<<<<<<<<<<
  18318. * cdef vector[X] v
  18319. * for item in o:
  18320. */
  18321. static std::vector<std::map<std::string,std::string> > __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(PyObject *__pyx_v_o) {
  18322. std::vector<std::map<std::string,std::string> > __pyx_v_v;
  18323. PyObject *__pyx_v_item = NULL;
  18324. std::vector<std::map<std::string,std::string> > __pyx_r;
  18325. __Pyx_RefNannyDeclarations
  18326. PyObject *__pyx_t_1 = NULL;
  18327. Py_ssize_t __pyx_t_2;
  18328. PyObject *(*__pyx_t_3)(PyObject *);
  18329. PyObject *__pyx_t_4 = NULL;
  18330. std::map<std::string,std::string> __pyx_t_5;
  18331. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);
  18332. /* "vector.from_py":47
  18333. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *:
  18334. * cdef vector[X] v
  18335. * for item in o: # <<<<<<<<<<<<<<
  18336. * v.push_back(<X>item)
  18337. * return v
  18338. */
  18339. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18340. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18341. __pyx_t_3 = NULL;
  18342. } else {
  18343. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18344. __Pyx_GOTREF(__pyx_t_1);
  18345. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18346. }
  18347. for (;;) {
  18348. if (likely(!__pyx_t_3)) {
  18349. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18350. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18351. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18352. __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18353. #else
  18354. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18355. __Pyx_GOTREF(__pyx_t_4);
  18356. #endif
  18357. } else {
  18358. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18359. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18360. __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(1, 47, __pyx_L1_error)
  18361. #else
  18362. __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 47, __pyx_L1_error)
  18363. __Pyx_GOTREF(__pyx_t_4);
  18364. #endif
  18365. }
  18366. } else {
  18367. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18368. if (unlikely(!__pyx_t_4)) {
  18369. PyObject* exc_type = PyErr_Occurred();
  18370. if (exc_type) {
  18371. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18372. else __PYX_ERR(1, 47, __pyx_L1_error)
  18373. }
  18374. break;
  18375. }
  18376. __Pyx_GOTREF(__pyx_t_4);
  18377. }
  18378. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18379. __pyx_t_4 = 0;
  18380. /* "vector.from_py":48
  18381. * cdef vector[X] v
  18382. * for item in o:
  18383. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18384. * return v
  18385. *
  18386. */
  18387. __pyx_t_5 = __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18388. __pyx_v_v.push_back(((std::map<std::string,std::string> )__pyx_t_5));
  18389. /* "vector.from_py":47
  18390. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *:
  18391. * cdef vector[X] v
  18392. * for item in o: # <<<<<<<<<<<<<<
  18393. * v.push_back(<X>item)
  18394. * return v
  18395. */
  18396. }
  18397. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18398. /* "vector.from_py":49
  18399. * for item in o:
  18400. * v.push_back(<X>item)
  18401. * return v # <<<<<<<<<<<<<<
  18402. *
  18403. *
  18404. */
  18405. __pyx_r = __pyx_v_v;
  18406. goto __pyx_L0;
  18407. /* "vector.from_py":45
  18408. *
  18409. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18410. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *: # <<<<<<<<<<<<<<
  18411. * cdef vector[X] v
  18412. * for item in o:
  18413. */
  18414. /* function exit code */
  18415. __pyx_L1_error:;
  18416. __Pyx_XDECREF(__pyx_t_1);
  18417. __Pyx_XDECREF(__pyx_t_4);
  18418. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18419. __Pyx_pretend_to_initialize(&__pyx_r);
  18420. __pyx_L0:;
  18421. __Pyx_XDECREF(__pyx_v_item);
  18422. __Pyx_RefNannyFinishContext();
  18423. return __pyx_r;
  18424. }
  18425. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  18426. PyObject *o;
  18427. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  18428. o = (*t->tp_alloc)(t, 0);
  18429. } else {
  18430. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  18431. }
  18432. if (unlikely(!o)) return 0;
  18433. if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  18434. return o;
  18435. bad:
  18436. Py_DECREF(o); o = 0;
  18437. return NULL;
  18438. }
  18439. static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) {
  18440. #if CYTHON_USE_TP_FINALIZE
  18441. if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
  18442. if (PyObject_CallFinalizerFromDealloc(o)) return;
  18443. }
  18444. #endif
  18445. {
  18446. PyObject *etype, *eval, *etb;
  18447. PyErr_Fetch(&etype, &eval, &etb);
  18448. ++Py_REFCNT(o);
  18449. __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o);
  18450. --Py_REFCNT(o);
  18451. PyErr_Restore(etype, eval, etb);
  18452. }
  18453. (*Py_TYPE(o)->tp_free)(o);
  18454. }
  18455. static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = {
  18456. {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized},
  18457. {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env},
  18458. {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs},
  18459. {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids},
  18460. {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids},
  18461. {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class},
  18462. {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name},
  18463. {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph},
  18464. {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node},
  18465. {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge},
  18466. {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge},
  18467. {"clear_graph", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph},
  18468. {"get_graph_internal_id", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id},
  18469. {"get_graph_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes},
  18470. {"get_graph_num_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_32get_graph_num_edges},
  18471. {"get_original_node_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_34get_original_node_ids},
  18472. {"get_graph_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_36get_graph_node_labels},
  18473. {"get_graph_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_38get_graph_edges},
  18474. {"get_graph_adjacence_matrix", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix},
  18475. {"set_edit_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_42set_edit_cost},
  18476. {"set_personal_edit_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_44set_personal_edit_cost},
  18477. {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_47init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_46init},
  18478. {"set_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_49set_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_48set_method},
  18479. {"init_method", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_51init_method, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_50init_method},
  18480. {"get_init_time", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_52get_init_time},
  18481. {"run_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_55run_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_54run_method},
  18482. {"get_upper_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_56get_upper_bound},
  18483. {"get_lower_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_58get_lower_bound},
  18484. {"get_forward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_60get_forward_map},
  18485. {"get_backward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_62get_backward_map},
  18486. {"get_node_image", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_64get_node_image},
  18487. {"get_node_pre_image", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_66get_node_pre_image},
  18488. {"get_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_68get_induced_cost},
  18489. {"get_node_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map},
  18490. {"get_assignment_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_72get_assignment_matrix},
  18491. {"get_all_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_74get_all_map},
  18492. {"get_runtime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_76get_runtime},
  18493. {"quasimetric_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_78quasimetric_cost},
  18494. {"hungarian_LSAP", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_80hungarian_LSAP},
  18495. {"hungarian_LSAPE", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_82hungarian_LSAPE},
  18496. {"add_random_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_84add_random_graph},
  18497. {"add_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_86add_nx_graph},
  18498. {"compute_ged_on_two_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_88compute_ged_on_two_graphs},
  18499. {"compute_edit_distance_on_nx_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_90compute_edit_distance_on_nx_graphs},
  18500. {"compute_edit_distance_on_GXl_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_92compute_edit_distance_on_GXl_graphs},
  18501. {"get_num_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_94get_num_node_labels},
  18502. {"get_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_96get_node_label},
  18503. {"get_num_edge_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_98get_num_edge_labels},
  18504. {"get_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_100get_edge_label},
  18505. {"get_avg_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_102get_avg_num_nodes},
  18506. {"get_node_rel_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_104get_node_rel_cost},
  18507. {"get_node_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_106get_node_del_cost},
  18508. {"get_node_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_108get_node_ins_cost},
  18509. {"get_median_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_110get_median_node_label},
  18510. {"get_edge_rel_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_112get_edge_rel_cost},
  18511. {"get_edge_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_114get_edge_del_cost},
  18512. {"get_edge_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_116get_edge_ins_cost},
  18513. {"get_median_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_118get_median_edge_label},
  18514. {"get_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_120get_nx_graph},
  18515. {"get_init_type", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_122get_init_type},
  18516. {"load_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_124load_nx_graph},
  18517. {"compute_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost},
  18518. {"__reduce_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__, METH_NOARGS, 0},
  18519. {"__setstate_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__, METH_O, 0},
  18520. {0, 0, 0, 0}
  18521. };
  18522. static PyTypeObject __pyx_type_8gedlibpy_GEDEnv = {
  18523. PyVarObject_HEAD_INIT(0, 0)
  18524. "gedlibpy.GEDEnv", /*tp_name*/
  18525. sizeof(struct __pyx_obj_8gedlibpy_GEDEnv), /*tp_basicsize*/
  18526. 0, /*tp_itemsize*/
  18527. __pyx_tp_dealloc_8gedlibpy_GEDEnv, /*tp_dealloc*/
  18528. #if PY_VERSION_HEX < 0x030800b4
  18529. 0, /*tp_print*/
  18530. #endif
  18531. #if PY_VERSION_HEX >= 0x030800b4
  18532. 0, /*tp_vectorcall_offset*/
  18533. #endif
  18534. 0, /*tp_getattr*/
  18535. 0, /*tp_setattr*/
  18536. #if PY_MAJOR_VERSION < 3
  18537. 0, /*tp_compare*/
  18538. #endif
  18539. #if PY_MAJOR_VERSION >= 3
  18540. 0, /*tp_as_async*/
  18541. #endif
  18542. 0, /*tp_repr*/
  18543. 0, /*tp_as_number*/
  18544. 0, /*tp_as_sequence*/
  18545. 0, /*tp_as_mapping*/
  18546. 0, /*tp_hash*/
  18547. 0, /*tp_call*/
  18548. 0, /*tp_str*/
  18549. 0, /*tp_getattro*/
  18550. 0, /*tp_setattro*/
  18551. 0, /*tp_as_buffer*/
  18552. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  18553. "Cython wrapper class for C++ class PyGEDEnv\n\t", /*tp_doc*/
  18554. 0, /*tp_traverse*/
  18555. 0, /*tp_clear*/
  18556. 0, /*tp_richcompare*/
  18557. 0, /*tp_weaklistoffset*/
  18558. 0, /*tp_iter*/
  18559. 0, /*tp_iternext*/
  18560. __pyx_methods_8gedlibpy_GEDEnv, /*tp_methods*/
  18561. 0, /*tp_members*/
  18562. 0, /*tp_getset*/
  18563. 0, /*tp_base*/
  18564. 0, /*tp_dict*/
  18565. 0, /*tp_descr_get*/
  18566. 0, /*tp_descr_set*/
  18567. 0, /*tp_dictoffset*/
  18568. 0, /*tp_init*/
  18569. 0, /*tp_alloc*/
  18570. __pyx_tp_new_8gedlibpy_GEDEnv, /*tp_new*/
  18571. 0, /*tp_free*/
  18572. 0, /*tp_is_gc*/
  18573. 0, /*tp_bases*/
  18574. 0, /*tp_mro*/
  18575. 0, /*tp_cache*/
  18576. 0, /*tp_subclasses*/
  18577. 0, /*tp_weaklist*/
  18578. 0, /*tp_del*/
  18579. 0, /*tp_version_tag*/
  18580. #if PY_VERSION_HEX >= 0x030400a1
  18581. 0, /*tp_finalize*/
  18582. #endif
  18583. #if PY_VERSION_HEX >= 0x030800b1
  18584. 0, /*tp_vectorcall*/
  18585. #endif
  18586. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  18587. 0, /*tp_print*/
  18588. #endif
  18589. };
  18590. static PyMethodDef __pyx_methods[] = {
  18591. {0, 0, 0, 0}
  18592. };
  18593. static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  18594. static const char* internal_type_names[] = {
  18595. "GEDEnv",
  18596. "PyGEDEnv",
  18597. "UINT32_t",
  18598. "X",
  18599. "Y",
  18600. "__pyx_ctuple_dbc1b__c5621__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc",
  18601. "__pyx_ctuple_dbc1b__c5621__std__in_map__lAngstd__in_pair__lAngsize_t__comma_size_t__rAng__comma_std__in_map__lAngstd__in_string__comma_std__in_string__rAng__rAng__etc__etc_struct",
  18602. "__pyx_ctuple_size_t",
  18603. "__pyx_ctuple_size_t__space___const___and_size_t__space___const_",
  18604. "__pyx_ctuple_size_t__space___const___and_size_t__space___const__struct",
  18605. "__pyx_ctuple_size_t_struct",
  18606. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng",
  18607. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng_struct",
  18608. "bool",
  18609. "list",
  18610. "map",
  18611. "pair",
  18612. "string",
  18613. "vector",
  18614. 0
  18615. };
  18616. const char** type_name = internal_type_names;
  18617. while (*type_name) {
  18618. if (__Pyx_StrEq(name, *type_name)) {
  18619. PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
  18620. goto bad;
  18621. }
  18622. type_name++;
  18623. }
  18624. if (0);
  18625. else {
  18626. if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  18627. }
  18628. return 0;
  18629. bad:
  18630. return -1;
  18631. }
  18632. static int
  18633. __Pyx_import_all_from(PyObject *locals, PyObject *v)
  18634. {
  18635. PyObject *all = PyObject_GetAttrString(v, "__all__");
  18636. PyObject *dict, *name, *value;
  18637. int skip_leading_underscores = 0;
  18638. int pos, err;
  18639. if (all == NULL) {
  18640. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  18641. return -1;
  18642. PyErr_Clear();
  18643. dict = PyObject_GetAttrString(v, "__dict__");
  18644. if (dict == NULL) {
  18645. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  18646. return -1;
  18647. PyErr_SetString(PyExc_ImportError,
  18648. "from-import-* object has no __dict__ and no __all__");
  18649. return -1;
  18650. }
  18651. #if PY_MAJOR_VERSION < 3
  18652. all = PyObject_CallMethod(dict, (char *)"keys", NULL);
  18653. #else
  18654. all = PyMapping_Keys(dict);
  18655. #endif
  18656. Py_DECREF(dict);
  18657. if (all == NULL)
  18658. return -1;
  18659. skip_leading_underscores = 1;
  18660. }
  18661. for (pos = 0, err = 0; ; pos++) {
  18662. name = PySequence_GetItem(all, pos);
  18663. if (name == NULL) {
  18664. if (!PyErr_ExceptionMatches(PyExc_IndexError))
  18665. err = -1;
  18666. else
  18667. PyErr_Clear();
  18668. break;
  18669. }
  18670. if (skip_leading_underscores &&
  18671. #if PY_MAJOR_VERSION < 3
  18672. PyString_Check(name) &&
  18673. PyString_AS_STRING(name)[0] == '_')
  18674. #else
  18675. PyUnicode_Check(name) &&
  18676. PyUnicode_AS_UNICODE(name)[0] == '_')
  18677. #endif
  18678. {
  18679. Py_DECREF(name);
  18680. continue;
  18681. }
  18682. value = PyObject_GetAttr(v, name);
  18683. if (value == NULL)
  18684. err = -1;
  18685. else if (PyDict_CheckExact(locals))
  18686. err = PyDict_SetItem(locals, name, value);
  18687. else
  18688. err = PyObject_SetItem(locals, name, value);
  18689. Py_DECREF(name);
  18690. Py_XDECREF(value);
  18691. if (err != 0)
  18692. break;
  18693. }
  18694. Py_DECREF(all);
  18695. return err;
  18696. }
  18697. static int __pyx_import_star(PyObject* m) {
  18698. int i;
  18699. int ret = -1;
  18700. char* s;
  18701. PyObject *locals = 0;
  18702. PyObject *list = 0;
  18703. #if PY_MAJOR_VERSION >= 3
  18704. PyObject *utf8_name = 0;
  18705. #endif
  18706. PyObject *name;
  18707. PyObject *item;
  18708. locals = PyDict_New(); if (!locals) goto bad;
  18709. if (__Pyx_import_all_from(locals, m) < 0) goto bad;
  18710. list = PyDict_Items(locals); if (!list) goto bad;
  18711. for(i=0; i<PyList_GET_SIZE(list); i++) {
  18712. name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
  18713. item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
  18714. #if PY_MAJOR_VERSION >= 3
  18715. utf8_name = PyUnicode_AsUTF8String(name);
  18716. if (!utf8_name) goto bad;
  18717. s = PyBytes_AS_STRING(utf8_name);
  18718. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  18719. Py_DECREF(utf8_name); utf8_name = 0;
  18720. #else
  18721. s = PyString_AsString(name);
  18722. if (!s) goto bad;
  18723. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  18724. #endif
  18725. }
  18726. ret = 0;
  18727. bad:
  18728. Py_XDECREF(locals);
  18729. Py_XDECREF(list);
  18730. #if PY_MAJOR_VERSION >= 3
  18731. Py_XDECREF(utf8_name);
  18732. #endif
  18733. return ret;
  18734. }
  18735. #if PY_MAJOR_VERSION >= 3
  18736. #if CYTHON_PEP489_MULTI_PHASE_INIT
  18737. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  18738. static int __pyx_pymod_exec_gedlibpy(PyObject* module); /*proto*/
  18739. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  18740. {Py_mod_create, (void*)__pyx_pymod_create},
  18741. {Py_mod_exec, (void*)__pyx_pymod_exec_gedlibpy},
  18742. {0, NULL}
  18743. };
  18744. #endif
  18745. static struct PyModuleDef __pyx_moduledef = {
  18746. PyModuleDef_HEAD_INIT,
  18747. "gedlibpy",
  18748. __pyx_k_Python_GedLib_module_This_modul, /* m_doc */
  18749. #if CYTHON_PEP489_MULTI_PHASE_INIT
  18750. 0, /* m_size */
  18751. #else
  18752. -1, /* m_size */
  18753. #endif
  18754. __pyx_methods /* m_methods */,
  18755. #if CYTHON_PEP489_MULTI_PHASE_INIT
  18756. __pyx_moduledef_slots, /* m_slots */
  18757. #else
  18758. NULL, /* m_reload */
  18759. #endif
  18760. NULL, /* m_traverse */
  18761. NULL, /* m_clear */
  18762. NULL /* m_free */
  18763. };
  18764. #endif
  18765. #ifndef CYTHON_SMALL_CODE
  18766. #if defined(__clang__)
  18767. #define CYTHON_SMALL_CODE
  18768. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  18769. #define CYTHON_SMALL_CODE __attribute__((cold))
  18770. #else
  18771. #define CYTHON_SMALL_CODE
  18772. #endif
  18773. #endif
  18774. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  18775. {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  18776. {&__pyx_kp_s_Class_for_Edit_Cost_Error_Raise, __pyx_k_Class_for_Edit_Cost_Error_Raise, sizeof(__pyx_k_Class_for_Edit_Cost_Error_Raise), 0, 0, 1, 0},
  18777. {&__pyx_kp_s_Class_for_Init_Error_Raise_an_e, __pyx_k_Class_for_Init_Error_Raise_an_e, sizeof(__pyx_k_Class_for_Init_Error_Raise_an_e), 0, 0, 1, 0},
  18778. {&__pyx_kp_s_Class_for_Method_Error_Raise_an, __pyx_k_Class_for_Method_Error_Raise_an, sizeof(__pyx_k_Class_for_Method_Error_Raise_an), 0, 0, 1, 0},
  18779. {&__pyx_kp_s_Class_for_error_s_management_Th, __pyx_k_Class_for_error_s_management_Th, sizeof(__pyx_k_Class_for_error_s_management_Th), 0, 0, 1, 0},
  18780. {&__pyx_kp_u_Computation_between_graph, __pyx_k_Computation_between_graph, sizeof(__pyx_k_Computation_between_graph), 0, 1, 0, 0},
  18781. {&__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES, __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES, sizeof(__pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES), 0, 1, 0, 1},
  18782. {&__pyx_n_s_EditCostError, __pyx_k_EditCostError, sizeof(__pyx_k_EditCostError), 0, 0, 1, 1},
  18783. {&__pyx_n_s_EditCostError___init, __pyx_k_EditCostError___init, sizeof(__pyx_k_EditCostError___init), 0, 0, 1, 1},
  18784. {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
  18785. {&__pyx_kp_u_Finish_The_return_contains_edit, __pyx_k_Finish_The_return_contains_edit, sizeof(__pyx_k_Finish_The_return_contains_edit), 0, 1, 0, 0},
  18786. {&__pyx_kp_u_Finish_You_can_check_the_result, __pyx_k_Finish_You_can_check_the_result, sizeof(__pyx_k_Finish_You_can_check_the_result), 0, 1, 0, 0},
  18787. {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
  18788. {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
  18789. {&__pyx_n_s_GEDEnv, __pyx_k_GEDEnv, sizeof(__pyx_k_GEDEnv), 0, 0, 1, 1},
  18790. {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  18791. {&__pyx_kp_u_Graphs_loaded, __pyx_k_Graphs_loaded, sizeof(__pyx_k_Graphs_loaded), 0, 1, 0, 0},
  18792. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  18793. {&__pyx_n_s_InitError, __pyx_k_InitError, sizeof(__pyx_k_InitError), 0, 0, 1, 1},
  18794. {&__pyx_n_s_InitError___init, __pyx_k_InitError___init, sizeof(__pyx_k_InitError___init), 0, 0, 1, 1},
  18795. {&__pyx_kp_u_Initialization_in_progress, __pyx_k_Initialization_in_progress, sizeof(__pyx_k_Initialization_in_progress), 0, 1, 0, 0},
  18796. {&__pyx_kp_u_Initialization_terminated, __pyx_k_Initialization_terminated, sizeof(__pyx_k_Initialization_terminated), 0, 1, 0, 0},
  18797. {&__pyx_n_s_LoadLibrary, __pyx_k_LoadLibrary, sizeof(__pyx_k_LoadLibrary), 0, 0, 1, 1},
  18798. {&__pyx_kp_u_Loading_graphs_in_progress, __pyx_k_Loading_graphs_in_progress, sizeof(__pyx_k_Loading_graphs_in_progress), 0, 1, 0, 0},
  18799. {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  18800. {&__pyx_n_s_MethodError, __pyx_k_MethodError, sizeof(__pyx_k_MethodError), 0, 0, 1, 1},
  18801. {&__pyx_n_s_MethodError___init, __pyx_k_MethodError___init, sizeof(__pyx_k_MethodError___init), 0, 0, 1, 1},
  18802. {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
  18803. {&__pyx_kp_u_Number_of_graphs, __pyx_k_Number_of_graphs, sizeof(__pyx_k_Number_of_graphs), 0, 1, 0, 0},
  18804. {&__pyx_kp_u_Please_don_t_restart_the_environ, __pyx_k_Please_don_t_restart_the_environ, sizeof(__pyx_k_Please_don_t_restart_the_environ), 0, 1, 0, 0},
  18805. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  18806. {&__pyx_kp_u_This_edit_cost_function_doesn_t, __pyx_k_This_edit_cost_function_doesn_t, sizeof(__pyx_k_This_edit_cost_function_doesn_t), 0, 1, 0, 0},
  18807. {&__pyx_kp_u_This_init_option_doesn_t_exist_p, __pyx_k_This_init_option_doesn_t_exist_p, sizeof(__pyx_k_This_init_option_doesn_t_exist_p), 0, 1, 0, 0},
  18808. {&__pyx_kp_u_This_method_doesn_t_exist_please, __pyx_k_This_method_doesn_t_exist_please, sizeof(__pyx_k_This_method_doesn_t_exist_please), 0, 1, 0, 0},
  18809. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  18810. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  18811. {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1},
  18812. {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1},
  18813. {&__pyx_n_s_add_graph, __pyx_k_add_graph, sizeof(__pyx_k_add_graph), 0, 0, 1, 1},
  18814. {&__pyx_n_s_add_node, __pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 0, 1, 1},
  18815. {&__pyx_n_s_add_nx_graph, __pyx_k_add_nx_graph, sizeof(__pyx_k_add_nx_graph), 0, 0, 1, 1},
  18816. {&__pyx_n_s_adj_lists, __pyx_k_adj_lists, sizeof(__pyx_k_adj_lists), 0, 0, 1, 1},
  18817. {&__pyx_n_s_adj_matrix, __pyx_k_adj_matrix, sizeof(__pyx_k_adj_matrix), 0, 0, 1, 1},
  18818. {&__pyx_n_s_cdll, __pyx_k_cdll, sizeof(__pyx_k_cdll), 0, 0, 1, 1},
  18819. {&__pyx_n_s_classe, __pyx_k_classe, sizeof(__pyx_k_classe), 0, 0, 1, 1},
  18820. {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1},
  18821. {&__pyx_n_s_clear_graph, __pyx_k_clear_graph, sizeof(__pyx_k_clear_graph), 0, 0, 1, 1},
  18822. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  18823. {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  18824. {&__pyx_n_s_dataset, __pyx_k_dataset, sizeof(__pyx_k_dataset), 0, 0, 1, 1},
  18825. {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  18826. {&__pyx_n_s_decode_graph_edges, __pyx_k_decode_graph_edges, sizeof(__pyx_k_decode_graph_edges), 0, 0, 1, 1},
  18827. {&__pyx_n_s_decode_your_map, __pyx_k_decode_your_map, sizeof(__pyx_k_decode_your_map), 0, 0, 1, 1},
  18828. {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  18829. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  18830. {&__pyx_n_s_edge_label, __pyx_k_edge_label, sizeof(__pyx_k_edge_label), 0, 0, 1, 1},
  18831. {&__pyx_n_s_edge_label_1, __pyx_k_edge_label_1, sizeof(__pyx_k_edge_label_1), 0, 0, 1, 1},
  18832. {&__pyx_n_s_edge_label_2, __pyx_k_edge_label_2, sizeof(__pyx_k_edge_label_2), 0, 0, 1, 1},
  18833. {&__pyx_n_s_edge_label_b, __pyx_k_edge_label_b, sizeof(__pyx_k_edge_label_b), 0, 0, 1, 1},
  18834. {&__pyx_n_s_edge_list, __pyx_k_edge_list, sizeof(__pyx_k_edge_list), 0, 0, 1, 1},
  18835. {&__pyx_n_s_edge_type, __pyx_k_edge_type, sizeof(__pyx_k_edge_type), 0, 0, 1, 1},
  18836. {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  18837. {&__pyx_n_s_edit_cost, __pyx_k_edit_cost, sizeof(__pyx_k_edit_cost), 0, 0, 1, 1},
  18838. {&__pyx_n_s_edit_cost_constant, __pyx_k_edit_cost_constant, sizeof(__pyx_k_edit_cost_constant), 0, 0, 1, 1},
  18839. {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  18840. {&__pyx_n_s_encode_your_map, __pyx_k_encode_your_map, sizeof(__pyx_k_encode_your_map), 0, 0, 1, 1},
  18841. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  18842. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  18843. {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1},
  18844. {&__pyx_n_s_g2, __pyx_k_g2, sizeof(__pyx_k_g2), 0, 0, 1, 1},
  18845. {&__pyx_n_s_g_id, __pyx_k_g_id, sizeof(__pyx_k_g_id), 0, 0, 1, 1},
  18846. {&__pyx_n_s_gedlibpy, __pyx_k_gedlibpy, sizeof(__pyx_k_gedlibpy), 0, 0, 1, 1},
  18847. {&__pyx_kp_s_gedlibpy_pyx, __pyx_k_gedlibpy_pyx, sizeof(__pyx_k_gedlibpy_pyx), 0, 0, 1, 0},
  18848. {&__pyx_n_s_get_dummy_node, __pyx_k_get_dummy_node, sizeof(__pyx_k_get_dummy_node), 0, 0, 1, 1},
  18849. {&__pyx_n_s_get_edge_data, __pyx_k_get_edge_data, sizeof(__pyx_k_get_edge_data), 0, 0, 1, 1},
  18850. {&__pyx_n_s_get_edit_cost_options, __pyx_k_get_edit_cost_options, sizeof(__pyx_k_get_edit_cost_options), 0, 0, 1, 1},
  18851. {&__pyx_n_s_get_graph_edges, __pyx_k_get_graph_edges, sizeof(__pyx_k_get_graph_edges), 0, 0, 1, 1},
  18852. {&__pyx_n_s_get_graph_node_labels, __pyx_k_get_graph_node_labels, sizeof(__pyx_k_get_graph_node_labels), 0, 0, 1, 1},
  18853. {&__pyx_n_s_get_graph_num_nodes, __pyx_k_get_graph_num_nodes, sizeof(__pyx_k_get_graph_num_nodes), 0, 0, 1, 1},
  18854. {&__pyx_n_s_get_init_options, __pyx_k_get_init_options, sizeof(__pyx_k_get_init_options), 0, 0, 1, 1},
  18855. {&__pyx_n_s_get_method_options, __pyx_k_get_method_options, sizeof(__pyx_k_get_method_options), 0, 0, 1, 1},
  18856. {&__pyx_n_s_get_node_map, __pyx_k_get_node_map, sizeof(__pyx_k_get_node_map), 0, 0, 1, 1},
  18857. {&__pyx_n_s_get_original_node_ids, __pyx_k_get_original_node_ids, sizeof(__pyx_k_get_original_node_ids), 0, 0, 1, 1},
  18858. {&__pyx_n_s_get_upper_bound, __pyx_k_get_upper_bound, sizeof(__pyx_k_get_upper_bound), 0, 0, 1, 1},
  18859. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  18860. {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
  18861. {&__pyx_n_s_graph_class, __pyx_k_graph_class, sizeof(__pyx_k_graph_class), 0, 0, 1, 1},
  18862. {&__pyx_n_s_graph_id, __pyx_k_graph_id, sizeof(__pyx_k_graph_id), 0, 0, 1, 1},
  18863. {&__pyx_n_s_graph_ids, __pyx_k_graph_ids, sizeof(__pyx_k_graph_ids), 0, 0, 1, 1},
  18864. {&__pyx_n_s_graph_name, __pyx_k_graph_name, sizeof(__pyx_k_graph_name), 0, 0, 1, 1},
  18865. {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  18866. {&__pyx_n_s_h_id, __pyx_k_h_id, sizeof(__pyx_k_h_id), 0, 0, 1, 1},
  18867. {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
  18868. {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
  18869. {&__pyx_n_s_ignore_duplicates, __pyx_k_ignore_duplicates, sizeof(__pyx_k_ignore_duplicates), 0, 0, 1, 1},
  18870. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  18871. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  18872. {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  18873. {&__pyx_n_s_init_method, __pyx_k_init_method, sizeof(__pyx_k_init_method), 0, 0, 1, 1},
  18874. {&__pyx_n_s_init_option, __pyx_k_init_option, sizeof(__pyx_k_init_option), 0, 0, 1, 1},
  18875. {&__pyx_n_s_is_initialized, __pyx_k_is_initialized, sizeof(__pyx_k_is_initialized), 0, 0, 1, 1},
  18876. {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  18877. {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  18878. {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  18879. {&__pyx_n_s_lib1, __pyx_k_lib1, sizeof(__pyx_k_lib1), 0, 0, 1, 1},
  18880. {&__pyx_n_s_lib2, __pyx_k_lib2, sizeof(__pyx_k_lib2), 0, 0, 1, 1},
  18881. {&__pyx_n_s_lib3, __pyx_k_lib3, sizeof(__pyx_k_lib3), 0, 0, 1, 1},
  18882. {&__pyx_n_s_lib4, __pyx_k_lib4, sizeof(__pyx_k_lib4), 0, 0, 1, 1},
  18883. {&__pyx_kp_u_lib_fann_libdoublefann_so, __pyx_k_lib_fann_libdoublefann_so, sizeof(__pyx_k_lib_fann_libdoublefann_so), 0, 1, 0, 0},
  18884. {&__pyx_kp_u_lib_libsvm_3_22_libsvm_so, __pyx_k_lib_libsvm_3_22_libsvm_so, sizeof(__pyx_k_lib_libsvm_3_22_libsvm_so), 0, 1, 0, 0},
  18885. {&__pyx_kp_u_lib_nomad_libnomad_so, __pyx_k_lib_nomad_libnomad_so, sizeof(__pyx_k_lib_nomad_libnomad_so), 0, 1, 0, 0},
  18886. {&__pyx_kp_u_lib_nomad_libsgtelib_so, __pyx_k_lib_nomad_libsgtelib_so, sizeof(__pyx_k_lib_nomad_libsgtelib_so), 0, 1, 0, 0},
  18887. {&__pyx_n_s_list_of_edges, __pyx_k_list_of_edges, sizeof(__pyx_k_list_of_edges), 0, 0, 1, 1},
  18888. {&__pyx_n_s_list_of_edit_cost_options, __pyx_k_list_of_edit_cost_options, sizeof(__pyx_k_list_of_edit_cost_options), 0, 0, 1, 1},
  18889. {&__pyx_n_s_list_of_init_options, __pyx_k_list_of_init_options, sizeof(__pyx_k_list_of_init_options), 0, 0, 1, 1},
  18890. {&__pyx_n_s_list_of_method_options, __pyx_k_list_of_method_options, sizeof(__pyx_k_list_of_method_options), 0, 0, 1, 1},
  18891. {&__pyx_n_s_list_of_nodes, __pyx_k_list_of_nodes, sizeof(__pyx_k_list_of_nodes), 0, 0, 1, 1},
  18892. {&__pyx_n_s_load_GXL_graphs, __pyx_k_load_GXL_graphs, sizeof(__pyx_k_load_GXL_graphs), 0, 0, 1, 1},
  18893. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  18894. {&__pyx_n_s_map_b, __pyx_k_map_b, sizeof(__pyx_k_map_b), 0, 0, 1, 1},
  18895. {&__pyx_n_s_map_edge_b, __pyx_k_map_edge_b, sizeof(__pyx_k_map_edge_b), 0, 0, 1, 1},
  18896. {&__pyx_n_s_map_edges, __pyx_k_map_edges, sizeof(__pyx_k_map_edges), 0, 0, 1, 1},
  18897. {&__pyx_n_s_map_u, __pyx_k_map_u, sizeof(__pyx_k_map_u), 0, 0, 1, 1},
  18898. {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  18899. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  18900. {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  18901. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  18902. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  18903. {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  18904. {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
  18905. {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
  18906. {&__pyx_n_s_networkx, __pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 0, 1, 1},
  18907. {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  18908. {&__pyx_n_s_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1},
  18909. {&__pyx_n_s_node_label, __pyx_k_node_label, sizeof(__pyx_k_node_label), 0, 0, 1, 1},
  18910. {&__pyx_n_s_node_label_1, __pyx_k_node_label_1, sizeof(__pyx_k_node_label_1), 0, 0, 1, 1},
  18911. {&__pyx_n_s_node_label_2, __pyx_k_node_label_2, sizeof(__pyx_k_node_label_2), 0, 0, 1, 1},
  18912. {&__pyx_n_s_node_type, __pyx_k_node_type, sizeof(__pyx_k_node_type), 0, 0, 1, 1},
  18913. {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  18914. {&__pyx_kp_u_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 1, 0, 0},
  18915. {&__pyx_kp_u_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 1, 0, 0},
  18916. {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
  18917. {&__pyx_n_s_nx_graph, __pyx_k_nx_graph, sizeof(__pyx_k_nx_graph), 0, 0, 1, 1},
  18918. {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
  18919. {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  18920. {&__pyx_n_u_original_node_ids, __pyx_k_original_node_ids, sizeof(__pyx_k_original_node_ids), 0, 1, 0, 1},
  18921. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  18922. {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  18923. {&__pyx_n_s_path_XML, __pyx_k_path_XML, sizeof(__pyx_k_path_XML), 0, 0, 1, 1},
  18924. {&__pyx_n_s_path_folder, __pyx_k_path_folder, sizeof(__pyx_k_path_folder), 0, 0, 1, 1},
  18925. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  18926. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  18927. {&__pyx_n_s_print_to_stdout, __pyx_k_print_to_stdout, sizeof(__pyx_k_print_to_stdout), 0, 0, 1, 1},
  18928. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  18929. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  18930. {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1},
  18931. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  18932. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  18933. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  18934. {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  18935. {&__pyx_n_s_restart_env, __pyx_k_restart_env, sizeof(__pyx_k_restart_env), 0, 0, 1, 1},
  18936. {&__pyx_n_s_run_method, __pyx_k_run_method, sizeof(__pyx_k_run_method), 0, 0, 1, 1},
  18937. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  18938. {&__pyx_n_s_set_edit_cost, __pyx_k_set_edit_cost, sizeof(__pyx_k_set_edit_cost), 0, 0, 1, 1},
  18939. {&__pyx_n_s_set_method, __pyx_k_set_method, sizeof(__pyx_k_set_method), 0, 0, 1, 1},
  18940. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  18941. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  18942. {&__pyx_n_s_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 0, 1, 1},
  18943. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  18944. {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
  18945. {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  18946. {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  18947. {&__pyx_kp_u_with_all_the_others_including_h, __pyx_k_with_all_the_others_including_h, sizeof(__pyx_k_with_all_the_others_including_h), 0, 1, 0, 0},
  18948. {0, 0, 0, 0, 0, 0, 0}
  18949. };
  18950. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  18951. __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 958, __pyx_L1_error)
  18952. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 975, __pyx_L1_error)
  18953. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  18954. __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
  18955. __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
  18956. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
  18957. __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 109, __pyx_L1_error)
  18958. return 0;
  18959. __pyx_L1_error:;
  18960. return -1;
  18961. }
  18962. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  18963. __Pyx_RefNannyDeclarations
  18964. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  18965. /* "gedlibpy.pyx":958
  18966. * self.restart_env()
  18967. *
  18968. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  18969. * for graph in dataset :
  18970. * self.add_nx_graph(graph, classes)
  18971. */
  18972. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Loading_graphs_in_progress); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 958, __pyx_L1_error)
  18973. __Pyx_GOTREF(__pyx_tuple__4);
  18974. __Pyx_GIVEREF(__pyx_tuple__4);
  18975. /* "gedlibpy.pyx":962
  18976. * self.add_nx_graph(graph, classes)
  18977. * listID = self.graph_ids()
  18978. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  18979. * print("Number of graphs = " + str(listID[1]))
  18980. *
  18981. */
  18982. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 962, __pyx_L1_error)
  18983. __Pyx_GOTREF(__pyx_tuple__5);
  18984. __Pyx_GIVEREF(__pyx_tuple__5);
  18985. /* "gedlibpy.pyx":966
  18986. *
  18987. * self.set_edit_cost(edit_cost)
  18988. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  18989. * self.init(init_option)
  18990. * print("Initialization terminated !")
  18991. */
  18992. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 966, __pyx_L1_error)
  18993. __Pyx_GOTREF(__pyx_tuple__6);
  18994. __Pyx_GIVEREF(__pyx_tuple__6);
  18995. /* "gedlibpy.pyx":968
  18996. * print("Initialization in progress...")
  18997. * self.init(init_option)
  18998. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  18999. *
  19000. * self.set_method(method, options)
  19001. */
  19002. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 968, __pyx_L1_error)
  19003. __Pyx_GOTREF(__pyx_tuple__7);
  19004. __Pyx_GIVEREF(__pyx_tuple__7);
  19005. /* "gedlibpy.pyx":983
  19006. * resMapping[g][h] = self.get_node_map(g, h)
  19007. *
  19008. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  19009. * return resDistance, resMapping
  19010. *
  19011. */
  19012. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Finish_The_return_contains_edit); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 983, __pyx_L1_error)
  19013. __Pyx_GOTREF(__pyx_tuple__8);
  19014. __Pyx_GIVEREF(__pyx_tuple__8);
  19015. /* "gedlibpy.pyx":1038
  19016. * #return res
  19017. *
  19018. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  19019. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  19020. * return listID
  19021. */
  19022. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Finish_You_can_check_the_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1038, __pyx_L1_error)
  19023. __Pyx_GOTREF(__pyx_tuple__9);
  19024. __Pyx_GIVEREF(__pyx_tuple__9);
  19025. /* "gedlibpy.pyx":1039
  19026. *
  19027. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  19028. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  19029. * return listID
  19030. *
  19031. */
  19032. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Please_don_t_restart_the_environ); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1039, __pyx_L1_error)
  19033. __Pyx_GOTREF(__pyx_tuple__10);
  19034. __Pyx_GIVEREF(__pyx_tuple__10);
  19035. /* "(tree fragment)":2
  19036. * def __reduce_cython__(self):
  19037. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19038. * def __setstate_cython__(self, __pyx_state):
  19039. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19040. */
  19041. __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 2, __pyx_L1_error)
  19042. __Pyx_GOTREF(__pyx_tuple__11);
  19043. __Pyx_GIVEREF(__pyx_tuple__11);
  19044. /* "(tree fragment)":4
  19045. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19046. * def __setstate_cython__(self, __pyx_state):
  19047. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19048. */
  19049. __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 4, __pyx_L1_error)
  19050. __Pyx_GOTREF(__pyx_tuple__12);
  19051. __Pyx_GIVEREF(__pyx_tuple__12);
  19052. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  19053. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  19054. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  19055. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  19056. *
  19057. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19058. */
  19059. __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(2, 272, __pyx_L1_error)
  19060. __Pyx_GOTREF(__pyx_tuple__13);
  19061. __Pyx_GIVEREF(__pyx_tuple__13);
  19062. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  19063. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19064. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  19065. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  19066. *
  19067. * info.buf = PyArray_DATA(self)
  19068. */
  19069. __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(2, 276, __pyx_L1_error)
  19070. __Pyx_GOTREF(__pyx_tuple__14);
  19071. __Pyx_GIVEREF(__pyx_tuple__14);
  19072. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  19073. * if ((descr.byteorder == c'>' and little_endian) or
  19074. * (descr.byteorder == c'<' and not little_endian)):
  19075. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  19076. * if t == NPY_BYTE: f = "b"
  19077. * elif t == NPY_UBYTE: f = "B"
  19078. */
  19079. __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(2, 306, __pyx_L1_error)
  19080. __Pyx_GOTREF(__pyx_tuple__15);
  19081. __Pyx_GIVEREF(__pyx_tuple__15);
  19082. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  19083. *
  19084. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  19085. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  19086. *
  19087. * if ((child.byteorder == c'>' and little_endian) or
  19088. */
  19089. __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(2, 856, __pyx_L1_error)
  19090. __Pyx_GOTREF(__pyx_tuple__16);
  19091. __Pyx_GIVEREF(__pyx_tuple__16);
  19092. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  19093. * t = child.type_num
  19094. * if end - f < 5:
  19095. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  19096. *
  19097. * # Until ticket #99 is fixed, use integers to avoid warnings
  19098. */
  19099. __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(2, 880, __pyx_L1_error)
  19100. __Pyx_GOTREF(__pyx_tuple__17);
  19101. __Pyx_GIVEREF(__pyx_tuple__17);
  19102. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  19103. * _import_array()
  19104. * except Exception:
  19105. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  19106. *
  19107. * cdef inline int import_umath() except -1:
  19108. */
  19109. __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 1038, __pyx_L1_error)
  19110. __Pyx_GOTREF(__pyx_tuple__18);
  19111. __Pyx_GIVEREF(__pyx_tuple__18);
  19112. /* "../../../../../../../../../home/ljia/.local/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  19113. * _import_umath()
  19114. * except Exception:
  19115. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  19116. *
  19117. * cdef inline int import_ufunc() except -1:
  19118. */
  19119. __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_u_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 1044, __pyx_L1_error)
  19120. __Pyx_GOTREF(__pyx_tuple__19);
  19121. __Pyx_GIVEREF(__pyx_tuple__19);
  19122. /* "gedlibpy.pyx":126
  19123. *
  19124. *
  19125. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  19126. * """
  19127. * Searchs the differents edit cost functions and returns the result.
  19128. */
  19129. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 126, __pyx_L1_error)
  19130. __Pyx_GOTREF(__pyx_tuple__21);
  19131. __Pyx_GIVEREF(__pyx_tuple__21);
  19132. __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_edit_cost_options, 126, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 126, __pyx_L1_error)
  19133. /* "gedlibpy.pyx":140
  19134. *
  19135. *
  19136. * def get_method_options() : # <<<<<<<<<<<<<<
  19137. * """
  19138. * Searchs the differents method for edit distance computation between graphs and returns the result.
  19139. */
  19140. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 140, __pyx_L1_error)
  19141. __Pyx_GOTREF(__pyx_tuple__23);
  19142. __Pyx_GIVEREF(__pyx_tuple__23);
  19143. __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_method_options, 140, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 140, __pyx_L1_error)
  19144. /* "gedlibpy.pyx":153
  19145. *
  19146. *
  19147. * def get_init_options() : # <<<<<<<<<<<<<<
  19148. * """
  19149. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  19150. */
  19151. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 153, __pyx_L1_error)
  19152. __Pyx_GOTREF(__pyx_tuple__25);
  19153. __Pyx_GIVEREF(__pyx_tuple__25);
  19154. __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_init_options, 153, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 153, __pyx_L1_error)
  19155. /* "gedlibpy.pyx":166
  19156. *
  19157. *
  19158. * def get_dummy_node() : # <<<<<<<<<<<<<<
  19159. * """
  19160. * Returns the ID of a dummy node.
  19161. */
  19162. __pyx_codeobj__27 = (PyObject*)__Pyx_PyCode_New(0, 0, 0, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_get_dummy_node, 166, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 166, __pyx_L1_error)
  19163. /* "gedlibpy.pyx":1375
  19164. * :type message: string
  19165. * """
  19166. * def __init__(self, message): # <<<<<<<<<<<<<<
  19167. * """
  19168. * Inits the error with its message.
  19169. */
  19170. __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1375, __pyx_L1_error)
  19171. __Pyx_GOTREF(__pyx_tuple__28);
  19172. __Pyx_GIVEREF(__pyx_tuple__28);
  19173. __pyx_codeobj__29 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__28, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1375, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1375, __pyx_L1_error)
  19174. /* "gedlibpy.pyx":1392
  19175. * :type message: string
  19176. * """
  19177. * def __init__(self, message): # <<<<<<<<<<<<<<
  19178. * """
  19179. * Inits the error with its message.
  19180. */
  19181. __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1392, __pyx_L1_error)
  19182. __Pyx_GOTREF(__pyx_tuple__30);
  19183. __Pyx_GIVEREF(__pyx_tuple__30);
  19184. __pyx_codeobj__31 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__30, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1392, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1392, __pyx_L1_error)
  19185. /* "gedlibpy.pyx":1409
  19186. * :type message: string
  19187. * """
  19188. * def __init__(self, message): # <<<<<<<<<<<<<<
  19189. * """
  19190. * Inits the error with its message.
  19191. */
  19192. __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1409, __pyx_L1_error)
  19193. __Pyx_GOTREF(__pyx_tuple__32);
  19194. __Pyx_GIVEREF(__pyx_tuple__32);
  19195. __pyx_codeobj__33 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__32, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_init_2, 1409, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1409, __pyx_L1_error)
  19196. /* "gedlibpy.pyx":1423
  19197. * #########################################
  19198. *
  19199. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  19200. * """
  19201. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  19202. */
  19203. __pyx_tuple__34 = PyTuple_Pack(4, __pyx_n_s_map_u, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 1423, __pyx_L1_error)
  19204. __Pyx_GOTREF(__pyx_tuple__34);
  19205. __Pyx_GIVEREF(__pyx_tuple__34);
  19206. __pyx_codeobj__35 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__34, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_encode_your_map, 1423, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1423, __pyx_L1_error)
  19207. /* "gedlibpy.pyx":1441
  19208. *
  19209. *
  19210. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  19211. * """
  19212. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  19213. */
  19214. __pyx_tuple__36 = PyTuple_Pack(4, __pyx_n_s_map_b, __pyx_n_s_res, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(0, 1441, __pyx_L1_error)
  19215. __Pyx_GOTREF(__pyx_tuple__36);
  19216. __Pyx_GIVEREF(__pyx_tuple__36);
  19217. __pyx_codeobj__37 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__36, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_your_map, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1441, __pyx_L1_error)
  19218. /* "gedlibpy.pyx":1459
  19219. *
  19220. *
  19221. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  19222. * """
  19223. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  19224. */
  19225. __pyx_tuple__38 = PyTuple_Pack(4, __pyx_n_s_map_edge_b, __pyx_n_s_map_edges, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 1459, __pyx_L1_error)
  19226. __Pyx_GOTREF(__pyx_tuple__38);
  19227. __Pyx_GIVEREF(__pyx_tuple__38);
  19228. __pyx_codeobj__39 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_gedlibpy_pyx, __pyx_n_s_decode_graph_edges, 1459, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1459, __pyx_L1_error)
  19229. __Pyx_RefNannyFinishContext();
  19230. return 0;
  19231. __pyx_L1_error:;
  19232. __Pyx_RefNannyFinishContext();
  19233. return -1;
  19234. }
  19235. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  19236. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  19237. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  19238. return 0;
  19239. __pyx_L1_error:;
  19240. return -1;
  19241. }
  19242. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  19243. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  19244. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  19245. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  19246. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  19247. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  19248. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  19249. static int __Pyx_modinit_global_init_code(void) {
  19250. __Pyx_RefNannyDeclarations
  19251. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  19252. /*--- Global init code ---*/
  19253. __Pyx_RefNannyFinishContext();
  19254. return 0;
  19255. }
  19256. static int __Pyx_modinit_variable_export_code(void) {
  19257. __Pyx_RefNannyDeclarations
  19258. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  19259. /*--- Variable export code ---*/
  19260. __Pyx_RefNannyFinishContext();
  19261. return 0;
  19262. }
  19263. static int __Pyx_modinit_function_export_code(void) {
  19264. __Pyx_RefNannyDeclarations
  19265. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  19266. /*--- Function export code ---*/
  19267. __Pyx_RefNannyFinishContext();
  19268. return 0;
  19269. }
  19270. static int __Pyx_modinit_type_init_code(void) {
  19271. __Pyx_RefNannyDeclarations
  19272. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  19273. /*--- Type init code ---*/
  19274. if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  19275. #if PY_VERSION_HEX < 0x030800B1
  19276. __pyx_type_8gedlibpy_GEDEnv.tp_print = 0;
  19277. #endif
  19278. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8gedlibpy_GEDEnv.tp_dictoffset && __pyx_type_8gedlibpy_GEDEnv.tp_getattro == PyObject_GenericGetAttr)) {
  19279. __pyx_type_8gedlibpy_GEDEnv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  19280. }
  19281. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  19282. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 178, __pyx_L1_error)
  19283. __pyx_ptype_8gedlibpy_GEDEnv = &__pyx_type_8gedlibpy_GEDEnv;
  19284. __Pyx_RefNannyFinishContext();
  19285. return 0;
  19286. __pyx_L1_error:;
  19287. __Pyx_RefNannyFinishContext();
  19288. return -1;
  19289. }
  19290. static int __Pyx_modinit_type_import_code(void) {
  19291. __Pyx_RefNannyDeclarations
  19292. PyObject *__pyx_t_1 = NULL;
  19293. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  19294. /*--- Type import code ---*/
  19295. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  19296. __Pyx_GOTREF(__pyx_t_1);
  19297. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  19298. #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  19299. sizeof(PyTypeObject),
  19300. #else
  19301. sizeof(PyHeapTypeObject),
  19302. #endif
  19303. __Pyx_ImportType_CheckSize_Warn);
  19304. if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
  19305. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19306. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  19307. __Pyx_GOTREF(__pyx_t_1);
  19308. __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
  19309. if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
  19310. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19311. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  19312. __Pyx_GOTREF(__pyx_t_1);
  19313. __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
  19314. if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
  19315. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19316. __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
  19317. __Pyx_GOTREF(__pyx_t_1);
  19318. __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
  19319. if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
  19320. __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
  19321. if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
  19322. __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
  19323. if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
  19324. __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
  19325. if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
  19326. __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
  19327. if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
  19328. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19329. __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 58, __pyx_L1_error)
  19330. __Pyx_GOTREF(__pyx_t_1);
  19331. __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn);
  19332. if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 58, __pyx_L1_error)
  19333. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19334. __Pyx_RefNannyFinishContext();
  19335. return 0;
  19336. __pyx_L1_error:;
  19337. __Pyx_XDECREF(__pyx_t_1);
  19338. __Pyx_RefNannyFinishContext();
  19339. return -1;
  19340. }
  19341. static int __Pyx_modinit_variable_import_code(void) {
  19342. __Pyx_RefNannyDeclarations
  19343. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  19344. /*--- Variable import code ---*/
  19345. __Pyx_RefNannyFinishContext();
  19346. return 0;
  19347. }
  19348. static int __Pyx_modinit_function_import_code(void) {
  19349. __Pyx_RefNannyDeclarations
  19350. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  19351. /*--- Function import code ---*/
  19352. __Pyx_RefNannyFinishContext();
  19353. return 0;
  19354. }
  19355. #if PY_MAJOR_VERSION < 3
  19356. #ifdef CYTHON_NO_PYINIT_EXPORT
  19357. #define __Pyx_PyMODINIT_FUNC void
  19358. #else
  19359. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  19360. #endif
  19361. #else
  19362. #ifdef CYTHON_NO_PYINIT_EXPORT
  19363. #define __Pyx_PyMODINIT_FUNC PyObject *
  19364. #else
  19365. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  19366. #endif
  19367. #endif
  19368. #if PY_MAJOR_VERSION < 3
  19369. __Pyx_PyMODINIT_FUNC initgedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  19370. __Pyx_PyMODINIT_FUNC initgedlibpy(void)
  19371. #else
  19372. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  19373. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)
  19374. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19375. {
  19376. return PyModuleDef_Init(&__pyx_moduledef);
  19377. }
  19378. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  19379. #if PY_VERSION_HEX >= 0x030700A1
  19380. static PY_INT64_T main_interpreter_id = -1;
  19381. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  19382. if (main_interpreter_id == -1) {
  19383. main_interpreter_id = current_id;
  19384. return (unlikely(current_id == -1)) ? -1 : 0;
  19385. } else if (unlikely(main_interpreter_id != current_id))
  19386. #else
  19387. static PyInterpreterState *main_interpreter = NULL;
  19388. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  19389. if (!main_interpreter) {
  19390. main_interpreter = current_interpreter;
  19391. } else if (unlikely(main_interpreter != current_interpreter))
  19392. #endif
  19393. {
  19394. PyErr_SetString(
  19395. PyExc_ImportError,
  19396. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  19397. return -1;
  19398. }
  19399. return 0;
  19400. }
  19401. 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) {
  19402. PyObject *value = PyObject_GetAttrString(spec, from_name);
  19403. int result = 0;
  19404. if (likely(value)) {
  19405. if (allow_none || value != Py_None) {
  19406. result = PyDict_SetItemString(moddict, to_name, value);
  19407. }
  19408. Py_DECREF(value);
  19409. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  19410. PyErr_Clear();
  19411. } else {
  19412. result = -1;
  19413. }
  19414. return result;
  19415. }
  19416. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  19417. PyObject *module = NULL, *moddict, *modname;
  19418. if (__Pyx_check_single_interpreter())
  19419. return NULL;
  19420. if (__pyx_m)
  19421. return __Pyx_NewRef(__pyx_m);
  19422. modname = PyObject_GetAttrString(spec, "name");
  19423. if (unlikely(!modname)) goto bad;
  19424. module = PyModule_NewObject(modname);
  19425. Py_DECREF(modname);
  19426. if (unlikely(!module)) goto bad;
  19427. moddict = PyModule_GetDict(module);
  19428. if (unlikely(!moddict)) goto bad;
  19429. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  19430. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  19431. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  19432. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  19433. return module;
  19434. bad:
  19435. Py_XDECREF(module);
  19436. return NULL;
  19437. }
  19438. static CYTHON_SMALL_CODE int __pyx_pymod_exec_gedlibpy(PyObject *__pyx_pyinit_module)
  19439. #endif
  19440. #endif
  19441. {
  19442. PyObject *__pyx_t_1 = NULL;
  19443. PyObject *__pyx_t_2 = NULL;
  19444. PyObject *__pyx_t_3 = NULL;
  19445. PyObject *__pyx_t_4 = NULL;
  19446. PyObject *__pyx_t_5 = NULL;
  19447. __Pyx_RefNannyDeclarations
  19448. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19449. if (__pyx_m) {
  19450. if (__pyx_m == __pyx_pyinit_module) return 0;
  19451. PyErr_SetString(PyExc_RuntimeError, "Module 'gedlibpy' has already been imported. Re-initialisation is not supported.");
  19452. return -1;
  19453. }
  19454. #elif PY_MAJOR_VERSION >= 3
  19455. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  19456. #endif
  19457. #if CYTHON_REFNANNY
  19458. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  19459. if (!__Pyx_RefNanny) {
  19460. PyErr_Clear();
  19461. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  19462. if (!__Pyx_RefNanny)
  19463. Py_FatalError("failed to import 'refnanny' module");
  19464. }
  19465. #endif
  19466. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)", 0);
  19467. if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19468. #ifdef __Pxy_PyFrame_Initialize_Offsets
  19469. __Pxy_PyFrame_Initialize_Offsets();
  19470. #endif
  19471. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  19472. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  19473. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  19474. #ifdef __Pyx_CyFunction_USED
  19475. if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19476. #endif
  19477. #ifdef __Pyx_FusedFunction_USED
  19478. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19479. #endif
  19480. #ifdef __Pyx_Coroutine_USED
  19481. if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19482. #endif
  19483. #ifdef __Pyx_Generator_USED
  19484. if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19485. #endif
  19486. #ifdef __Pyx_AsyncGen_USED
  19487. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19488. #endif
  19489. #ifdef __Pyx_StopAsyncIteration_USED
  19490. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19491. #endif
  19492. /*--- Library function declarations ---*/
  19493. /*--- Threads initialization code ---*/
  19494. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  19495. #ifdef WITH_THREAD /* Python build with threading support? */
  19496. PyEval_InitThreads();
  19497. #endif
  19498. #endif
  19499. /*--- Module creation code ---*/
  19500. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19501. __pyx_m = __pyx_pyinit_module;
  19502. Py_INCREF(__pyx_m);
  19503. #else
  19504. #if PY_MAJOR_VERSION < 3
  19505. __pyx_m = Py_InitModule4("gedlibpy", __pyx_methods, __pyx_k_Python_GedLib_module_This_modul, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  19506. #else
  19507. __pyx_m = PyModule_Create(&__pyx_moduledef);
  19508. #endif
  19509. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  19510. #endif
  19511. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  19512. Py_INCREF(__pyx_d);
  19513. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  19514. Py_INCREF(__pyx_b);
  19515. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  19516. Py_INCREF(__pyx_cython_runtime);
  19517. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  19518. /*--- Initialize various global constants etc. ---*/
  19519. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19520. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  19521. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19522. #endif
  19523. if (__pyx_module_is_main_gedlibpy) {
  19524. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19525. }
  19526. #if PY_MAJOR_VERSION >= 3
  19527. {
  19528. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  19529. if (!PyDict_GetItemString(modules, "gedlibpy")) {
  19530. if (unlikely(PyDict_SetItemString(modules, "gedlibpy", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  19531. }
  19532. }
  19533. #endif
  19534. /*--- Builtin init code ---*/
  19535. if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  19536. /*--- Constants init code ---*/
  19537. if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  19538. /*--- Global type/function init code ---*/
  19539. (void)__Pyx_modinit_global_init_code();
  19540. (void)__Pyx_modinit_variable_export_code();
  19541. (void)__Pyx_modinit_function_export_code();
  19542. if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  19543. if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  19544. (void)__Pyx_modinit_variable_import_code();
  19545. (void)__Pyx_modinit_function_import_code();
  19546. /*--- Execution code ---*/
  19547. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  19548. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  19549. #endif
  19550. /* "gedlibpy.pyx":115
  19551. * #############################
  19552. *
  19553. * import networkx as nx # <<<<<<<<<<<<<<
  19554. *
  19555. * # import librariesImport
  19556. */
  19557. __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
  19558. __Pyx_GOTREF(__pyx_t_1);
  19559. if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
  19560. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19561. /* "gedlibpy.pyx":118
  19562. *
  19563. * # import librariesImport
  19564. * from ctypes import * # <<<<<<<<<<<<<<
  19565. * import os
  19566. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  19567. */
  19568. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  19569. __Pyx_GOTREF(__pyx_t_1);
  19570. __Pyx_INCREF(__pyx_n_s__20);
  19571. __Pyx_GIVEREF(__pyx_n_s__20);
  19572. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s__20);
  19573. __pyx_t_2 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
  19574. __Pyx_GOTREF(__pyx_t_2);
  19575. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19576. if (__pyx_import_star(__pyx_t_2) < 0) __PYX_ERR(0, 118, __pyx_L1_error);
  19577. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19578. /* "gedlibpy.pyx":119
  19579. * # import librariesImport
  19580. * from ctypes import *
  19581. * import os # <<<<<<<<<<<<<<
  19582. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  19583. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  19584. */
  19585. __pyx_t_2 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 119, __pyx_L1_error)
  19586. __Pyx_GOTREF(__pyx_t_2);
  19587. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_2) < 0) __PYX_ERR(0, 119, __pyx_L1_error)
  19588. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19589. /* "gedlibpy.pyx":120
  19590. * from ctypes import *
  19591. * import os
  19592. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') # <<<<<<<<<<<<<<
  19593. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  19594. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  19595. */
  19596. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cdll); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  19597. __Pyx_GOTREF(__pyx_t_2);
  19598. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
  19599. __Pyx_GOTREF(__pyx_t_1);
  19600. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19601. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  19602. __Pyx_GOTREF(__pyx_t_2);
  19603. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
  19604. __Pyx_GOTREF(__pyx_t_3);
  19605. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19606. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  19607. __Pyx_GOTREF(__pyx_t_2);
  19608. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19609. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
  19610. __Pyx_GOTREF(__pyx_t_3);
  19611. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  19612. __Pyx_GOTREF(__pyx_t_4);
  19613. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19614. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 120, __pyx_L1_error)
  19615. __Pyx_GOTREF(__pyx_t_3);
  19616. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19617. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  19618. __Pyx_GOTREF(__pyx_t_4);
  19619. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
  19620. __Pyx_GOTREF(__pyx_t_5);
  19621. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19622. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19623. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  19624. __Pyx_GOTREF(__pyx_t_4);
  19625. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19626. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19627. __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_fann_libdoublefann_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 120, __pyx_L1_error)
  19628. __Pyx_GOTREF(__pyx_t_5);
  19629. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19630. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 120, __pyx_L1_error)
  19631. __Pyx_GOTREF(__pyx_t_4);
  19632. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19633. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19634. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 120, __pyx_L1_error)
  19635. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19636. /* "gedlibpy.pyx":121
  19637. * import os
  19638. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  19639. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') # <<<<<<<<<<<<<<
  19640. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  19641. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  19642. */
  19643. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  19644. __Pyx_GOTREF(__pyx_t_4);
  19645. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 121, __pyx_L1_error)
  19646. __Pyx_GOTREF(__pyx_t_5);
  19647. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19648. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  19649. __Pyx_GOTREF(__pyx_t_4);
  19650. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  19651. __Pyx_GOTREF(__pyx_t_1);
  19652. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19653. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 121, __pyx_L1_error)
  19654. __Pyx_GOTREF(__pyx_t_4);
  19655. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19656. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  19657. __Pyx_GOTREF(__pyx_t_1);
  19658. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  19659. __Pyx_GOTREF(__pyx_t_2);
  19660. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19661. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_realpath); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  19662. __Pyx_GOTREF(__pyx_t_1);
  19663. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19664. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  19665. __Pyx_GOTREF(__pyx_t_2);
  19666. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
  19667. __Pyx_GOTREF(__pyx_t_3);
  19668. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19669. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19670. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  19671. __Pyx_GOTREF(__pyx_t_2);
  19672. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19673. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19674. __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_lib_libsvm_3_22_libsvm_so); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 121, __pyx_L1_error)
  19675. __Pyx_GOTREF(__pyx_t_3);
  19676. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19677. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  19678. __Pyx_GOTREF(__pyx_t_2);
  19679. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19680. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19681. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_2) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  19682. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19683. /* "gedlibpy.pyx":122
  19684. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  19685. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  19686. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') # <<<<<<<<<<<<<<
  19687. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  19688. *
  19689. */
  19690. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cdll); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  19691. __Pyx_GOTREF(__pyx_t_2);
  19692. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  19693. __Pyx_GOTREF(__pyx_t_3);
  19694. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19695. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  19696. __Pyx_GOTREF(__pyx_t_2);
  19697. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  19698. __Pyx_GOTREF(__pyx_t_5);
  19699. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19700. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  19701. __Pyx_GOTREF(__pyx_t_2);
  19702. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19703. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  19704. __Pyx_GOTREF(__pyx_t_5);
  19705. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  19706. __Pyx_GOTREF(__pyx_t_4);
  19707. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19708. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  19709. __Pyx_GOTREF(__pyx_t_5);
  19710. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19711. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  19712. __Pyx_GOTREF(__pyx_t_4);
  19713. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  19714. __Pyx_GOTREF(__pyx_t_1);
  19715. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19716. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19717. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  19718. __Pyx_GOTREF(__pyx_t_4);
  19719. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19720. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19721. __pyx_t_1 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_nomad_libnomad_so); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  19722. __Pyx_GOTREF(__pyx_t_1);
  19723. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19724. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  19725. __Pyx_GOTREF(__pyx_t_4);
  19726. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19727. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19728. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  19729. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19730. /* "gedlibpy.pyx":123
  19731. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  19732. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  19733. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') # <<<<<<<<<<<<<<
  19734. *
  19735. *
  19736. */
  19737. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  19738. __Pyx_GOTREF(__pyx_t_4);
  19739. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  19740. __Pyx_GOTREF(__pyx_t_1);
  19741. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19742. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  19743. __Pyx_GOTREF(__pyx_t_4);
  19744. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  19745. __Pyx_GOTREF(__pyx_t_3);
  19746. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19747. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  19748. __Pyx_GOTREF(__pyx_t_4);
  19749. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19750. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  19751. __Pyx_GOTREF(__pyx_t_3);
  19752. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  19753. __Pyx_GOTREF(__pyx_t_2);
  19754. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19755. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  19756. __Pyx_GOTREF(__pyx_t_3);
  19757. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19758. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_file); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  19759. __Pyx_GOTREF(__pyx_t_2);
  19760. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  19761. __Pyx_GOTREF(__pyx_t_5);
  19762. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19763. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19764. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  19765. __Pyx_GOTREF(__pyx_t_2);
  19766. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19767. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19768. __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_kp_u_lib_nomad_libsgtelib_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  19769. __Pyx_GOTREF(__pyx_t_5);
  19770. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19771. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  19772. __Pyx_GOTREF(__pyx_t_2);
  19773. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19774. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19775. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_2) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
  19776. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19777. /* "gedlibpy.pyx":126
  19778. *
  19779. *
  19780. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  19781. * """
  19782. * Searchs the differents edit cost functions and returns the result.
  19783. */
  19784. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_1get_edit_cost_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  19785. __Pyx_GOTREF(__pyx_t_2);
  19786. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_2) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  19787. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19788. /* "gedlibpy.pyx":140
  19789. *
  19790. *
  19791. * def get_method_options() : # <<<<<<<<<<<<<<
  19792. * """
  19793. * Searchs the differents method for edit distance computation between graphs and returns the result.
  19794. */
  19795. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_3get_method_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
  19796. __Pyx_GOTREF(__pyx_t_2);
  19797. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_2) < 0) __PYX_ERR(0, 140, __pyx_L1_error)
  19798. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19799. /* "gedlibpy.pyx":153
  19800. *
  19801. *
  19802. * def get_init_options() : # <<<<<<<<<<<<<<
  19803. * """
  19804. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  19805. */
  19806. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_5get_init_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 153, __pyx_L1_error)
  19807. __Pyx_GOTREF(__pyx_t_2);
  19808. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_2) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
  19809. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19810. /* "gedlibpy.pyx":166
  19811. *
  19812. *
  19813. * def get_dummy_node() : # <<<<<<<<<<<<<<
  19814. * """
  19815. * Returns the ID of a dummy node.
  19816. */
  19817. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_7get_dummy_node, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 166, __pyx_L1_error)
  19818. __Pyx_GOTREF(__pyx_t_2);
  19819. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_2) < 0) __PYX_ERR(0, 166, __pyx_L1_error)
  19820. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19821. /* "gedlibpy.pyx":483
  19822. *
  19823. *
  19824. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  19825. * """
  19826. * Sets an edit cost function to the environment, if it exists.
  19827. */
  19828. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
  19829. __Pyx_GOTREF(__pyx_t_2);
  19830. __pyx_k__2 = __pyx_t_2;
  19831. __Pyx_GIVEREF(__pyx_t_2);
  19832. __pyx_t_2 = 0;
  19833. /* "gedlibpy.pyx":502
  19834. *
  19835. *
  19836. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  19837. * """
  19838. * Sets an personal edit cost function to the environment.
  19839. */
  19840. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
  19841. __Pyx_GOTREF(__pyx_t_2);
  19842. __pyx_k__3 = __pyx_t_2;
  19843. __Pyx_GIVEREF(__pyx_t_2);
  19844. __pyx_t_2 = 0;
  19845. /* "gedlibpy.pyx":1352
  19846. * #####################################################################
  19847. *
  19848. * list_of_edit_cost_options = get_edit_cost_options() # <<<<<<<<<<<<<<
  19849. * list_of_method_options = get_method_options()
  19850. * list_of_init_options = get_init_options()
  19851. */
  19852. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1352, __pyx_L1_error)
  19853. __Pyx_GOTREF(__pyx_t_2);
  19854. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1352, __pyx_L1_error)
  19855. __Pyx_GOTREF(__pyx_t_5);
  19856. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19857. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1352, __pyx_L1_error)
  19858. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19859. /* "gedlibpy.pyx":1353
  19860. *
  19861. * list_of_edit_cost_options = get_edit_cost_options()
  19862. * list_of_method_options = get_method_options() # <<<<<<<<<<<<<<
  19863. * list_of_init_options = get_init_options()
  19864. *
  19865. */
  19866. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1353, __pyx_L1_error)
  19867. __Pyx_GOTREF(__pyx_t_5);
  19868. __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1353, __pyx_L1_error)
  19869. __Pyx_GOTREF(__pyx_t_2);
  19870. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19871. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_2) < 0) __PYX_ERR(0, 1353, __pyx_L1_error)
  19872. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19873. /* "gedlibpy.pyx":1354
  19874. * list_of_edit_cost_options = get_edit_cost_options()
  19875. * list_of_method_options = get_method_options()
  19876. * list_of_init_options = get_init_options() # <<<<<<<<<<<<<<
  19877. *
  19878. *
  19879. */
  19880. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  19881. __Pyx_GOTREF(__pyx_t_2);
  19882. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1354, __pyx_L1_error)
  19883. __Pyx_GOTREF(__pyx_t_5);
  19884. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19885. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1354, __pyx_L1_error)
  19886. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19887. /* "gedlibpy.pyx":1361
  19888. * #####################
  19889. *
  19890. * class Error(Exception): # <<<<<<<<<<<<<<
  19891. * """
  19892. * Class for error's management. This one is general.
  19893. */
  19894. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error)
  19895. __Pyx_GOTREF(__pyx_t_5);
  19896. __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  19897. __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  19898. PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  19899. __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1361, __pyx_L1_error)
  19900. __Pyx_GOTREF(__pyx_t_2);
  19901. __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_5, __pyx_n_s_Error, __pyx_n_s_Error, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_error_s_management_Th); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
  19902. __Pyx_GOTREF(__pyx_t_1);
  19903. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_Error, __pyx_t_5, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error)
  19904. __Pyx_GOTREF(__pyx_t_4);
  19905. if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1361, __pyx_L1_error)
  19906. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19907. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19908. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19909. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19910. /* "gedlibpy.pyx":1368
  19911. *
  19912. *
  19913. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  19914. * """
  19915. * Class for Edit Cost Error. Raise an error if an edit cost function doesn't exist in the library (not in list_of_edit_cost_options).
  19916. */
  19917. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  19918. __Pyx_GOTREF(__pyx_t_5);
  19919. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
  19920. __Pyx_GOTREF(__pyx_t_2);
  19921. __Pyx_GIVEREF(__pyx_t_5);
  19922. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  19923. __pyx_t_5 = 0;
  19924. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1368, __pyx_L1_error)
  19925. __Pyx_GOTREF(__pyx_t_5);
  19926. __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_EditCostError, __pyx_n_s_EditCostError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Edit_Cost_Error_Raise); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  19927. __Pyx_GOTREF(__pyx_t_1);
  19928. /* "gedlibpy.pyx":1375
  19929. * :type message: string
  19930. * """
  19931. * def __init__(self, message): # <<<<<<<<<<<<<<
  19932. * """
  19933. * Inits the error with its message.
  19934. */
  19935. __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_13EditCostError_1__init__, 0, __pyx_n_s_EditCostError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1375, __pyx_L1_error)
  19936. __Pyx_GOTREF(__pyx_t_4);
  19937. if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1375, __pyx_L1_error)
  19938. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19939. /* "gedlibpy.pyx":1368
  19940. *
  19941. *
  19942. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  19943. * """
  19944. * Class for Edit Cost Error. Raise an error if an edit cost function doesn't exist in the library (not in list_of_edit_cost_options).
  19945. */
  19946. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_EditCostError, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1368, __pyx_L1_error)
  19947. __Pyx_GOTREF(__pyx_t_4);
  19948. if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1368, __pyx_L1_error)
  19949. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19950. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19951. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19952. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19953. /* "gedlibpy.pyx":1385
  19954. *
  19955. *
  19956. * class MethodError(Error) : # <<<<<<<<<<<<<<
  19957. * """
  19958. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  19959. */
  19960. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_Error); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
  19961. __Pyx_GOTREF(__pyx_t_2);
  19962. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
  19963. __Pyx_GOTREF(__pyx_t_5);
  19964. __Pyx_GIVEREF(__pyx_t_2);
  19965. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
  19966. __pyx_t_2 = 0;
  19967. __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1385, __pyx_L1_error)
  19968. __Pyx_GOTREF(__pyx_t_2);
  19969. __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_5, __pyx_n_s_MethodError, __pyx_n_s_MethodError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Method_Error_Raise_an); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
  19970. __Pyx_GOTREF(__pyx_t_1);
  19971. /* "gedlibpy.pyx":1392
  19972. * :type message: string
  19973. * """
  19974. * def __init__(self, message): # <<<<<<<<<<<<<<
  19975. * """
  19976. * Inits the error with its message.
  19977. */
  19978. __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_11MethodError_1__init__, 0, __pyx_n_s_MethodError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__31)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1392, __pyx_L1_error)
  19979. __Pyx_GOTREF(__pyx_t_4);
  19980. if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1392, __pyx_L1_error)
  19981. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19982. /* "gedlibpy.pyx":1385
  19983. *
  19984. *
  19985. * class MethodError(Error) : # <<<<<<<<<<<<<<
  19986. * """
  19987. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  19988. */
  19989. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_MethodError, __pyx_t_5, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1385, __pyx_L1_error)
  19990. __Pyx_GOTREF(__pyx_t_4);
  19991. if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1385, __pyx_L1_error)
  19992. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  19993. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19994. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  19995. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  19996. /* "gedlibpy.pyx":1402
  19997. *
  19998. *
  19999. * class InitError(Error) : # <<<<<<<<<<<<<<
  20000. * """
  20001. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20002. */
  20003. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error)
  20004. __Pyx_GOTREF(__pyx_t_5);
  20005. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1402, __pyx_L1_error)
  20006. __Pyx_GOTREF(__pyx_t_2);
  20007. __Pyx_GIVEREF(__pyx_t_5);
  20008. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  20009. __pyx_t_5 = 0;
  20010. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1402, __pyx_L1_error)
  20011. __Pyx_GOTREF(__pyx_t_5);
  20012. __pyx_t_1 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_2, __pyx_n_s_InitError, __pyx_n_s_InitError, (PyObject *) NULL, __pyx_n_s_gedlibpy, __pyx_kp_s_Class_for_Init_Error_Raise_an_e); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1402, __pyx_L1_error)
  20013. __Pyx_GOTREF(__pyx_t_1);
  20014. /* "gedlibpy.pyx":1409
  20015. * :type message: string
  20016. * """
  20017. * def __init__(self, message): # <<<<<<<<<<<<<<
  20018. * """
  20019. * Inits the error with its message.
  20020. */
  20021. __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8gedlibpy_9InitError_1__init__, 0, __pyx_n_s_InitError___init, NULL, __pyx_n_s_gedlibpy, __pyx_d, ((PyObject *)__pyx_codeobj__33)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1409, __pyx_L1_error)
  20022. __Pyx_GOTREF(__pyx_t_4);
  20023. if (__Pyx_SetNameInClass(__pyx_t_1, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1409, __pyx_L1_error)
  20024. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20025. /* "gedlibpy.pyx":1402
  20026. *
  20027. *
  20028. * class InitError(Error) : # <<<<<<<<<<<<<<
  20029. * """
  20030. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20031. */
  20032. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InitError, __pyx_t_2, __pyx_t_1, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error)
  20033. __Pyx_GOTREF(__pyx_t_4);
  20034. if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1402, __pyx_L1_error)
  20035. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20036. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20037. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20038. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20039. /* "gedlibpy.pyx":1423
  20040. * #########################################
  20041. *
  20042. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20043. * """
  20044. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20045. */
  20046. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1423, __pyx_L1_error)
  20047. __Pyx_GOTREF(__pyx_t_2);
  20048. if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_2) < 0) __PYX_ERR(0, 1423, __pyx_L1_error)
  20049. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20050. /* "gedlibpy.pyx":1441
  20051. *
  20052. *
  20053. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20054. * """
  20055. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20056. */
  20057. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error)
  20058. __Pyx_GOTREF(__pyx_t_2);
  20059. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_2) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  20060. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20061. /* "gedlibpy.pyx":1459
  20062. *
  20063. *
  20064. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20065. * """
  20066. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  20067. */
  20068. __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
  20069. __Pyx_GOTREF(__pyx_t_2);
  20070. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_2) < 0) __PYX_ERR(0, 1459, __pyx_L1_error)
  20071. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20072. /* "gedlibpy.pyx":1
  20073. * # distutils: language = c++ # <<<<<<<<<<<<<<
  20074. *
  20075. * """
  20076. */
  20077. __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  20078. __Pyx_GOTREF(__pyx_t_2);
  20079. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20080. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20081. /* "vector.from_py":45
  20082. *
  20083. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  20084. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___(object o) except *: # <<<<<<<<<<<<<<
  20085. * cdef vector[X] v
  20086. * for item in o:
  20087. */
  20088. /*--- Wrapped vars code ---*/
  20089. goto __pyx_L0;
  20090. __pyx_L1_error:;
  20091. __Pyx_XDECREF(__pyx_t_1);
  20092. __Pyx_XDECREF(__pyx_t_2);
  20093. __Pyx_XDECREF(__pyx_t_3);
  20094. __Pyx_XDECREF(__pyx_t_4);
  20095. __Pyx_XDECREF(__pyx_t_5);
  20096. if (__pyx_m) {
  20097. if (__pyx_d) {
  20098. __Pyx_AddTraceback("init gedlibpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  20099. }
  20100. Py_CLEAR(__pyx_m);
  20101. } else if (!PyErr_Occurred()) {
  20102. PyErr_SetString(PyExc_ImportError, "init gedlibpy");
  20103. }
  20104. __pyx_L0:;
  20105. __Pyx_RefNannyFinishContext();
  20106. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20107. return (__pyx_m != NULL) ? 0 : -1;
  20108. #elif PY_MAJOR_VERSION >= 3
  20109. return __pyx_m;
  20110. #else
  20111. return;
  20112. #endif
  20113. }
  20114. /* --- Runtime support code --- */
  20115. /* Refnanny */
  20116. #if CYTHON_REFNANNY
  20117. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  20118. PyObject *m = NULL, *p = NULL;
  20119. void *r = NULL;
  20120. m = PyImport_ImportModule(modname);
  20121. if (!m) goto end;
  20122. p = PyObject_GetAttrString(m, "RefNannyAPI");
  20123. if (!p) goto end;
  20124. r = PyLong_AsVoidPtr(p);
  20125. end:
  20126. Py_XDECREF(p);
  20127. Py_XDECREF(m);
  20128. return (__Pyx_RefNannyAPIStruct *)r;
  20129. }
  20130. #endif
  20131. /* PyObjectGetAttrStr */
  20132. #if CYTHON_USE_TYPE_SLOTS
  20133. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  20134. PyTypeObject* tp = Py_TYPE(obj);
  20135. if (likely(tp->tp_getattro))
  20136. return tp->tp_getattro(obj, attr_name);
  20137. #if PY_MAJOR_VERSION < 3
  20138. if (likely(tp->tp_getattr))
  20139. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  20140. #endif
  20141. return PyObject_GetAttr(obj, attr_name);
  20142. }
  20143. #endif
  20144. /* GetBuiltinName */
  20145. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  20146. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  20147. if (unlikely(!result)) {
  20148. PyErr_Format(PyExc_NameError,
  20149. #if PY_MAJOR_VERSION >= 3
  20150. "name '%U' is not defined", name);
  20151. #else
  20152. "name '%.200s' is not defined", PyString_AS_STRING(name));
  20153. #endif
  20154. }
  20155. return result;
  20156. }
  20157. /* decode_c_bytes */
  20158. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  20159. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  20160. const char* encoding, const char* errors,
  20161. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  20162. if (unlikely((start < 0) | (stop < 0))) {
  20163. if (start < 0) {
  20164. start += length;
  20165. if (start < 0)
  20166. start = 0;
  20167. }
  20168. if (stop < 0)
  20169. stop += length;
  20170. }
  20171. if (stop > length)
  20172. stop = length;
  20173. length = stop - start;
  20174. if (unlikely(length <= 0))
  20175. return PyUnicode_FromUnicode(NULL, 0);
  20176. cstring += start;
  20177. if (decode_func) {
  20178. return decode_func(cstring, length, errors);
  20179. } else {
  20180. return PyUnicode_Decode(cstring, length, encoding, errors);
  20181. }
  20182. }
  20183. /* RaiseArgTupleInvalid */
  20184. static void __Pyx_RaiseArgtupleInvalid(
  20185. const char* func_name,
  20186. int exact,
  20187. Py_ssize_t num_min,
  20188. Py_ssize_t num_max,
  20189. Py_ssize_t num_found)
  20190. {
  20191. Py_ssize_t num_expected;
  20192. const char *more_or_less;
  20193. if (num_found < num_min) {
  20194. num_expected = num_min;
  20195. more_or_less = "at least";
  20196. } else {
  20197. num_expected = num_max;
  20198. more_or_less = "at most";
  20199. }
  20200. if (exact) {
  20201. more_or_less = "exactly";
  20202. }
  20203. PyErr_Format(PyExc_TypeError,
  20204. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  20205. func_name, more_or_less, num_expected,
  20206. (num_expected == 1) ? "" : "s", num_found);
  20207. }
  20208. /* KeywordStringCheck */
  20209. static int __Pyx_CheckKeywordStrings(
  20210. PyObject *kwdict,
  20211. const char* function_name,
  20212. int kw_allowed)
  20213. {
  20214. PyObject* key = 0;
  20215. Py_ssize_t pos = 0;
  20216. #if CYTHON_COMPILING_IN_PYPY
  20217. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  20218. goto invalid_keyword;
  20219. return 1;
  20220. #else
  20221. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  20222. #if PY_MAJOR_VERSION < 3
  20223. if (unlikely(!PyString_Check(key)))
  20224. #endif
  20225. if (unlikely(!PyUnicode_Check(key)))
  20226. goto invalid_keyword_type;
  20227. }
  20228. if ((!kw_allowed) && unlikely(key))
  20229. goto invalid_keyword;
  20230. return 1;
  20231. invalid_keyword_type:
  20232. PyErr_Format(PyExc_TypeError,
  20233. "%.200s() keywords must be strings", function_name);
  20234. return 0;
  20235. #endif
  20236. invalid_keyword:
  20237. PyErr_Format(PyExc_TypeError,
  20238. #if PY_MAJOR_VERSION < 3
  20239. "%.200s() got an unexpected keyword argument '%.200s'",
  20240. function_name, PyString_AsString(key));
  20241. #else
  20242. "%s() got an unexpected keyword argument '%U'",
  20243. function_name, key);
  20244. #endif
  20245. return 0;
  20246. }
  20247. /* RaiseDoubleKeywords */
  20248. static void __Pyx_RaiseDoubleKeywordsError(
  20249. const char* func_name,
  20250. PyObject* kw_name)
  20251. {
  20252. PyErr_Format(PyExc_TypeError,
  20253. #if PY_MAJOR_VERSION >= 3
  20254. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  20255. #else
  20256. "%s() got multiple values for keyword argument '%s'", func_name,
  20257. PyString_AsString(kw_name));
  20258. #endif
  20259. }
  20260. /* ParseKeywords */
  20261. static int __Pyx_ParseOptionalKeywords(
  20262. PyObject *kwds,
  20263. PyObject **argnames[],
  20264. PyObject *kwds2,
  20265. PyObject *values[],
  20266. Py_ssize_t num_pos_args,
  20267. const char* function_name)
  20268. {
  20269. PyObject *key = 0, *value = 0;
  20270. Py_ssize_t pos = 0;
  20271. PyObject*** name;
  20272. PyObject*** first_kw_arg = argnames + num_pos_args;
  20273. while (PyDict_Next(kwds, &pos, &key, &value)) {
  20274. name = first_kw_arg;
  20275. while (*name && (**name != key)) name++;
  20276. if (*name) {
  20277. values[name-argnames] = value;
  20278. continue;
  20279. }
  20280. name = first_kw_arg;
  20281. #if PY_MAJOR_VERSION < 3
  20282. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  20283. while (*name) {
  20284. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  20285. && _PyString_Eq(**name, key)) {
  20286. values[name-argnames] = value;
  20287. break;
  20288. }
  20289. name++;
  20290. }
  20291. if (*name) continue;
  20292. else {
  20293. PyObject*** argname = argnames;
  20294. while (argname != first_kw_arg) {
  20295. if ((**argname == key) || (
  20296. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  20297. && _PyString_Eq(**argname, key))) {
  20298. goto arg_passed_twice;
  20299. }
  20300. argname++;
  20301. }
  20302. }
  20303. } else
  20304. #endif
  20305. if (likely(PyUnicode_Check(key))) {
  20306. while (*name) {
  20307. int cmp = (**name == key) ? 0 :
  20308. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  20309. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  20310. #endif
  20311. PyUnicode_Compare(**name, key);
  20312. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  20313. if (cmp == 0) {
  20314. values[name-argnames] = value;
  20315. break;
  20316. }
  20317. name++;
  20318. }
  20319. if (*name) continue;
  20320. else {
  20321. PyObject*** argname = argnames;
  20322. while (argname != first_kw_arg) {
  20323. int cmp = (**argname == key) ? 0 :
  20324. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  20325. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  20326. #endif
  20327. PyUnicode_Compare(**argname, key);
  20328. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  20329. if (cmp == 0) goto arg_passed_twice;
  20330. argname++;
  20331. }
  20332. }
  20333. } else
  20334. goto invalid_keyword_type;
  20335. if (kwds2) {
  20336. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  20337. } else {
  20338. goto invalid_keyword;
  20339. }
  20340. }
  20341. return 0;
  20342. arg_passed_twice:
  20343. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  20344. goto bad;
  20345. invalid_keyword_type:
  20346. PyErr_Format(PyExc_TypeError,
  20347. "%.200s() keywords must be strings", function_name);
  20348. goto bad;
  20349. invalid_keyword:
  20350. PyErr_Format(PyExc_TypeError,
  20351. #if PY_MAJOR_VERSION < 3
  20352. "%.200s() got an unexpected keyword argument '%.200s'",
  20353. function_name, PyString_AsString(key));
  20354. #else
  20355. "%s() got an unexpected keyword argument '%U'",
  20356. function_name, key);
  20357. #endif
  20358. bad:
  20359. return -1;
  20360. }
  20361. /* PyCFunctionFastCall */
  20362. #if CYTHON_FAST_PYCCALL
  20363. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  20364. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  20365. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  20366. PyObject *self = PyCFunction_GET_SELF(func);
  20367. int flags = PyCFunction_GET_FLAGS(func);
  20368. assert(PyCFunction_Check(func));
  20369. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
  20370. assert(nargs >= 0);
  20371. assert(nargs == 0 || args != NULL);
  20372. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  20373. because it may clear it (directly or indirectly) and so the
  20374. caller loses its exception */
  20375. assert(!PyErr_Occurred());
  20376. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  20377. return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
  20378. } else {
  20379. return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
  20380. }
  20381. }
  20382. #endif
  20383. /* PyFunctionFastCall */
  20384. #if CYTHON_FAST_PYCALL
  20385. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  20386. PyObject *globals) {
  20387. PyFrameObject *f;
  20388. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  20389. PyObject **fastlocals;
  20390. Py_ssize_t i;
  20391. PyObject *result;
  20392. assert(globals != NULL);
  20393. /* XXX Perhaps we should create a specialized
  20394. PyFrame_New() that doesn't take locals, but does
  20395. take builtins without sanity checking them.
  20396. */
  20397. assert(tstate != NULL);
  20398. f = PyFrame_New(tstate, co, globals, NULL);
  20399. if (f == NULL) {
  20400. return NULL;
  20401. }
  20402. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  20403. for (i = 0; i < na; i++) {
  20404. Py_INCREF(*args);
  20405. fastlocals[i] = *args++;
  20406. }
  20407. result = PyEval_EvalFrameEx(f,0);
  20408. ++tstate->recursion_depth;
  20409. Py_DECREF(f);
  20410. --tstate->recursion_depth;
  20411. return result;
  20412. }
  20413. #if 1 || PY_VERSION_HEX < 0x030600B1
  20414. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  20415. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  20416. PyObject *globals = PyFunction_GET_GLOBALS(func);
  20417. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  20418. PyObject *closure;
  20419. #if PY_MAJOR_VERSION >= 3
  20420. PyObject *kwdefs;
  20421. #endif
  20422. PyObject *kwtuple, **k;
  20423. PyObject **d;
  20424. Py_ssize_t nd;
  20425. Py_ssize_t nk;
  20426. PyObject *result;
  20427. assert(kwargs == NULL || PyDict_Check(kwargs));
  20428. nk = kwargs ? PyDict_Size(kwargs) : 0;
  20429. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  20430. return NULL;
  20431. }
  20432. if (
  20433. #if PY_MAJOR_VERSION >= 3
  20434. co->co_kwonlyargcount == 0 &&
  20435. #endif
  20436. likely(kwargs == NULL || nk == 0) &&
  20437. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  20438. if (argdefs == NULL && co->co_argcount == nargs) {
  20439. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  20440. goto done;
  20441. }
  20442. else if (nargs == 0 && argdefs != NULL
  20443. && co->co_argcount == Py_SIZE(argdefs)) {
  20444. /* function called with no arguments, but all parameters have
  20445. a default value: use default values as arguments .*/
  20446. args = &PyTuple_GET_ITEM(argdefs, 0);
  20447. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  20448. goto done;
  20449. }
  20450. }
  20451. if (kwargs != NULL) {
  20452. Py_ssize_t pos, i;
  20453. kwtuple = PyTuple_New(2 * nk);
  20454. if (kwtuple == NULL) {
  20455. result = NULL;
  20456. goto done;
  20457. }
  20458. k = &PyTuple_GET_ITEM(kwtuple, 0);
  20459. pos = i = 0;
  20460. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  20461. Py_INCREF(k[i]);
  20462. Py_INCREF(k[i+1]);
  20463. i += 2;
  20464. }
  20465. nk = i / 2;
  20466. }
  20467. else {
  20468. kwtuple = NULL;
  20469. k = NULL;
  20470. }
  20471. closure = PyFunction_GET_CLOSURE(func);
  20472. #if PY_MAJOR_VERSION >= 3
  20473. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  20474. #endif
  20475. if (argdefs != NULL) {
  20476. d = &PyTuple_GET_ITEM(argdefs, 0);
  20477. nd = Py_SIZE(argdefs);
  20478. }
  20479. else {
  20480. d = NULL;
  20481. nd = 0;
  20482. }
  20483. #if PY_MAJOR_VERSION >= 3
  20484. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  20485. args, (int)nargs,
  20486. k, (int)nk,
  20487. d, (int)nd, kwdefs, closure);
  20488. #else
  20489. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  20490. args, (int)nargs,
  20491. k, (int)nk,
  20492. d, (int)nd, closure);
  20493. #endif
  20494. Py_XDECREF(kwtuple);
  20495. done:
  20496. Py_LeaveRecursiveCall();
  20497. return result;
  20498. }
  20499. #endif
  20500. #endif
  20501. /* PyObjectCall */
  20502. #if CYTHON_COMPILING_IN_CPYTHON
  20503. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  20504. PyObject *result;
  20505. ternaryfunc call = func->ob_type->tp_call;
  20506. if (unlikely(!call))
  20507. return PyObject_Call(func, arg, kw);
  20508. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  20509. return NULL;
  20510. result = (*call)(func, arg, kw);
  20511. Py_LeaveRecursiveCall();
  20512. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  20513. PyErr_SetString(
  20514. PyExc_SystemError,
  20515. "NULL result without error in PyObject_Call");
  20516. }
  20517. return result;
  20518. }
  20519. #endif
  20520. /* PyObjectCall2Args */
  20521. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  20522. PyObject *args, *result = NULL;
  20523. #if CYTHON_FAST_PYCALL
  20524. if (PyFunction_Check(function)) {
  20525. PyObject *args[2] = {arg1, arg2};
  20526. return __Pyx_PyFunction_FastCall(function, args, 2);
  20527. }
  20528. #endif
  20529. #if CYTHON_FAST_PYCCALL
  20530. if (__Pyx_PyFastCFunction_Check(function)) {
  20531. PyObject *args[2] = {arg1, arg2};
  20532. return __Pyx_PyCFunction_FastCall(function, args, 2);
  20533. }
  20534. #endif
  20535. args = PyTuple_New(2);
  20536. if (unlikely(!args)) goto done;
  20537. Py_INCREF(arg1);
  20538. PyTuple_SET_ITEM(args, 0, arg1);
  20539. Py_INCREF(arg2);
  20540. PyTuple_SET_ITEM(args, 1, arg2);
  20541. Py_INCREF(function);
  20542. result = __Pyx_PyObject_Call(function, args, NULL);
  20543. Py_DECREF(args);
  20544. Py_DECREF(function);
  20545. done:
  20546. return result;
  20547. }
  20548. /* PyObjectCallMethO */
  20549. #if CYTHON_COMPILING_IN_CPYTHON
  20550. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  20551. PyObject *self, *result;
  20552. PyCFunction cfunc;
  20553. cfunc = PyCFunction_GET_FUNCTION(func);
  20554. self = PyCFunction_GET_SELF(func);
  20555. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  20556. return NULL;
  20557. result = cfunc(self, arg);
  20558. Py_LeaveRecursiveCall();
  20559. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  20560. PyErr_SetString(
  20561. PyExc_SystemError,
  20562. "NULL result without error in PyObject_Call");
  20563. }
  20564. return result;
  20565. }
  20566. #endif
  20567. /* PyObjectCallOneArg */
  20568. #if CYTHON_COMPILING_IN_CPYTHON
  20569. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  20570. PyObject *result;
  20571. PyObject *args = PyTuple_New(1);
  20572. if (unlikely(!args)) return NULL;
  20573. Py_INCREF(arg);
  20574. PyTuple_SET_ITEM(args, 0, arg);
  20575. result = __Pyx_PyObject_Call(func, args, NULL);
  20576. Py_DECREF(args);
  20577. return result;
  20578. }
  20579. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  20580. #if CYTHON_FAST_PYCALL
  20581. if (PyFunction_Check(func)) {
  20582. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  20583. }
  20584. #endif
  20585. if (likely(PyCFunction_Check(func))) {
  20586. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  20587. return __Pyx_PyObject_CallMethO(func, arg);
  20588. #if CYTHON_FAST_PYCCALL
  20589. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  20590. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  20591. #endif
  20592. }
  20593. }
  20594. return __Pyx__PyObject_CallOneArg(func, arg);
  20595. }
  20596. #else
  20597. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  20598. PyObject *result;
  20599. PyObject *args = PyTuple_Pack(1, arg);
  20600. if (unlikely(!args)) return NULL;
  20601. result = __Pyx_PyObject_Call(func, args, NULL);
  20602. Py_DECREF(args);
  20603. return result;
  20604. }
  20605. #endif
  20606. /* PyDictVersioning */
  20607. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  20608. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  20609. PyObject *dict = Py_TYPE(obj)->tp_dict;
  20610. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  20611. }
  20612. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  20613. PyObject **dictptr = NULL;
  20614. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  20615. if (offset) {
  20616. #if CYTHON_COMPILING_IN_CPYTHON
  20617. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  20618. #else
  20619. dictptr = _PyObject_GetDictPtr(obj);
  20620. #endif
  20621. }
  20622. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  20623. }
  20624. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  20625. PyObject *dict = Py_TYPE(obj)->tp_dict;
  20626. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  20627. return 0;
  20628. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  20629. }
  20630. #endif
  20631. /* GetModuleGlobalName */
  20632. #if CYTHON_USE_DICT_VERSIONS
  20633. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  20634. #else
  20635. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  20636. #endif
  20637. {
  20638. PyObject *result;
  20639. #if !CYTHON_AVOID_BORROWED_REFS
  20640. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  20641. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  20642. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  20643. if (likely(result)) {
  20644. return __Pyx_NewRef(result);
  20645. } else if (unlikely(PyErr_Occurred())) {
  20646. return NULL;
  20647. }
  20648. #else
  20649. result = PyDict_GetItem(__pyx_d, name);
  20650. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  20651. if (likely(result)) {
  20652. return __Pyx_NewRef(result);
  20653. }
  20654. #endif
  20655. #else
  20656. result = PyObject_GetItem(__pyx_d, name);
  20657. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  20658. if (likely(result)) {
  20659. return __Pyx_NewRef(result);
  20660. }
  20661. PyErr_Clear();
  20662. #endif
  20663. return __Pyx_GetBuiltinName(name);
  20664. }
  20665. /* PyErrFetchRestore */
  20666. #if CYTHON_FAST_THREAD_STATE
  20667. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  20668. PyObject *tmp_type, *tmp_value, *tmp_tb;
  20669. tmp_type = tstate->curexc_type;
  20670. tmp_value = tstate->curexc_value;
  20671. tmp_tb = tstate->curexc_traceback;
  20672. tstate->curexc_type = type;
  20673. tstate->curexc_value = value;
  20674. tstate->curexc_traceback = tb;
  20675. Py_XDECREF(tmp_type);
  20676. Py_XDECREF(tmp_value);
  20677. Py_XDECREF(tmp_tb);
  20678. }
  20679. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  20680. *type = tstate->curexc_type;
  20681. *value = tstate->curexc_value;
  20682. *tb = tstate->curexc_traceback;
  20683. tstate->curexc_type = 0;
  20684. tstate->curexc_value = 0;
  20685. tstate->curexc_traceback = 0;
  20686. }
  20687. #endif
  20688. /* RaiseException */
  20689. #if PY_MAJOR_VERSION < 3
  20690. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  20691. CYTHON_UNUSED PyObject *cause) {
  20692. __Pyx_PyThreadState_declare
  20693. Py_XINCREF(type);
  20694. if (!value || value == Py_None)
  20695. value = NULL;
  20696. else
  20697. Py_INCREF(value);
  20698. if (!tb || tb == Py_None)
  20699. tb = NULL;
  20700. else {
  20701. Py_INCREF(tb);
  20702. if (!PyTraceBack_Check(tb)) {
  20703. PyErr_SetString(PyExc_TypeError,
  20704. "raise: arg 3 must be a traceback or None");
  20705. goto raise_error;
  20706. }
  20707. }
  20708. if (PyType_Check(type)) {
  20709. #if CYTHON_COMPILING_IN_PYPY
  20710. if (!value) {
  20711. Py_INCREF(Py_None);
  20712. value = Py_None;
  20713. }
  20714. #endif
  20715. PyErr_NormalizeException(&type, &value, &tb);
  20716. } else {
  20717. if (value) {
  20718. PyErr_SetString(PyExc_TypeError,
  20719. "instance exception may not have a separate value");
  20720. goto raise_error;
  20721. }
  20722. value = type;
  20723. type = (PyObject*) Py_TYPE(type);
  20724. Py_INCREF(type);
  20725. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  20726. PyErr_SetString(PyExc_TypeError,
  20727. "raise: exception class must be a subclass of BaseException");
  20728. goto raise_error;
  20729. }
  20730. }
  20731. __Pyx_PyThreadState_assign
  20732. __Pyx_ErrRestore(type, value, tb);
  20733. return;
  20734. raise_error:
  20735. Py_XDECREF(value);
  20736. Py_XDECREF(type);
  20737. Py_XDECREF(tb);
  20738. return;
  20739. }
  20740. #else
  20741. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  20742. PyObject* owned_instance = NULL;
  20743. if (tb == Py_None) {
  20744. tb = 0;
  20745. } else if (tb && !PyTraceBack_Check(tb)) {
  20746. PyErr_SetString(PyExc_TypeError,
  20747. "raise: arg 3 must be a traceback or None");
  20748. goto bad;
  20749. }
  20750. if (value == Py_None)
  20751. value = 0;
  20752. if (PyExceptionInstance_Check(type)) {
  20753. if (value) {
  20754. PyErr_SetString(PyExc_TypeError,
  20755. "instance exception may not have a separate value");
  20756. goto bad;
  20757. }
  20758. value = type;
  20759. type = (PyObject*) Py_TYPE(value);
  20760. } else if (PyExceptionClass_Check(type)) {
  20761. PyObject *instance_class = NULL;
  20762. if (value && PyExceptionInstance_Check(value)) {
  20763. instance_class = (PyObject*) Py_TYPE(value);
  20764. if (instance_class != type) {
  20765. int is_subclass = PyObject_IsSubclass(instance_class, type);
  20766. if (!is_subclass) {
  20767. instance_class = NULL;
  20768. } else if (unlikely(is_subclass == -1)) {
  20769. goto bad;
  20770. } else {
  20771. type = instance_class;
  20772. }
  20773. }
  20774. }
  20775. if (!instance_class) {
  20776. PyObject *args;
  20777. if (!value)
  20778. args = PyTuple_New(0);
  20779. else if (PyTuple_Check(value)) {
  20780. Py_INCREF(value);
  20781. args = value;
  20782. } else
  20783. args = PyTuple_Pack(1, value);
  20784. if (!args)
  20785. goto bad;
  20786. owned_instance = PyObject_Call(type, args, NULL);
  20787. Py_DECREF(args);
  20788. if (!owned_instance)
  20789. goto bad;
  20790. value = owned_instance;
  20791. if (!PyExceptionInstance_Check(value)) {
  20792. PyErr_Format(PyExc_TypeError,
  20793. "calling %R should have returned an instance of "
  20794. "BaseException, not %R",
  20795. type, Py_TYPE(value));
  20796. goto bad;
  20797. }
  20798. }
  20799. } else {
  20800. PyErr_SetString(PyExc_TypeError,
  20801. "raise: exception class must be a subclass of BaseException");
  20802. goto bad;
  20803. }
  20804. if (cause) {
  20805. PyObject *fixed_cause;
  20806. if (cause == Py_None) {
  20807. fixed_cause = NULL;
  20808. } else if (PyExceptionClass_Check(cause)) {
  20809. fixed_cause = PyObject_CallObject(cause, NULL);
  20810. if (fixed_cause == NULL)
  20811. goto bad;
  20812. } else if (PyExceptionInstance_Check(cause)) {
  20813. fixed_cause = cause;
  20814. Py_INCREF(fixed_cause);
  20815. } else {
  20816. PyErr_SetString(PyExc_TypeError,
  20817. "exception causes must derive from "
  20818. "BaseException");
  20819. goto bad;
  20820. }
  20821. PyException_SetCause(value, fixed_cause);
  20822. }
  20823. PyErr_SetObject(type, value);
  20824. if (tb) {
  20825. #if CYTHON_COMPILING_IN_PYPY
  20826. PyObject *tmp_type, *tmp_value, *tmp_tb;
  20827. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  20828. Py_INCREF(tb);
  20829. PyErr_Restore(tmp_type, tmp_value, tb);
  20830. Py_XDECREF(tmp_tb);
  20831. #else
  20832. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  20833. PyObject* tmp_tb = tstate->curexc_traceback;
  20834. if (tb != tmp_tb) {
  20835. Py_INCREF(tb);
  20836. tstate->curexc_traceback = tb;
  20837. Py_XDECREF(tmp_tb);
  20838. }
  20839. #endif
  20840. }
  20841. bad:
  20842. Py_XDECREF(owned_instance);
  20843. return;
  20844. }
  20845. #endif
  20846. /* GetItemInt */
  20847. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  20848. PyObject *r;
  20849. if (!j) return NULL;
  20850. r = PyObject_GetItem(o, j);
  20851. Py_DECREF(j);
  20852. return r;
  20853. }
  20854. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  20855. CYTHON_NCP_UNUSED int wraparound,
  20856. CYTHON_NCP_UNUSED int boundscheck) {
  20857. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  20858. Py_ssize_t wrapped_i = i;
  20859. if (wraparound & unlikely(i < 0)) {
  20860. wrapped_i += PyList_GET_SIZE(o);
  20861. }
  20862. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
  20863. PyObject *r = PyList_GET_ITEM(o, wrapped_i);
  20864. Py_INCREF(r);
  20865. return r;
  20866. }
  20867. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  20868. #else
  20869. return PySequence_GetItem(o, i);
  20870. #endif
  20871. }
  20872. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  20873. CYTHON_NCP_UNUSED int wraparound,
  20874. CYTHON_NCP_UNUSED int boundscheck) {
  20875. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  20876. Py_ssize_t wrapped_i = i;
  20877. if (wraparound & unlikely(i < 0)) {
  20878. wrapped_i += PyTuple_GET_SIZE(o);
  20879. }
  20880. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
  20881. PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
  20882. Py_INCREF(r);
  20883. return r;
  20884. }
  20885. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  20886. #else
  20887. return PySequence_GetItem(o, i);
  20888. #endif
  20889. }
  20890. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
  20891. CYTHON_NCP_UNUSED int wraparound,
  20892. CYTHON_NCP_UNUSED int boundscheck) {
  20893. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
  20894. if (is_list || PyList_CheckExact(o)) {
  20895. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  20896. if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
  20897. PyObject *r = PyList_GET_ITEM(o, n);
  20898. Py_INCREF(r);
  20899. return r;
  20900. }
  20901. }
  20902. else if (PyTuple_CheckExact(o)) {
  20903. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  20904. if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
  20905. PyObject *r = PyTuple_GET_ITEM(o, n);
  20906. Py_INCREF(r);
  20907. return r;
  20908. }
  20909. } else {
  20910. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  20911. if (likely(m && m->sq_item)) {
  20912. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  20913. Py_ssize_t l = m->sq_length(o);
  20914. if (likely(l >= 0)) {
  20915. i += l;
  20916. } else {
  20917. if (!PyErr_ExceptionMatches(PyExc_OverflowError))
  20918. return NULL;
  20919. PyErr_Clear();
  20920. }
  20921. }
  20922. return m->sq_item(o, i);
  20923. }
  20924. }
  20925. #else
  20926. if (is_list || PySequence_Check(o)) {
  20927. return PySequence_GetItem(o, i);
  20928. }
  20929. #endif
  20930. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  20931. }
  20932. /* ObjectGetItem */
  20933. #if CYTHON_USE_TYPE_SLOTS
  20934. static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
  20935. PyObject *runerr;
  20936. Py_ssize_t key_value;
  20937. PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
  20938. if (unlikely(!(m && m->sq_item))) {
  20939. PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
  20940. return NULL;
  20941. }
  20942. key_value = __Pyx_PyIndex_AsSsize_t(index);
  20943. if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
  20944. return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
  20945. }
  20946. if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
  20947. PyErr_Clear();
  20948. PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
  20949. }
  20950. return NULL;
  20951. }
  20952. static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
  20953. PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
  20954. if (likely(m && m->mp_subscript)) {
  20955. return m->mp_subscript(obj, key);
  20956. }
  20957. return __Pyx_PyObject_GetIndex(obj, key);
  20958. }
  20959. #endif
  20960. /* PyObjectCallNoArg */
  20961. #if CYTHON_COMPILING_IN_CPYTHON
  20962. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
  20963. #if CYTHON_FAST_PYCALL
  20964. if (PyFunction_Check(func)) {
  20965. return __Pyx_PyFunction_FastCall(func, NULL, 0);
  20966. }
  20967. #endif
  20968. #ifdef __Pyx_CyFunction_USED
  20969. if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
  20970. #else
  20971. if (likely(PyCFunction_Check(func)))
  20972. #endif
  20973. {
  20974. if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
  20975. return __Pyx_PyObject_CallMethO(func, NULL);
  20976. }
  20977. }
  20978. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
  20979. }
  20980. #endif
  20981. /* IterFinish */
  20982. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  20983. #if CYTHON_FAST_THREAD_STATE
  20984. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  20985. PyObject* exc_type = tstate->curexc_type;
  20986. if (unlikely(exc_type)) {
  20987. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
  20988. PyObject *exc_value, *exc_tb;
  20989. exc_value = tstate->curexc_value;
  20990. exc_tb = tstate->curexc_traceback;
  20991. tstate->curexc_type = 0;
  20992. tstate->curexc_value = 0;
  20993. tstate->curexc_traceback = 0;
  20994. Py_DECREF(exc_type);
  20995. Py_XDECREF(exc_value);
  20996. Py_XDECREF(exc_tb);
  20997. return 0;
  20998. } else {
  20999. return -1;
  21000. }
  21001. }
  21002. return 0;
  21003. #else
  21004. if (unlikely(PyErr_Occurred())) {
  21005. if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
  21006. PyErr_Clear();
  21007. return 0;
  21008. } else {
  21009. return -1;
  21010. }
  21011. }
  21012. return 0;
  21013. #endif
  21014. }
  21015. /* PyObjectGetMethod */
  21016. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
  21017. PyObject *attr;
  21018. #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
  21019. PyTypeObject *tp = Py_TYPE(obj);
  21020. PyObject *descr;
  21021. descrgetfunc f = NULL;
  21022. PyObject **dictptr, *dict;
  21023. int meth_found = 0;
  21024. assert (*method == NULL);
  21025. if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
  21026. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21027. goto try_unpack;
  21028. }
  21029. if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
  21030. return 0;
  21031. }
  21032. descr = _PyType_Lookup(tp, name);
  21033. if (likely(descr != NULL)) {
  21034. Py_INCREF(descr);
  21035. #if PY_MAJOR_VERSION >= 3
  21036. #ifdef __Pyx_CyFunction_USED
  21037. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
  21038. #else
  21039. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
  21040. #endif
  21041. #else
  21042. #ifdef __Pyx_CyFunction_USED
  21043. if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
  21044. #else
  21045. if (likely(PyFunction_Check(descr)))
  21046. #endif
  21047. #endif
  21048. {
  21049. meth_found = 1;
  21050. } else {
  21051. f = Py_TYPE(descr)->tp_descr_get;
  21052. if (f != NULL && PyDescr_IsData(descr)) {
  21053. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21054. Py_DECREF(descr);
  21055. goto try_unpack;
  21056. }
  21057. }
  21058. }
  21059. dictptr = _PyObject_GetDictPtr(obj);
  21060. if (dictptr != NULL && (dict = *dictptr) != NULL) {
  21061. Py_INCREF(dict);
  21062. attr = __Pyx_PyDict_GetItemStr(dict, name);
  21063. if (attr != NULL) {
  21064. Py_INCREF(attr);
  21065. Py_DECREF(dict);
  21066. Py_XDECREF(descr);
  21067. goto try_unpack;
  21068. }
  21069. Py_DECREF(dict);
  21070. }
  21071. if (meth_found) {
  21072. *method = descr;
  21073. return 1;
  21074. }
  21075. if (f != NULL) {
  21076. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21077. Py_DECREF(descr);
  21078. goto try_unpack;
  21079. }
  21080. if (descr != NULL) {
  21081. *method = descr;
  21082. return 0;
  21083. }
  21084. PyErr_Format(PyExc_AttributeError,
  21085. #if PY_MAJOR_VERSION >= 3
  21086. "'%.50s' object has no attribute '%U'",
  21087. tp->tp_name, name);
  21088. #else
  21089. "'%.50s' object has no attribute '%.400s'",
  21090. tp->tp_name, PyString_AS_STRING(name));
  21091. #endif
  21092. return 0;
  21093. #else
  21094. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21095. goto try_unpack;
  21096. #endif
  21097. try_unpack:
  21098. #if CYTHON_UNPACK_METHODS
  21099. if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
  21100. PyObject *function = PyMethod_GET_FUNCTION(attr);
  21101. Py_INCREF(function);
  21102. Py_DECREF(attr);
  21103. *method = function;
  21104. return 1;
  21105. }
  21106. #endif
  21107. *method = attr;
  21108. return 0;
  21109. }
  21110. /* PyObjectCallMethod0 */
  21111. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
  21112. PyObject *method = NULL, *result = NULL;
  21113. int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
  21114. if (likely(is_method)) {
  21115. result = __Pyx_PyObject_CallOneArg(method, obj);
  21116. Py_DECREF(method);
  21117. return result;
  21118. }
  21119. if (unlikely(!method)) goto bad;
  21120. result = __Pyx_PyObject_CallNoArg(method);
  21121. Py_DECREF(method);
  21122. bad:
  21123. return result;
  21124. }
  21125. /* RaiseNeedMoreValuesToUnpack */
  21126. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  21127. PyErr_Format(PyExc_ValueError,
  21128. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  21129. index, (index == 1) ? "" : "s");
  21130. }
  21131. /* RaiseTooManyValuesToUnpack */
  21132. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  21133. PyErr_Format(PyExc_ValueError,
  21134. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  21135. }
  21136. /* UnpackItemEndCheck */
  21137. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  21138. if (unlikely(retval)) {
  21139. Py_DECREF(retval);
  21140. __Pyx_RaiseTooManyValuesError(expected);
  21141. return -1;
  21142. } else {
  21143. return __Pyx_IterFinish();
  21144. }
  21145. return 0;
  21146. }
  21147. /* RaiseNoneIterError */
  21148. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  21149. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  21150. }
  21151. /* UnpackTupleError */
  21152. static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
  21153. if (t == Py_None) {
  21154. __Pyx_RaiseNoneNotIterableError();
  21155. } else if (PyTuple_GET_SIZE(t) < index) {
  21156. __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
  21157. } else {
  21158. __Pyx_RaiseTooManyValuesError(index);
  21159. }
  21160. }
  21161. /* UnpackTuple2 */
  21162. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  21163. PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
  21164. PyObject *value1 = NULL, *value2 = NULL;
  21165. #if CYTHON_COMPILING_IN_PYPY
  21166. value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
  21167. value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
  21168. #else
  21169. value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
  21170. value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
  21171. #endif
  21172. if (decref_tuple) {
  21173. Py_DECREF(tuple);
  21174. }
  21175. *pvalue1 = value1;
  21176. *pvalue2 = value2;
  21177. return 0;
  21178. #if CYTHON_COMPILING_IN_PYPY
  21179. bad:
  21180. Py_XDECREF(value1);
  21181. Py_XDECREF(value2);
  21182. if (decref_tuple) { Py_XDECREF(tuple); }
  21183. return -1;
  21184. #endif
  21185. }
  21186. static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
  21187. int has_known_size, int decref_tuple) {
  21188. Py_ssize_t index;
  21189. PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
  21190. iternextfunc iternext;
  21191. iter = PyObject_GetIter(tuple);
  21192. if (unlikely(!iter)) goto bad;
  21193. if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
  21194. iternext = Py_TYPE(iter)->tp_iternext;
  21195. value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
  21196. value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
  21197. if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
  21198. Py_DECREF(iter);
  21199. *pvalue1 = value1;
  21200. *pvalue2 = value2;
  21201. return 0;
  21202. unpacking_failed:
  21203. if (!has_known_size && __Pyx_IterFinish() == 0)
  21204. __Pyx_RaiseNeedMoreValuesError(index);
  21205. bad:
  21206. Py_XDECREF(iter);
  21207. Py_XDECREF(value1);
  21208. Py_XDECREF(value2);
  21209. if (decref_tuple) { Py_XDECREF(tuple); }
  21210. return -1;
  21211. }
  21212. /* dict_iter */
  21213. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
  21214. Py_ssize_t* p_orig_length, int* p_source_is_dict) {
  21215. is_dict = is_dict || likely(PyDict_CheckExact(iterable));
  21216. *p_source_is_dict = is_dict;
  21217. if (is_dict) {
  21218. #if !CYTHON_COMPILING_IN_PYPY
  21219. *p_orig_length = PyDict_Size(iterable);
  21220. Py_INCREF(iterable);
  21221. return iterable;
  21222. #elif PY_MAJOR_VERSION >= 3
  21223. static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
  21224. PyObject **pp = NULL;
  21225. if (method_name) {
  21226. const char *name = PyUnicode_AsUTF8(method_name);
  21227. if (strcmp(name, "iteritems") == 0) pp = &py_items;
  21228. else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
  21229. else if (strcmp(name, "itervalues") == 0) pp = &py_values;
  21230. if (pp) {
  21231. if (!*pp) {
  21232. *pp = PyUnicode_FromString(name + 4);
  21233. if (!*pp)
  21234. return NULL;
  21235. }
  21236. method_name = *pp;
  21237. }
  21238. }
  21239. #endif
  21240. }
  21241. *p_orig_length = 0;
  21242. if (method_name) {
  21243. PyObject* iter;
  21244. iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
  21245. if (!iterable)
  21246. return NULL;
  21247. #if !CYTHON_COMPILING_IN_PYPY
  21248. if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
  21249. return iterable;
  21250. #endif
  21251. iter = PyObject_GetIter(iterable);
  21252. Py_DECREF(iterable);
  21253. return iter;
  21254. }
  21255. return PyObject_GetIter(iterable);
  21256. }
  21257. static CYTHON_INLINE int __Pyx_dict_iter_next(
  21258. PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
  21259. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
  21260. PyObject* next_item;
  21261. #if !CYTHON_COMPILING_IN_PYPY
  21262. if (source_is_dict) {
  21263. PyObject *key, *value;
  21264. if (unlikely(orig_length != PyDict_Size(iter_obj))) {
  21265. PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
  21266. return -1;
  21267. }
  21268. if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
  21269. return 0;
  21270. }
  21271. if (pitem) {
  21272. PyObject* tuple = PyTuple_New(2);
  21273. if (unlikely(!tuple)) {
  21274. return -1;
  21275. }
  21276. Py_INCREF(key);
  21277. Py_INCREF(value);
  21278. PyTuple_SET_ITEM(tuple, 0, key);
  21279. PyTuple_SET_ITEM(tuple, 1, value);
  21280. *pitem = tuple;
  21281. } else {
  21282. if (pkey) {
  21283. Py_INCREF(key);
  21284. *pkey = key;
  21285. }
  21286. if (pvalue) {
  21287. Py_INCREF(value);
  21288. *pvalue = value;
  21289. }
  21290. }
  21291. return 1;
  21292. } else if (PyTuple_CheckExact(iter_obj)) {
  21293. Py_ssize_t pos = *ppos;
  21294. if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
  21295. *ppos = pos + 1;
  21296. next_item = PyTuple_GET_ITEM(iter_obj, pos);
  21297. Py_INCREF(next_item);
  21298. } else if (PyList_CheckExact(iter_obj)) {
  21299. Py_ssize_t pos = *ppos;
  21300. if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
  21301. *ppos = pos + 1;
  21302. next_item = PyList_GET_ITEM(iter_obj, pos);
  21303. Py_INCREF(next_item);
  21304. } else
  21305. #endif
  21306. {
  21307. next_item = PyIter_Next(iter_obj);
  21308. if (unlikely(!next_item)) {
  21309. return __Pyx_IterFinish();
  21310. }
  21311. }
  21312. if (pitem) {
  21313. *pitem = next_item;
  21314. } else if (pkey && pvalue) {
  21315. if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
  21316. return -1;
  21317. } else if (pkey) {
  21318. *pkey = next_item;
  21319. } else {
  21320. *pvalue = next_item;
  21321. }
  21322. return 1;
  21323. }
  21324. /* PyObjectSetAttrStr */
  21325. #if CYTHON_USE_TYPE_SLOTS
  21326. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  21327. PyTypeObject* tp = Py_TYPE(obj);
  21328. if (likely(tp->tp_setattro))
  21329. return tp->tp_setattro(obj, attr_name, value);
  21330. #if PY_MAJOR_VERSION < 3
  21331. if (likely(tp->tp_setattr))
  21332. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  21333. #endif
  21334. return PyObject_SetAttr(obj, attr_name, value);
  21335. }
  21336. #endif
  21337. /* DictGetItem */
  21338. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  21339. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
  21340. PyObject *value;
  21341. value = PyDict_GetItemWithError(d, key);
  21342. if (unlikely(!value)) {
  21343. if (!PyErr_Occurred()) {
  21344. if (unlikely(PyTuple_Check(key))) {
  21345. PyObject* args = PyTuple_Pack(1, key);
  21346. if (likely(args)) {
  21347. PyErr_SetObject(PyExc_KeyError, args);
  21348. Py_DECREF(args);
  21349. }
  21350. } else {
  21351. PyErr_SetObject(PyExc_KeyError, key);
  21352. }
  21353. }
  21354. return NULL;
  21355. }
  21356. Py_INCREF(value);
  21357. return value;
  21358. }
  21359. #endif
  21360. /* ExtTypeTest */
  21361. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  21362. if (unlikely(!type)) {
  21363. PyErr_SetString(PyExc_SystemError, "Missing type object");
  21364. return 0;
  21365. }
  21366. if (likely(__Pyx_TypeCheck(obj, type)))
  21367. return 1;
  21368. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  21369. Py_TYPE(obj)->tp_name, type->tp_name);
  21370. return 0;
  21371. }
  21372. /* GetTopmostException */
  21373. #if CYTHON_USE_EXC_INFO_STACK
  21374. static _PyErr_StackItem *
  21375. __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
  21376. {
  21377. _PyErr_StackItem *exc_info = tstate->exc_info;
  21378. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  21379. exc_info->previous_item != NULL)
  21380. {
  21381. exc_info = exc_info->previous_item;
  21382. }
  21383. return exc_info;
  21384. }
  21385. #endif
  21386. /* SaveResetException */
  21387. #if CYTHON_FAST_THREAD_STATE
  21388. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  21389. #if CYTHON_USE_EXC_INFO_STACK
  21390. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  21391. *type = exc_info->exc_type;
  21392. *value = exc_info->exc_value;
  21393. *tb = exc_info->exc_traceback;
  21394. #else
  21395. *type = tstate->exc_type;
  21396. *value = tstate->exc_value;
  21397. *tb = tstate->exc_traceback;
  21398. #endif
  21399. Py_XINCREF(*type);
  21400. Py_XINCREF(*value);
  21401. Py_XINCREF(*tb);
  21402. }
  21403. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  21404. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21405. #if CYTHON_USE_EXC_INFO_STACK
  21406. _PyErr_StackItem *exc_info = tstate->exc_info;
  21407. tmp_type = exc_info->exc_type;
  21408. tmp_value = exc_info->exc_value;
  21409. tmp_tb = exc_info->exc_traceback;
  21410. exc_info->exc_type = type;
  21411. exc_info->exc_value = value;
  21412. exc_info->exc_traceback = tb;
  21413. #else
  21414. tmp_type = tstate->exc_type;
  21415. tmp_value = tstate->exc_value;
  21416. tmp_tb = tstate->exc_traceback;
  21417. tstate->exc_type = type;
  21418. tstate->exc_value = value;
  21419. tstate->exc_traceback = tb;
  21420. #endif
  21421. Py_XDECREF(tmp_type);
  21422. Py_XDECREF(tmp_value);
  21423. Py_XDECREF(tmp_tb);
  21424. }
  21425. #endif
  21426. /* PyErrExceptionMatches */
  21427. #if CYTHON_FAST_THREAD_STATE
  21428. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  21429. Py_ssize_t i, n;
  21430. n = PyTuple_GET_SIZE(tuple);
  21431. #if PY_MAJOR_VERSION >= 3
  21432. for (i=0; i<n; i++) {
  21433. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  21434. }
  21435. #endif
  21436. for (i=0; i<n; i++) {
  21437. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  21438. }
  21439. return 0;
  21440. }
  21441. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  21442. PyObject *exc_type = tstate->curexc_type;
  21443. if (exc_type == err) return 1;
  21444. if (unlikely(!exc_type)) return 0;
  21445. if (unlikely(PyTuple_Check(err)))
  21446. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  21447. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  21448. }
  21449. #endif
  21450. /* GetException */
  21451. #if CYTHON_FAST_THREAD_STATE
  21452. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
  21453. #else
  21454. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
  21455. #endif
  21456. {
  21457. PyObject *local_type, *local_value, *local_tb;
  21458. #if CYTHON_FAST_THREAD_STATE
  21459. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21460. local_type = tstate->curexc_type;
  21461. local_value = tstate->curexc_value;
  21462. local_tb = tstate->curexc_traceback;
  21463. tstate->curexc_type = 0;
  21464. tstate->curexc_value = 0;
  21465. tstate->curexc_traceback = 0;
  21466. #else
  21467. PyErr_Fetch(&local_type, &local_value, &local_tb);
  21468. #endif
  21469. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  21470. #if CYTHON_FAST_THREAD_STATE
  21471. if (unlikely(tstate->curexc_type))
  21472. #else
  21473. if (unlikely(PyErr_Occurred()))
  21474. #endif
  21475. goto bad;
  21476. #if PY_MAJOR_VERSION >= 3
  21477. if (local_tb) {
  21478. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  21479. goto bad;
  21480. }
  21481. #endif
  21482. Py_XINCREF(local_tb);
  21483. Py_XINCREF(local_type);
  21484. Py_XINCREF(local_value);
  21485. *type = local_type;
  21486. *value = local_value;
  21487. *tb = local_tb;
  21488. #if CYTHON_FAST_THREAD_STATE
  21489. #if CYTHON_USE_EXC_INFO_STACK
  21490. {
  21491. _PyErr_StackItem *exc_info = tstate->exc_info;
  21492. tmp_type = exc_info->exc_type;
  21493. tmp_value = exc_info->exc_value;
  21494. tmp_tb = exc_info->exc_traceback;
  21495. exc_info->exc_type = local_type;
  21496. exc_info->exc_value = local_value;
  21497. exc_info->exc_traceback = local_tb;
  21498. }
  21499. #else
  21500. tmp_type = tstate->exc_type;
  21501. tmp_value = tstate->exc_value;
  21502. tmp_tb = tstate->exc_traceback;
  21503. tstate->exc_type = local_type;
  21504. tstate->exc_value = local_value;
  21505. tstate->exc_traceback = local_tb;
  21506. #endif
  21507. Py_XDECREF(tmp_type);
  21508. Py_XDECREF(tmp_value);
  21509. Py_XDECREF(tmp_tb);
  21510. #else
  21511. PyErr_SetExcInfo(local_type, local_value, local_tb);
  21512. #endif
  21513. return 0;
  21514. bad:
  21515. *type = 0;
  21516. *value = 0;
  21517. *tb = 0;
  21518. Py_XDECREF(local_type);
  21519. Py_XDECREF(local_value);
  21520. Py_XDECREF(local_tb);
  21521. return -1;
  21522. }
  21523. /* PyObject_GenericGetAttrNoDict */
  21524. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  21525. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  21526. PyErr_Format(PyExc_AttributeError,
  21527. #if PY_MAJOR_VERSION >= 3
  21528. "'%.50s' object has no attribute '%U'",
  21529. tp->tp_name, attr_name);
  21530. #else
  21531. "'%.50s' object has no attribute '%.400s'",
  21532. tp->tp_name, PyString_AS_STRING(attr_name));
  21533. #endif
  21534. return NULL;
  21535. }
  21536. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  21537. PyObject *descr;
  21538. PyTypeObject *tp = Py_TYPE(obj);
  21539. if (unlikely(!PyString_Check(attr_name))) {
  21540. return PyObject_GenericGetAttr(obj, attr_name);
  21541. }
  21542. assert(!tp->tp_dictoffset);
  21543. descr = _PyType_Lookup(tp, attr_name);
  21544. if (unlikely(!descr)) {
  21545. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  21546. }
  21547. Py_INCREF(descr);
  21548. #if PY_MAJOR_VERSION < 3
  21549. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  21550. #endif
  21551. {
  21552. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  21553. if (unlikely(f)) {
  21554. PyObject *res = f(descr, obj, (PyObject *)tp);
  21555. Py_DECREF(descr);
  21556. return res;
  21557. }
  21558. }
  21559. return descr;
  21560. }
  21561. #endif
  21562. /* PyObject_GenericGetAttr */
  21563. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  21564. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  21565. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  21566. return PyObject_GenericGetAttr(obj, attr_name);
  21567. }
  21568. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  21569. }
  21570. #endif
  21571. /* SetupReduce */
  21572. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  21573. int ret;
  21574. PyObject *name_attr;
  21575. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  21576. if (likely(name_attr)) {
  21577. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  21578. } else {
  21579. ret = -1;
  21580. }
  21581. if (unlikely(ret < 0)) {
  21582. PyErr_Clear();
  21583. ret = 0;
  21584. }
  21585. Py_XDECREF(name_attr);
  21586. return ret;
  21587. }
  21588. static int __Pyx_setup_reduce(PyObject* type_obj) {
  21589. int ret = 0;
  21590. PyObject *object_reduce = NULL;
  21591. PyObject *object_reduce_ex = NULL;
  21592. PyObject *reduce = NULL;
  21593. PyObject *reduce_ex = NULL;
  21594. PyObject *reduce_cython = NULL;
  21595. PyObject *setstate = NULL;
  21596. PyObject *setstate_cython = NULL;
  21597. #if CYTHON_USE_PYTYPE_LOOKUP
  21598. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  21599. #else
  21600. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  21601. #endif
  21602. #if CYTHON_USE_PYTYPE_LOOKUP
  21603. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  21604. #else
  21605. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  21606. #endif
  21607. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
  21608. if (reduce_ex == object_reduce_ex) {
  21609. #if CYTHON_USE_PYTYPE_LOOKUP
  21610. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  21611. #else
  21612. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  21613. #endif
  21614. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
  21615. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  21616. reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
  21617. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  21618. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  21619. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  21620. if (!setstate) PyErr_Clear();
  21621. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  21622. setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
  21623. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  21624. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  21625. }
  21626. PyType_Modified((PyTypeObject*)type_obj);
  21627. }
  21628. }
  21629. goto __PYX_GOOD;
  21630. __PYX_BAD:
  21631. if (!PyErr_Occurred())
  21632. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  21633. ret = -1;
  21634. __PYX_GOOD:
  21635. #if !CYTHON_USE_PYTYPE_LOOKUP
  21636. Py_XDECREF(object_reduce);
  21637. Py_XDECREF(object_reduce_ex);
  21638. #endif
  21639. Py_XDECREF(reduce);
  21640. Py_XDECREF(reduce_ex);
  21641. Py_XDECREF(reduce_cython);
  21642. Py_XDECREF(setstate);
  21643. Py_XDECREF(setstate_cython);
  21644. return ret;
  21645. }
  21646. /* TypeImport */
  21647. #ifndef __PYX_HAVE_RT_ImportType
  21648. #define __PYX_HAVE_RT_ImportType
  21649. static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
  21650. size_t size, enum __Pyx_ImportType_CheckSize check_size)
  21651. {
  21652. PyObject *result = 0;
  21653. char warning[200];
  21654. Py_ssize_t basicsize;
  21655. #ifdef Py_LIMITED_API
  21656. PyObject *py_basicsize;
  21657. #endif
  21658. result = PyObject_GetAttrString(module, class_name);
  21659. if (!result)
  21660. goto bad;
  21661. if (!PyType_Check(result)) {
  21662. PyErr_Format(PyExc_TypeError,
  21663. "%.200s.%.200s is not a type object",
  21664. module_name, class_name);
  21665. goto bad;
  21666. }
  21667. #ifndef Py_LIMITED_API
  21668. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  21669. #else
  21670. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  21671. if (!py_basicsize)
  21672. goto bad;
  21673. basicsize = PyLong_AsSsize_t(py_basicsize);
  21674. Py_DECREF(py_basicsize);
  21675. py_basicsize = 0;
  21676. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  21677. goto bad;
  21678. #endif
  21679. if ((size_t)basicsize < size) {
  21680. PyErr_Format(PyExc_ValueError,
  21681. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  21682. "Expected %zd from C header, got %zd from PyObject",
  21683. module_name, class_name, size, basicsize);
  21684. goto bad;
  21685. }
  21686. if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
  21687. PyErr_Format(PyExc_ValueError,
  21688. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  21689. "Expected %zd from C header, got %zd from PyObject",
  21690. module_name, class_name, size, basicsize);
  21691. goto bad;
  21692. }
  21693. else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
  21694. PyOS_snprintf(warning, sizeof(warning),
  21695. "%s.%s size changed, may indicate binary incompatibility. "
  21696. "Expected %zd from C header, got %zd from PyObject",
  21697. module_name, class_name, size, basicsize);
  21698. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  21699. }
  21700. return (PyTypeObject *)result;
  21701. bad:
  21702. Py_XDECREF(result);
  21703. return NULL;
  21704. }
  21705. #endif
  21706. /* Import */
  21707. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  21708. PyObject *empty_list = 0;
  21709. PyObject *module = 0;
  21710. PyObject *global_dict = 0;
  21711. PyObject *empty_dict = 0;
  21712. PyObject *list;
  21713. #if PY_MAJOR_VERSION < 3
  21714. PyObject *py_import;
  21715. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  21716. if (!py_import)
  21717. goto bad;
  21718. #endif
  21719. if (from_list)
  21720. list = from_list;
  21721. else {
  21722. empty_list = PyList_New(0);
  21723. if (!empty_list)
  21724. goto bad;
  21725. list = empty_list;
  21726. }
  21727. global_dict = PyModule_GetDict(__pyx_m);
  21728. if (!global_dict)
  21729. goto bad;
  21730. empty_dict = PyDict_New();
  21731. if (!empty_dict)
  21732. goto bad;
  21733. {
  21734. #if PY_MAJOR_VERSION >= 3
  21735. if (level == -1) {
  21736. if (strchr(__Pyx_MODULE_NAME, '.')) {
  21737. module = PyImport_ImportModuleLevelObject(
  21738. name, global_dict, empty_dict, list, 1);
  21739. if (!module) {
  21740. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  21741. goto bad;
  21742. PyErr_Clear();
  21743. }
  21744. }
  21745. level = 0;
  21746. }
  21747. #endif
  21748. if (!module) {
  21749. #if PY_MAJOR_VERSION < 3
  21750. PyObject *py_level = PyInt_FromLong(level);
  21751. if (!py_level)
  21752. goto bad;
  21753. module = PyObject_CallFunctionObjArgs(py_import,
  21754. name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
  21755. Py_DECREF(py_level);
  21756. #else
  21757. module = PyImport_ImportModuleLevelObject(
  21758. name, global_dict, empty_dict, list, level);
  21759. #endif
  21760. }
  21761. }
  21762. bad:
  21763. #if PY_MAJOR_VERSION < 3
  21764. Py_XDECREF(py_import);
  21765. #endif
  21766. Py_XDECREF(empty_list);
  21767. Py_XDECREF(empty_dict);
  21768. return module;
  21769. }
  21770. /* CalculateMetaclass */
  21771. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  21772. Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
  21773. for (i=0; i < nbases; i++) {
  21774. PyTypeObject *tmptype;
  21775. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  21776. tmptype = Py_TYPE(tmp);
  21777. #if PY_MAJOR_VERSION < 3
  21778. if (tmptype == &PyClass_Type)
  21779. continue;
  21780. #endif
  21781. if (!metaclass) {
  21782. metaclass = tmptype;
  21783. continue;
  21784. }
  21785. if (PyType_IsSubtype(metaclass, tmptype))
  21786. continue;
  21787. if (PyType_IsSubtype(tmptype, metaclass)) {
  21788. metaclass = tmptype;
  21789. continue;
  21790. }
  21791. PyErr_SetString(PyExc_TypeError,
  21792. "metaclass conflict: "
  21793. "the metaclass of a derived class "
  21794. "must be a (non-strict) subclass "
  21795. "of the metaclasses of all its bases");
  21796. return NULL;
  21797. }
  21798. if (!metaclass) {
  21799. #if PY_MAJOR_VERSION < 3
  21800. metaclass = &PyClass_Type;
  21801. #else
  21802. metaclass = &PyType_Type;
  21803. #endif
  21804. }
  21805. Py_INCREF((PyObject*) metaclass);
  21806. return (PyObject*) metaclass;
  21807. }
  21808. /* Py3ClassCreate */
  21809. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  21810. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  21811. PyObject *ns;
  21812. if (metaclass) {
  21813. PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
  21814. if (prep) {
  21815. PyObject *pargs = PyTuple_Pack(2, name, bases);
  21816. if (unlikely(!pargs)) {
  21817. Py_DECREF(prep);
  21818. return NULL;
  21819. }
  21820. ns = PyObject_Call(prep, pargs, mkw);
  21821. Py_DECREF(prep);
  21822. Py_DECREF(pargs);
  21823. } else {
  21824. if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
  21825. return NULL;
  21826. PyErr_Clear();
  21827. ns = PyDict_New();
  21828. }
  21829. } else {
  21830. ns = PyDict_New();
  21831. }
  21832. if (unlikely(!ns))
  21833. return NULL;
  21834. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  21835. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  21836. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  21837. return ns;
  21838. bad:
  21839. Py_DECREF(ns);
  21840. return NULL;
  21841. }
  21842. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  21843. PyObject *dict, PyObject *mkw,
  21844. int calculate_metaclass, int allow_py2_metaclass) {
  21845. PyObject *result, *margs;
  21846. PyObject *owned_metaclass = NULL;
  21847. if (allow_py2_metaclass) {
  21848. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  21849. if (owned_metaclass) {
  21850. metaclass = owned_metaclass;
  21851. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  21852. PyErr_Clear();
  21853. } else {
  21854. return NULL;
  21855. }
  21856. }
  21857. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  21858. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  21859. Py_XDECREF(owned_metaclass);
  21860. if (unlikely(!metaclass))
  21861. return NULL;
  21862. owned_metaclass = metaclass;
  21863. }
  21864. margs = PyTuple_Pack(3, name, bases, dict);
  21865. if (unlikely(!margs)) {
  21866. result = NULL;
  21867. } else {
  21868. result = PyObject_Call(metaclass, margs, mkw);
  21869. Py_DECREF(margs);
  21870. }
  21871. Py_XDECREF(owned_metaclass);
  21872. return result;
  21873. }
  21874. /* FetchCommonType */
  21875. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  21876. PyObject* fake_module;
  21877. PyTypeObject* cached_type = NULL;
  21878. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  21879. if (!fake_module) return NULL;
  21880. Py_INCREF(fake_module);
  21881. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  21882. if (cached_type) {
  21883. if (!PyType_Check((PyObject*)cached_type)) {
  21884. PyErr_Format(PyExc_TypeError,
  21885. "Shared Cython type %.200s is not a type object",
  21886. type->tp_name);
  21887. goto bad;
  21888. }
  21889. if (cached_type->tp_basicsize != type->tp_basicsize) {
  21890. PyErr_Format(PyExc_TypeError,
  21891. "Shared Cython type %.200s has the wrong size, try recompiling",
  21892. type->tp_name);
  21893. goto bad;
  21894. }
  21895. } else {
  21896. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  21897. PyErr_Clear();
  21898. if (PyType_Ready(type) < 0) goto bad;
  21899. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  21900. goto bad;
  21901. Py_INCREF(type);
  21902. cached_type = type;
  21903. }
  21904. done:
  21905. Py_DECREF(fake_module);
  21906. return cached_type;
  21907. bad:
  21908. Py_XDECREF(cached_type);
  21909. cached_type = NULL;
  21910. goto done;
  21911. }
  21912. /* CythonFunction */
  21913. #include <structmember.h>
  21914. static PyObject *
  21915. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  21916. {
  21917. if (unlikely(op->func_doc == NULL)) {
  21918. if (op->func.m_ml->ml_doc) {
  21919. #if PY_MAJOR_VERSION >= 3
  21920. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  21921. #else
  21922. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  21923. #endif
  21924. if (unlikely(op->func_doc == NULL))
  21925. return NULL;
  21926. } else {
  21927. Py_INCREF(Py_None);
  21928. return Py_None;
  21929. }
  21930. }
  21931. Py_INCREF(op->func_doc);
  21932. return op->func_doc;
  21933. }
  21934. static int
  21935. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  21936. {
  21937. PyObject *tmp = op->func_doc;
  21938. if (value == NULL) {
  21939. value = Py_None;
  21940. }
  21941. Py_INCREF(value);
  21942. op->func_doc = value;
  21943. Py_XDECREF(tmp);
  21944. return 0;
  21945. }
  21946. static PyObject *
  21947. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  21948. {
  21949. if (unlikely(op->func_name == NULL)) {
  21950. #if PY_MAJOR_VERSION >= 3
  21951. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  21952. #else
  21953. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  21954. #endif
  21955. if (unlikely(op->func_name == NULL))
  21956. return NULL;
  21957. }
  21958. Py_INCREF(op->func_name);
  21959. return op->func_name;
  21960. }
  21961. static int
  21962. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  21963. {
  21964. PyObject *tmp;
  21965. #if PY_MAJOR_VERSION >= 3
  21966. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  21967. #else
  21968. if (unlikely(value == NULL || !PyString_Check(value)))
  21969. #endif
  21970. {
  21971. PyErr_SetString(PyExc_TypeError,
  21972. "__name__ must be set to a string object");
  21973. return -1;
  21974. }
  21975. tmp = op->func_name;
  21976. Py_INCREF(value);
  21977. op->func_name = value;
  21978. Py_XDECREF(tmp);
  21979. return 0;
  21980. }
  21981. static PyObject *
  21982. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  21983. {
  21984. Py_INCREF(op->func_qualname);
  21985. return op->func_qualname;
  21986. }
  21987. static int
  21988. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  21989. {
  21990. PyObject *tmp;
  21991. #if PY_MAJOR_VERSION >= 3
  21992. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  21993. #else
  21994. if (unlikely(value == NULL || !PyString_Check(value)))
  21995. #endif
  21996. {
  21997. PyErr_SetString(PyExc_TypeError,
  21998. "__qualname__ must be set to a string object");
  21999. return -1;
  22000. }
  22001. tmp = op->func_qualname;
  22002. Py_INCREF(value);
  22003. op->func_qualname = value;
  22004. Py_XDECREF(tmp);
  22005. return 0;
  22006. }
  22007. static PyObject *
  22008. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  22009. {
  22010. PyObject *self;
  22011. self = m->func_closure;
  22012. if (self == NULL)
  22013. self = Py_None;
  22014. Py_INCREF(self);
  22015. return self;
  22016. }
  22017. static PyObject *
  22018. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22019. {
  22020. if (unlikely(op->func_dict == NULL)) {
  22021. op->func_dict = PyDict_New();
  22022. if (unlikely(op->func_dict == NULL))
  22023. return NULL;
  22024. }
  22025. Py_INCREF(op->func_dict);
  22026. return op->func_dict;
  22027. }
  22028. static int
  22029. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  22030. {
  22031. PyObject *tmp;
  22032. if (unlikely(value == NULL)) {
  22033. PyErr_SetString(PyExc_TypeError,
  22034. "function's dictionary may not be deleted");
  22035. return -1;
  22036. }
  22037. if (unlikely(!PyDict_Check(value))) {
  22038. PyErr_SetString(PyExc_TypeError,
  22039. "setting function's dictionary to a non-dict");
  22040. return -1;
  22041. }
  22042. tmp = op->func_dict;
  22043. Py_INCREF(value);
  22044. op->func_dict = value;
  22045. Py_XDECREF(tmp);
  22046. return 0;
  22047. }
  22048. static PyObject *
  22049. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22050. {
  22051. Py_INCREF(op->func_globals);
  22052. return op->func_globals;
  22053. }
  22054. static PyObject *
  22055. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22056. {
  22057. Py_INCREF(Py_None);
  22058. return Py_None;
  22059. }
  22060. static PyObject *
  22061. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  22062. {
  22063. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  22064. Py_INCREF(result);
  22065. return result;
  22066. }
  22067. static int
  22068. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  22069. int result = 0;
  22070. PyObject *res = op->defaults_getter((PyObject *) op);
  22071. if (unlikely(!res))
  22072. return -1;
  22073. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  22074. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  22075. Py_INCREF(op->defaults_tuple);
  22076. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  22077. Py_INCREF(op->defaults_kwdict);
  22078. #else
  22079. op->defaults_tuple = PySequence_ITEM(res, 0);
  22080. if (unlikely(!op->defaults_tuple)) result = -1;
  22081. else {
  22082. op->defaults_kwdict = PySequence_ITEM(res, 1);
  22083. if (unlikely(!op->defaults_kwdict)) result = -1;
  22084. }
  22085. #endif
  22086. Py_DECREF(res);
  22087. return result;
  22088. }
  22089. static int
  22090. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22091. PyObject* tmp;
  22092. if (!value) {
  22093. value = Py_None;
  22094. } else if (value != Py_None && !PyTuple_Check(value)) {
  22095. PyErr_SetString(PyExc_TypeError,
  22096. "__defaults__ must be set to a tuple object");
  22097. return -1;
  22098. }
  22099. Py_INCREF(value);
  22100. tmp = op->defaults_tuple;
  22101. op->defaults_tuple = value;
  22102. Py_XDECREF(tmp);
  22103. return 0;
  22104. }
  22105. static PyObject *
  22106. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22107. PyObject* result = op->defaults_tuple;
  22108. if (unlikely(!result)) {
  22109. if (op->defaults_getter) {
  22110. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  22111. result = op->defaults_tuple;
  22112. } else {
  22113. result = Py_None;
  22114. }
  22115. }
  22116. Py_INCREF(result);
  22117. return result;
  22118. }
  22119. static int
  22120. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22121. PyObject* tmp;
  22122. if (!value) {
  22123. value = Py_None;
  22124. } else if (value != Py_None && !PyDict_Check(value)) {
  22125. PyErr_SetString(PyExc_TypeError,
  22126. "__kwdefaults__ must be set to a dict object");
  22127. return -1;
  22128. }
  22129. Py_INCREF(value);
  22130. tmp = op->defaults_kwdict;
  22131. op->defaults_kwdict = value;
  22132. Py_XDECREF(tmp);
  22133. return 0;
  22134. }
  22135. static PyObject *
  22136. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22137. PyObject* result = op->defaults_kwdict;
  22138. if (unlikely(!result)) {
  22139. if (op->defaults_getter) {
  22140. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  22141. result = op->defaults_kwdict;
  22142. } else {
  22143. result = Py_None;
  22144. }
  22145. }
  22146. Py_INCREF(result);
  22147. return result;
  22148. }
  22149. static int
  22150. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  22151. PyObject* tmp;
  22152. if (!value || value == Py_None) {
  22153. value = NULL;
  22154. } else if (!PyDict_Check(value)) {
  22155. PyErr_SetString(PyExc_TypeError,
  22156. "__annotations__ must be set to a dict object");
  22157. return -1;
  22158. }
  22159. Py_XINCREF(value);
  22160. tmp = op->func_annotations;
  22161. op->func_annotations = value;
  22162. Py_XDECREF(tmp);
  22163. return 0;
  22164. }
  22165. static PyObject *
  22166. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  22167. PyObject* result = op->func_annotations;
  22168. if (unlikely(!result)) {
  22169. result = PyDict_New();
  22170. if (unlikely(!result)) return NULL;
  22171. op->func_annotations = result;
  22172. }
  22173. Py_INCREF(result);
  22174. return result;
  22175. }
  22176. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  22177. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  22178. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  22179. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  22180. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  22181. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  22182. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  22183. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  22184. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  22185. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  22186. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  22187. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  22188. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  22189. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  22190. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  22191. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  22192. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  22193. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  22194. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  22195. {0, 0, 0, 0, 0}
  22196. };
  22197. static PyMemberDef __pyx_CyFunction_members[] = {
  22198. {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
  22199. {0, 0, 0, 0, 0}
  22200. };
  22201. static PyObject *
  22202. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  22203. {
  22204. #if PY_MAJOR_VERSION >= 3
  22205. return PyUnicode_FromString(m->func.m_ml->ml_name);
  22206. #else
  22207. return PyString_FromString(m->func.m_ml->ml_name);
  22208. #endif
  22209. }
  22210. static PyMethodDef __pyx_CyFunction_methods[] = {
  22211. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  22212. {0, 0, 0, 0}
  22213. };
  22214. #if PY_VERSION_HEX < 0x030500A0
  22215. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  22216. #else
  22217. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
  22218. #endif
  22219. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  22220. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  22221. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  22222. if (op == NULL)
  22223. return NULL;
  22224. op->flags = flags;
  22225. __Pyx_CyFunction_weakreflist(op) = NULL;
  22226. op->func.m_ml = ml;
  22227. op->func.m_self = (PyObject *) op;
  22228. Py_XINCREF(closure);
  22229. op->func_closure = closure;
  22230. Py_XINCREF(module);
  22231. op->func.m_module = module;
  22232. op->func_dict = NULL;
  22233. op->func_name = NULL;
  22234. Py_INCREF(qualname);
  22235. op->func_qualname = qualname;
  22236. op->func_doc = NULL;
  22237. op->func_classobj = NULL;
  22238. op->func_globals = globals;
  22239. Py_INCREF(op->func_globals);
  22240. Py_XINCREF(code);
  22241. op->func_code = code;
  22242. op->defaults_pyobjects = 0;
  22243. op->defaults = NULL;
  22244. op->defaults_tuple = NULL;
  22245. op->defaults_kwdict = NULL;
  22246. op->defaults_getter = NULL;
  22247. op->func_annotations = NULL;
  22248. PyObject_GC_Track(op);
  22249. return (PyObject *) op;
  22250. }
  22251. static int
  22252. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  22253. {
  22254. Py_CLEAR(m->func_closure);
  22255. Py_CLEAR(m->func.m_module);
  22256. Py_CLEAR(m->func_dict);
  22257. Py_CLEAR(m->func_name);
  22258. Py_CLEAR(m->func_qualname);
  22259. Py_CLEAR(m->func_doc);
  22260. Py_CLEAR(m->func_globals);
  22261. Py_CLEAR(m->func_code);
  22262. Py_CLEAR(m->func_classobj);
  22263. Py_CLEAR(m->defaults_tuple);
  22264. Py_CLEAR(m->defaults_kwdict);
  22265. Py_CLEAR(m->func_annotations);
  22266. if (m->defaults) {
  22267. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  22268. int i;
  22269. for (i = 0; i < m->defaults_pyobjects; i++)
  22270. Py_XDECREF(pydefaults[i]);
  22271. PyObject_Free(m->defaults);
  22272. m->defaults = NULL;
  22273. }
  22274. return 0;
  22275. }
  22276. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  22277. {
  22278. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  22279. PyObject_ClearWeakRefs((PyObject *) m);
  22280. __Pyx_CyFunction_clear(m);
  22281. PyObject_GC_Del(m);
  22282. }
  22283. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  22284. {
  22285. PyObject_GC_UnTrack(m);
  22286. __Pyx__CyFunction_dealloc(m);
  22287. }
  22288. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  22289. {
  22290. Py_VISIT(m->func_closure);
  22291. Py_VISIT(m->func.m_module);
  22292. Py_VISIT(m->func_dict);
  22293. Py_VISIT(m->func_name);
  22294. Py_VISIT(m->func_qualname);
  22295. Py_VISIT(m->func_doc);
  22296. Py_VISIT(m->func_globals);
  22297. Py_VISIT(m->func_code);
  22298. Py_VISIT(m->func_classobj);
  22299. Py_VISIT(m->defaults_tuple);
  22300. Py_VISIT(m->defaults_kwdict);
  22301. if (m->defaults) {
  22302. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  22303. int i;
  22304. for (i = 0; i < m->defaults_pyobjects; i++)
  22305. Py_VISIT(pydefaults[i]);
  22306. }
  22307. return 0;
  22308. }
  22309. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  22310. {
  22311. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22312. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  22313. Py_INCREF(func);
  22314. return func;
  22315. }
  22316. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  22317. if (type == NULL)
  22318. type = (PyObject *)(Py_TYPE(obj));
  22319. return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
  22320. }
  22321. if (obj == Py_None)
  22322. obj = NULL;
  22323. return __Pyx_PyMethod_New(func, obj, type);
  22324. }
  22325. static PyObject*
  22326. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  22327. {
  22328. #if PY_MAJOR_VERSION >= 3
  22329. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  22330. op->func_qualname, (void *)op);
  22331. #else
  22332. return PyString_FromFormat("<cyfunction %s at %p>",
  22333. PyString_AsString(op->func_qualname), (void *)op);
  22334. #endif
  22335. }
  22336. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  22337. PyCFunctionObject* f = (PyCFunctionObject*)func;
  22338. PyCFunction meth = f->m_ml->ml_meth;
  22339. Py_ssize_t size;
  22340. switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  22341. case METH_VARARGS:
  22342. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  22343. return (*meth)(self, arg);
  22344. break;
  22345. case METH_VARARGS | METH_KEYWORDS:
  22346. return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
  22347. case METH_NOARGS:
  22348. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  22349. size = PyTuple_GET_SIZE(arg);
  22350. if (likely(size == 0))
  22351. return (*meth)(self, NULL);
  22352. PyErr_Format(PyExc_TypeError,
  22353. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  22354. f->m_ml->ml_name, size);
  22355. return NULL;
  22356. }
  22357. break;
  22358. case METH_O:
  22359. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  22360. size = PyTuple_GET_SIZE(arg);
  22361. if (likely(size == 1)) {
  22362. PyObject *result, *arg0;
  22363. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  22364. arg0 = PyTuple_GET_ITEM(arg, 0);
  22365. #else
  22366. arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  22367. #endif
  22368. result = (*meth)(self, arg0);
  22369. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  22370. Py_DECREF(arg0);
  22371. #endif
  22372. return result;
  22373. }
  22374. PyErr_Format(PyExc_TypeError,
  22375. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  22376. f->m_ml->ml_name, size);
  22377. return NULL;
  22378. }
  22379. break;
  22380. default:
  22381. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  22382. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  22383. "longer supported!");
  22384. return NULL;
  22385. }
  22386. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  22387. f->m_ml->ml_name);
  22388. return NULL;
  22389. }
  22390. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  22391. return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
  22392. }
  22393. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  22394. PyObject *result;
  22395. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  22396. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  22397. Py_ssize_t argc;
  22398. PyObject *new_args;
  22399. PyObject *self;
  22400. argc = PyTuple_GET_SIZE(args);
  22401. new_args = PyTuple_GetSlice(args, 1, argc);
  22402. if (unlikely(!new_args))
  22403. return NULL;
  22404. self = PyTuple_GetItem(args, 0);
  22405. if (unlikely(!self)) {
  22406. Py_DECREF(new_args);
  22407. return NULL;
  22408. }
  22409. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  22410. Py_DECREF(new_args);
  22411. } else {
  22412. result = __Pyx_CyFunction_Call(func, args, kw);
  22413. }
  22414. return result;
  22415. }
  22416. static PyTypeObject __pyx_CyFunctionType_type = {
  22417. PyVarObject_HEAD_INIT(0, 0)
  22418. "cython_function_or_method",
  22419. sizeof(__pyx_CyFunctionObject),
  22420. 0,
  22421. (destructor) __Pyx_CyFunction_dealloc,
  22422. 0,
  22423. 0,
  22424. 0,
  22425. #if PY_MAJOR_VERSION < 3
  22426. 0,
  22427. #else
  22428. 0,
  22429. #endif
  22430. (reprfunc) __Pyx_CyFunction_repr,
  22431. 0,
  22432. 0,
  22433. 0,
  22434. 0,
  22435. __Pyx_CyFunction_CallAsMethod,
  22436. 0,
  22437. 0,
  22438. 0,
  22439. 0,
  22440. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
  22441. 0,
  22442. (traverseproc) __Pyx_CyFunction_traverse,
  22443. (inquiry) __Pyx_CyFunction_clear,
  22444. 0,
  22445. #if PY_VERSION_HEX < 0x030500A0
  22446. offsetof(__pyx_CyFunctionObject, func_weakreflist),
  22447. #else
  22448. offsetof(PyCFunctionObject, m_weakreflist),
  22449. #endif
  22450. 0,
  22451. 0,
  22452. __pyx_CyFunction_methods,
  22453. __pyx_CyFunction_members,
  22454. __pyx_CyFunction_getsets,
  22455. 0,
  22456. 0,
  22457. __Pyx_CyFunction_descr_get,
  22458. 0,
  22459. offsetof(__pyx_CyFunctionObject, func_dict),
  22460. 0,
  22461. 0,
  22462. 0,
  22463. 0,
  22464. 0,
  22465. 0,
  22466. 0,
  22467. 0,
  22468. 0,
  22469. 0,
  22470. 0,
  22471. 0,
  22472. #if PY_VERSION_HEX >= 0x030400a1
  22473. 0,
  22474. #endif
  22475. #if PY_VERSION_HEX >= 0x030800b1
  22476. 0,
  22477. #endif
  22478. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  22479. 0,
  22480. #endif
  22481. };
  22482. static int __pyx_CyFunction_init(void) {
  22483. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  22484. if (unlikely(__pyx_CyFunctionType == NULL)) {
  22485. return -1;
  22486. }
  22487. return 0;
  22488. }
  22489. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  22490. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22491. m->defaults = PyObject_Malloc(size);
  22492. if (unlikely(!m->defaults))
  22493. return PyErr_NoMemory();
  22494. memset(m->defaults, 0, size);
  22495. m->defaults_pyobjects = pyobjects;
  22496. return m->defaults;
  22497. }
  22498. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  22499. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22500. m->defaults_tuple = tuple;
  22501. Py_INCREF(tuple);
  22502. }
  22503. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  22504. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22505. m->defaults_kwdict = dict;
  22506. Py_INCREF(dict);
  22507. }
  22508. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  22509. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  22510. m->func_annotations = dict;
  22511. Py_INCREF(dict);
  22512. }
  22513. /* CLineInTraceback */
  22514. #ifndef CYTHON_CLINE_IN_TRACEBACK
  22515. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
  22516. PyObject *use_cline;
  22517. PyObject *ptype, *pvalue, *ptraceback;
  22518. #if CYTHON_COMPILING_IN_CPYTHON
  22519. PyObject **cython_runtime_dict;
  22520. #endif
  22521. if (unlikely(!__pyx_cython_runtime)) {
  22522. return c_line;
  22523. }
  22524. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  22525. #if CYTHON_COMPILING_IN_CPYTHON
  22526. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  22527. if (likely(cython_runtime_dict)) {
  22528. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  22529. use_cline, *cython_runtime_dict,
  22530. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  22531. } else
  22532. #endif
  22533. {
  22534. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  22535. if (use_cline_obj) {
  22536. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  22537. Py_DECREF(use_cline_obj);
  22538. } else {
  22539. PyErr_Clear();
  22540. use_cline = NULL;
  22541. }
  22542. }
  22543. if (!use_cline) {
  22544. c_line = 0;
  22545. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  22546. }
  22547. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  22548. c_line = 0;
  22549. }
  22550. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  22551. return c_line;
  22552. }
  22553. #endif
  22554. /* CodeObjectCache */
  22555. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  22556. int start = 0, mid = 0, end = count - 1;
  22557. if (end >= 0 && code_line > entries[end].code_line) {
  22558. return count;
  22559. }
  22560. while (start < end) {
  22561. mid = start + (end - start) / 2;
  22562. if (code_line < entries[mid].code_line) {
  22563. end = mid;
  22564. } else if (code_line > entries[mid].code_line) {
  22565. start = mid + 1;
  22566. } else {
  22567. return mid;
  22568. }
  22569. }
  22570. if (code_line <= entries[mid].code_line) {
  22571. return mid;
  22572. } else {
  22573. return mid + 1;
  22574. }
  22575. }
  22576. static PyCodeObject *__pyx_find_code_object(int code_line) {
  22577. PyCodeObject* code_object;
  22578. int pos;
  22579. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  22580. return NULL;
  22581. }
  22582. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  22583. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  22584. return NULL;
  22585. }
  22586. code_object = __pyx_code_cache.entries[pos].code_object;
  22587. Py_INCREF(code_object);
  22588. return code_object;
  22589. }
  22590. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  22591. int pos, i;
  22592. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  22593. if (unlikely(!code_line)) {
  22594. return;
  22595. }
  22596. if (unlikely(!entries)) {
  22597. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  22598. if (likely(entries)) {
  22599. __pyx_code_cache.entries = entries;
  22600. __pyx_code_cache.max_count = 64;
  22601. __pyx_code_cache.count = 1;
  22602. entries[0].code_line = code_line;
  22603. entries[0].code_object = code_object;
  22604. Py_INCREF(code_object);
  22605. }
  22606. return;
  22607. }
  22608. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  22609. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  22610. PyCodeObject* tmp = entries[pos].code_object;
  22611. entries[pos].code_object = code_object;
  22612. Py_DECREF(tmp);
  22613. return;
  22614. }
  22615. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  22616. int new_max = __pyx_code_cache.max_count + 64;
  22617. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  22618. __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
  22619. if (unlikely(!entries)) {
  22620. return;
  22621. }
  22622. __pyx_code_cache.entries = entries;
  22623. __pyx_code_cache.max_count = new_max;
  22624. }
  22625. for (i=__pyx_code_cache.count; i>pos; i--) {
  22626. entries[i] = entries[i-1];
  22627. }
  22628. entries[pos].code_line = code_line;
  22629. entries[pos].code_object = code_object;
  22630. __pyx_code_cache.count++;
  22631. Py_INCREF(code_object);
  22632. }
  22633. /* AddTraceback */
  22634. #include "compile.h"
  22635. #include "frameobject.h"
  22636. #include "traceback.h"
  22637. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  22638. const char *funcname, int c_line,
  22639. int py_line, const char *filename) {
  22640. PyCodeObject *py_code = 0;
  22641. PyObject *py_srcfile = 0;
  22642. PyObject *py_funcname = 0;
  22643. #if PY_MAJOR_VERSION < 3
  22644. py_srcfile = PyString_FromString(filename);
  22645. #else
  22646. py_srcfile = PyUnicode_FromString(filename);
  22647. #endif
  22648. if (!py_srcfile) goto bad;
  22649. if (c_line) {
  22650. #if PY_MAJOR_VERSION < 3
  22651. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  22652. #else
  22653. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  22654. #endif
  22655. }
  22656. else {
  22657. #if PY_MAJOR_VERSION < 3
  22658. py_funcname = PyString_FromString(funcname);
  22659. #else
  22660. py_funcname = PyUnicode_FromString(funcname);
  22661. #endif
  22662. }
  22663. if (!py_funcname) goto bad;
  22664. py_code = __Pyx_PyCode_New(
  22665. 0,
  22666. 0,
  22667. 0,
  22668. 0,
  22669. 0,
  22670. __pyx_empty_bytes, /*PyObject *code,*/
  22671. __pyx_empty_tuple, /*PyObject *consts,*/
  22672. __pyx_empty_tuple, /*PyObject *names,*/
  22673. __pyx_empty_tuple, /*PyObject *varnames,*/
  22674. __pyx_empty_tuple, /*PyObject *freevars,*/
  22675. __pyx_empty_tuple, /*PyObject *cellvars,*/
  22676. py_srcfile, /*PyObject *filename,*/
  22677. py_funcname, /*PyObject *name,*/
  22678. py_line,
  22679. __pyx_empty_bytes /*PyObject *lnotab*/
  22680. );
  22681. Py_DECREF(py_srcfile);
  22682. Py_DECREF(py_funcname);
  22683. return py_code;
  22684. bad:
  22685. Py_XDECREF(py_srcfile);
  22686. Py_XDECREF(py_funcname);
  22687. return NULL;
  22688. }
  22689. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  22690. int py_line, const char *filename) {
  22691. PyCodeObject *py_code = 0;
  22692. PyFrameObject *py_frame = 0;
  22693. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  22694. if (c_line) {
  22695. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  22696. }
  22697. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  22698. if (!py_code) {
  22699. py_code = __Pyx_CreateCodeObjectForTraceback(
  22700. funcname, c_line, py_line, filename);
  22701. if (!py_code) goto bad;
  22702. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  22703. }
  22704. py_frame = PyFrame_New(
  22705. tstate, /*PyThreadState *tstate,*/
  22706. py_code, /*PyCodeObject *code,*/
  22707. __pyx_d, /*PyObject *globals,*/
  22708. 0 /*PyObject *locals*/
  22709. );
  22710. if (!py_frame) goto bad;
  22711. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  22712. PyTraceBack_Here(py_frame);
  22713. bad:
  22714. Py_XDECREF(py_code);
  22715. Py_XDECREF(py_frame);
  22716. }
  22717. /* CIntFromPyVerify */
  22718. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  22719. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  22720. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  22721. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  22722. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  22723. {\
  22724. func_type value = func_value;\
  22725. if (sizeof(target_type) < sizeof(func_type)) {\
  22726. if (unlikely(value != (func_type) (target_type) value)) {\
  22727. func_type zero = 0;\
  22728. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  22729. return (target_type) -1;\
  22730. if (is_unsigned && unlikely(value < zero))\
  22731. goto raise_neg_overflow;\
  22732. else\
  22733. goto raise_overflow;\
  22734. }\
  22735. }\
  22736. return (target_type) value;\
  22737. }
  22738. /* CIntToPy */
  22739. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
  22740. const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
  22741. const int is_unsigned = neg_one > const_zero;
  22742. if (is_unsigned) {
  22743. if (sizeof(npy_uint64) < sizeof(long)) {
  22744. return PyInt_FromLong((long) value);
  22745. } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
  22746. return PyLong_FromUnsignedLong((unsigned long) value);
  22747. #ifdef HAVE_LONG_LONG
  22748. } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
  22749. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  22750. #endif
  22751. }
  22752. } else {
  22753. if (sizeof(npy_uint64) <= sizeof(long)) {
  22754. return PyInt_FromLong((long) value);
  22755. #ifdef HAVE_LONG_LONG
  22756. } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
  22757. return PyLong_FromLongLong((PY_LONG_LONG) value);
  22758. #endif
  22759. }
  22760. }
  22761. {
  22762. int one = 1; int little = (int)*(unsigned char *)&one;
  22763. unsigned char *bytes = (unsigned char *)&value;
  22764. return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
  22765. little, !is_unsigned);
  22766. }
  22767. }
  22768. /* CIntToPy */
  22769. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  22770. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  22771. const int is_unsigned = neg_one > const_zero;
  22772. if (is_unsigned) {
  22773. if (sizeof(int) < sizeof(long)) {
  22774. return PyInt_FromLong((long) value);
  22775. } else if (sizeof(int) <= sizeof(unsigned long)) {
  22776. return PyLong_FromUnsignedLong((unsigned long) value);
  22777. #ifdef HAVE_LONG_LONG
  22778. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  22779. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  22780. #endif
  22781. }
  22782. } else {
  22783. if (sizeof(int) <= sizeof(long)) {
  22784. return PyInt_FromLong((long) value);
  22785. #ifdef HAVE_LONG_LONG
  22786. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  22787. return PyLong_FromLongLong((PY_LONG_LONG) value);
  22788. #endif
  22789. }
  22790. }
  22791. {
  22792. int one = 1; int little = (int)*(unsigned char *)&one;
  22793. unsigned char *bytes = (unsigned char *)&value;
  22794. return _PyLong_FromByteArray(bytes, sizeof(int),
  22795. little, !is_unsigned);
  22796. }
  22797. }
  22798. /* CIntToPy */
  22799. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  22800. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  22801. const int is_unsigned = neg_one > const_zero;
  22802. if (is_unsigned) {
  22803. if (sizeof(long) < sizeof(long)) {
  22804. return PyInt_FromLong((long) value);
  22805. } else if (sizeof(long) <= sizeof(unsigned long)) {
  22806. return PyLong_FromUnsignedLong((unsigned long) value);
  22807. #ifdef HAVE_LONG_LONG
  22808. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  22809. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  22810. #endif
  22811. }
  22812. } else {
  22813. if (sizeof(long) <= sizeof(long)) {
  22814. return PyInt_FromLong((long) value);
  22815. #ifdef HAVE_LONG_LONG
  22816. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  22817. return PyLong_FromLongLong((PY_LONG_LONG) value);
  22818. #endif
  22819. }
  22820. }
  22821. {
  22822. int one = 1; int little = (int)*(unsigned char *)&one;
  22823. unsigned char *bytes = (unsigned char *)&value;
  22824. return _PyLong_FromByteArray(bytes, sizeof(long),
  22825. little, !is_unsigned);
  22826. }
  22827. }
  22828. /* Declarations */
  22829. #if CYTHON_CCOMPLEX
  22830. #ifdef __cplusplus
  22831. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  22832. return ::std::complex< float >(x, y);
  22833. }
  22834. #else
  22835. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  22836. return x + y*(__pyx_t_float_complex)_Complex_I;
  22837. }
  22838. #endif
  22839. #else
  22840. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  22841. __pyx_t_float_complex z;
  22842. z.real = x;
  22843. z.imag = y;
  22844. return z;
  22845. }
  22846. #endif
  22847. /* Arithmetic */
  22848. #if CYTHON_CCOMPLEX
  22849. #else
  22850. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22851. return (a.real == b.real) && (a.imag == b.imag);
  22852. }
  22853. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22854. __pyx_t_float_complex z;
  22855. z.real = a.real + b.real;
  22856. z.imag = a.imag + b.imag;
  22857. return z;
  22858. }
  22859. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22860. __pyx_t_float_complex z;
  22861. z.real = a.real - b.real;
  22862. z.imag = a.imag - b.imag;
  22863. return z;
  22864. }
  22865. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22866. __pyx_t_float_complex z;
  22867. z.real = a.real * b.real - a.imag * b.imag;
  22868. z.imag = a.real * b.imag + a.imag * b.real;
  22869. return z;
  22870. }
  22871. #if 1
  22872. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22873. if (b.imag == 0) {
  22874. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  22875. } else if (fabsf(b.real) >= fabsf(b.imag)) {
  22876. if (b.real == 0 && b.imag == 0) {
  22877. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
  22878. } else {
  22879. float r = b.imag / b.real;
  22880. float s = (float)(1.0) / (b.real + b.imag * r);
  22881. return __pyx_t_float_complex_from_parts(
  22882. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  22883. }
  22884. } else {
  22885. float r = b.real / b.imag;
  22886. float s = (float)(1.0) / (b.imag + b.real * r);
  22887. return __pyx_t_float_complex_from_parts(
  22888. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  22889. }
  22890. }
  22891. #else
  22892. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22893. if (b.imag == 0) {
  22894. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  22895. } else {
  22896. float denom = b.real * b.real + b.imag * b.imag;
  22897. return __pyx_t_float_complex_from_parts(
  22898. (a.real * b.real + a.imag * b.imag) / denom,
  22899. (a.imag * b.real - a.real * b.imag) / denom);
  22900. }
  22901. }
  22902. #endif
  22903. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
  22904. __pyx_t_float_complex z;
  22905. z.real = -a.real;
  22906. z.imag = -a.imag;
  22907. return z;
  22908. }
  22909. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
  22910. return (a.real == 0) && (a.imag == 0);
  22911. }
  22912. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
  22913. __pyx_t_float_complex z;
  22914. z.real = a.real;
  22915. z.imag = -a.imag;
  22916. return z;
  22917. }
  22918. #if 1
  22919. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
  22920. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  22921. return sqrtf(z.real*z.real + z.imag*z.imag);
  22922. #else
  22923. return hypotf(z.real, z.imag);
  22924. #endif
  22925. }
  22926. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  22927. __pyx_t_float_complex z;
  22928. float r, lnr, theta, z_r, z_theta;
  22929. if (b.imag == 0 && b.real == (int)b.real) {
  22930. if (b.real < 0) {
  22931. float denom = a.real * a.real + a.imag * a.imag;
  22932. a.real = a.real / denom;
  22933. a.imag = -a.imag / denom;
  22934. b.real = -b.real;
  22935. }
  22936. switch ((int)b.real) {
  22937. case 0:
  22938. z.real = 1;
  22939. z.imag = 0;
  22940. return z;
  22941. case 1:
  22942. return a;
  22943. case 2:
  22944. return __Pyx_c_prod_float(a, a);
  22945. case 3:
  22946. z = __Pyx_c_prod_float(a, a);
  22947. return __Pyx_c_prod_float(z, a);
  22948. case 4:
  22949. z = __Pyx_c_prod_float(a, a);
  22950. return __Pyx_c_prod_float(z, z);
  22951. }
  22952. }
  22953. if (a.imag == 0) {
  22954. if (a.real == 0) {
  22955. return a;
  22956. } else if (b.imag == 0) {
  22957. z.real = powf(a.real, b.real);
  22958. z.imag = 0;
  22959. return z;
  22960. } else if (a.real > 0) {
  22961. r = a.real;
  22962. theta = 0;
  22963. } else {
  22964. r = -a.real;
  22965. theta = atan2f(0.0, -1.0);
  22966. }
  22967. } else {
  22968. r = __Pyx_c_abs_float(a);
  22969. theta = atan2f(a.imag, a.real);
  22970. }
  22971. lnr = logf(r);
  22972. z_r = expf(lnr * b.real - theta * b.imag);
  22973. z_theta = theta * b.real + lnr * b.imag;
  22974. z.real = z_r * cosf(z_theta);
  22975. z.imag = z_r * sinf(z_theta);
  22976. return z;
  22977. }
  22978. #endif
  22979. #endif
  22980. /* Declarations */
  22981. #if CYTHON_CCOMPLEX
  22982. #ifdef __cplusplus
  22983. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  22984. return ::std::complex< double >(x, y);
  22985. }
  22986. #else
  22987. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  22988. return x + y*(__pyx_t_double_complex)_Complex_I;
  22989. }
  22990. #endif
  22991. #else
  22992. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  22993. __pyx_t_double_complex z;
  22994. z.real = x;
  22995. z.imag = y;
  22996. return z;
  22997. }
  22998. #endif
  22999. /* Arithmetic */
  23000. #if CYTHON_CCOMPLEX
  23001. #else
  23002. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23003. return (a.real == b.real) && (a.imag == b.imag);
  23004. }
  23005. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23006. __pyx_t_double_complex z;
  23007. z.real = a.real + b.real;
  23008. z.imag = a.imag + b.imag;
  23009. return z;
  23010. }
  23011. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23012. __pyx_t_double_complex z;
  23013. z.real = a.real - b.real;
  23014. z.imag = a.imag - b.imag;
  23015. return z;
  23016. }
  23017. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23018. __pyx_t_double_complex z;
  23019. z.real = a.real * b.real - a.imag * b.imag;
  23020. z.imag = a.real * b.imag + a.imag * b.real;
  23021. return z;
  23022. }
  23023. #if 1
  23024. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23025. if (b.imag == 0) {
  23026. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  23027. } else if (fabs(b.real) >= fabs(b.imag)) {
  23028. if (b.real == 0 && b.imag == 0) {
  23029. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
  23030. } else {
  23031. double r = b.imag / b.real;
  23032. double s = (double)(1.0) / (b.real + b.imag * r);
  23033. return __pyx_t_double_complex_from_parts(
  23034. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  23035. }
  23036. } else {
  23037. double r = b.real / b.imag;
  23038. double s = (double)(1.0) / (b.imag + b.real * r);
  23039. return __pyx_t_double_complex_from_parts(
  23040. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  23041. }
  23042. }
  23043. #else
  23044. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23045. if (b.imag == 0) {
  23046. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  23047. } else {
  23048. double denom = b.real * b.real + b.imag * b.imag;
  23049. return __pyx_t_double_complex_from_parts(
  23050. (a.real * b.real + a.imag * b.imag) / denom,
  23051. (a.imag * b.real - a.real * b.imag) / denom);
  23052. }
  23053. }
  23054. #endif
  23055. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
  23056. __pyx_t_double_complex z;
  23057. z.real = -a.real;
  23058. z.imag = -a.imag;
  23059. return z;
  23060. }
  23061. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
  23062. return (a.real == 0) && (a.imag == 0);
  23063. }
  23064. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
  23065. __pyx_t_double_complex z;
  23066. z.real = a.real;
  23067. z.imag = -a.imag;
  23068. return z;
  23069. }
  23070. #if 1
  23071. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
  23072. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  23073. return sqrt(z.real*z.real + z.imag*z.imag);
  23074. #else
  23075. return hypot(z.real, z.imag);
  23076. #endif
  23077. }
  23078. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  23079. __pyx_t_double_complex z;
  23080. double r, lnr, theta, z_r, z_theta;
  23081. if (b.imag == 0 && b.real == (int)b.real) {
  23082. if (b.real < 0) {
  23083. double denom = a.real * a.real + a.imag * a.imag;
  23084. a.real = a.real / denom;
  23085. a.imag = -a.imag / denom;
  23086. b.real = -b.real;
  23087. }
  23088. switch ((int)b.real) {
  23089. case 0:
  23090. z.real = 1;
  23091. z.imag = 0;
  23092. return z;
  23093. case 1:
  23094. return a;
  23095. case 2:
  23096. return __Pyx_c_prod_double(a, a);
  23097. case 3:
  23098. z = __Pyx_c_prod_double(a, a);
  23099. return __Pyx_c_prod_double(z, a);
  23100. case 4:
  23101. z = __Pyx_c_prod_double(a, a);
  23102. return __Pyx_c_prod_double(z, z);
  23103. }
  23104. }
  23105. if (a.imag == 0) {
  23106. if (a.real == 0) {
  23107. return a;
  23108. } else if (b.imag == 0) {
  23109. z.real = pow(a.real, b.real);
  23110. z.imag = 0;
  23111. return z;
  23112. } else if (a.real > 0) {
  23113. r = a.real;
  23114. theta = 0;
  23115. } else {
  23116. r = -a.real;
  23117. theta = atan2(0.0, -1.0);
  23118. }
  23119. } else {
  23120. r = __Pyx_c_abs_double(a);
  23121. theta = atan2(a.imag, a.real);
  23122. }
  23123. lnr = log(r);
  23124. z_r = exp(lnr * b.real - theta * b.imag);
  23125. z_theta = theta * b.real + lnr * b.imag;
  23126. z.real = z_r * cos(z_theta);
  23127. z.imag = z_r * sin(z_theta);
  23128. return z;
  23129. }
  23130. #endif
  23131. #endif
  23132. /* CIntToPy */
  23133. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
  23134. const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
  23135. const int is_unsigned = neg_one > const_zero;
  23136. if (is_unsigned) {
  23137. if (sizeof(enum NPY_TYPES) < sizeof(long)) {
  23138. return PyInt_FromLong((long) value);
  23139. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
  23140. return PyLong_FromUnsignedLong((unsigned long) value);
  23141. #ifdef HAVE_LONG_LONG
  23142. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
  23143. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23144. #endif
  23145. }
  23146. } else {
  23147. if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
  23148. return PyInt_FromLong((long) value);
  23149. #ifdef HAVE_LONG_LONG
  23150. } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
  23151. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23152. #endif
  23153. }
  23154. }
  23155. {
  23156. int one = 1; int little = (int)*(unsigned char *)&one;
  23157. unsigned char *bytes = (unsigned char *)&value;
  23158. return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
  23159. little, !is_unsigned);
  23160. }
  23161. }
  23162. /* CIntFromPy */
  23163. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
  23164. const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
  23165. const int is_unsigned = neg_one > const_zero;
  23166. #if PY_MAJOR_VERSION < 3
  23167. if (likely(PyInt_Check(x))) {
  23168. if (sizeof(size_t) < sizeof(long)) {
  23169. __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
  23170. } else {
  23171. long val = PyInt_AS_LONG(x);
  23172. if (is_unsigned && unlikely(val < 0)) {
  23173. goto raise_neg_overflow;
  23174. }
  23175. return (size_t) val;
  23176. }
  23177. } else
  23178. #endif
  23179. if (likely(PyLong_Check(x))) {
  23180. if (is_unsigned) {
  23181. #if CYTHON_USE_PYLONG_INTERNALS
  23182. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23183. switch (Py_SIZE(x)) {
  23184. case 0: return (size_t) 0;
  23185. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
  23186. case 2:
  23187. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  23188. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23189. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23190. } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
  23191. return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  23192. }
  23193. }
  23194. break;
  23195. case 3:
  23196. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  23197. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23198. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23199. } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
  23200. return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  23201. }
  23202. }
  23203. break;
  23204. case 4:
  23205. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  23206. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23207. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23208. } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
  23209. return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  23210. }
  23211. }
  23212. break;
  23213. }
  23214. #endif
  23215. #if CYTHON_COMPILING_IN_CPYTHON
  23216. if (unlikely(Py_SIZE(x) < 0)) {
  23217. goto raise_neg_overflow;
  23218. }
  23219. #else
  23220. {
  23221. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  23222. if (unlikely(result < 0))
  23223. return (size_t) -1;
  23224. if (unlikely(result == 1))
  23225. goto raise_neg_overflow;
  23226. }
  23227. #endif
  23228. if (sizeof(size_t) <= sizeof(unsigned long)) {
  23229. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
  23230. #ifdef HAVE_LONG_LONG
  23231. } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
  23232. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  23233. #endif
  23234. }
  23235. } else {
  23236. #if CYTHON_USE_PYLONG_INTERNALS
  23237. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23238. switch (Py_SIZE(x)) {
  23239. case 0: return (size_t) 0;
  23240. case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
  23241. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
  23242. case -2:
  23243. if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
  23244. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23245. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23246. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23247. return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23248. }
  23249. }
  23250. break;
  23251. case 2:
  23252. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  23253. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23254. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23255. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23256. return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23257. }
  23258. }
  23259. break;
  23260. case -3:
  23261. if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  23262. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23263. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23264. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23265. return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23266. }
  23267. }
  23268. break;
  23269. case 3:
  23270. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  23271. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23272. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23273. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23274. return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23275. }
  23276. }
  23277. break;
  23278. case -4:
  23279. if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  23280. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23281. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23282. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  23283. return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23284. }
  23285. }
  23286. break;
  23287. case 4:
  23288. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  23289. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23290. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23291. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  23292. return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  23293. }
  23294. }
  23295. break;
  23296. }
  23297. #endif
  23298. if (sizeof(size_t) <= sizeof(long)) {
  23299. __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
  23300. #ifdef HAVE_LONG_LONG
  23301. } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
  23302. __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
  23303. #endif
  23304. }
  23305. }
  23306. {
  23307. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  23308. PyErr_SetString(PyExc_RuntimeError,
  23309. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  23310. #else
  23311. size_t val;
  23312. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  23313. #if PY_MAJOR_VERSION < 3
  23314. if (likely(v) && !PyLong_Check(v)) {
  23315. PyObject *tmp = v;
  23316. v = PyNumber_Long(tmp);
  23317. Py_DECREF(tmp);
  23318. }
  23319. #endif
  23320. if (likely(v)) {
  23321. int one = 1; int is_little = (int)*(unsigned char *)&one;
  23322. unsigned char *bytes = (unsigned char *)&val;
  23323. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  23324. bytes, sizeof(val),
  23325. is_little, !is_unsigned);
  23326. Py_DECREF(v);
  23327. if (likely(!ret))
  23328. return val;
  23329. }
  23330. #endif
  23331. return (size_t) -1;
  23332. }
  23333. } else {
  23334. size_t val;
  23335. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  23336. if (!tmp) return (size_t) -1;
  23337. val = __Pyx_PyInt_As_size_t(tmp);
  23338. Py_DECREF(tmp);
  23339. return val;
  23340. }
  23341. raise_overflow:
  23342. PyErr_SetString(PyExc_OverflowError,
  23343. "value too large to convert to size_t");
  23344. return (size_t) -1;
  23345. raise_neg_overflow:
  23346. PyErr_SetString(PyExc_OverflowError,
  23347. "can't convert negative value to size_t");
  23348. return (size_t) -1;
  23349. }
  23350. /* CIntFromPy */
  23351. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  23352. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  23353. const int is_unsigned = neg_one > const_zero;
  23354. #if PY_MAJOR_VERSION < 3
  23355. if (likely(PyInt_Check(x))) {
  23356. if (sizeof(int) < sizeof(long)) {
  23357. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  23358. } else {
  23359. long val = PyInt_AS_LONG(x);
  23360. if (is_unsigned && unlikely(val < 0)) {
  23361. goto raise_neg_overflow;
  23362. }
  23363. return (int) val;
  23364. }
  23365. } else
  23366. #endif
  23367. if (likely(PyLong_Check(x))) {
  23368. if (is_unsigned) {
  23369. #if CYTHON_USE_PYLONG_INTERNALS
  23370. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23371. switch (Py_SIZE(x)) {
  23372. case 0: return (int) 0;
  23373. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  23374. case 2:
  23375. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  23376. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23377. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23378. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  23379. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23380. }
  23381. }
  23382. break;
  23383. case 3:
  23384. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  23385. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23386. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23387. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  23388. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23389. }
  23390. }
  23391. break;
  23392. case 4:
  23393. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  23394. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23395. __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])))
  23396. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  23397. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  23398. }
  23399. }
  23400. break;
  23401. }
  23402. #endif
  23403. #if CYTHON_COMPILING_IN_CPYTHON
  23404. if (unlikely(Py_SIZE(x) < 0)) {
  23405. goto raise_neg_overflow;
  23406. }
  23407. #else
  23408. {
  23409. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  23410. if (unlikely(result < 0))
  23411. return (int) -1;
  23412. if (unlikely(result == 1))
  23413. goto raise_neg_overflow;
  23414. }
  23415. #endif
  23416. if (sizeof(int) <= sizeof(unsigned long)) {
  23417. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  23418. #ifdef HAVE_LONG_LONG
  23419. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  23420. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  23421. #endif
  23422. }
  23423. } else {
  23424. #if CYTHON_USE_PYLONG_INTERNALS
  23425. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23426. switch (Py_SIZE(x)) {
  23427. case 0: return (int) 0;
  23428. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  23429. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  23430. case -2:
  23431. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  23432. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23433. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23434. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23435. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23436. }
  23437. }
  23438. break;
  23439. case 2:
  23440. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  23441. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23442. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23443. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23444. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23445. }
  23446. }
  23447. break;
  23448. case -3:
  23449. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  23450. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23451. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23452. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23453. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23454. }
  23455. }
  23456. break;
  23457. case 3:
  23458. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  23459. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23460. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23461. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23462. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23463. }
  23464. }
  23465. break;
  23466. case -4:
  23467. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  23468. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23469. __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])))
  23470. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  23471. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23472. }
  23473. }
  23474. break;
  23475. case 4:
  23476. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  23477. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23478. __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])))
  23479. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  23480. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  23481. }
  23482. }
  23483. break;
  23484. }
  23485. #endif
  23486. if (sizeof(int) <= sizeof(long)) {
  23487. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  23488. #ifdef HAVE_LONG_LONG
  23489. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  23490. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  23491. #endif
  23492. }
  23493. }
  23494. {
  23495. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  23496. PyErr_SetString(PyExc_RuntimeError,
  23497. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  23498. #else
  23499. int val;
  23500. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  23501. #if PY_MAJOR_VERSION < 3
  23502. if (likely(v) && !PyLong_Check(v)) {
  23503. PyObject *tmp = v;
  23504. v = PyNumber_Long(tmp);
  23505. Py_DECREF(tmp);
  23506. }
  23507. #endif
  23508. if (likely(v)) {
  23509. int one = 1; int is_little = (int)*(unsigned char *)&one;
  23510. unsigned char *bytes = (unsigned char *)&val;
  23511. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  23512. bytes, sizeof(val),
  23513. is_little, !is_unsigned);
  23514. Py_DECREF(v);
  23515. if (likely(!ret))
  23516. return val;
  23517. }
  23518. #endif
  23519. return (int) -1;
  23520. }
  23521. } else {
  23522. int val;
  23523. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  23524. if (!tmp) return (int) -1;
  23525. val = __Pyx_PyInt_As_int(tmp);
  23526. Py_DECREF(tmp);
  23527. return val;
  23528. }
  23529. raise_overflow:
  23530. PyErr_SetString(PyExc_OverflowError,
  23531. "value too large to convert to int");
  23532. return (int) -1;
  23533. raise_neg_overflow:
  23534. PyErr_SetString(PyExc_OverflowError,
  23535. "can't convert negative value to int");
  23536. return (int) -1;
  23537. }
  23538. /* CIntFromPy */
  23539. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  23540. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  23541. const int is_unsigned = neg_one > const_zero;
  23542. #if PY_MAJOR_VERSION < 3
  23543. if (likely(PyInt_Check(x))) {
  23544. if (sizeof(long) < sizeof(long)) {
  23545. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  23546. } else {
  23547. long val = PyInt_AS_LONG(x);
  23548. if (is_unsigned && unlikely(val < 0)) {
  23549. goto raise_neg_overflow;
  23550. }
  23551. return (long) val;
  23552. }
  23553. } else
  23554. #endif
  23555. if (likely(PyLong_Check(x))) {
  23556. if (is_unsigned) {
  23557. #if CYTHON_USE_PYLONG_INTERNALS
  23558. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23559. switch (Py_SIZE(x)) {
  23560. case 0: return (long) 0;
  23561. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  23562. case 2:
  23563. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  23564. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23565. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23566. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  23567. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  23568. }
  23569. }
  23570. break;
  23571. case 3:
  23572. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  23573. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23574. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23575. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  23576. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  23577. }
  23578. }
  23579. break;
  23580. case 4:
  23581. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  23582. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23583. __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])))
  23584. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  23585. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  23586. }
  23587. }
  23588. break;
  23589. }
  23590. #endif
  23591. #if CYTHON_COMPILING_IN_CPYTHON
  23592. if (unlikely(Py_SIZE(x) < 0)) {
  23593. goto raise_neg_overflow;
  23594. }
  23595. #else
  23596. {
  23597. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  23598. if (unlikely(result < 0))
  23599. return (long) -1;
  23600. if (unlikely(result == 1))
  23601. goto raise_neg_overflow;
  23602. }
  23603. #endif
  23604. if (sizeof(long) <= sizeof(unsigned long)) {
  23605. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  23606. #ifdef HAVE_LONG_LONG
  23607. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  23608. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  23609. #endif
  23610. }
  23611. } else {
  23612. #if CYTHON_USE_PYLONG_INTERNALS
  23613. const digit* digits = ((PyLongObject*)x)->ob_digit;
  23614. switch (Py_SIZE(x)) {
  23615. case 0: return (long) 0;
  23616. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  23617. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  23618. case -2:
  23619. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  23620. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23621. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23622. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  23623. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23624. }
  23625. }
  23626. break;
  23627. case 2:
  23628. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  23629. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  23630. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23631. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  23632. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23633. }
  23634. }
  23635. break;
  23636. case -3:
  23637. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  23638. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23639. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23640. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  23641. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23642. }
  23643. }
  23644. break;
  23645. case 3:
  23646. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  23647. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  23648. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  23649. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  23650. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23651. }
  23652. }
  23653. break;
  23654. case -4:
  23655. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  23656. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23657. __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])))
  23658. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  23659. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23660. }
  23661. }
  23662. break;
  23663. case 4:
  23664. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  23665. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  23666. __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])))
  23667. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  23668. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  23669. }
  23670. }
  23671. break;
  23672. }
  23673. #endif
  23674. if (sizeof(long) <= sizeof(long)) {
  23675. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  23676. #ifdef HAVE_LONG_LONG
  23677. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  23678. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  23679. #endif
  23680. }
  23681. }
  23682. {
  23683. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  23684. PyErr_SetString(PyExc_RuntimeError,
  23685. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  23686. #else
  23687. long val;
  23688. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  23689. #if PY_MAJOR_VERSION < 3
  23690. if (likely(v) && !PyLong_Check(v)) {
  23691. PyObject *tmp = v;
  23692. v = PyNumber_Long(tmp);
  23693. Py_DECREF(tmp);
  23694. }
  23695. #endif
  23696. if (likely(v)) {
  23697. int one = 1; int is_little = (int)*(unsigned char *)&one;
  23698. unsigned char *bytes = (unsigned char *)&val;
  23699. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  23700. bytes, sizeof(val),
  23701. is_little, !is_unsigned);
  23702. Py_DECREF(v);
  23703. if (likely(!ret))
  23704. return val;
  23705. }
  23706. #endif
  23707. return (long) -1;
  23708. }
  23709. } else {
  23710. long val;
  23711. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  23712. if (!tmp) return (long) -1;
  23713. val = __Pyx_PyInt_As_long(tmp);
  23714. Py_DECREF(tmp);
  23715. return val;
  23716. }
  23717. raise_overflow:
  23718. PyErr_SetString(PyExc_OverflowError,
  23719. "value too large to convert to long");
  23720. return (long) -1;
  23721. raise_neg_overflow:
  23722. PyErr_SetString(PyExc_OverflowError,
  23723. "can't convert negative value to long");
  23724. return (long) -1;
  23725. }
  23726. /* FastTypeChecks */
  23727. #if CYTHON_COMPILING_IN_CPYTHON
  23728. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  23729. while (a) {
  23730. a = a->tp_base;
  23731. if (a == b)
  23732. return 1;
  23733. }
  23734. return b == &PyBaseObject_Type;
  23735. }
  23736. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  23737. PyObject *mro;
  23738. if (a == b) return 1;
  23739. mro = a->tp_mro;
  23740. if (likely(mro)) {
  23741. Py_ssize_t i, n;
  23742. n = PyTuple_GET_SIZE(mro);
  23743. for (i = 0; i < n; i++) {
  23744. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  23745. return 1;
  23746. }
  23747. return 0;
  23748. }
  23749. return __Pyx_InBases(a, b);
  23750. }
  23751. #if PY_MAJOR_VERSION == 2
  23752. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  23753. PyObject *exception, *value, *tb;
  23754. int res;
  23755. __Pyx_PyThreadState_declare
  23756. __Pyx_PyThreadState_assign
  23757. __Pyx_ErrFetch(&exception, &value, &tb);
  23758. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  23759. if (unlikely(res == -1)) {
  23760. PyErr_WriteUnraisable(err);
  23761. res = 0;
  23762. }
  23763. if (!res) {
  23764. res = PyObject_IsSubclass(err, exc_type2);
  23765. if (unlikely(res == -1)) {
  23766. PyErr_WriteUnraisable(err);
  23767. res = 0;
  23768. }
  23769. }
  23770. __Pyx_ErrRestore(exception, value, tb);
  23771. return res;
  23772. }
  23773. #else
  23774. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  23775. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  23776. if (!res) {
  23777. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  23778. }
  23779. return res;
  23780. }
  23781. #endif
  23782. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  23783. Py_ssize_t i, n;
  23784. assert(PyExceptionClass_Check(exc_type));
  23785. n = PyTuple_GET_SIZE(tuple);
  23786. #if PY_MAJOR_VERSION >= 3
  23787. for (i=0; i<n; i++) {
  23788. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  23789. }
  23790. #endif
  23791. for (i=0; i<n; i++) {
  23792. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  23793. #if PY_MAJOR_VERSION < 3
  23794. if (likely(exc_type == t)) return 1;
  23795. #endif
  23796. if (likely(PyExceptionClass_Check(t))) {
  23797. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  23798. } else {
  23799. }
  23800. }
  23801. return 0;
  23802. }
  23803. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  23804. if (likely(err == exc_type)) return 1;
  23805. if (likely(PyExceptionClass_Check(err))) {
  23806. if (likely(PyExceptionClass_Check(exc_type))) {
  23807. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  23808. } else if (likely(PyTuple_Check(exc_type))) {
  23809. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  23810. } else {
  23811. }
  23812. }
  23813. return PyErr_GivenExceptionMatches(err, exc_type);
  23814. }
  23815. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  23816. assert(PyExceptionClass_Check(exc_type1));
  23817. assert(PyExceptionClass_Check(exc_type2));
  23818. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  23819. if (likely(PyExceptionClass_Check(err))) {
  23820. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  23821. }
  23822. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  23823. }
  23824. #endif
  23825. /* CStringEquals */
  23826. static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
  23827. while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
  23828. return *s1 == *s2;
  23829. }
  23830. /* CheckBinaryVersion */
  23831. static int __Pyx_check_binary_version(void) {
  23832. char ctversion[4], rtversion[4];
  23833. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  23834. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  23835. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  23836. char message[200];
  23837. PyOS_snprintf(message, sizeof(message),
  23838. "compiletime version %s of module '%.100s' "
  23839. "does not match runtime version %s",
  23840. ctversion, __Pyx_MODULE_NAME, rtversion);
  23841. return PyErr_WarnEx(NULL, message, 1);
  23842. }
  23843. return 0;
  23844. }
  23845. /* InitStrings */
  23846. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  23847. while (t->p) {
  23848. #if PY_MAJOR_VERSION < 3
  23849. if (t->is_unicode) {
  23850. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  23851. } else if (t->intern) {
  23852. *t->p = PyString_InternFromString(t->s);
  23853. } else {
  23854. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  23855. }
  23856. #else
  23857. if (t->is_unicode | t->is_str) {
  23858. if (t->intern) {
  23859. *t->p = PyUnicode_InternFromString(t->s);
  23860. } else if (t->encoding) {
  23861. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  23862. } else {
  23863. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  23864. }
  23865. } else {
  23866. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  23867. }
  23868. #endif
  23869. if (!*t->p)
  23870. return -1;
  23871. if (PyObject_Hash(*t->p) == -1)
  23872. return -1;
  23873. ++t;
  23874. }
  23875. return 0;
  23876. }
  23877. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  23878. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  23879. }
  23880. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  23881. Py_ssize_t ignore;
  23882. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  23883. }
  23884. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  23885. #if !CYTHON_PEP393_ENABLED
  23886. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  23887. char* defenc_c;
  23888. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  23889. if (!defenc) return NULL;
  23890. defenc_c = PyBytes_AS_STRING(defenc);
  23891. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  23892. {
  23893. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  23894. char* c;
  23895. for (c = defenc_c; c < end; c++) {
  23896. if ((unsigned char) (*c) >= 128) {
  23897. PyUnicode_AsASCIIString(o);
  23898. return NULL;
  23899. }
  23900. }
  23901. }
  23902. #endif
  23903. *length = PyBytes_GET_SIZE(defenc);
  23904. return defenc_c;
  23905. }
  23906. #else
  23907. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  23908. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  23909. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  23910. if (likely(PyUnicode_IS_ASCII(o))) {
  23911. *length = PyUnicode_GET_LENGTH(o);
  23912. return PyUnicode_AsUTF8(o);
  23913. } else {
  23914. PyUnicode_AsASCIIString(o);
  23915. return NULL;
  23916. }
  23917. #else
  23918. return PyUnicode_AsUTF8AndSize(o, length);
  23919. #endif
  23920. }
  23921. #endif
  23922. #endif
  23923. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  23924. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  23925. if (
  23926. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  23927. __Pyx_sys_getdefaultencoding_not_ascii &&
  23928. #endif
  23929. PyUnicode_Check(o)) {
  23930. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  23931. } else
  23932. #endif
  23933. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  23934. if (PyByteArray_Check(o)) {
  23935. *length = PyByteArray_GET_SIZE(o);
  23936. return PyByteArray_AS_STRING(o);
  23937. } else
  23938. #endif
  23939. {
  23940. char* result;
  23941. int r = PyBytes_AsStringAndSize(o, &result, length);
  23942. if (unlikely(r < 0)) {
  23943. return NULL;
  23944. } else {
  23945. return result;
  23946. }
  23947. }
  23948. }
  23949. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  23950. int is_true = x == Py_True;
  23951. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  23952. else return PyObject_IsTrue(x);
  23953. }
  23954. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  23955. int retval;
  23956. if (unlikely(!x)) return -1;
  23957. retval = __Pyx_PyObject_IsTrue(x);
  23958. Py_DECREF(x);
  23959. return retval;
  23960. }
  23961. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  23962. #if PY_MAJOR_VERSION >= 3
  23963. if (PyLong_Check(result)) {
  23964. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  23965. "__int__ returned non-int (type %.200s). "
  23966. "The ability to return an instance of a strict subclass of int "
  23967. "is deprecated, and may be removed in a future version of Python.",
  23968. Py_TYPE(result)->tp_name)) {
  23969. Py_DECREF(result);
  23970. return NULL;
  23971. }
  23972. return result;
  23973. }
  23974. #endif
  23975. PyErr_Format(PyExc_TypeError,
  23976. "__%.4s__ returned non-%.4s (type %.200s)",
  23977. type_name, type_name, Py_TYPE(result)->tp_name);
  23978. Py_DECREF(result);
  23979. return NULL;
  23980. }
  23981. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  23982. #if CYTHON_USE_TYPE_SLOTS
  23983. PyNumberMethods *m;
  23984. #endif
  23985. const char *name = NULL;
  23986. PyObject *res = NULL;
  23987. #if PY_MAJOR_VERSION < 3
  23988. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  23989. #else
  23990. if (likely(PyLong_Check(x)))
  23991. #endif
  23992. return __Pyx_NewRef(x);
  23993. #if CYTHON_USE_TYPE_SLOTS
  23994. m = Py_TYPE(x)->tp_as_number;
  23995. #if PY_MAJOR_VERSION < 3
  23996. if (m && m->nb_int) {
  23997. name = "int";
  23998. res = m->nb_int(x);
  23999. }
  24000. else if (m && m->nb_long) {
  24001. name = "long";
  24002. res = m->nb_long(x);
  24003. }
  24004. #else
  24005. if (likely(m && m->nb_int)) {
  24006. name = "int";
  24007. res = m->nb_int(x);
  24008. }
  24009. #endif
  24010. #else
  24011. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  24012. res = PyNumber_Int(x);
  24013. }
  24014. #endif
  24015. if (likely(res)) {
  24016. #if PY_MAJOR_VERSION < 3
  24017. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  24018. #else
  24019. if (unlikely(!PyLong_CheckExact(res))) {
  24020. #endif
  24021. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  24022. }
  24023. }
  24024. else if (!PyErr_Occurred()) {
  24025. PyErr_SetString(PyExc_TypeError,
  24026. "an integer is required");
  24027. }
  24028. return res;
  24029. }
  24030. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  24031. Py_ssize_t ival;
  24032. PyObject *x;
  24033. #if PY_MAJOR_VERSION < 3
  24034. if (likely(PyInt_CheckExact(b))) {
  24035. if (sizeof(Py_ssize_t) >= sizeof(long))
  24036. return PyInt_AS_LONG(b);
  24037. else
  24038. return PyInt_AsSsize_t(b);
  24039. }
  24040. #endif
  24041. if (likely(PyLong_CheckExact(b))) {
  24042. #if CYTHON_USE_PYLONG_INTERNALS
  24043. const digit* digits = ((PyLongObject*)b)->ob_digit;
  24044. const Py_ssize_t size = Py_SIZE(b);
  24045. if (likely(__Pyx_sst_abs(size) <= 1)) {
  24046. ival = likely(size) ? digits[0] : 0;
  24047. if (size == -1) ival = -ival;
  24048. return ival;
  24049. } else {
  24050. switch (size) {
  24051. case 2:
  24052. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  24053. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24054. }
  24055. break;
  24056. case -2:
  24057. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  24058. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24059. }
  24060. break;
  24061. case 3:
  24062. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  24063. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24064. }
  24065. break;
  24066. case -3:
  24067. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  24068. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24069. }
  24070. break;
  24071. case 4:
  24072. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  24073. 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]));
  24074. }
  24075. break;
  24076. case -4:
  24077. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  24078. 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]));
  24079. }
  24080. break;
  24081. }
  24082. }
  24083. #endif
  24084. return PyLong_AsSsize_t(b);
  24085. }
  24086. x = PyNumber_Index(b);
  24087. if (!x) return -1;
  24088. ival = PyInt_AsSsize_t(x);
  24089. Py_DECREF(x);
  24090. return ival;
  24091. }
  24092. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  24093. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  24094. }
  24095. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  24096. return PyInt_FromSize_t(ival);
  24097. }
  24098. #endif /* Py_PYTHON_H */

A Python package for graph kernels, graph edit distances and graph pre-image problem.