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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665176661766717668176691767017671176721767317674176751767617677176781767917680176811768217683176841768517686176871768817689176901769117692176931769417695176961769717698176991770017701177021770317704177051770617707177081770917710177111771217713177141771517716177171771817719177201772117722177231772417725177261772717728177291773017731177321773317734177351773617737177381773917740177411774217743177441774517746177471774817749177501775117752177531775417755177561775717758177591776017761177621776317764177651776617767177681776917770177711777217773177741777517776177771777817779177801778117782177831778417785177861778717788177891779017791177921779317794177951779617797177981779917800178011780217803178041780517806178071780817809178101781117812178131781417815178161781717818178191782017821178221782317824178251782617827178281782917830178311783217833178341783517836178371783817839178401784117842178431784417845178461784717848178491785017851178521785317854178551785617857178581785917860178611786217863178641786517866178671786817869178701787117872178731787417875178761787717878178791788017881178821788317884178851788617887178881788917890178911789217893178941789517896178971789817899179001790117902179031790417905179061790717908179091791017911179121791317914179151791617917179181791917920179211792217923179241792517926179271792817929179301793117932179331793417935179361793717938179391794017941179421794317944179451794617947179481794917950179511795217953179541795517956179571795817959179601796117962179631796417965179661796717968179691797017971179721797317974179751797617977179781797917980179811798217983179841798517986179871798817989179901799117992179931799417995179961799717998179991800018001180021800318004180051800618007180081800918010180111801218013180141801518016180171801818019180201802118022180231802418025180261802718028180291803018031180321803318034180351803618037180381803918040180411804218043180441804518046180471804818049180501805118052180531805418055180561805718058180591806018061180621806318064180651806618067180681806918070180711807218073180741807518076180771807818079180801808118082180831808418085180861808718088180891809018091180921809318094180951809618097180981809918100181011810218103181041810518106181071810818109181101811118112181131811418115181161811718118181191812018121181221812318124181251812618127181281812918130181311813218133181341813518136181371813818139181401814118142181431814418145181461814718148181491815018151181521815318154181551815618157181581815918160181611816218163181641816518166181671816818169181701817118172181731817418175181761817718178181791818018181181821818318184181851818618187181881818918190181911819218193181941819518196181971819818199182001820118202182031820418205182061820718208182091821018211182121821318214182151821618217182181821918220182211822218223182241822518226182271822818229182301823118232182331823418235182361823718238182391824018241182421824318244182451824618247182481824918250182511825218253182541825518256182571825818259182601826118262182631826418265182661826718268182691827018271182721827318274182751827618277182781827918280182811828218283182841828518286182871828818289182901829118292182931829418295182961829718298182991830018301183021830318304183051830618307183081830918310183111831218313183141831518316183171831818319183201832118322183231832418325183261832718328183291833018331183321833318334183351833618337183381833918340183411834218343183441834518346183471834818349183501835118352183531835418355183561835718358183591836018361183621836318364183651836618367183681836918370183711837218373183741837518376183771837818379183801838118382183831838418385183861838718388183891839018391183921839318394183951839618397183981839918400184011840218403184041840518406184071840818409184101841118412184131841418415184161841718418184191842018421184221842318424184251842618427184281842918430184311843218433184341843518436184371843818439184401844118442184431844418445184461844718448184491845018451184521845318454184551845618457184581845918460184611846218463184641846518466184671846818469184701847118472184731847418475184761847718478184791848018481184821848318484184851848618487184881848918490184911849218493184941849518496184971849818499185001850118502185031850418505185061850718508185091851018511185121851318514185151851618517185181851918520185211852218523185241852518526185271852818529185301853118532185331853418535185361853718538185391854018541185421854318544185451854618547185481854918550185511855218553185541855518556185571855818559185601856118562185631856418565185661856718568185691857018571185721857318574185751857618577185781857918580185811858218583185841858518586185871858818589185901859118592185931859418595185961859718598185991860018601186021860318604186051860618607186081860918610186111861218613186141861518616186171861818619186201862118622186231862418625186261862718628186291863018631186321863318634186351863618637186381863918640186411864218643186441864518646186471864818649186501865118652186531865418655186561865718658186591866018661186621866318664186651866618667186681866918670186711867218673186741867518676186771867818679186801868118682186831868418685186861868718688186891869018691186921869318694186951869618697186981869918700187011870218703187041870518706187071870818709187101871118712187131871418715187161871718718187191872018721187221872318724187251872618727187281872918730187311873218733187341873518736187371873818739187401874118742187431874418745187461874718748187491875018751187521875318754187551875618757187581875918760187611876218763187641876518766187671876818769187701877118772187731877418775187761877718778187791878018781187821878318784187851878618787187881878918790187911879218793187941879518796187971879818799188001880118802188031880418805188061880718808188091881018811188121881318814188151881618817188181881918820188211882218823188241882518826188271882818829188301883118832188331883418835188361883718838188391884018841188421884318844188451884618847188481884918850188511885218853188541885518856188571885818859188601886118862188631886418865188661886718868188691887018871188721887318874188751887618877188781887918880188811888218883188841888518886188871888818889188901889118892188931889418895188961889718898188991890018901189021890318904189051890618907189081890918910189111891218913189141891518916189171891818919189201892118922189231892418925189261892718928189291893018931189321893318934189351893618937189381893918940189411894218943189441894518946189471894818949189501895118952189531895418955189561895718958189591896018961189621896318964189651896618967189681896918970189711897218973189741897518976189771897818979189801898118982189831898418985189861898718988189891899018991189921899318994189951899618997189981899919000190011900219003190041900519006190071900819009190101901119012190131901419015190161901719018190191902019021190221902319024190251902619027190281902919030190311903219033190341903519036190371903819039190401904119042190431904419045190461904719048190491905019051190521905319054190551905619057190581905919060190611906219063190641906519066190671906819069190701907119072190731907419075190761907719078190791908019081190821908319084190851908619087190881908919090190911909219093190941909519096190971909819099191001910119102191031910419105191061910719108191091911019111191121911319114191151911619117191181911919120191211912219123191241912519126191271912819129191301913119132191331913419135191361913719138191391914019141191421914319144191451914619147191481914919150191511915219153191541915519156191571915819159191601916119162191631916419165191661916719168191691917019171191721917319174191751917619177191781917919180191811918219183191841918519186191871918819189191901919119192191931919419195191961919719198191991920019201192021920319204192051920619207192081920919210192111921219213192141921519216192171921819219192201922119222192231922419225192261922719228192291923019231192321923319234192351923619237192381923919240192411924219243192441924519246192471924819249192501925119252192531925419255192561925719258192591926019261192621926319264192651926619267192681926919270192711927219273192741927519276192771927819279192801928119282192831928419285192861928719288192891929019291192921929319294192951929619297192981929919300193011930219303193041930519306193071930819309193101931119312193131931419315193161931719318193191932019321193221932319324193251932619327193281932919330193311933219333193341933519336193371933819339193401934119342193431934419345193461934719348193491935019351193521935319354193551935619357193581935919360193611936219363193641936519366193671936819369193701937119372193731937419375193761937719378193791938019381193821938319384193851938619387193881938919390193911939219393193941939519396193971939819399194001940119402194031940419405194061940719408194091941019411194121941319414194151941619417194181941919420194211942219423194241942519426194271942819429194301943119432194331943419435194361943719438194391944019441194421944319444194451944619447194481944919450194511945219453194541945519456194571945819459194601946119462194631946419465194661946719468194691947019471194721947319474194751947619477194781947919480194811948219483194841948519486194871948819489194901949119492194931949419495194961949719498194991950019501195021950319504195051950619507195081950919510195111951219513195141951519516195171951819519195201952119522195231952419525195261952719528195291953019531195321953319534195351953619537195381953919540195411954219543195441954519546195471954819549195501955119552195531955419555195561955719558195591956019561195621956319564195651956619567195681956919570195711957219573195741957519576195771957819579195801958119582195831958419585195861958719588195891959019591195921959319594195951959619597195981959919600196011960219603196041960519606196071960819609196101961119612196131961419615196161961719618196191962019621196221962319624196251962619627196281962919630196311963219633196341963519636196371963819639196401964119642196431964419645196461964719648196491965019651196521965319654196551965619657196581965919660196611966219663196641966519666196671966819669196701967119672196731967419675196761967719678196791968019681196821968319684196851968619687196881968919690196911969219693196941969519696196971969819699197001970119702197031970419705197061970719708197091971019711197121971319714197151971619717197181971919720197211972219723197241972519726197271972819729197301973119732197331973419735197361973719738197391974019741197421974319744197451974619747197481974919750197511975219753197541975519756197571975819759197601976119762197631976419765197661976719768197691977019771197721977319774197751977619777197781977919780197811978219783197841978519786197871978819789197901979119792197931979419795197961979719798197991980019801198021980319804198051980619807198081980919810198111981219813198141981519816198171981819819198201982119822198231982419825198261982719828198291983019831198321983319834198351983619837198381983919840198411984219843198441984519846198471984819849198501985119852198531985419855198561985719858198591986019861198621986319864198651986619867198681986919870198711987219873198741987519876198771987819879198801988119882198831988419885198861988719888198891989019891198921989319894198951989619897198981989919900199011990219903199041990519906199071990819909199101991119912199131991419915199161991719918199191992019921199221992319924199251992619927199281992919930199311993219933199341993519936199371993819939199401994119942199431994419945199461994719948199491995019951199521995319954199551995619957199581995919960199611996219963199641996519966199671996819969199701997119972199731997419975199761997719978199791998019981199821998319984199851998619987199881998919990199911999219993199941999519996199971999819999200002000120002200032000420005200062000720008200092001020011200122001320014200152001620017200182001920020200212002220023200242002520026200272002820029200302003120032200332003420035200362003720038200392004020041200422004320044200452004620047200482004920050200512005220053200542005520056200572005820059200602006120062200632006420065200662006720068200692007020071200722007320074200752007620077200782007920080200812008220083200842008520086200872008820089200902009120092200932009420095200962009720098200992010020101201022010320104201052010620107201082010920110201112011220113201142011520116201172011820119201202012120122201232012420125201262012720128201292013020131201322013320134201352013620137201382013920140201412014220143201442014520146201472014820149201502015120152201532015420155201562015720158201592016020161201622016320164201652016620167201682016920170201712017220173201742017520176201772017820179201802018120182201832018420185201862018720188201892019020191201922019320194201952019620197201982019920200202012020220203202042020520206202072020820209202102021120212202132021420215202162021720218202192022020221202222022320224202252022620227202282022920230202312023220233202342023520236202372023820239202402024120242202432024420245202462024720248202492025020251202522025320254202552025620257202582025920260202612026220263202642026520266202672026820269202702027120272202732027420275202762027720278202792028020281202822028320284202852028620287202882028920290202912029220293202942029520296202972029820299203002030120302203032030420305203062030720308203092031020311203122031320314203152031620317203182031920320203212032220323203242032520326203272032820329203302033120332203332033420335203362033720338203392034020341203422034320344203452034620347203482034920350203512035220353203542035520356203572035820359203602036120362203632036420365203662036720368203692037020371203722037320374203752037620377203782037920380203812038220383203842038520386203872038820389203902039120392203932039420395203962039720398203992040020401204022040320404204052040620407204082040920410204112041220413204142041520416204172041820419204202042120422204232042420425204262042720428204292043020431204322043320434204352043620437204382043920440204412044220443204442044520446204472044820449204502045120452204532045420455204562045720458204592046020461204622046320464204652046620467204682046920470204712047220473204742047520476204772047820479204802048120482204832048420485204862048720488204892049020491204922049320494204952049620497204982049920500205012050220503205042050520506205072050820509205102051120512205132051420515205162051720518205192052020521205222052320524205252052620527205282052920530205312053220533205342053520536205372053820539205402054120542205432054420545205462054720548205492055020551205522055320554205552055620557205582055920560205612056220563205642056520566205672056820569205702057120572205732057420575205762057720578205792058020581205822058320584205852058620587205882058920590205912059220593205942059520596205972059820599206002060120602206032060420605206062060720608206092061020611206122061320614206152061620617206182061920620206212062220623206242062520626206272062820629206302063120632206332063420635206362063720638206392064020641206422064320644206452064620647206482064920650206512065220653206542065520656206572065820659206602066120662206632066420665206662066720668206692067020671206722067320674206752067620677206782067920680206812068220683206842068520686206872068820689206902069120692206932069420695206962069720698206992070020701207022070320704207052070620707207082070920710207112071220713207142071520716207172071820719207202072120722207232072420725207262072720728207292073020731207322073320734207352073620737207382073920740207412074220743207442074520746207472074820749207502075120752207532075420755207562075720758207592076020761207622076320764207652076620767207682076920770207712077220773207742077520776207772077820779207802078120782207832078420785207862078720788207892079020791207922079320794207952079620797207982079920800208012080220803208042080520806208072080820809208102081120812208132081420815208162081720818208192082020821208222082320824208252082620827208282082920830208312083220833208342083520836208372083820839208402084120842208432084420845208462084720848208492085020851208522085320854208552085620857208582085920860208612086220863208642086520866208672086820869208702087120872208732087420875208762087720878208792088020881208822088320884208852088620887208882088920890208912089220893208942089520896208972089820899209002090120902209032090420905209062090720908209092091020911209122091320914209152091620917209182091920920209212092220923209242092520926209272092820929209302093120932209332093420935209362093720938209392094020941209422094320944209452094620947209482094920950209512095220953209542095520956209572095820959209602096120962209632096420965209662096720968209692097020971209722097320974209752097620977209782097920980209812098220983209842098520986209872098820989209902099120992209932099420995209962099720998209992100021001210022100321004210052100621007210082100921010210112101221013210142101521016210172101821019210202102121022210232102421025210262102721028210292103021031210322103321034210352103621037210382103921040210412104221043210442104521046210472104821049210502105121052210532105421055210562105721058210592106021061210622106321064210652106621067210682106921070210712107221073210742107521076210772107821079210802108121082210832108421085210862108721088210892109021091210922109321094210952109621097210982109921100211012110221103211042110521106211072110821109211102111121112211132111421115211162111721118211192112021121211222112321124211252112621127211282112921130211312113221133211342113521136211372113821139211402114121142211432114421145211462114721148211492115021151211522115321154211552115621157211582115921160211612116221163211642116521166211672116821169211702117121172211732117421175211762117721178211792118021181211822118321184211852118621187211882118921190211912119221193211942119521196211972119821199212002120121202212032120421205212062120721208212092121021211212122121321214212152121621217212182121921220212212122221223212242122521226212272122821229212302123121232212332123421235212362123721238212392124021241212422124321244212452124621247212482124921250212512125221253212542125521256212572125821259212602126121262212632126421265212662126721268212692127021271212722127321274212752127621277212782127921280212812128221283212842128521286212872128821289212902129121292212932129421295212962129721298212992130021301213022130321304213052130621307213082130921310213112131221313213142131521316213172131821319213202132121322213232132421325213262132721328213292133021331213322133321334213352133621337213382133921340213412134221343213442134521346213472134821349213502135121352213532135421355213562135721358213592136021361213622136321364213652136621367213682136921370213712137221373213742137521376213772137821379213802138121382213832138421385213862138721388213892139021391213922139321394213952139621397213982139921400214012140221403214042140521406214072140821409214102141121412214132141421415214162141721418214192142021421214222142321424214252142621427214282142921430214312143221433214342143521436214372143821439214402144121442214432144421445214462144721448214492145021451214522145321454214552145621457214582145921460214612146221463214642146521466214672146821469214702147121472214732147421475214762147721478214792148021481214822148321484214852148621487214882148921490214912149221493214942149521496214972149821499215002150121502215032150421505215062150721508215092151021511215122151321514215152151621517215182151921520215212152221523215242152521526215272152821529215302153121532215332153421535215362153721538215392154021541215422154321544215452154621547215482154921550215512155221553215542155521556215572155821559215602156121562215632156421565215662156721568215692157021571215722157321574215752157621577215782157921580215812158221583215842158521586215872158821589215902159121592215932159421595215962159721598215992160021601216022160321604216052160621607216082160921610216112161221613216142161521616216172161821619216202162121622216232162421625216262162721628216292163021631216322163321634216352163621637216382163921640216412164221643216442164521646216472164821649216502165121652216532165421655216562165721658216592166021661216622166321664216652166621667216682166921670216712167221673216742167521676216772167821679216802168121682216832168421685216862168721688216892169021691216922169321694216952169621697216982169921700217012170221703217042170521706217072170821709217102171121712217132171421715217162171721718217192172021721217222172321724217252172621727217282172921730217312173221733217342173521736217372173821739217402174121742217432174421745217462174721748217492175021751217522175321754217552175621757217582175921760217612176221763217642176521766217672176821769217702177121772217732177421775217762177721778217792178021781217822178321784217852178621787217882178921790217912179221793217942179521796217972179821799218002180121802218032180421805218062180721808218092181021811218122181321814218152181621817218182181921820218212182221823218242182521826218272182821829218302183121832218332183421835218362183721838218392184021841218422184321844218452184621847218482184921850218512185221853218542185521856218572185821859218602186121862218632186421865218662186721868218692187021871218722187321874218752187621877218782187921880218812188221883218842188521886218872188821889218902189121892218932189421895218962189721898218992190021901219022190321904219052190621907219082190921910219112191221913219142191521916219172191821919219202192121922219232192421925219262192721928219292193021931219322193321934219352193621937219382193921940219412194221943219442194521946219472194821949219502195121952219532195421955219562195721958219592196021961219622196321964219652196621967219682196921970219712197221973219742197521976219772197821979219802198121982219832198421985219862198721988219892199021991219922199321994219952199621997219982199922000220012200222003220042200522006220072200822009220102201122012220132201422015220162201722018220192202022021220222202322024220252202622027220282202922030220312203222033220342203522036220372203822039220402204122042220432204422045220462204722048220492205022051220522205322054220552205622057220582205922060220612206222063220642206522066220672206822069220702207122072220732207422075220762207722078220792208022081220822208322084220852208622087220882208922090220912209222093220942209522096220972209822099221002210122102221032210422105221062210722108221092211022111221122211322114221152211622117221182211922120221212212222123221242212522126221272212822129221302213122132221332213422135221362213722138221392214022141221422214322144221452214622147221482214922150221512215222153221542215522156221572215822159221602216122162221632216422165221662216722168221692217022171221722217322174221752217622177221782217922180221812218222183221842218522186221872218822189221902219122192221932219422195221962219722198221992220022201222022220322204222052220622207222082220922210222112221222213222142221522216222172221822219222202222122222222232222422225222262222722228222292223022231222322223322234222352223622237222382223922240222412224222243222442224522246222472224822249222502225122252222532225422255222562225722258222592226022261222622226322264222652226622267222682226922270222712227222273222742227522276222772227822279222802228122282222832228422285222862228722288222892229022291222922229322294222952229622297222982229922300223012230222303223042230522306223072230822309223102231122312223132231422315223162231722318223192232022321223222232322324223252232622327223282232922330223312233222333223342233522336223372233822339223402234122342223432234422345223462234722348223492235022351223522235322354223552235622357223582235922360223612236222363223642236522366223672236822369223702237122372223732237422375223762237722378223792238022381223822238322384223852238622387223882238922390223912239222393223942239522396223972239822399224002240122402224032240422405224062240722408224092241022411224122241322414224152241622417224182241922420224212242222423224242242522426224272242822429224302243122432224332243422435224362243722438224392244022441224422244322444224452244622447224482244922450224512245222453224542245522456224572245822459224602246122462224632246422465224662246722468224692247022471224722247322474224752247622477224782247922480224812248222483224842248522486224872248822489224902249122492224932249422495224962249722498224992250022501225022250322504225052250622507225082250922510225112251222513225142251522516225172251822519225202252122522225232252422525225262252722528225292253022531225322253322534225352253622537225382253922540225412254222543225442254522546225472254822549225502255122552225532255422555225562255722558225592256022561225622256322564225652256622567225682256922570225712257222573225742257522576225772257822579225802258122582225832258422585225862258722588225892259022591225922259322594225952259622597225982259922600226012260222603226042260522606226072260822609226102261122612226132261422615226162261722618226192262022621226222262322624226252262622627226282262922630226312263222633226342263522636226372263822639226402264122642226432264422645226462264722648226492265022651226522265322654226552265622657226582265922660226612266222663226642266522666226672266822669226702267122672226732267422675226762267722678226792268022681226822268322684226852268622687226882268922690226912269222693226942269522696226972269822699227002270122702227032270422705227062270722708227092271022711227122271322714227152271622717227182271922720227212272222723227242272522726227272272822729227302273122732227332273422735227362273722738227392274022741227422274322744227452274622747227482274922750227512275222753227542275522756227572275822759227602276122762227632276422765227662276722768227692277022771227722277322774227752277622777227782277922780227812278222783227842278522786227872278822789227902279122792227932279422795227962279722798227992280022801228022280322804228052280622807228082280922810228112281222813228142281522816228172281822819228202282122822228232282422825228262282722828228292283022831228322283322834228352283622837228382283922840228412284222843228442284522846228472284822849228502285122852228532285422855228562285722858228592286022861228622286322864228652286622867228682286922870228712287222873228742287522876228772287822879228802288122882228832288422885228862288722888228892289022891228922289322894228952289622897228982289922900229012290222903229042290522906229072290822909229102291122912229132291422915229162291722918229192292022921229222292322924229252292622927229282292922930229312293222933229342293522936229372293822939229402294122942229432294422945229462294722948229492295022951229522295322954229552295622957229582295922960229612296222963229642296522966229672296822969229702297122972229732297422975229762297722978229792298022981229822298322984229852298622987229882298922990229912299222993229942299522996229972299822999230002300123002230032300423005230062300723008230092301023011230122301323014230152301623017230182301923020230212302223023230242302523026230272302823029230302303123032230332303423035230362303723038230392304023041230422304323044230452304623047230482304923050230512305223053230542305523056230572305823059230602306123062230632306423065230662306723068230692307023071230722307323074230752307623077230782307923080230812308223083230842308523086230872308823089230902309123092230932309423095230962309723098230992310023101231022310323104231052310623107231082310923110231112311223113231142311523116231172311823119231202312123122231232312423125231262312723128231292313023131231322313323134231352313623137231382313923140231412314223143231442314523146231472314823149231502315123152231532315423155231562315723158231592316023161231622316323164231652316623167231682316923170231712317223173231742317523176231772317823179231802318123182231832318423185231862318723188231892319023191231922319323194231952319623197231982319923200232012320223203232042320523206232072320823209232102321123212232132321423215232162321723218232192322023221232222322323224232252322623227232282322923230232312323223233232342323523236232372323823239232402324123242232432324423245232462324723248232492325023251232522325323254232552325623257232582325923260232612326223263232642326523266232672326823269232702327123272232732327423275232762327723278232792328023281232822328323284232852328623287232882328923290232912329223293232942329523296232972329823299233002330123302233032330423305233062330723308233092331023311233122331323314233152331623317233182331923320233212332223323233242332523326233272332823329233302333123332233332333423335233362333723338233392334023341233422334323344233452334623347233482334923350233512335223353233542335523356233572335823359233602336123362233632336423365233662336723368233692337023371233722337323374233752337623377233782337923380233812338223383233842338523386233872338823389233902339123392233932339423395233962339723398233992340023401234022340323404234052340623407234082340923410234112341223413234142341523416234172341823419234202342123422234232342423425234262342723428234292343023431234322343323434234352343623437234382343923440234412344223443234442344523446234472344823449234502345123452234532345423455234562345723458234592346023461234622346323464234652346623467234682346923470234712347223473234742347523476234772347823479234802348123482234832348423485234862348723488234892349023491234922349323494234952349623497234982349923500235012350223503235042350523506235072350823509235102351123512235132351423515235162351723518235192352023521235222352323524235252352623527235282352923530235312353223533235342353523536235372353823539235402354123542235432354423545235462354723548235492355023551235522355323554235552355623557235582355923560235612356223563235642356523566235672356823569235702357123572235732357423575235762357723578235792358023581235822358323584235852358623587235882358923590235912359223593235942359523596235972359823599236002360123602236032360423605236062360723608236092361023611236122361323614236152361623617236182361923620236212362223623236242362523626236272362823629236302363123632236332363423635236362363723638236392364023641236422364323644236452364623647236482364923650236512365223653236542365523656236572365823659236602366123662236632366423665236662366723668236692367023671236722367323674236752367623677236782367923680236812368223683236842368523686236872368823689236902369123692236932369423695236962369723698236992370023701237022370323704237052370623707237082370923710237112371223713237142371523716237172371823719237202372123722237232372423725237262372723728237292373023731237322373323734237352373623737237382373923740237412374223743237442374523746237472374823749237502375123752237532375423755237562375723758237592376023761237622376323764237652376623767237682376923770237712377223773237742377523776237772377823779237802378123782237832378423785237862378723788237892379023791237922379323794237952379623797237982379923800238012380223803238042380523806238072380823809238102381123812238132381423815238162381723818238192382023821238222382323824238252382623827238282382923830238312383223833238342383523836238372383823839238402384123842238432384423845238462384723848238492385023851238522385323854238552385623857238582385923860238612386223863238642386523866238672386823869238702387123872238732387423875238762387723878238792388023881238822388323884238852388623887238882388923890238912389223893238942389523896238972389823899239002390123902239032390423905239062390723908239092391023911239122391323914239152391623917239182391923920239212392223923239242392523926239272392823929239302393123932239332393423935239362393723938239392394023941239422394323944239452394623947239482394923950239512395223953239542395523956239572395823959239602396123962239632396423965239662396723968239692397023971239722397323974239752397623977239782397923980239812398223983239842398523986239872398823989239902399123992239932399423995239962399723998239992400024001240022400324004240052400624007240082400924010240112401224013240142401524016240172401824019240202402124022240232402424025240262402724028240292403024031240322403324034240352403624037240382403924040240412404224043240442404524046240472404824049240502405124052240532405424055240562405724058240592406024061240622406324064240652406624067240682406924070240712407224073240742407524076240772407824079240802408124082240832408424085240862408724088240892409024091240922409324094240952409624097240982409924100241012410224103241042410524106241072410824109241102411124112241132411424115241162411724118241192412024121241222412324124241252412624127241282412924130241312413224133241342413524136241372413824139241402414124142241432414424145241462414724148241492415024151241522415324154241552415624157241582415924160241612416224163241642416524166241672416824169241702417124172241732417424175241762417724178241792418024181241822418324184241852418624187241882418924190241912419224193241942419524196241972419824199242002420124202242032420424205242062420724208242092421024211242122421324214242152421624217242182421924220242212422224223242242422524226242272422824229242302423124232242332423424235242362423724238242392424024241242422424324244242452424624247242482424924250242512425224253242542425524256242572425824259242602426124262242632426424265242662426724268242692427024271242722427324274242752427624277242782427924280242812428224283242842428524286242872428824289242902429124292242932429424295242962429724298242992430024301243022430324304243052430624307243082430924310243112431224313243142431524316243172431824319243202432124322243232432424325243262432724328243292433024331243322433324334243352433624337243382433924340243412434224343243442434524346243472434824349243502435124352243532435424355243562435724358243592436024361243622436324364243652436624367243682436924370243712437224373243742437524376243772437824379243802438124382243832438424385243862438724388243892439024391243922439324394243952439624397243982439924400244012440224403244042440524406244072440824409244102441124412244132441424415244162441724418244192442024421244222442324424244252442624427244282442924430244312443224433244342443524436244372443824439244402444124442244432444424445244462444724448244492445024451244522445324454244552445624457244582445924460244612446224463244642446524466244672446824469244702447124472244732447424475244762447724478244792448024481244822448324484244852448624487244882448924490244912449224493244942449524496244972449824499245002450124502245032450424505245062450724508245092451024511245122451324514245152451624517245182451924520245212452224523245242452524526245272452824529245302453124532245332453424535245362453724538245392454024541245422454324544245452454624547245482454924550245512455224553245542455524556245572455824559245602456124562245632456424565245662456724568245692457024571245722457324574245752457624577245782457924580245812458224583245842458524586245872458824589245902459124592245932459424595245962459724598245992460024601246022460324604246052460624607246082460924610246112461224613246142461524616246172461824619246202462124622246232462424625246262462724628246292463024631246322463324634246352463624637246382463924640246412464224643246442464524646246472464824649246502465124652246532465424655246562465724658246592466024661246622466324664246652466624667246682466924670246712467224673246742467524676246772467824679246802468124682246832468424685246862468724688246892469024691246922469324694246952469624697246982469924700247012470224703247042470524706247072470824709247102471124712247132471424715247162471724718247192472024721247222472324724247252472624727247282472924730247312473224733247342473524736247372473824739247402474124742247432474424745247462474724748247492475024751247522475324754247552475624757247582475924760247612476224763247642476524766247672476824769247702477124772247732477424775247762477724778247792478024781247822478324784247852478624787247882478924790247912479224793247942479524796247972479824799248002480124802248032480424805248062480724808248092481024811248122481324814248152481624817248182481924820248212482224823248242482524826248272482824829248302483124832248332483424835248362483724838248392484024841248422484324844248452484624847248482484924850248512485224853248542485524856248572485824859248602486124862248632486424865248662486724868248692487024871248722487324874248752487624877248782487924880248812488224883248842488524886248872488824889248902489124892248932489424895248962489724898248992490024901249022490324904249052490624907249082490924910249112491224913249142491524916249172491824919249202492124922249232492424925249262492724928249292493024931249322493324934249352493624937249382493924940249412494224943249442494524946249472494824949249502495124952249532495424955249562495724958249592496024961249622496324964249652496624967249682496924970249712497224973249742497524976249772497824979249802498124982249832498424985249862498724988249892499024991249922499324994249952499624997249982499925000250012500225003250042500525006250072500825009250102501125012250132501425015250162501725018250192502025021250222502325024250252502625027250282502925030250312503225033250342503525036250372503825039250402504125042250432504425045250462504725048250492505025051250522505325054250552505625057250582505925060250612506225063250642506525066250672506825069250702507125072250732507425075250762507725078250792508025081250822508325084250852508625087250882508925090250912509225093250942509525096250972509825099251002510125102251032510425105251062510725108251092511025111251122511325114251152511625117251182511925120251212512225123251242512525126251272512825129251302513125132251332513425135251362513725138251392514025141251422514325144251452514625147251482514925150251512515225153251542515525156251572515825159251602516125162251632516425165251662516725168251692517025171251722517325174251752517625177251782517925180251812518225183251842518525186251872518825189251902519125192251932519425195251962519725198251992520025201252022520325204252052520625207252082520925210252112521225213252142521525216252172521825219252202522125222252232522425225252262522725228252292523025231252322523325234252352523625237252382523925240252412524225243252442524525246252472524825249252502525125252252532525425255252562525725258252592526025261252622526325264252652526625267252682526925270252712527225273252742527525276252772527825279252802528125282252832528425285252862528725288252892529025291252922529325294252952529625297252982529925300253012530225303253042530525306253072530825309253102531125312253132531425315253162531725318253192532025321253222532325324253252532625327253282532925330253312533225333253342533525336253372533825339253402534125342253432534425345253462534725348253492535025351253522535325354253552535625357253582535925360253612536225363253642536525366253672536825369253702537125372253732537425375253762537725378253792538025381253822538325384253852538625387253882538925390253912539225393253942539525396253972539825399254002540125402254032540425405254062540725408254092541025411254122541325414254152541625417254182541925420254212542225423254242542525426254272542825429254302543125432254332543425435254362543725438254392544025441254422544325444254452544625447254482544925450254512545225453254542545525456254572545825459254602546125462254632546425465254662546725468254692547025471254722547325474254752547625477254782547925480254812548225483254842548525486254872548825489254902549125492254932549425495254962549725498254992550025501255022550325504255052550625507255082550925510255112551225513255142551525516255172551825519255202552125522255232552425525255262552725528255292553025531255322553325534255352553625537255382553925540255412554225543255442554525546255472554825549255502555125552255532555425555255562555725558255592556025561255622556325564255652556625567255682556925570255712557225573255742557525576255772557825579255802558125582255832558425585255862558725588255892559025591255922559325594255952559625597255982559925600256012560225603256042560525606256072560825609256102561125612256132561425615256162561725618256192562025621256222562325624256252562625627256282562925630256312563225633256342563525636256372563825639256402564125642256432564425645256462564725648256492565025651256522565325654256552565625657256582565925660256612566225663256642566525666256672566825669256702567125672256732567425675256762567725678256792568025681256822568325684256852568625687256882568925690256912569225693256942569525696256972569825699257002570125702257032570425705257062570725708257092571025711257122571325714257152571625717257182571925720257212572225723257242572525726257272572825729257302573125732257332573425735257362573725738257392574025741257422574325744257452574625747257482574925750257512575225753257542575525756257572575825759257602576125762257632576425765257662576725768257692577025771257722577325774257752577625777257782577925780257812578225783257842578525786257872578825789257902579125792257932579425795257962579725798257992580025801258022580325804258052580625807258082580925810258112581225813258142581525816258172581825819258202582125822258232582425825258262582725828258292583025831258322583325834258352583625837258382583925840258412584225843258442584525846258472584825849258502585125852258532585425855258562585725858258592586025861258622586325864258652586625867258682586925870258712587225873258742587525876258772587825879258802588125882258832588425885258862588725888258892589025891258922589325894258952589625897258982589925900259012590225903259042590525906259072590825909259102591125912259132591425915259162591725918259192592025921259222592325924259252592625927259282592925930259312593225933259342593525936259372593825939259402594125942259432594425945259462594725948259492595025951259522595325954259552595625957259582595925960259612596225963259642596525966259672596825969259702597125972259732597425975259762597725978259792598025981259822598325984259852598625987259882598925990259912599225993259942599525996259972599825999260002600126002260032600426005260062600726008260092601026011260122601326014260152601626017260182601926020260212602226023260242602526026260272602826029260302603126032260332603426035260362603726038260392604026041260422604326044260452604626047260482604926050260512605226053260542605526056260572605826059260602606126062260632606426065260662606726068260692607026071260722607326074260752607626077260782607926080260812608226083260842608526086260872608826089260902609126092260932609426095260962609726098260992610026101261022610326104261052610626107261082610926110261112611226113261142611526116261172611826119261202612126122261232612426125261262612726128261292613026131261322613326134261352613626137261382613926140261412614226143261442614526146261472614826149261502615126152261532615426155261562615726158261592616026161261622616326164261652616626167261682616926170261712617226173261742617526176261772617826179261802618126182261832618426185261862618726188261892619026191261922619326194261952619626197261982619926200262012620226203262042620526206262072620826209262102621126212262132621426215262162621726218262192622026221262222622326224262252622626227262282622926230262312623226233262342623526236262372623826239262402624126242262432624426245262462624726248262492625026251262522625326254262552625626257262582625926260262612626226263262642626526266262672626826269262702627126272262732627426275262762627726278262792628026281262822628326284262852628626287262882628926290262912629226293262942629526296262972629826299263002630126302263032630426305263062630726308263092631026311263122631326314263152631626317263182631926320263212632226323263242632526326263272632826329263302633126332263332633426335263362633726338263392634026341263422634326344263452634626347263482634926350263512635226353263542635526356263572635826359263602636126362263632636426365263662636726368263692637026371263722637326374263752637626377263782637926380263812638226383263842638526386263872638826389263902639126392263932639426395263962639726398263992640026401264022640326404264052640626407264082640926410264112641226413264142641526416264172641826419264202642126422264232642426425264262642726428264292643026431264322643326434264352643626437264382643926440264412644226443264442644526446264472644826449264502645126452264532645426455264562645726458264592646026461264622646326464264652646626467264682646926470264712647226473264742647526476264772647826479264802648126482264832648426485264862648726488264892649026491264922649326494264952649626497264982649926500265012650226503265042650526506265072650826509265102651126512265132651426515265162651726518265192652026521265222652326524265252652626527265282652926530265312653226533265342653526536265372653826539265402654126542265432654426545265462654726548265492655026551265522655326554265552655626557265582655926560265612656226563265642656526566265672656826569265702657126572265732657426575265762657726578265792658026581265822658326584265852658626587265882658926590265912659226593265942659526596265972659826599266002660126602266032660426605266062660726608266092661026611266122661326614266152661626617266182661926620
  1. /* Generated by Cython 0.29.16 */
  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_16"
  54. #define CYTHON_HEX_VERSION 0x001D10F0
  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. #ifndef PyObject_Unicode
  543. #define PyObject_Unicode PyObject_Str
  544. #endif
  545. #endif
  546. #if PY_MAJOR_VERSION >= 3
  547. #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  548. #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
  549. #else
  550. #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  551. #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
  552. #endif
  553. #ifndef PySet_CheckExact
  554. #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
  555. #endif
  556. #if CYTHON_ASSUME_SAFE_MACROS
  557. #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
  558. #else
  559. #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
  560. #endif
  561. #if PY_MAJOR_VERSION >= 3
  562. #define PyIntObject PyLongObject
  563. #define PyInt_Type PyLong_Type
  564. #define PyInt_Check(op) PyLong_Check(op)
  565. #define PyInt_CheckExact(op) PyLong_CheckExact(op)
  566. #define PyInt_FromString PyLong_FromString
  567. #define PyInt_FromUnicode PyLong_FromUnicode
  568. #define PyInt_FromLong PyLong_FromLong
  569. #define PyInt_FromSize_t PyLong_FromSize_t
  570. #define PyInt_FromSsize_t PyLong_FromSsize_t
  571. #define PyInt_AsLong PyLong_AsLong
  572. #define PyInt_AS_LONG PyLong_AS_LONG
  573. #define PyInt_AsSsize_t PyLong_AsSsize_t
  574. #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
  575. #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  576. #define PyNumber_Int PyNumber_Long
  577. #endif
  578. #if PY_MAJOR_VERSION >= 3
  579. #define PyBoolObject PyLongObject
  580. #endif
  581. #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  582. #ifndef PyUnicode_InternFromString
  583. #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  584. #endif
  585. #endif
  586. #if PY_VERSION_HEX < 0x030200A4
  587. typedef long Py_hash_t;
  588. #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  589. #define __Pyx_PyInt_AsHash_t PyInt_AsLong
  590. #else
  591. #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  592. #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
  593. #endif
  594. #if PY_MAJOR_VERSION >= 3
  595. #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
  596. #else
  597. #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
  598. #endif
  599. #if CYTHON_USE_ASYNC_SLOTS
  600. #if PY_VERSION_HEX >= 0x030500B1
  601. #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
  602. #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  603. #else
  604. #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  605. #endif
  606. #else
  607. #define __Pyx_PyType_AsAsync(obj) NULL
  608. #endif
  609. #ifndef __Pyx_PyAsyncMethodsStruct
  610. typedef struct {
  611. unaryfunc am_await;
  612. unaryfunc am_aiter;
  613. unaryfunc am_anext;
  614. } __Pyx_PyAsyncMethodsStruct;
  615. #endif
  616. #if defined(WIN32) || defined(MS_WINDOWS)
  617. #define _USE_MATH_DEFINES
  618. #endif
  619. #include <math.h>
  620. #ifdef NAN
  621. #define __PYX_NAN() ((float) NAN)
  622. #else
  623. static CYTHON_INLINE float __PYX_NAN() {
  624. float value;
  625. memset(&value, 0xFF, sizeof(value));
  626. return value;
  627. }
  628. #endif
  629. #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
  630. #define __Pyx_truncl trunc
  631. #else
  632. #define __Pyx_truncl truncl
  633. #endif
  634. #define __PYX_ERR(f_index, lineno, Ln_error) \
  635. { \
  636. __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
  637. }
  638. #ifndef __PYX_EXTERN_C
  639. #ifdef __cplusplus
  640. #define __PYX_EXTERN_C extern "C"
  641. #else
  642. #define __PYX_EXTERN_C extern
  643. #endif
  644. #endif
  645. #define __PYX_HAVE__gedlibpy
  646. #define __PYX_HAVE_API__gedlibpy
  647. /* Early includes */
  648. #include "ios"
  649. #include "new"
  650. #include "stdexcept"
  651. #include "typeinfo"
  652. #include <vector>
  653. #include <string.h>
  654. #include <string>
  655. #include <utility>
  656. #include <map>
  657. #include <list>
  658. #include <stdio.h>
  659. #include "numpy/arrayobject.h"
  660. #include "numpy/ufuncobject.h"
  661. #include "pythread.h"
  662. #include "src/GedLibBind.hpp"
  663. #ifdef _OPENMP
  664. #include <omp.h>
  665. #endif /* _OPENMP */
  666. #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
  667. #define CYTHON_WITHOUT_ASSERTIONS
  668. #endif
  669. typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
  670. const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
  671. #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
  672. #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
  673. #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
  674. #define __PYX_DEFAULT_STRING_ENCODING ""
  675. #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
  676. #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  677. #define __Pyx_uchar_cast(c) ((unsigned char)c)
  678. #define __Pyx_long_cast(x) ((long)x)
  679. #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
  680. (sizeof(type) < sizeof(Py_ssize_t)) ||\
  681. (sizeof(type) > sizeof(Py_ssize_t) &&\
  682. likely(v < (type)PY_SSIZE_T_MAX ||\
  683. v == (type)PY_SSIZE_T_MAX) &&\
  684. (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
  685. v == (type)PY_SSIZE_T_MIN))) ||\
  686. (sizeof(type) == sizeof(Py_ssize_t) &&\
  687. (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
  688. v == (type)PY_SSIZE_T_MAX))) )
  689. static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
  690. return (size_t) i < (size_t) limit;
  691. }
  692. #if defined (__cplusplus) && __cplusplus >= 201103L
  693. #include <cstdlib>
  694. #define __Pyx_sst_abs(value) std::abs(value)
  695. #elif SIZEOF_INT >= SIZEOF_SIZE_T
  696. #define __Pyx_sst_abs(value) abs(value)
  697. #elif SIZEOF_LONG >= SIZEOF_SIZE_T
  698. #define __Pyx_sst_abs(value) labs(value)
  699. #elif defined (_MSC_VER)
  700. #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
  701. #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
  702. #define __Pyx_sst_abs(value) llabs(value)
  703. #elif defined (__GNUC__)
  704. #define __Pyx_sst_abs(value) __builtin_llabs(value)
  705. #else
  706. #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
  707. #endif
  708. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
  709. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
  710. #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
  711. #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
  712. #define __Pyx_PyBytes_FromString PyBytes_FromString
  713. #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
  714. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
  715. #if PY_MAJOR_VERSION < 3
  716. #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
  717. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
  718. #else
  719. #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
  720. #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
  721. #endif
  722. #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
  723. #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
  724. #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
  725. #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
  726. #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
  727. #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
  728. #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
  729. #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
  730. #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
  731. #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
  732. #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
  733. #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
  734. #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
  735. #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
  736. #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
  737. #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
  738. static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
  739. const Py_UNICODE *u_end = u;
  740. while (*u_end++) ;
  741. return (size_t)(u_end - u - 1);
  742. }
  743. #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
  744. #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
  745. #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
  746. #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
  747. #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
  748. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
  749. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
  750. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
  751. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
  752. #define __Pyx_PySequence_Tuple(obj)\
  753. (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
  754. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
  755. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
  756. #if CYTHON_ASSUME_SAFE_MACROS
  757. #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
  758. #else
  759. #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
  760. #endif
  761. #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
  762. #if PY_MAJOR_VERSION >= 3
  763. #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
  764. #else
  765. #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
  766. #endif
  767. #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
  768. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  769. static int __Pyx_sys_getdefaultencoding_not_ascii;
  770. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  771. PyObject* sys;
  772. PyObject* default_encoding = NULL;
  773. PyObject* ascii_chars_u = NULL;
  774. PyObject* ascii_chars_b = NULL;
  775. const char* default_encoding_c;
  776. sys = PyImport_ImportModule("sys");
  777. if (!sys) goto bad;
  778. default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
  779. Py_DECREF(sys);
  780. if (!default_encoding) goto bad;
  781. default_encoding_c = PyBytes_AsString(default_encoding);
  782. if (!default_encoding_c) goto bad;
  783. if (strcmp(default_encoding_c, "ascii") == 0) {
  784. __Pyx_sys_getdefaultencoding_not_ascii = 0;
  785. } else {
  786. char ascii_chars[128];
  787. int c;
  788. for (c = 0; c < 128; c++) {
  789. ascii_chars[c] = c;
  790. }
  791. __Pyx_sys_getdefaultencoding_not_ascii = 1;
  792. ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
  793. if (!ascii_chars_u) goto bad;
  794. ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
  795. if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
  796. PyErr_Format(
  797. PyExc_ValueError,
  798. "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
  799. default_encoding_c);
  800. goto bad;
  801. }
  802. Py_DECREF(ascii_chars_u);
  803. Py_DECREF(ascii_chars_b);
  804. }
  805. Py_DECREF(default_encoding);
  806. return 0;
  807. bad:
  808. Py_XDECREF(default_encoding);
  809. Py_XDECREF(ascii_chars_u);
  810. Py_XDECREF(ascii_chars_b);
  811. return -1;
  812. }
  813. #endif
  814. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
  815. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
  816. #else
  817. #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
  818. #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  819. static char* __PYX_DEFAULT_STRING_ENCODING;
  820. static int __Pyx_init_sys_getdefaultencoding_params(void) {
  821. PyObject* sys;
  822. PyObject* default_encoding = NULL;
  823. char* default_encoding_c;
  824. sys = PyImport_ImportModule("sys");
  825. if (!sys) goto bad;
  826. default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
  827. Py_DECREF(sys);
  828. if (!default_encoding) goto bad;
  829. default_encoding_c = PyBytes_AsString(default_encoding);
  830. if (!default_encoding_c) goto bad;
  831. __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
  832. if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
  833. strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
  834. Py_DECREF(default_encoding);
  835. return 0;
  836. bad:
  837. Py_XDECREF(default_encoding);
  838. return -1;
  839. }
  840. #endif
  841. #endif
  842. /* Test for GCC > 2.95 */
  843. #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  844. #define likely(x) __builtin_expect(!!(x), 1)
  845. #define unlikely(x) __builtin_expect(!!(x), 0)
  846. #else /* !__GNUC__ or GCC < 2.95 */
  847. #define likely(x) (x)
  848. #define unlikely(x) (x)
  849. #endif /* __GNUC__ */
  850. static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
  851. static PyObject *__pyx_m = NULL;
  852. static PyObject *__pyx_d;
  853. static PyObject *__pyx_b;
  854. static PyObject *__pyx_cython_runtime = NULL;
  855. static PyObject *__pyx_empty_tuple;
  856. static PyObject *__pyx_empty_bytes;
  857. static PyObject *__pyx_empty_unicode;
  858. static int __pyx_lineno;
  859. static int __pyx_clineno = 0;
  860. static const char * __pyx_cfilenm= __FILE__;
  861. static const char *__pyx_filename;
  862. /* Header.proto */
  863. #if !defined(CYTHON_CCOMPLEX)
  864. #if defined(__cplusplus)
  865. #define CYTHON_CCOMPLEX 1
  866. #elif defined(_Complex_I)
  867. #define CYTHON_CCOMPLEX 1
  868. #else
  869. #define CYTHON_CCOMPLEX 0
  870. #endif
  871. #endif
  872. #if CYTHON_CCOMPLEX
  873. #ifdef __cplusplus
  874. #include <complex>
  875. #else
  876. #include <complex.h>
  877. #endif
  878. #endif
  879. #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  880. #undef _Complex_I
  881. #define _Complex_I 1.0fj
  882. #endif
  883. static const char *__pyx_f[] = {
  884. "gedlibpy.pyx",
  885. "stringsource",
  886. "__init__.pxd",
  887. "array.pxd",
  888. "type.pxd",
  889. "bool.pxd",
  890. "complex.pxd",
  891. };
  892. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":776
  893. * # in Cython to enable them only on the right systems.
  894. *
  895. * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
  896. * ctypedef npy_int16 int16_t
  897. * ctypedef npy_int32 int32_t
  898. */
  899. typedef npy_int8 __pyx_t_5numpy_int8_t;
  900. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":777
  901. *
  902. * ctypedef npy_int8 int8_t
  903. * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
  904. * ctypedef npy_int32 int32_t
  905. * ctypedef npy_int64 int64_t
  906. */
  907. typedef npy_int16 __pyx_t_5numpy_int16_t;
  908. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":778
  909. * ctypedef npy_int8 int8_t
  910. * ctypedef npy_int16 int16_t
  911. * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
  912. * ctypedef npy_int64 int64_t
  913. * #ctypedef npy_int96 int96_t
  914. */
  915. typedef npy_int32 __pyx_t_5numpy_int32_t;
  916. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":779
  917. * ctypedef npy_int16 int16_t
  918. * ctypedef npy_int32 int32_t
  919. * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
  920. * #ctypedef npy_int96 int96_t
  921. * #ctypedef npy_int128 int128_t
  922. */
  923. typedef npy_int64 __pyx_t_5numpy_int64_t;
  924. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":783
  925. * #ctypedef npy_int128 int128_t
  926. *
  927. * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
  928. * ctypedef npy_uint16 uint16_t
  929. * ctypedef npy_uint32 uint32_t
  930. */
  931. typedef npy_uint8 __pyx_t_5numpy_uint8_t;
  932. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":784
  933. *
  934. * ctypedef npy_uint8 uint8_t
  935. * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
  936. * ctypedef npy_uint32 uint32_t
  937. * ctypedef npy_uint64 uint64_t
  938. */
  939. typedef npy_uint16 __pyx_t_5numpy_uint16_t;
  940. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":785
  941. * ctypedef npy_uint8 uint8_t
  942. * ctypedef npy_uint16 uint16_t
  943. * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
  944. * ctypedef npy_uint64 uint64_t
  945. * #ctypedef npy_uint96 uint96_t
  946. */
  947. typedef npy_uint32 __pyx_t_5numpy_uint32_t;
  948. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":786
  949. * ctypedef npy_uint16 uint16_t
  950. * ctypedef npy_uint32 uint32_t
  951. * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
  952. * #ctypedef npy_uint96 uint96_t
  953. * #ctypedef npy_uint128 uint128_t
  954. */
  955. typedef npy_uint64 __pyx_t_5numpy_uint64_t;
  956. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":790
  957. * #ctypedef npy_uint128 uint128_t
  958. *
  959. * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
  960. * ctypedef npy_float64 float64_t
  961. * #ctypedef npy_float80 float80_t
  962. */
  963. typedef npy_float32 __pyx_t_5numpy_float32_t;
  964. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":791
  965. *
  966. * ctypedef npy_float32 float32_t
  967. * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
  968. * #ctypedef npy_float80 float80_t
  969. * #ctypedef npy_float128 float128_t
  970. */
  971. typedef npy_float64 __pyx_t_5numpy_float64_t;
  972. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":800
  973. * # The int types are mapped a bit surprising --
  974. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  975. * ctypedef npy_long int_t # <<<<<<<<<<<<<<
  976. * ctypedef npy_longlong long_t
  977. * ctypedef npy_longlong longlong_t
  978. */
  979. typedef npy_long __pyx_t_5numpy_int_t;
  980. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":801
  981. * # numpy.int corresponds to 'l' and numpy.long to 'q'
  982. * ctypedef npy_long int_t
  983. * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
  984. * ctypedef npy_longlong longlong_t
  985. *
  986. */
  987. typedef npy_longlong __pyx_t_5numpy_long_t;
  988. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":802
  989. * ctypedef npy_long int_t
  990. * ctypedef npy_longlong long_t
  991. * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
  992. *
  993. * ctypedef npy_ulong uint_t
  994. */
  995. typedef npy_longlong __pyx_t_5numpy_longlong_t;
  996. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":804
  997. * ctypedef npy_longlong longlong_t
  998. *
  999. * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
  1000. * ctypedef npy_ulonglong ulong_t
  1001. * ctypedef npy_ulonglong ulonglong_t
  1002. */
  1003. typedef npy_ulong __pyx_t_5numpy_uint_t;
  1004. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":805
  1005. *
  1006. * ctypedef npy_ulong uint_t
  1007. * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
  1008. * ctypedef npy_ulonglong ulonglong_t
  1009. *
  1010. */
  1011. typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
  1012. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":806
  1013. * ctypedef npy_ulong uint_t
  1014. * ctypedef npy_ulonglong ulong_t
  1015. * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
  1016. *
  1017. * ctypedef npy_intp intp_t
  1018. */
  1019. typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
  1020. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":808
  1021. * ctypedef npy_ulonglong ulonglong_t
  1022. *
  1023. * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
  1024. * ctypedef npy_uintp uintp_t
  1025. *
  1026. */
  1027. typedef npy_intp __pyx_t_5numpy_intp_t;
  1028. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":809
  1029. *
  1030. * ctypedef npy_intp intp_t
  1031. * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
  1032. *
  1033. * ctypedef npy_double float_t
  1034. */
  1035. typedef npy_uintp __pyx_t_5numpy_uintp_t;
  1036. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":811
  1037. * ctypedef npy_uintp uintp_t
  1038. *
  1039. * ctypedef npy_double float_t # <<<<<<<<<<<<<<
  1040. * ctypedef npy_double double_t
  1041. * ctypedef npy_longdouble longdouble_t
  1042. */
  1043. typedef npy_double __pyx_t_5numpy_float_t;
  1044. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":812
  1045. *
  1046. * ctypedef npy_double float_t
  1047. * ctypedef npy_double double_t # <<<<<<<<<<<<<<
  1048. * ctypedef npy_longdouble longdouble_t
  1049. *
  1050. */
  1051. typedef npy_double __pyx_t_5numpy_double_t;
  1052. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":813
  1053. * ctypedef npy_double float_t
  1054. * ctypedef npy_double double_t
  1055. * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
  1056. *
  1057. * ctypedef npy_cfloat cfloat_t
  1058. */
  1059. typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
  1060. /* "gedlibpy.pyx":39
  1061. * #Long unsigned int equivalent
  1062. * cimport numpy as cnp
  1063. * ctypedef cnp.npy_uint32 UINT32_t # <<<<<<<<<<<<<<
  1064. * from cpython cimport array
  1065. *
  1066. */
  1067. typedef npy_uint32 __pyx_t_8gedlibpy_UINT32_t;
  1068. /* Declarations.proto */
  1069. #if CYTHON_CCOMPLEX
  1070. #ifdef __cplusplus
  1071. typedef ::std::complex< float > __pyx_t_float_complex;
  1072. #else
  1073. typedef float _Complex __pyx_t_float_complex;
  1074. #endif
  1075. #else
  1076. typedef struct { float real, imag; } __pyx_t_float_complex;
  1077. #endif
  1078. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
  1079. /* Declarations.proto */
  1080. #if CYTHON_CCOMPLEX
  1081. #ifdef __cplusplus
  1082. typedef ::std::complex< double > __pyx_t_double_complex;
  1083. #else
  1084. typedef double _Complex __pyx_t_double_complex;
  1085. #endif
  1086. #else
  1087. typedef struct { double real, imag; } __pyx_t_double_complex;
  1088. #endif
  1089. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
  1090. /*--- Type declarations ---*/
  1091. #ifndef _ARRAYARRAY_H
  1092. struct arrayobject;
  1093. typedef struct arrayobject arrayobject;
  1094. #endif
  1095. struct __pyx_obj_8gedlibpy_GEDEnv;
  1096. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":815
  1097. * ctypedef npy_longdouble longdouble_t
  1098. *
  1099. * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
  1100. * ctypedef npy_cdouble cdouble_t
  1101. * ctypedef npy_clongdouble clongdouble_t
  1102. */
  1103. typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
  1104. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":816
  1105. *
  1106. * ctypedef npy_cfloat cfloat_t
  1107. * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
  1108. * ctypedef npy_clongdouble clongdouble_t
  1109. *
  1110. */
  1111. typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
  1112. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":817
  1113. * ctypedef npy_cfloat cfloat_t
  1114. * ctypedef npy_cdouble cdouble_t
  1115. * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
  1116. *
  1117. * ctypedef npy_cdouble complex_t
  1118. */
  1119. typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
  1120. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":819
  1121. * ctypedef npy_clongdouble clongdouble_t
  1122. *
  1123. * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
  1124. *
  1125. * cdef inline object PyArray_MultiIterNew1(a):
  1126. */
  1127. typedef npy_cdouble __pyx_t_5numpy_complex_t;
  1128. /* "gedlibpy.pyx":182
  1129. *
  1130. * # @cython.auto_pickle(True)
  1131. * cdef class GEDEnv: # <<<<<<<<<<<<<<
  1132. * """Cython wrapper class for C++ class PyGEDEnv
  1133. * """
  1134. */
  1135. struct __pyx_obj_8gedlibpy_GEDEnv {
  1136. PyObject_HEAD
  1137. pyged::PyGEDEnv *c_env;
  1138. };
  1139. /* --- Runtime support code (head) --- */
  1140. /* Refnanny.proto */
  1141. #ifndef CYTHON_REFNANNY
  1142. #define CYTHON_REFNANNY 0
  1143. #endif
  1144. #if CYTHON_REFNANNY
  1145. typedef struct {
  1146. void (*INCREF)(void*, PyObject*, int);
  1147. void (*DECREF)(void*, PyObject*, int);
  1148. void (*GOTREF)(void*, PyObject*, int);
  1149. void (*GIVEREF)(void*, PyObject*, int);
  1150. void* (*SetupContext)(const char*, int, const char*);
  1151. void (*FinishContext)(void**);
  1152. } __Pyx_RefNannyAPIStruct;
  1153. static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  1154. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  1155. #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
  1156. #ifdef WITH_THREAD
  1157. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1158. if (acquire_gil) {\
  1159. PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
  1160. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  1161. PyGILState_Release(__pyx_gilstate_save);\
  1162. } else {\
  1163. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
  1164. }
  1165. #else
  1166. #define __Pyx_RefNannySetupContext(name, acquire_gil)\
  1167. __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
  1168. #endif
  1169. #define __Pyx_RefNannyFinishContext()\
  1170. __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  1171. #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1172. #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1173. #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1174. #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  1175. #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  1176. #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  1177. #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  1178. #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
  1179. #else
  1180. #define __Pyx_RefNannyDeclarations
  1181. #define __Pyx_RefNannySetupContext(name, acquire_gil)
  1182. #define __Pyx_RefNannyFinishContext()
  1183. #define __Pyx_INCREF(r) Py_INCREF(r)
  1184. #define __Pyx_DECREF(r) Py_DECREF(r)
  1185. #define __Pyx_GOTREF(r)
  1186. #define __Pyx_GIVEREF(r)
  1187. #define __Pyx_XINCREF(r) Py_XINCREF(r)
  1188. #define __Pyx_XDECREF(r) Py_XDECREF(r)
  1189. #define __Pyx_XGOTREF(r)
  1190. #define __Pyx_XGIVEREF(r)
  1191. #endif
  1192. #define __Pyx_XDECREF_SET(r, v) do {\
  1193. PyObject *tmp = (PyObject *) r;\
  1194. r = v; __Pyx_XDECREF(tmp);\
  1195. } while (0)
  1196. #define __Pyx_DECREF_SET(r, v) do {\
  1197. PyObject *tmp = (PyObject *) r;\
  1198. r = v; __Pyx_DECREF(tmp);\
  1199. } while (0)
  1200. #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
  1201. #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
  1202. /* PyObjectGetAttrStr.proto */
  1203. #if CYTHON_USE_TYPE_SLOTS
  1204. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
  1205. #else
  1206. #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
  1207. #endif
  1208. /* GetBuiltinName.proto */
  1209. static PyObject *__Pyx_GetBuiltinName(PyObject *name);
  1210. /* ListCompAppend.proto */
  1211. #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
  1212. static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
  1213. PyListObject* L = (PyListObject*) list;
  1214. Py_ssize_t len = Py_SIZE(list);
  1215. if (likely(L->allocated > len)) {
  1216. Py_INCREF(x);
  1217. PyList_SET_ITEM(list, len, x);
  1218. Py_SIZE(list) = len+1;
  1219. return 0;
  1220. }
  1221. return PyList_Append(list, x);
  1222. }
  1223. #else
  1224. #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
  1225. #endif
  1226. /* IncludeCppStringH.proto */
  1227. #include <string>
  1228. /* decode_c_string_utf16.proto */
  1229. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
  1230. int byteorder = 0;
  1231. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1232. }
  1233. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
  1234. int byteorder = -1;
  1235. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1236. }
  1237. static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
  1238. int byteorder = 1;
  1239. return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
  1240. }
  1241. /* decode_c_bytes.proto */
  1242. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  1243. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  1244. const char* encoding, const char* errors,
  1245. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
  1246. /* decode_cpp_string.proto */
  1247. static CYTHON_INLINE PyObject* __Pyx_decode_cpp_string(
  1248. std::string cppstring, Py_ssize_t start, Py_ssize_t stop,
  1249. const char* encoding, const char* errors,
  1250. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  1251. return __Pyx_decode_c_bytes(
  1252. cppstring.data(), cppstring.size(), start, stop, encoding, errors, decode_func);
  1253. }
  1254. /* RaiseArgTupleInvalid.proto */
  1255. static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
  1256. Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
  1257. /* KeywordStringCheck.proto */
  1258. static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
  1259. /* RaiseDoubleKeywords.proto */
  1260. static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
  1261. /* ParseKeywords.proto */
  1262. static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
  1263. PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
  1264. const char* function_name);
  1265. /* PyCFunctionFastCall.proto */
  1266. #if CYTHON_FAST_PYCCALL
  1267. static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
  1268. #else
  1269. #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
  1270. #endif
  1271. /* PyFunctionFastCall.proto */
  1272. #if CYTHON_FAST_PYCALL
  1273. #define __Pyx_PyFunction_FastCall(func, args, nargs)\
  1274. __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
  1275. #if 1 || PY_VERSION_HEX < 0x030600B1
  1276. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
  1277. #else
  1278. #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
  1279. #endif
  1280. #define __Pyx_BUILD_ASSERT_EXPR(cond)\
  1281. (sizeof(char [1 - 2*!(cond)]) - 1)
  1282. #ifndef Py_MEMBER_SIZE
  1283. #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
  1284. #endif
  1285. static size_t __pyx_pyframe_localsplus_offset = 0;
  1286. #include "frameobject.h"
  1287. #define __Pxy_PyFrame_Initialize_Offsets()\
  1288. ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
  1289. (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  1290. #define __Pyx_PyFrame_GetLocalsplus(frame)\
  1291. (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
  1292. #endif
  1293. /* PyObjectCall.proto */
  1294. #if CYTHON_COMPILING_IN_CPYTHON
  1295. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
  1296. #else
  1297. #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
  1298. #endif
  1299. /* PyObjectCall2Args.proto */
  1300. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
  1301. /* PyObjectCallMethO.proto */
  1302. #if CYTHON_COMPILING_IN_CPYTHON
  1303. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
  1304. #endif
  1305. /* PyObjectCallOneArg.proto */
  1306. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
  1307. /* PyDictVersioning.proto */
  1308. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  1309. #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
  1310. #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
  1311. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
  1312. (version_var) = __PYX_GET_DICT_VERSION(dict);\
  1313. (cache_var) = (value);
  1314. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
  1315. static PY_UINT64_T __pyx_dict_version = 0;\
  1316. static PyObject *__pyx_dict_cached_value = NULL;\
  1317. if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
  1318. (VAR) = __pyx_dict_cached_value;\
  1319. } else {\
  1320. (VAR) = __pyx_dict_cached_value = (LOOKUP);\
  1321. __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
  1322. }\
  1323. }
  1324. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
  1325. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
  1326. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
  1327. #else
  1328. #define __PYX_GET_DICT_VERSION(dict) (0)
  1329. #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
  1330. #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
  1331. #endif
  1332. /* GetModuleGlobalName.proto */
  1333. #if CYTHON_USE_DICT_VERSIONS
  1334. #define __Pyx_GetModuleGlobalName(var, name) {\
  1335. static PY_UINT64_T __pyx_dict_version = 0;\
  1336. static PyObject *__pyx_dict_cached_value = NULL;\
  1337. (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
  1338. (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
  1339. __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1340. }
  1341. #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
  1342. PY_UINT64_T __pyx_dict_version;\
  1343. PyObject *__pyx_dict_cached_value;\
  1344. (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
  1345. }
  1346. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
  1347. #else
  1348. #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1349. #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
  1350. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
  1351. #endif
  1352. /* PySequenceContains.proto */
  1353. static CYTHON_INLINE int __Pyx_PySequence_ContainsTF(PyObject* item, PyObject* seq, int eq) {
  1354. int result = PySequence_Contains(seq, item);
  1355. return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
  1356. }
  1357. /* PyThreadStateGet.proto */
  1358. #if CYTHON_FAST_THREAD_STATE
  1359. #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
  1360. #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
  1361. #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
  1362. #else
  1363. #define __Pyx_PyThreadState_declare
  1364. #define __Pyx_PyThreadState_assign
  1365. #define __Pyx_PyErr_Occurred() PyErr_Occurred()
  1366. #endif
  1367. /* PyErrFetchRestore.proto */
  1368. #if CYTHON_FAST_THREAD_STATE
  1369. #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
  1370. #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
  1371. #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
  1372. #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
  1373. #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
  1374. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1375. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1376. #if CYTHON_COMPILING_IN_CPYTHON
  1377. #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
  1378. #else
  1379. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1380. #endif
  1381. #else
  1382. #define __Pyx_PyErr_Clear() PyErr_Clear()
  1383. #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
  1384. #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
  1385. #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
  1386. #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
  1387. #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
  1388. #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
  1389. #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
  1390. #endif
  1391. /* RaiseException.proto */
  1392. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
  1393. /* GetItemInt.proto */
  1394. #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1395. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1396. __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
  1397. (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
  1398. __Pyx_GetItemInt_Generic(o, to_py_func(i))))
  1399. #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1400. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1401. __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  1402. (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
  1403. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  1404. int wraparound, int boundscheck);
  1405. #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
  1406. (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
  1407. __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
  1408. (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
  1409. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  1410. int wraparound, int boundscheck);
  1411. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
  1412. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
  1413. int is_list, int wraparound, int boundscheck);
  1414. /* ObjectGetItem.proto */
  1415. #if CYTHON_USE_TYPE_SLOTS
  1416. static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
  1417. #else
  1418. #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
  1419. #endif
  1420. /* PyObjectCallNoArg.proto */
  1421. #if CYTHON_COMPILING_IN_CPYTHON
  1422. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
  1423. #else
  1424. #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
  1425. #endif
  1426. /* IterFinish.proto */
  1427. static CYTHON_INLINE int __Pyx_IterFinish(void);
  1428. /* PyObjectGetMethod.proto */
  1429. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);
  1430. /* PyObjectCallMethod0.proto */
  1431. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);
  1432. /* RaiseNeedMoreValuesToUnpack.proto */
  1433. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
  1434. /* RaiseTooManyValuesToUnpack.proto */
  1435. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
  1436. /* UnpackItemEndCheck.proto */
  1437. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
  1438. /* RaiseNoneIterError.proto */
  1439. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
  1440. /* UnpackTupleError.proto */
  1441. static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);
  1442. /* UnpackTuple2.proto */
  1443. #define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
  1444. (likely(is_tuple || PyTuple_Check(tuple)) ?\
  1445. (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
  1446. __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
  1447. (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
  1448. __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
  1449. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  1450. PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
  1451. static int __Pyx_unpack_tuple2_generic(
  1452. PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);
  1453. /* dict_iter.proto */
  1454. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
  1455. Py_ssize_t* p_orig_length, int* p_is_dict);
  1456. static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
  1457. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);
  1458. /* PyIntBinop.proto */
  1459. #if !CYTHON_COMPILING_IN_PYPY
  1460. static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
  1461. #else
  1462. #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
  1463. (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
  1464. #endif
  1465. /* PyObjectSetAttrStr.proto */
  1466. #if CYTHON_USE_TYPE_SLOTS
  1467. #define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
  1468. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
  1469. #else
  1470. #define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
  1471. #define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
  1472. #endif
  1473. /* DictGetItem.proto */
  1474. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  1475. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
  1476. #define __Pyx_PyObject_Dict_GetItem(obj, name)\
  1477. (likely(PyDict_CheckExact(obj)) ?\
  1478. __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
  1479. #else
  1480. #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
  1481. #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
  1482. #endif
  1483. /* ExtTypeTest.proto */
  1484. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
  1485. /* GetTopmostException.proto */
  1486. #if CYTHON_USE_EXC_INFO_STACK
  1487. static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
  1488. #endif
  1489. /* SaveResetException.proto */
  1490. #if CYTHON_FAST_THREAD_STATE
  1491. #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
  1492. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1493. #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
  1494. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
  1495. #else
  1496. #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
  1497. #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
  1498. #endif
  1499. /* PyErrExceptionMatches.proto */
  1500. #if CYTHON_FAST_THREAD_STATE
  1501. #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
  1502. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
  1503. #else
  1504. #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
  1505. #endif
  1506. /* GetException.proto */
  1507. #if CYTHON_FAST_THREAD_STATE
  1508. #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
  1509. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
  1510. #else
  1511. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
  1512. #endif
  1513. /* PyObject_GenericGetAttrNoDict.proto */
  1514. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1515. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
  1516. #else
  1517. #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
  1518. #endif
  1519. /* PyObject_GenericGetAttr.proto */
  1520. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  1521. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
  1522. #else
  1523. #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
  1524. #endif
  1525. /* SetupReduce.proto */
  1526. static int __Pyx_setup_reduce(PyObject* type_obj);
  1527. /* TypeImport.proto */
  1528. #ifndef __PYX_HAVE_RT_ImportType_proto
  1529. #define __PYX_HAVE_RT_ImportType_proto
  1530. enum __Pyx_ImportType_CheckSize {
  1531. __Pyx_ImportType_CheckSize_Error = 0,
  1532. __Pyx_ImportType_CheckSize_Warn = 1,
  1533. __Pyx_ImportType_CheckSize_Ignore = 2
  1534. };
  1535. static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
  1536. #endif
  1537. /* Import.proto */
  1538. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
  1539. /* ImportFrom.proto */
  1540. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
  1541. /* CalculateMetaclass.proto */
  1542. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
  1543. /* Py3ClassCreate.proto */
  1544. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
  1545. PyObject *mkw, PyObject *modname, PyObject *doc);
  1546. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
  1547. PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);
  1548. /* FetchCommonType.proto */
  1549. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
  1550. /* CythonFunction.proto */
  1551. #define __Pyx_CyFunction_USED 1
  1552. #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
  1553. #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
  1554. #define __Pyx_CYFUNCTION_CCLASS 0x04
  1555. #define __Pyx_CyFunction_GetClosure(f)\
  1556. (((__pyx_CyFunctionObject *) (f))->func_closure)
  1557. #define __Pyx_CyFunction_GetClassObj(f)\
  1558. (((__pyx_CyFunctionObject *) (f))->func_classobj)
  1559. #define __Pyx_CyFunction_Defaults(type, f)\
  1560. ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
  1561. #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
  1562. ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
  1563. typedef struct {
  1564. PyCFunctionObject func;
  1565. #if PY_VERSION_HEX < 0x030500A0
  1566. PyObject *func_weakreflist;
  1567. #endif
  1568. PyObject *func_dict;
  1569. PyObject *func_name;
  1570. PyObject *func_qualname;
  1571. PyObject *func_doc;
  1572. PyObject *func_globals;
  1573. PyObject *func_code;
  1574. PyObject *func_closure;
  1575. PyObject *func_classobj;
  1576. void *defaults;
  1577. int defaults_pyobjects;
  1578. size_t defaults_size; // used by FusedFunction for copying defaults
  1579. int flags;
  1580. PyObject *defaults_tuple;
  1581. PyObject *defaults_kwdict;
  1582. PyObject *(*defaults_getter)(PyObject *);
  1583. PyObject *func_annotations;
  1584. } __pyx_CyFunctionObject;
  1585. static PyTypeObject *__pyx_CyFunctionType = 0;
  1586. #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
  1587. #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
  1588. __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
  1589. static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
  1590. int flags, PyObject* qualname,
  1591. PyObject *self,
  1592. PyObject *module, PyObject *globals,
  1593. PyObject* code);
  1594. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
  1595. size_t size,
  1596. int pyobjects);
  1597. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
  1598. PyObject *tuple);
  1599. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
  1600. PyObject *dict);
  1601. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
  1602. PyObject *dict);
  1603. static int __pyx_CyFunction_init(void);
  1604. /* SetNameInClass.proto */
  1605. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  1606. #define __Pyx_SetNameInClass(ns, name, value)\
  1607. (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
  1608. #elif CYTHON_COMPILING_IN_CPYTHON
  1609. #define __Pyx_SetNameInClass(ns, name, value)\
  1610. (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
  1611. #else
  1612. #define __Pyx_SetNameInClass(ns, name, value) PyObject_SetItem(ns, name, value)
  1613. #endif
  1614. /* CLineInTraceback.proto */
  1615. #ifdef CYTHON_CLINE_IN_TRACEBACK
  1616. #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
  1617. #else
  1618. static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
  1619. #endif
  1620. /* CodeObjectCache.proto */
  1621. typedef struct {
  1622. PyCodeObject* code_object;
  1623. int code_line;
  1624. } __Pyx_CodeObjectCacheEntry;
  1625. struct __Pyx_CodeObjectCache {
  1626. int count;
  1627. int max_count;
  1628. __Pyx_CodeObjectCacheEntry* entries;
  1629. };
  1630. static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
  1631. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
  1632. static PyCodeObject *__pyx_find_code_object(int code_line);
  1633. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
  1634. /* AddTraceback.proto */
  1635. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  1636. int py_line, const char *filename);
  1637. /* ArrayAPI.proto */
  1638. #ifndef _ARRAYARRAY_H
  1639. #define _ARRAYARRAY_H
  1640. typedef struct arraydescr {
  1641. int typecode;
  1642. int itemsize;
  1643. PyObject * (*getitem)(struct arrayobject *, Py_ssize_t);
  1644. int (*setitem)(struct arrayobject *, Py_ssize_t, PyObject *);
  1645. #if PY_MAJOR_VERSION >= 3
  1646. char *formats;
  1647. #endif
  1648. } arraydescr;
  1649. struct arrayobject {
  1650. PyObject_HEAD
  1651. Py_ssize_t ob_size;
  1652. union {
  1653. char *ob_item;
  1654. float *as_floats;
  1655. double *as_doubles;
  1656. int *as_ints;
  1657. unsigned int *as_uints;
  1658. unsigned char *as_uchars;
  1659. signed char *as_schars;
  1660. char *as_chars;
  1661. unsigned long *as_ulongs;
  1662. long *as_longs;
  1663. #if PY_MAJOR_VERSION >= 3
  1664. unsigned long long *as_ulonglongs;
  1665. long long *as_longlongs;
  1666. #endif
  1667. short *as_shorts;
  1668. unsigned short *as_ushorts;
  1669. Py_UNICODE *as_pyunicodes;
  1670. void *as_voidptr;
  1671. } data;
  1672. Py_ssize_t allocated;
  1673. struct arraydescr *ob_descr;
  1674. PyObject *weakreflist;
  1675. #if PY_MAJOR_VERSION >= 3
  1676. int ob_exports;
  1677. #endif
  1678. };
  1679. #ifndef NO_NEWARRAY_INLINE
  1680. static CYTHON_INLINE PyObject * newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1681. struct arraydescr *descr) {
  1682. arrayobject *op;
  1683. size_t nbytes;
  1684. if (size < 0) {
  1685. PyErr_BadInternalCall();
  1686. return NULL;
  1687. }
  1688. nbytes = size * descr->itemsize;
  1689. if (nbytes / descr->itemsize != (size_t)size) {
  1690. return PyErr_NoMemory();
  1691. }
  1692. op = (arrayobject *) type->tp_alloc(type, 0);
  1693. if (op == NULL) {
  1694. return NULL;
  1695. }
  1696. op->ob_descr = descr;
  1697. op->allocated = size;
  1698. op->weakreflist = NULL;
  1699. op->ob_size = size;
  1700. if (size <= 0) {
  1701. op->data.ob_item = NULL;
  1702. }
  1703. else {
  1704. op->data.ob_item = PyMem_NEW(char, nbytes);
  1705. if (op->data.ob_item == NULL) {
  1706. Py_DECREF(op);
  1707. return PyErr_NoMemory();
  1708. }
  1709. }
  1710. return (PyObject *) op;
  1711. }
  1712. #else
  1713. PyObject* newarrayobject(PyTypeObject *type, Py_ssize_t size,
  1714. struct arraydescr *descr);
  1715. #endif
  1716. static CYTHON_INLINE int resize(arrayobject *self, Py_ssize_t n) {
  1717. void *items = (void*) self->data.ob_item;
  1718. PyMem_Resize(items, char, (size_t)(n * self->ob_descr->itemsize));
  1719. if (items == NULL) {
  1720. PyErr_NoMemory();
  1721. return -1;
  1722. }
  1723. self->data.ob_item = (char*) items;
  1724. self->ob_size = n;
  1725. self->allocated = n;
  1726. return 0;
  1727. }
  1728. static CYTHON_INLINE int resize_smart(arrayobject *self, Py_ssize_t n) {
  1729. void *items = (void*) self->data.ob_item;
  1730. Py_ssize_t newsize;
  1731. if (n < self->allocated && n*4 > self->allocated) {
  1732. self->ob_size = n;
  1733. return 0;
  1734. }
  1735. newsize = n + (n / 2) + 1;
  1736. if (newsize <= n) {
  1737. PyErr_NoMemory();
  1738. return -1;
  1739. }
  1740. PyMem_Resize(items, char, (size_t)(newsize * self->ob_descr->itemsize));
  1741. if (items == NULL) {
  1742. PyErr_NoMemory();
  1743. return -1;
  1744. }
  1745. self->data.ob_item = (char*) items;
  1746. self->ob_size = n;
  1747. self->allocated = newsize;
  1748. return 0;
  1749. }
  1750. #endif
  1751. /* CppExceptionConversion.proto */
  1752. #ifndef __Pyx_CppExn2PyErr
  1753. #include <new>
  1754. #include <typeinfo>
  1755. #include <stdexcept>
  1756. #include <ios>
  1757. static void __Pyx_CppExn2PyErr() {
  1758. try {
  1759. if (PyErr_Occurred())
  1760. ; // let the latest Python exn pass through and ignore the current one
  1761. else
  1762. throw;
  1763. } catch (const std::bad_alloc& exn) {
  1764. PyErr_SetString(PyExc_MemoryError, exn.what());
  1765. } catch (const std::bad_cast& exn) {
  1766. PyErr_SetString(PyExc_TypeError, exn.what());
  1767. } catch (const std::bad_typeid& exn) {
  1768. PyErr_SetString(PyExc_TypeError, exn.what());
  1769. } catch (const std::domain_error& exn) {
  1770. PyErr_SetString(PyExc_ValueError, exn.what());
  1771. } catch (const std::invalid_argument& exn) {
  1772. PyErr_SetString(PyExc_ValueError, exn.what());
  1773. } catch (const std::ios_base::failure& exn) {
  1774. PyErr_SetString(PyExc_IOError, exn.what());
  1775. } catch (const std::out_of_range& exn) {
  1776. PyErr_SetString(PyExc_IndexError, exn.what());
  1777. } catch (const std::overflow_error& exn) {
  1778. PyErr_SetString(PyExc_OverflowError, exn.what());
  1779. } catch (const std::range_error& exn) {
  1780. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1781. } catch (const std::underflow_error& exn) {
  1782. PyErr_SetString(PyExc_ArithmeticError, exn.what());
  1783. } catch (const std::exception& exn) {
  1784. PyErr_SetString(PyExc_RuntimeError, exn.what());
  1785. }
  1786. catch (...)
  1787. {
  1788. PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  1789. }
  1790. }
  1791. #endif
  1792. /* CIntToPy.proto */
  1793. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value);
  1794. /* CIntToPy.proto */
  1795. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
  1796. /* CIntToPy.proto */
  1797. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
  1798. /* RealImag.proto */
  1799. #if CYTHON_CCOMPLEX
  1800. #ifdef __cplusplus
  1801. #define __Pyx_CREAL(z) ((z).real())
  1802. #define __Pyx_CIMAG(z) ((z).imag())
  1803. #else
  1804. #define __Pyx_CREAL(z) (__real__(z))
  1805. #define __Pyx_CIMAG(z) (__imag__(z))
  1806. #endif
  1807. #else
  1808. #define __Pyx_CREAL(z) ((z).real)
  1809. #define __Pyx_CIMAG(z) ((z).imag)
  1810. #endif
  1811. #if defined(__cplusplus) && CYTHON_CCOMPLEX\
  1812. && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
  1813. #define __Pyx_SET_CREAL(z,x) ((z).real(x))
  1814. #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
  1815. #else
  1816. #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
  1817. #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
  1818. #endif
  1819. /* Arithmetic.proto */
  1820. #if CYTHON_CCOMPLEX
  1821. #define __Pyx_c_eq_float(a, b) ((a)==(b))
  1822. #define __Pyx_c_sum_float(a, b) ((a)+(b))
  1823. #define __Pyx_c_diff_float(a, b) ((a)-(b))
  1824. #define __Pyx_c_prod_float(a, b) ((a)*(b))
  1825. #define __Pyx_c_quot_float(a, b) ((a)/(b))
  1826. #define __Pyx_c_neg_float(a) (-(a))
  1827. #ifdef __cplusplus
  1828. #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
  1829. #define __Pyx_c_conj_float(z) (::std::conj(z))
  1830. #if 1
  1831. #define __Pyx_c_abs_float(z) (::std::abs(z))
  1832. #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
  1833. #endif
  1834. #else
  1835. #define __Pyx_c_is_zero_float(z) ((z)==0)
  1836. #define __Pyx_c_conj_float(z) (conjf(z))
  1837. #if 1
  1838. #define __Pyx_c_abs_float(z) (cabsf(z))
  1839. #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
  1840. #endif
  1841. #endif
  1842. #else
  1843. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1844. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1845. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1846. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1847. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1848. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
  1849. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
  1850. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
  1851. #if 1
  1852. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
  1853. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
  1854. #endif
  1855. #endif
  1856. /* Arithmetic.proto */
  1857. #if CYTHON_CCOMPLEX
  1858. #define __Pyx_c_eq_double(a, b) ((a)==(b))
  1859. #define __Pyx_c_sum_double(a, b) ((a)+(b))
  1860. #define __Pyx_c_diff_double(a, b) ((a)-(b))
  1861. #define __Pyx_c_prod_double(a, b) ((a)*(b))
  1862. #define __Pyx_c_quot_double(a, b) ((a)/(b))
  1863. #define __Pyx_c_neg_double(a) (-(a))
  1864. #ifdef __cplusplus
  1865. #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
  1866. #define __Pyx_c_conj_double(z) (::std::conj(z))
  1867. #if 1
  1868. #define __Pyx_c_abs_double(z) (::std::abs(z))
  1869. #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
  1870. #endif
  1871. #else
  1872. #define __Pyx_c_is_zero_double(z) ((z)==0)
  1873. #define __Pyx_c_conj_double(z) (conj(z))
  1874. #if 1
  1875. #define __Pyx_c_abs_double(z) (cabs(z))
  1876. #define __Pyx_c_pow_double(a, b) (cpow(a, b))
  1877. #endif
  1878. #endif
  1879. #else
  1880. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1881. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1882. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1883. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1884. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1885. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
  1886. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
  1887. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
  1888. #if 1
  1889. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
  1890. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
  1891. #endif
  1892. #endif
  1893. /* CIntToPy.proto */
  1894. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
  1895. /* CIntFromPy.proto */
  1896. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);
  1897. /* CIntFromPy.proto */
  1898. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
  1899. /* CIntFromPy.proto */
  1900. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
  1901. /* FastTypeChecks.proto */
  1902. #if CYTHON_COMPILING_IN_CPYTHON
  1903. #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
  1904. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
  1905. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
  1906. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
  1907. #else
  1908. #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
  1909. #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
  1910. #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
  1911. #endif
  1912. #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
  1913. /* CStringEquals.proto */
  1914. static CYTHON_INLINE int __Pyx_StrEq(const char *, const char *);
  1915. /* CheckBinaryVersion.proto */
  1916. static int __Pyx_check_binary_version(void);
  1917. /* InitStrings.proto */
  1918. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
  1919. /* Module declarations from 'libcpp.vector' */
  1920. /* Module declarations from 'libc.string' */
  1921. /* Module declarations from 'libcpp.string' */
  1922. /* Module declarations from 'libcpp.utility' */
  1923. /* Module declarations from 'libcpp.map' */
  1924. /* Module declarations from 'libcpp' */
  1925. /* Module declarations from 'libcpp.pair' */
  1926. /* Module declarations from 'libcpp.list' */
  1927. /* Module declarations from 'cpython.buffer' */
  1928. /* Module declarations from 'libc.stdio' */
  1929. /* Module declarations from '__builtin__' */
  1930. /* Module declarations from 'cpython.type' */
  1931. static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
  1932. /* Module declarations from 'cpython.version' */
  1933. /* Module declarations from 'cpython.exc' */
  1934. /* Module declarations from 'cpython.module' */
  1935. /* Module declarations from 'cpython.mem' */
  1936. /* Module declarations from 'cpython.tuple' */
  1937. /* Module declarations from 'cpython.list' */
  1938. /* Module declarations from 'cpython.sequence' */
  1939. /* Module declarations from 'cpython.mapping' */
  1940. /* Module declarations from 'cpython.iterator' */
  1941. /* Module declarations from 'cpython.number' */
  1942. /* Module declarations from 'cpython.int' */
  1943. /* Module declarations from '__builtin__' */
  1944. /* Module declarations from 'cpython.bool' */
  1945. static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
  1946. /* Module declarations from 'cpython.long' */
  1947. /* Module declarations from 'cpython.float' */
  1948. /* Module declarations from '__builtin__' */
  1949. /* Module declarations from 'cpython.complex' */
  1950. static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
  1951. /* Module declarations from 'cpython.string' */
  1952. /* Module declarations from 'cpython.unicode' */
  1953. /* Module declarations from 'cpython.dict' */
  1954. /* Module declarations from 'cpython.instance' */
  1955. /* Module declarations from 'cpython.function' */
  1956. /* Module declarations from 'cpython.method' */
  1957. /* Module declarations from 'cpython.weakref' */
  1958. /* Module declarations from 'cpython.getargs' */
  1959. /* Module declarations from 'cpython.pythread' */
  1960. /* Module declarations from 'cpython.pystate' */
  1961. /* Module declarations from 'cpython.cobject' */
  1962. /* Module declarations from 'cpython.oldbuffer' */
  1963. /* Module declarations from 'cpython.set' */
  1964. /* Module declarations from 'cpython.bytes' */
  1965. /* Module declarations from 'cpython.pycapsule' */
  1966. /* Module declarations from 'cpython' */
  1967. /* Module declarations from 'cpython.object' */
  1968. /* Module declarations from 'cpython.ref' */
  1969. /* Module declarations from 'numpy' */
  1970. /* Module declarations from 'numpy' */
  1971. static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
  1972. static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
  1973. static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
  1974. static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
  1975. static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
  1976. static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
  1977. /* Module declarations from 'array' */
  1978. /* Module declarations from 'cpython.array' */
  1979. static PyTypeObject *__pyx_ptype_7cpython_5array_array = 0;
  1980. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *, char *, Py_ssize_t); /*proto*/
  1981. /* Module declarations from 'cython' */
  1982. /* Module declarations from 'gedlibpy' */
  1983. static PyTypeObject *__pyx_ptype_8gedlibpy_GEDEnv = 0;
  1984. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
  1985. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
  1986. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
  1987. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
  1988. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
  1989. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
  1990. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &); /*proto*/
  1991. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &); /*proto*/
  1992. static std::map<std::string,std::string> __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
  1993. static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(std::map<std::string,std::string> const &); /*proto*/
  1994. 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*/
  1995. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(const std::vector<std::vector<size_t> > &); /*proto*/
  1996. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1997. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &); /*proto*/
  1998. 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*/
  1999. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &); /*proto*/
  2000. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &); /*proto*/
  2001. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(const std::vector<std::vector<npy_uint64> > &); /*proto*/
  2002. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *); /*proto*/
  2003. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *); /*proto*/
  2004. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *); /*proto*/
  2005. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &); /*proto*/
  2006. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &); /*proto*/
  2007. 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*/
  2008. static std::pair<size_t,size_t> __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *); /*proto*/
  2009. static std::vector<std::pair<size_t,size_t> > __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(PyObject *); /*proto*/
  2010. #define __Pyx_MODULE_NAME "gedlibpy"
  2011. extern int __pyx_module_is_main_gedlibpy;
  2012. int __pyx_module_is_main_gedlibpy = 0;
  2013. /* Implementation of 'gedlibpy' */
  2014. static PyObject *__pyx_builtin_range;
  2015. static PyObject *__pyx_builtin_print;
  2016. static PyObject *__pyx_builtin_enumerate;
  2017. static PyObject *__pyx_builtin_TypeError;
  2018. static PyObject *__pyx_builtin_ValueError;
  2019. static PyObject *__pyx_builtin_RuntimeError;
  2020. static PyObject *__pyx_builtin_ImportError;
  2021. static PyObject *__pyx_builtin_MemoryError;
  2022. static const char __pyx_k_[] = "";
  2023. static const char __pyx_k_g[] = "g";
  2024. static const char __pyx_k_h[] = "h";
  2025. static const char __pyx_k_g1[] = "g1";
  2026. static const char __pyx_k_g2[] = "g2";
  2027. static const char __pyx_k_id[] = "id";
  2028. static const char __pyx_k_np[] = "np";
  2029. static const char __pyx_k_nx[] = "nx";
  2030. static const char __pyx_k_os[] = "os";
  2031. static const char __pyx_k__20[] = "*";
  2032. static const char __pyx_k_doc[] = "__doc__";
  2033. static const char __pyx_k_inf[] = "inf";
  2034. static const char __pyx_k_key[] = "key";
  2035. static const char __pyx_k_res[] = "res";
  2036. static const char __pyx_k_cdll[] = "cdll";
  2037. static const char __pyx_k_file[] = "__file__";
  2038. static const char __pyx_k_g_id[] = "g_id";
  2039. static const char __pyx_k_h_id[] = "h_id";
  2040. static const char __pyx_k_head[] = "head";
  2041. static const char __pyx_k_init[] = "init";
  2042. static const char __pyx_k_lib1[] = "lib1";
  2043. static const char __pyx_k_lib2[] = "lib2";
  2044. static const char __pyx_k_lib3[] = "lib3";
  2045. static const char __pyx_k_lib4[] = "lib4";
  2046. static const char __pyx_k_main[] = "__main__";
  2047. static const char __pyx_k_name[] = "name";
  2048. static const char __pyx_k_path[] = "path";
  2049. static const char __pyx_k_self[] = "self";
  2050. static const char __pyx_k_tail[] = "tail";
  2051. static const char __pyx_k_test[] = "__test__";
  2052. static const char __pyx_k_Error[] = "Error";
  2053. static const char __pyx_k_Graph[] = "Graph";
  2054. static const char __pyx_k_edges[] = "edges";
  2055. static const char __pyx_k_graph[] = "graph";
  2056. static const char __pyx_k_items[] = "items";
  2057. static const char __pyx_k_map_b[] = "map_b";
  2058. static const char __pyx_k_map_u[] = "map_u";
  2059. static const char __pyx_k_nodes[] = "nodes";
  2060. static const char __pyx_k_numpy[] = "numpy";
  2061. static const char __pyx_k_print[] = "print";
  2062. static const char __pyx_k_range[] = "range";
  2063. static const char __pyx_k_utf_8[] = "utf-8";
  2064. static const char __pyx_k_value[] = "value";
  2065. static const char __pyx_k_GEDEnv[] = "GEDEnv";
  2066. static const char __pyx_k_classe[] = "classe";
  2067. static const char __pyx_k_ctypes[] = "ctypes";
  2068. static const char __pyx_k_decode[] = "decode";
  2069. static const char __pyx_k_encode[] = "encode";
  2070. static const char __pyx_k_import[] = "__import__";
  2071. static const char __pyx_k_init_2[] = "__init__";
  2072. static const char __pyx_k_method[] = "method";
  2073. static const char __pyx_k_module[] = "__module__";
  2074. static const char __pyx_k_name_2[] = "__name__";
  2075. static const char __pyx_k_option[] = "option";
  2076. static const char __pyx_k_reduce[] = "__reduce__";
  2077. static const char __pyx_k_NodeMap[] = "NodeMap";
  2078. static const char __pyx_k_classes[] = "classes";
  2079. static const char __pyx_k_dataset[] = "dataset";
  2080. static const char __pyx_k_dirname[] = "dirname";
  2081. static const char __pyx_k_message[] = "message";
  2082. static const char __pyx_k_node_id[] = "node_id";
  2083. static const char __pyx_k_options[] = "options";
  2084. static const char __pyx_k_prepare[] = "__prepare__";
  2085. static const char __pyx_k_add_edge[] = "add_edge";
  2086. static const char __pyx_k_add_node[] = "add_node";
  2087. static const char __pyx_k_gedlibpy[] = "gedlibpy";
  2088. static const char __pyx_k_getstate[] = "__getstate__";
  2089. static const char __pyx_k_graph_id[] = "graph_id";
  2090. static const char __pyx_k_networkx[] = "networkx";
  2091. static const char __pyx_k_node_map[] = "node_map";
  2092. static const char __pyx_k_nx_graph[] = "nx_graph";
  2093. static const char __pyx_k_path_XML[] = "path_XML";
  2094. static const char __pyx_k_qualname[] = "__qualname__";
  2095. static const char __pyx_k_realpath[] = "realpath";
  2096. static const char __pyx_k_setstate[] = "__setstate__";
  2097. static const char __pyx_k_InitError[] = "InitError";
  2098. static const char __pyx_k_TypeError[] = "TypeError";
  2099. static const char __pyx_k_add_graph[] = "add_graph";
  2100. static const char __pyx_k_adj_lists[] = "adj_lists";
  2101. static const char __pyx_k_edge_list[] = "edge_list";
  2102. static const char __pyx_k_edge_type[] = "edge_type";
  2103. static const char __pyx_k_edit_cost[] = "edit_cost";
  2104. static const char __pyx_k_enumerate[] = "enumerate";
  2105. static const char __pyx_k_graph_ids[] = "graph_ids";
  2106. static const char __pyx_k_iteritems[] = "iteritems";
  2107. static const char __pyx_k_map_edges[] = "map_edges";
  2108. static const char __pyx_k_metaclass[] = "__metaclass__";
  2109. static const char __pyx_k_node_type[] = "node_type";
  2110. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  2111. static const char __pyx_k_ValueError[] = "ValueError";
  2112. static const char __pyx_k_adj_matrix[] = "adj_matrix";
  2113. static const char __pyx_k_edge_label[] = "edge_label";
  2114. static const char __pyx_k_graph_name[] = "graph_name";
  2115. static const char __pyx_k_map_edge_b[] = "map_edge_b";
  2116. static const char __pyx_k_node_label[] = "node_label";
  2117. static const char __pyx_k_run_method[] = "run_method";
  2118. static const char __pyx_k_set_method[] = "set_method";
  2119. static const char __pyx_k_ImportError[] = "ImportError";
  2120. static const char __pyx_k_LoadLibrary[] = "LoadLibrary";
  2121. static const char __pyx_k_MemoryError[] = "MemoryError";
  2122. static const char __pyx_k_MethodError[] = "MethodError";
  2123. static const char __pyx_k_as_relation[] = "as_relation";
  2124. static const char __pyx_k_clear_graph[] = "clear_graph";
  2125. static const char __pyx_k_graph_class[] = "graph_class";
  2126. static const char __pyx_k_init_method[] = "init_method";
  2127. static const char __pyx_k_init_option[] = "init_option";
  2128. static const char __pyx_k_path_folder[] = "path_folder";
  2129. static const char __pyx_k_restart_env[] = "restart_env";
  2130. static const char __pyx_k_RuntimeError[] = "RuntimeError";
  2131. static const char __pyx_k_add_nx_graph[] = "add_nx_graph";
  2132. static const char __pyx_k_edge_label_1[] = "edge_label_1";
  2133. static const char __pyx_k_edge_label_2[] = "edge_label_2";
  2134. static const char __pyx_k_edge_label_b[] = "edge_label_b";
  2135. static const char __pyx_k_gedlibpy_pyx[] = "gedlibpy.pyx";
  2136. static const char __pyx_k_get_node_map[] = "get_node_map";
  2137. static const char __pyx_k_node_label_1[] = "node_label_1";
  2138. static const char __pyx_k_node_label_2[] = "node_label_2";
  2139. static const char __pyx_k_EditCostError[] = "EditCostError";
  2140. static const char __pyx_k_Graphs_loaded[] = "Graphs loaded ! ";
  2141. static const char __pyx_k_get_edge_data[] = "get_edge_data";
  2142. static const char __pyx_k_list_of_edges[] = "list_of_edges";
  2143. static const char __pyx_k_list_of_nodes[] = "list_of_nodes";
  2144. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  2145. static const char __pyx_k_set_edit_cost[] = "set_edit_cost";
  2146. static const char __pyx_k_add_assignment[] = "add_assignment";
  2147. static const char __pyx_k_get_dummy_node[] = "get_dummy_node";
  2148. static const char __pyx_k_is_initialized[] = "is_initialized";
  2149. static const char __pyx_k_decode_your_map[] = "decode_your_map";
  2150. static const char __pyx_k_encode_your_map[] = "encode_your_map";
  2151. static const char __pyx_k_get_graph_edges[] = "get_graph_edges";
  2152. static const char __pyx_k_get_upper_bound[] = "get_upper_bound";
  2153. static const char __pyx_k_gklearn_ged_env[] = "gklearn.ged.env";
  2154. static const char __pyx_k_load_GXL_graphs[] = "load_GXL_graphs";
  2155. static const char __pyx_k_print_to_stdout[] = "print_to_stdout";
  2156. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  2157. static const char __pyx_k_InitError___init[] = "InitError.__init__";
  2158. static const char __pyx_k_Number_of_graphs[] = "Number of graphs = ";
  2159. static const char __pyx_k_get_init_options[] = "get_init_options";
  2160. static const char __pyx_k_set_induced_cost[] = "set_induced_cost";
  2161. static const char __pyx_k_ignore_duplicates[] = "ignore_duplicates";
  2162. static const char __pyx_k_original_node_ids[] = "original_node_ids";
  2163. static const char __pyx_k_MethodError___init[] = "MethodError.__init__";
  2164. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  2165. static const char __pyx_k_decode_graph_edges[] = "decode_graph_edges";
  2166. static const char __pyx_k_edit_cost_constant[] = "edit_cost_constant";
  2167. static const char __pyx_k_get_method_options[] = "get_method_options";
  2168. static const char __pyx_k_get_graph_num_nodes[] = "get_graph_num_nodes";
  2169. static const char __pyx_k_EditCostError___init[] = "EditCostError.__init__";
  2170. static const char __pyx_k_list_of_init_options[] = "list_of_init_options";
  2171. static const char __pyx_k_get_edit_cost_options[] = "get_edit_cost_options";
  2172. static const char __pyx_k_get_graph_node_labels[] = "get_graph_node_labels";
  2173. static const char __pyx_k_get_original_node_ids[] = "get_original_node_ids";
  2174. static const char __pyx_k_lib_nomad_libnomad_so[] = "/lib/nomad/libnomad.so";
  2175. static const char __pyx_k_list_of_method_options[] = "list_of_method_options";
  2176. static const char __pyx_k_lib_nomad_libsgtelib_so[] = "/lib/nomad/libsgtelib.so";
  2177. static const char __pyx_k_Computation_between_graph[] = "Computation between graph ";
  2178. static const char __pyx_k_Initialization_terminated[] = "Initialization terminated !";
  2179. static const char __pyx_k_lib_fann_libdoublefann_so[] = "/lib/fann/libdoublefann.so";
  2180. static const char __pyx_k_lib_libsvm_3_22_libsvm_so[] = "/lib/libsvm.3.22/libsvm.so";
  2181. static const char __pyx_k_list_of_edit_cost_options[] = "list_of_edit_cost_options";
  2182. static const char __pyx_k_Initialization_in_progress[] = "Initialization in progress...";
  2183. static const char __pyx_k_Loading_graphs_in_progress[] = "Loading graphs in progress...";
  2184. static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  2185. static const char __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES[] = "EAGER_WITHOUT_SHUFFLED_COPIES";
  2186. 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";
  2187. 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";
  2188. 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";
  2189. static const char __pyx_k_Class_for_error_s_management_Th[] = "\n\t\tClass for error's management. This one is general. \n\t";
  2190. 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";
  2191. 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";
  2192. 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";
  2193. 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";
  2194. static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
  2195. static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  2196. static const char __pyx_k_with_all_the_others_including_h[] = " with all the others including himself.";
  2197. static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  2198. static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  2199. 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 !";
  2200. 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.";
  2201. 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";
  2202. static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  2203. static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
  2204. static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
  2205. static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  2206. static PyObject *__pyx_kp_u_;
  2207. static PyObject *__pyx_kp_s_Class_for_Edit_Cost_Error_Raise;
  2208. static PyObject *__pyx_kp_s_Class_for_Init_Error_Raise_an_e;
  2209. static PyObject *__pyx_kp_s_Class_for_Method_Error_Raise_an;
  2210. static PyObject *__pyx_kp_s_Class_for_error_s_management_Th;
  2211. static PyObject *__pyx_kp_u_Computation_between_graph;
  2212. static PyObject *__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES;
  2213. static PyObject *__pyx_n_s_EditCostError;
  2214. static PyObject *__pyx_n_s_EditCostError___init;
  2215. static PyObject *__pyx_n_s_Error;
  2216. static PyObject *__pyx_kp_u_Finish_The_return_contains_edit;
  2217. static PyObject *__pyx_kp_u_Finish_You_can_check_the_result;
  2218. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  2219. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  2220. static PyObject *__pyx_n_s_GEDEnv;
  2221. static PyObject *__pyx_n_s_Graph;
  2222. static PyObject *__pyx_kp_u_Graphs_loaded;
  2223. static PyObject *__pyx_n_s_ImportError;
  2224. static PyObject *__pyx_n_s_InitError;
  2225. static PyObject *__pyx_n_s_InitError___init;
  2226. static PyObject *__pyx_kp_u_Initialization_in_progress;
  2227. static PyObject *__pyx_kp_u_Initialization_terminated;
  2228. static PyObject *__pyx_n_s_LoadLibrary;
  2229. static PyObject *__pyx_kp_u_Loading_graphs_in_progress;
  2230. static PyObject *__pyx_n_s_MemoryError;
  2231. static PyObject *__pyx_n_s_MethodError;
  2232. static PyObject *__pyx_n_s_MethodError___init;
  2233. static PyObject *__pyx_n_s_NodeMap;
  2234. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  2235. static PyObject *__pyx_kp_u_Number_of_graphs;
  2236. static PyObject *__pyx_kp_u_Please_don_t_restart_the_environ;
  2237. static PyObject *__pyx_n_s_RuntimeError;
  2238. static PyObject *__pyx_kp_u_This_edit_cost_function_doesn_t;
  2239. static PyObject *__pyx_kp_u_This_init_option_doesn_t_exist_p;
  2240. static PyObject *__pyx_kp_u_This_method_doesn_t_exist_please;
  2241. static PyObject *__pyx_n_s_TypeError;
  2242. static PyObject *__pyx_n_s_ValueError;
  2243. static PyObject *__pyx_n_s__20;
  2244. static PyObject *__pyx_n_s_add_assignment;
  2245. static PyObject *__pyx_n_s_add_edge;
  2246. static PyObject *__pyx_n_s_add_graph;
  2247. static PyObject *__pyx_n_s_add_node;
  2248. static PyObject *__pyx_n_s_add_nx_graph;
  2249. static PyObject *__pyx_n_s_adj_lists;
  2250. static PyObject *__pyx_n_s_adj_matrix;
  2251. static PyObject *__pyx_n_s_as_relation;
  2252. static PyObject *__pyx_n_s_cdll;
  2253. static PyObject *__pyx_n_s_classe;
  2254. static PyObject *__pyx_n_s_classes;
  2255. static PyObject *__pyx_n_s_clear_graph;
  2256. static PyObject *__pyx_n_s_cline_in_traceback;
  2257. static PyObject *__pyx_n_s_ctypes;
  2258. static PyObject *__pyx_n_s_dataset;
  2259. static PyObject *__pyx_n_s_decode;
  2260. static PyObject *__pyx_n_s_decode_graph_edges;
  2261. static PyObject *__pyx_n_s_decode_your_map;
  2262. static PyObject *__pyx_n_s_dirname;
  2263. static PyObject *__pyx_n_s_doc;
  2264. static PyObject *__pyx_n_s_edge_label;
  2265. static PyObject *__pyx_n_s_edge_label_1;
  2266. static PyObject *__pyx_n_s_edge_label_2;
  2267. static PyObject *__pyx_n_s_edge_label_b;
  2268. static PyObject *__pyx_n_s_edge_list;
  2269. static PyObject *__pyx_n_s_edge_type;
  2270. static PyObject *__pyx_n_s_edges;
  2271. static PyObject *__pyx_n_s_edit_cost;
  2272. static PyObject *__pyx_n_s_edit_cost_constant;
  2273. static PyObject *__pyx_n_s_encode;
  2274. static PyObject *__pyx_n_s_encode_your_map;
  2275. static PyObject *__pyx_n_s_enumerate;
  2276. static PyObject *__pyx_n_s_file;
  2277. static PyObject *__pyx_n_s_g;
  2278. static PyObject *__pyx_n_s_g1;
  2279. static PyObject *__pyx_n_s_g2;
  2280. static PyObject *__pyx_n_s_g_id;
  2281. static PyObject *__pyx_n_s_gedlibpy;
  2282. static PyObject *__pyx_kp_s_gedlibpy_pyx;
  2283. static PyObject *__pyx_n_s_get_dummy_node;
  2284. static PyObject *__pyx_n_s_get_edge_data;
  2285. static PyObject *__pyx_n_s_get_edit_cost_options;
  2286. static PyObject *__pyx_n_s_get_graph_edges;
  2287. static PyObject *__pyx_n_s_get_graph_node_labels;
  2288. static PyObject *__pyx_n_s_get_graph_num_nodes;
  2289. static PyObject *__pyx_n_s_get_init_options;
  2290. static PyObject *__pyx_n_s_get_method_options;
  2291. static PyObject *__pyx_n_s_get_node_map;
  2292. static PyObject *__pyx_n_s_get_original_node_ids;
  2293. static PyObject *__pyx_n_s_get_upper_bound;
  2294. static PyObject *__pyx_n_s_getstate;
  2295. static PyObject *__pyx_n_s_gklearn_ged_env;
  2296. static PyObject *__pyx_n_s_graph;
  2297. static PyObject *__pyx_n_s_graph_class;
  2298. static PyObject *__pyx_n_s_graph_id;
  2299. static PyObject *__pyx_n_s_graph_ids;
  2300. static PyObject *__pyx_n_s_graph_name;
  2301. static PyObject *__pyx_n_s_h;
  2302. static PyObject *__pyx_n_s_h_id;
  2303. static PyObject *__pyx_n_s_head;
  2304. static PyObject *__pyx_n_u_id;
  2305. static PyObject *__pyx_n_s_ignore_duplicates;
  2306. static PyObject *__pyx_n_s_import;
  2307. static PyObject *__pyx_n_s_inf;
  2308. static PyObject *__pyx_n_s_init;
  2309. static PyObject *__pyx_n_s_init_2;
  2310. static PyObject *__pyx_n_s_init_method;
  2311. static PyObject *__pyx_n_s_init_option;
  2312. static PyObject *__pyx_n_s_is_initialized;
  2313. static PyObject *__pyx_n_s_items;
  2314. static PyObject *__pyx_n_s_iteritems;
  2315. static PyObject *__pyx_n_s_key;
  2316. static PyObject *__pyx_n_s_lib1;
  2317. static PyObject *__pyx_n_s_lib2;
  2318. static PyObject *__pyx_n_s_lib3;
  2319. static PyObject *__pyx_n_s_lib4;
  2320. static PyObject *__pyx_kp_u_lib_fann_libdoublefann_so;
  2321. static PyObject *__pyx_kp_u_lib_libsvm_3_22_libsvm_so;
  2322. static PyObject *__pyx_kp_u_lib_nomad_libnomad_so;
  2323. static PyObject *__pyx_kp_u_lib_nomad_libsgtelib_so;
  2324. static PyObject *__pyx_n_s_list_of_edges;
  2325. static PyObject *__pyx_n_s_list_of_edit_cost_options;
  2326. static PyObject *__pyx_n_s_list_of_init_options;
  2327. static PyObject *__pyx_n_s_list_of_method_options;
  2328. static PyObject *__pyx_n_s_list_of_nodes;
  2329. static PyObject *__pyx_n_s_load_GXL_graphs;
  2330. static PyObject *__pyx_n_s_main;
  2331. static PyObject *__pyx_n_s_map_b;
  2332. static PyObject *__pyx_n_s_map_edge_b;
  2333. static PyObject *__pyx_n_s_map_edges;
  2334. static PyObject *__pyx_n_s_map_u;
  2335. static PyObject *__pyx_n_s_message;
  2336. static PyObject *__pyx_n_s_metaclass;
  2337. static PyObject *__pyx_n_s_method;
  2338. static PyObject *__pyx_n_s_module;
  2339. static PyObject *__pyx_n_s_name;
  2340. static PyObject *__pyx_n_s_name_2;
  2341. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  2342. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  2343. static PyObject *__pyx_n_s_networkx;
  2344. static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  2345. static PyObject *__pyx_n_s_node_id;
  2346. static PyObject *__pyx_n_s_node_label;
  2347. static PyObject *__pyx_n_s_node_label_1;
  2348. static PyObject *__pyx_n_s_node_label_2;
  2349. static PyObject *__pyx_n_s_node_map;
  2350. static PyObject *__pyx_n_s_node_type;
  2351. static PyObject *__pyx_n_s_nodes;
  2352. static PyObject *__pyx_n_s_np;
  2353. static PyObject *__pyx_n_s_numpy;
  2354. static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
  2355. static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
  2356. static PyObject *__pyx_n_s_nx;
  2357. static PyObject *__pyx_n_s_nx_graph;
  2358. static PyObject *__pyx_n_s_option;
  2359. static PyObject *__pyx_n_s_options;
  2360. static PyObject *__pyx_n_u_original_node_ids;
  2361. static PyObject *__pyx_n_s_os;
  2362. static PyObject *__pyx_n_s_path;
  2363. static PyObject *__pyx_n_s_path_XML;
  2364. static PyObject *__pyx_n_s_path_folder;
  2365. static PyObject *__pyx_n_s_prepare;
  2366. static PyObject *__pyx_n_s_print;
  2367. static PyObject *__pyx_n_s_print_to_stdout;
  2368. static PyObject *__pyx_n_s_qualname;
  2369. static PyObject *__pyx_n_s_range;
  2370. static PyObject *__pyx_n_s_realpath;
  2371. static PyObject *__pyx_n_s_reduce;
  2372. static PyObject *__pyx_n_s_reduce_cython;
  2373. static PyObject *__pyx_n_s_reduce_ex;
  2374. static PyObject *__pyx_n_s_res;
  2375. static PyObject *__pyx_n_s_restart_env;
  2376. static PyObject *__pyx_n_s_run_method;
  2377. static PyObject *__pyx_n_s_self;
  2378. static PyObject *__pyx_n_s_set_edit_cost;
  2379. static PyObject *__pyx_n_s_set_induced_cost;
  2380. static PyObject *__pyx_n_s_set_method;
  2381. static PyObject *__pyx_n_s_setstate;
  2382. static PyObject *__pyx_n_s_setstate_cython;
  2383. static PyObject *__pyx_n_s_tail;
  2384. static PyObject *__pyx_n_s_test;
  2385. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  2386. static PyObject *__pyx_kp_u_utf_8;
  2387. static PyObject *__pyx_n_s_value;
  2388. static PyObject *__pyx_kp_u_with_all_the_others_including_h;
  2389. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2390. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2391. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2392. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2393. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2394. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2395. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2396. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2397. 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 */
  2398. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2399. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2400. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2401. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2402. 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 */
  2403. 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 */
  2404. 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 */
  2405. 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 */
  2406. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2407. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2408. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2409. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2410. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2411. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2412. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2413. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2414. 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 */
  2415. 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 */
  2416. 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 */
  2417. 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 */
  2418. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2419. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2420. 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 */
  2421. 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 */
  2422. 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 */
  2423. 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 */
  2424. 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 */
  2425. 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 */
  2426. 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 */
  2427. 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 */
  2428. 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 */
  2429. 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 */
  2430. 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 */
  2431. 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 */
  2432. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2433. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2434. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2435. 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 */
  2436. 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 */
  2437. 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 */
  2438. 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 */
  2439. 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 */
  2440. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2441. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2442. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2443. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2444. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2445. 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 */
  2446. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2447. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2448. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels); /* proto */
  2449. 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 */
  2450. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2451. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2452. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels); /* proto */
  2453. 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 */
  2454. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2455. 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 */
  2456. 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, PyObject *__pyx_v_node_map); /* proto */
  2457. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2458. 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 */
  2459. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2460. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2461. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2462. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u); /* proto */
  2463. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b); /* proto */
  2464. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /* proto */
  2465. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  2466. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2467. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
  2468. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2469. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  2470. static PyObject *__pyx_int_0;
  2471. static PyObject *__pyx_int_1;
  2472. static PyObject *__pyx_k__2;
  2473. static PyObject *__pyx_k__3;
  2474. static PyObject *__pyx_tuple__4;
  2475. static PyObject *__pyx_tuple__5;
  2476. static PyObject *__pyx_tuple__6;
  2477. static PyObject *__pyx_tuple__7;
  2478. static PyObject *__pyx_tuple__8;
  2479. static PyObject *__pyx_tuple__9;
  2480. static PyObject *__pyx_tuple__10;
  2481. static PyObject *__pyx_tuple__11;
  2482. static PyObject *__pyx_tuple__12;
  2483. static PyObject *__pyx_tuple__13;
  2484. static PyObject *__pyx_tuple__14;
  2485. static PyObject *__pyx_tuple__15;
  2486. static PyObject *__pyx_tuple__16;
  2487. static PyObject *__pyx_tuple__17;
  2488. static PyObject *__pyx_tuple__18;
  2489. static PyObject *__pyx_tuple__19;
  2490. static PyObject *__pyx_tuple__21;
  2491. static PyObject *__pyx_tuple__23;
  2492. static PyObject *__pyx_tuple__25;
  2493. static PyObject *__pyx_tuple__28;
  2494. static PyObject *__pyx_tuple__30;
  2495. static PyObject *__pyx_tuple__32;
  2496. static PyObject *__pyx_tuple__34;
  2497. static PyObject *__pyx_tuple__36;
  2498. static PyObject *__pyx_tuple__38;
  2499. static PyObject *__pyx_codeobj__22;
  2500. static PyObject *__pyx_codeobj__24;
  2501. static PyObject *__pyx_codeobj__26;
  2502. static PyObject *__pyx_codeobj__27;
  2503. static PyObject *__pyx_codeobj__29;
  2504. static PyObject *__pyx_codeobj__31;
  2505. static PyObject *__pyx_codeobj__33;
  2506. static PyObject *__pyx_codeobj__35;
  2507. static PyObject *__pyx_codeobj__37;
  2508. static PyObject *__pyx_codeobj__39;
  2509. /* Late includes */
  2510. /* "gedlibpy.pyx":129
  2511. *
  2512. *
  2513. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2514. * """
  2515. * Searchs the differents edit cost functions and returns the result.
  2516. */
  2517. /* Python wrapper */
  2518. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2519. 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";
  2520. 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};
  2521. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2522. PyObject *__pyx_r = 0;
  2523. __Pyx_RefNannyDeclarations
  2524. __Pyx_RefNannySetupContext("get_edit_cost_options (wrapper)", 0);
  2525. __pyx_r = __pyx_pf_8gedlibpy_get_edit_cost_options(__pyx_self);
  2526. /* function exit code */
  2527. __Pyx_RefNannyFinishContext();
  2528. return __pyx_r;
  2529. }
  2530. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2531. std::string __pyx_7genexpr__pyx_v_option;
  2532. PyObject *__pyx_r = NULL;
  2533. __Pyx_RefNannyDeclarations
  2534. PyObject *__pyx_t_1 = NULL;
  2535. std::vector<std::string> __pyx_t_2;
  2536. std::vector<std::string> ::iterator __pyx_t_3;
  2537. std::vector<std::string> *__pyx_t_4;
  2538. std::string __pyx_t_5;
  2539. PyObject *__pyx_t_6 = NULL;
  2540. __Pyx_RefNannySetupContext("get_edit_cost_options", 0);
  2541. /* "gedlibpy.pyx":140
  2542. * """
  2543. *
  2544. * return [option.decode('utf-8') for option in getEditCostStringOptions()] # <<<<<<<<<<<<<<
  2545. *
  2546. *
  2547. */
  2548. __Pyx_XDECREF(__pyx_r);
  2549. { /* enter inner scope */
  2550. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 140, __pyx_L1_error)
  2551. __Pyx_GOTREF(__pyx_t_1);
  2552. try {
  2553. __pyx_t_2 = pyged::getEditCostStringOptions();
  2554. } catch(...) {
  2555. __Pyx_CppExn2PyErr();
  2556. __PYX_ERR(0, 140, __pyx_L1_error)
  2557. }
  2558. __pyx_t_4 = &__pyx_t_2;
  2559. __pyx_t_3 = __pyx_t_4->begin();
  2560. for (;;) {
  2561. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2562. __pyx_t_5 = *__pyx_t_3;
  2563. ++__pyx_t_3;
  2564. __pyx_7genexpr__pyx_v_option = __pyx_t_5;
  2565. __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, 140, __pyx_L1_error)
  2566. __Pyx_GOTREF(__pyx_t_6);
  2567. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 140, __pyx_L1_error)
  2568. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2569. }
  2570. } /* exit inner scope */
  2571. __pyx_r = __pyx_t_1;
  2572. __pyx_t_1 = 0;
  2573. goto __pyx_L0;
  2574. /* "gedlibpy.pyx":129
  2575. *
  2576. *
  2577. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2578. * """
  2579. * Searchs the differents edit cost functions and returns the result.
  2580. */
  2581. /* function exit code */
  2582. __pyx_L1_error:;
  2583. __Pyx_XDECREF(__pyx_t_1);
  2584. __Pyx_XDECREF(__pyx_t_6);
  2585. __Pyx_AddTraceback("gedlibpy.get_edit_cost_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2586. __pyx_r = NULL;
  2587. __pyx_L0:;
  2588. __Pyx_XGIVEREF(__pyx_r);
  2589. __Pyx_RefNannyFinishContext();
  2590. return __pyx_r;
  2591. }
  2592. /* "gedlibpy.pyx":143
  2593. *
  2594. *
  2595. * def get_method_options() : # <<<<<<<<<<<<<<
  2596. * """
  2597. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2598. */
  2599. /* Python wrapper */
  2600. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2601. 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";
  2602. 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};
  2603. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2604. PyObject *__pyx_r = 0;
  2605. __Pyx_RefNannyDeclarations
  2606. __Pyx_RefNannySetupContext("get_method_options (wrapper)", 0);
  2607. __pyx_r = __pyx_pf_8gedlibpy_2get_method_options(__pyx_self);
  2608. /* function exit code */
  2609. __Pyx_RefNannyFinishContext();
  2610. return __pyx_r;
  2611. }
  2612. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2613. std::string __pyx_8genexpr1__pyx_v_option;
  2614. PyObject *__pyx_r = NULL;
  2615. __Pyx_RefNannyDeclarations
  2616. PyObject *__pyx_t_1 = NULL;
  2617. std::vector<std::string> __pyx_t_2;
  2618. std::vector<std::string> ::iterator __pyx_t_3;
  2619. std::vector<std::string> *__pyx_t_4;
  2620. std::string __pyx_t_5;
  2621. PyObject *__pyx_t_6 = NULL;
  2622. __Pyx_RefNannySetupContext("get_method_options", 0);
  2623. /* "gedlibpy.pyx":153
  2624. * .. note:: Prefer the list_of_method_options attribute of this module.
  2625. * """
  2626. * return [option.decode('utf-8') for option in getMethodStringOptions()] # <<<<<<<<<<<<<<
  2627. *
  2628. *
  2629. */
  2630. __Pyx_XDECREF(__pyx_r);
  2631. { /* enter inner scope */
  2632. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
  2633. __Pyx_GOTREF(__pyx_t_1);
  2634. try {
  2635. __pyx_t_2 = pyged::getMethodStringOptions();
  2636. } catch(...) {
  2637. __Pyx_CppExn2PyErr();
  2638. __PYX_ERR(0, 153, __pyx_L1_error)
  2639. }
  2640. __pyx_t_4 = &__pyx_t_2;
  2641. __pyx_t_3 = __pyx_t_4->begin();
  2642. for (;;) {
  2643. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2644. __pyx_t_5 = *__pyx_t_3;
  2645. ++__pyx_t_3;
  2646. __pyx_8genexpr1__pyx_v_option = __pyx_t_5;
  2647. __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, 153, __pyx_L1_error)
  2648. __Pyx_GOTREF(__pyx_t_6);
  2649. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 153, __pyx_L1_error)
  2650. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2651. }
  2652. } /* exit inner scope */
  2653. __pyx_r = __pyx_t_1;
  2654. __pyx_t_1 = 0;
  2655. goto __pyx_L0;
  2656. /* "gedlibpy.pyx":143
  2657. *
  2658. *
  2659. * def get_method_options() : # <<<<<<<<<<<<<<
  2660. * """
  2661. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2662. */
  2663. /* function exit code */
  2664. __pyx_L1_error:;
  2665. __Pyx_XDECREF(__pyx_t_1);
  2666. __Pyx_XDECREF(__pyx_t_6);
  2667. __Pyx_AddTraceback("gedlibpy.get_method_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2668. __pyx_r = NULL;
  2669. __pyx_L0:;
  2670. __Pyx_XGIVEREF(__pyx_r);
  2671. __Pyx_RefNannyFinishContext();
  2672. return __pyx_r;
  2673. }
  2674. /* "gedlibpy.pyx":156
  2675. *
  2676. *
  2677. * def get_init_options() : # <<<<<<<<<<<<<<
  2678. * """
  2679. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2680. */
  2681. /* Python wrapper */
  2682. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2683. 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";
  2684. 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};
  2685. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2686. PyObject *__pyx_r = 0;
  2687. __Pyx_RefNannyDeclarations
  2688. __Pyx_RefNannySetupContext("get_init_options (wrapper)", 0);
  2689. __pyx_r = __pyx_pf_8gedlibpy_4get_init_options(__pyx_self);
  2690. /* function exit code */
  2691. __Pyx_RefNannyFinishContext();
  2692. return __pyx_r;
  2693. }
  2694. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2695. std::string __pyx_8genexpr2__pyx_v_option;
  2696. PyObject *__pyx_r = NULL;
  2697. __Pyx_RefNannyDeclarations
  2698. PyObject *__pyx_t_1 = NULL;
  2699. std::vector<std::string> __pyx_t_2;
  2700. std::vector<std::string> ::iterator __pyx_t_3;
  2701. std::vector<std::string> *__pyx_t_4;
  2702. std::string __pyx_t_5;
  2703. PyObject *__pyx_t_6 = NULL;
  2704. __Pyx_RefNannySetupContext("get_init_options", 0);
  2705. /* "gedlibpy.pyx":166
  2706. * .. note:: Prefer the list_of_init_options attribute of this module.
  2707. * """
  2708. * return [option.decode('utf-8') for option in getInitStringOptions()] # <<<<<<<<<<<<<<
  2709. *
  2710. *
  2711. */
  2712. __Pyx_XDECREF(__pyx_r);
  2713. { /* enter inner scope */
  2714. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 166, __pyx_L1_error)
  2715. __Pyx_GOTREF(__pyx_t_1);
  2716. try {
  2717. __pyx_t_2 = pyged::getInitStringOptions();
  2718. } catch(...) {
  2719. __Pyx_CppExn2PyErr();
  2720. __PYX_ERR(0, 166, __pyx_L1_error)
  2721. }
  2722. __pyx_t_4 = &__pyx_t_2;
  2723. __pyx_t_3 = __pyx_t_4->begin();
  2724. for (;;) {
  2725. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2726. __pyx_t_5 = *__pyx_t_3;
  2727. ++__pyx_t_3;
  2728. __pyx_8genexpr2__pyx_v_option = __pyx_t_5;
  2729. __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, 166, __pyx_L1_error)
  2730. __Pyx_GOTREF(__pyx_t_6);
  2731. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 166, __pyx_L1_error)
  2732. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2733. }
  2734. } /* exit inner scope */
  2735. __pyx_r = __pyx_t_1;
  2736. __pyx_t_1 = 0;
  2737. goto __pyx_L0;
  2738. /* "gedlibpy.pyx":156
  2739. *
  2740. *
  2741. * def get_init_options() : # <<<<<<<<<<<<<<
  2742. * """
  2743. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2744. */
  2745. /* function exit code */
  2746. __pyx_L1_error:;
  2747. __Pyx_XDECREF(__pyx_t_1);
  2748. __Pyx_XDECREF(__pyx_t_6);
  2749. __Pyx_AddTraceback("gedlibpy.get_init_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2750. __pyx_r = NULL;
  2751. __pyx_L0:;
  2752. __Pyx_XGIVEREF(__pyx_r);
  2753. __Pyx_RefNannyFinishContext();
  2754. return __pyx_r;
  2755. }
  2756. /* "gedlibpy.pyx":169
  2757. *
  2758. *
  2759. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2760. * """
  2761. * Returns the ID of a dummy node.
  2762. */
  2763. /* Python wrapper */
  2764. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2765. 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";
  2766. 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};
  2767. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2768. PyObject *__pyx_r = 0;
  2769. __Pyx_RefNannyDeclarations
  2770. __Pyx_RefNannySetupContext("get_dummy_node (wrapper)", 0);
  2771. __pyx_r = __pyx_pf_8gedlibpy_6get_dummy_node(__pyx_self);
  2772. /* function exit code */
  2773. __Pyx_RefNannyFinishContext();
  2774. return __pyx_r;
  2775. }
  2776. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self) {
  2777. PyObject *__pyx_r = NULL;
  2778. __Pyx_RefNannyDeclarations
  2779. size_t __pyx_t_1;
  2780. PyObject *__pyx_t_2 = NULL;
  2781. __Pyx_RefNannySetupContext("get_dummy_node", 0);
  2782. /* "gedlibpy.pyx":178
  2783. * .. note:: A dummy node is used when a node isn't associated to an other node.
  2784. * """
  2785. * return getDummyNode() # <<<<<<<<<<<<<<
  2786. *
  2787. *
  2788. */
  2789. __Pyx_XDECREF(__pyx_r);
  2790. try {
  2791. __pyx_t_1 = pyged::getDummyNode();
  2792. } catch(...) {
  2793. __Pyx_CppExn2PyErr();
  2794. __PYX_ERR(0, 178, __pyx_L1_error)
  2795. }
  2796. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 178, __pyx_L1_error)
  2797. __Pyx_GOTREF(__pyx_t_2);
  2798. __pyx_r = __pyx_t_2;
  2799. __pyx_t_2 = 0;
  2800. goto __pyx_L0;
  2801. /* "gedlibpy.pyx":169
  2802. *
  2803. *
  2804. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2805. * """
  2806. * Returns the ID of a dummy node.
  2807. */
  2808. /* function exit code */
  2809. __pyx_L1_error:;
  2810. __Pyx_XDECREF(__pyx_t_2);
  2811. __Pyx_AddTraceback("gedlibpy.get_dummy_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2812. __pyx_r = NULL;
  2813. __pyx_L0:;
  2814. __Pyx_XGIVEREF(__pyx_r);
  2815. __Pyx_RefNannyFinishContext();
  2816. return __pyx_r;
  2817. }
  2818. /* "gedlibpy.pyx":189
  2819. *
  2820. *
  2821. * def __cinit__(self): # <<<<<<<<<<<<<<
  2822. * # self.c_env = PyGEDEnv()
  2823. * self.c_env = new PyGEDEnv()
  2824. */
  2825. /* Python wrapper */
  2826. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2827. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2828. int __pyx_r;
  2829. __Pyx_RefNannyDeclarations
  2830. __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  2831. if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
  2832. __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  2833. if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  2834. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv___cinit__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2835. /* function exit code */
  2836. __Pyx_RefNannyFinishContext();
  2837. return __pyx_r;
  2838. }
  2839. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2840. int __pyx_r;
  2841. __Pyx_RefNannyDeclarations
  2842. pyged::PyGEDEnv *__pyx_t_1;
  2843. __Pyx_RefNannySetupContext("__cinit__", 0);
  2844. /* "gedlibpy.pyx":191
  2845. * def __cinit__(self):
  2846. * # self.c_env = PyGEDEnv()
  2847. * self.c_env = new PyGEDEnv() # <<<<<<<<<<<<<<
  2848. *
  2849. *
  2850. */
  2851. try {
  2852. __pyx_t_1 = new pyged::PyGEDEnv();
  2853. } catch(...) {
  2854. __Pyx_CppExn2PyErr();
  2855. __PYX_ERR(0, 191, __pyx_L1_error)
  2856. }
  2857. __pyx_v_self->c_env = __pyx_t_1;
  2858. /* "gedlibpy.pyx":189
  2859. *
  2860. *
  2861. * def __cinit__(self): # <<<<<<<<<<<<<<
  2862. * # self.c_env = PyGEDEnv()
  2863. * self.c_env = new PyGEDEnv()
  2864. */
  2865. /* function exit code */
  2866. __pyx_r = 0;
  2867. goto __pyx_L0;
  2868. __pyx_L1_error:;
  2869. __Pyx_AddTraceback("gedlibpy.GEDEnv.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2870. __pyx_r = -1;
  2871. __pyx_L0:;
  2872. __Pyx_RefNannyFinishContext();
  2873. return __pyx_r;
  2874. }
  2875. /* "gedlibpy.pyx":194
  2876. *
  2877. *
  2878. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2879. * del self.c_env
  2880. *
  2881. */
  2882. /* Python wrapper */
  2883. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
  2884. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self) {
  2885. __Pyx_RefNannyDeclarations
  2886. __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  2887. __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2888. /* function exit code */
  2889. __Pyx_RefNannyFinishContext();
  2890. }
  2891. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2892. __Pyx_RefNannyDeclarations
  2893. __Pyx_RefNannySetupContext("__dealloc__", 0);
  2894. /* "gedlibpy.pyx":195
  2895. *
  2896. * def __dealloc__(self):
  2897. * del self.c_env # <<<<<<<<<<<<<<
  2898. *
  2899. *
  2900. */
  2901. delete __pyx_v_self->c_env;
  2902. /* "gedlibpy.pyx":194
  2903. *
  2904. *
  2905. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2906. * del self.c_env
  2907. *
  2908. */
  2909. /* function exit code */
  2910. __Pyx_RefNannyFinishContext();
  2911. }
  2912. /* "gedlibpy.pyx":203
  2913. *
  2914. *
  2915. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2916. * """
  2917. * Checks and returns if the computation environment is initialized or not.
  2918. */
  2919. /* Python wrapper */
  2920. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2921. 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";
  2922. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2923. PyObject *__pyx_r = 0;
  2924. __Pyx_RefNannyDeclarations
  2925. __Pyx_RefNannySetupContext("is_initialized (wrapper)", 0);
  2926. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2927. /* function exit code */
  2928. __Pyx_RefNannyFinishContext();
  2929. return __pyx_r;
  2930. }
  2931. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2932. PyObject *__pyx_r = NULL;
  2933. __Pyx_RefNannyDeclarations
  2934. bool __pyx_t_1;
  2935. PyObject *__pyx_t_2 = NULL;
  2936. __Pyx_RefNannySetupContext("is_initialized", 0);
  2937. /* "gedlibpy.pyx":212
  2938. * .. note:: This function exists for internals verifications but you can use it for your code.
  2939. * """
  2940. * return self.c_env.isInitialized() # <<<<<<<<<<<<<<
  2941. *
  2942. *
  2943. */
  2944. __Pyx_XDECREF(__pyx_r);
  2945. try {
  2946. __pyx_t_1 = __pyx_v_self->c_env->isInitialized();
  2947. } catch(...) {
  2948. __Pyx_CppExn2PyErr();
  2949. __PYX_ERR(0, 212, __pyx_L1_error)
  2950. }
  2951. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 212, __pyx_L1_error)
  2952. __Pyx_GOTREF(__pyx_t_2);
  2953. __pyx_r = __pyx_t_2;
  2954. __pyx_t_2 = 0;
  2955. goto __pyx_L0;
  2956. /* "gedlibpy.pyx":203
  2957. *
  2958. *
  2959. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2960. * """
  2961. * Checks and returns if the computation environment is initialized or not.
  2962. */
  2963. /* function exit code */
  2964. __pyx_L1_error:;
  2965. __Pyx_XDECREF(__pyx_t_2);
  2966. __Pyx_AddTraceback("gedlibpy.GEDEnv.is_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2967. __pyx_r = NULL;
  2968. __pyx_L0:;
  2969. __Pyx_XGIVEREF(__pyx_r);
  2970. __Pyx_RefNannyFinishContext();
  2971. return __pyx_r;
  2972. }
  2973. /* "gedlibpy.pyx":215
  2974. *
  2975. *
  2976. * def restart_env(self) : # <<<<<<<<<<<<<<
  2977. * """
  2978. * Restarts the environment variable. All data related to it will be delete.
  2979. */
  2980. /* Python wrapper */
  2981. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2982. 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";
  2983. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2984. PyObject *__pyx_r = 0;
  2985. __Pyx_RefNannyDeclarations
  2986. __Pyx_RefNannySetupContext("restart_env (wrapper)", 0);
  2987. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_6restart_env(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2988. /* function exit code */
  2989. __Pyx_RefNannyFinishContext();
  2990. return __pyx_r;
  2991. }
  2992. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2993. PyObject *__pyx_r = NULL;
  2994. __Pyx_RefNannyDeclarations
  2995. __Pyx_RefNannySetupContext("restart_env", 0);
  2996. /* "gedlibpy.pyx":222
  2997. * .. note:: You can now delete and add somes graphs after initialization so you can avoid this function.
  2998. * """
  2999. * self.c_env.restartEnv() # <<<<<<<<<<<<<<
  3000. *
  3001. *
  3002. */
  3003. try {
  3004. __pyx_v_self->c_env->restartEnv();
  3005. } catch(...) {
  3006. __Pyx_CppExn2PyErr();
  3007. __PYX_ERR(0, 222, __pyx_L1_error)
  3008. }
  3009. /* "gedlibpy.pyx":215
  3010. *
  3011. *
  3012. * def restart_env(self) : # <<<<<<<<<<<<<<
  3013. * """
  3014. * Restarts the environment variable. All data related to it will be delete.
  3015. */
  3016. /* function exit code */
  3017. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3018. goto __pyx_L0;
  3019. __pyx_L1_error:;
  3020. __Pyx_AddTraceback("gedlibpy.GEDEnv.restart_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3021. __pyx_r = NULL;
  3022. __pyx_L0:;
  3023. __Pyx_XGIVEREF(__pyx_r);
  3024. __Pyx_RefNannyFinishContext();
  3025. return __pyx_r;
  3026. }
  3027. /* "gedlibpy.pyx":225
  3028. *
  3029. *
  3030. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3031. * """
  3032. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3033. */
  3034. /* Python wrapper */
  3035. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3036. 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";
  3037. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3038. PyObject *__pyx_v_path_folder = 0;
  3039. PyObject *__pyx_v_path_XML = 0;
  3040. PyObject *__pyx_v_node_type = 0;
  3041. PyObject *__pyx_v_edge_type = 0;
  3042. PyObject *__pyx_r = 0;
  3043. __Pyx_RefNannyDeclarations
  3044. __Pyx_RefNannySetupContext("load_GXL_graphs (wrapper)", 0);
  3045. {
  3046. 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};
  3047. PyObject* values[4] = {0,0,0,0};
  3048. if (unlikely(__pyx_kwds)) {
  3049. Py_ssize_t kw_args;
  3050. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3051. switch (pos_args) {
  3052. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3053. CYTHON_FALLTHROUGH;
  3054. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3055. CYTHON_FALLTHROUGH;
  3056. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3057. CYTHON_FALLTHROUGH;
  3058. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3059. CYTHON_FALLTHROUGH;
  3060. case 0: break;
  3061. default: goto __pyx_L5_argtuple_error;
  3062. }
  3063. kw_args = PyDict_Size(__pyx_kwds);
  3064. switch (pos_args) {
  3065. case 0:
  3066. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  3067. else goto __pyx_L5_argtuple_error;
  3068. CYTHON_FALLTHROUGH;
  3069. case 1:
  3070. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  3071. else {
  3072. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 225, __pyx_L3_error)
  3073. }
  3074. CYTHON_FALLTHROUGH;
  3075. case 2:
  3076. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_type)) != 0)) kw_args--;
  3077. else {
  3078. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 225, __pyx_L3_error)
  3079. }
  3080. CYTHON_FALLTHROUGH;
  3081. case 3:
  3082. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_type)) != 0)) kw_args--;
  3083. else {
  3084. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 225, __pyx_L3_error)
  3085. }
  3086. }
  3087. if (unlikely(kw_args > 0)) {
  3088. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 225, __pyx_L3_error)
  3089. }
  3090. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  3091. goto __pyx_L5_argtuple_error;
  3092. } else {
  3093. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3094. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3095. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3096. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3097. }
  3098. __pyx_v_path_folder = values[0];
  3099. __pyx_v_path_XML = values[1];
  3100. __pyx_v_node_type = values[2];
  3101. __pyx_v_edge_type = values[3];
  3102. }
  3103. goto __pyx_L4_argument_unpacking_done;
  3104. __pyx_L5_argtuple_error:;
  3105. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 225, __pyx_L3_error)
  3106. __pyx_L3_error:;
  3107. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3108. __Pyx_RefNannyFinishContext();
  3109. return NULL;
  3110. __pyx_L4_argument_unpacking_done:;
  3111. __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);
  3112. /* function exit code */
  3113. __Pyx_RefNannyFinishContext();
  3114. return __pyx_r;
  3115. }
  3116. 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) {
  3117. PyObject *__pyx_r = NULL;
  3118. __Pyx_RefNannyDeclarations
  3119. PyObject *__pyx_t_1 = NULL;
  3120. PyObject *__pyx_t_2 = NULL;
  3121. PyObject *__pyx_t_3 = NULL;
  3122. std::string __pyx_t_4;
  3123. std::string __pyx_t_5;
  3124. bool __pyx_t_6;
  3125. bool __pyx_t_7;
  3126. __Pyx_RefNannySetupContext("load_GXL_graphs", 0);
  3127. /* "gedlibpy.pyx":241
  3128. * .. note:: You can call this function multiple times if you want, but not after an init call.
  3129. * """
  3130. * self.c_env.loadGXLGraph(path_folder.encode('utf-8'), path_XML.encode('utf-8'), node_type, edge_type) # <<<<<<<<<<<<<<
  3131. *
  3132. *
  3133. */
  3134. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_folder, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  3135. __Pyx_GOTREF(__pyx_t_2);
  3136. __pyx_t_3 = NULL;
  3137. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3138. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3139. if (likely(__pyx_t_3)) {
  3140. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3141. __Pyx_INCREF(__pyx_t_3);
  3142. __Pyx_INCREF(function);
  3143. __Pyx_DECREF_SET(__pyx_t_2, function);
  3144. }
  3145. }
  3146. __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);
  3147. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3148. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  3149. __Pyx_GOTREF(__pyx_t_1);
  3150. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3151. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
  3152. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3153. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_XML, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  3154. __Pyx_GOTREF(__pyx_t_2);
  3155. __pyx_t_3 = NULL;
  3156. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3157. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3158. if (likely(__pyx_t_3)) {
  3159. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3160. __Pyx_INCREF(__pyx_t_3);
  3161. __Pyx_INCREF(function);
  3162. __Pyx_DECREF_SET(__pyx_t_2, function);
  3163. }
  3164. }
  3165. __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);
  3166. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3167. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  3168. __Pyx_GOTREF(__pyx_t_1);
  3169. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3170. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
  3171. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3172. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_node_type); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
  3173. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_edge_type); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
  3174. try {
  3175. __pyx_v_self->c_env->loadGXLGraph(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
  3176. } catch(...) {
  3177. __Pyx_CppExn2PyErr();
  3178. __PYX_ERR(0, 241, __pyx_L1_error)
  3179. }
  3180. /* "gedlibpy.pyx":225
  3181. *
  3182. *
  3183. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3184. * """
  3185. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3186. */
  3187. /* function exit code */
  3188. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3189. goto __pyx_L0;
  3190. __pyx_L1_error:;
  3191. __Pyx_XDECREF(__pyx_t_1);
  3192. __Pyx_XDECREF(__pyx_t_2);
  3193. __Pyx_XDECREF(__pyx_t_3);
  3194. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3195. __pyx_r = NULL;
  3196. __pyx_L0:;
  3197. __Pyx_XGIVEREF(__pyx_r);
  3198. __Pyx_RefNannyFinishContext();
  3199. return __pyx_r;
  3200. }
  3201. /* "gedlibpy.pyx":244
  3202. *
  3203. *
  3204. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3205. * """
  3206. * Searchs the first and last IDs of the loaded graphs in the environment.
  3207. */
  3208. /* Python wrapper */
  3209. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3210. 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";
  3211. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3212. PyObject *__pyx_r = 0;
  3213. __Pyx_RefNannyDeclarations
  3214. __Pyx_RefNannySetupContext("graph_ids (wrapper)", 0);
  3215. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3216. /* function exit code */
  3217. __Pyx_RefNannyFinishContext();
  3218. return __pyx_r;
  3219. }
  3220. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3221. PyObject *__pyx_r = NULL;
  3222. __Pyx_RefNannyDeclarations
  3223. std::pair<size_t,size_t> __pyx_t_1;
  3224. PyObject *__pyx_t_2 = NULL;
  3225. __Pyx_RefNannySetupContext("graph_ids", 0);
  3226. /* "gedlibpy.pyx":253
  3227. * .. note:: Prefer this function if you have huges structures with lots of graphs.
  3228. * """
  3229. * return self.c_env.getGraphIds() # <<<<<<<<<<<<<<
  3230. *
  3231. *
  3232. */
  3233. __Pyx_XDECREF(__pyx_r);
  3234. try {
  3235. __pyx_t_1 = __pyx_v_self->c_env->getGraphIds();
  3236. } catch(...) {
  3237. __Pyx_CppExn2PyErr();
  3238. __PYX_ERR(0, 253, __pyx_L1_error)
  3239. }
  3240. __pyx_t_2 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 253, __pyx_L1_error)
  3241. __Pyx_GOTREF(__pyx_t_2);
  3242. __pyx_r = __pyx_t_2;
  3243. __pyx_t_2 = 0;
  3244. goto __pyx_L0;
  3245. /* "gedlibpy.pyx":244
  3246. *
  3247. *
  3248. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3249. * """
  3250. * Searchs the first and last IDs of the loaded graphs in the environment.
  3251. */
  3252. /* function exit code */
  3253. __pyx_L1_error:;
  3254. __Pyx_XDECREF(__pyx_t_2);
  3255. __Pyx_AddTraceback("gedlibpy.GEDEnv.graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3256. __pyx_r = NULL;
  3257. __pyx_L0:;
  3258. __Pyx_XGIVEREF(__pyx_r);
  3259. __Pyx_RefNannyFinishContext();
  3260. return __pyx_r;
  3261. }
  3262. /* "gedlibpy.pyx":256
  3263. *
  3264. *
  3265. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3266. * """
  3267. * Searchs all the IDs of the loaded graphs in the environment.
  3268. */
  3269. /* Python wrapper */
  3270. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3271. 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";
  3272. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3273. PyObject *__pyx_r = 0;
  3274. __Pyx_RefNannyDeclarations
  3275. __Pyx_RefNannySetupContext("get_all_graph_ids (wrapper)", 0);
  3276. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3277. /* function exit code */
  3278. __Pyx_RefNannyFinishContext();
  3279. return __pyx_r;
  3280. }
  3281. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3282. PyObject *__pyx_r = NULL;
  3283. __Pyx_RefNannyDeclarations
  3284. std::vector<size_t> __pyx_t_1;
  3285. PyObject *__pyx_t_2 = NULL;
  3286. __Pyx_RefNannySetupContext("get_all_graph_ids", 0);
  3287. /* "gedlibpy.pyx":265
  3288. * .. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order.
  3289. * """
  3290. * return self.c_env.getAllGraphIds() # <<<<<<<<<<<<<<
  3291. *
  3292. *
  3293. */
  3294. __Pyx_XDECREF(__pyx_r);
  3295. try {
  3296. __pyx_t_1 = __pyx_v_self->c_env->getAllGraphIds();
  3297. } catch(...) {
  3298. __Pyx_CppExn2PyErr();
  3299. __PYX_ERR(0, 265, __pyx_L1_error)
  3300. }
  3301. __pyx_t_2 = __pyx_convert_vector_to_py_size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 265, __pyx_L1_error)
  3302. __Pyx_GOTREF(__pyx_t_2);
  3303. __pyx_r = __pyx_t_2;
  3304. __pyx_t_2 = 0;
  3305. goto __pyx_L0;
  3306. /* "gedlibpy.pyx":256
  3307. *
  3308. *
  3309. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3310. * """
  3311. * Searchs all the IDs of the loaded graphs in the environment.
  3312. */
  3313. /* function exit code */
  3314. __pyx_L1_error:;
  3315. __Pyx_XDECREF(__pyx_t_2);
  3316. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3317. __pyx_r = NULL;
  3318. __pyx_L0:;
  3319. __Pyx_XGIVEREF(__pyx_r);
  3320. __Pyx_RefNannyFinishContext();
  3321. return __pyx_r;
  3322. }
  3323. /* "gedlibpy.pyx":268
  3324. *
  3325. *
  3326. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3327. * """
  3328. * Returns the class of a graph with its ID.
  3329. */
  3330. /* Python wrapper */
  3331. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3332. 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";
  3333. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3334. PyObject *__pyx_r = 0;
  3335. __Pyx_RefNannyDeclarations
  3336. __Pyx_RefNannySetupContext("get_graph_class (wrapper)", 0);
  3337. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3338. /* function exit code */
  3339. __Pyx_RefNannyFinishContext();
  3340. return __pyx_r;
  3341. }
  3342. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3343. PyObject *__pyx_r = NULL;
  3344. __Pyx_RefNannyDeclarations
  3345. size_t __pyx_t_1;
  3346. std::string __pyx_t_2;
  3347. PyObject *__pyx_t_3 = NULL;
  3348. __Pyx_RefNannySetupContext("get_graph_class", 0);
  3349. /* "gedlibpy.pyx":280
  3350. * .. note:: An empty string can be a class.
  3351. * """
  3352. * return self.c_env.getGraphClass(id) # <<<<<<<<<<<<<<
  3353. *
  3354. *
  3355. */
  3356. __Pyx_XDECREF(__pyx_r);
  3357. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 280, __pyx_L1_error)
  3358. try {
  3359. __pyx_t_2 = __pyx_v_self->c_env->getGraphClass(__pyx_t_1);
  3360. } catch(...) {
  3361. __Pyx_CppExn2PyErr();
  3362. __PYX_ERR(0, 280, __pyx_L1_error)
  3363. }
  3364. __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 280, __pyx_L1_error)
  3365. __Pyx_GOTREF(__pyx_t_3);
  3366. __pyx_r = __pyx_t_3;
  3367. __pyx_t_3 = 0;
  3368. goto __pyx_L0;
  3369. /* "gedlibpy.pyx":268
  3370. *
  3371. *
  3372. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3373. * """
  3374. * Returns the class of a graph with its ID.
  3375. */
  3376. /* function exit code */
  3377. __pyx_L1_error:;
  3378. __Pyx_XDECREF(__pyx_t_3);
  3379. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3380. __pyx_r = NULL;
  3381. __pyx_L0:;
  3382. __Pyx_XGIVEREF(__pyx_r);
  3383. __Pyx_RefNannyFinishContext();
  3384. return __pyx_r;
  3385. }
  3386. /* "gedlibpy.pyx":283
  3387. *
  3388. *
  3389. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3390. * """
  3391. * Returns the name of a graph with its ID.
  3392. */
  3393. /* Python wrapper */
  3394. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3395. 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";
  3396. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3397. PyObject *__pyx_r = 0;
  3398. __Pyx_RefNannyDeclarations
  3399. __Pyx_RefNannySetupContext("get_graph_name (wrapper)", 0);
  3400. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3401. /* function exit code */
  3402. __Pyx_RefNannyFinishContext();
  3403. return __pyx_r;
  3404. }
  3405. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3406. PyObject *__pyx_r = NULL;
  3407. __Pyx_RefNannyDeclarations
  3408. size_t __pyx_t_1;
  3409. std::string __pyx_t_2;
  3410. PyObject *__pyx_t_3 = NULL;
  3411. __Pyx_RefNannySetupContext("get_graph_name", 0);
  3412. /* "gedlibpy.pyx":295
  3413. * .. note:: An empty string can be a name.
  3414. * """
  3415. * return self.c_env.getGraphName(id).decode('utf-8') # <<<<<<<<<<<<<<
  3416. *
  3417. *
  3418. */
  3419. __Pyx_XDECREF(__pyx_r);
  3420. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
  3421. try {
  3422. __pyx_t_2 = __pyx_v_self->c_env->getGraphName(__pyx_t_1);
  3423. } catch(...) {
  3424. __Pyx_CppExn2PyErr();
  3425. __PYX_ERR(0, 295, __pyx_L1_error)
  3426. }
  3427. __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, 295, __pyx_L1_error)
  3428. __Pyx_GOTREF(__pyx_t_3);
  3429. __pyx_r = __pyx_t_3;
  3430. __pyx_t_3 = 0;
  3431. goto __pyx_L0;
  3432. /* "gedlibpy.pyx":283
  3433. *
  3434. *
  3435. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3436. * """
  3437. * Returns the name of a graph with its ID.
  3438. */
  3439. /* function exit code */
  3440. __pyx_L1_error:;
  3441. __Pyx_XDECREF(__pyx_t_3);
  3442. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3443. __pyx_r = NULL;
  3444. __pyx_L0:;
  3445. __Pyx_XGIVEREF(__pyx_r);
  3446. __Pyx_RefNannyFinishContext();
  3447. return __pyx_r;
  3448. }
  3449. /* "gedlibpy.pyx":298
  3450. *
  3451. *
  3452. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3453. * """
  3454. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3455. */
  3456. /* Python wrapper */
  3457. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3458. 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";
  3459. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3460. PyObject *__pyx_v_name = 0;
  3461. PyObject *__pyx_v_classe = 0;
  3462. PyObject *__pyx_r = 0;
  3463. __Pyx_RefNannyDeclarations
  3464. __Pyx_RefNannySetupContext("add_graph (wrapper)", 0);
  3465. {
  3466. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_classe,0};
  3467. PyObject* values[2] = {0,0};
  3468. values[0] = ((PyObject *)__pyx_kp_u_);
  3469. values[1] = ((PyObject *)__pyx_kp_u_);
  3470. if (unlikely(__pyx_kwds)) {
  3471. Py_ssize_t kw_args;
  3472. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3473. switch (pos_args) {
  3474. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3475. CYTHON_FALLTHROUGH;
  3476. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3477. CYTHON_FALLTHROUGH;
  3478. case 0: break;
  3479. default: goto __pyx_L5_argtuple_error;
  3480. }
  3481. kw_args = PyDict_Size(__pyx_kwds);
  3482. switch (pos_args) {
  3483. case 0:
  3484. if (kw_args > 0) {
  3485. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
  3486. if (value) { values[0] = value; kw_args--; }
  3487. }
  3488. CYTHON_FALLTHROUGH;
  3489. case 1:
  3490. if (kw_args > 0) {
  3491. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe);
  3492. if (value) { values[1] = value; kw_args--; }
  3493. }
  3494. }
  3495. if (unlikely(kw_args > 0)) {
  3496. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 298, __pyx_L3_error)
  3497. }
  3498. } else {
  3499. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3500. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3501. CYTHON_FALLTHROUGH;
  3502. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3503. CYTHON_FALLTHROUGH;
  3504. case 0: break;
  3505. default: goto __pyx_L5_argtuple_error;
  3506. }
  3507. }
  3508. __pyx_v_name = values[0];
  3509. __pyx_v_classe = values[1];
  3510. }
  3511. goto __pyx_L4_argument_unpacking_done;
  3512. __pyx_L5_argtuple_error:;
  3513. __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 298, __pyx_L3_error)
  3514. __pyx_L3_error:;
  3515. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3516. __Pyx_RefNannyFinishContext();
  3517. return NULL;
  3518. __pyx_L4_argument_unpacking_done:;
  3519. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_18add_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_name, __pyx_v_classe);
  3520. /* function exit code */
  3521. __Pyx_RefNannyFinishContext();
  3522. return __pyx_r;
  3523. }
  3524. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe) {
  3525. PyObject *__pyx_r = NULL;
  3526. __Pyx_RefNannyDeclarations
  3527. PyObject *__pyx_t_1 = NULL;
  3528. PyObject *__pyx_t_2 = NULL;
  3529. PyObject *__pyx_t_3 = NULL;
  3530. std::string __pyx_t_4;
  3531. std::string __pyx_t_5;
  3532. size_t __pyx_t_6;
  3533. __Pyx_RefNannySetupContext("add_graph", 0);
  3534. /* "gedlibpy.pyx":312
  3535. * .. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications.
  3536. * """
  3537. * return self.c_env.addGraph(name.encode('utf-8'), classe.encode('utf-8')) # <<<<<<<<<<<<<<
  3538. *
  3539. *
  3540. */
  3541. __Pyx_XDECREF(__pyx_r);
  3542. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  3543. __Pyx_GOTREF(__pyx_t_2);
  3544. __pyx_t_3 = NULL;
  3545. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3546. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3547. if (likely(__pyx_t_3)) {
  3548. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3549. __Pyx_INCREF(__pyx_t_3);
  3550. __Pyx_INCREF(function);
  3551. __Pyx_DECREF_SET(__pyx_t_2, function);
  3552. }
  3553. }
  3554. __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);
  3555. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3556. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  3557. __Pyx_GOTREF(__pyx_t_1);
  3558. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3559. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
  3560. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3561. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_classe, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 312, __pyx_L1_error)
  3562. __Pyx_GOTREF(__pyx_t_2);
  3563. __pyx_t_3 = NULL;
  3564. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3565. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3566. if (likely(__pyx_t_3)) {
  3567. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3568. __Pyx_INCREF(__pyx_t_3);
  3569. __Pyx_INCREF(function);
  3570. __Pyx_DECREF_SET(__pyx_t_2, function);
  3571. }
  3572. }
  3573. __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);
  3574. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3575. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  3576. __Pyx_GOTREF(__pyx_t_1);
  3577. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3578. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 312, __pyx_L1_error)
  3579. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3580. try {
  3581. __pyx_t_6 = __pyx_v_self->c_env->addGraph(__pyx_t_4, __pyx_t_5);
  3582. } catch(...) {
  3583. __Pyx_CppExn2PyErr();
  3584. __PYX_ERR(0, 312, __pyx_L1_error)
  3585. }
  3586. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 312, __pyx_L1_error)
  3587. __Pyx_GOTREF(__pyx_t_1);
  3588. __pyx_r = __pyx_t_1;
  3589. __pyx_t_1 = 0;
  3590. goto __pyx_L0;
  3591. /* "gedlibpy.pyx":298
  3592. *
  3593. *
  3594. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3595. * """
  3596. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3597. */
  3598. /* function exit code */
  3599. __pyx_L1_error:;
  3600. __Pyx_XDECREF(__pyx_t_1);
  3601. __Pyx_XDECREF(__pyx_t_2);
  3602. __Pyx_XDECREF(__pyx_t_3);
  3603. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3604. __pyx_r = NULL;
  3605. __pyx_L0:;
  3606. __Pyx_XGIVEREF(__pyx_r);
  3607. __Pyx_RefNannyFinishContext();
  3608. return __pyx_r;
  3609. }
  3610. /* "gedlibpy.pyx":315
  3611. *
  3612. *
  3613. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3614. * """
  3615. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3616. */
  3617. /* Python wrapper */
  3618. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3619. 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";
  3620. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3621. PyObject *__pyx_v_graph_id = 0;
  3622. PyObject *__pyx_v_node_id = 0;
  3623. PyObject *__pyx_v_node_label = 0;
  3624. PyObject *__pyx_r = 0;
  3625. __Pyx_RefNannyDeclarations
  3626. __Pyx_RefNannySetupContext("add_node (wrapper)", 0);
  3627. {
  3628. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_node_id,&__pyx_n_s_node_label,0};
  3629. PyObject* values[3] = {0,0,0};
  3630. if (unlikely(__pyx_kwds)) {
  3631. Py_ssize_t kw_args;
  3632. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3633. switch (pos_args) {
  3634. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3635. CYTHON_FALLTHROUGH;
  3636. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3637. CYTHON_FALLTHROUGH;
  3638. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3639. CYTHON_FALLTHROUGH;
  3640. case 0: break;
  3641. default: goto __pyx_L5_argtuple_error;
  3642. }
  3643. kw_args = PyDict_Size(__pyx_kwds);
  3644. switch (pos_args) {
  3645. case 0:
  3646. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3647. else goto __pyx_L5_argtuple_error;
  3648. CYTHON_FALLTHROUGH;
  3649. case 1:
  3650. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  3651. else {
  3652. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 315, __pyx_L3_error)
  3653. }
  3654. CYTHON_FALLTHROUGH;
  3655. case 2:
  3656. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label)) != 0)) kw_args--;
  3657. else {
  3658. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 315, __pyx_L3_error)
  3659. }
  3660. }
  3661. if (unlikely(kw_args > 0)) {
  3662. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 315, __pyx_L3_error)
  3663. }
  3664. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  3665. goto __pyx_L5_argtuple_error;
  3666. } else {
  3667. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3668. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3669. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3670. }
  3671. __pyx_v_graph_id = values[0];
  3672. __pyx_v_node_id = values[1];
  3673. __pyx_v_node_label = values[2];
  3674. }
  3675. goto __pyx_L4_argument_unpacking_done;
  3676. __pyx_L5_argtuple_error:;
  3677. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 315, __pyx_L3_error)
  3678. __pyx_L3_error:;
  3679. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3680. __Pyx_RefNannyFinishContext();
  3681. return NULL;
  3682. __pyx_L4_argument_unpacking_done:;
  3683. __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);
  3684. /* function exit code */
  3685. __Pyx_RefNannyFinishContext();
  3686. return __pyx_r;
  3687. }
  3688. 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) {
  3689. PyObject *__pyx_r = NULL;
  3690. __Pyx_RefNannyDeclarations
  3691. size_t __pyx_t_1;
  3692. PyObject *__pyx_t_2 = NULL;
  3693. PyObject *__pyx_t_3 = NULL;
  3694. PyObject *__pyx_t_4 = NULL;
  3695. std::string __pyx_t_5;
  3696. std::map<std::string,std::string> __pyx_t_6;
  3697. __Pyx_RefNannySetupContext("add_node", 0);
  3698. /* "gedlibpy.pyx":329
  3699. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3700. * """
  3701. * self.c_env.addNode(graph_id, node_id.encode('utf-8'), encode_your_map(node_label)) # <<<<<<<<<<<<<<
  3702. *
  3703. *
  3704. */
  3705. __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, 329, __pyx_L1_error)
  3706. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
  3707. __Pyx_GOTREF(__pyx_t_3);
  3708. __pyx_t_4 = NULL;
  3709. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3710. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3711. if (likely(__pyx_t_4)) {
  3712. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3713. __Pyx_INCREF(__pyx_t_4);
  3714. __Pyx_INCREF(function);
  3715. __Pyx_DECREF_SET(__pyx_t_3, function);
  3716. }
  3717. }
  3718. __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);
  3719. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3720. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
  3721. __Pyx_GOTREF(__pyx_t_2);
  3722. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3723. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 329, __pyx_L1_error)
  3724. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3725. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 329, __pyx_L1_error)
  3726. __Pyx_GOTREF(__pyx_t_3);
  3727. __pyx_t_4 = NULL;
  3728. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3729. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3730. if (likely(__pyx_t_4)) {
  3731. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3732. __Pyx_INCREF(__pyx_t_4);
  3733. __Pyx_INCREF(function);
  3734. __Pyx_DECREF_SET(__pyx_t_3, function);
  3735. }
  3736. }
  3737. __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);
  3738. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3739. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 329, __pyx_L1_error)
  3740. __Pyx_GOTREF(__pyx_t_2);
  3741. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3742. __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, 329, __pyx_L1_error)
  3743. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3744. try {
  3745. __pyx_v_self->c_env->addNode(__pyx_t_1, __pyx_t_5, __pyx_t_6);
  3746. } catch(...) {
  3747. __Pyx_CppExn2PyErr();
  3748. __PYX_ERR(0, 329, __pyx_L1_error)
  3749. }
  3750. /* "gedlibpy.pyx":315
  3751. *
  3752. *
  3753. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3754. * """
  3755. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3756. */
  3757. /* function exit code */
  3758. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3759. goto __pyx_L0;
  3760. __pyx_L1_error:;
  3761. __Pyx_XDECREF(__pyx_t_2);
  3762. __Pyx_XDECREF(__pyx_t_3);
  3763. __Pyx_XDECREF(__pyx_t_4);
  3764. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3765. __pyx_r = NULL;
  3766. __pyx_L0:;
  3767. __Pyx_XGIVEREF(__pyx_r);
  3768. __Pyx_RefNannyFinishContext();
  3769. return __pyx_r;
  3770. }
  3771. /* "gedlibpy.pyx":332
  3772. *
  3773. *
  3774. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3775. * """
  3776. * Adds an edge on a graph selected by its ID.
  3777. */
  3778. /* Python wrapper */
  3779. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3780. 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";
  3781. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3782. PyObject *__pyx_v_graph_id = 0;
  3783. PyObject *__pyx_v_tail = 0;
  3784. PyObject *__pyx_v_head = 0;
  3785. PyObject *__pyx_v_edge_label = 0;
  3786. PyObject *__pyx_v_ignore_duplicates = 0;
  3787. PyObject *__pyx_r = 0;
  3788. __Pyx_RefNannyDeclarations
  3789. __Pyx_RefNannySetupContext("add_edge (wrapper)", 0);
  3790. {
  3791. 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};
  3792. PyObject* values[5] = {0,0,0,0,0};
  3793. values[4] = ((PyObject *)Py_True);
  3794. if (unlikely(__pyx_kwds)) {
  3795. Py_ssize_t kw_args;
  3796. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3797. switch (pos_args) {
  3798. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3799. CYTHON_FALLTHROUGH;
  3800. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3801. CYTHON_FALLTHROUGH;
  3802. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3803. CYTHON_FALLTHROUGH;
  3804. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3805. CYTHON_FALLTHROUGH;
  3806. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3807. CYTHON_FALLTHROUGH;
  3808. case 0: break;
  3809. default: goto __pyx_L5_argtuple_error;
  3810. }
  3811. kw_args = PyDict_Size(__pyx_kwds);
  3812. switch (pos_args) {
  3813. case 0:
  3814. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3815. else goto __pyx_L5_argtuple_error;
  3816. CYTHON_FALLTHROUGH;
  3817. case 1:
  3818. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  3819. else {
  3820. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 332, __pyx_L3_error)
  3821. }
  3822. CYTHON_FALLTHROUGH;
  3823. case 2:
  3824. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  3825. else {
  3826. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 332, __pyx_L3_error)
  3827. }
  3828. CYTHON_FALLTHROUGH;
  3829. case 3:
  3830. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  3831. else {
  3832. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 332, __pyx_L3_error)
  3833. }
  3834. CYTHON_FALLTHROUGH;
  3835. case 4:
  3836. if (kw_args > 0) {
  3837. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  3838. if (value) { values[4] = value; kw_args--; }
  3839. }
  3840. }
  3841. if (unlikely(kw_args > 0)) {
  3842. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 332, __pyx_L3_error)
  3843. }
  3844. } else {
  3845. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3846. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3847. CYTHON_FALLTHROUGH;
  3848. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3849. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3850. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3851. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3852. break;
  3853. default: goto __pyx_L5_argtuple_error;
  3854. }
  3855. }
  3856. __pyx_v_graph_id = values[0];
  3857. __pyx_v_tail = values[1];
  3858. __pyx_v_head = values[2];
  3859. __pyx_v_edge_label = values[3];
  3860. __pyx_v_ignore_duplicates = values[4];
  3861. }
  3862. goto __pyx_L4_argument_unpacking_done;
  3863. __pyx_L5_argtuple_error:;
  3864. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 332, __pyx_L3_error)
  3865. __pyx_L3_error:;
  3866. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3867. __Pyx_RefNannyFinishContext();
  3868. return NULL;
  3869. __pyx_L4_argument_unpacking_done:;
  3870. __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);
  3871. /* function exit code */
  3872. __Pyx_RefNannyFinishContext();
  3873. return __pyx_r;
  3874. }
  3875. 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) {
  3876. PyObject *__pyx_r = NULL;
  3877. __Pyx_RefNannyDeclarations
  3878. size_t __pyx_t_1;
  3879. PyObject *__pyx_t_2 = NULL;
  3880. PyObject *__pyx_t_3 = NULL;
  3881. PyObject *__pyx_t_4 = NULL;
  3882. std::string __pyx_t_5;
  3883. std::string __pyx_t_6;
  3884. std::map<std::string,std::string> __pyx_t_7;
  3885. bool __pyx_t_8;
  3886. __Pyx_RefNannySetupContext("add_edge", 0);
  3887. /* "gedlibpy.pyx":350
  3888. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3889. * """
  3890. * self.c_env.addEdge(graph_id, tail.encode('utf-8'), head.encode('utf-8'), encode_your_map(edge_label), ignore_duplicates) # <<<<<<<<<<<<<<
  3891. *
  3892. *
  3893. */
  3894. __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, 350, __pyx_L1_error)
  3895. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  3896. __Pyx_GOTREF(__pyx_t_3);
  3897. __pyx_t_4 = NULL;
  3898. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3899. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3900. if (likely(__pyx_t_4)) {
  3901. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3902. __Pyx_INCREF(__pyx_t_4);
  3903. __Pyx_INCREF(function);
  3904. __Pyx_DECREF_SET(__pyx_t_3, function);
  3905. }
  3906. }
  3907. __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);
  3908. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3909. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
  3910. __Pyx_GOTREF(__pyx_t_2);
  3911. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3912. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error)
  3913. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3914. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  3915. __Pyx_GOTREF(__pyx_t_3);
  3916. __pyx_t_4 = NULL;
  3917. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3918. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3919. if (likely(__pyx_t_4)) {
  3920. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3921. __Pyx_INCREF(__pyx_t_4);
  3922. __Pyx_INCREF(function);
  3923. __Pyx_DECREF_SET(__pyx_t_3, function);
  3924. }
  3925. }
  3926. __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);
  3927. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3928. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
  3929. __Pyx_GOTREF(__pyx_t_2);
  3930. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3931. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error)
  3932. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3933. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
  3934. __Pyx_GOTREF(__pyx_t_3);
  3935. __pyx_t_4 = NULL;
  3936. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3937. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3938. if (likely(__pyx_t_4)) {
  3939. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3940. __Pyx_INCREF(__pyx_t_4);
  3941. __Pyx_INCREF(function);
  3942. __Pyx_DECREF_SET(__pyx_t_3, function);
  3943. }
  3944. }
  3945. __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);
  3946. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3947. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
  3948. __Pyx_GOTREF(__pyx_t_2);
  3949. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3950. __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, 350, __pyx_L1_error)
  3951. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3952. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_duplicates); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 350, __pyx_L1_error)
  3953. try {
  3954. __pyx_v_self->c_env->addEdge(__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
  3955. } catch(...) {
  3956. __Pyx_CppExn2PyErr();
  3957. __PYX_ERR(0, 350, __pyx_L1_error)
  3958. }
  3959. /* "gedlibpy.pyx":332
  3960. *
  3961. *
  3962. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3963. * """
  3964. * Adds an edge on a graph selected by its ID.
  3965. */
  3966. /* function exit code */
  3967. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3968. goto __pyx_L0;
  3969. __pyx_L1_error:;
  3970. __Pyx_XDECREF(__pyx_t_2);
  3971. __Pyx_XDECREF(__pyx_t_3);
  3972. __Pyx_XDECREF(__pyx_t_4);
  3973. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3974. __pyx_r = NULL;
  3975. __pyx_L0:;
  3976. __Pyx_XGIVEREF(__pyx_r);
  3977. __Pyx_RefNannyFinishContext();
  3978. return __pyx_r;
  3979. }
  3980. /* "gedlibpy.pyx":353
  3981. *
  3982. *
  3983. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  3984. * """
  3985. * Adds a symmetrical edge on a graph selected by its ID.
  3986. */
  3987. /* Python wrapper */
  3988. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3989. 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";
  3990. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3991. PyObject *__pyx_v_graph_id = 0;
  3992. PyObject *__pyx_v_tail = 0;
  3993. PyObject *__pyx_v_head = 0;
  3994. PyObject *__pyx_v_edge_label = 0;
  3995. PyObject *__pyx_r = 0;
  3996. __Pyx_RefNannyDeclarations
  3997. __Pyx_RefNannySetupContext("add_symmetrical_edge (wrapper)", 0);
  3998. {
  3999. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_tail,&__pyx_n_s_head,&__pyx_n_s_edge_label,0};
  4000. PyObject* values[4] = {0,0,0,0};
  4001. if (unlikely(__pyx_kwds)) {
  4002. Py_ssize_t kw_args;
  4003. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4004. switch (pos_args) {
  4005. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4006. CYTHON_FALLTHROUGH;
  4007. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4008. CYTHON_FALLTHROUGH;
  4009. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4010. CYTHON_FALLTHROUGH;
  4011. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4012. CYTHON_FALLTHROUGH;
  4013. case 0: break;
  4014. default: goto __pyx_L5_argtuple_error;
  4015. }
  4016. kw_args = PyDict_Size(__pyx_kwds);
  4017. switch (pos_args) {
  4018. case 0:
  4019. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  4020. else goto __pyx_L5_argtuple_error;
  4021. CYTHON_FALLTHROUGH;
  4022. case 1:
  4023. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  4024. else {
  4025. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 353, __pyx_L3_error)
  4026. }
  4027. CYTHON_FALLTHROUGH;
  4028. case 2:
  4029. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  4030. else {
  4031. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 353, __pyx_L3_error)
  4032. }
  4033. CYTHON_FALLTHROUGH;
  4034. case 3:
  4035. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  4036. else {
  4037. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 353, __pyx_L3_error)
  4038. }
  4039. }
  4040. if (unlikely(kw_args > 0)) {
  4041. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 353, __pyx_L3_error)
  4042. }
  4043. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  4044. goto __pyx_L5_argtuple_error;
  4045. } else {
  4046. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4047. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4048. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4049. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4050. }
  4051. __pyx_v_graph_id = values[0];
  4052. __pyx_v_tail = values[1];
  4053. __pyx_v_head = values[2];
  4054. __pyx_v_edge_label = values[3];
  4055. }
  4056. goto __pyx_L4_argument_unpacking_done;
  4057. __pyx_L5_argtuple_error:;
  4058. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 353, __pyx_L3_error)
  4059. __pyx_L3_error:;
  4060. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4061. __Pyx_RefNannyFinishContext();
  4062. return NULL;
  4063. __pyx_L4_argument_unpacking_done:;
  4064. __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);
  4065. /* function exit code */
  4066. __Pyx_RefNannyFinishContext();
  4067. return __pyx_r;
  4068. }
  4069. 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) {
  4070. PyObject *__pyx_v_tailB = NULL;
  4071. PyObject *__pyx_v_headB = NULL;
  4072. PyObject *__pyx_v_edgeLabelB = NULL;
  4073. PyObject *__pyx_r = NULL;
  4074. __Pyx_RefNannyDeclarations
  4075. PyObject *__pyx_t_1 = NULL;
  4076. PyObject *__pyx_t_2 = NULL;
  4077. PyObject *__pyx_t_3 = NULL;
  4078. size_t __pyx_t_4;
  4079. std::string __pyx_t_5;
  4080. std::string __pyx_t_6;
  4081. std::map<std::string,std::string> __pyx_t_7;
  4082. __Pyx_RefNannySetupContext("add_symmetrical_edge", 0);
  4083. /* "gedlibpy.pyx":369
  4084. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  4085. * """
  4086. * tailB = tail.encode('utf-8') # <<<<<<<<<<<<<<
  4087. * headB = head.encode('utf-8')
  4088. * edgeLabelB = encode_your_map(edge_label)
  4089. */
  4090. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 369, __pyx_L1_error)
  4091. __Pyx_GOTREF(__pyx_t_2);
  4092. __pyx_t_3 = NULL;
  4093. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4094. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4095. if (likely(__pyx_t_3)) {
  4096. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4097. __Pyx_INCREF(__pyx_t_3);
  4098. __Pyx_INCREF(function);
  4099. __Pyx_DECREF_SET(__pyx_t_2, function);
  4100. }
  4101. }
  4102. __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);
  4103. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4104. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  4105. __Pyx_GOTREF(__pyx_t_1);
  4106. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4107. __pyx_v_tailB = __pyx_t_1;
  4108. __pyx_t_1 = 0;
  4109. /* "gedlibpy.pyx":370
  4110. * """
  4111. * tailB = tail.encode('utf-8')
  4112. * headB = head.encode('utf-8') # <<<<<<<<<<<<<<
  4113. * edgeLabelB = encode_your_map(edge_label)
  4114. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4115. */
  4116. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 370, __pyx_L1_error)
  4117. __Pyx_GOTREF(__pyx_t_2);
  4118. __pyx_t_3 = NULL;
  4119. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4120. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4121. if (likely(__pyx_t_3)) {
  4122. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4123. __Pyx_INCREF(__pyx_t_3);
  4124. __Pyx_INCREF(function);
  4125. __Pyx_DECREF_SET(__pyx_t_2, function);
  4126. }
  4127. }
  4128. __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);
  4129. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4130. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  4131. __Pyx_GOTREF(__pyx_t_1);
  4132. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4133. __pyx_v_headB = __pyx_t_1;
  4134. __pyx_t_1 = 0;
  4135. /* "gedlibpy.pyx":371
  4136. * tailB = tail.encode('utf-8')
  4137. * headB = head.encode('utf-8')
  4138. * edgeLabelB = encode_your_map(edge_label) # <<<<<<<<<<<<<<
  4139. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4140. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4141. */
  4142. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 371, __pyx_L1_error)
  4143. __Pyx_GOTREF(__pyx_t_2);
  4144. __pyx_t_3 = NULL;
  4145. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4146. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4147. if (likely(__pyx_t_3)) {
  4148. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4149. __Pyx_INCREF(__pyx_t_3);
  4150. __Pyx_INCREF(function);
  4151. __Pyx_DECREF_SET(__pyx_t_2, function);
  4152. }
  4153. }
  4154. __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);
  4155. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4156. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
  4157. __Pyx_GOTREF(__pyx_t_1);
  4158. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4159. __pyx_v_edgeLabelB = __pyx_t_1;
  4160. __pyx_t_1 = 0;
  4161. /* "gedlibpy.pyx":372
  4162. * headB = head.encode('utf-8')
  4163. * edgeLabelB = encode_your_map(edge_label)
  4164. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4165. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4166. *
  4167. */
  4168. __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, 372, __pyx_L1_error)
  4169. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error)
  4170. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 372, __pyx_L1_error)
  4171. __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, 372, __pyx_L1_error)
  4172. try {
  4173. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, 1);
  4174. } catch(...) {
  4175. __Pyx_CppExn2PyErr();
  4176. __PYX_ERR(0, 372, __pyx_L1_error)
  4177. }
  4178. /* "gedlibpy.pyx":373
  4179. * edgeLabelB = encode_your_map(edge_label)
  4180. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4181. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4182. *
  4183. *
  4184. */
  4185. __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, 373, __pyx_L1_error)
  4186. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error)
  4187. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 373, __pyx_L1_error)
  4188. __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, 373, __pyx_L1_error)
  4189. try {
  4190. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_t_7, 1);
  4191. } catch(...) {
  4192. __Pyx_CppExn2PyErr();
  4193. __PYX_ERR(0, 373, __pyx_L1_error)
  4194. }
  4195. /* "gedlibpy.pyx":353
  4196. *
  4197. *
  4198. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  4199. * """
  4200. * Adds a symmetrical edge on a graph selected by its ID.
  4201. */
  4202. /* function exit code */
  4203. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4204. goto __pyx_L0;
  4205. __pyx_L1_error:;
  4206. __Pyx_XDECREF(__pyx_t_1);
  4207. __Pyx_XDECREF(__pyx_t_2);
  4208. __Pyx_XDECREF(__pyx_t_3);
  4209. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4210. __pyx_r = NULL;
  4211. __pyx_L0:;
  4212. __Pyx_XDECREF(__pyx_v_tailB);
  4213. __Pyx_XDECREF(__pyx_v_headB);
  4214. __Pyx_XDECREF(__pyx_v_edgeLabelB);
  4215. __Pyx_XGIVEREF(__pyx_r);
  4216. __Pyx_RefNannyFinishContext();
  4217. return __pyx_r;
  4218. }
  4219. /* "gedlibpy.pyx":376
  4220. *
  4221. *
  4222. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4223. * """
  4224. * Deletes a graph, selected by its ID, to the environment.
  4225. */
  4226. /* Python wrapper */
  4227. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4228. 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";
  4229. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4230. PyObject *__pyx_r = 0;
  4231. __Pyx_RefNannyDeclarations
  4232. __Pyx_RefNannySetupContext("clear_graph (wrapper)", 0);
  4233. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4234. /* function exit code */
  4235. __Pyx_RefNannyFinishContext();
  4236. return __pyx_r;
  4237. }
  4238. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4239. PyObject *__pyx_r = NULL;
  4240. __Pyx_RefNannyDeclarations
  4241. size_t __pyx_t_1;
  4242. __Pyx_RefNannySetupContext("clear_graph", 0);
  4243. /* "gedlibpy.pyx":385
  4244. * .. note:: Call init() after you're finished your modifications.
  4245. * """
  4246. * self.c_env.clearGraph(graph_id) # <<<<<<<<<<<<<<
  4247. *
  4248. *
  4249. */
  4250. __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, 385, __pyx_L1_error)
  4251. try {
  4252. __pyx_v_self->c_env->clearGraph(__pyx_t_1);
  4253. } catch(...) {
  4254. __Pyx_CppExn2PyErr();
  4255. __PYX_ERR(0, 385, __pyx_L1_error)
  4256. }
  4257. /* "gedlibpy.pyx":376
  4258. *
  4259. *
  4260. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4261. * """
  4262. * Deletes a graph, selected by its ID, to the environment.
  4263. */
  4264. /* function exit code */
  4265. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4266. goto __pyx_L0;
  4267. __pyx_L1_error:;
  4268. __Pyx_AddTraceback("gedlibpy.GEDEnv.clear_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4269. __pyx_r = NULL;
  4270. __pyx_L0:;
  4271. __Pyx_XGIVEREF(__pyx_r);
  4272. __Pyx_RefNannyFinishContext();
  4273. return __pyx_r;
  4274. }
  4275. /* "gedlibpy.pyx":388
  4276. *
  4277. *
  4278. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4279. * """
  4280. * Searchs and returns the internal Id of a graph, selected by its ID.
  4281. */
  4282. /* Python wrapper */
  4283. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4284. 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";
  4285. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4286. PyObject *__pyx_r = 0;
  4287. __Pyx_RefNannyDeclarations
  4288. __Pyx_RefNannySetupContext("get_graph_internal_id (wrapper)", 0);
  4289. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4290. /* function exit code */
  4291. __Pyx_RefNannyFinishContext();
  4292. return __pyx_r;
  4293. }
  4294. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4295. PyObject *__pyx_r = NULL;
  4296. __Pyx_RefNannyDeclarations
  4297. size_t __pyx_t_1;
  4298. size_t __pyx_t_2;
  4299. PyObject *__pyx_t_3 = NULL;
  4300. __Pyx_RefNannySetupContext("get_graph_internal_id", 0);
  4301. /* "gedlibpy.pyx":400
  4302. * .. note:: These functions allow to collect all the graph's informations.
  4303. * """
  4304. * return self.c_env.getGraphInternalId(graph_id) # <<<<<<<<<<<<<<
  4305. *
  4306. *
  4307. */
  4308. __Pyx_XDECREF(__pyx_r);
  4309. __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, 400, __pyx_L1_error)
  4310. try {
  4311. __pyx_t_2 = __pyx_v_self->c_env->getGraphInternalId(__pyx_t_1);
  4312. } catch(...) {
  4313. __Pyx_CppExn2PyErr();
  4314. __PYX_ERR(0, 400, __pyx_L1_error)
  4315. }
  4316. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
  4317. __Pyx_GOTREF(__pyx_t_3);
  4318. __pyx_r = __pyx_t_3;
  4319. __pyx_t_3 = 0;
  4320. goto __pyx_L0;
  4321. /* "gedlibpy.pyx":388
  4322. *
  4323. *
  4324. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4325. * """
  4326. * Searchs and returns the internal Id of a graph, selected by its ID.
  4327. */
  4328. /* function exit code */
  4329. __pyx_L1_error:;
  4330. __Pyx_XDECREF(__pyx_t_3);
  4331. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_internal_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4332. __pyx_r = NULL;
  4333. __pyx_L0:;
  4334. __Pyx_XGIVEREF(__pyx_r);
  4335. __Pyx_RefNannyFinishContext();
  4336. return __pyx_r;
  4337. }
  4338. /* "gedlibpy.pyx":403
  4339. *
  4340. *
  4341. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4342. * """
  4343. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4344. */
  4345. /* Python wrapper */
  4346. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4347. 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";
  4348. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4349. PyObject *__pyx_r = 0;
  4350. __Pyx_RefNannyDeclarations
  4351. __Pyx_RefNannySetupContext("get_graph_num_nodes (wrapper)", 0);
  4352. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4353. /* function exit code */
  4354. __Pyx_RefNannyFinishContext();
  4355. return __pyx_r;
  4356. }
  4357. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4358. PyObject *__pyx_r = NULL;
  4359. __Pyx_RefNannyDeclarations
  4360. size_t __pyx_t_1;
  4361. size_t __pyx_t_2;
  4362. PyObject *__pyx_t_3 = NULL;
  4363. __Pyx_RefNannySetupContext("get_graph_num_nodes", 0);
  4364. /* "gedlibpy.pyx":415
  4365. * .. note:: These functions allow to collect all the graph's informations.
  4366. * """
  4367. * return self.c_env.getGraphNumNodes(graph_id) # <<<<<<<<<<<<<<
  4368. *
  4369. *
  4370. */
  4371. __Pyx_XDECREF(__pyx_r);
  4372. __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, 415, __pyx_L1_error)
  4373. try {
  4374. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumNodes(__pyx_t_1);
  4375. } catch(...) {
  4376. __Pyx_CppExn2PyErr();
  4377. __PYX_ERR(0, 415, __pyx_L1_error)
  4378. }
  4379. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
  4380. __Pyx_GOTREF(__pyx_t_3);
  4381. __pyx_r = __pyx_t_3;
  4382. __pyx_t_3 = 0;
  4383. goto __pyx_L0;
  4384. /* "gedlibpy.pyx":403
  4385. *
  4386. *
  4387. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4388. * """
  4389. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4390. */
  4391. /* function exit code */
  4392. __pyx_L1_error:;
  4393. __Pyx_XDECREF(__pyx_t_3);
  4394. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4395. __pyx_r = NULL;
  4396. __pyx_L0:;
  4397. __Pyx_XGIVEREF(__pyx_r);
  4398. __Pyx_RefNannyFinishContext();
  4399. return __pyx_r;
  4400. }
  4401. /* "gedlibpy.pyx":418
  4402. *
  4403. *
  4404. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4405. * """
  4406. * Searchs and returns the number of edges on a graph, selected by its ID.
  4407. */
  4408. /* Python wrapper */
  4409. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4410. 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";
  4411. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4412. PyObject *__pyx_r = 0;
  4413. __Pyx_RefNannyDeclarations
  4414. __Pyx_RefNannySetupContext("get_graph_num_edges (wrapper)", 0);
  4415. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4416. /* function exit code */
  4417. __Pyx_RefNannyFinishContext();
  4418. return __pyx_r;
  4419. }
  4420. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4421. PyObject *__pyx_r = NULL;
  4422. __Pyx_RefNannyDeclarations
  4423. size_t __pyx_t_1;
  4424. size_t __pyx_t_2;
  4425. PyObject *__pyx_t_3 = NULL;
  4426. __Pyx_RefNannySetupContext("get_graph_num_edges", 0);
  4427. /* "gedlibpy.pyx":430
  4428. * .. note:: These functions allow to collect all the graph's informations.
  4429. * """
  4430. * return self.c_env.getGraphNumEdges(graph_id) # <<<<<<<<<<<<<<
  4431. *
  4432. *
  4433. */
  4434. __Pyx_XDECREF(__pyx_r);
  4435. __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, 430, __pyx_L1_error)
  4436. try {
  4437. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumEdges(__pyx_t_1);
  4438. } catch(...) {
  4439. __Pyx_CppExn2PyErr();
  4440. __PYX_ERR(0, 430, __pyx_L1_error)
  4441. }
  4442. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
  4443. __Pyx_GOTREF(__pyx_t_3);
  4444. __pyx_r = __pyx_t_3;
  4445. __pyx_t_3 = 0;
  4446. goto __pyx_L0;
  4447. /* "gedlibpy.pyx":418
  4448. *
  4449. *
  4450. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4451. * """
  4452. * Searchs and returns the number of edges on a graph, selected by its ID.
  4453. */
  4454. /* function exit code */
  4455. __pyx_L1_error:;
  4456. __Pyx_XDECREF(__pyx_t_3);
  4457. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4458. __pyx_r = NULL;
  4459. __pyx_L0:;
  4460. __Pyx_XGIVEREF(__pyx_r);
  4461. __Pyx_RefNannyFinishContext();
  4462. return __pyx_r;
  4463. }
  4464. /* "gedlibpy.pyx":433
  4465. *
  4466. *
  4467. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4468. * """
  4469. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4470. */
  4471. /* Python wrapper */
  4472. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4473. 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";
  4474. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4475. PyObject *__pyx_r = 0;
  4476. __Pyx_RefNannyDeclarations
  4477. __Pyx_RefNannySetupContext("get_original_node_ids (wrapper)", 0);
  4478. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4479. /* function exit code */
  4480. __Pyx_RefNannyFinishContext();
  4481. return __pyx_r;
  4482. }
  4483. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4484. std::string __pyx_8genexpr3__pyx_v_gid;
  4485. PyObject *__pyx_r = NULL;
  4486. __Pyx_RefNannyDeclarations
  4487. PyObject *__pyx_t_1 = NULL;
  4488. size_t __pyx_t_2;
  4489. std::vector<std::string> __pyx_t_3;
  4490. std::vector<std::string> ::iterator __pyx_t_4;
  4491. std::vector<std::string> *__pyx_t_5;
  4492. std::string __pyx_t_6;
  4493. PyObject *__pyx_t_7 = NULL;
  4494. __Pyx_RefNannySetupContext("get_original_node_ids", 0);
  4495. /* "gedlibpy.pyx":445
  4496. * .. note:: These functions allow to collect all the graph's informations.
  4497. * """
  4498. * return [gid.decode('utf-8') for gid in self.c_env.getGraphOriginalNodeIds(graph_id)] # <<<<<<<<<<<<<<
  4499. *
  4500. *
  4501. */
  4502. __Pyx_XDECREF(__pyx_r);
  4503. { /* enter inner scope */
  4504. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 445, __pyx_L1_error)
  4505. __Pyx_GOTREF(__pyx_t_1);
  4506. __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, 445, __pyx_L1_error)
  4507. try {
  4508. __pyx_t_3 = __pyx_v_self->c_env->getGraphOriginalNodeIds(__pyx_t_2);
  4509. } catch(...) {
  4510. __Pyx_CppExn2PyErr();
  4511. __PYX_ERR(0, 445, __pyx_L1_error)
  4512. }
  4513. __pyx_t_5 = &__pyx_t_3;
  4514. __pyx_t_4 = __pyx_t_5->begin();
  4515. for (;;) {
  4516. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4517. __pyx_t_6 = *__pyx_t_4;
  4518. ++__pyx_t_4;
  4519. __pyx_8genexpr3__pyx_v_gid = __pyx_t_6;
  4520. __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, 445, __pyx_L1_error)
  4521. __Pyx_GOTREF(__pyx_t_7);
  4522. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 445, __pyx_L1_error)
  4523. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4524. }
  4525. } /* exit inner scope */
  4526. __pyx_r = __pyx_t_1;
  4527. __pyx_t_1 = 0;
  4528. goto __pyx_L0;
  4529. /* "gedlibpy.pyx":433
  4530. *
  4531. *
  4532. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4533. * """
  4534. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4535. */
  4536. /* function exit code */
  4537. __pyx_L1_error:;
  4538. __Pyx_XDECREF(__pyx_t_1);
  4539. __Pyx_XDECREF(__pyx_t_7);
  4540. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_original_node_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4541. __pyx_r = NULL;
  4542. __pyx_L0:;
  4543. __Pyx_XGIVEREF(__pyx_r);
  4544. __Pyx_RefNannyFinishContext();
  4545. return __pyx_r;
  4546. }
  4547. /* "gedlibpy.pyx":448
  4548. *
  4549. *
  4550. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4551. * """
  4552. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4553. */
  4554. /* Python wrapper */
  4555. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4556. 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";
  4557. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4558. PyObject *__pyx_r = 0;
  4559. __Pyx_RefNannyDeclarations
  4560. __Pyx_RefNannySetupContext("get_graph_node_labels (wrapper)", 0);
  4561. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4562. /* function exit code */
  4563. __Pyx_RefNannyFinishContext();
  4564. return __pyx_r;
  4565. }
  4566. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4567. std::map<std::string,std::string> __pyx_8genexpr4__pyx_v_node_label;
  4568. PyObject *__pyx_r = NULL;
  4569. __Pyx_RefNannyDeclarations
  4570. PyObject *__pyx_t_1 = NULL;
  4571. size_t __pyx_t_2;
  4572. std::vector<std::map<std::string,std::string> > __pyx_t_3;
  4573. std::vector<std::map<std::string,std::string> > ::iterator __pyx_t_4;
  4574. std::vector<std::map<std::string,std::string> > *__pyx_t_5;
  4575. std::map<std::string,std::string> __pyx_t_6;
  4576. PyObject *__pyx_t_7 = NULL;
  4577. PyObject *__pyx_t_8 = NULL;
  4578. PyObject *__pyx_t_9 = NULL;
  4579. PyObject *__pyx_t_10 = NULL;
  4580. __Pyx_RefNannySetupContext("get_graph_node_labels", 0);
  4581. /* "gedlibpy.pyx":460
  4582. * .. note:: These functions allow to collect all the graph's informations.
  4583. * """
  4584. * return [decode_your_map(node_label) for node_label in self.c_env.getGraphNodeLabels(graph_id)] # <<<<<<<<<<<<<<
  4585. *
  4586. *
  4587. */
  4588. __Pyx_XDECREF(__pyx_r);
  4589. { /* enter inner scope */
  4590. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
  4591. __Pyx_GOTREF(__pyx_t_1);
  4592. __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, 460, __pyx_L1_error)
  4593. try {
  4594. __pyx_t_3 = __pyx_v_self->c_env->getGraphNodeLabels(__pyx_t_2);
  4595. } catch(...) {
  4596. __Pyx_CppExn2PyErr();
  4597. __PYX_ERR(0, 460, __pyx_L1_error)
  4598. }
  4599. __pyx_t_5 = &__pyx_t_3;
  4600. __pyx_t_4 = __pyx_t_5->begin();
  4601. for (;;) {
  4602. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4603. __pyx_t_6 = *__pyx_t_4;
  4604. ++__pyx_t_4;
  4605. __pyx_8genexpr4__pyx_v_node_label = __pyx_t_6;
  4606. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 460, __pyx_L1_error)
  4607. __Pyx_GOTREF(__pyx_t_8);
  4608. __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, 460, __pyx_L1_error)
  4609. __Pyx_GOTREF(__pyx_t_9);
  4610. __pyx_t_10 = NULL;
  4611. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  4612. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
  4613. if (likely(__pyx_t_10)) {
  4614. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  4615. __Pyx_INCREF(__pyx_t_10);
  4616. __Pyx_INCREF(function);
  4617. __Pyx_DECREF_SET(__pyx_t_8, function);
  4618. }
  4619. }
  4620. __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);
  4621. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  4622. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4623. if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 460, __pyx_L1_error)
  4624. __Pyx_GOTREF(__pyx_t_7);
  4625. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4626. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 460, __pyx_L1_error)
  4627. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4628. }
  4629. } /* exit inner scope */
  4630. __pyx_r = __pyx_t_1;
  4631. __pyx_t_1 = 0;
  4632. goto __pyx_L0;
  4633. /* "gedlibpy.pyx":448
  4634. *
  4635. *
  4636. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4637. * """
  4638. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4639. */
  4640. /* function exit code */
  4641. __pyx_L1_error:;
  4642. __Pyx_XDECREF(__pyx_t_1);
  4643. __Pyx_XDECREF(__pyx_t_7);
  4644. __Pyx_XDECREF(__pyx_t_8);
  4645. __Pyx_XDECREF(__pyx_t_9);
  4646. __Pyx_XDECREF(__pyx_t_10);
  4647. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4648. __pyx_r = NULL;
  4649. __pyx_L0:;
  4650. __Pyx_XGIVEREF(__pyx_r);
  4651. __Pyx_RefNannyFinishContext();
  4652. return __pyx_r;
  4653. }
  4654. /* "gedlibpy.pyx":463
  4655. *
  4656. *
  4657. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4658. * """
  4659. * Searchs and returns all the edges on a graph, selected by its ID.
  4660. */
  4661. /* Python wrapper */
  4662. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4663. 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";
  4664. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4665. PyObject *__pyx_r = 0;
  4666. __Pyx_RefNannyDeclarations
  4667. __Pyx_RefNannySetupContext("get_graph_edges (wrapper)", 0);
  4668. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4669. /* function exit code */
  4670. __Pyx_RefNannyFinishContext();
  4671. return __pyx_r;
  4672. }
  4673. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4674. PyObject *__pyx_r = NULL;
  4675. __Pyx_RefNannyDeclarations
  4676. PyObject *__pyx_t_1 = NULL;
  4677. PyObject *__pyx_t_2 = NULL;
  4678. size_t __pyx_t_3;
  4679. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > __pyx_t_4;
  4680. PyObject *__pyx_t_5 = NULL;
  4681. PyObject *__pyx_t_6 = NULL;
  4682. __Pyx_RefNannySetupContext("get_graph_edges", 0);
  4683. /* "gedlibpy.pyx":475
  4684. * .. note:: These functions allow to collect all the graph's informations.
  4685. * """
  4686. * return decode_graph_edges(self.c_env.getGraphEdges(graph_id)) # <<<<<<<<<<<<<<
  4687. *
  4688. *
  4689. */
  4690. __Pyx_XDECREF(__pyx_r);
  4691. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
  4692. __Pyx_GOTREF(__pyx_t_2);
  4693. __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, 475, __pyx_L1_error)
  4694. try {
  4695. __pyx_t_4 = __pyx_v_self->c_env->getGraphEdges(__pyx_t_3);
  4696. } catch(...) {
  4697. __Pyx_CppExn2PyErr();
  4698. __PYX_ERR(0, 475, __pyx_L1_error)
  4699. }
  4700. __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, 475, __pyx_L1_error)
  4701. __Pyx_GOTREF(__pyx_t_5);
  4702. __pyx_t_6 = NULL;
  4703. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4704. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  4705. if (likely(__pyx_t_6)) {
  4706. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4707. __Pyx_INCREF(__pyx_t_6);
  4708. __Pyx_INCREF(function);
  4709. __Pyx_DECREF_SET(__pyx_t_2, function);
  4710. }
  4711. }
  4712. __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);
  4713. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4714. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4715. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
  4716. __Pyx_GOTREF(__pyx_t_1);
  4717. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4718. __pyx_r = __pyx_t_1;
  4719. __pyx_t_1 = 0;
  4720. goto __pyx_L0;
  4721. /* "gedlibpy.pyx":463
  4722. *
  4723. *
  4724. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4725. * """
  4726. * Searchs and returns all the edges on a graph, selected by its ID.
  4727. */
  4728. /* function exit code */
  4729. __pyx_L1_error:;
  4730. __Pyx_XDECREF(__pyx_t_1);
  4731. __Pyx_XDECREF(__pyx_t_2);
  4732. __Pyx_XDECREF(__pyx_t_5);
  4733. __Pyx_XDECREF(__pyx_t_6);
  4734. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4735. __pyx_r = NULL;
  4736. __pyx_L0:;
  4737. __Pyx_XGIVEREF(__pyx_r);
  4738. __Pyx_RefNannyFinishContext();
  4739. return __pyx_r;
  4740. }
  4741. /* "gedlibpy.pyx":478
  4742. *
  4743. *
  4744. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4745. * """
  4746. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4747. */
  4748. /* Python wrapper */
  4749. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4750. 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";
  4751. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4752. PyObject *__pyx_r = 0;
  4753. __Pyx_RefNannyDeclarations
  4754. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix (wrapper)", 0);
  4755. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4756. /* function exit code */
  4757. __Pyx_RefNannyFinishContext();
  4758. return __pyx_r;
  4759. }
  4760. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4761. PyObject *__pyx_r = NULL;
  4762. __Pyx_RefNannyDeclarations
  4763. size_t __pyx_t_1;
  4764. std::vector<std::vector<size_t> > __pyx_t_2;
  4765. PyObject *__pyx_t_3 = NULL;
  4766. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix", 0);
  4767. /* "gedlibpy.pyx":490
  4768. * .. note:: These functions allow to collect all the graph's informations.
  4769. * """
  4770. * return self.c_env.getGraphAdjacenceMatrix(graph_id) # <<<<<<<<<<<<<<
  4771. *
  4772. *
  4773. */
  4774. __Pyx_XDECREF(__pyx_r);
  4775. __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, 490, __pyx_L1_error)
  4776. try {
  4777. __pyx_t_2 = __pyx_v_self->c_env->getGraphAdjacenceMatrix(__pyx_t_1);
  4778. } catch(...) {
  4779. __Pyx_CppExn2PyErr();
  4780. __PYX_ERR(0, 490, __pyx_L1_error)
  4781. }
  4782. __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, 490, __pyx_L1_error)
  4783. __Pyx_GOTREF(__pyx_t_3);
  4784. __pyx_r = __pyx_t_3;
  4785. __pyx_t_3 = 0;
  4786. goto __pyx_L0;
  4787. /* "gedlibpy.pyx":478
  4788. *
  4789. *
  4790. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4791. * """
  4792. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4793. */
  4794. /* function exit code */
  4795. __pyx_L1_error:;
  4796. __Pyx_XDECREF(__pyx_t_3);
  4797. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_adjacence_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4798. __pyx_r = NULL;
  4799. __pyx_L0:;
  4800. __Pyx_XGIVEREF(__pyx_r);
  4801. __Pyx_RefNannyFinishContext();
  4802. return __pyx_r;
  4803. }
  4804. /* "gedlibpy.pyx":493
  4805. *
  4806. *
  4807. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4808. * """
  4809. * Sets an edit cost function to the environment, if it exists.
  4810. */
  4811. /* Python wrapper */
  4812. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4813. 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";
  4814. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4815. PyObject *__pyx_v_edit_cost = 0;
  4816. PyObject *__pyx_v_edit_cost_constant = 0;
  4817. PyObject *__pyx_r = 0;
  4818. __Pyx_RefNannyDeclarations
  4819. __Pyx_RefNannySetupContext("set_edit_cost (wrapper)", 0);
  4820. {
  4821. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost,&__pyx_n_s_edit_cost_constant,0};
  4822. PyObject* values[2] = {0,0};
  4823. values[1] = __pyx_k__2;
  4824. if (unlikely(__pyx_kwds)) {
  4825. Py_ssize_t kw_args;
  4826. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4827. switch (pos_args) {
  4828. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4829. CYTHON_FALLTHROUGH;
  4830. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4831. CYTHON_FALLTHROUGH;
  4832. case 0: break;
  4833. default: goto __pyx_L5_argtuple_error;
  4834. }
  4835. kw_args = PyDict_Size(__pyx_kwds);
  4836. switch (pos_args) {
  4837. case 0:
  4838. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  4839. else goto __pyx_L5_argtuple_error;
  4840. CYTHON_FALLTHROUGH;
  4841. case 1:
  4842. if (kw_args > 0) {
  4843. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  4844. if (value) { values[1] = value; kw_args--; }
  4845. }
  4846. }
  4847. if (unlikely(kw_args > 0)) {
  4848. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 493, __pyx_L3_error)
  4849. }
  4850. } else {
  4851. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4852. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4853. CYTHON_FALLTHROUGH;
  4854. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4855. break;
  4856. default: goto __pyx_L5_argtuple_error;
  4857. }
  4858. }
  4859. __pyx_v_edit_cost = values[0];
  4860. __pyx_v_edit_cost_constant = values[1];
  4861. }
  4862. goto __pyx_L4_argument_unpacking_done;
  4863. __pyx_L5_argtuple_error:;
  4864. __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 493, __pyx_L3_error)
  4865. __pyx_L3_error:;
  4866. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4867. __Pyx_RefNannyFinishContext();
  4868. return NULL;
  4869. __pyx_L4_argument_unpacking_done:;
  4870. __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);
  4871. /* function exit code */
  4872. __Pyx_RefNannyFinishContext();
  4873. return __pyx_r;
  4874. }
  4875. 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) {
  4876. PyObject *__pyx_v_edit_cost_b = NULL;
  4877. PyObject *__pyx_r = NULL;
  4878. __Pyx_RefNannyDeclarations
  4879. PyObject *__pyx_t_1 = NULL;
  4880. int __pyx_t_2;
  4881. int __pyx_t_3;
  4882. PyObject *__pyx_t_4 = NULL;
  4883. PyObject *__pyx_t_5 = NULL;
  4884. std::string __pyx_t_6;
  4885. std::vector<double> __pyx_t_7;
  4886. __Pyx_RefNannySetupContext("set_edit_cost", 0);
  4887. /* "gedlibpy.pyx":505
  4888. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4889. * """
  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. */
  4894. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
  4895. __Pyx_GOTREF(__pyx_t_1);
  4896. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_edit_cost, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 505, __pyx_L1_error)
  4897. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4898. __pyx_t_3 = (__pyx_t_2 != 0);
  4899. if (likely(__pyx_t_3)) {
  4900. /* "gedlibpy.pyx":506
  4901. * """
  4902. * if edit_cost in list_of_edit_cost_options:
  4903. * edit_cost_b = edit_cost.encode('utf-8') # <<<<<<<<<<<<<<
  4904. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4905. * else:
  4906. */
  4907. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edit_cost, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 506, __pyx_L1_error)
  4908. __Pyx_GOTREF(__pyx_t_4);
  4909. __pyx_t_5 = NULL;
  4910. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  4911. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4912. if (likely(__pyx_t_5)) {
  4913. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4914. __Pyx_INCREF(__pyx_t_5);
  4915. __Pyx_INCREF(function);
  4916. __Pyx_DECREF_SET(__pyx_t_4, function);
  4917. }
  4918. }
  4919. __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);
  4920. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4921. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 506, __pyx_L1_error)
  4922. __Pyx_GOTREF(__pyx_t_1);
  4923. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4924. __pyx_v_edit_cost_b = __pyx_t_1;
  4925. __pyx_t_1 = 0;
  4926. /* "gedlibpy.pyx":507
  4927. * if edit_cost in list_of_edit_cost_options:
  4928. * edit_cost_b = edit_cost.encode('utf-8')
  4929. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) # <<<<<<<<<<<<<<
  4930. * else:
  4931. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function")
  4932. */
  4933. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_edit_cost_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
  4934. __pyx_t_7 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 507, __pyx_L1_error)
  4935. try {
  4936. __pyx_v_self->c_env->setEditCost(__pyx_t_6, __pyx_t_7);
  4937. } catch(...) {
  4938. __Pyx_CppExn2PyErr();
  4939. __PYX_ERR(0, 507, __pyx_L1_error)
  4940. }
  4941. /* "gedlibpy.pyx":505
  4942. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4943. * """
  4944. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4945. * edit_cost_b = edit_cost.encode('utf-8')
  4946. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4947. */
  4948. goto __pyx_L3;
  4949. }
  4950. /* "gedlibpy.pyx":509
  4951. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4952. * else:
  4953. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") # <<<<<<<<<<<<<<
  4954. *
  4955. *
  4956. */
  4957. /*else*/ {
  4958. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 509, __pyx_L1_error)
  4959. __Pyx_GOTREF(__pyx_t_4);
  4960. __pyx_t_5 = NULL;
  4961. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  4962. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4963. if (likely(__pyx_t_5)) {
  4964. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4965. __Pyx_INCREF(__pyx_t_5);
  4966. __Pyx_INCREF(function);
  4967. __Pyx_DECREF_SET(__pyx_t_4, function);
  4968. }
  4969. }
  4970. __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);
  4971. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4972. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 509, __pyx_L1_error)
  4973. __Pyx_GOTREF(__pyx_t_1);
  4974. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4975. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  4976. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4977. __PYX_ERR(0, 509, __pyx_L1_error)
  4978. }
  4979. __pyx_L3:;
  4980. /* "gedlibpy.pyx":493
  4981. *
  4982. *
  4983. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4984. * """
  4985. * Sets an edit cost function to the environment, if it exists.
  4986. */
  4987. /* function exit code */
  4988. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4989. goto __pyx_L0;
  4990. __pyx_L1_error:;
  4991. __Pyx_XDECREF(__pyx_t_1);
  4992. __Pyx_XDECREF(__pyx_t_4);
  4993. __Pyx_XDECREF(__pyx_t_5);
  4994. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4995. __pyx_r = NULL;
  4996. __pyx_L0:;
  4997. __Pyx_XDECREF(__pyx_v_edit_cost_b);
  4998. __Pyx_XGIVEREF(__pyx_r);
  4999. __Pyx_RefNannyFinishContext();
  5000. return __pyx_r;
  5001. }
  5002. /* "gedlibpy.pyx":512
  5003. *
  5004. *
  5005. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5006. * """
  5007. * Sets an personal edit cost function to the environment.
  5008. */
  5009. /* Python wrapper */
  5010. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5011. 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";
  5012. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5013. PyObject *__pyx_v_edit_cost_constant = 0;
  5014. PyObject *__pyx_r = 0;
  5015. __Pyx_RefNannyDeclarations
  5016. __Pyx_RefNannySetupContext("set_personal_edit_cost (wrapper)", 0);
  5017. {
  5018. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost_constant,0};
  5019. PyObject* values[1] = {0};
  5020. values[0] = __pyx_k__3;
  5021. if (unlikely(__pyx_kwds)) {
  5022. Py_ssize_t kw_args;
  5023. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5024. switch (pos_args) {
  5025. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5026. CYTHON_FALLTHROUGH;
  5027. case 0: break;
  5028. default: goto __pyx_L5_argtuple_error;
  5029. }
  5030. kw_args = PyDict_Size(__pyx_kwds);
  5031. switch (pos_args) {
  5032. case 0:
  5033. if (kw_args > 0) {
  5034. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  5035. if (value) { values[0] = value; kw_args--; }
  5036. }
  5037. }
  5038. if (unlikely(kw_args > 0)) {
  5039. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 512, __pyx_L3_error)
  5040. }
  5041. } else {
  5042. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5043. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5044. CYTHON_FALLTHROUGH;
  5045. case 0: break;
  5046. default: goto __pyx_L5_argtuple_error;
  5047. }
  5048. }
  5049. __pyx_v_edit_cost_constant = values[0];
  5050. }
  5051. goto __pyx_L4_argument_unpacking_done;
  5052. __pyx_L5_argtuple_error:;
  5053. __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 512, __pyx_L3_error)
  5054. __pyx_L3_error:;
  5055. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5056. __Pyx_RefNannyFinishContext();
  5057. return NULL;
  5058. __pyx_L4_argument_unpacking_done:;
  5059. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edit_cost_constant);
  5060. /* function exit code */
  5061. __Pyx_RefNannyFinishContext();
  5062. return __pyx_r;
  5063. }
  5064. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost_constant) {
  5065. PyObject *__pyx_r = NULL;
  5066. __Pyx_RefNannyDeclarations
  5067. std::vector<double> __pyx_t_1;
  5068. __Pyx_RefNannySetupContext("set_personal_edit_cost", 0);
  5069. /* "gedlibpy.pyx":522
  5070. * .. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function.
  5071. * """
  5072. * self.c_env.setPersonalEditCost(edit_cost_constant) # <<<<<<<<<<<<<<
  5073. *
  5074. *
  5075. */
  5076. __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 522, __pyx_L1_error)
  5077. try {
  5078. __pyx_v_self->c_env->setPersonalEditCost(__pyx_t_1);
  5079. } catch(...) {
  5080. __Pyx_CppExn2PyErr();
  5081. __PYX_ERR(0, 522, __pyx_L1_error)
  5082. }
  5083. /* "gedlibpy.pyx":512
  5084. *
  5085. *
  5086. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5087. * """
  5088. * Sets an personal edit cost function to the environment.
  5089. */
  5090. /* function exit code */
  5091. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5092. goto __pyx_L0;
  5093. __pyx_L1_error:;
  5094. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5095. __pyx_r = NULL;
  5096. __pyx_L0:;
  5097. __Pyx_XGIVEREF(__pyx_r);
  5098. __Pyx_RefNannyFinishContext();
  5099. return __pyx_r;
  5100. }
  5101. /* "gedlibpy.pyx":525
  5102. *
  5103. *
  5104. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5105. * """
  5106. * Initializes the environment with the chosen edit cost function and graphs.
  5107. */
  5108. /* Python wrapper */
  5109. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5110. 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";
  5111. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5112. PyObject *__pyx_v_init_option = 0;
  5113. PyObject *__pyx_v_print_to_stdout = 0;
  5114. PyObject *__pyx_r = 0;
  5115. __Pyx_RefNannyDeclarations
  5116. __Pyx_RefNannySetupContext("init (wrapper)", 0);
  5117. {
  5118. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_init_option,&__pyx_n_s_print_to_stdout,0};
  5119. PyObject* values[2] = {0,0};
  5120. values[0] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  5121. values[1] = ((PyObject *)Py_False);
  5122. if (unlikely(__pyx_kwds)) {
  5123. Py_ssize_t kw_args;
  5124. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5125. switch (pos_args) {
  5126. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5127. CYTHON_FALLTHROUGH;
  5128. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5129. CYTHON_FALLTHROUGH;
  5130. case 0: break;
  5131. default: goto __pyx_L5_argtuple_error;
  5132. }
  5133. kw_args = PyDict_Size(__pyx_kwds);
  5134. switch (pos_args) {
  5135. case 0:
  5136. if (kw_args > 0) {
  5137. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  5138. if (value) { values[0] = value; kw_args--; }
  5139. }
  5140. CYTHON_FALLTHROUGH;
  5141. case 1:
  5142. if (kw_args > 0) {
  5143. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_print_to_stdout);
  5144. if (value) { values[1] = value; kw_args--; }
  5145. }
  5146. }
  5147. if (unlikely(kw_args > 0)) {
  5148. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 525, __pyx_L3_error)
  5149. }
  5150. } else {
  5151. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5152. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5153. CYTHON_FALLTHROUGH;
  5154. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5155. CYTHON_FALLTHROUGH;
  5156. case 0: break;
  5157. default: goto __pyx_L5_argtuple_error;
  5158. }
  5159. }
  5160. __pyx_v_init_option = values[0];
  5161. __pyx_v_print_to_stdout = values[1];
  5162. }
  5163. goto __pyx_L4_argument_unpacking_done;
  5164. __pyx_L5_argtuple_error:;
  5165. __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 525, __pyx_L3_error)
  5166. __pyx_L3_error:;
  5167. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5168. __Pyx_RefNannyFinishContext();
  5169. return NULL;
  5170. __pyx_L4_argument_unpacking_done:;
  5171. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_46init(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_init_option, __pyx_v_print_to_stdout);
  5172. /* function exit code */
  5173. __Pyx_RefNannyFinishContext();
  5174. return __pyx_r;
  5175. }
  5176. 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) {
  5177. PyObject *__pyx_v_init_option_b = NULL;
  5178. PyObject *__pyx_r = NULL;
  5179. __Pyx_RefNannyDeclarations
  5180. PyObject *__pyx_t_1 = NULL;
  5181. int __pyx_t_2;
  5182. int __pyx_t_3;
  5183. PyObject *__pyx_t_4 = NULL;
  5184. PyObject *__pyx_t_5 = NULL;
  5185. std::string __pyx_t_6;
  5186. bool __pyx_t_7;
  5187. __Pyx_RefNannySetupContext("init", 0);
  5188. /* "gedlibpy.pyx":536
  5189. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5190. * """
  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. */
  5195. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 536, __pyx_L1_error)
  5196. __Pyx_GOTREF(__pyx_t_1);
  5197. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_init_option, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 536, __pyx_L1_error)
  5198. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5199. __pyx_t_3 = (__pyx_t_2 != 0);
  5200. if (likely(__pyx_t_3)) {
  5201. /* "gedlibpy.pyx":537
  5202. * """
  5203. * if init_option in list_of_init_options:
  5204. * init_option_b = init_option.encode('utf-8') # <<<<<<<<<<<<<<
  5205. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5206. * else:
  5207. */
  5208. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_init_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
  5209. __Pyx_GOTREF(__pyx_t_4);
  5210. __pyx_t_5 = NULL;
  5211. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5212. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5213. if (likely(__pyx_t_5)) {
  5214. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5215. __Pyx_INCREF(__pyx_t_5);
  5216. __Pyx_INCREF(function);
  5217. __Pyx_DECREF_SET(__pyx_t_4, function);
  5218. }
  5219. }
  5220. __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);
  5221. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5222. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 537, __pyx_L1_error)
  5223. __Pyx_GOTREF(__pyx_t_1);
  5224. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5225. __pyx_v_init_option_b = __pyx_t_1;
  5226. __pyx_t_1 = 0;
  5227. /* "gedlibpy.pyx":538
  5228. * if init_option in list_of_init_options:
  5229. * init_option_b = init_option.encode('utf-8')
  5230. * self.c_env.initEnv(init_option_b, print_to_stdout) # <<<<<<<<<<<<<<
  5231. * else:
  5232. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.")
  5233. */
  5234. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_init_option_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L1_error)
  5235. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_print_to_stdout); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 538, __pyx_L1_error)
  5236. try {
  5237. __pyx_v_self->c_env->initEnv(__pyx_t_6, __pyx_t_7);
  5238. } catch(...) {
  5239. __Pyx_CppExn2PyErr();
  5240. __PYX_ERR(0, 538, __pyx_L1_error)
  5241. }
  5242. /* "gedlibpy.pyx":536
  5243. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5244. * """
  5245. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5246. * init_option_b = init_option.encode('utf-8')
  5247. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5248. */
  5249. goto __pyx_L3;
  5250. }
  5251. /* "gedlibpy.pyx":540
  5252. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5253. * else:
  5254. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") # <<<<<<<<<<<<<<
  5255. *
  5256. *
  5257. */
  5258. /*else*/ {
  5259. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
  5260. __Pyx_GOTREF(__pyx_t_4);
  5261. __pyx_t_5 = NULL;
  5262. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5263. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5264. if (likely(__pyx_t_5)) {
  5265. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5266. __Pyx_INCREF(__pyx_t_5);
  5267. __Pyx_INCREF(function);
  5268. __Pyx_DECREF_SET(__pyx_t_4, function);
  5269. }
  5270. }
  5271. __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);
  5272. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5273. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 540, __pyx_L1_error)
  5274. __Pyx_GOTREF(__pyx_t_1);
  5275. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5276. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5277. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5278. __PYX_ERR(0, 540, __pyx_L1_error)
  5279. }
  5280. __pyx_L3:;
  5281. /* "gedlibpy.pyx":525
  5282. *
  5283. *
  5284. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5285. * """
  5286. * Initializes the environment with the chosen edit cost function and graphs.
  5287. */
  5288. /* function exit code */
  5289. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5290. goto __pyx_L0;
  5291. __pyx_L1_error:;
  5292. __Pyx_XDECREF(__pyx_t_1);
  5293. __Pyx_XDECREF(__pyx_t_4);
  5294. __Pyx_XDECREF(__pyx_t_5);
  5295. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5296. __pyx_r = NULL;
  5297. __pyx_L0:;
  5298. __Pyx_XDECREF(__pyx_v_init_option_b);
  5299. __Pyx_XGIVEREF(__pyx_r);
  5300. __Pyx_RefNannyFinishContext();
  5301. return __pyx_r;
  5302. }
  5303. /* "gedlibpy.pyx":543
  5304. *
  5305. *
  5306. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5307. * """
  5308. * Sets a computation method to the environment, if its exists.
  5309. */
  5310. /* Python wrapper */
  5311. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5312. 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";
  5313. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5314. PyObject *__pyx_v_method = 0;
  5315. PyObject *__pyx_v_options = 0;
  5316. PyObject *__pyx_r = 0;
  5317. __Pyx_RefNannyDeclarations
  5318. __Pyx_RefNannySetupContext("set_method (wrapper)", 0);
  5319. {
  5320. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_options,0};
  5321. PyObject* values[2] = {0,0};
  5322. values[1] = ((PyObject *)__pyx_kp_u_);
  5323. if (unlikely(__pyx_kwds)) {
  5324. Py_ssize_t kw_args;
  5325. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5326. switch (pos_args) {
  5327. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5328. CYTHON_FALLTHROUGH;
  5329. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5330. CYTHON_FALLTHROUGH;
  5331. case 0: break;
  5332. default: goto __pyx_L5_argtuple_error;
  5333. }
  5334. kw_args = PyDict_Size(__pyx_kwds);
  5335. switch (pos_args) {
  5336. case 0:
  5337. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  5338. else goto __pyx_L5_argtuple_error;
  5339. CYTHON_FALLTHROUGH;
  5340. case 1:
  5341. if (kw_args > 0) {
  5342. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  5343. if (value) { values[1] = value; kw_args--; }
  5344. }
  5345. }
  5346. if (unlikely(kw_args > 0)) {
  5347. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 543, __pyx_L3_error)
  5348. }
  5349. } else {
  5350. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5351. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5352. CYTHON_FALLTHROUGH;
  5353. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5354. break;
  5355. default: goto __pyx_L5_argtuple_error;
  5356. }
  5357. }
  5358. __pyx_v_method = values[0];
  5359. __pyx_v_options = values[1];
  5360. }
  5361. goto __pyx_L4_argument_unpacking_done;
  5362. __pyx_L5_argtuple_error:;
  5363. __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 543, __pyx_L3_error)
  5364. __pyx_L3_error:;
  5365. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5366. __Pyx_RefNannyFinishContext();
  5367. return NULL;
  5368. __pyx_L4_argument_unpacking_done:;
  5369. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_48set_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_method, __pyx_v_options);
  5370. /* function exit code */
  5371. __Pyx_RefNannyFinishContext();
  5372. return __pyx_r;
  5373. }
  5374. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_options) {
  5375. PyObject *__pyx_v_method_b = NULL;
  5376. PyObject *__pyx_r = NULL;
  5377. __Pyx_RefNannyDeclarations
  5378. PyObject *__pyx_t_1 = NULL;
  5379. int __pyx_t_2;
  5380. int __pyx_t_3;
  5381. PyObject *__pyx_t_4 = NULL;
  5382. PyObject *__pyx_t_5 = NULL;
  5383. std::string __pyx_t_6;
  5384. std::string __pyx_t_7;
  5385. __Pyx_RefNannySetupContext("set_method", 0);
  5386. /* "gedlibpy.pyx":555
  5387. * .. 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.
  5388. * """
  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. */
  5393. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 555, __pyx_L1_error)
  5394. __Pyx_GOTREF(__pyx_t_1);
  5395. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 555, __pyx_L1_error)
  5396. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5397. __pyx_t_3 = (__pyx_t_2 != 0);
  5398. if (likely(__pyx_t_3)) {
  5399. /* "gedlibpy.pyx":556
  5400. * """
  5401. * if method in list_of_method_options:
  5402. * method_b = method.encode('utf-8') # <<<<<<<<<<<<<<
  5403. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5404. * else:
  5405. */
  5406. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
  5407. __Pyx_GOTREF(__pyx_t_4);
  5408. __pyx_t_5 = NULL;
  5409. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5410. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5411. if (likely(__pyx_t_5)) {
  5412. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5413. __Pyx_INCREF(__pyx_t_5);
  5414. __Pyx_INCREF(function);
  5415. __Pyx_DECREF_SET(__pyx_t_4, function);
  5416. }
  5417. }
  5418. __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);
  5419. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5420. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 556, __pyx_L1_error)
  5421. __Pyx_GOTREF(__pyx_t_1);
  5422. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5423. __pyx_v_method_b = __pyx_t_1;
  5424. __pyx_t_1 = 0;
  5425. /* "gedlibpy.pyx":557
  5426. * if method in list_of_method_options:
  5427. * method_b = method.encode('utf-8')
  5428. * self.c_env.setMethod(method_b, options.encode('utf-8')) # <<<<<<<<<<<<<<
  5429. * else:
  5430. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method")
  5431. */
  5432. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_method_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L1_error)
  5433. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
  5434. __Pyx_GOTREF(__pyx_t_4);
  5435. __pyx_t_5 = NULL;
  5436. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5437. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5438. if (likely(__pyx_t_5)) {
  5439. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5440. __Pyx_INCREF(__pyx_t_5);
  5441. __Pyx_INCREF(function);
  5442. __Pyx_DECREF_SET(__pyx_t_4, function);
  5443. }
  5444. }
  5445. __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);
  5446. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5447. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 557, __pyx_L1_error)
  5448. __Pyx_GOTREF(__pyx_t_1);
  5449. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5450. __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 557, __pyx_L1_error)
  5451. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5452. try {
  5453. __pyx_v_self->c_env->setMethod(__pyx_t_6, __pyx_t_7);
  5454. } catch(...) {
  5455. __Pyx_CppExn2PyErr();
  5456. __PYX_ERR(0, 557, __pyx_L1_error)
  5457. }
  5458. /* "gedlibpy.pyx":555
  5459. * .. 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.
  5460. * """
  5461. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5462. * method_b = method.encode('utf-8')
  5463. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5464. */
  5465. goto __pyx_L3;
  5466. }
  5467. /* "gedlibpy.pyx":559
  5468. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5469. * else:
  5470. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") # <<<<<<<<<<<<<<
  5471. *
  5472. *
  5473. */
  5474. /*else*/ {
  5475. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 559, __pyx_L1_error)
  5476. __Pyx_GOTREF(__pyx_t_4);
  5477. __pyx_t_5 = NULL;
  5478. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5479. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5480. if (likely(__pyx_t_5)) {
  5481. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5482. __Pyx_INCREF(__pyx_t_5);
  5483. __Pyx_INCREF(function);
  5484. __Pyx_DECREF_SET(__pyx_t_4, function);
  5485. }
  5486. }
  5487. __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);
  5488. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5489. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
  5490. __Pyx_GOTREF(__pyx_t_1);
  5491. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5492. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5493. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5494. __PYX_ERR(0, 559, __pyx_L1_error)
  5495. }
  5496. __pyx_L3:;
  5497. /* "gedlibpy.pyx":543
  5498. *
  5499. *
  5500. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5501. * """
  5502. * Sets a computation method to the environment, if its exists.
  5503. */
  5504. /* function exit code */
  5505. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5506. goto __pyx_L0;
  5507. __pyx_L1_error:;
  5508. __Pyx_XDECREF(__pyx_t_1);
  5509. __Pyx_XDECREF(__pyx_t_4);
  5510. __Pyx_XDECREF(__pyx_t_5);
  5511. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5512. __pyx_r = NULL;
  5513. __pyx_L0:;
  5514. __Pyx_XDECREF(__pyx_v_method_b);
  5515. __Pyx_XGIVEREF(__pyx_r);
  5516. __Pyx_RefNannyFinishContext();
  5517. return __pyx_r;
  5518. }
  5519. /* "gedlibpy.pyx":562
  5520. *
  5521. *
  5522. * def init_method(self) : # <<<<<<<<<<<<<<
  5523. * """
  5524. * Inits the environment with the set method.
  5525. */
  5526. /* Python wrapper */
  5527. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5528. 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";
  5529. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5530. PyObject *__pyx_r = 0;
  5531. __Pyx_RefNannyDeclarations
  5532. __Pyx_RefNannySetupContext("init_method (wrapper)", 0);
  5533. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_50init_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5534. /* function exit code */
  5535. __Pyx_RefNannyFinishContext();
  5536. return __pyx_r;
  5537. }
  5538. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5539. PyObject *__pyx_r = NULL;
  5540. __Pyx_RefNannyDeclarations
  5541. __Pyx_RefNannySetupContext("init_method", 0);
  5542. /* "gedlibpy.pyx":569
  5543. * .. note:: Call this function after set the method. You can't launch computation or change the method after that.
  5544. * """
  5545. * self.c_env.initMethod() # <<<<<<<<<<<<<<
  5546. *
  5547. *
  5548. */
  5549. try {
  5550. __pyx_v_self->c_env->initMethod();
  5551. } catch(...) {
  5552. __Pyx_CppExn2PyErr();
  5553. __PYX_ERR(0, 569, __pyx_L1_error)
  5554. }
  5555. /* "gedlibpy.pyx":562
  5556. *
  5557. *
  5558. * def init_method(self) : # <<<<<<<<<<<<<<
  5559. * """
  5560. * Inits the environment with the set method.
  5561. */
  5562. /* function exit code */
  5563. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5564. goto __pyx_L0;
  5565. __pyx_L1_error:;
  5566. __Pyx_AddTraceback("gedlibpy.GEDEnv.init_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5567. __pyx_r = NULL;
  5568. __pyx_L0:;
  5569. __Pyx_XGIVEREF(__pyx_r);
  5570. __Pyx_RefNannyFinishContext();
  5571. return __pyx_r;
  5572. }
  5573. /* "gedlibpy.pyx":572
  5574. *
  5575. *
  5576. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5577. * """
  5578. * Returns the initialization time.
  5579. */
  5580. /* Python wrapper */
  5581. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5582. 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";
  5583. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5584. PyObject *__pyx_r = 0;
  5585. __Pyx_RefNannyDeclarations
  5586. __Pyx_RefNannySetupContext("get_init_time (wrapper)", 0);
  5587. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5588. /* function exit code */
  5589. __Pyx_RefNannyFinishContext();
  5590. return __pyx_r;
  5591. }
  5592. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5593. PyObject *__pyx_r = NULL;
  5594. __Pyx_RefNannyDeclarations
  5595. double __pyx_t_1;
  5596. PyObject *__pyx_t_2 = NULL;
  5597. __Pyx_RefNannySetupContext("get_init_time", 0);
  5598. /* "gedlibpy.pyx":579
  5599. * :rtype: double
  5600. * """
  5601. * return self.c_env.getInitime() # <<<<<<<<<<<<<<
  5602. *
  5603. *
  5604. */
  5605. __Pyx_XDECREF(__pyx_r);
  5606. try {
  5607. __pyx_t_1 = __pyx_v_self->c_env->getInitime();
  5608. } catch(...) {
  5609. __Pyx_CppExn2PyErr();
  5610. __PYX_ERR(0, 579, __pyx_L1_error)
  5611. }
  5612. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
  5613. __Pyx_GOTREF(__pyx_t_2);
  5614. __pyx_r = __pyx_t_2;
  5615. __pyx_t_2 = 0;
  5616. goto __pyx_L0;
  5617. /* "gedlibpy.pyx":572
  5618. *
  5619. *
  5620. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5621. * """
  5622. * Returns the initialization time.
  5623. */
  5624. /* function exit code */
  5625. __pyx_L1_error:;
  5626. __Pyx_XDECREF(__pyx_t_2);
  5627. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5628. __pyx_r = NULL;
  5629. __pyx_L0:;
  5630. __Pyx_XGIVEREF(__pyx_r);
  5631. __Pyx_RefNannyFinishContext();
  5632. return __pyx_r;
  5633. }
  5634. /* "gedlibpy.pyx":582
  5635. *
  5636. *
  5637. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5638. * """
  5639. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5640. */
  5641. /* Python wrapper */
  5642. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5643. 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";
  5644. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5645. PyObject *__pyx_v_g = 0;
  5646. PyObject *__pyx_v_h = 0;
  5647. PyObject *__pyx_r = 0;
  5648. __Pyx_RefNannyDeclarations
  5649. __Pyx_RefNannySetupContext("run_method (wrapper)", 0);
  5650. {
  5651. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5652. PyObject* values[2] = {0,0};
  5653. if (unlikely(__pyx_kwds)) {
  5654. Py_ssize_t kw_args;
  5655. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5656. switch (pos_args) {
  5657. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5658. CYTHON_FALLTHROUGH;
  5659. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5660. CYTHON_FALLTHROUGH;
  5661. case 0: break;
  5662. default: goto __pyx_L5_argtuple_error;
  5663. }
  5664. kw_args = PyDict_Size(__pyx_kwds);
  5665. switch (pos_args) {
  5666. case 0:
  5667. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5668. else goto __pyx_L5_argtuple_error;
  5669. CYTHON_FALLTHROUGH;
  5670. case 1:
  5671. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5672. else {
  5673. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 582, __pyx_L3_error)
  5674. }
  5675. }
  5676. if (unlikely(kw_args > 0)) {
  5677. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 582, __pyx_L3_error)
  5678. }
  5679. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5680. goto __pyx_L5_argtuple_error;
  5681. } else {
  5682. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5683. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5684. }
  5685. __pyx_v_g = values[0];
  5686. __pyx_v_h = values[1];
  5687. }
  5688. goto __pyx_L4_argument_unpacking_done;
  5689. __pyx_L5_argtuple_error:;
  5690. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 582, __pyx_L3_error)
  5691. __pyx_L3_error:;
  5692. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5693. __Pyx_RefNannyFinishContext();
  5694. return NULL;
  5695. __pyx_L4_argument_unpacking_done:;
  5696. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_54run_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5697. /* function exit code */
  5698. __Pyx_RefNannyFinishContext();
  5699. return __pyx_r;
  5700. }
  5701. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5702. PyObject *__pyx_r = NULL;
  5703. __Pyx_RefNannyDeclarations
  5704. size_t __pyx_t_1;
  5705. size_t __pyx_t_2;
  5706. __Pyx_RefNannySetupContext("run_method", 0);
  5707. /* "gedlibpy.pyx":594
  5708. * .. 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.
  5709. * """
  5710. * self.c_env.runMethod(g, h) # <<<<<<<<<<<<<<
  5711. *
  5712. *
  5713. */
  5714. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error)
  5715. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 594, __pyx_L1_error)
  5716. try {
  5717. __pyx_v_self->c_env->runMethod(__pyx_t_1, __pyx_t_2);
  5718. } catch(...) {
  5719. __Pyx_CppExn2PyErr();
  5720. __PYX_ERR(0, 594, __pyx_L1_error)
  5721. }
  5722. /* "gedlibpy.pyx":582
  5723. *
  5724. *
  5725. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5726. * """
  5727. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5728. */
  5729. /* function exit code */
  5730. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5731. goto __pyx_L0;
  5732. __pyx_L1_error:;
  5733. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5734. __pyx_r = NULL;
  5735. __pyx_L0:;
  5736. __Pyx_XGIVEREF(__pyx_r);
  5737. __Pyx_RefNannyFinishContext();
  5738. return __pyx_r;
  5739. }
  5740. /* "gedlibpy.pyx":597
  5741. *
  5742. *
  5743. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5744. * """
  5745. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5746. */
  5747. /* Python wrapper */
  5748. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5749. 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";
  5750. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5751. PyObject *__pyx_v_g = 0;
  5752. PyObject *__pyx_v_h = 0;
  5753. PyObject *__pyx_r = 0;
  5754. __Pyx_RefNannyDeclarations
  5755. __Pyx_RefNannySetupContext("get_upper_bound (wrapper)", 0);
  5756. {
  5757. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5758. PyObject* values[2] = {0,0};
  5759. if (unlikely(__pyx_kwds)) {
  5760. Py_ssize_t kw_args;
  5761. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5762. switch (pos_args) {
  5763. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5764. CYTHON_FALLTHROUGH;
  5765. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5766. CYTHON_FALLTHROUGH;
  5767. case 0: break;
  5768. default: goto __pyx_L5_argtuple_error;
  5769. }
  5770. kw_args = PyDict_Size(__pyx_kwds);
  5771. switch (pos_args) {
  5772. case 0:
  5773. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5774. else goto __pyx_L5_argtuple_error;
  5775. CYTHON_FALLTHROUGH;
  5776. case 1:
  5777. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5778. else {
  5779. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 597, __pyx_L3_error)
  5780. }
  5781. }
  5782. if (unlikely(kw_args > 0)) {
  5783. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 597, __pyx_L3_error)
  5784. }
  5785. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5786. goto __pyx_L5_argtuple_error;
  5787. } else {
  5788. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5789. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5790. }
  5791. __pyx_v_g = values[0];
  5792. __pyx_v_h = values[1];
  5793. }
  5794. goto __pyx_L4_argument_unpacking_done;
  5795. __pyx_L5_argtuple_error:;
  5796. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 597, __pyx_L3_error)
  5797. __pyx_L3_error:;
  5798. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5799. __Pyx_RefNannyFinishContext();
  5800. return NULL;
  5801. __pyx_L4_argument_unpacking_done:;
  5802. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5803. /* function exit code */
  5804. __Pyx_RefNannyFinishContext();
  5805. return __pyx_r;
  5806. }
  5807. 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) {
  5808. PyObject *__pyx_r = NULL;
  5809. __Pyx_RefNannyDeclarations
  5810. size_t __pyx_t_1;
  5811. size_t __pyx_t_2;
  5812. double __pyx_t_3;
  5813. PyObject *__pyx_t_4 = NULL;
  5814. __Pyx_RefNannySetupContext("get_upper_bound", 0);
  5815. /* "gedlibpy.pyx":612
  5816. * .. 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.
  5817. * """
  5818. * return self.c_env.getUpperBound(g, h) # <<<<<<<<<<<<<<
  5819. *
  5820. *
  5821. */
  5822. __Pyx_XDECREF(__pyx_r);
  5823. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L1_error)
  5824. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 612, __pyx_L1_error)
  5825. try {
  5826. __pyx_t_3 = __pyx_v_self->c_env->getUpperBound(__pyx_t_1, __pyx_t_2);
  5827. } catch(...) {
  5828. __Pyx_CppExn2PyErr();
  5829. __PYX_ERR(0, 612, __pyx_L1_error)
  5830. }
  5831. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 612, __pyx_L1_error)
  5832. __Pyx_GOTREF(__pyx_t_4);
  5833. __pyx_r = __pyx_t_4;
  5834. __pyx_t_4 = 0;
  5835. goto __pyx_L0;
  5836. /* "gedlibpy.pyx":597
  5837. *
  5838. *
  5839. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5840. * """
  5841. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5842. */
  5843. /* function exit code */
  5844. __pyx_L1_error:;
  5845. __Pyx_XDECREF(__pyx_t_4);
  5846. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5847. __pyx_r = NULL;
  5848. __pyx_L0:;
  5849. __Pyx_XGIVEREF(__pyx_r);
  5850. __Pyx_RefNannyFinishContext();
  5851. return __pyx_r;
  5852. }
  5853. /* "gedlibpy.pyx":615
  5854. *
  5855. *
  5856. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5857. * """
  5858. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5859. */
  5860. /* Python wrapper */
  5861. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5862. 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";
  5863. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5864. PyObject *__pyx_v_g = 0;
  5865. PyObject *__pyx_v_h = 0;
  5866. PyObject *__pyx_r = 0;
  5867. __Pyx_RefNannyDeclarations
  5868. __Pyx_RefNannySetupContext("get_lower_bound (wrapper)", 0);
  5869. {
  5870. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5871. PyObject* values[2] = {0,0};
  5872. if (unlikely(__pyx_kwds)) {
  5873. Py_ssize_t kw_args;
  5874. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5875. switch (pos_args) {
  5876. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5877. CYTHON_FALLTHROUGH;
  5878. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5879. CYTHON_FALLTHROUGH;
  5880. case 0: break;
  5881. default: goto __pyx_L5_argtuple_error;
  5882. }
  5883. kw_args = PyDict_Size(__pyx_kwds);
  5884. switch (pos_args) {
  5885. case 0:
  5886. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5887. else goto __pyx_L5_argtuple_error;
  5888. CYTHON_FALLTHROUGH;
  5889. case 1:
  5890. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5891. else {
  5892. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 615, __pyx_L3_error)
  5893. }
  5894. }
  5895. if (unlikely(kw_args > 0)) {
  5896. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 615, __pyx_L3_error)
  5897. }
  5898. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5899. goto __pyx_L5_argtuple_error;
  5900. } else {
  5901. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5902. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5903. }
  5904. __pyx_v_g = values[0];
  5905. __pyx_v_h = values[1];
  5906. }
  5907. goto __pyx_L4_argument_unpacking_done;
  5908. __pyx_L5_argtuple_error:;
  5909. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 615, __pyx_L3_error)
  5910. __pyx_L3_error:;
  5911. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5912. __Pyx_RefNannyFinishContext();
  5913. return NULL;
  5914. __pyx_L4_argument_unpacking_done:;
  5915. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5916. /* function exit code */
  5917. __Pyx_RefNannyFinishContext();
  5918. return __pyx_r;
  5919. }
  5920. 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) {
  5921. PyObject *__pyx_r = NULL;
  5922. __Pyx_RefNannyDeclarations
  5923. size_t __pyx_t_1;
  5924. size_t __pyx_t_2;
  5925. double __pyx_t_3;
  5926. PyObject *__pyx_t_4 = NULL;
  5927. __Pyx_RefNannySetupContext("get_lower_bound", 0);
  5928. /* "gedlibpy.pyx":630
  5929. * .. note:: This function can be ignored, because lower bound doesn't have a crucial utility.
  5930. * """
  5931. * return self.c_env.getLowerBound(g, h) # <<<<<<<<<<<<<<
  5932. *
  5933. *
  5934. */
  5935. __Pyx_XDECREF(__pyx_r);
  5936. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
  5937. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
  5938. try {
  5939. __pyx_t_3 = __pyx_v_self->c_env->getLowerBound(__pyx_t_1, __pyx_t_2);
  5940. } catch(...) {
  5941. __Pyx_CppExn2PyErr();
  5942. __PYX_ERR(0, 630, __pyx_L1_error)
  5943. }
  5944. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 630, __pyx_L1_error)
  5945. __Pyx_GOTREF(__pyx_t_4);
  5946. __pyx_r = __pyx_t_4;
  5947. __pyx_t_4 = 0;
  5948. goto __pyx_L0;
  5949. /* "gedlibpy.pyx":615
  5950. *
  5951. *
  5952. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5953. * """
  5954. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5955. */
  5956. /* function exit code */
  5957. __pyx_L1_error:;
  5958. __Pyx_XDECREF(__pyx_t_4);
  5959. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5960. __pyx_r = NULL;
  5961. __pyx_L0:;
  5962. __Pyx_XGIVEREF(__pyx_r);
  5963. __Pyx_RefNannyFinishContext();
  5964. return __pyx_r;
  5965. }
  5966. /* "gedlibpy.pyx":633
  5967. *
  5968. *
  5969. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  5970. * """
  5971. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  5972. */
  5973. /* Python wrapper */
  5974. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5975. 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";
  5976. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5977. PyObject *__pyx_v_g = 0;
  5978. PyObject *__pyx_v_h = 0;
  5979. PyObject *__pyx_r = 0;
  5980. __Pyx_RefNannyDeclarations
  5981. __Pyx_RefNannySetupContext("get_forward_map (wrapper)", 0);
  5982. {
  5983. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5984. PyObject* values[2] = {0,0};
  5985. if (unlikely(__pyx_kwds)) {
  5986. Py_ssize_t kw_args;
  5987. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5988. switch (pos_args) {
  5989. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5990. CYTHON_FALLTHROUGH;
  5991. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5992. CYTHON_FALLTHROUGH;
  5993. case 0: break;
  5994. default: goto __pyx_L5_argtuple_error;
  5995. }
  5996. kw_args = PyDict_Size(__pyx_kwds);
  5997. switch (pos_args) {
  5998. case 0:
  5999. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6000. else goto __pyx_L5_argtuple_error;
  6001. CYTHON_FALLTHROUGH;
  6002. case 1:
  6003. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6004. else {
  6005. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 633, __pyx_L3_error)
  6006. }
  6007. }
  6008. if (unlikely(kw_args > 0)) {
  6009. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 633, __pyx_L3_error)
  6010. }
  6011. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6012. goto __pyx_L5_argtuple_error;
  6013. } else {
  6014. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6015. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6016. }
  6017. __pyx_v_g = values[0];
  6018. __pyx_v_h = values[1];
  6019. }
  6020. goto __pyx_L4_argument_unpacking_done;
  6021. __pyx_L5_argtuple_error:;
  6022. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 633, __pyx_L3_error)
  6023. __pyx_L3_error:;
  6024. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6025. __Pyx_RefNannyFinishContext();
  6026. return NULL;
  6027. __pyx_L4_argument_unpacking_done:;
  6028. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6029. /* function exit code */
  6030. __Pyx_RefNannyFinishContext();
  6031. return __pyx_r;
  6032. }
  6033. 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) {
  6034. PyObject *__pyx_r = NULL;
  6035. __Pyx_RefNannyDeclarations
  6036. size_t __pyx_t_1;
  6037. size_t __pyx_t_2;
  6038. std::vector<npy_uint64> __pyx_t_3;
  6039. PyObject *__pyx_t_4 = NULL;
  6040. __Pyx_RefNannySetupContext("get_forward_map", 0);
  6041. /* "gedlibpy.pyx":648
  6042. * .. 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 !
  6043. * """
  6044. * return self.c_env.getForwardMap(g, h) # <<<<<<<<<<<<<<
  6045. *
  6046. *
  6047. */
  6048. __Pyx_XDECREF(__pyx_r);
  6049. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
  6050. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 648, __pyx_L1_error)
  6051. try {
  6052. __pyx_t_3 = __pyx_v_self->c_env->getForwardMap(__pyx_t_1, __pyx_t_2);
  6053. } catch(...) {
  6054. __Pyx_CppExn2PyErr();
  6055. __PYX_ERR(0, 648, __pyx_L1_error)
  6056. }
  6057. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
  6058. __Pyx_GOTREF(__pyx_t_4);
  6059. __pyx_r = __pyx_t_4;
  6060. __pyx_t_4 = 0;
  6061. goto __pyx_L0;
  6062. /* "gedlibpy.pyx":633
  6063. *
  6064. *
  6065. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  6066. * """
  6067. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6068. */
  6069. /* function exit code */
  6070. __pyx_L1_error:;
  6071. __Pyx_XDECREF(__pyx_t_4);
  6072. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6073. __pyx_r = NULL;
  6074. __pyx_L0:;
  6075. __Pyx_XGIVEREF(__pyx_r);
  6076. __Pyx_RefNannyFinishContext();
  6077. return __pyx_r;
  6078. }
  6079. /* "gedlibpy.pyx":651
  6080. *
  6081. *
  6082. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6083. * """
  6084. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6085. */
  6086. /* Python wrapper */
  6087. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6088. 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";
  6089. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6090. PyObject *__pyx_v_g = 0;
  6091. PyObject *__pyx_v_h = 0;
  6092. PyObject *__pyx_r = 0;
  6093. __Pyx_RefNannyDeclarations
  6094. __Pyx_RefNannySetupContext("get_backward_map (wrapper)", 0);
  6095. {
  6096. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6097. PyObject* values[2] = {0,0};
  6098. if (unlikely(__pyx_kwds)) {
  6099. Py_ssize_t kw_args;
  6100. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6101. switch (pos_args) {
  6102. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6103. CYTHON_FALLTHROUGH;
  6104. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6105. CYTHON_FALLTHROUGH;
  6106. case 0: break;
  6107. default: goto __pyx_L5_argtuple_error;
  6108. }
  6109. kw_args = PyDict_Size(__pyx_kwds);
  6110. switch (pos_args) {
  6111. case 0:
  6112. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6113. else goto __pyx_L5_argtuple_error;
  6114. CYTHON_FALLTHROUGH;
  6115. case 1:
  6116. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6117. else {
  6118. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 651, __pyx_L3_error)
  6119. }
  6120. }
  6121. if (unlikely(kw_args > 0)) {
  6122. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 651, __pyx_L3_error)
  6123. }
  6124. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6125. goto __pyx_L5_argtuple_error;
  6126. } else {
  6127. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6128. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6129. }
  6130. __pyx_v_g = values[0];
  6131. __pyx_v_h = values[1];
  6132. }
  6133. goto __pyx_L4_argument_unpacking_done;
  6134. __pyx_L5_argtuple_error:;
  6135. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 651, __pyx_L3_error)
  6136. __pyx_L3_error:;
  6137. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6138. __Pyx_RefNannyFinishContext();
  6139. return NULL;
  6140. __pyx_L4_argument_unpacking_done:;
  6141. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6142. /* function exit code */
  6143. __Pyx_RefNannyFinishContext();
  6144. return __pyx_r;
  6145. }
  6146. 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) {
  6147. PyObject *__pyx_r = NULL;
  6148. __Pyx_RefNannyDeclarations
  6149. size_t __pyx_t_1;
  6150. size_t __pyx_t_2;
  6151. std::vector<npy_uint64> __pyx_t_3;
  6152. PyObject *__pyx_t_4 = NULL;
  6153. __Pyx_RefNannySetupContext("get_backward_map", 0);
  6154. /* "gedlibpy.pyx":666
  6155. * .. 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 !
  6156. * """
  6157. * return self.c_env.getBackwardMap(g, h) # <<<<<<<<<<<<<<
  6158. *
  6159. *
  6160. */
  6161. __Pyx_XDECREF(__pyx_r);
  6162. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error)
  6163. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 666, __pyx_L1_error)
  6164. try {
  6165. __pyx_t_3 = __pyx_v_self->c_env->getBackwardMap(__pyx_t_1, __pyx_t_2);
  6166. } catch(...) {
  6167. __Pyx_CppExn2PyErr();
  6168. __PYX_ERR(0, 666, __pyx_L1_error)
  6169. }
  6170. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 666, __pyx_L1_error)
  6171. __Pyx_GOTREF(__pyx_t_4);
  6172. __pyx_r = __pyx_t_4;
  6173. __pyx_t_4 = 0;
  6174. goto __pyx_L0;
  6175. /* "gedlibpy.pyx":651
  6176. *
  6177. *
  6178. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6179. * """
  6180. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6181. */
  6182. /* function exit code */
  6183. __pyx_L1_error:;
  6184. __Pyx_XDECREF(__pyx_t_4);
  6185. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6186. __pyx_r = NULL;
  6187. __pyx_L0:;
  6188. __Pyx_XGIVEREF(__pyx_r);
  6189. __Pyx_RefNannyFinishContext();
  6190. return __pyx_r;
  6191. }
  6192. /* "gedlibpy.pyx":669
  6193. *
  6194. *
  6195. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6196. * """
  6197. * Returns the node's image in the adjacence matrix, if it exists.
  6198. */
  6199. /* Python wrapper */
  6200. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6201. 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";
  6202. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6203. PyObject *__pyx_v_g = 0;
  6204. PyObject *__pyx_v_h = 0;
  6205. PyObject *__pyx_v_node_id = 0;
  6206. PyObject *__pyx_r = 0;
  6207. __Pyx_RefNannyDeclarations
  6208. __Pyx_RefNannySetupContext("get_node_image (wrapper)", 0);
  6209. {
  6210. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6211. PyObject* values[3] = {0,0,0};
  6212. if (unlikely(__pyx_kwds)) {
  6213. Py_ssize_t kw_args;
  6214. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6215. switch (pos_args) {
  6216. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6217. CYTHON_FALLTHROUGH;
  6218. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6219. CYTHON_FALLTHROUGH;
  6220. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6221. CYTHON_FALLTHROUGH;
  6222. case 0: break;
  6223. default: goto __pyx_L5_argtuple_error;
  6224. }
  6225. kw_args = PyDict_Size(__pyx_kwds);
  6226. switch (pos_args) {
  6227. case 0:
  6228. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6229. else goto __pyx_L5_argtuple_error;
  6230. CYTHON_FALLTHROUGH;
  6231. case 1:
  6232. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6233. else {
  6234. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 669, __pyx_L3_error)
  6235. }
  6236. CYTHON_FALLTHROUGH;
  6237. case 2:
  6238. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6239. else {
  6240. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 669, __pyx_L3_error)
  6241. }
  6242. }
  6243. if (unlikely(kw_args > 0)) {
  6244. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 669, __pyx_L3_error)
  6245. }
  6246. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6247. goto __pyx_L5_argtuple_error;
  6248. } else {
  6249. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6250. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6251. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6252. }
  6253. __pyx_v_g = values[0];
  6254. __pyx_v_h = values[1];
  6255. __pyx_v_node_id = values[2];
  6256. }
  6257. goto __pyx_L4_argument_unpacking_done;
  6258. __pyx_L5_argtuple_error:;
  6259. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 669, __pyx_L3_error)
  6260. __pyx_L3_error:;
  6261. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6262. __Pyx_RefNannyFinishContext();
  6263. return NULL;
  6264. __pyx_L4_argument_unpacking_done:;
  6265. __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);
  6266. /* function exit code */
  6267. __Pyx_RefNannyFinishContext();
  6268. return __pyx_r;
  6269. }
  6270. 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) {
  6271. PyObject *__pyx_r = NULL;
  6272. __Pyx_RefNannyDeclarations
  6273. size_t __pyx_t_1;
  6274. size_t __pyx_t_2;
  6275. size_t __pyx_t_3;
  6276. size_t __pyx_t_4;
  6277. PyObject *__pyx_t_5 = NULL;
  6278. __Pyx_RefNannySetupContext("get_node_image", 0);
  6279. /* "gedlibpy.pyx":687
  6280. *
  6281. * """
  6282. * return self.c_env.getNodeImage(g, h, node_id) # <<<<<<<<<<<<<<
  6283. *
  6284. *
  6285. */
  6286. __Pyx_XDECREF(__pyx_r);
  6287. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
  6288. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 687, __pyx_L1_error)
  6289. __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, 687, __pyx_L1_error)
  6290. try {
  6291. __pyx_t_4 = __pyx_v_self->c_env->getNodeImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6292. } catch(...) {
  6293. __Pyx_CppExn2PyErr();
  6294. __PYX_ERR(0, 687, __pyx_L1_error)
  6295. }
  6296. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 687, __pyx_L1_error)
  6297. __Pyx_GOTREF(__pyx_t_5);
  6298. __pyx_r = __pyx_t_5;
  6299. __pyx_t_5 = 0;
  6300. goto __pyx_L0;
  6301. /* "gedlibpy.pyx":669
  6302. *
  6303. *
  6304. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6305. * """
  6306. * Returns the node's image in the adjacence matrix, if it exists.
  6307. */
  6308. /* function exit code */
  6309. __pyx_L1_error:;
  6310. __Pyx_XDECREF(__pyx_t_5);
  6311. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6312. __pyx_r = NULL;
  6313. __pyx_L0:;
  6314. __Pyx_XGIVEREF(__pyx_r);
  6315. __Pyx_RefNannyFinishContext();
  6316. return __pyx_r;
  6317. }
  6318. /* "gedlibpy.pyx":690
  6319. *
  6320. *
  6321. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6322. * """
  6323. * Returns the node's preimage in the adjacence matrix, if it exists.
  6324. */
  6325. /* Python wrapper */
  6326. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6327. 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";
  6328. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6329. PyObject *__pyx_v_g = 0;
  6330. PyObject *__pyx_v_h = 0;
  6331. PyObject *__pyx_v_node_id = 0;
  6332. PyObject *__pyx_r = 0;
  6333. __Pyx_RefNannyDeclarations
  6334. __Pyx_RefNannySetupContext("get_node_pre_image (wrapper)", 0);
  6335. {
  6336. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6337. PyObject* values[3] = {0,0,0};
  6338. if (unlikely(__pyx_kwds)) {
  6339. Py_ssize_t kw_args;
  6340. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6341. switch (pos_args) {
  6342. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6343. CYTHON_FALLTHROUGH;
  6344. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6345. CYTHON_FALLTHROUGH;
  6346. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6347. CYTHON_FALLTHROUGH;
  6348. case 0: break;
  6349. default: goto __pyx_L5_argtuple_error;
  6350. }
  6351. kw_args = PyDict_Size(__pyx_kwds);
  6352. switch (pos_args) {
  6353. case 0:
  6354. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6355. else goto __pyx_L5_argtuple_error;
  6356. CYTHON_FALLTHROUGH;
  6357. case 1:
  6358. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6359. else {
  6360. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 690, __pyx_L3_error)
  6361. }
  6362. CYTHON_FALLTHROUGH;
  6363. case 2:
  6364. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6365. else {
  6366. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 690, __pyx_L3_error)
  6367. }
  6368. }
  6369. if (unlikely(kw_args > 0)) {
  6370. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 690, __pyx_L3_error)
  6371. }
  6372. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6373. goto __pyx_L5_argtuple_error;
  6374. } else {
  6375. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6376. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6377. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6378. }
  6379. __pyx_v_g = values[0];
  6380. __pyx_v_h = values[1];
  6381. __pyx_v_node_id = values[2];
  6382. }
  6383. goto __pyx_L4_argument_unpacking_done;
  6384. __pyx_L5_argtuple_error:;
  6385. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 690, __pyx_L3_error)
  6386. __pyx_L3_error:;
  6387. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6388. __Pyx_RefNannyFinishContext();
  6389. return NULL;
  6390. __pyx_L4_argument_unpacking_done:;
  6391. __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);
  6392. /* function exit code */
  6393. __Pyx_RefNannyFinishContext();
  6394. return __pyx_r;
  6395. }
  6396. 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) {
  6397. PyObject *__pyx_r = NULL;
  6398. __Pyx_RefNannyDeclarations
  6399. size_t __pyx_t_1;
  6400. size_t __pyx_t_2;
  6401. size_t __pyx_t_3;
  6402. size_t __pyx_t_4;
  6403. PyObject *__pyx_t_5 = NULL;
  6404. __Pyx_RefNannySetupContext("get_node_pre_image", 0);
  6405. /* "gedlibpy.pyx":708
  6406. *
  6407. * """
  6408. * return self.c_env.getNodePreImage(g, h, node_id) # <<<<<<<<<<<<<<
  6409. *
  6410. *
  6411. */
  6412. __Pyx_XDECREF(__pyx_r);
  6413. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error)
  6414. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 708, __pyx_L1_error)
  6415. __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, 708, __pyx_L1_error)
  6416. try {
  6417. __pyx_t_4 = __pyx_v_self->c_env->getNodePreImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6418. } catch(...) {
  6419. __Pyx_CppExn2PyErr();
  6420. __PYX_ERR(0, 708, __pyx_L1_error)
  6421. }
  6422. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 708, __pyx_L1_error)
  6423. __Pyx_GOTREF(__pyx_t_5);
  6424. __pyx_r = __pyx_t_5;
  6425. __pyx_t_5 = 0;
  6426. goto __pyx_L0;
  6427. /* "gedlibpy.pyx":690
  6428. *
  6429. *
  6430. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6431. * """
  6432. * Returns the node's preimage in the adjacence matrix, if it exists.
  6433. */
  6434. /* function exit code */
  6435. __pyx_L1_error:;
  6436. __Pyx_XDECREF(__pyx_t_5);
  6437. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6438. __pyx_r = NULL;
  6439. __pyx_L0:;
  6440. __Pyx_XGIVEREF(__pyx_r);
  6441. __Pyx_RefNannyFinishContext();
  6442. return __pyx_r;
  6443. }
  6444. /* "gedlibpy.pyx":711
  6445. *
  6446. *
  6447. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6448. * """
  6449. * Returns the induced cost between the two indicated graphs.
  6450. */
  6451. /* Python wrapper */
  6452. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6453. 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";
  6454. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6455. PyObject *__pyx_v_g = 0;
  6456. PyObject *__pyx_v_h = 0;
  6457. PyObject *__pyx_r = 0;
  6458. __Pyx_RefNannyDeclarations
  6459. __Pyx_RefNannySetupContext("get_induced_cost (wrapper)", 0);
  6460. {
  6461. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6462. PyObject* values[2] = {0,0};
  6463. if (unlikely(__pyx_kwds)) {
  6464. Py_ssize_t kw_args;
  6465. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6466. switch (pos_args) {
  6467. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6468. CYTHON_FALLTHROUGH;
  6469. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6470. CYTHON_FALLTHROUGH;
  6471. case 0: break;
  6472. default: goto __pyx_L5_argtuple_error;
  6473. }
  6474. kw_args = PyDict_Size(__pyx_kwds);
  6475. switch (pos_args) {
  6476. case 0:
  6477. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6478. else goto __pyx_L5_argtuple_error;
  6479. CYTHON_FALLTHROUGH;
  6480. case 1:
  6481. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6482. else {
  6483. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 711, __pyx_L3_error)
  6484. }
  6485. }
  6486. if (unlikely(kw_args > 0)) {
  6487. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 711, __pyx_L3_error)
  6488. }
  6489. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6490. goto __pyx_L5_argtuple_error;
  6491. } else {
  6492. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6493. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6494. }
  6495. __pyx_v_g = values[0];
  6496. __pyx_v_h = values[1];
  6497. }
  6498. goto __pyx_L4_argument_unpacking_done;
  6499. __pyx_L5_argtuple_error:;
  6500. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 711, __pyx_L3_error)
  6501. __pyx_L3_error:;
  6502. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6503. __Pyx_RefNannyFinishContext();
  6504. return NULL;
  6505. __pyx_L4_argument_unpacking_done:;
  6506. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6507. /* function exit code */
  6508. __Pyx_RefNannyFinishContext();
  6509. return __pyx_r;
  6510. }
  6511. 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) {
  6512. PyObject *__pyx_r = NULL;
  6513. __Pyx_RefNannyDeclarations
  6514. size_t __pyx_t_1;
  6515. size_t __pyx_t_2;
  6516. double __pyx_t_3;
  6517. PyObject *__pyx_t_4 = NULL;
  6518. __Pyx_RefNannySetupContext("get_induced_cost", 0);
  6519. /* "gedlibpy.pyx":727
  6520. *
  6521. * """
  6522. * return self.c_env.getInducedCost(g, h) # <<<<<<<<<<<<<<
  6523. *
  6524. *
  6525. */
  6526. __Pyx_XDECREF(__pyx_r);
  6527. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
  6528. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 727, __pyx_L1_error)
  6529. try {
  6530. __pyx_t_3 = __pyx_v_self->c_env->getInducedCost(__pyx_t_1, __pyx_t_2);
  6531. } catch(...) {
  6532. __Pyx_CppExn2PyErr();
  6533. __PYX_ERR(0, 727, __pyx_L1_error)
  6534. }
  6535. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 727, __pyx_L1_error)
  6536. __Pyx_GOTREF(__pyx_t_4);
  6537. __pyx_r = __pyx_t_4;
  6538. __pyx_t_4 = 0;
  6539. goto __pyx_L0;
  6540. /* "gedlibpy.pyx":711
  6541. *
  6542. *
  6543. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6544. * """
  6545. * Returns the induced cost between the two indicated graphs.
  6546. */
  6547. /* function exit code */
  6548. __pyx_L1_error:;
  6549. __Pyx_XDECREF(__pyx_t_4);
  6550. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6551. __pyx_r = NULL;
  6552. __pyx_L0:;
  6553. __Pyx_XGIVEREF(__pyx_r);
  6554. __Pyx_RefNannyFinishContext();
  6555. return __pyx_r;
  6556. }
  6557. /* "gedlibpy.pyx":730
  6558. *
  6559. *
  6560. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  6561. * """
  6562. * Returns the Node Map, like C++ NodeMap.
  6563. */
  6564. /* Python wrapper */
  6565. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6566. 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: gklearn.ged.env.NodeMap.\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";
  6567. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6568. PyObject *__pyx_v_g = 0;
  6569. PyObject *__pyx_v_h = 0;
  6570. PyObject *__pyx_r = 0;
  6571. __Pyx_RefNannyDeclarations
  6572. __Pyx_RefNannySetupContext("get_node_map (wrapper)", 0);
  6573. {
  6574. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6575. PyObject* values[2] = {0,0};
  6576. if (unlikely(__pyx_kwds)) {
  6577. Py_ssize_t kw_args;
  6578. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6579. switch (pos_args) {
  6580. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6581. CYTHON_FALLTHROUGH;
  6582. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6583. CYTHON_FALLTHROUGH;
  6584. case 0: break;
  6585. default: goto __pyx_L5_argtuple_error;
  6586. }
  6587. kw_args = PyDict_Size(__pyx_kwds);
  6588. switch (pos_args) {
  6589. case 0:
  6590. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6591. else goto __pyx_L5_argtuple_error;
  6592. CYTHON_FALLTHROUGH;
  6593. case 1:
  6594. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6595. else {
  6596. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 730, __pyx_L3_error)
  6597. }
  6598. }
  6599. if (unlikely(kw_args > 0)) {
  6600. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 730, __pyx_L3_error)
  6601. }
  6602. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6603. goto __pyx_L5_argtuple_error;
  6604. } else {
  6605. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6606. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6607. }
  6608. __pyx_v_g = values[0];
  6609. __pyx_v_h = values[1];
  6610. }
  6611. goto __pyx_L4_argument_unpacking_done;
  6612. __pyx_L5_argtuple_error:;
  6613. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 730, __pyx_L3_error)
  6614. __pyx_L3_error:;
  6615. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6616. __Pyx_RefNannyFinishContext();
  6617. return NULL;
  6618. __pyx_L4_argument_unpacking_done:;
  6619. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6620. /* function exit code */
  6621. __Pyx_RefNannyFinishContext();
  6622. return __pyx_r;
  6623. }
  6624. 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) {
  6625. std::vector<std::pair<size_t,size_t> > __pyx_v_map_as_relation;
  6626. double __pyx_v_induced_cost;
  6627. PyObject *__pyx_v_source_map = NULL;
  6628. PyObject *__pyx_v_target_map = NULL;
  6629. Py_ssize_t __pyx_v_num_node_source;
  6630. Py_ssize_t __pyx_v_num_node_target;
  6631. PyObject *__pyx_v_node_map = NULL;
  6632. Py_ssize_t __pyx_v_i;
  6633. std::pair<size_t,size_t> __pyx_8genexpr5__pyx_v_item;
  6634. std::pair<size_t,size_t> __pyx_8genexpr6__pyx_v_item;
  6635. PyObject *__pyx_8genexpr7__pyx_v_item = NULL;
  6636. PyObject *__pyx_8genexpr8__pyx_v_item = NULL;
  6637. PyObject *__pyx_r = NULL;
  6638. __Pyx_RefNannyDeclarations
  6639. size_t __pyx_t_1;
  6640. size_t __pyx_t_2;
  6641. std::vector<std::pair<size_t,size_t> > __pyx_t_3;
  6642. double __pyx_t_4;
  6643. PyObject *__pyx_t_5 = NULL;
  6644. std::vector<std::pair<size_t,size_t> > ::iterator __pyx_t_6;
  6645. std::pair<size_t,size_t> __pyx_t_7;
  6646. PyObject *__pyx_t_8 = NULL;
  6647. PyObject *__pyx_t_9 = NULL;
  6648. Py_ssize_t __pyx_t_10;
  6649. PyObject *__pyx_t_11 = NULL;
  6650. int __pyx_t_12;
  6651. PyObject *__pyx_t_13 = NULL;
  6652. int __pyx_t_14;
  6653. PyObject *__pyx_t_15 = NULL;
  6654. Py_ssize_t __pyx_t_16;
  6655. Py_ssize_t __pyx_t_17;
  6656. __Pyx_RefNannySetupContext("get_node_map", 0);
  6657. /* "gedlibpy.pyx":745
  6658. * .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.
  6659. * """
  6660. * map_as_relation = self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<<
  6661. * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary.
  6662. * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct.
  6663. */
  6664. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 745, __pyx_L1_error)
  6665. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 745, __pyx_L1_error)
  6666. try {
  6667. __pyx_t_3 = __pyx_v_self->c_env->getNodeMap(__pyx_t_1, __pyx_t_2);
  6668. } catch(...) {
  6669. __Pyx_CppExn2PyErr();
  6670. __PYX_ERR(0, 745, __pyx_L1_error)
  6671. }
  6672. __pyx_v_map_as_relation = __pyx_t_3;
  6673. /* "gedlibpy.pyx":746
  6674. * """
  6675. * map_as_relation = self.c_env.getNodeMap(g, h)
  6676. * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary. # <<<<<<<<<<<<<<
  6677. * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct.
  6678. * # print(source_map)
  6679. */
  6680. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
  6681. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
  6682. try {
  6683. __pyx_t_4 = __pyx_v_self->c_env->getInducedCost(__pyx_t_2, __pyx_t_1);
  6684. } catch(...) {
  6685. __Pyx_CppExn2PyErr();
  6686. __PYX_ERR(0, 746, __pyx_L1_error)
  6687. }
  6688. __pyx_v_induced_cost = __pyx_t_4;
  6689. /* "gedlibpy.pyx":747
  6690. * map_as_relation = self.c_env.getNodeMap(g, h)
  6691. * induced_cost = self.c_env.getInducedCost(g, h) # @todo: the C++ implementation for this function in GedLibBind.ipp re-call get_node_map() once more, this is not neccessary.
  6692. * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct. # <<<<<<<<<<<<<<
  6693. * # print(source_map)
  6694. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6695. */
  6696. { /* enter inner scope */
  6697. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
  6698. __Pyx_GOTREF(__pyx_t_5);
  6699. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6700. for (;;) {
  6701. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6702. __pyx_t_7 = *__pyx_t_6;
  6703. ++__pyx_t_6;
  6704. __pyx_8genexpr5__pyx_v_item = __pyx_t_7;
  6705. __pyx_t_9 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_map_as_relation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L1_error)
  6706. __Pyx_GOTREF(__pyx_t_9);
  6707. __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 747, __pyx_L1_error)
  6708. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6709. if (((__pyx_8genexpr5__pyx_v_item.first < __pyx_t_10) != 0)) {
  6710. __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr5__pyx_v_item.first); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L1_error)
  6711. __Pyx_GOTREF(__pyx_t_9);
  6712. __pyx_t_8 = __pyx_t_9;
  6713. __pyx_t_9 = 0;
  6714. } else {
  6715. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 747, __pyx_L1_error)
  6716. __Pyx_GOTREF(__pyx_t_9);
  6717. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 747, __pyx_L1_error)
  6718. __Pyx_GOTREF(__pyx_t_11);
  6719. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6720. __pyx_t_8 = __pyx_t_11;
  6721. __pyx_t_11 = 0;
  6722. }
  6723. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 747, __pyx_L1_error)
  6724. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6725. }
  6726. } /* exit inner scope */
  6727. __pyx_v_source_map = ((PyObject*)__pyx_t_5);
  6728. __pyx_t_5 = 0;
  6729. /* "gedlibpy.pyx":749
  6730. * source_map = [item.first if item.first < len(map_as_relation) else np.inf for item in map_as_relation] # item.first < len(map_as_relation) is not exactly correct.
  6731. * # print(source_map)
  6732. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] # <<<<<<<<<<<<<<
  6733. * # print(target_map)
  6734. * num_node_source = len([item for item in source_map if item != np.inf])
  6735. */
  6736. { /* enter inner scope */
  6737. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 749, __pyx_L1_error)
  6738. __Pyx_GOTREF(__pyx_t_5);
  6739. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6740. for (;;) {
  6741. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6742. __pyx_t_7 = *__pyx_t_6;
  6743. ++__pyx_t_6;
  6744. __pyx_8genexpr6__pyx_v_item = __pyx_t_7;
  6745. __pyx_t_11 = __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_map_as_relation); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 749, __pyx_L1_error)
  6746. __Pyx_GOTREF(__pyx_t_11);
  6747. __pyx_t_10 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 749, __pyx_L1_error)
  6748. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6749. if (((__pyx_8genexpr6__pyx_v_item.second < __pyx_t_10) != 0)) {
  6750. __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr6__pyx_v_item.second); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 749, __pyx_L1_error)
  6751. __Pyx_GOTREF(__pyx_t_11);
  6752. __pyx_t_8 = __pyx_t_11;
  6753. __pyx_t_11 = 0;
  6754. } else {
  6755. __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 749, __pyx_L1_error)
  6756. __Pyx_GOTREF(__pyx_t_11);
  6757. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_inf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 749, __pyx_L1_error)
  6758. __Pyx_GOTREF(__pyx_t_9);
  6759. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6760. __pyx_t_8 = __pyx_t_9;
  6761. __pyx_t_9 = 0;
  6762. }
  6763. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 749, __pyx_L1_error)
  6764. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6765. }
  6766. } /* exit inner scope */
  6767. __pyx_v_target_map = ((PyObject*)__pyx_t_5);
  6768. __pyx_t_5 = 0;
  6769. /* "gedlibpy.pyx":751
  6770. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6771. * # print(target_map)
  6772. * num_node_source = len([item for item in source_map if item != np.inf]) # <<<<<<<<<<<<<<
  6773. * # print(num_node_source)
  6774. * num_node_target = len([item for item in target_map if item != np.inf])
  6775. */
  6776. { /* enter inner scope */
  6777. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L9_error)
  6778. __Pyx_GOTREF(__pyx_t_5);
  6779. __pyx_t_8 = __pyx_v_source_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6780. for (;;) {
  6781. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6782. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6783. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 751, __pyx_L9_error)
  6784. #else
  6785. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 751, __pyx_L9_error)
  6786. __Pyx_GOTREF(__pyx_t_9);
  6787. #endif
  6788. __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_item, __pyx_t_9);
  6789. __pyx_t_9 = 0;
  6790. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 751, __pyx_L9_error)
  6791. __Pyx_GOTREF(__pyx_t_9);
  6792. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 751, __pyx_L9_error)
  6793. __Pyx_GOTREF(__pyx_t_11);
  6794. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6795. __pyx_t_9 = PyObject_RichCompare(__pyx_8genexpr7__pyx_v_item, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 751, __pyx_L9_error)
  6796. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6797. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 751, __pyx_L9_error)
  6798. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6799. if (__pyx_t_12) {
  6800. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr7__pyx_v_item))) __PYX_ERR(0, 751, __pyx_L9_error)
  6801. }
  6802. }
  6803. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6804. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6805. goto __pyx_L13_exit_scope;
  6806. __pyx_L9_error:;
  6807. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6808. goto __pyx_L1_error;
  6809. __pyx_L13_exit_scope:;
  6810. } /* exit inner scope */
  6811. __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 751, __pyx_L1_error)
  6812. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6813. __pyx_v_num_node_source = __pyx_t_10;
  6814. /* "gedlibpy.pyx":753
  6815. * num_node_source = len([item for item in source_map if item != np.inf])
  6816. * # print(num_node_source)
  6817. * num_node_target = len([item for item in target_map if item != np.inf]) # <<<<<<<<<<<<<<
  6818. * # print(num_node_target)
  6819. *
  6820. */
  6821. { /* enter inner scope */
  6822. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 753, __pyx_L16_error)
  6823. __Pyx_GOTREF(__pyx_t_5);
  6824. __pyx_t_8 = __pyx_v_target_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6825. for (;;) {
  6826. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6827. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6828. __pyx_t_9 = PyList_GET_ITEM(__pyx_t_8, __pyx_t_10); __Pyx_INCREF(__pyx_t_9); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 753, __pyx_L16_error)
  6829. #else
  6830. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L16_error)
  6831. __Pyx_GOTREF(__pyx_t_9);
  6832. #endif
  6833. __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_item, __pyx_t_9);
  6834. __pyx_t_9 = 0;
  6835. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L16_error)
  6836. __Pyx_GOTREF(__pyx_t_9);
  6837. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 753, __pyx_L16_error)
  6838. __Pyx_GOTREF(__pyx_t_11);
  6839. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6840. __pyx_t_9 = PyObject_RichCompare(__pyx_8genexpr8__pyx_v_item, __pyx_t_11, Py_NE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 753, __pyx_L16_error)
  6841. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6842. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 753, __pyx_L16_error)
  6843. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6844. if (__pyx_t_12) {
  6845. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr8__pyx_v_item))) __PYX_ERR(0, 753, __pyx_L16_error)
  6846. }
  6847. }
  6848. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6849. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6850. goto __pyx_L20_exit_scope;
  6851. __pyx_L16_error:;
  6852. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6853. goto __pyx_L1_error;
  6854. __pyx_L20_exit_scope:;
  6855. } /* exit inner scope */
  6856. __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 753, __pyx_L1_error)
  6857. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6858. __pyx_v_num_node_target = __pyx_t_10;
  6859. /* "gedlibpy.pyx":756
  6860. * # print(num_node_target)
  6861. *
  6862. * node_map = NodeMap(num_node_source, num_node_target) # <<<<<<<<<<<<<<
  6863. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6864. * for i in range(len(source_map)):
  6865. */
  6866. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 756, __pyx_L1_error)
  6867. __Pyx_GOTREF(__pyx_t_8);
  6868. __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_num_node_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 756, __pyx_L1_error)
  6869. __Pyx_GOTREF(__pyx_t_9);
  6870. __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_num_node_target); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 756, __pyx_L1_error)
  6871. __Pyx_GOTREF(__pyx_t_11);
  6872. __pyx_t_13 = NULL;
  6873. __pyx_t_14 = 0;
  6874. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  6875. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
  6876. if (likely(__pyx_t_13)) {
  6877. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6878. __Pyx_INCREF(__pyx_t_13);
  6879. __Pyx_INCREF(function);
  6880. __Pyx_DECREF_SET(__pyx_t_8, function);
  6881. __pyx_t_14 = 1;
  6882. }
  6883. }
  6884. #if CYTHON_FAST_PYCALL
  6885. if (PyFunction_Check(__pyx_t_8)) {
  6886. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6887. __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
  6888. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6889. __Pyx_GOTREF(__pyx_t_5);
  6890. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6891. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6892. } else
  6893. #endif
  6894. #if CYTHON_FAST_PYCCALL
  6895. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6896. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6897. __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
  6898. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6899. __Pyx_GOTREF(__pyx_t_5);
  6900. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6901. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6902. } else
  6903. #endif
  6904. {
  6905. __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 756, __pyx_L1_error)
  6906. __Pyx_GOTREF(__pyx_t_15);
  6907. if (__pyx_t_13) {
  6908. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
  6909. }
  6910. __Pyx_GIVEREF(__pyx_t_9);
  6911. PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_9);
  6912. __Pyx_GIVEREF(__pyx_t_11);
  6913. PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_11);
  6914. __pyx_t_9 = 0;
  6915. __pyx_t_11 = 0;
  6916. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 756, __pyx_L1_error)
  6917. __Pyx_GOTREF(__pyx_t_5);
  6918. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6919. }
  6920. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6921. __pyx_v_node_map = __pyx_t_5;
  6922. __pyx_t_5 = 0;
  6923. /* "gedlibpy.pyx":758
  6924. * node_map = NodeMap(num_node_source, num_node_target)
  6925. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6926. * for i in range(len(source_map)): # <<<<<<<<<<<<<<
  6927. * node_map.add_assignment(source_map[i], target_map[i])
  6928. * node_map.set_induced_cost(induced_cost)
  6929. */
  6930. __pyx_t_10 = PyList_GET_SIZE(__pyx_v_source_map); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 758, __pyx_L1_error)
  6931. __pyx_t_16 = __pyx_t_10;
  6932. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  6933. __pyx_v_i = __pyx_t_17;
  6934. /* "gedlibpy.pyx":759
  6935. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6936. * for i in range(len(source_map)):
  6937. * node_map.add_assignment(source_map[i], target_map[i]) # <<<<<<<<<<<<<<
  6938. * node_map.set_induced_cost(induced_cost)
  6939. *
  6940. */
  6941. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_add_assignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 759, __pyx_L1_error)
  6942. __Pyx_GOTREF(__pyx_t_8);
  6943. __pyx_t_15 = __Pyx_GetItemInt_List(__pyx_v_source_map, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 759, __pyx_L1_error)
  6944. __Pyx_GOTREF(__pyx_t_15);
  6945. __pyx_t_11 = __Pyx_GetItemInt_List(__pyx_v_target_map, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 759, __pyx_L1_error)
  6946. __Pyx_GOTREF(__pyx_t_11);
  6947. __pyx_t_9 = NULL;
  6948. __pyx_t_14 = 0;
  6949. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  6950. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  6951. if (likely(__pyx_t_9)) {
  6952. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6953. __Pyx_INCREF(__pyx_t_9);
  6954. __Pyx_INCREF(function);
  6955. __Pyx_DECREF_SET(__pyx_t_8, function);
  6956. __pyx_t_14 = 1;
  6957. }
  6958. }
  6959. #if CYTHON_FAST_PYCALL
  6960. if (PyFunction_Check(__pyx_t_8)) {
  6961. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6962. __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
  6963. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6964. __Pyx_GOTREF(__pyx_t_5);
  6965. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6966. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6967. } else
  6968. #endif
  6969. #if CYTHON_FAST_PYCCALL
  6970. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6971. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6972. __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_14, 2+__pyx_t_14); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
  6973. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6974. __Pyx_GOTREF(__pyx_t_5);
  6975. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6976. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6977. } else
  6978. #endif
  6979. {
  6980. __pyx_t_13 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 759, __pyx_L1_error)
  6981. __Pyx_GOTREF(__pyx_t_13);
  6982. if (__pyx_t_9) {
  6983. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL;
  6984. }
  6985. __Pyx_GIVEREF(__pyx_t_15);
  6986. PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_14, __pyx_t_15);
  6987. __Pyx_GIVEREF(__pyx_t_11);
  6988. PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_14, __pyx_t_11);
  6989. __pyx_t_15 = 0;
  6990. __pyx_t_11 = 0;
  6991. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 759, __pyx_L1_error)
  6992. __Pyx_GOTREF(__pyx_t_5);
  6993. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  6994. }
  6995. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6996. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6997. }
  6998. /* "gedlibpy.pyx":760
  6999. * for i in range(len(source_map)):
  7000. * node_map.add_assignment(source_map[i], target_map[i])
  7001. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  7002. *
  7003. * return node_map
  7004. */
  7005. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 760, __pyx_L1_error)
  7006. __Pyx_GOTREF(__pyx_t_8);
  7007. __pyx_t_13 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 760, __pyx_L1_error)
  7008. __Pyx_GOTREF(__pyx_t_13);
  7009. __pyx_t_11 = NULL;
  7010. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  7011. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
  7012. if (likely(__pyx_t_11)) {
  7013. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  7014. __Pyx_INCREF(__pyx_t_11);
  7015. __Pyx_INCREF(function);
  7016. __Pyx_DECREF_SET(__pyx_t_8, function);
  7017. }
  7018. }
  7019. __pyx_t_5 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_11, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13);
  7020. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  7021. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  7022. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 760, __pyx_L1_error)
  7023. __Pyx_GOTREF(__pyx_t_5);
  7024. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7025. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7026. /* "gedlibpy.pyx":762
  7027. * node_map.set_induced_cost(induced_cost)
  7028. *
  7029. * return node_map # <<<<<<<<<<<<<<
  7030. *
  7031. *
  7032. */
  7033. __Pyx_XDECREF(__pyx_r);
  7034. __Pyx_INCREF(__pyx_v_node_map);
  7035. __pyx_r = __pyx_v_node_map;
  7036. goto __pyx_L0;
  7037. /* "gedlibpy.pyx":730
  7038. *
  7039. *
  7040. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  7041. * """
  7042. * Returns the Node Map, like C++ NodeMap.
  7043. */
  7044. /* function exit code */
  7045. __pyx_L1_error:;
  7046. __Pyx_XDECREF(__pyx_t_5);
  7047. __Pyx_XDECREF(__pyx_t_8);
  7048. __Pyx_XDECREF(__pyx_t_9);
  7049. __Pyx_XDECREF(__pyx_t_11);
  7050. __Pyx_XDECREF(__pyx_t_13);
  7051. __Pyx_XDECREF(__pyx_t_15);
  7052. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7053. __pyx_r = NULL;
  7054. __pyx_L0:;
  7055. __Pyx_XDECREF(__pyx_v_source_map);
  7056. __Pyx_XDECREF(__pyx_v_target_map);
  7057. __Pyx_XDECREF(__pyx_v_node_map);
  7058. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item);
  7059. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item);
  7060. __Pyx_XGIVEREF(__pyx_r);
  7061. __Pyx_RefNannyFinishContext();
  7062. return __pyx_r;
  7063. }
  7064. /* "gedlibpy.pyx":765
  7065. *
  7066. *
  7067. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7068. * """
  7069. * Returns the Assignment Matrix between two selected graphs g and h.
  7070. */
  7071. /* Python wrapper */
  7072. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7073. 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";
  7074. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7075. PyObject *__pyx_v_g = 0;
  7076. PyObject *__pyx_v_h = 0;
  7077. PyObject *__pyx_r = 0;
  7078. __Pyx_RefNannyDeclarations
  7079. __Pyx_RefNannySetupContext("get_assignment_matrix (wrapper)", 0);
  7080. {
  7081. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7082. PyObject* values[2] = {0,0};
  7083. if (unlikely(__pyx_kwds)) {
  7084. Py_ssize_t kw_args;
  7085. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7086. switch (pos_args) {
  7087. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7088. CYTHON_FALLTHROUGH;
  7089. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7090. CYTHON_FALLTHROUGH;
  7091. case 0: break;
  7092. default: goto __pyx_L5_argtuple_error;
  7093. }
  7094. kw_args = PyDict_Size(__pyx_kwds);
  7095. switch (pos_args) {
  7096. case 0:
  7097. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7098. else goto __pyx_L5_argtuple_error;
  7099. CYTHON_FALLTHROUGH;
  7100. case 1:
  7101. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7102. else {
  7103. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 765, __pyx_L3_error)
  7104. }
  7105. }
  7106. if (unlikely(kw_args > 0)) {
  7107. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 765, __pyx_L3_error)
  7108. }
  7109. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7110. goto __pyx_L5_argtuple_error;
  7111. } else {
  7112. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7113. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7114. }
  7115. __pyx_v_g = values[0];
  7116. __pyx_v_h = values[1];
  7117. }
  7118. goto __pyx_L4_argument_unpacking_done;
  7119. __pyx_L5_argtuple_error:;
  7120. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 765, __pyx_L3_error)
  7121. __pyx_L3_error:;
  7122. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7123. __Pyx_RefNannyFinishContext();
  7124. return NULL;
  7125. __pyx_L4_argument_unpacking_done:;
  7126. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7127. /* function exit code */
  7128. __Pyx_RefNannyFinishContext();
  7129. return __pyx_r;
  7130. }
  7131. 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) {
  7132. PyObject *__pyx_r = NULL;
  7133. __Pyx_RefNannyDeclarations
  7134. size_t __pyx_t_1;
  7135. size_t __pyx_t_2;
  7136. std::vector<std::vector<int> > __pyx_t_3;
  7137. PyObject *__pyx_t_4 = NULL;
  7138. __Pyx_RefNannySetupContext("get_assignment_matrix", 0);
  7139. /* "gedlibpy.pyx":780
  7140. * .. note:: This function creates datas so use it if necessary.
  7141. * """
  7142. * return self.c_env.getAssignmentMatrix(g, h) # <<<<<<<<<<<<<<
  7143. *
  7144. *
  7145. */
  7146. __Pyx_XDECREF(__pyx_r);
  7147. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
  7148. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 780, __pyx_L1_error)
  7149. try {
  7150. __pyx_t_3 = __pyx_v_self->c_env->getAssignmentMatrix(__pyx_t_1, __pyx_t_2);
  7151. } catch(...) {
  7152. __Pyx_CppExn2PyErr();
  7153. __PYX_ERR(0, 780, __pyx_L1_error)
  7154. }
  7155. __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, 780, __pyx_L1_error)
  7156. __Pyx_GOTREF(__pyx_t_4);
  7157. __pyx_r = __pyx_t_4;
  7158. __pyx_t_4 = 0;
  7159. goto __pyx_L0;
  7160. /* "gedlibpy.pyx":765
  7161. *
  7162. *
  7163. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7164. * """
  7165. * Returns the Assignment Matrix between two selected graphs g and h.
  7166. */
  7167. /* function exit code */
  7168. __pyx_L1_error:;
  7169. __Pyx_XDECREF(__pyx_t_4);
  7170. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7171. __pyx_r = NULL;
  7172. __pyx_L0:;
  7173. __Pyx_XGIVEREF(__pyx_r);
  7174. __Pyx_RefNannyFinishContext();
  7175. return __pyx_r;
  7176. }
  7177. /* "gedlibpy.pyx":783
  7178. *
  7179. *
  7180. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7181. * """
  7182. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7183. */
  7184. /* Python wrapper */
  7185. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7186. 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";
  7187. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7188. PyObject *__pyx_v_g = 0;
  7189. PyObject *__pyx_v_h = 0;
  7190. PyObject *__pyx_r = 0;
  7191. __Pyx_RefNannyDeclarations
  7192. __Pyx_RefNannySetupContext("get_all_map (wrapper)", 0);
  7193. {
  7194. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7195. PyObject* values[2] = {0,0};
  7196. if (unlikely(__pyx_kwds)) {
  7197. Py_ssize_t kw_args;
  7198. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7199. switch (pos_args) {
  7200. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7201. CYTHON_FALLTHROUGH;
  7202. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7203. CYTHON_FALLTHROUGH;
  7204. case 0: break;
  7205. default: goto __pyx_L5_argtuple_error;
  7206. }
  7207. kw_args = PyDict_Size(__pyx_kwds);
  7208. switch (pos_args) {
  7209. case 0:
  7210. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7211. else goto __pyx_L5_argtuple_error;
  7212. CYTHON_FALLTHROUGH;
  7213. case 1:
  7214. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7215. else {
  7216. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 783, __pyx_L3_error)
  7217. }
  7218. }
  7219. if (unlikely(kw_args > 0)) {
  7220. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 783, __pyx_L3_error)
  7221. }
  7222. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7223. goto __pyx_L5_argtuple_error;
  7224. } else {
  7225. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7226. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7227. }
  7228. __pyx_v_g = values[0];
  7229. __pyx_v_h = values[1];
  7230. }
  7231. goto __pyx_L4_argument_unpacking_done;
  7232. __pyx_L5_argtuple_error:;
  7233. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 783, __pyx_L3_error)
  7234. __pyx_L3_error:;
  7235. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7236. __Pyx_RefNannyFinishContext();
  7237. return NULL;
  7238. __pyx_L4_argument_unpacking_done:;
  7239. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7240. /* function exit code */
  7241. __Pyx_RefNannyFinishContext();
  7242. return __pyx_r;
  7243. }
  7244. 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) {
  7245. PyObject *__pyx_r = NULL;
  7246. __Pyx_RefNannyDeclarations
  7247. size_t __pyx_t_1;
  7248. size_t __pyx_t_2;
  7249. std::vector<std::vector<npy_uint64> > __pyx_t_3;
  7250. PyObject *__pyx_t_4 = NULL;
  7251. __Pyx_RefNannySetupContext("get_all_map", 0);
  7252. /* "gedlibpy.pyx":798
  7253. * .. 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 !
  7254. * """
  7255. * return self.c_env.getAllMap(g, h) # <<<<<<<<<<<<<<
  7256. *
  7257. *
  7258. */
  7259. __Pyx_XDECREF(__pyx_r);
  7260. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L1_error)
  7261. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 798, __pyx_L1_error)
  7262. try {
  7263. __pyx_t_3 = __pyx_v_self->c_env->getAllMap(__pyx_t_1, __pyx_t_2);
  7264. } catch(...) {
  7265. __Pyx_CppExn2PyErr();
  7266. __PYX_ERR(0, 798, __pyx_L1_error)
  7267. }
  7268. __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, 798, __pyx_L1_error)
  7269. __Pyx_GOTREF(__pyx_t_4);
  7270. __pyx_r = __pyx_t_4;
  7271. __pyx_t_4 = 0;
  7272. goto __pyx_L0;
  7273. /* "gedlibpy.pyx":783
  7274. *
  7275. *
  7276. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7277. * """
  7278. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7279. */
  7280. /* function exit code */
  7281. __pyx_L1_error:;
  7282. __Pyx_XDECREF(__pyx_t_4);
  7283. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7284. __pyx_r = NULL;
  7285. __pyx_L0:;
  7286. __Pyx_XGIVEREF(__pyx_r);
  7287. __Pyx_RefNannyFinishContext();
  7288. return __pyx_r;
  7289. }
  7290. /* "gedlibpy.pyx":801
  7291. *
  7292. *
  7293. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7294. * """
  7295. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7296. */
  7297. /* Python wrapper */
  7298. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7299. 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";
  7300. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7301. PyObject *__pyx_v_g = 0;
  7302. PyObject *__pyx_v_h = 0;
  7303. PyObject *__pyx_r = 0;
  7304. __Pyx_RefNannyDeclarations
  7305. __Pyx_RefNannySetupContext("get_runtime (wrapper)", 0);
  7306. {
  7307. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7308. PyObject* values[2] = {0,0};
  7309. if (unlikely(__pyx_kwds)) {
  7310. Py_ssize_t kw_args;
  7311. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7312. switch (pos_args) {
  7313. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7314. CYTHON_FALLTHROUGH;
  7315. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7316. CYTHON_FALLTHROUGH;
  7317. case 0: break;
  7318. default: goto __pyx_L5_argtuple_error;
  7319. }
  7320. kw_args = PyDict_Size(__pyx_kwds);
  7321. switch (pos_args) {
  7322. case 0:
  7323. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7324. else goto __pyx_L5_argtuple_error;
  7325. CYTHON_FALLTHROUGH;
  7326. case 1:
  7327. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7328. else {
  7329. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 801, __pyx_L3_error)
  7330. }
  7331. }
  7332. if (unlikely(kw_args > 0)) {
  7333. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 801, __pyx_L3_error)
  7334. }
  7335. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7336. goto __pyx_L5_argtuple_error;
  7337. } else {
  7338. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7339. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7340. }
  7341. __pyx_v_g = values[0];
  7342. __pyx_v_h = values[1];
  7343. }
  7344. goto __pyx_L4_argument_unpacking_done;
  7345. __pyx_L5_argtuple_error:;
  7346. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 801, __pyx_L3_error)
  7347. __pyx_L3_error:;
  7348. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7349. __Pyx_RefNannyFinishContext();
  7350. return NULL;
  7351. __pyx_L4_argument_unpacking_done:;
  7352. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7353. /* function exit code */
  7354. __Pyx_RefNannyFinishContext();
  7355. return __pyx_r;
  7356. }
  7357. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  7358. PyObject *__pyx_r = NULL;
  7359. __Pyx_RefNannyDeclarations
  7360. size_t __pyx_t_1;
  7361. size_t __pyx_t_2;
  7362. double __pyx_t_3;
  7363. PyObject *__pyx_t_4 = NULL;
  7364. __Pyx_RefNannySetupContext("get_runtime", 0);
  7365. /* "gedlibpy.pyx":816
  7366. * .. note:: Python is a bit longer than C++ due to the functions's encapsulate.
  7367. * """
  7368. * return self.c_env.getRuntime(g,h) # <<<<<<<<<<<<<<
  7369. *
  7370. *
  7371. */
  7372. __Pyx_XDECREF(__pyx_r);
  7373. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
  7374. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 816, __pyx_L1_error)
  7375. try {
  7376. __pyx_t_3 = __pyx_v_self->c_env->getRuntime(__pyx_t_1, __pyx_t_2);
  7377. } catch(...) {
  7378. __Pyx_CppExn2PyErr();
  7379. __PYX_ERR(0, 816, __pyx_L1_error)
  7380. }
  7381. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 816, __pyx_L1_error)
  7382. __Pyx_GOTREF(__pyx_t_4);
  7383. __pyx_r = __pyx_t_4;
  7384. __pyx_t_4 = 0;
  7385. goto __pyx_L0;
  7386. /* "gedlibpy.pyx":801
  7387. *
  7388. *
  7389. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7390. * """
  7391. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7392. */
  7393. /* function exit code */
  7394. __pyx_L1_error:;
  7395. __Pyx_XDECREF(__pyx_t_4);
  7396. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7397. __pyx_r = NULL;
  7398. __pyx_L0:;
  7399. __Pyx_XGIVEREF(__pyx_r);
  7400. __Pyx_RefNannyFinishContext();
  7401. return __pyx_r;
  7402. }
  7403. /* "gedlibpy.pyx":819
  7404. *
  7405. *
  7406. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7407. * """
  7408. * Checks and returns if the edit costs are quasimetric.
  7409. */
  7410. /* Python wrapper */
  7411. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  7412. 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";
  7413. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  7414. PyObject *__pyx_r = 0;
  7415. __Pyx_RefNannyDeclarations
  7416. __Pyx_RefNannySetupContext("quasimetric_cost (wrapper)", 0);
  7417. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  7418. /* function exit code */
  7419. __Pyx_RefNannyFinishContext();
  7420. return __pyx_r;
  7421. }
  7422. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  7423. PyObject *__pyx_r = NULL;
  7424. __Pyx_RefNannyDeclarations
  7425. bool __pyx_t_1;
  7426. PyObject *__pyx_t_2 = NULL;
  7427. __Pyx_RefNannySetupContext("quasimetric_cost", 0);
  7428. /* "gedlibpy.pyx":833
  7429. * .. warning:: run_method() between the same two graph must be called before this function.
  7430. * """
  7431. * return self.c_env.quasimetricCosts() # <<<<<<<<<<<<<<
  7432. *
  7433. *
  7434. */
  7435. __Pyx_XDECREF(__pyx_r);
  7436. try {
  7437. __pyx_t_1 = __pyx_v_self->c_env->quasimetricCosts();
  7438. } catch(...) {
  7439. __Pyx_CppExn2PyErr();
  7440. __PYX_ERR(0, 833, __pyx_L1_error)
  7441. }
  7442. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 833, __pyx_L1_error)
  7443. __Pyx_GOTREF(__pyx_t_2);
  7444. __pyx_r = __pyx_t_2;
  7445. __pyx_t_2 = 0;
  7446. goto __pyx_L0;
  7447. /* "gedlibpy.pyx":819
  7448. *
  7449. *
  7450. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7451. * """
  7452. * Checks and returns if the edit costs are quasimetric.
  7453. */
  7454. /* function exit code */
  7455. __pyx_L1_error:;
  7456. __Pyx_XDECREF(__pyx_t_2);
  7457. __Pyx_AddTraceback("gedlibpy.GEDEnv.quasimetric_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7458. __pyx_r = NULL;
  7459. __pyx_L0:;
  7460. __Pyx_XGIVEREF(__pyx_r);
  7461. __Pyx_RefNannyFinishContext();
  7462. return __pyx_r;
  7463. }
  7464. /* "gedlibpy.pyx":836
  7465. *
  7466. *
  7467. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7468. * """
  7469. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7470. */
  7471. /* Python wrapper */
  7472. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7473. 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";
  7474. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7475. PyObject *__pyx_r = 0;
  7476. __Pyx_RefNannyDeclarations
  7477. __Pyx_RefNannySetupContext("hungarian_LSAP (wrapper)", 0);
  7478. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7479. /* function exit code */
  7480. __Pyx_RefNannyFinishContext();
  7481. return __pyx_r;
  7482. }
  7483. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7484. PyObject *__pyx_r = NULL;
  7485. __Pyx_RefNannyDeclarations
  7486. std::vector<std::vector<size_t> > __pyx_t_1;
  7487. std::vector<std::vector<size_t> > __pyx_t_2;
  7488. PyObject *__pyx_t_3 = NULL;
  7489. __Pyx_RefNannySetupContext("hungarian_LSAP", 0);
  7490. /* "gedlibpy.pyx":847
  7491. * .. seealso:: hungarian_LSAPE()
  7492. * """
  7493. * return self.c_env.hungarianLSAP(matrix_cost) # <<<<<<<<<<<<<<
  7494. *
  7495. *
  7496. */
  7497. __Pyx_XDECREF(__pyx_r);
  7498. __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, 847, __pyx_L1_error)
  7499. try {
  7500. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAP(__pyx_t_1);
  7501. } catch(...) {
  7502. __Pyx_CppExn2PyErr();
  7503. __PYX_ERR(0, 847, __pyx_L1_error)
  7504. }
  7505. __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, 847, __pyx_L1_error)
  7506. __Pyx_GOTREF(__pyx_t_3);
  7507. __pyx_r = __pyx_t_3;
  7508. __pyx_t_3 = 0;
  7509. goto __pyx_L0;
  7510. /* "gedlibpy.pyx":836
  7511. *
  7512. *
  7513. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7514. * """
  7515. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7516. */
  7517. /* function exit code */
  7518. __pyx_L1_error:;
  7519. __Pyx_XDECREF(__pyx_t_3);
  7520. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7521. __pyx_r = NULL;
  7522. __pyx_L0:;
  7523. __Pyx_XGIVEREF(__pyx_r);
  7524. __Pyx_RefNannyFinishContext();
  7525. return __pyx_r;
  7526. }
  7527. /* "gedlibpy.pyx":850
  7528. *
  7529. *
  7530. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7531. * """
  7532. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7533. */
  7534. /* Python wrapper */
  7535. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7536. 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";
  7537. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7538. PyObject *__pyx_r = 0;
  7539. __Pyx_RefNannyDeclarations
  7540. __Pyx_RefNannySetupContext("hungarian_LSAPE (wrapper)", 0);
  7541. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7542. /* function exit code */
  7543. __Pyx_RefNannyFinishContext();
  7544. return __pyx_r;
  7545. }
  7546. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7547. PyObject *__pyx_r = NULL;
  7548. __Pyx_RefNannyDeclarations
  7549. std::vector<std::vector<double> > __pyx_t_1;
  7550. std::vector<std::vector<double> > __pyx_t_2;
  7551. PyObject *__pyx_t_3 = NULL;
  7552. __Pyx_RefNannySetupContext("hungarian_LSAPE", 0);
  7553. /* "gedlibpy.pyx":861
  7554. * .. seealso:: hungarian_LSAP()
  7555. * """
  7556. * return self.c_env.hungarianLSAPE(matrix_cost) # <<<<<<<<<<<<<<
  7557. *
  7558. *
  7559. */
  7560. __Pyx_XDECREF(__pyx_r);
  7561. __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, 861, __pyx_L1_error)
  7562. try {
  7563. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAPE(__pyx_t_1);
  7564. } catch(...) {
  7565. __Pyx_CppExn2PyErr();
  7566. __PYX_ERR(0, 861, __pyx_L1_error)
  7567. }
  7568. __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, 861, __pyx_L1_error)
  7569. __Pyx_GOTREF(__pyx_t_3);
  7570. __pyx_r = __pyx_t_3;
  7571. __pyx_t_3 = 0;
  7572. goto __pyx_L0;
  7573. /* "gedlibpy.pyx":850
  7574. *
  7575. *
  7576. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7577. * """
  7578. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7579. */
  7580. /* function exit code */
  7581. __pyx_L1_error:;
  7582. __Pyx_XDECREF(__pyx_t_3);
  7583. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7584. __pyx_r = NULL;
  7585. __pyx_L0:;
  7586. __Pyx_XGIVEREF(__pyx_r);
  7587. __Pyx_RefNannyFinishContext();
  7588. return __pyx_r;
  7589. }
  7590. /* "gedlibpy.pyx":864
  7591. *
  7592. *
  7593. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7594. * """
  7595. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7596. */
  7597. /* Python wrapper */
  7598. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7599. 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";
  7600. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7601. PyObject *__pyx_v_name = 0;
  7602. PyObject *__pyx_v_classe = 0;
  7603. PyObject *__pyx_v_list_of_nodes = 0;
  7604. PyObject *__pyx_v_list_of_edges = 0;
  7605. PyObject *__pyx_v_ignore_duplicates = 0;
  7606. PyObject *__pyx_r = 0;
  7607. __Pyx_RefNannyDeclarations
  7608. __Pyx_RefNannySetupContext("add_random_graph (wrapper)", 0);
  7609. {
  7610. 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};
  7611. PyObject* values[5] = {0,0,0,0,0};
  7612. values[4] = ((PyObject *)Py_True);
  7613. if (unlikely(__pyx_kwds)) {
  7614. Py_ssize_t kw_args;
  7615. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7616. switch (pos_args) {
  7617. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7618. CYTHON_FALLTHROUGH;
  7619. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7620. CYTHON_FALLTHROUGH;
  7621. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7622. CYTHON_FALLTHROUGH;
  7623. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7624. CYTHON_FALLTHROUGH;
  7625. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7626. CYTHON_FALLTHROUGH;
  7627. case 0: break;
  7628. default: goto __pyx_L5_argtuple_error;
  7629. }
  7630. kw_args = PyDict_Size(__pyx_kwds);
  7631. switch (pos_args) {
  7632. case 0:
  7633. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
  7634. else goto __pyx_L5_argtuple_error;
  7635. CYTHON_FALLTHROUGH;
  7636. case 1:
  7637. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  7638. else {
  7639. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 864, __pyx_L3_error)
  7640. }
  7641. CYTHON_FALLTHROUGH;
  7642. case 2:
  7643. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_nodes)) != 0)) kw_args--;
  7644. else {
  7645. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 864, __pyx_L3_error)
  7646. }
  7647. CYTHON_FALLTHROUGH;
  7648. case 3:
  7649. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_edges)) != 0)) kw_args--;
  7650. else {
  7651. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 864, __pyx_L3_error)
  7652. }
  7653. CYTHON_FALLTHROUGH;
  7654. case 4:
  7655. if (kw_args > 0) {
  7656. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  7657. if (value) { values[4] = value; kw_args--; }
  7658. }
  7659. }
  7660. if (unlikely(kw_args > 0)) {
  7661. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 864, __pyx_L3_error)
  7662. }
  7663. } else {
  7664. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7665. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7666. CYTHON_FALLTHROUGH;
  7667. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7668. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7669. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7670. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7671. break;
  7672. default: goto __pyx_L5_argtuple_error;
  7673. }
  7674. }
  7675. __pyx_v_name = values[0];
  7676. __pyx_v_classe = values[1];
  7677. __pyx_v_list_of_nodes = values[2];
  7678. __pyx_v_list_of_edges = values[3];
  7679. __pyx_v_ignore_duplicates = values[4];
  7680. }
  7681. goto __pyx_L4_argument_unpacking_done;
  7682. __pyx_L5_argtuple_error:;
  7683. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 864, __pyx_L3_error)
  7684. __pyx_L3_error:;
  7685. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7686. __Pyx_RefNannyFinishContext();
  7687. return NULL;
  7688. __pyx_L4_argument_unpacking_done:;
  7689. __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);
  7690. /* function exit code */
  7691. __Pyx_RefNannyFinishContext();
  7692. return __pyx_r;
  7693. }
  7694. 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) {
  7695. PyObject *__pyx_v_id = NULL;
  7696. PyObject *__pyx_v_node = NULL;
  7697. PyObject *__pyx_v_edge = NULL;
  7698. PyObject *__pyx_r = NULL;
  7699. __Pyx_RefNannyDeclarations
  7700. PyObject *__pyx_t_1 = NULL;
  7701. PyObject *__pyx_t_2 = NULL;
  7702. PyObject *__pyx_t_3 = NULL;
  7703. int __pyx_t_4;
  7704. PyObject *__pyx_t_5 = NULL;
  7705. Py_ssize_t __pyx_t_6;
  7706. PyObject *(*__pyx_t_7)(PyObject *);
  7707. PyObject *__pyx_t_8 = NULL;
  7708. PyObject *__pyx_t_9 = NULL;
  7709. PyObject *__pyx_t_10 = NULL;
  7710. PyObject *__pyx_t_11 = NULL;
  7711. __Pyx_RefNannySetupContext("add_random_graph", 0);
  7712. /* "gedlibpy.pyx":884
  7713. *
  7714. * """
  7715. * id = self.add_graph(name, classe) # <<<<<<<<<<<<<<
  7716. * for node in list_of_nodes:
  7717. * self.add_node(id, node[0], node[1])
  7718. */
  7719. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
  7720. __Pyx_GOTREF(__pyx_t_2);
  7721. __pyx_t_3 = NULL;
  7722. __pyx_t_4 = 0;
  7723. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  7724. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  7725. if (likely(__pyx_t_3)) {
  7726. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  7727. __Pyx_INCREF(__pyx_t_3);
  7728. __Pyx_INCREF(function);
  7729. __Pyx_DECREF_SET(__pyx_t_2, function);
  7730. __pyx_t_4 = 1;
  7731. }
  7732. }
  7733. #if CYTHON_FAST_PYCALL
  7734. if (PyFunction_Check(__pyx_t_2)) {
  7735. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7736. __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, 884, __pyx_L1_error)
  7737. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7738. __Pyx_GOTREF(__pyx_t_1);
  7739. } else
  7740. #endif
  7741. #if CYTHON_FAST_PYCCALL
  7742. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  7743. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7744. __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, 884, __pyx_L1_error)
  7745. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7746. __Pyx_GOTREF(__pyx_t_1);
  7747. } else
  7748. #endif
  7749. {
  7750. __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 884, __pyx_L1_error)
  7751. __Pyx_GOTREF(__pyx_t_5);
  7752. if (__pyx_t_3) {
  7753. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  7754. }
  7755. __Pyx_INCREF(__pyx_v_name);
  7756. __Pyx_GIVEREF(__pyx_v_name);
  7757. PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  7758. __Pyx_INCREF(__pyx_v_classe);
  7759. __Pyx_GIVEREF(__pyx_v_classe);
  7760. PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_classe);
  7761. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 884, __pyx_L1_error)
  7762. __Pyx_GOTREF(__pyx_t_1);
  7763. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7764. }
  7765. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7766. __pyx_v_id = __pyx_t_1;
  7767. __pyx_t_1 = 0;
  7768. /* "gedlibpy.pyx":885
  7769. * """
  7770. * id = self.add_graph(name, classe)
  7771. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7772. * self.add_node(id, node[0], node[1])
  7773. * for edge in list_of_edges:
  7774. */
  7775. if (likely(PyList_CheckExact(__pyx_v_list_of_nodes)) || PyTuple_CheckExact(__pyx_v_list_of_nodes)) {
  7776. __pyx_t_1 = __pyx_v_list_of_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7777. __pyx_t_7 = NULL;
  7778. } else {
  7779. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 885, __pyx_L1_error)
  7780. __Pyx_GOTREF(__pyx_t_1);
  7781. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 885, __pyx_L1_error)
  7782. }
  7783. for (;;) {
  7784. if (likely(!__pyx_t_7)) {
  7785. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7786. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7787. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7788. __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, 885, __pyx_L1_error)
  7789. #else
  7790. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  7791. __Pyx_GOTREF(__pyx_t_2);
  7792. #endif
  7793. } else {
  7794. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7795. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7796. __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, 885, __pyx_L1_error)
  7797. #else
  7798. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 885, __pyx_L1_error)
  7799. __Pyx_GOTREF(__pyx_t_2);
  7800. #endif
  7801. }
  7802. } else {
  7803. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7804. if (unlikely(!__pyx_t_2)) {
  7805. PyObject* exc_type = PyErr_Occurred();
  7806. if (exc_type) {
  7807. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7808. else __PYX_ERR(0, 885, __pyx_L1_error)
  7809. }
  7810. break;
  7811. }
  7812. __Pyx_GOTREF(__pyx_t_2);
  7813. }
  7814. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_2);
  7815. __pyx_t_2 = 0;
  7816. /* "gedlibpy.pyx":886
  7817. * id = self.add_graph(name, classe)
  7818. * for node in list_of_nodes:
  7819. * self.add_node(id, node[0], node[1]) # <<<<<<<<<<<<<<
  7820. * for edge in list_of_edges:
  7821. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7822. */
  7823. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 886, __pyx_L1_error)
  7824. __Pyx_GOTREF(__pyx_t_5);
  7825. __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, 886, __pyx_L1_error)
  7826. __Pyx_GOTREF(__pyx_t_3);
  7827. __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, 886, __pyx_L1_error)
  7828. __Pyx_GOTREF(__pyx_t_8);
  7829. __pyx_t_9 = NULL;
  7830. __pyx_t_4 = 0;
  7831. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7832. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7833. if (likely(__pyx_t_9)) {
  7834. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7835. __Pyx_INCREF(__pyx_t_9);
  7836. __Pyx_INCREF(function);
  7837. __Pyx_DECREF_SET(__pyx_t_5, function);
  7838. __pyx_t_4 = 1;
  7839. }
  7840. }
  7841. #if CYTHON_FAST_PYCALL
  7842. if (PyFunction_Check(__pyx_t_5)) {
  7843. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7844. __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, 886, __pyx_L1_error)
  7845. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7846. __Pyx_GOTREF(__pyx_t_2);
  7847. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7848. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7849. } else
  7850. #endif
  7851. #if CYTHON_FAST_PYCCALL
  7852. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7853. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7854. __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, 886, __pyx_L1_error)
  7855. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7856. __Pyx_GOTREF(__pyx_t_2);
  7857. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7858. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7859. } else
  7860. #endif
  7861. {
  7862. __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 886, __pyx_L1_error)
  7863. __Pyx_GOTREF(__pyx_t_10);
  7864. if (__pyx_t_9) {
  7865. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7866. }
  7867. __Pyx_INCREF(__pyx_v_id);
  7868. __Pyx_GIVEREF(__pyx_v_id);
  7869. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_id);
  7870. __Pyx_GIVEREF(__pyx_t_3);
  7871. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_3);
  7872. __Pyx_GIVEREF(__pyx_t_8);
  7873. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8);
  7874. __pyx_t_3 = 0;
  7875. __pyx_t_8 = 0;
  7876. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 886, __pyx_L1_error)
  7877. __Pyx_GOTREF(__pyx_t_2);
  7878. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7879. }
  7880. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7881. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7882. /* "gedlibpy.pyx":885
  7883. * """
  7884. * id = self.add_graph(name, classe)
  7885. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7886. * self.add_node(id, node[0], node[1])
  7887. * for edge in list_of_edges:
  7888. */
  7889. }
  7890. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7891. /* "gedlibpy.pyx":887
  7892. * for node in list_of_nodes:
  7893. * self.add_node(id, node[0], node[1])
  7894. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  7895. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7896. * return id
  7897. */
  7898. if (likely(PyList_CheckExact(__pyx_v_list_of_edges)) || PyTuple_CheckExact(__pyx_v_list_of_edges)) {
  7899. __pyx_t_1 = __pyx_v_list_of_edges; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7900. __pyx_t_7 = NULL;
  7901. } else {
  7902. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 887, __pyx_L1_error)
  7903. __Pyx_GOTREF(__pyx_t_1);
  7904. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 887, __pyx_L1_error)
  7905. }
  7906. for (;;) {
  7907. if (likely(!__pyx_t_7)) {
  7908. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7909. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7910. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7911. __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, 887, __pyx_L1_error)
  7912. #else
  7913. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error)
  7914. __Pyx_GOTREF(__pyx_t_2);
  7915. #endif
  7916. } else {
  7917. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7918. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7919. __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, 887, __pyx_L1_error)
  7920. #else
  7921. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error)
  7922. __Pyx_GOTREF(__pyx_t_2);
  7923. #endif
  7924. }
  7925. } else {
  7926. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7927. if (unlikely(!__pyx_t_2)) {
  7928. PyObject* exc_type = PyErr_Occurred();
  7929. if (exc_type) {
  7930. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7931. else __PYX_ERR(0, 887, __pyx_L1_error)
  7932. }
  7933. break;
  7934. }
  7935. __Pyx_GOTREF(__pyx_t_2);
  7936. }
  7937. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  7938. __pyx_t_2 = 0;
  7939. /* "gedlibpy.pyx":888
  7940. * self.add_node(id, node[0], node[1])
  7941. * for edge in list_of_edges:
  7942. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) # <<<<<<<<<<<<<<
  7943. * return id
  7944. *
  7945. */
  7946. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 888, __pyx_L1_error)
  7947. __Pyx_GOTREF(__pyx_t_5);
  7948. __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, 888, __pyx_L1_error)
  7949. __Pyx_GOTREF(__pyx_t_10);
  7950. __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, 888, __pyx_L1_error)
  7951. __Pyx_GOTREF(__pyx_t_8);
  7952. __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, 888, __pyx_L1_error)
  7953. __Pyx_GOTREF(__pyx_t_3);
  7954. __pyx_t_9 = NULL;
  7955. __pyx_t_4 = 0;
  7956. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7957. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7958. if (likely(__pyx_t_9)) {
  7959. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7960. __Pyx_INCREF(__pyx_t_9);
  7961. __Pyx_INCREF(function);
  7962. __Pyx_DECREF_SET(__pyx_t_5, function);
  7963. __pyx_t_4 = 1;
  7964. }
  7965. }
  7966. #if CYTHON_FAST_PYCALL
  7967. if (PyFunction_Check(__pyx_t_5)) {
  7968. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7969. __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, 888, __pyx_L1_error)
  7970. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7971. __Pyx_GOTREF(__pyx_t_2);
  7972. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7973. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7974. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7975. } else
  7976. #endif
  7977. #if CYTHON_FAST_PYCCALL
  7978. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7979. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7980. __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, 888, __pyx_L1_error)
  7981. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7982. __Pyx_GOTREF(__pyx_t_2);
  7983. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7984. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7985. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7986. } else
  7987. #endif
  7988. {
  7989. __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 888, __pyx_L1_error)
  7990. __Pyx_GOTREF(__pyx_t_11);
  7991. if (__pyx_t_9) {
  7992. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7993. }
  7994. __Pyx_INCREF(__pyx_v_id);
  7995. __Pyx_GIVEREF(__pyx_v_id);
  7996. PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_id);
  7997. __Pyx_GIVEREF(__pyx_t_10);
  7998. PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
  7999. __Pyx_GIVEREF(__pyx_t_8);
  8000. PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_4, __pyx_t_8);
  8001. __Pyx_GIVEREF(__pyx_t_3);
  8002. PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_4, __pyx_t_3);
  8003. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8004. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8005. PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_4, __pyx_v_ignore_duplicates);
  8006. __pyx_t_10 = 0;
  8007. __pyx_t_8 = 0;
  8008. __pyx_t_3 = 0;
  8009. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 888, __pyx_L1_error)
  8010. __Pyx_GOTREF(__pyx_t_2);
  8011. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8012. }
  8013. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8014. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8015. /* "gedlibpy.pyx":887
  8016. * for node in list_of_nodes:
  8017. * self.add_node(id, node[0], node[1])
  8018. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  8019. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8020. * return id
  8021. */
  8022. }
  8023. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8024. /* "gedlibpy.pyx":889
  8025. * for edge in list_of_edges:
  8026. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8027. * return id # <<<<<<<<<<<<<<
  8028. *
  8029. *
  8030. */
  8031. __Pyx_XDECREF(__pyx_r);
  8032. __Pyx_INCREF(__pyx_v_id);
  8033. __pyx_r = __pyx_v_id;
  8034. goto __pyx_L0;
  8035. /* "gedlibpy.pyx":864
  8036. *
  8037. *
  8038. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8039. * """
  8040. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8041. */
  8042. /* function exit code */
  8043. __pyx_L1_error:;
  8044. __Pyx_XDECREF(__pyx_t_1);
  8045. __Pyx_XDECREF(__pyx_t_2);
  8046. __Pyx_XDECREF(__pyx_t_3);
  8047. __Pyx_XDECREF(__pyx_t_5);
  8048. __Pyx_XDECREF(__pyx_t_8);
  8049. __Pyx_XDECREF(__pyx_t_9);
  8050. __Pyx_XDECREF(__pyx_t_10);
  8051. __Pyx_XDECREF(__pyx_t_11);
  8052. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8053. __pyx_r = NULL;
  8054. __pyx_L0:;
  8055. __Pyx_XDECREF(__pyx_v_id);
  8056. __Pyx_XDECREF(__pyx_v_node);
  8057. __Pyx_XDECREF(__pyx_v_edge);
  8058. __Pyx_XGIVEREF(__pyx_r);
  8059. __Pyx_RefNannyFinishContext();
  8060. return __pyx_r;
  8061. }
  8062. /* "gedlibpy.pyx":892
  8063. *
  8064. *
  8065. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8066. * """
  8067. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8068. */
  8069. /* Python wrapper */
  8070. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8071. 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";
  8072. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8073. PyObject *__pyx_v_g = 0;
  8074. PyObject *__pyx_v_classe = 0;
  8075. PyObject *__pyx_v_ignore_duplicates = 0;
  8076. PyObject *__pyx_r = 0;
  8077. __Pyx_RefNannyDeclarations
  8078. __Pyx_RefNannySetupContext("add_nx_graph (wrapper)", 0);
  8079. {
  8080. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_classe,&__pyx_n_s_ignore_duplicates,0};
  8081. PyObject* values[3] = {0,0,0};
  8082. values[2] = ((PyObject *)Py_True);
  8083. if (unlikely(__pyx_kwds)) {
  8084. Py_ssize_t kw_args;
  8085. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8086. switch (pos_args) {
  8087. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8088. CYTHON_FALLTHROUGH;
  8089. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8090. CYTHON_FALLTHROUGH;
  8091. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8092. CYTHON_FALLTHROUGH;
  8093. case 0: break;
  8094. default: goto __pyx_L5_argtuple_error;
  8095. }
  8096. kw_args = PyDict_Size(__pyx_kwds);
  8097. switch (pos_args) {
  8098. case 0:
  8099. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  8100. else goto __pyx_L5_argtuple_error;
  8101. CYTHON_FALLTHROUGH;
  8102. case 1:
  8103. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  8104. else {
  8105. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 892, __pyx_L3_error)
  8106. }
  8107. CYTHON_FALLTHROUGH;
  8108. case 2:
  8109. if (kw_args > 0) {
  8110. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  8111. if (value) { values[2] = value; kw_args--; }
  8112. }
  8113. }
  8114. if (unlikely(kw_args > 0)) {
  8115. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 892, __pyx_L3_error)
  8116. }
  8117. } else {
  8118. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8119. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8120. CYTHON_FALLTHROUGH;
  8121. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8122. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8123. break;
  8124. default: goto __pyx_L5_argtuple_error;
  8125. }
  8126. }
  8127. __pyx_v_g = values[0];
  8128. __pyx_v_classe = values[1];
  8129. __pyx_v_ignore_duplicates = values[2];
  8130. }
  8131. goto __pyx_L4_argument_unpacking_done;
  8132. __pyx_L5_argtuple_error:;
  8133. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 892, __pyx_L3_error)
  8134. __pyx_L3_error:;
  8135. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8136. __Pyx_RefNannyFinishContext();
  8137. return NULL;
  8138. __pyx_L4_argument_unpacking_done:;
  8139. __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);
  8140. /* function exit code */
  8141. __Pyx_RefNannyFinishContext();
  8142. return __pyx_r;
  8143. }
  8144. 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) {
  8145. PyObject *__pyx_v_id = NULL;
  8146. PyObject *__pyx_v_node = NULL;
  8147. PyObject *__pyx_v_edge = NULL;
  8148. PyObject *__pyx_r = NULL;
  8149. __Pyx_RefNannyDeclarations
  8150. PyObject *__pyx_t_1 = NULL;
  8151. PyObject *__pyx_t_2 = NULL;
  8152. PyObject *__pyx_t_3 = NULL;
  8153. PyObject *__pyx_t_4 = NULL;
  8154. int __pyx_t_5;
  8155. PyObject *__pyx_t_6 = NULL;
  8156. Py_ssize_t __pyx_t_7;
  8157. PyObject *(*__pyx_t_8)(PyObject *);
  8158. PyObject *__pyx_t_9 = NULL;
  8159. PyObject *__pyx_t_10 = NULL;
  8160. PyObject *__pyx_t_11 = NULL;
  8161. PyObject *__pyx_t_12 = NULL;
  8162. PyObject *__pyx_t_13 = NULL;
  8163. PyObject *__pyx_t_14 = NULL;
  8164. __Pyx_RefNannySetupContext("add_nx_graph", 0);
  8165. /* "gedlibpy.pyx":906
  8166. *
  8167. * """
  8168. * id = self.add_graph(g.name, classe) # <<<<<<<<<<<<<<
  8169. * for node in g.nodes:
  8170. * self.add_node(id, str(node), g.nodes[node])
  8171. */
  8172. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 906, __pyx_L1_error)
  8173. __Pyx_GOTREF(__pyx_t_2);
  8174. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
  8175. __Pyx_GOTREF(__pyx_t_3);
  8176. __pyx_t_4 = NULL;
  8177. __pyx_t_5 = 0;
  8178. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8179. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
  8180. if (likely(__pyx_t_4)) {
  8181. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8182. __Pyx_INCREF(__pyx_t_4);
  8183. __Pyx_INCREF(function);
  8184. __Pyx_DECREF_SET(__pyx_t_2, function);
  8185. __pyx_t_5 = 1;
  8186. }
  8187. }
  8188. #if CYTHON_FAST_PYCALL
  8189. if (PyFunction_Check(__pyx_t_2)) {
  8190. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8191. __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, 906, __pyx_L1_error)
  8192. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8193. __Pyx_GOTREF(__pyx_t_1);
  8194. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8195. } else
  8196. #endif
  8197. #if CYTHON_FAST_PYCCALL
  8198. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8199. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8200. __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, 906, __pyx_L1_error)
  8201. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8202. __Pyx_GOTREF(__pyx_t_1);
  8203. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8204. } else
  8205. #endif
  8206. {
  8207. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
  8208. __Pyx_GOTREF(__pyx_t_6);
  8209. if (__pyx_t_4) {
  8210. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8211. }
  8212. __Pyx_GIVEREF(__pyx_t_3);
  8213. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
  8214. __Pyx_INCREF(__pyx_v_classe);
  8215. __Pyx_GIVEREF(__pyx_v_classe);
  8216. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_classe);
  8217. __pyx_t_3 = 0;
  8218. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 906, __pyx_L1_error)
  8219. __Pyx_GOTREF(__pyx_t_1);
  8220. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8221. }
  8222. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8223. __pyx_v_id = __pyx_t_1;
  8224. __pyx_t_1 = 0;
  8225. /* "gedlibpy.pyx":907
  8226. * """
  8227. * id = self.add_graph(g.name, classe)
  8228. * for node in g.nodes: # <<<<<<<<<<<<<<
  8229. * self.add_node(id, str(node), g.nodes[node])
  8230. * for edge in g.edges:
  8231. */
  8232. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
  8233. __Pyx_GOTREF(__pyx_t_1);
  8234. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  8235. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
  8236. __pyx_t_8 = NULL;
  8237. } else {
  8238. __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
  8239. __Pyx_GOTREF(__pyx_t_2);
  8240. __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 907, __pyx_L1_error)
  8241. }
  8242. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8243. for (;;) {
  8244. if (likely(!__pyx_t_8)) {
  8245. if (likely(PyList_CheckExact(__pyx_t_2))) {
  8246. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
  8247. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8248. __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, 907, __pyx_L1_error)
  8249. #else
  8250. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
  8251. __Pyx_GOTREF(__pyx_t_1);
  8252. #endif
  8253. } else {
  8254. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  8255. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8256. __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, 907, __pyx_L1_error)
  8257. #else
  8258. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
  8259. __Pyx_GOTREF(__pyx_t_1);
  8260. #endif
  8261. }
  8262. } else {
  8263. __pyx_t_1 = __pyx_t_8(__pyx_t_2);
  8264. if (unlikely(!__pyx_t_1)) {
  8265. PyObject* exc_type = PyErr_Occurred();
  8266. if (exc_type) {
  8267. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8268. else __PYX_ERR(0, 907, __pyx_L1_error)
  8269. }
  8270. break;
  8271. }
  8272. __Pyx_GOTREF(__pyx_t_1);
  8273. }
  8274. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
  8275. __pyx_t_1 = 0;
  8276. /* "gedlibpy.pyx":908
  8277. * id = self.add_graph(g.name, classe)
  8278. * for node in g.nodes:
  8279. * self.add_node(id, str(node), g.nodes[node]) # <<<<<<<<<<<<<<
  8280. * for edge in g.edges:
  8281. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8282. */
  8283. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
  8284. __Pyx_GOTREF(__pyx_t_6);
  8285. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 908, __pyx_L1_error)
  8286. __Pyx_GOTREF(__pyx_t_3);
  8287. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 908, __pyx_L1_error)
  8288. __Pyx_GOTREF(__pyx_t_4);
  8289. __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error)
  8290. __Pyx_GOTREF(__pyx_t_9);
  8291. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8292. __pyx_t_4 = NULL;
  8293. __pyx_t_5 = 0;
  8294. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8295. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8296. if (likely(__pyx_t_4)) {
  8297. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8298. __Pyx_INCREF(__pyx_t_4);
  8299. __Pyx_INCREF(function);
  8300. __Pyx_DECREF_SET(__pyx_t_6, function);
  8301. __pyx_t_5 = 1;
  8302. }
  8303. }
  8304. #if CYTHON_FAST_PYCALL
  8305. if (PyFunction_Check(__pyx_t_6)) {
  8306. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8307. __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, 908, __pyx_L1_error)
  8308. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8309. __Pyx_GOTREF(__pyx_t_1);
  8310. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8311. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8312. } else
  8313. #endif
  8314. #if CYTHON_FAST_PYCCALL
  8315. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8316. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8317. __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, 908, __pyx_L1_error)
  8318. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8319. __Pyx_GOTREF(__pyx_t_1);
  8320. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8321. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8322. } else
  8323. #endif
  8324. {
  8325. __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 908, __pyx_L1_error)
  8326. __Pyx_GOTREF(__pyx_t_10);
  8327. if (__pyx_t_4) {
  8328. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8329. }
  8330. __Pyx_INCREF(__pyx_v_id);
  8331. __Pyx_GIVEREF(__pyx_v_id);
  8332. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_id);
  8333. __Pyx_GIVEREF(__pyx_t_3);
  8334. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_3);
  8335. __Pyx_GIVEREF(__pyx_t_9);
  8336. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_9);
  8337. __pyx_t_3 = 0;
  8338. __pyx_t_9 = 0;
  8339. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 908, __pyx_L1_error)
  8340. __Pyx_GOTREF(__pyx_t_1);
  8341. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8342. }
  8343. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8344. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8345. /* "gedlibpy.pyx":907
  8346. * """
  8347. * id = self.add_graph(g.name, classe)
  8348. * for node in g.nodes: # <<<<<<<<<<<<<<
  8349. * self.add_node(id, str(node), g.nodes[node])
  8350. * for edge in g.edges:
  8351. */
  8352. }
  8353. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8354. /* "gedlibpy.pyx":909
  8355. * for node in g.nodes:
  8356. * self.add_node(id, str(node), g.nodes[node])
  8357. * for edge in g.edges: # <<<<<<<<<<<<<<
  8358. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8359. * return id
  8360. */
  8361. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
  8362. __Pyx_GOTREF(__pyx_t_2);
  8363. if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
  8364. __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
  8365. __pyx_t_8 = NULL;
  8366. } else {
  8367. __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 909, __pyx_L1_error)
  8368. __Pyx_GOTREF(__pyx_t_1);
  8369. __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 909, __pyx_L1_error)
  8370. }
  8371. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8372. for (;;) {
  8373. if (likely(!__pyx_t_8)) {
  8374. if (likely(PyList_CheckExact(__pyx_t_1))) {
  8375. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
  8376. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8377. __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, 909, __pyx_L1_error)
  8378. #else
  8379. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
  8380. __Pyx_GOTREF(__pyx_t_2);
  8381. #endif
  8382. } else {
  8383. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  8384. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8385. __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, 909, __pyx_L1_error)
  8386. #else
  8387. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 909, __pyx_L1_error)
  8388. __Pyx_GOTREF(__pyx_t_2);
  8389. #endif
  8390. }
  8391. } else {
  8392. __pyx_t_2 = __pyx_t_8(__pyx_t_1);
  8393. if (unlikely(!__pyx_t_2)) {
  8394. PyObject* exc_type = PyErr_Occurred();
  8395. if (exc_type) {
  8396. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8397. else __PYX_ERR(0, 909, __pyx_L1_error)
  8398. }
  8399. break;
  8400. }
  8401. __Pyx_GOTREF(__pyx_t_2);
  8402. }
  8403. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  8404. __pyx_t_2 = 0;
  8405. /* "gedlibpy.pyx":910
  8406. * self.add_node(id, str(node), g.nodes[node])
  8407. * for edge in g.edges:
  8408. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) # <<<<<<<<<<<<<<
  8409. * return id
  8410. *
  8411. */
  8412. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
  8413. __Pyx_GOTREF(__pyx_t_6);
  8414. __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, 910, __pyx_L1_error)
  8415. __Pyx_GOTREF(__pyx_t_10);
  8416. __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error)
  8417. __Pyx_GOTREF(__pyx_t_9);
  8418. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8419. __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, 910, __pyx_L1_error)
  8420. __Pyx_GOTREF(__pyx_t_10);
  8421. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 910, __pyx_L1_error)
  8422. __Pyx_GOTREF(__pyx_t_3);
  8423. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8424. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 910, __pyx_L1_error)
  8425. __Pyx_GOTREF(__pyx_t_4);
  8426. __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, 910, __pyx_L1_error)
  8427. __Pyx_GOTREF(__pyx_t_11);
  8428. __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, 910, __pyx_L1_error)
  8429. __Pyx_GOTREF(__pyx_t_12);
  8430. __pyx_t_13 = NULL;
  8431. __pyx_t_5 = 0;
  8432. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  8433. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
  8434. if (likely(__pyx_t_13)) {
  8435. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  8436. __Pyx_INCREF(__pyx_t_13);
  8437. __Pyx_INCREF(function);
  8438. __Pyx_DECREF_SET(__pyx_t_4, function);
  8439. __pyx_t_5 = 1;
  8440. }
  8441. }
  8442. #if CYTHON_FAST_PYCALL
  8443. if (PyFunction_Check(__pyx_t_4)) {
  8444. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8445. __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, 910, __pyx_L1_error)
  8446. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8447. __Pyx_GOTREF(__pyx_t_10);
  8448. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8449. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8450. } else
  8451. #endif
  8452. #if CYTHON_FAST_PYCCALL
  8453. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  8454. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8455. __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, 910, __pyx_L1_error)
  8456. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8457. __Pyx_GOTREF(__pyx_t_10);
  8458. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8459. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8460. } else
  8461. #endif
  8462. {
  8463. __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L1_error)
  8464. __Pyx_GOTREF(__pyx_t_14);
  8465. if (__pyx_t_13) {
  8466. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
  8467. }
  8468. __Pyx_GIVEREF(__pyx_t_11);
  8469. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_t_11);
  8470. __Pyx_GIVEREF(__pyx_t_12);
  8471. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_12);
  8472. __pyx_t_11 = 0;
  8473. __pyx_t_12 = 0;
  8474. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 910, __pyx_L1_error)
  8475. __Pyx_GOTREF(__pyx_t_10);
  8476. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8477. }
  8478. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8479. __pyx_t_4 = NULL;
  8480. __pyx_t_5 = 0;
  8481. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8482. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8483. if (likely(__pyx_t_4)) {
  8484. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8485. __Pyx_INCREF(__pyx_t_4);
  8486. __Pyx_INCREF(function);
  8487. __Pyx_DECREF_SET(__pyx_t_6, function);
  8488. __pyx_t_5 = 1;
  8489. }
  8490. }
  8491. #if CYTHON_FAST_PYCALL
  8492. if (PyFunction_Check(__pyx_t_6)) {
  8493. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8494. __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, 910, __pyx_L1_error)
  8495. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8496. __Pyx_GOTREF(__pyx_t_2);
  8497. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8498. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8499. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8500. } else
  8501. #endif
  8502. #if CYTHON_FAST_PYCCALL
  8503. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8504. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8505. __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, 910, __pyx_L1_error)
  8506. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8507. __Pyx_GOTREF(__pyx_t_2);
  8508. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8509. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8510. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8511. } else
  8512. #endif
  8513. {
  8514. __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 910, __pyx_L1_error)
  8515. __Pyx_GOTREF(__pyx_t_14);
  8516. if (__pyx_t_4) {
  8517. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8518. }
  8519. __Pyx_INCREF(__pyx_v_id);
  8520. __Pyx_GIVEREF(__pyx_v_id);
  8521. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_v_id);
  8522. __Pyx_GIVEREF(__pyx_t_9);
  8523. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_9);
  8524. __Pyx_GIVEREF(__pyx_t_3);
  8525. PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_5, __pyx_t_3);
  8526. __Pyx_GIVEREF(__pyx_t_10);
  8527. PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_5, __pyx_t_10);
  8528. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8529. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8530. PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_5, __pyx_v_ignore_duplicates);
  8531. __pyx_t_9 = 0;
  8532. __pyx_t_3 = 0;
  8533. __pyx_t_10 = 0;
  8534. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 910, __pyx_L1_error)
  8535. __Pyx_GOTREF(__pyx_t_2);
  8536. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8537. }
  8538. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8539. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8540. /* "gedlibpy.pyx":909
  8541. * for node in g.nodes:
  8542. * self.add_node(id, str(node), g.nodes[node])
  8543. * for edge in g.edges: # <<<<<<<<<<<<<<
  8544. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8545. * return id
  8546. */
  8547. }
  8548. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8549. /* "gedlibpy.pyx":911
  8550. * for edge in g.edges:
  8551. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8552. * return id # <<<<<<<<<<<<<<
  8553. *
  8554. *
  8555. */
  8556. __Pyx_XDECREF(__pyx_r);
  8557. __Pyx_INCREF(__pyx_v_id);
  8558. __pyx_r = __pyx_v_id;
  8559. goto __pyx_L0;
  8560. /* "gedlibpy.pyx":892
  8561. *
  8562. *
  8563. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8564. * """
  8565. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8566. */
  8567. /* function exit code */
  8568. __pyx_L1_error:;
  8569. __Pyx_XDECREF(__pyx_t_1);
  8570. __Pyx_XDECREF(__pyx_t_2);
  8571. __Pyx_XDECREF(__pyx_t_3);
  8572. __Pyx_XDECREF(__pyx_t_4);
  8573. __Pyx_XDECREF(__pyx_t_6);
  8574. __Pyx_XDECREF(__pyx_t_9);
  8575. __Pyx_XDECREF(__pyx_t_10);
  8576. __Pyx_XDECREF(__pyx_t_11);
  8577. __Pyx_XDECREF(__pyx_t_12);
  8578. __Pyx_XDECREF(__pyx_t_13);
  8579. __Pyx_XDECREF(__pyx_t_14);
  8580. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8581. __pyx_r = NULL;
  8582. __pyx_L0:;
  8583. __Pyx_XDECREF(__pyx_v_id);
  8584. __Pyx_XDECREF(__pyx_v_node);
  8585. __Pyx_XDECREF(__pyx_v_edge);
  8586. __Pyx_XGIVEREF(__pyx_r);
  8587. __Pyx_RefNannyFinishContext();
  8588. return __pyx_r;
  8589. }
  8590. /* "gedlibpy.pyx":914
  8591. *
  8592. *
  8593. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8594. * """
  8595. * Computes the edit distance between two NX graphs.
  8596. */
  8597. /* Python wrapper */
  8598. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8599. 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";
  8600. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8601. PyObject *__pyx_v_g1 = 0;
  8602. PyObject *__pyx_v_g2 = 0;
  8603. PyObject *__pyx_v_edit_cost = 0;
  8604. PyObject *__pyx_v_method = 0;
  8605. PyObject *__pyx_v_options = 0;
  8606. PyObject *__pyx_v_init_option = 0;
  8607. PyObject *__pyx_r = 0;
  8608. __Pyx_RefNannyDeclarations
  8609. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs (wrapper)", 0);
  8610. {
  8611. 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};
  8612. PyObject* values[6] = {0,0,0,0,0,0};
  8613. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  8614. if (unlikely(__pyx_kwds)) {
  8615. Py_ssize_t kw_args;
  8616. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8617. switch (pos_args) {
  8618. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8619. CYTHON_FALLTHROUGH;
  8620. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8621. CYTHON_FALLTHROUGH;
  8622. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8623. CYTHON_FALLTHROUGH;
  8624. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8625. CYTHON_FALLTHROUGH;
  8626. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8627. CYTHON_FALLTHROUGH;
  8628. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8629. CYTHON_FALLTHROUGH;
  8630. case 0: break;
  8631. default: goto __pyx_L5_argtuple_error;
  8632. }
  8633. kw_args = PyDict_Size(__pyx_kwds);
  8634. switch (pos_args) {
  8635. case 0:
  8636. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g1)) != 0)) kw_args--;
  8637. else goto __pyx_L5_argtuple_error;
  8638. CYTHON_FALLTHROUGH;
  8639. case 1:
  8640. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g2)) != 0)) kw_args--;
  8641. else {
  8642. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 914, __pyx_L3_error)
  8643. }
  8644. CYTHON_FALLTHROUGH;
  8645. case 2:
  8646. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  8647. else {
  8648. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 914, __pyx_L3_error)
  8649. }
  8650. CYTHON_FALLTHROUGH;
  8651. case 3:
  8652. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  8653. else {
  8654. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 914, __pyx_L3_error)
  8655. }
  8656. CYTHON_FALLTHROUGH;
  8657. case 4:
  8658. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  8659. else {
  8660. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 914, __pyx_L3_error)
  8661. }
  8662. CYTHON_FALLTHROUGH;
  8663. case 5:
  8664. if (kw_args > 0) {
  8665. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  8666. if (value) { values[5] = value; kw_args--; }
  8667. }
  8668. }
  8669. if (unlikely(kw_args > 0)) {
  8670. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ged_on_two_graphs") < 0)) __PYX_ERR(0, 914, __pyx_L3_error)
  8671. }
  8672. } else {
  8673. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8674. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8675. CYTHON_FALLTHROUGH;
  8676. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8677. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8678. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8679. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8680. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8681. break;
  8682. default: goto __pyx_L5_argtuple_error;
  8683. }
  8684. }
  8685. __pyx_v_g1 = values[0];
  8686. __pyx_v_g2 = values[1];
  8687. __pyx_v_edit_cost = values[2];
  8688. __pyx_v_method = values[3];
  8689. __pyx_v_options = values[4];
  8690. __pyx_v_init_option = values[5];
  8691. }
  8692. goto __pyx_L4_argument_unpacking_done;
  8693. __pyx_L5_argtuple_error:;
  8694. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 914, __pyx_L3_error)
  8695. __pyx_L3_error:;
  8696. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8697. __Pyx_RefNannyFinishContext();
  8698. return NULL;
  8699. __pyx_L4_argument_unpacking_done:;
  8700. __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);
  8701. /* function exit code */
  8702. __Pyx_RefNannyFinishContext();
  8703. return __pyx_r;
  8704. }
  8705. 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) {
  8706. PyObject *__pyx_v_g = NULL;
  8707. PyObject *__pyx_v_h = NULL;
  8708. PyObject *__pyx_v_resDistance = NULL;
  8709. PyObject *__pyx_v_resMapping = NULL;
  8710. PyObject *__pyx_r = NULL;
  8711. __Pyx_RefNannyDeclarations
  8712. PyObject *__pyx_t_1 = NULL;
  8713. PyObject *__pyx_t_2 = NULL;
  8714. PyObject *__pyx_t_3 = NULL;
  8715. int __pyx_t_4;
  8716. int __pyx_t_5;
  8717. PyObject *__pyx_t_6 = NULL;
  8718. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs", 0);
  8719. /* "gedlibpy.pyx":937
  8720. *
  8721. * """
  8722. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8723. * self.restart_env()
  8724. *
  8725. */
  8726. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 937, __pyx_L1_error)
  8727. __Pyx_GOTREF(__pyx_t_2);
  8728. __pyx_t_3 = NULL;
  8729. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8730. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8731. if (likely(__pyx_t_3)) {
  8732. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8733. __Pyx_INCREF(__pyx_t_3);
  8734. __Pyx_INCREF(function);
  8735. __Pyx_DECREF_SET(__pyx_t_2, function);
  8736. }
  8737. }
  8738. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8739. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8740. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 937, __pyx_L1_error)
  8741. __Pyx_GOTREF(__pyx_t_1);
  8742. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8743. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 937, __pyx_L1_error)
  8744. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8745. if (__pyx_t_4) {
  8746. /* "gedlibpy.pyx":938
  8747. * """
  8748. * if self.is_initialized() :
  8749. * self.restart_env() # <<<<<<<<<<<<<<
  8750. *
  8751. * g = self.add_nx_graph(g1, "")
  8752. */
  8753. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
  8754. __Pyx_GOTREF(__pyx_t_2);
  8755. __pyx_t_3 = NULL;
  8756. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8757. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8758. if (likely(__pyx_t_3)) {
  8759. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8760. __Pyx_INCREF(__pyx_t_3);
  8761. __Pyx_INCREF(function);
  8762. __Pyx_DECREF_SET(__pyx_t_2, function);
  8763. }
  8764. }
  8765. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8766. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8767. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
  8768. __Pyx_GOTREF(__pyx_t_1);
  8769. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8770. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8771. /* "gedlibpy.pyx":937
  8772. *
  8773. * """
  8774. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8775. * self.restart_env()
  8776. *
  8777. */
  8778. }
  8779. /* "gedlibpy.pyx":940
  8780. * self.restart_env()
  8781. *
  8782. * g = self.add_nx_graph(g1, "") # <<<<<<<<<<<<<<
  8783. * h = self.add_nx_graph(g2, "")
  8784. *
  8785. */
  8786. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 940, __pyx_L1_error)
  8787. __Pyx_GOTREF(__pyx_t_2);
  8788. __pyx_t_3 = NULL;
  8789. __pyx_t_5 = 0;
  8790. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8791. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8792. if (likely(__pyx_t_3)) {
  8793. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8794. __Pyx_INCREF(__pyx_t_3);
  8795. __Pyx_INCREF(function);
  8796. __Pyx_DECREF_SET(__pyx_t_2, function);
  8797. __pyx_t_5 = 1;
  8798. }
  8799. }
  8800. #if CYTHON_FAST_PYCALL
  8801. if (PyFunction_Check(__pyx_t_2)) {
  8802. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8803. __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, 940, __pyx_L1_error)
  8804. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8805. __Pyx_GOTREF(__pyx_t_1);
  8806. } else
  8807. #endif
  8808. #if CYTHON_FAST_PYCCALL
  8809. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8810. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8811. __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, 940, __pyx_L1_error)
  8812. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8813. __Pyx_GOTREF(__pyx_t_1);
  8814. } else
  8815. #endif
  8816. {
  8817. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 940, __pyx_L1_error)
  8818. __Pyx_GOTREF(__pyx_t_6);
  8819. if (__pyx_t_3) {
  8820. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8821. }
  8822. __Pyx_INCREF(__pyx_v_g1);
  8823. __Pyx_GIVEREF(__pyx_v_g1);
  8824. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g1);
  8825. __Pyx_INCREF(__pyx_kp_u_);
  8826. __Pyx_GIVEREF(__pyx_kp_u_);
  8827. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_u_);
  8828. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 940, __pyx_L1_error)
  8829. __Pyx_GOTREF(__pyx_t_1);
  8830. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8831. }
  8832. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8833. __pyx_v_g = __pyx_t_1;
  8834. __pyx_t_1 = 0;
  8835. /* "gedlibpy.pyx":941
  8836. *
  8837. * g = self.add_nx_graph(g1, "")
  8838. * h = self.add_nx_graph(g2, "") # <<<<<<<<<<<<<<
  8839. *
  8840. * self.set_edit_cost(edit_cost)
  8841. */
  8842. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 941, __pyx_L1_error)
  8843. __Pyx_GOTREF(__pyx_t_2);
  8844. __pyx_t_6 = NULL;
  8845. __pyx_t_5 = 0;
  8846. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8847. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8848. if (likely(__pyx_t_6)) {
  8849. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8850. __Pyx_INCREF(__pyx_t_6);
  8851. __Pyx_INCREF(function);
  8852. __Pyx_DECREF_SET(__pyx_t_2, function);
  8853. __pyx_t_5 = 1;
  8854. }
  8855. }
  8856. #if CYTHON_FAST_PYCALL
  8857. if (PyFunction_Check(__pyx_t_2)) {
  8858. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8859. __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, 941, __pyx_L1_error)
  8860. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8861. __Pyx_GOTREF(__pyx_t_1);
  8862. } else
  8863. #endif
  8864. #if CYTHON_FAST_PYCCALL
  8865. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8866. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8867. __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, 941, __pyx_L1_error)
  8868. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8869. __Pyx_GOTREF(__pyx_t_1);
  8870. } else
  8871. #endif
  8872. {
  8873. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 941, __pyx_L1_error)
  8874. __Pyx_GOTREF(__pyx_t_3);
  8875. if (__pyx_t_6) {
  8876. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8877. }
  8878. __Pyx_INCREF(__pyx_v_g2);
  8879. __Pyx_GIVEREF(__pyx_v_g2);
  8880. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g2);
  8881. __Pyx_INCREF(__pyx_kp_u_);
  8882. __Pyx_GIVEREF(__pyx_kp_u_);
  8883. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_);
  8884. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 941, __pyx_L1_error)
  8885. __Pyx_GOTREF(__pyx_t_1);
  8886. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8887. }
  8888. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8889. __pyx_v_h = __pyx_t_1;
  8890. __pyx_t_1 = 0;
  8891. /* "gedlibpy.pyx":943
  8892. * h = self.add_nx_graph(g2, "")
  8893. *
  8894. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  8895. * self.init(init_option)
  8896. *
  8897. */
  8898. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
  8899. __Pyx_GOTREF(__pyx_t_2);
  8900. __pyx_t_3 = NULL;
  8901. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8902. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8903. if (likely(__pyx_t_3)) {
  8904. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8905. __Pyx_INCREF(__pyx_t_3);
  8906. __Pyx_INCREF(function);
  8907. __Pyx_DECREF_SET(__pyx_t_2, function);
  8908. }
  8909. }
  8910. __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);
  8911. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8912. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  8913. __Pyx_GOTREF(__pyx_t_1);
  8914. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8915. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8916. /* "gedlibpy.pyx":944
  8917. *
  8918. * self.set_edit_cost(edit_cost)
  8919. * self.init(init_option) # <<<<<<<<<<<<<<
  8920. *
  8921. * self.set_method(method, options)
  8922. */
  8923. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
  8924. __Pyx_GOTREF(__pyx_t_2);
  8925. __pyx_t_3 = NULL;
  8926. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8927. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8928. if (likely(__pyx_t_3)) {
  8929. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8930. __Pyx_INCREF(__pyx_t_3);
  8931. __Pyx_INCREF(function);
  8932. __Pyx_DECREF_SET(__pyx_t_2, function);
  8933. }
  8934. }
  8935. __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);
  8936. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8937. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  8938. __Pyx_GOTREF(__pyx_t_1);
  8939. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8940. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8941. /* "gedlibpy.pyx":946
  8942. * self.init(init_option)
  8943. *
  8944. * self.set_method(method, options) # <<<<<<<<<<<<<<
  8945. * self.init_method()
  8946. *
  8947. */
  8948. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
  8949. __Pyx_GOTREF(__pyx_t_2);
  8950. __pyx_t_3 = NULL;
  8951. __pyx_t_5 = 0;
  8952. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8953. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8954. if (likely(__pyx_t_3)) {
  8955. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8956. __Pyx_INCREF(__pyx_t_3);
  8957. __Pyx_INCREF(function);
  8958. __Pyx_DECREF_SET(__pyx_t_2, function);
  8959. __pyx_t_5 = 1;
  8960. }
  8961. }
  8962. #if CYTHON_FAST_PYCALL
  8963. if (PyFunction_Check(__pyx_t_2)) {
  8964. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8965. __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, 946, __pyx_L1_error)
  8966. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8967. __Pyx_GOTREF(__pyx_t_1);
  8968. } else
  8969. #endif
  8970. #if CYTHON_FAST_PYCCALL
  8971. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8972. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8973. __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, 946, __pyx_L1_error)
  8974. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8975. __Pyx_GOTREF(__pyx_t_1);
  8976. } else
  8977. #endif
  8978. {
  8979. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 946, __pyx_L1_error)
  8980. __Pyx_GOTREF(__pyx_t_6);
  8981. if (__pyx_t_3) {
  8982. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8983. }
  8984. __Pyx_INCREF(__pyx_v_method);
  8985. __Pyx_GIVEREF(__pyx_v_method);
  8986. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
  8987. __Pyx_INCREF(__pyx_v_options);
  8988. __Pyx_GIVEREF(__pyx_v_options);
  8989. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_options);
  8990. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 946, __pyx_L1_error)
  8991. __Pyx_GOTREF(__pyx_t_1);
  8992. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8993. }
  8994. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8995. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8996. /* "gedlibpy.pyx":947
  8997. *
  8998. * self.set_method(method, options)
  8999. * self.init_method() # <<<<<<<<<<<<<<
  9000. *
  9001. * resDistance = 0
  9002. */
  9003. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 947, __pyx_L1_error)
  9004. __Pyx_GOTREF(__pyx_t_2);
  9005. __pyx_t_6 = NULL;
  9006. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9007. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9008. if (likely(__pyx_t_6)) {
  9009. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9010. __Pyx_INCREF(__pyx_t_6);
  9011. __Pyx_INCREF(function);
  9012. __Pyx_DECREF_SET(__pyx_t_2, function);
  9013. }
  9014. }
  9015. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9016. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9017. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
  9018. __Pyx_GOTREF(__pyx_t_1);
  9019. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9020. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9021. /* "gedlibpy.pyx":949
  9022. * self.init_method()
  9023. *
  9024. * resDistance = 0 # <<<<<<<<<<<<<<
  9025. * resMapping = []
  9026. * self.run_method(g, h)
  9027. */
  9028. __Pyx_INCREF(__pyx_int_0);
  9029. __pyx_v_resDistance = __pyx_int_0;
  9030. /* "gedlibpy.pyx":950
  9031. *
  9032. * resDistance = 0
  9033. * resMapping = [] # <<<<<<<<<<<<<<
  9034. * self.run_method(g, h)
  9035. * resDistance = self.get_upper_bound(g, h)
  9036. */
  9037. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 950, __pyx_L1_error)
  9038. __Pyx_GOTREF(__pyx_t_1);
  9039. __pyx_v_resMapping = __pyx_t_1;
  9040. __pyx_t_1 = 0;
  9041. /* "gedlibpy.pyx":951
  9042. * resDistance = 0
  9043. * resMapping = []
  9044. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9045. * resDistance = self.get_upper_bound(g, h)
  9046. * resMapping = self.get_node_map(g, h)
  9047. */
  9048. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 951, __pyx_L1_error)
  9049. __Pyx_GOTREF(__pyx_t_2);
  9050. __pyx_t_6 = NULL;
  9051. __pyx_t_5 = 0;
  9052. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9053. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9054. if (likely(__pyx_t_6)) {
  9055. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9056. __Pyx_INCREF(__pyx_t_6);
  9057. __Pyx_INCREF(function);
  9058. __Pyx_DECREF_SET(__pyx_t_2, function);
  9059. __pyx_t_5 = 1;
  9060. }
  9061. }
  9062. #if CYTHON_FAST_PYCALL
  9063. if (PyFunction_Check(__pyx_t_2)) {
  9064. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9065. __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, 951, __pyx_L1_error)
  9066. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9067. __Pyx_GOTREF(__pyx_t_1);
  9068. } else
  9069. #endif
  9070. #if CYTHON_FAST_PYCCALL
  9071. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9072. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9073. __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, 951, __pyx_L1_error)
  9074. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9075. __Pyx_GOTREF(__pyx_t_1);
  9076. } else
  9077. #endif
  9078. {
  9079. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 951, __pyx_L1_error)
  9080. __Pyx_GOTREF(__pyx_t_3);
  9081. if (__pyx_t_6) {
  9082. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9083. }
  9084. __Pyx_INCREF(__pyx_v_g);
  9085. __Pyx_GIVEREF(__pyx_v_g);
  9086. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9087. __Pyx_INCREF(__pyx_v_h);
  9088. __Pyx_GIVEREF(__pyx_v_h);
  9089. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9090. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 951, __pyx_L1_error)
  9091. __Pyx_GOTREF(__pyx_t_1);
  9092. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9093. }
  9094. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9095. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9096. /* "gedlibpy.pyx":952
  9097. * resMapping = []
  9098. * self.run_method(g, h)
  9099. * resDistance = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  9100. * resMapping = self.get_node_map(g, h)
  9101. *
  9102. */
  9103. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 952, __pyx_L1_error)
  9104. __Pyx_GOTREF(__pyx_t_2);
  9105. __pyx_t_3 = NULL;
  9106. __pyx_t_5 = 0;
  9107. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9108. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9109. if (likely(__pyx_t_3)) {
  9110. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9111. __Pyx_INCREF(__pyx_t_3);
  9112. __Pyx_INCREF(function);
  9113. __Pyx_DECREF_SET(__pyx_t_2, function);
  9114. __pyx_t_5 = 1;
  9115. }
  9116. }
  9117. #if CYTHON_FAST_PYCALL
  9118. if (PyFunction_Check(__pyx_t_2)) {
  9119. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9120. __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, 952, __pyx_L1_error)
  9121. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9122. __Pyx_GOTREF(__pyx_t_1);
  9123. } else
  9124. #endif
  9125. #if CYTHON_FAST_PYCCALL
  9126. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9127. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9128. __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, 952, __pyx_L1_error)
  9129. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9130. __Pyx_GOTREF(__pyx_t_1);
  9131. } else
  9132. #endif
  9133. {
  9134. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 952, __pyx_L1_error)
  9135. __Pyx_GOTREF(__pyx_t_6);
  9136. if (__pyx_t_3) {
  9137. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9138. }
  9139. __Pyx_INCREF(__pyx_v_g);
  9140. __Pyx_GIVEREF(__pyx_v_g);
  9141. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g);
  9142. __Pyx_INCREF(__pyx_v_h);
  9143. __Pyx_GIVEREF(__pyx_v_h);
  9144. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_h);
  9145. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 952, __pyx_L1_error)
  9146. __Pyx_GOTREF(__pyx_t_1);
  9147. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  9148. }
  9149. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9150. __Pyx_DECREF_SET(__pyx_v_resDistance, __pyx_t_1);
  9151. __pyx_t_1 = 0;
  9152. /* "gedlibpy.pyx":953
  9153. * self.run_method(g, h)
  9154. * resDistance = self.get_upper_bound(g, h)
  9155. * resMapping = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  9156. *
  9157. * return resDistance, resMapping
  9158. */
  9159. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 953, __pyx_L1_error)
  9160. __Pyx_GOTREF(__pyx_t_2);
  9161. __pyx_t_6 = NULL;
  9162. __pyx_t_5 = 0;
  9163. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9164. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9165. if (likely(__pyx_t_6)) {
  9166. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9167. __Pyx_INCREF(__pyx_t_6);
  9168. __Pyx_INCREF(function);
  9169. __Pyx_DECREF_SET(__pyx_t_2, function);
  9170. __pyx_t_5 = 1;
  9171. }
  9172. }
  9173. #if CYTHON_FAST_PYCALL
  9174. if (PyFunction_Check(__pyx_t_2)) {
  9175. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9176. __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, 953, __pyx_L1_error)
  9177. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9178. __Pyx_GOTREF(__pyx_t_1);
  9179. } else
  9180. #endif
  9181. #if CYTHON_FAST_PYCCALL
  9182. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9183. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9184. __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, 953, __pyx_L1_error)
  9185. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9186. __Pyx_GOTREF(__pyx_t_1);
  9187. } else
  9188. #endif
  9189. {
  9190. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error)
  9191. __Pyx_GOTREF(__pyx_t_3);
  9192. if (__pyx_t_6) {
  9193. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9194. }
  9195. __Pyx_INCREF(__pyx_v_g);
  9196. __Pyx_GIVEREF(__pyx_v_g);
  9197. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9198. __Pyx_INCREF(__pyx_v_h);
  9199. __Pyx_GIVEREF(__pyx_v_h);
  9200. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9201. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 953, __pyx_L1_error)
  9202. __Pyx_GOTREF(__pyx_t_1);
  9203. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9204. }
  9205. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9206. __Pyx_DECREF_SET(__pyx_v_resMapping, __pyx_t_1);
  9207. __pyx_t_1 = 0;
  9208. /* "gedlibpy.pyx":955
  9209. * resMapping = self.get_node_map(g, h)
  9210. *
  9211. * return resDistance, resMapping # <<<<<<<<<<<<<<
  9212. *
  9213. *
  9214. */
  9215. __Pyx_XDECREF(__pyx_r);
  9216. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 955, __pyx_L1_error)
  9217. __Pyx_GOTREF(__pyx_t_1);
  9218. __Pyx_INCREF(__pyx_v_resDistance);
  9219. __Pyx_GIVEREF(__pyx_v_resDistance);
  9220. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_resDistance);
  9221. __Pyx_INCREF(__pyx_v_resMapping);
  9222. __Pyx_GIVEREF(__pyx_v_resMapping);
  9223. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_resMapping);
  9224. __pyx_r = __pyx_t_1;
  9225. __pyx_t_1 = 0;
  9226. goto __pyx_L0;
  9227. /* "gedlibpy.pyx":914
  9228. *
  9229. *
  9230. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9231. * """
  9232. * Computes the edit distance between two NX graphs.
  9233. */
  9234. /* function exit code */
  9235. __pyx_L1_error:;
  9236. __Pyx_XDECREF(__pyx_t_1);
  9237. __Pyx_XDECREF(__pyx_t_2);
  9238. __Pyx_XDECREF(__pyx_t_3);
  9239. __Pyx_XDECREF(__pyx_t_6);
  9240. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9241. __pyx_r = NULL;
  9242. __pyx_L0:;
  9243. __Pyx_XDECREF(__pyx_v_g);
  9244. __Pyx_XDECREF(__pyx_v_h);
  9245. __Pyx_XDECREF(__pyx_v_resDistance);
  9246. __Pyx_XDECREF(__pyx_v_resMapping);
  9247. __Pyx_XGIVEREF(__pyx_r);
  9248. __Pyx_RefNannyFinishContext();
  9249. return __pyx_r;
  9250. }
  9251. /* "gedlibpy.pyx":958
  9252. *
  9253. *
  9254. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9255. * """
  9256. *
  9257. */
  9258. /* Python wrapper */
  9259. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9260. 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";
  9261. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9262. PyObject *__pyx_v_dataset = 0;
  9263. PyObject *__pyx_v_classes = 0;
  9264. PyObject *__pyx_v_edit_cost = 0;
  9265. PyObject *__pyx_v_method = 0;
  9266. PyObject *__pyx_v_options = 0;
  9267. PyObject *__pyx_v_init_option = 0;
  9268. PyObject *__pyx_r = 0;
  9269. __Pyx_RefNannyDeclarations
  9270. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs (wrapper)", 0);
  9271. {
  9272. 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};
  9273. PyObject* values[6] = {0,0,0,0,0,0};
  9274. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  9275. if (unlikely(__pyx_kwds)) {
  9276. Py_ssize_t kw_args;
  9277. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  9278. switch (pos_args) {
  9279. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9280. CYTHON_FALLTHROUGH;
  9281. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9282. CYTHON_FALLTHROUGH;
  9283. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9284. CYTHON_FALLTHROUGH;
  9285. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9286. CYTHON_FALLTHROUGH;
  9287. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9288. CYTHON_FALLTHROUGH;
  9289. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9290. CYTHON_FALLTHROUGH;
  9291. case 0: break;
  9292. default: goto __pyx_L5_argtuple_error;
  9293. }
  9294. kw_args = PyDict_Size(__pyx_kwds);
  9295. switch (pos_args) {
  9296. case 0:
  9297. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dataset)) != 0)) kw_args--;
  9298. else goto __pyx_L5_argtuple_error;
  9299. CYTHON_FALLTHROUGH;
  9300. case 1:
  9301. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classes)) != 0)) kw_args--;
  9302. else {
  9303. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 958, __pyx_L3_error)
  9304. }
  9305. CYTHON_FALLTHROUGH;
  9306. case 2:
  9307. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  9308. else {
  9309. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 958, __pyx_L3_error)
  9310. }
  9311. CYTHON_FALLTHROUGH;
  9312. case 3:
  9313. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  9314. else {
  9315. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 958, __pyx_L3_error)
  9316. }
  9317. CYTHON_FALLTHROUGH;
  9318. case 4:
  9319. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  9320. else {
  9321. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 958, __pyx_L3_error)
  9322. }
  9323. CYTHON_FALLTHROUGH;
  9324. case 5:
  9325. if (kw_args > 0) {
  9326. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  9327. if (value) { values[5] = value; kw_args--; }
  9328. }
  9329. }
  9330. if (unlikely(kw_args > 0)) {
  9331. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_nx_graphs") < 0)) __PYX_ERR(0, 958, __pyx_L3_error)
  9332. }
  9333. } else {
  9334. switch (PyTuple_GET_SIZE(__pyx_args)) {
  9335. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9336. CYTHON_FALLTHROUGH;
  9337. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9338. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9339. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9340. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9341. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9342. break;
  9343. default: goto __pyx_L5_argtuple_error;
  9344. }
  9345. }
  9346. __pyx_v_dataset = values[0];
  9347. __pyx_v_classes = values[1];
  9348. __pyx_v_edit_cost = values[2];
  9349. __pyx_v_method = values[3];
  9350. __pyx_v_options = values[4];
  9351. __pyx_v_init_option = values[5];
  9352. }
  9353. goto __pyx_L4_argument_unpacking_done;
  9354. __pyx_L5_argtuple_error:;
  9355. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 958, __pyx_L3_error)
  9356. __pyx_L3_error:;
  9357. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9358. __Pyx_RefNannyFinishContext();
  9359. return NULL;
  9360. __pyx_L4_argument_unpacking_done:;
  9361. __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);
  9362. /* function exit code */
  9363. __Pyx_RefNannyFinishContext();
  9364. return __pyx_r;
  9365. }
  9366. 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) {
  9367. PyObject *__pyx_v_graph = NULL;
  9368. PyObject *__pyx_v_listID = NULL;
  9369. PyObject *__pyx_v_resDistance = NULL;
  9370. PyObject *__pyx_v_resMapping = NULL;
  9371. PyObject *__pyx_v_g = NULL;
  9372. PyObject *__pyx_v_h = NULL;
  9373. PyObject *__pyx_r = NULL;
  9374. __Pyx_RefNannyDeclarations
  9375. PyObject *__pyx_t_1 = NULL;
  9376. PyObject *__pyx_t_2 = NULL;
  9377. PyObject *__pyx_t_3 = NULL;
  9378. int __pyx_t_4;
  9379. Py_ssize_t __pyx_t_5;
  9380. PyObject *(*__pyx_t_6)(PyObject *);
  9381. PyObject *__pyx_t_7 = NULL;
  9382. int __pyx_t_8;
  9383. PyObject *__pyx_t_9 = NULL;
  9384. Py_ssize_t __pyx_t_10;
  9385. PyObject *(*__pyx_t_11)(PyObject *);
  9386. PyObject *__pyx_t_12 = NULL;
  9387. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs", 0);
  9388. /* "gedlibpy.pyx":982
  9389. *
  9390. * """
  9391. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9392. * self.restart_env()
  9393. *
  9394. */
  9395. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  9396. __Pyx_GOTREF(__pyx_t_2);
  9397. __pyx_t_3 = NULL;
  9398. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9399. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9400. if (likely(__pyx_t_3)) {
  9401. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9402. __Pyx_INCREF(__pyx_t_3);
  9403. __Pyx_INCREF(function);
  9404. __Pyx_DECREF_SET(__pyx_t_2, function);
  9405. }
  9406. }
  9407. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9408. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9409. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
  9410. __Pyx_GOTREF(__pyx_t_1);
  9411. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9412. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 982, __pyx_L1_error)
  9413. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9414. if (__pyx_t_4) {
  9415. /* "gedlibpy.pyx":983
  9416. * """
  9417. * if self.is_initialized() :
  9418. * self.restart_env() # <<<<<<<<<<<<<<
  9419. *
  9420. * print("Loading graphs in progress...")
  9421. */
  9422. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 983, __pyx_L1_error)
  9423. __Pyx_GOTREF(__pyx_t_2);
  9424. __pyx_t_3 = NULL;
  9425. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9426. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9427. if (likely(__pyx_t_3)) {
  9428. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9429. __Pyx_INCREF(__pyx_t_3);
  9430. __Pyx_INCREF(function);
  9431. __Pyx_DECREF_SET(__pyx_t_2, function);
  9432. }
  9433. }
  9434. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9435. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9436. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 983, __pyx_L1_error)
  9437. __Pyx_GOTREF(__pyx_t_1);
  9438. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9439. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9440. /* "gedlibpy.pyx":982
  9441. *
  9442. * """
  9443. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9444. * self.restart_env()
  9445. *
  9446. */
  9447. }
  9448. /* "gedlibpy.pyx":985
  9449. * self.restart_env()
  9450. *
  9451. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  9452. * for graph in dataset :
  9453. * self.add_nx_graph(graph, classes)
  9454. */
  9455. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 985, __pyx_L1_error)
  9456. __Pyx_GOTREF(__pyx_t_1);
  9457. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9458. /* "gedlibpy.pyx":986
  9459. *
  9460. * print("Loading graphs in progress...")
  9461. * for graph in dataset : # <<<<<<<<<<<<<<
  9462. * self.add_nx_graph(graph, classes)
  9463. * listID = self.graph_ids()
  9464. */
  9465. if (likely(PyList_CheckExact(__pyx_v_dataset)) || PyTuple_CheckExact(__pyx_v_dataset)) {
  9466. __pyx_t_1 = __pyx_v_dataset; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  9467. __pyx_t_6 = NULL;
  9468. } else {
  9469. __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
  9470. __Pyx_GOTREF(__pyx_t_1);
  9471. __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 986, __pyx_L1_error)
  9472. }
  9473. for (;;) {
  9474. if (likely(!__pyx_t_6)) {
  9475. if (likely(PyList_CheckExact(__pyx_t_1))) {
  9476. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
  9477. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9478. __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, 986, __pyx_L1_error)
  9479. #else
  9480. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  9481. __Pyx_GOTREF(__pyx_t_2);
  9482. #endif
  9483. } else {
  9484. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  9485. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9486. __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, 986, __pyx_L1_error)
  9487. #else
  9488. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  9489. __Pyx_GOTREF(__pyx_t_2);
  9490. #endif
  9491. }
  9492. } else {
  9493. __pyx_t_2 = __pyx_t_6(__pyx_t_1);
  9494. if (unlikely(!__pyx_t_2)) {
  9495. PyObject* exc_type = PyErr_Occurred();
  9496. if (exc_type) {
  9497. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9498. else __PYX_ERR(0, 986, __pyx_L1_error)
  9499. }
  9500. break;
  9501. }
  9502. __Pyx_GOTREF(__pyx_t_2);
  9503. }
  9504. __Pyx_XDECREF_SET(__pyx_v_graph, __pyx_t_2);
  9505. __pyx_t_2 = 0;
  9506. /* "gedlibpy.pyx":987
  9507. * print("Loading graphs in progress...")
  9508. * for graph in dataset :
  9509. * self.add_nx_graph(graph, classes) # <<<<<<<<<<<<<<
  9510. * listID = self.graph_ids()
  9511. * print("Graphs loaded ! ")
  9512. */
  9513. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 987, __pyx_L1_error)
  9514. __Pyx_GOTREF(__pyx_t_3);
  9515. __pyx_t_7 = NULL;
  9516. __pyx_t_8 = 0;
  9517. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  9518. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
  9519. if (likely(__pyx_t_7)) {
  9520. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  9521. __Pyx_INCREF(__pyx_t_7);
  9522. __Pyx_INCREF(function);
  9523. __Pyx_DECREF_SET(__pyx_t_3, function);
  9524. __pyx_t_8 = 1;
  9525. }
  9526. }
  9527. #if CYTHON_FAST_PYCALL
  9528. if (PyFunction_Check(__pyx_t_3)) {
  9529. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9530. __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, 987, __pyx_L1_error)
  9531. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9532. __Pyx_GOTREF(__pyx_t_2);
  9533. } else
  9534. #endif
  9535. #if CYTHON_FAST_PYCCALL
  9536. if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
  9537. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9538. __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, 987, __pyx_L1_error)
  9539. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9540. __Pyx_GOTREF(__pyx_t_2);
  9541. } else
  9542. #endif
  9543. {
  9544. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 987, __pyx_L1_error)
  9545. __Pyx_GOTREF(__pyx_t_9);
  9546. if (__pyx_t_7) {
  9547. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9548. }
  9549. __Pyx_INCREF(__pyx_v_graph);
  9550. __Pyx_GIVEREF(__pyx_v_graph);
  9551. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_graph);
  9552. __Pyx_INCREF(__pyx_v_classes);
  9553. __Pyx_GIVEREF(__pyx_v_classes);
  9554. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_classes);
  9555. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
  9556. __Pyx_GOTREF(__pyx_t_2);
  9557. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9558. }
  9559. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9560. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9561. /* "gedlibpy.pyx":986
  9562. *
  9563. * print("Loading graphs in progress...")
  9564. * for graph in dataset : # <<<<<<<<<<<<<<
  9565. * self.add_nx_graph(graph, classes)
  9566. * listID = self.graph_ids()
  9567. */
  9568. }
  9569. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9570. /* "gedlibpy.pyx":988
  9571. * for graph in dataset :
  9572. * self.add_nx_graph(graph, classes)
  9573. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  9574. * print("Graphs loaded ! ")
  9575. * print("Number of graphs = " + str(listID[1]))
  9576. */
  9577. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 988, __pyx_L1_error)
  9578. __Pyx_GOTREF(__pyx_t_2);
  9579. __pyx_t_3 = NULL;
  9580. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9581. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9582. if (likely(__pyx_t_3)) {
  9583. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9584. __Pyx_INCREF(__pyx_t_3);
  9585. __Pyx_INCREF(function);
  9586. __Pyx_DECREF_SET(__pyx_t_2, function);
  9587. }
  9588. }
  9589. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9590. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9591. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 988, __pyx_L1_error)
  9592. __Pyx_GOTREF(__pyx_t_1);
  9593. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9594. __pyx_v_listID = __pyx_t_1;
  9595. __pyx_t_1 = 0;
  9596. /* "gedlibpy.pyx":989
  9597. * self.add_nx_graph(graph, classes)
  9598. * listID = self.graph_ids()
  9599. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  9600. * print("Number of graphs = " + str(listID[1]))
  9601. *
  9602. */
  9603. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
  9604. __Pyx_GOTREF(__pyx_t_1);
  9605. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9606. /* "gedlibpy.pyx":990
  9607. * listID = self.graph_ids()
  9608. * print("Graphs loaded ! ")
  9609. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  9610. *
  9611. * self.set_edit_cost(edit_cost)
  9612. */
  9613. __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, 990, __pyx_L1_error)
  9614. __Pyx_GOTREF(__pyx_t_1);
  9615. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error)
  9616. __Pyx_GOTREF(__pyx_t_2);
  9617. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9618. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
  9619. __Pyx_GOTREF(__pyx_t_1);
  9620. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9621. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error)
  9622. __Pyx_GOTREF(__pyx_t_2);
  9623. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9624. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9625. /* "gedlibpy.pyx":992
  9626. * print("Number of graphs = " + str(listID[1]))
  9627. *
  9628. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  9629. * print("Initialization in progress...")
  9630. * self.init(init_option)
  9631. */
  9632. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  9633. __Pyx_GOTREF(__pyx_t_1);
  9634. __pyx_t_3 = NULL;
  9635. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9636. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9637. if (likely(__pyx_t_3)) {
  9638. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9639. __Pyx_INCREF(__pyx_t_3);
  9640. __Pyx_INCREF(function);
  9641. __Pyx_DECREF_SET(__pyx_t_1, function);
  9642. }
  9643. }
  9644. __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);
  9645. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9646. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error)
  9647. __Pyx_GOTREF(__pyx_t_2);
  9648. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9649. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9650. /* "gedlibpy.pyx":993
  9651. *
  9652. * self.set_edit_cost(edit_cost)
  9653. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  9654. * self.init(init_option)
  9655. * print("Initialization terminated !")
  9656. */
  9657. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error)
  9658. __Pyx_GOTREF(__pyx_t_2);
  9659. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9660. /* "gedlibpy.pyx":994
  9661. * self.set_edit_cost(edit_cost)
  9662. * print("Initialization in progress...")
  9663. * self.init(init_option) # <<<<<<<<<<<<<<
  9664. * print("Initialization terminated !")
  9665. *
  9666. */
  9667. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  9668. __Pyx_GOTREF(__pyx_t_1);
  9669. __pyx_t_3 = NULL;
  9670. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9671. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9672. if (likely(__pyx_t_3)) {
  9673. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9674. __Pyx_INCREF(__pyx_t_3);
  9675. __Pyx_INCREF(function);
  9676. __Pyx_DECREF_SET(__pyx_t_1, function);
  9677. }
  9678. }
  9679. __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);
  9680. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9681. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 994, __pyx_L1_error)
  9682. __Pyx_GOTREF(__pyx_t_2);
  9683. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9684. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9685. /* "gedlibpy.pyx":995
  9686. * print("Initialization in progress...")
  9687. * self.init(init_option)
  9688. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  9689. *
  9690. * self.set_method(method, options)
  9691. */
  9692. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  9693. __Pyx_GOTREF(__pyx_t_2);
  9694. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9695. /* "gedlibpy.pyx":997
  9696. * print("Initialization terminated !")
  9697. *
  9698. * self.set_method(method, options) # <<<<<<<<<<<<<<
  9699. * self.init_method()
  9700. *
  9701. */
  9702. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 997, __pyx_L1_error)
  9703. __Pyx_GOTREF(__pyx_t_1);
  9704. __pyx_t_3 = NULL;
  9705. __pyx_t_8 = 0;
  9706. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9707. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9708. if (likely(__pyx_t_3)) {
  9709. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9710. __Pyx_INCREF(__pyx_t_3);
  9711. __Pyx_INCREF(function);
  9712. __Pyx_DECREF_SET(__pyx_t_1, function);
  9713. __pyx_t_8 = 1;
  9714. }
  9715. }
  9716. #if CYTHON_FAST_PYCALL
  9717. if (PyFunction_Check(__pyx_t_1)) {
  9718. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9719. __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, 997, __pyx_L1_error)
  9720. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9721. __Pyx_GOTREF(__pyx_t_2);
  9722. } else
  9723. #endif
  9724. #if CYTHON_FAST_PYCCALL
  9725. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  9726. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9727. __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, 997, __pyx_L1_error)
  9728. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9729. __Pyx_GOTREF(__pyx_t_2);
  9730. } else
  9731. #endif
  9732. {
  9733. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 997, __pyx_L1_error)
  9734. __Pyx_GOTREF(__pyx_t_9);
  9735. if (__pyx_t_3) {
  9736. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9737. }
  9738. __Pyx_INCREF(__pyx_v_method);
  9739. __Pyx_GIVEREF(__pyx_v_method);
  9740. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_method);
  9741. __Pyx_INCREF(__pyx_v_options);
  9742. __Pyx_GIVEREF(__pyx_v_options);
  9743. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_options);
  9744. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 997, __pyx_L1_error)
  9745. __Pyx_GOTREF(__pyx_t_2);
  9746. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9747. }
  9748. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9749. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9750. /* "gedlibpy.pyx":998
  9751. *
  9752. * self.set_method(method, options)
  9753. * self.init_method() # <<<<<<<<<<<<<<
  9754. *
  9755. * resDistance = [[]]
  9756. */
  9757. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
  9758. __Pyx_GOTREF(__pyx_t_1);
  9759. __pyx_t_9 = NULL;
  9760. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9761. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
  9762. if (likely(__pyx_t_9)) {
  9763. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9764. __Pyx_INCREF(__pyx_t_9);
  9765. __Pyx_INCREF(function);
  9766. __Pyx_DECREF_SET(__pyx_t_1, function);
  9767. }
  9768. }
  9769. __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  9770. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  9771. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
  9772. __Pyx_GOTREF(__pyx_t_2);
  9773. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9774. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9775. /* "gedlibpy.pyx":1000
  9776. * self.init_method()
  9777. *
  9778. * resDistance = [[]] # <<<<<<<<<<<<<<
  9779. * resMapping = [[]]
  9780. * for g in range(listID[0], listID[1]) :
  9781. */
  9782. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  9783. __Pyx_GOTREF(__pyx_t_2);
  9784. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
  9785. __Pyx_GOTREF(__pyx_t_1);
  9786. __Pyx_GIVEREF(__pyx_t_2);
  9787. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  9788. __pyx_t_2 = 0;
  9789. __pyx_v_resDistance = ((PyObject*)__pyx_t_1);
  9790. __pyx_t_1 = 0;
  9791. /* "gedlibpy.pyx":1001
  9792. *
  9793. * resDistance = [[]]
  9794. * resMapping = [[]] # <<<<<<<<<<<<<<
  9795. * for g in range(listID[0], listID[1]) :
  9796. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9797. */
  9798. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1001, __pyx_L1_error)
  9799. __Pyx_GOTREF(__pyx_t_1);
  9800. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1001, __pyx_L1_error)
  9801. __Pyx_GOTREF(__pyx_t_2);
  9802. __Pyx_GIVEREF(__pyx_t_1);
  9803. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  9804. __pyx_t_1 = 0;
  9805. __pyx_v_resMapping = ((PyObject*)__pyx_t_2);
  9806. __pyx_t_2 = 0;
  9807. /* "gedlibpy.pyx":1002
  9808. * resDistance = [[]]
  9809. * resMapping = [[]]
  9810. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9811. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9812. * for h in range(listID[0], listID[1]) :
  9813. */
  9814. __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, 1002, __pyx_L1_error)
  9815. __Pyx_GOTREF(__pyx_t_2);
  9816. __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, 1002, __pyx_L1_error)
  9817. __Pyx_GOTREF(__pyx_t_1);
  9818. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9819. __Pyx_GOTREF(__pyx_t_9);
  9820. __Pyx_GIVEREF(__pyx_t_2);
  9821. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  9822. __Pyx_GIVEREF(__pyx_t_1);
  9823. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  9824. __pyx_t_2 = 0;
  9825. __pyx_t_1 = 0;
  9826. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9827. __Pyx_GOTREF(__pyx_t_1);
  9828. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9829. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9830. __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
  9831. __pyx_t_6 = NULL;
  9832. } else {
  9833. __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9834. __Pyx_GOTREF(__pyx_t_9);
  9835. __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9836. }
  9837. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9838. for (;;) {
  9839. if (likely(!__pyx_t_6)) {
  9840. if (likely(PyList_CheckExact(__pyx_t_9))) {
  9841. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
  9842. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9843. __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, 1002, __pyx_L1_error)
  9844. #else
  9845. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9846. __Pyx_GOTREF(__pyx_t_1);
  9847. #endif
  9848. } else {
  9849. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
  9850. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9851. __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, 1002, __pyx_L1_error)
  9852. #else
  9853. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1002, __pyx_L1_error)
  9854. __Pyx_GOTREF(__pyx_t_1);
  9855. #endif
  9856. }
  9857. } else {
  9858. __pyx_t_1 = __pyx_t_6(__pyx_t_9);
  9859. if (unlikely(!__pyx_t_1)) {
  9860. PyObject* exc_type = PyErr_Occurred();
  9861. if (exc_type) {
  9862. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9863. else __PYX_ERR(0, 1002, __pyx_L1_error)
  9864. }
  9865. break;
  9866. }
  9867. __Pyx_GOTREF(__pyx_t_1);
  9868. }
  9869. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  9870. __pyx_t_1 = 0;
  9871. /* "gedlibpy.pyx":1003
  9872. * resMapping = [[]]
  9873. * for g in range(listID[0], listID[1]) :
  9874. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  9875. * for h in range(listID[0], listID[1]) :
  9876. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9877. */
  9878. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1003, __pyx_L1_error)
  9879. __Pyx_GOTREF(__pyx_t_1);
  9880. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  9881. __Pyx_GOTREF(__pyx_t_2);
  9882. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9883. __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, 1003, __pyx_L1_error)
  9884. __Pyx_GOTREF(__pyx_t_1);
  9885. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9886. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1003, __pyx_L1_error)
  9887. __Pyx_GOTREF(__pyx_t_2);
  9888. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9889. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9890. /* "gedlibpy.pyx":1004
  9891. * for g in range(listID[0], listID[1]) :
  9892. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9893. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9894. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9895. * self.run_method(g, h)
  9896. */
  9897. __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, 1004, __pyx_L1_error)
  9898. __Pyx_GOTREF(__pyx_t_2);
  9899. __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, 1004, __pyx_L1_error)
  9900. __Pyx_GOTREF(__pyx_t_1);
  9901. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9902. __Pyx_GOTREF(__pyx_t_3);
  9903. __Pyx_GIVEREF(__pyx_t_2);
  9904. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9905. __Pyx_GIVEREF(__pyx_t_1);
  9906. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  9907. __pyx_t_2 = 0;
  9908. __pyx_t_1 = 0;
  9909. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9910. __Pyx_GOTREF(__pyx_t_1);
  9911. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9912. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9913. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
  9914. __pyx_t_11 = NULL;
  9915. } else {
  9916. __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9917. __Pyx_GOTREF(__pyx_t_3);
  9918. __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9919. }
  9920. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9921. for (;;) {
  9922. if (likely(!__pyx_t_11)) {
  9923. if (likely(PyList_CheckExact(__pyx_t_3))) {
  9924. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
  9925. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9926. __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, 1004, __pyx_L1_error)
  9927. #else
  9928. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9929. __Pyx_GOTREF(__pyx_t_1);
  9930. #endif
  9931. } else {
  9932. if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  9933. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9934. __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, 1004, __pyx_L1_error)
  9935. #else
  9936. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1004, __pyx_L1_error)
  9937. __Pyx_GOTREF(__pyx_t_1);
  9938. #endif
  9939. }
  9940. } else {
  9941. __pyx_t_1 = __pyx_t_11(__pyx_t_3);
  9942. if (unlikely(!__pyx_t_1)) {
  9943. PyObject* exc_type = PyErr_Occurred();
  9944. if (exc_type) {
  9945. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9946. else __PYX_ERR(0, 1004, __pyx_L1_error)
  9947. }
  9948. break;
  9949. }
  9950. __Pyx_GOTREF(__pyx_t_1);
  9951. }
  9952. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  9953. __pyx_t_1 = 0;
  9954. /* "gedlibpy.pyx":1006
  9955. * for h in range(listID[0], listID[1]) :
  9956. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9957. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9958. * resDistance[g][h] = self.get_upper_bound(g, h)
  9959. * resMapping[g][h] = self.get_node_map(g, h)
  9960. */
  9961. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1006, __pyx_L1_error)
  9962. __Pyx_GOTREF(__pyx_t_2);
  9963. __pyx_t_7 = NULL;
  9964. __pyx_t_8 = 0;
  9965. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9966. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  9967. if (likely(__pyx_t_7)) {
  9968. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9969. __Pyx_INCREF(__pyx_t_7);
  9970. __Pyx_INCREF(function);
  9971. __Pyx_DECREF_SET(__pyx_t_2, function);
  9972. __pyx_t_8 = 1;
  9973. }
  9974. }
  9975. #if CYTHON_FAST_PYCALL
  9976. if (PyFunction_Check(__pyx_t_2)) {
  9977. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9978. __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, 1006, __pyx_L1_error)
  9979. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9980. __Pyx_GOTREF(__pyx_t_1);
  9981. } else
  9982. #endif
  9983. #if CYTHON_FAST_PYCCALL
  9984. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9985. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9986. __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, 1006, __pyx_L1_error)
  9987. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9988. __Pyx_GOTREF(__pyx_t_1);
  9989. } else
  9990. #endif
  9991. {
  9992. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1006, __pyx_L1_error)
  9993. __Pyx_GOTREF(__pyx_t_12);
  9994. if (__pyx_t_7) {
  9995. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9996. }
  9997. __Pyx_INCREF(__pyx_v_g);
  9998. __Pyx_GIVEREF(__pyx_v_g);
  9999. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  10000. __Pyx_INCREF(__pyx_v_h);
  10001. __Pyx_GIVEREF(__pyx_v_h);
  10002. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  10003. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1006, __pyx_L1_error)
  10004. __Pyx_GOTREF(__pyx_t_1);
  10005. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10006. }
  10007. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10008. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10009. /* "gedlibpy.pyx":1007
  10010. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10011. * self.run_method(g, h)
  10012. * resDistance[g][h] = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  10013. * resMapping[g][h] = self.get_node_map(g, h)
  10014. *
  10015. */
  10016. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error)
  10017. __Pyx_GOTREF(__pyx_t_2);
  10018. __pyx_t_12 = NULL;
  10019. __pyx_t_8 = 0;
  10020. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10021. __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
  10022. if (likely(__pyx_t_12)) {
  10023. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10024. __Pyx_INCREF(__pyx_t_12);
  10025. __Pyx_INCREF(function);
  10026. __Pyx_DECREF_SET(__pyx_t_2, function);
  10027. __pyx_t_8 = 1;
  10028. }
  10029. }
  10030. #if CYTHON_FAST_PYCALL
  10031. if (PyFunction_Check(__pyx_t_2)) {
  10032. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10033. __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, 1007, __pyx_L1_error)
  10034. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10035. __Pyx_GOTREF(__pyx_t_1);
  10036. } else
  10037. #endif
  10038. #if CYTHON_FAST_PYCCALL
  10039. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10040. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10041. __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, 1007, __pyx_L1_error)
  10042. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10043. __Pyx_GOTREF(__pyx_t_1);
  10044. } else
  10045. #endif
  10046. {
  10047. __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1007, __pyx_L1_error)
  10048. __Pyx_GOTREF(__pyx_t_7);
  10049. if (__pyx_t_12) {
  10050. __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
  10051. }
  10052. __Pyx_INCREF(__pyx_v_g);
  10053. __Pyx_GIVEREF(__pyx_v_g);
  10054. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_g);
  10055. __Pyx_INCREF(__pyx_v_h);
  10056. __Pyx_GIVEREF(__pyx_v_h);
  10057. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_h);
  10058. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1007, __pyx_L1_error)
  10059. __Pyx_GOTREF(__pyx_t_1);
  10060. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  10061. }
  10062. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10063. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1007, __pyx_L1_error)
  10064. __Pyx_GOTREF(__pyx_t_2);
  10065. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 1007, __pyx_L1_error)
  10066. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10067. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10068. /* "gedlibpy.pyx":1008
  10069. * self.run_method(g, h)
  10070. * resDistance[g][h] = self.get_upper_bound(g, h)
  10071. * resMapping[g][h] = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  10072. *
  10073. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10074. */
  10075. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
  10076. __Pyx_GOTREF(__pyx_t_2);
  10077. __pyx_t_7 = NULL;
  10078. __pyx_t_8 = 0;
  10079. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10080. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  10081. if (likely(__pyx_t_7)) {
  10082. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10083. __Pyx_INCREF(__pyx_t_7);
  10084. __Pyx_INCREF(function);
  10085. __Pyx_DECREF_SET(__pyx_t_2, function);
  10086. __pyx_t_8 = 1;
  10087. }
  10088. }
  10089. #if CYTHON_FAST_PYCALL
  10090. if (PyFunction_Check(__pyx_t_2)) {
  10091. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10092. __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, 1008, __pyx_L1_error)
  10093. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10094. __Pyx_GOTREF(__pyx_t_1);
  10095. } else
  10096. #endif
  10097. #if CYTHON_FAST_PYCCALL
  10098. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10099. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10100. __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, 1008, __pyx_L1_error)
  10101. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10102. __Pyx_GOTREF(__pyx_t_1);
  10103. } else
  10104. #endif
  10105. {
  10106. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1008, __pyx_L1_error)
  10107. __Pyx_GOTREF(__pyx_t_12);
  10108. if (__pyx_t_7) {
  10109. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  10110. }
  10111. __Pyx_INCREF(__pyx_v_g);
  10112. __Pyx_GIVEREF(__pyx_v_g);
  10113. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  10114. __Pyx_INCREF(__pyx_v_h);
  10115. __Pyx_GIVEREF(__pyx_v_h);
  10116. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  10117. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1008, __pyx_L1_error)
  10118. __Pyx_GOTREF(__pyx_t_1);
  10119. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10120. }
  10121. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10122. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
  10123. __Pyx_GOTREF(__pyx_t_2);
  10124. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 1008, __pyx_L1_error)
  10125. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10126. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10127. /* "gedlibpy.pyx":1004
  10128. * for g in range(listID[0], listID[1]) :
  10129. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10130. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10131. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10132. * self.run_method(g, h)
  10133. */
  10134. }
  10135. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10136. /* "gedlibpy.pyx":1002
  10137. * resDistance = [[]]
  10138. * resMapping = [[]]
  10139. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10140. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10141. * for h in range(listID[0], listID[1]) :
  10142. */
  10143. }
  10144. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10145. /* "gedlibpy.pyx":1010
  10146. * resMapping[g][h] = self.get_node_map(g, h)
  10147. *
  10148. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  10149. * return resDistance, resMapping
  10150. *
  10151. */
  10152. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1010, __pyx_L1_error)
  10153. __Pyx_GOTREF(__pyx_t_9);
  10154. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10155. /* "gedlibpy.pyx":1011
  10156. *
  10157. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10158. * return resDistance, resMapping # <<<<<<<<<<<<<<
  10159. *
  10160. *
  10161. */
  10162. __Pyx_XDECREF(__pyx_r);
  10163. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1011, __pyx_L1_error)
  10164. __Pyx_GOTREF(__pyx_t_9);
  10165. __Pyx_INCREF(__pyx_v_resDistance);
  10166. __Pyx_GIVEREF(__pyx_v_resDistance);
  10167. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_resDistance);
  10168. __Pyx_INCREF(__pyx_v_resMapping);
  10169. __Pyx_GIVEREF(__pyx_v_resMapping);
  10170. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_resMapping);
  10171. __pyx_r = __pyx_t_9;
  10172. __pyx_t_9 = 0;
  10173. goto __pyx_L0;
  10174. /* "gedlibpy.pyx":958
  10175. *
  10176. *
  10177. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10178. * """
  10179. *
  10180. */
  10181. /* function exit code */
  10182. __pyx_L1_error:;
  10183. __Pyx_XDECREF(__pyx_t_1);
  10184. __Pyx_XDECREF(__pyx_t_2);
  10185. __Pyx_XDECREF(__pyx_t_3);
  10186. __Pyx_XDECREF(__pyx_t_7);
  10187. __Pyx_XDECREF(__pyx_t_9);
  10188. __Pyx_XDECREF(__pyx_t_12);
  10189. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10190. __pyx_r = NULL;
  10191. __pyx_L0:;
  10192. __Pyx_XDECREF(__pyx_v_graph);
  10193. __Pyx_XDECREF(__pyx_v_listID);
  10194. __Pyx_XDECREF(__pyx_v_resDistance);
  10195. __Pyx_XDECREF(__pyx_v_resMapping);
  10196. __Pyx_XDECREF(__pyx_v_g);
  10197. __Pyx_XDECREF(__pyx_v_h);
  10198. __Pyx_XGIVEREF(__pyx_r);
  10199. __Pyx_RefNannyFinishContext();
  10200. return __pyx_r;
  10201. }
  10202. /* "gedlibpy.pyx":1014
  10203. *
  10204. *
  10205. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10206. * """
  10207. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10208. */
  10209. /* Python wrapper */
  10210. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10211. 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";
  10212. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10213. PyObject *__pyx_v_path_folder = 0;
  10214. PyObject *__pyx_v_path_XML = 0;
  10215. PyObject *__pyx_v_edit_cost = 0;
  10216. PyObject *__pyx_v_method = 0;
  10217. PyObject *__pyx_v_options = 0;
  10218. PyObject *__pyx_v_init_option = 0;
  10219. PyObject *__pyx_r = 0;
  10220. __Pyx_RefNannyDeclarations
  10221. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs (wrapper)", 0);
  10222. {
  10223. 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};
  10224. PyObject* values[6] = {0,0,0,0,0,0};
  10225. values[4] = ((PyObject *)__pyx_kp_u_);
  10226. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  10227. if (unlikely(__pyx_kwds)) {
  10228. Py_ssize_t kw_args;
  10229. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  10230. switch (pos_args) {
  10231. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10232. CYTHON_FALLTHROUGH;
  10233. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10234. CYTHON_FALLTHROUGH;
  10235. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10236. CYTHON_FALLTHROUGH;
  10237. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10238. CYTHON_FALLTHROUGH;
  10239. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10240. CYTHON_FALLTHROUGH;
  10241. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10242. CYTHON_FALLTHROUGH;
  10243. case 0: break;
  10244. default: goto __pyx_L5_argtuple_error;
  10245. }
  10246. kw_args = PyDict_Size(__pyx_kwds);
  10247. switch (pos_args) {
  10248. case 0:
  10249. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  10250. else goto __pyx_L5_argtuple_error;
  10251. CYTHON_FALLTHROUGH;
  10252. case 1:
  10253. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  10254. else {
  10255. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 1014, __pyx_L3_error)
  10256. }
  10257. CYTHON_FALLTHROUGH;
  10258. case 2:
  10259. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  10260. else {
  10261. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 1014, __pyx_L3_error)
  10262. }
  10263. CYTHON_FALLTHROUGH;
  10264. case 3:
  10265. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  10266. else {
  10267. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 1014, __pyx_L3_error)
  10268. }
  10269. CYTHON_FALLTHROUGH;
  10270. case 4:
  10271. if (kw_args > 0) {
  10272. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  10273. if (value) { values[4] = value; kw_args--; }
  10274. }
  10275. CYTHON_FALLTHROUGH;
  10276. case 5:
  10277. if (kw_args > 0) {
  10278. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  10279. if (value) { values[5] = value; kw_args--; }
  10280. }
  10281. }
  10282. if (unlikely(kw_args > 0)) {
  10283. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_GXl_graphs") < 0)) __PYX_ERR(0, 1014, __pyx_L3_error)
  10284. }
  10285. } else {
  10286. switch (PyTuple_GET_SIZE(__pyx_args)) {
  10287. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10288. CYTHON_FALLTHROUGH;
  10289. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10290. CYTHON_FALLTHROUGH;
  10291. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10292. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10293. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10294. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10295. break;
  10296. default: goto __pyx_L5_argtuple_error;
  10297. }
  10298. }
  10299. __pyx_v_path_folder = values[0];
  10300. __pyx_v_path_XML = values[1];
  10301. __pyx_v_edit_cost = values[2];
  10302. __pyx_v_method = values[3];
  10303. __pyx_v_options = values[4];
  10304. __pyx_v_init_option = values[5];
  10305. }
  10306. goto __pyx_L4_argument_unpacking_done;
  10307. __pyx_L5_argtuple_error:;
  10308. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1014, __pyx_L3_error)
  10309. __pyx_L3_error:;
  10310. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10311. __Pyx_RefNannyFinishContext();
  10312. return NULL;
  10313. __pyx_L4_argument_unpacking_done:;
  10314. __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);
  10315. /* function exit code */
  10316. __Pyx_RefNannyFinishContext();
  10317. return __pyx_r;
  10318. }
  10319. 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) {
  10320. PyObject *__pyx_v_listID = NULL;
  10321. PyObject *__pyx_v_g = NULL;
  10322. PyObject *__pyx_v_h = NULL;
  10323. PyObject *__pyx_r = NULL;
  10324. __Pyx_RefNannyDeclarations
  10325. PyObject *__pyx_t_1 = NULL;
  10326. PyObject *__pyx_t_2 = NULL;
  10327. PyObject *__pyx_t_3 = NULL;
  10328. int __pyx_t_4;
  10329. int __pyx_t_5;
  10330. PyObject *__pyx_t_6 = NULL;
  10331. Py_ssize_t __pyx_t_7;
  10332. PyObject *(*__pyx_t_8)(PyObject *);
  10333. Py_ssize_t __pyx_t_9;
  10334. PyObject *(*__pyx_t_10)(PyObject *);
  10335. PyObject *__pyx_t_11 = NULL;
  10336. PyObject *__pyx_t_12 = NULL;
  10337. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs", 0);
  10338. /* "gedlibpy.pyx":1038
  10339. * """
  10340. *
  10341. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10342. * self.restart_env()
  10343. *
  10344. */
  10345. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
  10346. __Pyx_GOTREF(__pyx_t_2);
  10347. __pyx_t_3 = NULL;
  10348. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10349. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10350. if (likely(__pyx_t_3)) {
  10351. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10352. __Pyx_INCREF(__pyx_t_3);
  10353. __Pyx_INCREF(function);
  10354. __Pyx_DECREF_SET(__pyx_t_2, function);
  10355. }
  10356. }
  10357. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10358. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10359. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1038, __pyx_L1_error)
  10360. __Pyx_GOTREF(__pyx_t_1);
  10361. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10362. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1038, __pyx_L1_error)
  10363. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10364. if (__pyx_t_4) {
  10365. /* "gedlibpy.pyx":1039
  10366. *
  10367. * if self.is_initialized() :
  10368. * self.restart_env() # <<<<<<<<<<<<<<
  10369. *
  10370. * print("Loading graphs in progress...")
  10371. */
  10372. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10373. __Pyx_GOTREF(__pyx_t_2);
  10374. __pyx_t_3 = NULL;
  10375. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10376. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10377. if (likely(__pyx_t_3)) {
  10378. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10379. __Pyx_INCREF(__pyx_t_3);
  10380. __Pyx_INCREF(function);
  10381. __Pyx_DECREF_SET(__pyx_t_2, function);
  10382. }
  10383. }
  10384. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10385. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10386. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10387. __Pyx_GOTREF(__pyx_t_1);
  10388. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10389. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10390. /* "gedlibpy.pyx":1038
  10391. * """
  10392. *
  10393. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10394. * self.restart_env()
  10395. *
  10396. */
  10397. }
  10398. /* "gedlibpy.pyx":1041
  10399. * self.restart_env()
  10400. *
  10401. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  10402. * self.load_GXL_graphs(path_folder, path_XML)
  10403. * listID = self.graph_ids()
  10404. */
  10405. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
  10406. __Pyx_GOTREF(__pyx_t_1);
  10407. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10408. /* "gedlibpy.pyx":1042
  10409. *
  10410. * print("Loading graphs in progress...")
  10411. * self.load_GXL_graphs(path_folder, path_XML) # <<<<<<<<<<<<<<
  10412. * listID = self.graph_ids()
  10413. * print("Graphs loaded ! ")
  10414. */
  10415. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_GXL_graphs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
  10416. __Pyx_GOTREF(__pyx_t_2);
  10417. __pyx_t_3 = NULL;
  10418. __pyx_t_5 = 0;
  10419. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10420. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10421. if (likely(__pyx_t_3)) {
  10422. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10423. __Pyx_INCREF(__pyx_t_3);
  10424. __Pyx_INCREF(function);
  10425. __Pyx_DECREF_SET(__pyx_t_2, function);
  10426. __pyx_t_5 = 1;
  10427. }
  10428. }
  10429. #if CYTHON_FAST_PYCALL
  10430. if (PyFunction_Check(__pyx_t_2)) {
  10431. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10432. __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, 1042, __pyx_L1_error)
  10433. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10434. __Pyx_GOTREF(__pyx_t_1);
  10435. } else
  10436. #endif
  10437. #if CYTHON_FAST_PYCCALL
  10438. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10439. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10440. __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, 1042, __pyx_L1_error)
  10441. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10442. __Pyx_GOTREF(__pyx_t_1);
  10443. } else
  10444. #endif
  10445. {
  10446. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1042, __pyx_L1_error)
  10447. __Pyx_GOTREF(__pyx_t_6);
  10448. if (__pyx_t_3) {
  10449. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  10450. }
  10451. __Pyx_INCREF(__pyx_v_path_folder);
  10452. __Pyx_GIVEREF(__pyx_v_path_folder);
  10453. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_path_folder);
  10454. __Pyx_INCREF(__pyx_v_path_XML);
  10455. __Pyx_GIVEREF(__pyx_v_path_XML);
  10456. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_path_XML);
  10457. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
  10458. __Pyx_GOTREF(__pyx_t_1);
  10459. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10460. }
  10461. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10462. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10463. /* "gedlibpy.pyx":1043
  10464. * print("Loading graphs in progress...")
  10465. * self.load_GXL_graphs(path_folder, path_XML)
  10466. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  10467. * print("Graphs loaded ! ")
  10468. * print("Number of graphs = " + str(listID[1]))
  10469. */
  10470. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1043, __pyx_L1_error)
  10471. __Pyx_GOTREF(__pyx_t_2);
  10472. __pyx_t_6 = NULL;
  10473. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10474. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10475. if (likely(__pyx_t_6)) {
  10476. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10477. __Pyx_INCREF(__pyx_t_6);
  10478. __Pyx_INCREF(function);
  10479. __Pyx_DECREF_SET(__pyx_t_2, function);
  10480. }
  10481. }
  10482. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10483. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10484. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1043, __pyx_L1_error)
  10485. __Pyx_GOTREF(__pyx_t_1);
  10486. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10487. __pyx_v_listID = __pyx_t_1;
  10488. __pyx_t_1 = 0;
  10489. /* "gedlibpy.pyx":1044
  10490. * self.load_GXL_graphs(path_folder, path_XML)
  10491. * listID = self.graph_ids()
  10492. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  10493. * print("Number of graphs = " + str(listID[1]))
  10494. *
  10495. */
  10496. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
  10497. __Pyx_GOTREF(__pyx_t_1);
  10498. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10499. /* "gedlibpy.pyx":1045
  10500. * listID = self.graph_ids()
  10501. * print("Graphs loaded ! ")
  10502. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  10503. *
  10504. * self.set_edit_cost(edit_cost)
  10505. */
  10506. __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, 1045, __pyx_L1_error)
  10507. __Pyx_GOTREF(__pyx_t_1);
  10508. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10509. __Pyx_GOTREF(__pyx_t_2);
  10510. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10511. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10512. __Pyx_GOTREF(__pyx_t_1);
  10513. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10514. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10515. __Pyx_GOTREF(__pyx_t_2);
  10516. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10517. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10518. /* "gedlibpy.pyx":1047
  10519. * print("Number of graphs = " + str(listID[1]))
  10520. *
  10521. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  10522. * print("Initialization in progress...")
  10523. * self.init(init_option)
  10524. */
  10525. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1047, __pyx_L1_error)
  10526. __Pyx_GOTREF(__pyx_t_1);
  10527. __pyx_t_6 = NULL;
  10528. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10529. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10530. if (likely(__pyx_t_6)) {
  10531. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10532. __Pyx_INCREF(__pyx_t_6);
  10533. __Pyx_INCREF(function);
  10534. __Pyx_DECREF_SET(__pyx_t_1, function);
  10535. }
  10536. }
  10537. __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);
  10538. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10539. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1047, __pyx_L1_error)
  10540. __Pyx_GOTREF(__pyx_t_2);
  10541. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10542. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10543. /* "gedlibpy.pyx":1048
  10544. *
  10545. * self.set_edit_cost(edit_cost)
  10546. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  10547. * self.init(init_option)
  10548. * print("Initialization terminated !")
  10549. */
  10550. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10551. __Pyx_GOTREF(__pyx_t_2);
  10552. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10553. /* "gedlibpy.pyx":1049
  10554. * self.set_edit_cost(edit_cost)
  10555. * print("Initialization in progress...")
  10556. * self.init(init_option) # <<<<<<<<<<<<<<
  10557. * print("Initialization terminated !")
  10558. *
  10559. */
  10560. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10561. __Pyx_GOTREF(__pyx_t_1);
  10562. __pyx_t_6 = NULL;
  10563. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10564. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10565. if (likely(__pyx_t_6)) {
  10566. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10567. __Pyx_INCREF(__pyx_t_6);
  10568. __Pyx_INCREF(function);
  10569. __Pyx_DECREF_SET(__pyx_t_1, function);
  10570. }
  10571. }
  10572. __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);
  10573. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10574. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10575. __Pyx_GOTREF(__pyx_t_2);
  10576. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10577. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10578. /* "gedlibpy.pyx":1050
  10579. * print("Initialization in progress...")
  10580. * self.init(init_option)
  10581. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  10582. *
  10583. * self.set_method(method, options)
  10584. */
  10585. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10586. __Pyx_GOTREF(__pyx_t_2);
  10587. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10588. /* "gedlibpy.pyx":1052
  10589. * print("Initialization terminated !")
  10590. *
  10591. * self.set_method(method, options) # <<<<<<<<<<<<<<
  10592. * self.init_method()
  10593. *
  10594. */
  10595. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10596. __Pyx_GOTREF(__pyx_t_1);
  10597. __pyx_t_6 = NULL;
  10598. __pyx_t_5 = 0;
  10599. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10600. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10601. if (likely(__pyx_t_6)) {
  10602. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10603. __Pyx_INCREF(__pyx_t_6);
  10604. __Pyx_INCREF(function);
  10605. __Pyx_DECREF_SET(__pyx_t_1, function);
  10606. __pyx_t_5 = 1;
  10607. }
  10608. }
  10609. #if CYTHON_FAST_PYCALL
  10610. if (PyFunction_Check(__pyx_t_1)) {
  10611. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10612. __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, 1052, __pyx_L1_error)
  10613. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10614. __Pyx_GOTREF(__pyx_t_2);
  10615. } else
  10616. #endif
  10617. #if CYTHON_FAST_PYCCALL
  10618. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  10619. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10620. __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, 1052, __pyx_L1_error)
  10621. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10622. __Pyx_GOTREF(__pyx_t_2);
  10623. } else
  10624. #endif
  10625. {
  10626. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10627. __Pyx_GOTREF(__pyx_t_3);
  10628. if (__pyx_t_6) {
  10629. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  10630. }
  10631. __Pyx_INCREF(__pyx_v_method);
  10632. __Pyx_GIVEREF(__pyx_v_method);
  10633. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_method);
  10634. __Pyx_INCREF(__pyx_v_options);
  10635. __Pyx_GIVEREF(__pyx_v_options);
  10636. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_options);
  10637. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10638. __Pyx_GOTREF(__pyx_t_2);
  10639. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10640. }
  10641. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10642. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10643. /* "gedlibpy.pyx":1053
  10644. *
  10645. * self.set_method(method, options)
  10646. * self.init_method() # <<<<<<<<<<<<<<
  10647. *
  10648. * #res = []
  10649. */
  10650. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1053, __pyx_L1_error)
  10651. __Pyx_GOTREF(__pyx_t_1);
  10652. __pyx_t_3 = NULL;
  10653. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10654. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  10655. if (likely(__pyx_t_3)) {
  10656. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10657. __Pyx_INCREF(__pyx_t_3);
  10658. __Pyx_INCREF(function);
  10659. __Pyx_DECREF_SET(__pyx_t_1, function);
  10660. }
  10661. }
  10662. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  10663. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10664. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1053, __pyx_L1_error)
  10665. __Pyx_GOTREF(__pyx_t_2);
  10666. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10667. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10668. /* "gedlibpy.pyx":1056
  10669. *
  10670. * #res = []
  10671. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10672. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10673. * for h in range(listID[0], listID[1]) :
  10674. */
  10675. __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, 1056, __pyx_L1_error)
  10676. __Pyx_GOTREF(__pyx_t_2);
  10677. __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, 1056, __pyx_L1_error)
  10678. __Pyx_GOTREF(__pyx_t_1);
  10679. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10680. __Pyx_GOTREF(__pyx_t_3);
  10681. __Pyx_GIVEREF(__pyx_t_2);
  10682. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10683. __Pyx_GIVEREF(__pyx_t_1);
  10684. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  10685. __pyx_t_2 = 0;
  10686. __pyx_t_1 = 0;
  10687. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10688. __Pyx_GOTREF(__pyx_t_1);
  10689. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10690. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10691. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
  10692. __pyx_t_8 = NULL;
  10693. } else {
  10694. __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10695. __Pyx_GOTREF(__pyx_t_3);
  10696. __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10697. }
  10698. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10699. for (;;) {
  10700. if (likely(!__pyx_t_8)) {
  10701. if (likely(PyList_CheckExact(__pyx_t_3))) {
  10702. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10703. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10704. __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, 1056, __pyx_L1_error)
  10705. #else
  10706. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10707. __Pyx_GOTREF(__pyx_t_1);
  10708. #endif
  10709. } else {
  10710. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  10711. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10712. __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, 1056, __pyx_L1_error)
  10713. #else
  10714. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
  10715. __Pyx_GOTREF(__pyx_t_1);
  10716. #endif
  10717. }
  10718. } else {
  10719. __pyx_t_1 = __pyx_t_8(__pyx_t_3);
  10720. if (unlikely(!__pyx_t_1)) {
  10721. PyObject* exc_type = PyErr_Occurred();
  10722. if (exc_type) {
  10723. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10724. else __PYX_ERR(0, 1056, __pyx_L1_error)
  10725. }
  10726. break;
  10727. }
  10728. __Pyx_GOTREF(__pyx_t_1);
  10729. }
  10730. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  10731. __pyx_t_1 = 0;
  10732. /* "gedlibpy.pyx":1057
  10733. * #res = []
  10734. * for g in range(listID[0], listID[1]) :
  10735. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  10736. * for h in range(listID[0], listID[1]) :
  10737. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10738. */
  10739. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
  10740. __Pyx_GOTREF(__pyx_t_1);
  10741. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
  10742. __Pyx_GOTREF(__pyx_t_2);
  10743. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10744. __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, 1057, __pyx_L1_error)
  10745. __Pyx_GOTREF(__pyx_t_1);
  10746. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10747. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
  10748. __Pyx_GOTREF(__pyx_t_2);
  10749. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10750. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10751. /* "gedlibpy.pyx":1058
  10752. * for g in range(listID[0], listID[1]) :
  10753. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10754. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10755. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10756. * self.run_method(g,h)
  10757. */
  10758. __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, 1058, __pyx_L1_error)
  10759. __Pyx_GOTREF(__pyx_t_2);
  10760. __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, 1058, __pyx_L1_error)
  10761. __Pyx_GOTREF(__pyx_t_1);
  10762. __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10763. __Pyx_GOTREF(__pyx_t_6);
  10764. __Pyx_GIVEREF(__pyx_t_2);
  10765. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  10766. __Pyx_GIVEREF(__pyx_t_1);
  10767. PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  10768. __pyx_t_2 = 0;
  10769. __pyx_t_1 = 0;
  10770. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10771. __Pyx_GOTREF(__pyx_t_1);
  10772. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10773. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10774. __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
  10775. __pyx_t_10 = NULL;
  10776. } else {
  10777. __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10778. __Pyx_GOTREF(__pyx_t_6);
  10779. __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10780. }
  10781. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10782. for (;;) {
  10783. if (likely(!__pyx_t_10)) {
  10784. if (likely(PyList_CheckExact(__pyx_t_6))) {
  10785. if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
  10786. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10787. __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, 1058, __pyx_L1_error)
  10788. #else
  10789. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10790. __Pyx_GOTREF(__pyx_t_1);
  10791. #endif
  10792. } else {
  10793. if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
  10794. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10795. __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, 1058, __pyx_L1_error)
  10796. #else
  10797. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10798. __Pyx_GOTREF(__pyx_t_1);
  10799. #endif
  10800. }
  10801. } else {
  10802. __pyx_t_1 = __pyx_t_10(__pyx_t_6);
  10803. if (unlikely(!__pyx_t_1)) {
  10804. PyObject* exc_type = PyErr_Occurred();
  10805. if (exc_type) {
  10806. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10807. else __PYX_ERR(0, 1058, __pyx_L1_error)
  10808. }
  10809. break;
  10810. }
  10811. __Pyx_GOTREF(__pyx_t_1);
  10812. }
  10813. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  10814. __pyx_t_1 = 0;
  10815. /* "gedlibpy.pyx":1060
  10816. * for h in range(listID[0], listID[1]) :
  10817. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10818. * self.run_method(g,h) # <<<<<<<<<<<<<<
  10819. * #res.append((get_upper_bound(g,h), get_node_map(g,h), get_runtime(g,h)))
  10820. *
  10821. */
  10822. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1060, __pyx_L1_error)
  10823. __Pyx_GOTREF(__pyx_t_2);
  10824. __pyx_t_11 = NULL;
  10825. __pyx_t_5 = 0;
  10826. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10827. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
  10828. if (likely(__pyx_t_11)) {
  10829. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10830. __Pyx_INCREF(__pyx_t_11);
  10831. __Pyx_INCREF(function);
  10832. __Pyx_DECREF_SET(__pyx_t_2, function);
  10833. __pyx_t_5 = 1;
  10834. }
  10835. }
  10836. #if CYTHON_FAST_PYCALL
  10837. if (PyFunction_Check(__pyx_t_2)) {
  10838. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10839. __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, 1060, __pyx_L1_error)
  10840. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10841. __Pyx_GOTREF(__pyx_t_1);
  10842. } else
  10843. #endif
  10844. #if CYTHON_FAST_PYCCALL
  10845. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10846. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10847. __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, 1060, __pyx_L1_error)
  10848. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10849. __Pyx_GOTREF(__pyx_t_1);
  10850. } else
  10851. #endif
  10852. {
  10853. __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1060, __pyx_L1_error)
  10854. __Pyx_GOTREF(__pyx_t_12);
  10855. if (__pyx_t_11) {
  10856. __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
  10857. }
  10858. __Pyx_INCREF(__pyx_v_g);
  10859. __Pyx_GIVEREF(__pyx_v_g);
  10860. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_g);
  10861. __Pyx_INCREF(__pyx_v_h);
  10862. __Pyx_GIVEREF(__pyx_v_h);
  10863. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_h);
  10864. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
  10865. __Pyx_GOTREF(__pyx_t_1);
  10866. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10867. }
  10868. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10869. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10870. /* "gedlibpy.pyx":1058
  10871. * for g in range(listID[0], listID[1]) :
  10872. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10873. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10874. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10875. * self.run_method(g,h)
  10876. */
  10877. }
  10878. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10879. /* "gedlibpy.pyx":1056
  10880. *
  10881. * #res = []
  10882. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10883. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10884. * for h in range(listID[0], listID[1]) :
  10885. */
  10886. }
  10887. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10888. /* "gedlibpy.pyx":1065
  10889. * #return res
  10890. *
  10891. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  10892. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10893. * return listID
  10894. */
  10895. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1065, __pyx_L1_error)
  10896. __Pyx_GOTREF(__pyx_t_3);
  10897. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10898. /* "gedlibpy.pyx":1066
  10899. *
  10900. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10901. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  10902. * return listID
  10903. *
  10904. */
  10905. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error)
  10906. __Pyx_GOTREF(__pyx_t_3);
  10907. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10908. /* "gedlibpy.pyx":1067
  10909. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10910. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10911. * return listID # <<<<<<<<<<<<<<
  10912. *
  10913. *
  10914. */
  10915. __Pyx_XDECREF(__pyx_r);
  10916. __Pyx_INCREF(__pyx_v_listID);
  10917. __pyx_r = __pyx_v_listID;
  10918. goto __pyx_L0;
  10919. /* "gedlibpy.pyx":1014
  10920. *
  10921. *
  10922. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10923. * """
  10924. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10925. */
  10926. /* function exit code */
  10927. __pyx_L1_error:;
  10928. __Pyx_XDECREF(__pyx_t_1);
  10929. __Pyx_XDECREF(__pyx_t_2);
  10930. __Pyx_XDECREF(__pyx_t_3);
  10931. __Pyx_XDECREF(__pyx_t_6);
  10932. __Pyx_XDECREF(__pyx_t_11);
  10933. __Pyx_XDECREF(__pyx_t_12);
  10934. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10935. __pyx_r = NULL;
  10936. __pyx_L0:;
  10937. __Pyx_XDECREF(__pyx_v_listID);
  10938. __Pyx_XDECREF(__pyx_v_g);
  10939. __Pyx_XDECREF(__pyx_v_h);
  10940. __Pyx_XGIVEREF(__pyx_r);
  10941. __Pyx_RefNannyFinishContext();
  10942. return __pyx_r;
  10943. }
  10944. /* "gedlibpy.pyx":1070
  10945. *
  10946. *
  10947. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10948. * """
  10949. * Returns the number of node labels.
  10950. */
  10951. /* Python wrapper */
  10952. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10953. 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";
  10954. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10955. PyObject *__pyx_r = 0;
  10956. __Pyx_RefNannyDeclarations
  10957. __Pyx_RefNannySetupContext("get_num_node_labels (wrapper)", 0);
  10958. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10959. /* function exit code */
  10960. __Pyx_RefNannyFinishContext();
  10961. return __pyx_r;
  10962. }
  10963. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10964. PyObject *__pyx_r = NULL;
  10965. __Pyx_RefNannyDeclarations
  10966. size_t __pyx_t_1;
  10967. PyObject *__pyx_t_2 = NULL;
  10968. __Pyx_RefNannySetupContext("get_num_node_labels", 0);
  10969. /* "gedlibpy.pyx":1079
  10970. * .. note:: If 1 is returned, the nodes are unlabeled.
  10971. * """
  10972. * return self.c_env.getNumNodeLabels() # <<<<<<<<<<<<<<
  10973. *
  10974. *
  10975. */
  10976. __Pyx_XDECREF(__pyx_r);
  10977. try {
  10978. __pyx_t_1 = __pyx_v_self->c_env->getNumNodeLabels();
  10979. } catch(...) {
  10980. __Pyx_CppExn2PyErr();
  10981. __PYX_ERR(0, 1079, __pyx_L1_error)
  10982. }
  10983. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
  10984. __Pyx_GOTREF(__pyx_t_2);
  10985. __pyx_r = __pyx_t_2;
  10986. __pyx_t_2 = 0;
  10987. goto __pyx_L0;
  10988. /* "gedlibpy.pyx":1070
  10989. *
  10990. *
  10991. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10992. * """
  10993. * Returns the number of node labels.
  10994. */
  10995. /* function exit code */
  10996. __pyx_L1_error:;
  10997. __Pyx_XDECREF(__pyx_t_2);
  10998. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10999. __pyx_r = NULL;
  11000. __pyx_L0:;
  11001. __Pyx_XGIVEREF(__pyx_r);
  11002. __Pyx_RefNannyFinishContext();
  11003. return __pyx_r;
  11004. }
  11005. /* "gedlibpy.pyx":1082
  11006. *
  11007. *
  11008. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  11009. * """
  11010. * Returns node label.
  11011. */
  11012. /* Python wrapper */
  11013. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  11014. 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";
  11015. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11016. PyObject *__pyx_r = 0;
  11017. __Pyx_RefNannyDeclarations
  11018. __Pyx_RefNannySetupContext("get_node_label (wrapper)", 0);
  11019. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11020. /* function exit code */
  11021. __Pyx_RefNannyFinishContext();
  11022. return __pyx_r;
  11023. }
  11024. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11025. PyObject *__pyx_r = NULL;
  11026. __Pyx_RefNannyDeclarations
  11027. PyObject *__pyx_t_1 = NULL;
  11028. PyObject *__pyx_t_2 = NULL;
  11029. size_t __pyx_t_3;
  11030. std::map<std::string,std::string> __pyx_t_4;
  11031. PyObject *__pyx_t_5 = NULL;
  11032. PyObject *__pyx_t_6 = NULL;
  11033. __Pyx_RefNannySetupContext("get_node_label", 0);
  11034. /* "gedlibpy.pyx":1091
  11035. * :rtype: dict{string : string}
  11036. * """
  11037. * return decode_your_map(self.c_env.getNodeLabel(label_id)) # <<<<<<<<<<<<<<
  11038. *
  11039. *
  11040. */
  11041. __Pyx_XDECREF(__pyx_r);
  11042. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
  11043. __Pyx_GOTREF(__pyx_t_2);
  11044. __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, 1091, __pyx_L1_error)
  11045. try {
  11046. __pyx_t_4 = __pyx_v_self->c_env->getNodeLabel(__pyx_t_3);
  11047. } catch(...) {
  11048. __Pyx_CppExn2PyErr();
  11049. __PYX_ERR(0, 1091, __pyx_L1_error)
  11050. }
  11051. __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, 1091, __pyx_L1_error)
  11052. __Pyx_GOTREF(__pyx_t_5);
  11053. __pyx_t_6 = NULL;
  11054. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11055. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11056. if (likely(__pyx_t_6)) {
  11057. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11058. __Pyx_INCREF(__pyx_t_6);
  11059. __Pyx_INCREF(function);
  11060. __Pyx_DECREF_SET(__pyx_t_2, function);
  11061. }
  11062. }
  11063. __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);
  11064. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11065. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11066. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
  11067. __Pyx_GOTREF(__pyx_t_1);
  11068. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11069. __pyx_r = __pyx_t_1;
  11070. __pyx_t_1 = 0;
  11071. goto __pyx_L0;
  11072. /* "gedlibpy.pyx":1082
  11073. *
  11074. *
  11075. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  11076. * """
  11077. * Returns node label.
  11078. */
  11079. /* function exit code */
  11080. __pyx_L1_error:;
  11081. __Pyx_XDECREF(__pyx_t_1);
  11082. __Pyx_XDECREF(__pyx_t_2);
  11083. __Pyx_XDECREF(__pyx_t_5);
  11084. __Pyx_XDECREF(__pyx_t_6);
  11085. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11086. __pyx_r = NULL;
  11087. __pyx_L0:;
  11088. __Pyx_XGIVEREF(__pyx_r);
  11089. __Pyx_RefNannyFinishContext();
  11090. return __pyx_r;
  11091. }
  11092. /* "gedlibpy.pyx":1094
  11093. *
  11094. *
  11095. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11096. * """
  11097. * Returns the number of edge labels.
  11098. */
  11099. /* Python wrapper */
  11100. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11101. 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";
  11102. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11103. PyObject *__pyx_r = 0;
  11104. __Pyx_RefNannyDeclarations
  11105. __Pyx_RefNannySetupContext("get_num_edge_labels (wrapper)", 0);
  11106. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11107. /* function exit code */
  11108. __Pyx_RefNannyFinishContext();
  11109. return __pyx_r;
  11110. }
  11111. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11112. PyObject *__pyx_r = NULL;
  11113. __Pyx_RefNannyDeclarations
  11114. size_t __pyx_t_1;
  11115. PyObject *__pyx_t_2 = NULL;
  11116. __Pyx_RefNannySetupContext("get_num_edge_labels", 0);
  11117. /* "gedlibpy.pyx":1103
  11118. * .. note:: If 1 is returned, the edges are unlabeled.
  11119. * """
  11120. * return self.c_env.getNumEdgeLabels() # <<<<<<<<<<<<<<
  11121. *
  11122. *
  11123. */
  11124. __Pyx_XDECREF(__pyx_r);
  11125. try {
  11126. __pyx_t_1 = __pyx_v_self->c_env->getNumEdgeLabels();
  11127. } catch(...) {
  11128. __Pyx_CppExn2PyErr();
  11129. __PYX_ERR(0, 1103, __pyx_L1_error)
  11130. }
  11131. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1103, __pyx_L1_error)
  11132. __Pyx_GOTREF(__pyx_t_2);
  11133. __pyx_r = __pyx_t_2;
  11134. __pyx_t_2 = 0;
  11135. goto __pyx_L0;
  11136. /* "gedlibpy.pyx":1094
  11137. *
  11138. *
  11139. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11140. * """
  11141. * Returns the number of edge labels.
  11142. */
  11143. /* function exit code */
  11144. __pyx_L1_error:;
  11145. __Pyx_XDECREF(__pyx_t_2);
  11146. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_edge_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11147. __pyx_r = NULL;
  11148. __pyx_L0:;
  11149. __Pyx_XGIVEREF(__pyx_r);
  11150. __Pyx_RefNannyFinishContext();
  11151. return __pyx_r;
  11152. }
  11153. /* "gedlibpy.pyx":1106
  11154. *
  11155. *
  11156. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11157. * """
  11158. * Returns edge label.
  11159. */
  11160. /* Python wrapper */
  11161. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  11162. 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";
  11163. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11164. PyObject *__pyx_r = 0;
  11165. __Pyx_RefNannyDeclarations
  11166. __Pyx_RefNannySetupContext("get_edge_label (wrapper)", 0);
  11167. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11168. /* function exit code */
  11169. __Pyx_RefNannyFinishContext();
  11170. return __pyx_r;
  11171. }
  11172. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11173. PyObject *__pyx_r = NULL;
  11174. __Pyx_RefNannyDeclarations
  11175. PyObject *__pyx_t_1 = NULL;
  11176. PyObject *__pyx_t_2 = NULL;
  11177. size_t __pyx_t_3;
  11178. std::map<std::string,std::string> __pyx_t_4;
  11179. PyObject *__pyx_t_5 = NULL;
  11180. PyObject *__pyx_t_6 = NULL;
  11181. __Pyx_RefNannySetupContext("get_edge_label", 0);
  11182. /* "gedlibpy.pyx":1115
  11183. * :rtype: dict{string : string}
  11184. * """
  11185. * return decode_your_map(self.c_env.getEdgeLabel(label_id)) # <<<<<<<<<<<<<<
  11186. *
  11187. *
  11188. */
  11189. __Pyx_XDECREF(__pyx_r);
  11190. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error)
  11191. __Pyx_GOTREF(__pyx_t_2);
  11192. __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, 1115, __pyx_L1_error)
  11193. try {
  11194. __pyx_t_4 = __pyx_v_self->c_env->getEdgeLabel(__pyx_t_3);
  11195. } catch(...) {
  11196. __Pyx_CppExn2PyErr();
  11197. __PYX_ERR(0, 1115, __pyx_L1_error)
  11198. }
  11199. __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, 1115, __pyx_L1_error)
  11200. __Pyx_GOTREF(__pyx_t_5);
  11201. __pyx_t_6 = NULL;
  11202. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11203. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11204. if (likely(__pyx_t_6)) {
  11205. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11206. __Pyx_INCREF(__pyx_t_6);
  11207. __Pyx_INCREF(function);
  11208. __Pyx_DECREF_SET(__pyx_t_2, function);
  11209. }
  11210. }
  11211. __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);
  11212. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11213. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11214. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
  11215. __Pyx_GOTREF(__pyx_t_1);
  11216. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11217. __pyx_r = __pyx_t_1;
  11218. __pyx_t_1 = 0;
  11219. goto __pyx_L0;
  11220. /* "gedlibpy.pyx":1106
  11221. *
  11222. *
  11223. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11224. * """
  11225. * Returns edge label.
  11226. */
  11227. /* function exit code */
  11228. __pyx_L1_error:;
  11229. __Pyx_XDECREF(__pyx_t_1);
  11230. __Pyx_XDECREF(__pyx_t_2);
  11231. __Pyx_XDECREF(__pyx_t_5);
  11232. __Pyx_XDECREF(__pyx_t_6);
  11233. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11234. __pyx_r = NULL;
  11235. __pyx_L0:;
  11236. __Pyx_XGIVEREF(__pyx_r);
  11237. __Pyx_RefNannyFinishContext();
  11238. return __pyx_r;
  11239. }
  11240. /* "gedlibpy.pyx":1129
  11241. * # return self.c_env.getNumNodes(graph_id)
  11242. *
  11243. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11244. * """
  11245. * Returns average number of nodes.
  11246. */
  11247. /* Python wrapper */
  11248. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11249. 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";
  11250. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11251. PyObject *__pyx_r = 0;
  11252. __Pyx_RefNannyDeclarations
  11253. __Pyx_RefNannySetupContext("get_avg_num_nodes (wrapper)", 0);
  11254. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11255. /* function exit code */
  11256. __Pyx_RefNannyFinishContext();
  11257. return __pyx_r;
  11258. }
  11259. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11260. PyObject *__pyx_r = NULL;
  11261. __Pyx_RefNannyDeclarations
  11262. double __pyx_t_1;
  11263. PyObject *__pyx_t_2 = NULL;
  11264. __Pyx_RefNannySetupContext("get_avg_num_nodes", 0);
  11265. /* "gedlibpy.pyx":1136
  11266. * :rtype: double
  11267. * """
  11268. * return self.c_env.getAvgNumNodes() # <<<<<<<<<<<<<<
  11269. *
  11270. * def get_node_rel_cost(self, node_label_1, node_label_2):
  11271. */
  11272. __Pyx_XDECREF(__pyx_r);
  11273. try {
  11274. __pyx_t_1 = __pyx_v_self->c_env->getAvgNumNodes();
  11275. } catch(...) {
  11276. __Pyx_CppExn2PyErr();
  11277. __PYX_ERR(0, 1136, __pyx_L1_error)
  11278. }
  11279. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1136, __pyx_L1_error)
  11280. __Pyx_GOTREF(__pyx_t_2);
  11281. __pyx_r = __pyx_t_2;
  11282. __pyx_t_2 = 0;
  11283. goto __pyx_L0;
  11284. /* "gedlibpy.pyx":1129
  11285. * # return self.c_env.getNumNodes(graph_id)
  11286. *
  11287. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11288. * """
  11289. * Returns average number of nodes.
  11290. */
  11291. /* function exit code */
  11292. __pyx_L1_error:;
  11293. __Pyx_XDECREF(__pyx_t_2);
  11294. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_avg_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11295. __pyx_r = NULL;
  11296. __pyx_L0:;
  11297. __Pyx_XGIVEREF(__pyx_r);
  11298. __Pyx_RefNannyFinishContext();
  11299. return __pyx_r;
  11300. }
  11301. /* "gedlibpy.pyx":1138
  11302. * return self.c_env.getAvgNumNodes()
  11303. *
  11304. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11305. * """
  11306. * Returns node relabeling cost.
  11307. */
  11308. /* Python wrapper */
  11309. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11310. 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";
  11311. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11312. PyObject *__pyx_v_node_label_1 = 0;
  11313. PyObject *__pyx_v_node_label_2 = 0;
  11314. PyObject *__pyx_r = 0;
  11315. __Pyx_RefNannyDeclarations
  11316. __Pyx_RefNannySetupContext("get_node_rel_cost (wrapper)", 0);
  11317. {
  11318. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_label_1,&__pyx_n_s_node_label_2,0};
  11319. PyObject* values[2] = {0,0};
  11320. if (unlikely(__pyx_kwds)) {
  11321. Py_ssize_t kw_args;
  11322. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11323. switch (pos_args) {
  11324. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11325. CYTHON_FALLTHROUGH;
  11326. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11327. CYTHON_FALLTHROUGH;
  11328. case 0: break;
  11329. default: goto __pyx_L5_argtuple_error;
  11330. }
  11331. kw_args = PyDict_Size(__pyx_kwds);
  11332. switch (pos_args) {
  11333. case 0:
  11334. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_1)) != 0)) kw_args--;
  11335. else goto __pyx_L5_argtuple_error;
  11336. CYTHON_FALLTHROUGH;
  11337. case 1:
  11338. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_2)) != 0)) kw_args--;
  11339. else {
  11340. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1138, __pyx_L3_error)
  11341. }
  11342. }
  11343. if (unlikely(kw_args > 0)) {
  11344. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1138, __pyx_L3_error)
  11345. }
  11346. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11347. goto __pyx_L5_argtuple_error;
  11348. } else {
  11349. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11350. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11351. }
  11352. __pyx_v_node_label_1 = values[0];
  11353. __pyx_v_node_label_2 = values[1];
  11354. }
  11355. goto __pyx_L4_argument_unpacking_done;
  11356. __pyx_L5_argtuple_error:;
  11357. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1138, __pyx_L3_error)
  11358. __pyx_L3_error:;
  11359. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11360. __Pyx_RefNannyFinishContext();
  11361. return NULL;
  11362. __pyx_L4_argument_unpacking_done:;
  11363. __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);
  11364. /* function exit code */
  11365. __Pyx_RefNannyFinishContext();
  11366. return __pyx_r;
  11367. }
  11368. 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) {
  11369. PyObject *__pyx_r = NULL;
  11370. __Pyx_RefNannyDeclarations
  11371. PyObject *__pyx_t_1 = NULL;
  11372. PyObject *__pyx_t_2 = NULL;
  11373. PyObject *__pyx_t_3 = NULL;
  11374. std::map<std::string,std::string> __pyx_t_4;
  11375. std::map<std::string,std::string> __pyx_t_5;
  11376. double __pyx_t_6;
  11377. __Pyx_RefNannySetupContext("get_node_rel_cost", 0);
  11378. /* "gedlibpy.pyx":1149
  11379. * :rtype: double
  11380. * """
  11381. * return self.c_env.getNodeRelCost(encode_your_map(node_label_1), encode_your_map(node_label_2)) # <<<<<<<<<<<<<<
  11382. *
  11383. *
  11384. */
  11385. __Pyx_XDECREF(__pyx_r);
  11386. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
  11387. __Pyx_GOTREF(__pyx_t_2);
  11388. __pyx_t_3 = NULL;
  11389. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11390. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11391. if (likely(__pyx_t_3)) {
  11392. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11393. __Pyx_INCREF(__pyx_t_3);
  11394. __Pyx_INCREF(function);
  11395. __Pyx_DECREF_SET(__pyx_t_2, function);
  11396. }
  11397. }
  11398. __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);
  11399. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11400. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
  11401. __Pyx_GOTREF(__pyx_t_1);
  11402. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11403. __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, 1149, __pyx_L1_error)
  11404. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11405. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1149, __pyx_L1_error)
  11406. __Pyx_GOTREF(__pyx_t_2);
  11407. __pyx_t_3 = NULL;
  11408. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11409. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11410. if (likely(__pyx_t_3)) {
  11411. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11412. __Pyx_INCREF(__pyx_t_3);
  11413. __Pyx_INCREF(function);
  11414. __Pyx_DECREF_SET(__pyx_t_2, function);
  11415. }
  11416. }
  11417. __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);
  11418. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11419. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
  11420. __Pyx_GOTREF(__pyx_t_1);
  11421. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11422. __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, 1149, __pyx_L1_error)
  11423. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11424. try {
  11425. __pyx_t_6 = __pyx_v_self->c_env->getNodeRelCost(__pyx_t_4, __pyx_t_5);
  11426. } catch(...) {
  11427. __Pyx_CppExn2PyErr();
  11428. __PYX_ERR(0, 1149, __pyx_L1_error)
  11429. }
  11430. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
  11431. __Pyx_GOTREF(__pyx_t_1);
  11432. __pyx_r = __pyx_t_1;
  11433. __pyx_t_1 = 0;
  11434. goto __pyx_L0;
  11435. /* "gedlibpy.pyx":1138
  11436. * return self.c_env.getAvgNumNodes()
  11437. *
  11438. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11439. * """
  11440. * Returns node relabeling cost.
  11441. */
  11442. /* function exit code */
  11443. __pyx_L1_error:;
  11444. __Pyx_XDECREF(__pyx_t_1);
  11445. __Pyx_XDECREF(__pyx_t_2);
  11446. __Pyx_XDECREF(__pyx_t_3);
  11447. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11448. __pyx_r = NULL;
  11449. __pyx_L0:;
  11450. __Pyx_XGIVEREF(__pyx_r);
  11451. __Pyx_RefNannyFinishContext();
  11452. return __pyx_r;
  11453. }
  11454. /* "gedlibpy.pyx":1152
  11455. *
  11456. *
  11457. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11458. * """
  11459. * Returns node deletion cost.
  11460. */
  11461. /* Python wrapper */
  11462. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11463. 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";
  11464. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11465. PyObject *__pyx_r = 0;
  11466. __Pyx_RefNannyDeclarations
  11467. __Pyx_RefNannySetupContext("get_node_del_cost (wrapper)", 0);
  11468. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11469. /* function exit code */
  11470. __Pyx_RefNannyFinishContext();
  11471. return __pyx_r;
  11472. }
  11473. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11474. PyObject *__pyx_r = NULL;
  11475. __Pyx_RefNannyDeclarations
  11476. PyObject *__pyx_t_1 = NULL;
  11477. PyObject *__pyx_t_2 = NULL;
  11478. PyObject *__pyx_t_3 = NULL;
  11479. std::map<std::string,std::string> __pyx_t_4;
  11480. double __pyx_t_5;
  11481. __Pyx_RefNannySetupContext("get_node_del_cost", 0);
  11482. /* "gedlibpy.pyx":1161
  11483. * :rtype: double
  11484. * """
  11485. * return self.c_env.getNodeDelCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11486. *
  11487. *
  11488. */
  11489. __Pyx_XDECREF(__pyx_r);
  11490. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1161, __pyx_L1_error)
  11491. __Pyx_GOTREF(__pyx_t_2);
  11492. __pyx_t_3 = NULL;
  11493. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11494. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11495. if (likely(__pyx_t_3)) {
  11496. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11497. __Pyx_INCREF(__pyx_t_3);
  11498. __Pyx_INCREF(function);
  11499. __Pyx_DECREF_SET(__pyx_t_2, function);
  11500. }
  11501. }
  11502. __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);
  11503. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11504. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
  11505. __Pyx_GOTREF(__pyx_t_1);
  11506. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11507. __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, 1161, __pyx_L1_error)
  11508. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11509. try {
  11510. __pyx_t_5 = __pyx_v_self->c_env->getNodeDelCost(__pyx_t_4);
  11511. } catch(...) {
  11512. __Pyx_CppExn2PyErr();
  11513. __PYX_ERR(0, 1161, __pyx_L1_error)
  11514. }
  11515. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
  11516. __Pyx_GOTREF(__pyx_t_1);
  11517. __pyx_r = __pyx_t_1;
  11518. __pyx_t_1 = 0;
  11519. goto __pyx_L0;
  11520. /* "gedlibpy.pyx":1152
  11521. *
  11522. *
  11523. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11524. * """
  11525. * Returns node deletion cost.
  11526. */
  11527. /* function exit code */
  11528. __pyx_L1_error:;
  11529. __Pyx_XDECREF(__pyx_t_1);
  11530. __Pyx_XDECREF(__pyx_t_2);
  11531. __Pyx_XDECREF(__pyx_t_3);
  11532. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11533. __pyx_r = NULL;
  11534. __pyx_L0:;
  11535. __Pyx_XGIVEREF(__pyx_r);
  11536. __Pyx_RefNannyFinishContext();
  11537. return __pyx_r;
  11538. }
  11539. /* "gedlibpy.pyx":1164
  11540. *
  11541. *
  11542. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11543. * """
  11544. * Returns node insertion cost.
  11545. */
  11546. /* Python wrapper */
  11547. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11548. 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";
  11549. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11550. PyObject *__pyx_r = 0;
  11551. __Pyx_RefNannyDeclarations
  11552. __Pyx_RefNannySetupContext("get_node_ins_cost (wrapper)", 0);
  11553. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11554. /* function exit code */
  11555. __Pyx_RefNannyFinishContext();
  11556. return __pyx_r;
  11557. }
  11558. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11559. PyObject *__pyx_r = NULL;
  11560. __Pyx_RefNannyDeclarations
  11561. PyObject *__pyx_t_1 = NULL;
  11562. PyObject *__pyx_t_2 = NULL;
  11563. PyObject *__pyx_t_3 = NULL;
  11564. std::map<std::string,std::string> __pyx_t_4;
  11565. double __pyx_t_5;
  11566. __Pyx_RefNannySetupContext("get_node_ins_cost", 0);
  11567. /* "gedlibpy.pyx":1173
  11568. * :rtype: double
  11569. * """
  11570. * return self.c_env.getNodeInsCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11571. *
  11572. *
  11573. */
  11574. __Pyx_XDECREF(__pyx_r);
  11575. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11576. __Pyx_GOTREF(__pyx_t_2);
  11577. __pyx_t_3 = NULL;
  11578. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11579. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11580. if (likely(__pyx_t_3)) {
  11581. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11582. __Pyx_INCREF(__pyx_t_3);
  11583. __Pyx_INCREF(function);
  11584. __Pyx_DECREF_SET(__pyx_t_2, function);
  11585. }
  11586. }
  11587. __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);
  11588. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11589. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11590. __Pyx_GOTREF(__pyx_t_1);
  11591. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11592. __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)
  11593. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11594. try {
  11595. __pyx_t_5 = __pyx_v_self->c_env->getNodeInsCost(__pyx_t_4);
  11596. } catch(...) {
  11597. __Pyx_CppExn2PyErr();
  11598. __PYX_ERR(0, 1173, __pyx_L1_error)
  11599. }
  11600. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1173, __pyx_L1_error)
  11601. __Pyx_GOTREF(__pyx_t_1);
  11602. __pyx_r = __pyx_t_1;
  11603. __pyx_t_1 = 0;
  11604. goto __pyx_L0;
  11605. /* "gedlibpy.pyx":1164
  11606. *
  11607. *
  11608. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11609. * """
  11610. * Returns node insertion cost.
  11611. */
  11612. /* function exit code */
  11613. __pyx_L1_error:;
  11614. __Pyx_XDECREF(__pyx_t_1);
  11615. __Pyx_XDECREF(__pyx_t_2);
  11616. __Pyx_XDECREF(__pyx_t_3);
  11617. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11618. __pyx_r = NULL;
  11619. __pyx_L0:;
  11620. __Pyx_XGIVEREF(__pyx_r);
  11621. __Pyx_RefNannyFinishContext();
  11622. return __pyx_r;
  11623. }
  11624. /* "gedlibpy.pyx":1176
  11625. *
  11626. *
  11627. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11628. * """
  11629. * Computes median node label.
  11630. */
  11631. /* Python wrapper */
  11632. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels); /*proto*/
  11633. 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";
  11634. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11635. PyObject *__pyx_r = 0;
  11636. __Pyx_RefNannyDeclarations
  11637. __Pyx_RefNannySetupContext("get_median_node_label (wrapper)", 0);
  11638. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_labels));
  11639. /* function exit code */
  11640. __Pyx_RefNannyFinishContext();
  11641. return __pyx_r;
  11642. }
  11643. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11644. PyObject *__pyx_v_node_labels_b = NULL;
  11645. PyObject *__pyx_8genexpr9__pyx_v_node_label = NULL;
  11646. PyObject *__pyx_r = NULL;
  11647. __Pyx_RefNannyDeclarations
  11648. PyObject *__pyx_t_1 = NULL;
  11649. PyObject *__pyx_t_2 = NULL;
  11650. Py_ssize_t __pyx_t_3;
  11651. PyObject *(*__pyx_t_4)(PyObject *);
  11652. PyObject *__pyx_t_5 = NULL;
  11653. PyObject *__pyx_t_6 = NULL;
  11654. PyObject *__pyx_t_7 = NULL;
  11655. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  11656. std::map<std::string,std::string> __pyx_t_9;
  11657. __Pyx_RefNannySetupContext("get_median_node_label", 0);
  11658. /* "gedlibpy.pyx":1185
  11659. * :rtype: dict{string : string}
  11660. * """
  11661. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] # <<<<<<<<<<<<<<
  11662. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b))
  11663. *
  11664. */
  11665. { /* enter inner scope */
  11666. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11667. __Pyx_GOTREF(__pyx_t_1);
  11668. if (likely(PyList_CheckExact(__pyx_v_node_labels)) || PyTuple_CheckExact(__pyx_v_node_labels)) {
  11669. __pyx_t_2 = __pyx_v_node_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  11670. __pyx_t_4 = NULL;
  11671. } else {
  11672. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_node_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11673. __Pyx_GOTREF(__pyx_t_2);
  11674. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11675. }
  11676. for (;;) {
  11677. if (likely(!__pyx_t_4)) {
  11678. if (likely(PyList_CheckExact(__pyx_t_2))) {
  11679. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  11680. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11681. __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, 1185, __pyx_L5_error)
  11682. #else
  11683. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11684. __Pyx_GOTREF(__pyx_t_5);
  11685. #endif
  11686. } else {
  11687. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  11688. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11689. __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, 1185, __pyx_L5_error)
  11690. #else
  11691. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11692. __Pyx_GOTREF(__pyx_t_5);
  11693. #endif
  11694. }
  11695. } else {
  11696. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  11697. if (unlikely(!__pyx_t_5)) {
  11698. PyObject* exc_type = PyErr_Occurred();
  11699. if (exc_type) {
  11700. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11701. else __PYX_ERR(0, 1185, __pyx_L5_error)
  11702. }
  11703. break;
  11704. }
  11705. __Pyx_GOTREF(__pyx_t_5);
  11706. }
  11707. __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_node_label, __pyx_t_5);
  11708. __pyx_t_5 = 0;
  11709. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11710. __Pyx_GOTREF(__pyx_t_6);
  11711. __pyx_t_7 = NULL;
  11712. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  11713. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  11714. if (likely(__pyx_t_7)) {
  11715. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  11716. __Pyx_INCREF(__pyx_t_7);
  11717. __Pyx_INCREF(function);
  11718. __Pyx_DECREF_SET(__pyx_t_6, function);
  11719. }
  11720. }
  11721. __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_8genexpr9__pyx_v_node_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_8genexpr9__pyx_v_node_label);
  11722. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  11723. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1185, __pyx_L5_error)
  11724. __Pyx_GOTREF(__pyx_t_5);
  11725. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  11726. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1185, __pyx_L5_error)
  11727. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11728. }
  11729. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11730. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11731. goto __pyx_L8_exit_scope;
  11732. __pyx_L5_error:;
  11733. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11734. goto __pyx_L1_error;
  11735. __pyx_L8_exit_scope:;
  11736. } /* exit inner scope */
  11737. __pyx_v_node_labels_b = ((PyObject*)__pyx_t_1);
  11738. __pyx_t_1 = 0;
  11739. /* "gedlibpy.pyx":1186
  11740. * """
  11741. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels]
  11742. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b)) # <<<<<<<<<<<<<<
  11743. *
  11744. *
  11745. */
  11746. __Pyx_XDECREF(__pyx_r);
  11747. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1186, __pyx_L1_error)
  11748. __Pyx_GOTREF(__pyx_t_2);
  11749. __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, 1186, __pyx_L1_error)
  11750. try {
  11751. __pyx_t_9 = __pyx_v_self->c_env->getMedianNodeLabel(__pyx_t_8);
  11752. } catch(...) {
  11753. __Pyx_CppExn2PyErr();
  11754. __PYX_ERR(0, 1186, __pyx_L1_error)
  11755. }
  11756. __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, 1186, __pyx_L1_error)
  11757. __Pyx_GOTREF(__pyx_t_5);
  11758. __pyx_t_6 = NULL;
  11759. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11760. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11761. if (likely(__pyx_t_6)) {
  11762. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11763. __Pyx_INCREF(__pyx_t_6);
  11764. __Pyx_INCREF(function);
  11765. __Pyx_DECREF_SET(__pyx_t_2, function);
  11766. }
  11767. }
  11768. __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);
  11769. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11770. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11771. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1186, __pyx_L1_error)
  11772. __Pyx_GOTREF(__pyx_t_1);
  11773. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11774. __pyx_r = __pyx_t_1;
  11775. __pyx_t_1 = 0;
  11776. goto __pyx_L0;
  11777. /* "gedlibpy.pyx":1176
  11778. *
  11779. *
  11780. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11781. * """
  11782. * Computes median node label.
  11783. */
  11784. /* function exit code */
  11785. __pyx_L1_error:;
  11786. __Pyx_XDECREF(__pyx_t_1);
  11787. __Pyx_XDECREF(__pyx_t_2);
  11788. __Pyx_XDECREF(__pyx_t_5);
  11789. __Pyx_XDECREF(__pyx_t_6);
  11790. __Pyx_XDECREF(__pyx_t_7);
  11791. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11792. __pyx_r = NULL;
  11793. __pyx_L0:;
  11794. __Pyx_XDECREF(__pyx_v_node_labels_b);
  11795. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label);
  11796. __Pyx_XGIVEREF(__pyx_r);
  11797. __Pyx_RefNannyFinishContext();
  11798. return __pyx_r;
  11799. }
  11800. /* "gedlibpy.pyx":1189
  11801. *
  11802. *
  11803. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11804. * """
  11805. * Returns edge relabeling cost.
  11806. */
  11807. /* Python wrapper */
  11808. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11809. 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";
  11810. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11811. PyObject *__pyx_v_edge_label_1 = 0;
  11812. PyObject *__pyx_v_edge_label_2 = 0;
  11813. PyObject *__pyx_r = 0;
  11814. __Pyx_RefNannyDeclarations
  11815. __Pyx_RefNannySetupContext("get_edge_rel_cost (wrapper)", 0);
  11816. {
  11817. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_label_1,&__pyx_n_s_edge_label_2,0};
  11818. PyObject* values[2] = {0,0};
  11819. if (unlikely(__pyx_kwds)) {
  11820. Py_ssize_t kw_args;
  11821. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11822. switch (pos_args) {
  11823. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11824. CYTHON_FALLTHROUGH;
  11825. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11826. CYTHON_FALLTHROUGH;
  11827. case 0: break;
  11828. default: goto __pyx_L5_argtuple_error;
  11829. }
  11830. kw_args = PyDict_Size(__pyx_kwds);
  11831. switch (pos_args) {
  11832. case 0:
  11833. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_1)) != 0)) kw_args--;
  11834. else goto __pyx_L5_argtuple_error;
  11835. CYTHON_FALLTHROUGH;
  11836. case 1:
  11837. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_2)) != 0)) kw_args--;
  11838. else {
  11839. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1189, __pyx_L3_error)
  11840. }
  11841. }
  11842. if (unlikely(kw_args > 0)) {
  11843. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1189, __pyx_L3_error)
  11844. }
  11845. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11846. goto __pyx_L5_argtuple_error;
  11847. } else {
  11848. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11849. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11850. }
  11851. __pyx_v_edge_label_1 = values[0];
  11852. __pyx_v_edge_label_2 = values[1];
  11853. }
  11854. goto __pyx_L4_argument_unpacking_done;
  11855. __pyx_L5_argtuple_error:;
  11856. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1189, __pyx_L3_error)
  11857. __pyx_L3_error:;
  11858. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11859. __Pyx_RefNannyFinishContext();
  11860. return NULL;
  11861. __pyx_L4_argument_unpacking_done:;
  11862. __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);
  11863. /* function exit code */
  11864. __Pyx_RefNannyFinishContext();
  11865. return __pyx_r;
  11866. }
  11867. 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) {
  11868. PyObject *__pyx_r = NULL;
  11869. __Pyx_RefNannyDeclarations
  11870. PyObject *__pyx_t_1 = NULL;
  11871. PyObject *__pyx_t_2 = NULL;
  11872. PyObject *__pyx_t_3 = NULL;
  11873. std::map<std::string,std::string> __pyx_t_4;
  11874. std::map<std::string,std::string> __pyx_t_5;
  11875. double __pyx_t_6;
  11876. __Pyx_RefNannySetupContext("get_edge_rel_cost", 0);
  11877. /* "gedlibpy.pyx":1200
  11878. * :rtype: double
  11879. * """
  11880. * return self.c_env.getEdgeRelCost(encode_your_map(edge_label_1), encode_your_map(edge_label_2)) # <<<<<<<<<<<<<<
  11881. *
  11882. *
  11883. */
  11884. __Pyx_XDECREF(__pyx_r);
  11885. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error)
  11886. __Pyx_GOTREF(__pyx_t_2);
  11887. __pyx_t_3 = NULL;
  11888. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11889. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11890. if (likely(__pyx_t_3)) {
  11891. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11892. __Pyx_INCREF(__pyx_t_3);
  11893. __Pyx_INCREF(function);
  11894. __Pyx_DECREF_SET(__pyx_t_2, function);
  11895. }
  11896. }
  11897. __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);
  11898. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11899. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  11900. __Pyx_GOTREF(__pyx_t_1);
  11901. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11902. __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, 1200, __pyx_L1_error)
  11903. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11904. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1200, __pyx_L1_error)
  11905. __Pyx_GOTREF(__pyx_t_2);
  11906. __pyx_t_3 = NULL;
  11907. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11908. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11909. if (likely(__pyx_t_3)) {
  11910. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11911. __Pyx_INCREF(__pyx_t_3);
  11912. __Pyx_INCREF(function);
  11913. __Pyx_DECREF_SET(__pyx_t_2, function);
  11914. }
  11915. }
  11916. __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);
  11917. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11918. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  11919. __Pyx_GOTREF(__pyx_t_1);
  11920. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11921. __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, 1200, __pyx_L1_error)
  11922. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11923. try {
  11924. __pyx_t_6 = __pyx_v_self->c_env->getEdgeRelCost(__pyx_t_4, __pyx_t_5);
  11925. } catch(...) {
  11926. __Pyx_CppExn2PyErr();
  11927. __PYX_ERR(0, 1200, __pyx_L1_error)
  11928. }
  11929. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1200, __pyx_L1_error)
  11930. __Pyx_GOTREF(__pyx_t_1);
  11931. __pyx_r = __pyx_t_1;
  11932. __pyx_t_1 = 0;
  11933. goto __pyx_L0;
  11934. /* "gedlibpy.pyx":1189
  11935. *
  11936. *
  11937. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11938. * """
  11939. * Returns edge relabeling cost.
  11940. */
  11941. /* function exit code */
  11942. __pyx_L1_error:;
  11943. __Pyx_XDECREF(__pyx_t_1);
  11944. __Pyx_XDECREF(__pyx_t_2);
  11945. __Pyx_XDECREF(__pyx_t_3);
  11946. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11947. __pyx_r = NULL;
  11948. __pyx_L0:;
  11949. __Pyx_XGIVEREF(__pyx_r);
  11950. __Pyx_RefNannyFinishContext();
  11951. return __pyx_r;
  11952. }
  11953. /* "gedlibpy.pyx":1203
  11954. *
  11955. *
  11956. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  11957. * """
  11958. * Returns edge deletion cost.
  11959. */
  11960. /* Python wrapper */
  11961. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  11962. 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";
  11963. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11964. PyObject *__pyx_r = 0;
  11965. __Pyx_RefNannyDeclarations
  11966. __Pyx_RefNannySetupContext("get_edge_del_cost (wrapper)", 0);
  11967. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  11968. /* function exit code */
  11969. __Pyx_RefNannyFinishContext();
  11970. return __pyx_r;
  11971. }
  11972. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11973. PyObject *__pyx_r = NULL;
  11974. __Pyx_RefNannyDeclarations
  11975. PyObject *__pyx_t_1 = NULL;
  11976. PyObject *__pyx_t_2 = NULL;
  11977. PyObject *__pyx_t_3 = NULL;
  11978. std::map<std::string,std::string> __pyx_t_4;
  11979. double __pyx_t_5;
  11980. __Pyx_RefNannySetupContext("get_edge_del_cost", 0);
  11981. /* "gedlibpy.pyx":1212
  11982. * :rtype: double
  11983. * """
  11984. * return self.c_env.getEdgeDelCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  11985. *
  11986. *
  11987. */
  11988. __Pyx_XDECREF(__pyx_r);
  11989. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1212, __pyx_L1_error)
  11990. __Pyx_GOTREF(__pyx_t_2);
  11991. __pyx_t_3 = NULL;
  11992. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11993. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11994. if (likely(__pyx_t_3)) {
  11995. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11996. __Pyx_INCREF(__pyx_t_3);
  11997. __Pyx_INCREF(function);
  11998. __Pyx_DECREF_SET(__pyx_t_2, function);
  11999. }
  12000. }
  12001. __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);
  12002. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  12003. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
  12004. __Pyx_GOTREF(__pyx_t_1);
  12005. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12006. __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, 1212, __pyx_L1_error)
  12007. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12008. try {
  12009. __pyx_t_5 = __pyx_v_self->c_env->getEdgeDelCost(__pyx_t_4);
  12010. } catch(...) {
  12011. __Pyx_CppExn2PyErr();
  12012. __PYX_ERR(0, 1212, __pyx_L1_error)
  12013. }
  12014. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1212, __pyx_L1_error)
  12015. __Pyx_GOTREF(__pyx_t_1);
  12016. __pyx_r = __pyx_t_1;
  12017. __pyx_t_1 = 0;
  12018. goto __pyx_L0;
  12019. /* "gedlibpy.pyx":1203
  12020. *
  12021. *
  12022. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  12023. * """
  12024. * Returns edge deletion cost.
  12025. */
  12026. /* function exit code */
  12027. __pyx_L1_error:;
  12028. __Pyx_XDECREF(__pyx_t_1);
  12029. __Pyx_XDECREF(__pyx_t_2);
  12030. __Pyx_XDECREF(__pyx_t_3);
  12031. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12032. __pyx_r = NULL;
  12033. __pyx_L0:;
  12034. __Pyx_XGIVEREF(__pyx_r);
  12035. __Pyx_RefNannyFinishContext();
  12036. return __pyx_r;
  12037. }
  12038. /* "gedlibpy.pyx":1215
  12039. *
  12040. *
  12041. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12042. * """
  12043. * Returns edge insertion cost.
  12044. */
  12045. /* Python wrapper */
  12046. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  12047. 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";
  12048. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12049. PyObject *__pyx_r = 0;
  12050. __Pyx_RefNannyDeclarations
  12051. __Pyx_RefNannySetupContext("get_edge_ins_cost (wrapper)", 0);
  12052. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  12053. /* function exit code */
  12054. __Pyx_RefNannyFinishContext();
  12055. return __pyx_r;
  12056. }
  12057. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12058. PyObject *__pyx_r = NULL;
  12059. __Pyx_RefNannyDeclarations
  12060. PyObject *__pyx_t_1 = NULL;
  12061. PyObject *__pyx_t_2 = NULL;
  12062. PyObject *__pyx_t_3 = NULL;
  12063. std::map<std::string,std::string> __pyx_t_4;
  12064. double __pyx_t_5;
  12065. __Pyx_RefNannySetupContext("get_edge_ins_cost", 0);
  12066. /* "gedlibpy.pyx":1224
  12067. * :rtype: double
  12068. * """
  12069. * return self.c_env.getEdgeInsCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  12070. *
  12071. *
  12072. */
  12073. __Pyx_XDECREF(__pyx_r);
  12074. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1224, __pyx_L1_error)
  12075. __Pyx_GOTREF(__pyx_t_2);
  12076. __pyx_t_3 = NULL;
  12077. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12078. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  12079. if (likely(__pyx_t_3)) {
  12080. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12081. __Pyx_INCREF(__pyx_t_3);
  12082. __Pyx_INCREF(function);
  12083. __Pyx_DECREF_SET(__pyx_t_2, function);
  12084. }
  12085. }
  12086. __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);
  12087. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  12088. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  12089. __Pyx_GOTREF(__pyx_t_1);
  12090. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12091. __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, 1224, __pyx_L1_error)
  12092. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12093. try {
  12094. __pyx_t_5 = __pyx_v_self->c_env->getEdgeInsCost(__pyx_t_4);
  12095. } catch(...) {
  12096. __Pyx_CppExn2PyErr();
  12097. __PYX_ERR(0, 1224, __pyx_L1_error)
  12098. }
  12099. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1224, __pyx_L1_error)
  12100. __Pyx_GOTREF(__pyx_t_1);
  12101. __pyx_r = __pyx_t_1;
  12102. __pyx_t_1 = 0;
  12103. goto __pyx_L0;
  12104. /* "gedlibpy.pyx":1215
  12105. *
  12106. *
  12107. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12108. * """
  12109. * Returns edge insertion cost.
  12110. */
  12111. /* function exit code */
  12112. __pyx_L1_error:;
  12113. __Pyx_XDECREF(__pyx_t_1);
  12114. __Pyx_XDECREF(__pyx_t_2);
  12115. __Pyx_XDECREF(__pyx_t_3);
  12116. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12117. __pyx_r = NULL;
  12118. __pyx_L0:;
  12119. __Pyx_XGIVEREF(__pyx_r);
  12120. __Pyx_RefNannyFinishContext();
  12121. return __pyx_r;
  12122. }
  12123. /* "gedlibpy.pyx":1227
  12124. *
  12125. *
  12126. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12127. * """
  12128. * Computes median edge label.
  12129. */
  12130. /* Python wrapper */
  12131. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels); /*proto*/
  12132. 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";
  12133. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12134. PyObject *__pyx_r = 0;
  12135. __Pyx_RefNannyDeclarations
  12136. __Pyx_RefNannySetupContext("get_median_edge_label (wrapper)", 0);
  12137. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_labels));
  12138. /* function exit code */
  12139. __Pyx_RefNannyFinishContext();
  12140. return __pyx_r;
  12141. }
  12142. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12143. CYTHON_UNUSED PyObject *__pyx_v_edge_labels_b = NULL;
  12144. PyObject *__pyx_9genexpr10__pyx_v_edge_label = NULL;
  12145. PyObject *__pyx_r = NULL;
  12146. __Pyx_RefNannyDeclarations
  12147. PyObject *__pyx_t_1 = NULL;
  12148. PyObject *__pyx_t_2 = NULL;
  12149. Py_ssize_t __pyx_t_3;
  12150. PyObject *(*__pyx_t_4)(PyObject *);
  12151. PyObject *__pyx_t_5 = NULL;
  12152. PyObject *__pyx_t_6 = NULL;
  12153. PyObject *__pyx_t_7 = NULL;
  12154. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  12155. std::map<std::string,std::string> __pyx_t_9;
  12156. __Pyx_RefNannySetupContext("get_median_edge_label", 0);
  12157. /* "gedlibpy.pyx":1236
  12158. * :rtype: dict{string : string}
  12159. * """
  12160. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] # <<<<<<<<<<<<<<
  12161. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b))
  12162. *
  12163. */
  12164. { /* enter inner scope */
  12165. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12166. __Pyx_GOTREF(__pyx_t_1);
  12167. if (likely(PyList_CheckExact(__pyx_v_edge_labels)) || PyTuple_CheckExact(__pyx_v_edge_labels)) {
  12168. __pyx_t_2 = __pyx_v_edge_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  12169. __pyx_t_4 = NULL;
  12170. } else {
  12171. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_edge_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12172. __Pyx_GOTREF(__pyx_t_2);
  12173. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12174. }
  12175. for (;;) {
  12176. if (likely(!__pyx_t_4)) {
  12177. if (likely(PyList_CheckExact(__pyx_t_2))) {
  12178. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  12179. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12180. __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, 1236, __pyx_L5_error)
  12181. #else
  12182. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12183. __Pyx_GOTREF(__pyx_t_5);
  12184. #endif
  12185. } else {
  12186. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  12187. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12188. __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, 1236, __pyx_L5_error)
  12189. #else
  12190. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12191. __Pyx_GOTREF(__pyx_t_5);
  12192. #endif
  12193. }
  12194. } else {
  12195. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  12196. if (unlikely(!__pyx_t_5)) {
  12197. PyObject* exc_type = PyErr_Occurred();
  12198. if (exc_type) {
  12199. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12200. else __PYX_ERR(0, 1236, __pyx_L5_error)
  12201. }
  12202. break;
  12203. }
  12204. __Pyx_GOTREF(__pyx_t_5);
  12205. }
  12206. __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_edge_label, __pyx_t_5);
  12207. __pyx_t_5 = 0;
  12208. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12209. __Pyx_GOTREF(__pyx_t_6);
  12210. __pyx_t_7 = NULL;
  12211. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  12212. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  12213. if (likely(__pyx_t_7)) {
  12214. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  12215. __Pyx_INCREF(__pyx_t_7);
  12216. __Pyx_INCREF(function);
  12217. __Pyx_DECREF_SET(__pyx_t_6, function);
  12218. }
  12219. }
  12220. __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_9genexpr10__pyx_v_edge_label) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_9genexpr10__pyx_v_edge_label);
  12221. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  12222. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1236, __pyx_L5_error)
  12223. __Pyx_GOTREF(__pyx_t_5);
  12224. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12225. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1236, __pyx_L5_error)
  12226. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12227. }
  12228. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12229. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12230. goto __pyx_L8_exit_scope;
  12231. __pyx_L5_error:;
  12232. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12233. goto __pyx_L1_error;
  12234. __pyx_L8_exit_scope:;
  12235. } /* exit inner scope */
  12236. __pyx_v_edge_labels_b = ((PyObject*)__pyx_t_1);
  12237. __pyx_t_1 = 0;
  12238. /* "gedlibpy.pyx":1237
  12239. * """
  12240. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels]
  12241. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b)) # <<<<<<<<<<<<<<
  12242. *
  12243. *
  12244. */
  12245. __Pyx_XDECREF(__pyx_r);
  12246. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1237, __pyx_L1_error)
  12247. __Pyx_GOTREF(__pyx_t_2);
  12248. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1237, __pyx_L1_error)
  12249. __Pyx_GOTREF(__pyx_t_5);
  12250. __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, 1237, __pyx_L1_error)
  12251. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12252. try {
  12253. __pyx_t_9 = __pyx_v_self->c_env->getMedianEdgeLabel(__pyx_t_8);
  12254. } catch(...) {
  12255. __Pyx_CppExn2PyErr();
  12256. __PYX_ERR(0, 1237, __pyx_L1_error)
  12257. }
  12258. __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, 1237, __pyx_L1_error)
  12259. __Pyx_GOTREF(__pyx_t_5);
  12260. __pyx_t_6 = NULL;
  12261. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12262. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  12263. if (likely(__pyx_t_6)) {
  12264. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12265. __Pyx_INCREF(__pyx_t_6);
  12266. __Pyx_INCREF(function);
  12267. __Pyx_DECREF_SET(__pyx_t_2, function);
  12268. }
  12269. }
  12270. __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);
  12271. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12272. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12273. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1237, __pyx_L1_error)
  12274. __Pyx_GOTREF(__pyx_t_1);
  12275. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12276. __pyx_r = __pyx_t_1;
  12277. __pyx_t_1 = 0;
  12278. goto __pyx_L0;
  12279. /* "gedlibpy.pyx":1227
  12280. *
  12281. *
  12282. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12283. * """
  12284. * Computes median edge label.
  12285. */
  12286. /* function exit code */
  12287. __pyx_L1_error:;
  12288. __Pyx_XDECREF(__pyx_t_1);
  12289. __Pyx_XDECREF(__pyx_t_2);
  12290. __Pyx_XDECREF(__pyx_t_5);
  12291. __Pyx_XDECREF(__pyx_t_6);
  12292. __Pyx_XDECREF(__pyx_t_7);
  12293. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12294. __pyx_r = NULL;
  12295. __pyx_L0:;
  12296. __Pyx_XDECREF(__pyx_v_edge_labels_b);
  12297. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label);
  12298. __Pyx_XGIVEREF(__pyx_r);
  12299. __Pyx_RefNannyFinishContext();
  12300. return __pyx_r;
  12301. }
  12302. /* "gedlibpy.pyx":1240
  12303. *
  12304. *
  12305. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12306. * """
  12307. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12308. */
  12309. /* Python wrapper */
  12310. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12311. 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";
  12312. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12313. PyObject *__pyx_v_graph_id = 0;
  12314. CYTHON_UNUSED PyObject *__pyx_v_adj_matrix = 0;
  12315. CYTHON_UNUSED PyObject *__pyx_v_adj_lists = 0;
  12316. CYTHON_UNUSED PyObject *__pyx_v_edge_list = 0;
  12317. PyObject *__pyx_r = 0;
  12318. __Pyx_RefNannyDeclarations
  12319. __Pyx_RefNannySetupContext("get_nx_graph (wrapper)", 0);
  12320. {
  12321. 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};
  12322. PyObject* values[4] = {0,0,0,0};
  12323. values[1] = ((PyObject *)Py_True);
  12324. values[2] = ((PyObject *)Py_False);
  12325. values[3] = ((PyObject *)Py_False);
  12326. if (unlikely(__pyx_kwds)) {
  12327. Py_ssize_t kw_args;
  12328. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12329. switch (pos_args) {
  12330. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12331. CYTHON_FALLTHROUGH;
  12332. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12333. CYTHON_FALLTHROUGH;
  12334. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12335. CYTHON_FALLTHROUGH;
  12336. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12337. CYTHON_FALLTHROUGH;
  12338. case 0: break;
  12339. default: goto __pyx_L5_argtuple_error;
  12340. }
  12341. kw_args = PyDict_Size(__pyx_kwds);
  12342. switch (pos_args) {
  12343. case 0:
  12344. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12345. else goto __pyx_L5_argtuple_error;
  12346. CYTHON_FALLTHROUGH;
  12347. case 1:
  12348. if (kw_args > 0) {
  12349. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_matrix);
  12350. if (value) { values[1] = value; kw_args--; }
  12351. }
  12352. CYTHON_FALLTHROUGH;
  12353. case 2:
  12354. if (kw_args > 0) {
  12355. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_lists);
  12356. if (value) { values[2] = value; kw_args--; }
  12357. }
  12358. CYTHON_FALLTHROUGH;
  12359. case 3:
  12360. if (kw_args > 0) {
  12361. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_list);
  12362. if (value) { values[3] = value; kw_args--; }
  12363. }
  12364. }
  12365. if (unlikely(kw_args > 0)) {
  12366. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1240, __pyx_L3_error)
  12367. }
  12368. } else {
  12369. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12370. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12371. CYTHON_FALLTHROUGH;
  12372. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12373. CYTHON_FALLTHROUGH;
  12374. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12375. CYTHON_FALLTHROUGH;
  12376. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12377. break;
  12378. default: goto __pyx_L5_argtuple_error;
  12379. }
  12380. }
  12381. __pyx_v_graph_id = values[0];
  12382. __pyx_v_adj_matrix = values[1];
  12383. __pyx_v_adj_lists = values[2];
  12384. __pyx_v_edge_list = values[3];
  12385. }
  12386. goto __pyx_L4_argument_unpacking_done;
  12387. __pyx_L5_argtuple_error:;
  12388. __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1240, __pyx_L3_error)
  12389. __pyx_L3_error:;
  12390. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12391. __Pyx_RefNannyFinishContext();
  12392. return NULL;
  12393. __pyx_L4_argument_unpacking_done:;
  12394. __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);
  12395. /* function exit code */
  12396. __Pyx_RefNannyFinishContext();
  12397. return __pyx_r;
  12398. }
  12399. 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) {
  12400. PyObject *__pyx_v_graph = NULL;
  12401. PyObject *__pyx_v_nb_nodes = NULL;
  12402. PyObject *__pyx_v_original_node_ids = NULL;
  12403. PyObject *__pyx_v_node_labels = NULL;
  12404. PyObject *__pyx_v_node_id = NULL;
  12405. PyObject *__pyx_v_edges = NULL;
  12406. PyObject *__pyx_v_head = NULL;
  12407. PyObject *__pyx_v_tail = NULL;
  12408. PyObject *__pyx_v_labels = NULL;
  12409. PyObject *__pyx_r = NULL;
  12410. __Pyx_RefNannyDeclarations
  12411. PyObject *__pyx_t_1 = NULL;
  12412. PyObject *__pyx_t_2 = NULL;
  12413. PyObject *__pyx_t_3 = NULL;
  12414. Py_ssize_t __pyx_t_4;
  12415. PyObject *(*__pyx_t_5)(PyObject *);
  12416. PyObject *__pyx_t_6 = NULL;
  12417. PyObject *__pyx_t_7 = NULL;
  12418. Py_ssize_t __pyx_t_8;
  12419. int __pyx_t_9;
  12420. int __pyx_t_10;
  12421. PyObject *__pyx_t_11 = NULL;
  12422. PyObject *(*__pyx_t_12)(PyObject *);
  12423. __Pyx_RefNannySetupContext("get_nx_graph", 0);
  12424. /* "gedlibpy.pyx":1263
  12425. * The obtained graph.
  12426. * """
  12427. * graph = nx.Graph() # <<<<<<<<<<<<<<
  12428. * graph.graph['id'] = graph_id
  12429. *
  12430. */
  12431. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1263, __pyx_L1_error)
  12432. __Pyx_GOTREF(__pyx_t_2);
  12433. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1263, __pyx_L1_error)
  12434. __Pyx_GOTREF(__pyx_t_3);
  12435. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12436. __pyx_t_2 = NULL;
  12437. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  12438. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12439. if (likely(__pyx_t_2)) {
  12440. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12441. __Pyx_INCREF(__pyx_t_2);
  12442. __Pyx_INCREF(function);
  12443. __Pyx_DECREF_SET(__pyx_t_3, function);
  12444. }
  12445. }
  12446. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  12447. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12448. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
  12449. __Pyx_GOTREF(__pyx_t_1);
  12450. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12451. __pyx_v_graph = __pyx_t_1;
  12452. __pyx_t_1 = 0;
  12453. /* "gedlibpy.pyx":1264
  12454. * """
  12455. * graph = nx.Graph()
  12456. * graph.graph['id'] = graph_id # <<<<<<<<<<<<<<
  12457. *
  12458. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12459. */
  12460. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1264, __pyx_L1_error)
  12461. __Pyx_GOTREF(__pyx_t_1);
  12462. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1264, __pyx_L1_error)
  12463. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12464. /* "gedlibpy.pyx":1266
  12465. * graph.graph['id'] = graph_id
  12466. *
  12467. * nb_nodes = self.get_graph_num_nodes(graph_id) # <<<<<<<<<<<<<<
  12468. * original_node_ids = self.get_original_node_ids(graph_id)
  12469. * node_labels = self.get_graph_node_labels(graph_id)
  12470. */
  12471. __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, 1266, __pyx_L1_error)
  12472. __Pyx_GOTREF(__pyx_t_3);
  12473. __pyx_t_2 = NULL;
  12474. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12475. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12476. if (likely(__pyx_t_2)) {
  12477. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12478. __Pyx_INCREF(__pyx_t_2);
  12479. __Pyx_INCREF(function);
  12480. __Pyx_DECREF_SET(__pyx_t_3, function);
  12481. }
  12482. }
  12483. __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);
  12484. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12485. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12486. __Pyx_GOTREF(__pyx_t_1);
  12487. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12488. __pyx_v_nb_nodes = __pyx_t_1;
  12489. __pyx_t_1 = 0;
  12490. /* "gedlibpy.pyx":1267
  12491. *
  12492. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12493. * original_node_ids = self.get_original_node_ids(graph_id) # <<<<<<<<<<<<<<
  12494. * node_labels = self.get_graph_node_labels(graph_id)
  12495. * # print(original_node_ids)
  12496. */
  12497. __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, 1267, __pyx_L1_error)
  12498. __Pyx_GOTREF(__pyx_t_3);
  12499. __pyx_t_2 = NULL;
  12500. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12501. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12502. if (likely(__pyx_t_2)) {
  12503. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12504. __Pyx_INCREF(__pyx_t_2);
  12505. __Pyx_INCREF(function);
  12506. __Pyx_DECREF_SET(__pyx_t_3, function);
  12507. }
  12508. }
  12509. __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);
  12510. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12511. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
  12512. __Pyx_GOTREF(__pyx_t_1);
  12513. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12514. __pyx_v_original_node_ids = __pyx_t_1;
  12515. __pyx_t_1 = 0;
  12516. /* "gedlibpy.pyx":1268
  12517. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12518. * original_node_ids = self.get_original_node_ids(graph_id)
  12519. * node_labels = self.get_graph_node_labels(graph_id) # <<<<<<<<<<<<<<
  12520. * # print(original_node_ids)
  12521. * # print(node_labels)
  12522. */
  12523. __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, 1268, __pyx_L1_error)
  12524. __Pyx_GOTREF(__pyx_t_3);
  12525. __pyx_t_2 = NULL;
  12526. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12527. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12528. if (likely(__pyx_t_2)) {
  12529. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12530. __Pyx_INCREF(__pyx_t_2);
  12531. __Pyx_INCREF(function);
  12532. __Pyx_DECREF_SET(__pyx_t_3, function);
  12533. }
  12534. }
  12535. __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);
  12536. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12537. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  12538. __Pyx_GOTREF(__pyx_t_1);
  12539. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12540. __pyx_v_node_labels = __pyx_t_1;
  12541. __pyx_t_1 = 0;
  12542. /* "gedlibpy.pyx":1271
  12543. * # print(original_node_ids)
  12544. * # print(node_labels)
  12545. * graph.graph['original_node_ids'] = original_node_ids # <<<<<<<<<<<<<<
  12546. *
  12547. * for node_id in range(0, nb_nodes):
  12548. */
  12549. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12550. __Pyx_GOTREF(__pyx_t_1);
  12551. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_original_node_ids, __pyx_v_original_node_ids) < 0)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12552. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12553. /* "gedlibpy.pyx":1273
  12554. * graph.graph['original_node_ids'] = original_node_ids
  12555. *
  12556. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12557. * graph.add_node(node_id, **node_labels[node_id])
  12558. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12559. */
  12560. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12561. __Pyx_GOTREF(__pyx_t_1);
  12562. __Pyx_INCREF(__pyx_int_0);
  12563. __Pyx_GIVEREF(__pyx_int_0);
  12564. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  12565. __Pyx_INCREF(__pyx_v_nb_nodes);
  12566. __Pyx_GIVEREF(__pyx_v_nb_nodes);
  12567. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nb_nodes);
  12568. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12569. __Pyx_GOTREF(__pyx_t_3);
  12570. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12571. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  12572. __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  12573. __pyx_t_5 = NULL;
  12574. } else {
  12575. __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12576. __Pyx_GOTREF(__pyx_t_1);
  12577. __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12578. }
  12579. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12580. for (;;) {
  12581. if (likely(!__pyx_t_5)) {
  12582. if (likely(PyList_CheckExact(__pyx_t_1))) {
  12583. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
  12584. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12585. __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, 1273, __pyx_L1_error)
  12586. #else
  12587. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12588. __Pyx_GOTREF(__pyx_t_3);
  12589. #endif
  12590. } else {
  12591. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  12592. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12593. __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, 1273, __pyx_L1_error)
  12594. #else
  12595. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1273, __pyx_L1_error)
  12596. __Pyx_GOTREF(__pyx_t_3);
  12597. #endif
  12598. }
  12599. } else {
  12600. __pyx_t_3 = __pyx_t_5(__pyx_t_1);
  12601. if (unlikely(!__pyx_t_3)) {
  12602. PyObject* exc_type = PyErr_Occurred();
  12603. if (exc_type) {
  12604. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12605. else __PYX_ERR(0, 1273, __pyx_L1_error)
  12606. }
  12607. break;
  12608. }
  12609. __Pyx_GOTREF(__pyx_t_3);
  12610. }
  12611. __Pyx_XDECREF_SET(__pyx_v_node_id, __pyx_t_3);
  12612. __pyx_t_3 = 0;
  12613. /* "gedlibpy.pyx":1274
  12614. *
  12615. * for node_id in range(0, nb_nodes):
  12616. * graph.add_node(node_id, **node_labels[node_id]) # <<<<<<<<<<<<<<
  12617. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12618. *
  12619. */
  12620. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12621. __Pyx_GOTREF(__pyx_t_3);
  12622. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12623. __Pyx_GOTREF(__pyx_t_2);
  12624. __Pyx_INCREF(__pyx_v_node_id);
  12625. __Pyx_GIVEREF(__pyx_v_node_id);
  12626. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node_id);
  12627. __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_node_labels, __pyx_v_node_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12628. __Pyx_GOTREF(__pyx_t_7);
  12629. if (unlikely(__pyx_t_7 == Py_None)) {
  12630. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12631. __PYX_ERR(0, 1274, __pyx_L1_error)
  12632. }
  12633. if (likely(PyDict_CheckExact(__pyx_t_7))) {
  12634. __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12635. __Pyx_GOTREF(__pyx_t_6);
  12636. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12637. } else {
  12638. __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12639. __Pyx_GOTREF(__pyx_t_6);
  12640. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12641. }
  12642. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1274, __pyx_L1_error)
  12643. __Pyx_GOTREF(__pyx_t_7);
  12644. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12645. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12646. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12647. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12648. /* "gedlibpy.pyx":1273
  12649. * graph.graph['original_node_ids'] = original_node_ids
  12650. *
  12651. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12652. * graph.add_node(node_id, **node_labels[node_id])
  12653. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12654. */
  12655. }
  12656. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12657. /* "gedlibpy.pyx":1277
  12658. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12659. *
  12660. * edges = self.get_graph_edges(graph_id) # <<<<<<<<<<<<<<
  12661. * for (head, tail), labels in edges.items():
  12662. * graph.add_edge(head, tail, **labels)
  12663. */
  12664. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1277, __pyx_L1_error)
  12665. __Pyx_GOTREF(__pyx_t_7);
  12666. __pyx_t_6 = NULL;
  12667. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12668. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
  12669. if (likely(__pyx_t_6)) {
  12670. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12671. __Pyx_INCREF(__pyx_t_6);
  12672. __Pyx_INCREF(function);
  12673. __Pyx_DECREF_SET(__pyx_t_7, function);
  12674. }
  12675. }
  12676. __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);
  12677. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12678. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1277, __pyx_L1_error)
  12679. __Pyx_GOTREF(__pyx_t_1);
  12680. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12681. __pyx_v_edges = __pyx_t_1;
  12682. __pyx_t_1 = 0;
  12683. /* "gedlibpy.pyx":1278
  12684. *
  12685. * edges = self.get_graph_edges(graph_id)
  12686. * for (head, tail), labels in edges.items(): # <<<<<<<<<<<<<<
  12687. * graph.add_edge(head, tail, **labels)
  12688. * # print(edges)
  12689. */
  12690. __pyx_t_4 = 0;
  12691. if (unlikely(__pyx_v_edges == Py_None)) {
  12692. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  12693. __PYX_ERR(0, 1278, __pyx_L1_error)
  12694. }
  12695. __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, 1278, __pyx_L1_error)
  12696. __Pyx_GOTREF(__pyx_t_7);
  12697. __Pyx_XDECREF(__pyx_t_1);
  12698. __pyx_t_1 = __pyx_t_7;
  12699. __pyx_t_7 = 0;
  12700. while (1) {
  12701. __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);
  12702. if (unlikely(__pyx_t_10 == 0)) break;
  12703. if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1278, __pyx_L1_error)
  12704. __Pyx_GOTREF(__pyx_t_7);
  12705. __Pyx_GOTREF(__pyx_t_6);
  12706. if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
  12707. PyObject* sequence = __pyx_t_7;
  12708. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  12709. if (unlikely(size != 2)) {
  12710. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  12711. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  12712. __PYX_ERR(0, 1278, __pyx_L1_error)
  12713. }
  12714. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12715. if (likely(PyTuple_CheckExact(sequence))) {
  12716. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  12717. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  12718. } else {
  12719. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  12720. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  12721. }
  12722. __Pyx_INCREF(__pyx_t_2);
  12723. __Pyx_INCREF(__pyx_t_3);
  12724. #else
  12725. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
  12726. __Pyx_GOTREF(__pyx_t_2);
  12727. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
  12728. __Pyx_GOTREF(__pyx_t_3);
  12729. #endif
  12730. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12731. } else {
  12732. Py_ssize_t index = -1;
  12733. __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1278, __pyx_L1_error)
  12734. __Pyx_GOTREF(__pyx_t_11);
  12735. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12736. __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
  12737. index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
  12738. __Pyx_GOTREF(__pyx_t_2);
  12739. index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  12740. __Pyx_GOTREF(__pyx_t_3);
  12741. if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
  12742. __pyx_t_12 = NULL;
  12743. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12744. goto __pyx_L8_unpacking_done;
  12745. __pyx_L7_unpacking_failed:;
  12746. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12747. __pyx_t_12 = NULL;
  12748. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  12749. __PYX_ERR(0, 1278, __pyx_L1_error)
  12750. __pyx_L8_unpacking_done:;
  12751. }
  12752. __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
  12753. __pyx_t_2 = 0;
  12754. __Pyx_XDECREF_SET(__pyx_v_tail, __pyx_t_3);
  12755. __pyx_t_3 = 0;
  12756. __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_6);
  12757. __pyx_t_6 = 0;
  12758. /* "gedlibpy.pyx":1279
  12759. * edges = self.get_graph_edges(graph_id)
  12760. * for (head, tail), labels in edges.items():
  12761. * graph.add_edge(head, tail, **labels) # <<<<<<<<<<<<<<
  12762. * # print(edges)
  12763. *
  12764. */
  12765. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1279, __pyx_L1_error)
  12766. __Pyx_GOTREF(__pyx_t_6);
  12767. __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1279, __pyx_L1_error)
  12768. __Pyx_GOTREF(__pyx_t_7);
  12769. __Pyx_INCREF(__pyx_v_head);
  12770. __Pyx_GIVEREF(__pyx_v_head);
  12771. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_head);
  12772. __Pyx_INCREF(__pyx_v_tail);
  12773. __Pyx_GIVEREF(__pyx_v_tail);
  12774. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_tail);
  12775. if (unlikely(__pyx_v_labels == Py_None)) {
  12776. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12777. __PYX_ERR(0, 1279, __pyx_L1_error)
  12778. }
  12779. if (likely(PyDict_CheckExact(__pyx_v_labels))) {
  12780. __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
  12781. __Pyx_GOTREF(__pyx_t_3);
  12782. } else {
  12783. __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1279, __pyx_L1_error)
  12784. __Pyx_GOTREF(__pyx_t_3);
  12785. }
  12786. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1279, __pyx_L1_error)
  12787. __Pyx_GOTREF(__pyx_t_2);
  12788. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12789. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12790. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12791. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12792. }
  12793. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12794. /* "gedlibpy.pyx":1282
  12795. * # print(edges)
  12796. *
  12797. * return graph # <<<<<<<<<<<<<<
  12798. *
  12799. *
  12800. */
  12801. __Pyx_XDECREF(__pyx_r);
  12802. __Pyx_INCREF(__pyx_v_graph);
  12803. __pyx_r = __pyx_v_graph;
  12804. goto __pyx_L0;
  12805. /* "gedlibpy.pyx":1240
  12806. *
  12807. *
  12808. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12809. * """
  12810. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12811. */
  12812. /* function exit code */
  12813. __pyx_L1_error:;
  12814. __Pyx_XDECREF(__pyx_t_1);
  12815. __Pyx_XDECREF(__pyx_t_2);
  12816. __Pyx_XDECREF(__pyx_t_3);
  12817. __Pyx_XDECREF(__pyx_t_6);
  12818. __Pyx_XDECREF(__pyx_t_7);
  12819. __Pyx_XDECREF(__pyx_t_11);
  12820. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12821. __pyx_r = NULL;
  12822. __pyx_L0:;
  12823. __Pyx_XDECREF(__pyx_v_graph);
  12824. __Pyx_XDECREF(__pyx_v_nb_nodes);
  12825. __Pyx_XDECREF(__pyx_v_original_node_ids);
  12826. __Pyx_XDECREF(__pyx_v_node_labels);
  12827. __Pyx_XDECREF(__pyx_v_node_id);
  12828. __Pyx_XDECREF(__pyx_v_edges);
  12829. __Pyx_XDECREF(__pyx_v_head);
  12830. __Pyx_XDECREF(__pyx_v_tail);
  12831. __Pyx_XDECREF(__pyx_v_labels);
  12832. __Pyx_XGIVEREF(__pyx_r);
  12833. __Pyx_RefNannyFinishContext();
  12834. return __pyx_r;
  12835. }
  12836. /* "gedlibpy.pyx":1285
  12837. *
  12838. *
  12839. * def get_init_type(self): # <<<<<<<<<<<<<<
  12840. * """
  12841. * Returns the initialization type of the last initialization in string.
  12842. */
  12843. /* Python wrapper */
  12844. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  12845. 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";
  12846. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  12847. PyObject *__pyx_r = 0;
  12848. __Pyx_RefNannyDeclarations
  12849. __Pyx_RefNannySetupContext("get_init_type (wrapper)", 0);
  12850. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  12851. /* function exit code */
  12852. __Pyx_RefNannyFinishContext();
  12853. return __pyx_r;
  12854. }
  12855. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  12856. PyObject *__pyx_r = NULL;
  12857. __Pyx_RefNannyDeclarations
  12858. std::string __pyx_t_1;
  12859. PyObject *__pyx_t_2 = NULL;
  12860. __Pyx_RefNannySetupContext("get_init_type", 0);
  12861. /* "gedlibpy.pyx":1294
  12862. * Initialization type in string.
  12863. * """
  12864. * return self.c_env.getInitType().decode('utf-8') # <<<<<<<<<<<<<<
  12865. *
  12866. *
  12867. */
  12868. __Pyx_XDECREF(__pyx_r);
  12869. try {
  12870. __pyx_t_1 = __pyx_v_self->c_env->getInitType();
  12871. } catch(...) {
  12872. __Pyx_CppExn2PyErr();
  12873. __PYX_ERR(0, 1294, __pyx_L1_error)
  12874. }
  12875. __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, 1294, __pyx_L1_error)
  12876. __Pyx_GOTREF(__pyx_t_2);
  12877. __pyx_r = __pyx_t_2;
  12878. __pyx_t_2 = 0;
  12879. goto __pyx_L0;
  12880. /* "gedlibpy.pyx":1285
  12881. *
  12882. *
  12883. * def get_init_type(self): # <<<<<<<<<<<<<<
  12884. * """
  12885. * Returns the initialization type of the last initialization in string.
  12886. */
  12887. /* function exit code */
  12888. __pyx_L1_error:;
  12889. __Pyx_XDECREF(__pyx_t_2);
  12890. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12891. __pyx_r = NULL;
  12892. __pyx_L0:;
  12893. __Pyx_XGIVEREF(__pyx_r);
  12894. __Pyx_RefNannyFinishContext();
  12895. return __pyx_r;
  12896. }
  12897. /* "gedlibpy.pyx":1316
  12898. *
  12899. *
  12900. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  12901. * """
  12902. * Loads NetworkX Graph into the GED environment.
  12903. */
  12904. /* Python wrapper */
  12905. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12906. 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";
  12907. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12908. PyObject *__pyx_v_nx_graph = 0;
  12909. PyObject *__pyx_v_graph_id = 0;
  12910. PyObject *__pyx_v_graph_name = 0;
  12911. PyObject *__pyx_v_graph_class = 0;
  12912. PyObject *__pyx_r = 0;
  12913. __Pyx_RefNannyDeclarations
  12914. __Pyx_RefNannySetupContext("load_nx_graph (wrapper)", 0);
  12915. {
  12916. 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};
  12917. PyObject* values[4] = {0,0,0,0};
  12918. values[2] = ((PyObject *)__pyx_kp_u_);
  12919. values[3] = ((PyObject *)__pyx_kp_u_);
  12920. if (unlikely(__pyx_kwds)) {
  12921. Py_ssize_t kw_args;
  12922. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12923. switch (pos_args) {
  12924. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12925. CYTHON_FALLTHROUGH;
  12926. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12927. CYTHON_FALLTHROUGH;
  12928. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12929. CYTHON_FALLTHROUGH;
  12930. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12931. CYTHON_FALLTHROUGH;
  12932. case 0: break;
  12933. default: goto __pyx_L5_argtuple_error;
  12934. }
  12935. kw_args = PyDict_Size(__pyx_kwds);
  12936. switch (pos_args) {
  12937. case 0:
  12938. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nx_graph)) != 0)) kw_args--;
  12939. else goto __pyx_L5_argtuple_error;
  12940. CYTHON_FALLTHROUGH;
  12941. case 1:
  12942. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12943. else {
  12944. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1316, __pyx_L3_error)
  12945. }
  12946. CYTHON_FALLTHROUGH;
  12947. case 2:
  12948. if (kw_args > 0) {
  12949. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_name);
  12950. if (value) { values[2] = value; kw_args--; }
  12951. }
  12952. CYTHON_FALLTHROUGH;
  12953. case 3:
  12954. if (kw_args > 0) {
  12955. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_class);
  12956. if (value) { values[3] = value; kw_args--; }
  12957. }
  12958. }
  12959. if (unlikely(kw_args > 0)) {
  12960. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1316, __pyx_L3_error)
  12961. }
  12962. } else {
  12963. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12964. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12965. CYTHON_FALLTHROUGH;
  12966. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12967. CYTHON_FALLTHROUGH;
  12968. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12969. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12970. break;
  12971. default: goto __pyx_L5_argtuple_error;
  12972. }
  12973. }
  12974. __pyx_v_nx_graph = values[0];
  12975. __pyx_v_graph_id = values[1];
  12976. __pyx_v_graph_name = values[2];
  12977. __pyx_v_graph_class = values[3];
  12978. }
  12979. goto __pyx_L4_argument_unpacking_done;
  12980. __pyx_L5_argtuple_error:;
  12981. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1316, __pyx_L3_error)
  12982. __pyx_L3_error:;
  12983. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12984. __Pyx_RefNannyFinishContext();
  12985. return NULL;
  12986. __pyx_L4_argument_unpacking_done:;
  12987. __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);
  12988. /* function exit code */
  12989. __Pyx_RefNannyFinishContext();
  12990. return __pyx_r;
  12991. }
  12992. 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) {
  12993. PyObject *__pyx_v_node = NULL;
  12994. PyObject *__pyx_v_edge = NULL;
  12995. PyObject *__pyx_r = NULL;
  12996. __Pyx_RefNannyDeclarations
  12997. int __pyx_t_1;
  12998. int __pyx_t_2;
  12999. PyObject *__pyx_t_3 = NULL;
  13000. PyObject *__pyx_t_4 = NULL;
  13001. PyObject *__pyx_t_5 = NULL;
  13002. int __pyx_t_6;
  13003. PyObject *__pyx_t_7 = NULL;
  13004. Py_ssize_t __pyx_t_8;
  13005. PyObject *(*__pyx_t_9)(PyObject *);
  13006. PyObject *__pyx_t_10 = NULL;
  13007. PyObject *__pyx_t_11 = NULL;
  13008. PyObject *__pyx_t_12 = NULL;
  13009. PyObject *__pyx_t_13 = NULL;
  13010. PyObject *__pyx_t_14 = NULL;
  13011. PyObject *__pyx_t_15 = NULL;
  13012. PyObject *__pyx_t_16 = NULL;
  13013. __Pyx_RefNannySetupContext("load_nx_graph", 0);
  13014. __Pyx_INCREF(__pyx_v_graph_id);
  13015. /* "gedlibpy.pyx":1339
  13016. * The ID of the newly loaded graph.
  13017. * """
  13018. * if graph_id is None: # <<<<<<<<<<<<<<
  13019. * graph_id = self.add_graph(graph_name, graph_class)
  13020. * else:
  13021. */
  13022. __pyx_t_1 = (__pyx_v_graph_id == Py_None);
  13023. __pyx_t_2 = (__pyx_t_1 != 0);
  13024. if (__pyx_t_2) {
  13025. /* "gedlibpy.pyx":1340
  13026. * """
  13027. * if graph_id is None:
  13028. * graph_id = self.add_graph(graph_name, graph_class) # <<<<<<<<<<<<<<
  13029. * else:
  13030. * self.clear_graph(graph_id)
  13031. */
  13032. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1340, __pyx_L1_error)
  13033. __Pyx_GOTREF(__pyx_t_4);
  13034. __pyx_t_5 = NULL;
  13035. __pyx_t_6 = 0;
  13036. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13037. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  13038. if (likely(__pyx_t_5)) {
  13039. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13040. __Pyx_INCREF(__pyx_t_5);
  13041. __Pyx_INCREF(function);
  13042. __Pyx_DECREF_SET(__pyx_t_4, function);
  13043. __pyx_t_6 = 1;
  13044. }
  13045. }
  13046. #if CYTHON_FAST_PYCALL
  13047. if (PyFunction_Check(__pyx_t_4)) {
  13048. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13049. __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, 1340, __pyx_L1_error)
  13050. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13051. __Pyx_GOTREF(__pyx_t_3);
  13052. } else
  13053. #endif
  13054. #if CYTHON_FAST_PYCCALL
  13055. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  13056. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13057. __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, 1340, __pyx_L1_error)
  13058. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13059. __Pyx_GOTREF(__pyx_t_3);
  13060. } else
  13061. #endif
  13062. {
  13063. __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1340, __pyx_L1_error)
  13064. __Pyx_GOTREF(__pyx_t_7);
  13065. if (__pyx_t_5) {
  13066. __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  13067. }
  13068. __Pyx_INCREF(__pyx_v_graph_name);
  13069. __Pyx_GIVEREF(__pyx_v_graph_name);
  13070. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_graph_name);
  13071. __Pyx_INCREF(__pyx_v_graph_class);
  13072. __Pyx_GIVEREF(__pyx_v_graph_class);
  13073. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graph_class);
  13074. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error)
  13075. __Pyx_GOTREF(__pyx_t_3);
  13076. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13077. }
  13078. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13079. __Pyx_DECREF_SET(__pyx_v_graph_id, __pyx_t_3);
  13080. __pyx_t_3 = 0;
  13081. /* "gedlibpy.pyx":1339
  13082. * The ID of the newly loaded graph.
  13083. * """
  13084. * if graph_id is None: # <<<<<<<<<<<<<<
  13085. * graph_id = self.add_graph(graph_name, graph_class)
  13086. * else:
  13087. */
  13088. goto __pyx_L3;
  13089. }
  13090. /* "gedlibpy.pyx":1342
  13091. * graph_id = self.add_graph(graph_name, graph_class)
  13092. * else:
  13093. * self.clear_graph(graph_id) # <<<<<<<<<<<<<<
  13094. * for node in nx_graph.nodes:
  13095. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13096. */
  13097. /*else*/ {
  13098. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1342, __pyx_L1_error)
  13099. __Pyx_GOTREF(__pyx_t_4);
  13100. __pyx_t_7 = NULL;
  13101. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13102. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
  13103. if (likely(__pyx_t_7)) {
  13104. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13105. __Pyx_INCREF(__pyx_t_7);
  13106. __Pyx_INCREF(function);
  13107. __Pyx_DECREF_SET(__pyx_t_4, function);
  13108. }
  13109. }
  13110. __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);
  13111. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13112. if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
  13113. __Pyx_GOTREF(__pyx_t_3);
  13114. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13115. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13116. }
  13117. __pyx_L3:;
  13118. /* "gedlibpy.pyx":1343
  13119. * else:
  13120. * self.clear_graph(graph_id)
  13121. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13122. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13123. * for edge in nx_graph.edges:
  13124. */
  13125. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
  13126. __Pyx_GOTREF(__pyx_t_3);
  13127. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  13128. __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
  13129. __pyx_t_9 = NULL;
  13130. } else {
  13131. __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1343, __pyx_L1_error)
  13132. __Pyx_GOTREF(__pyx_t_4);
  13133. __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1343, __pyx_L1_error)
  13134. }
  13135. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13136. for (;;) {
  13137. if (likely(!__pyx_t_9)) {
  13138. if (likely(PyList_CheckExact(__pyx_t_4))) {
  13139. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
  13140. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13141. __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, 1343, __pyx_L1_error)
  13142. #else
  13143. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
  13144. __Pyx_GOTREF(__pyx_t_3);
  13145. #endif
  13146. } else {
  13147. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  13148. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13149. __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, 1343, __pyx_L1_error)
  13150. #else
  13151. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
  13152. __Pyx_GOTREF(__pyx_t_3);
  13153. #endif
  13154. }
  13155. } else {
  13156. __pyx_t_3 = __pyx_t_9(__pyx_t_4);
  13157. if (unlikely(!__pyx_t_3)) {
  13158. PyObject* exc_type = PyErr_Occurred();
  13159. if (exc_type) {
  13160. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13161. else __PYX_ERR(0, 1343, __pyx_L1_error)
  13162. }
  13163. break;
  13164. }
  13165. __Pyx_GOTREF(__pyx_t_3);
  13166. }
  13167. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
  13168. __pyx_t_3 = 0;
  13169. /* "gedlibpy.pyx":1344
  13170. * self.clear_graph(graph_id)
  13171. * for node in nx_graph.nodes:
  13172. * self.add_node(graph_id, str(node), nx_graph.nodes[node]) # <<<<<<<<<<<<<<
  13173. * for edge in nx_graph.edges:
  13174. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13175. */
  13176. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13177. __Pyx_GOTREF(__pyx_t_7);
  13178. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13179. __Pyx_GOTREF(__pyx_t_5);
  13180. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13181. __Pyx_GOTREF(__pyx_t_10);
  13182. __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13183. __Pyx_GOTREF(__pyx_t_11);
  13184. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13185. __pyx_t_10 = NULL;
  13186. __pyx_t_6 = 0;
  13187. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13188. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13189. if (likely(__pyx_t_10)) {
  13190. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13191. __Pyx_INCREF(__pyx_t_10);
  13192. __Pyx_INCREF(function);
  13193. __Pyx_DECREF_SET(__pyx_t_7, function);
  13194. __pyx_t_6 = 1;
  13195. }
  13196. }
  13197. #if CYTHON_FAST_PYCALL
  13198. if (PyFunction_Check(__pyx_t_7)) {
  13199. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13200. __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, 1344, __pyx_L1_error)
  13201. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13202. __Pyx_GOTREF(__pyx_t_3);
  13203. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13204. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13205. } else
  13206. #endif
  13207. #if CYTHON_FAST_PYCCALL
  13208. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13209. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13210. __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, 1344, __pyx_L1_error)
  13211. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13212. __Pyx_GOTREF(__pyx_t_3);
  13213. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13214. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13215. } else
  13216. #endif
  13217. {
  13218. __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13219. __Pyx_GOTREF(__pyx_t_12);
  13220. if (__pyx_t_10) {
  13221. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13222. }
  13223. __Pyx_INCREF(__pyx_v_graph_id);
  13224. __Pyx_GIVEREF(__pyx_v_graph_id);
  13225. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_graph_id);
  13226. __Pyx_GIVEREF(__pyx_t_5);
  13227. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_5);
  13228. __Pyx_GIVEREF(__pyx_t_11);
  13229. PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_6, __pyx_t_11);
  13230. __pyx_t_5 = 0;
  13231. __pyx_t_11 = 0;
  13232. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
  13233. __Pyx_GOTREF(__pyx_t_3);
  13234. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13235. }
  13236. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13237. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13238. /* "gedlibpy.pyx":1343
  13239. * else:
  13240. * self.clear_graph(graph_id)
  13241. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13242. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13243. * for edge in nx_graph.edges:
  13244. */
  13245. }
  13246. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13247. /* "gedlibpy.pyx":1345
  13248. * for node in nx_graph.nodes:
  13249. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13250. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13251. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13252. * return graph_id
  13253. */
  13254. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
  13255. __Pyx_GOTREF(__pyx_t_4);
  13256. if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
  13257. __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
  13258. __pyx_t_9 = NULL;
  13259. } else {
  13260. __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1345, __pyx_L1_error)
  13261. __Pyx_GOTREF(__pyx_t_3);
  13262. __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1345, __pyx_L1_error)
  13263. }
  13264. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13265. for (;;) {
  13266. if (likely(!__pyx_t_9)) {
  13267. if (likely(PyList_CheckExact(__pyx_t_3))) {
  13268. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
  13269. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13270. __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, 1345, __pyx_L1_error)
  13271. #else
  13272. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
  13273. __Pyx_GOTREF(__pyx_t_4);
  13274. #endif
  13275. } else {
  13276. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  13277. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13278. __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, 1345, __pyx_L1_error)
  13279. #else
  13280. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
  13281. __Pyx_GOTREF(__pyx_t_4);
  13282. #endif
  13283. }
  13284. } else {
  13285. __pyx_t_4 = __pyx_t_9(__pyx_t_3);
  13286. if (unlikely(!__pyx_t_4)) {
  13287. PyObject* exc_type = PyErr_Occurred();
  13288. if (exc_type) {
  13289. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13290. else __PYX_ERR(0, 1345, __pyx_L1_error)
  13291. }
  13292. break;
  13293. }
  13294. __Pyx_GOTREF(__pyx_t_4);
  13295. }
  13296. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4);
  13297. __pyx_t_4 = 0;
  13298. /* "gedlibpy.pyx":1346
  13299. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13300. * for edge in nx_graph.edges:
  13301. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) # <<<<<<<<<<<<<<
  13302. * return graph_id
  13303. *
  13304. */
  13305. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13306. __Pyx_GOTREF(__pyx_t_7);
  13307. __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, 1346, __pyx_L1_error)
  13308. __Pyx_GOTREF(__pyx_t_12);
  13309. __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13310. __Pyx_GOTREF(__pyx_t_11);
  13311. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13312. __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, 1346, __pyx_L1_error)
  13313. __Pyx_GOTREF(__pyx_t_12);
  13314. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13315. __Pyx_GOTREF(__pyx_t_5);
  13316. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13317. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13318. __Pyx_GOTREF(__pyx_t_10);
  13319. __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, 1346, __pyx_L1_error)
  13320. __Pyx_GOTREF(__pyx_t_13);
  13321. __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, 1346, __pyx_L1_error)
  13322. __Pyx_GOTREF(__pyx_t_14);
  13323. __pyx_t_15 = NULL;
  13324. __pyx_t_6 = 0;
  13325. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
  13326. __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
  13327. if (likely(__pyx_t_15)) {
  13328. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
  13329. __Pyx_INCREF(__pyx_t_15);
  13330. __Pyx_INCREF(function);
  13331. __Pyx_DECREF_SET(__pyx_t_10, function);
  13332. __pyx_t_6 = 1;
  13333. }
  13334. }
  13335. #if CYTHON_FAST_PYCALL
  13336. if (PyFunction_Check(__pyx_t_10)) {
  13337. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13338. __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, 1346, __pyx_L1_error)
  13339. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13340. __Pyx_GOTREF(__pyx_t_12);
  13341. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13342. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13343. } else
  13344. #endif
  13345. #if CYTHON_FAST_PYCCALL
  13346. if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
  13347. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13348. __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, 1346, __pyx_L1_error)
  13349. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13350. __Pyx_GOTREF(__pyx_t_12);
  13351. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13352. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13353. } else
  13354. #endif
  13355. {
  13356. __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13357. __Pyx_GOTREF(__pyx_t_16);
  13358. if (__pyx_t_15) {
  13359. __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
  13360. }
  13361. __Pyx_GIVEREF(__pyx_t_13);
  13362. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
  13363. __Pyx_GIVEREF(__pyx_t_14);
  13364. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_14);
  13365. __pyx_t_13 = 0;
  13366. __pyx_t_14 = 0;
  13367. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13368. __Pyx_GOTREF(__pyx_t_12);
  13369. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13370. }
  13371. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13372. __pyx_t_10 = NULL;
  13373. __pyx_t_6 = 0;
  13374. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13375. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13376. if (likely(__pyx_t_10)) {
  13377. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13378. __Pyx_INCREF(__pyx_t_10);
  13379. __Pyx_INCREF(function);
  13380. __Pyx_DECREF_SET(__pyx_t_7, function);
  13381. __pyx_t_6 = 1;
  13382. }
  13383. }
  13384. #if CYTHON_FAST_PYCALL
  13385. if (PyFunction_Check(__pyx_t_7)) {
  13386. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13387. __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, 1346, __pyx_L1_error)
  13388. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13389. __Pyx_GOTREF(__pyx_t_4);
  13390. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13391. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13392. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13393. } else
  13394. #endif
  13395. #if CYTHON_FAST_PYCCALL
  13396. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13397. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13398. __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, 1346, __pyx_L1_error)
  13399. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13400. __Pyx_GOTREF(__pyx_t_4);
  13401. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13402. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13403. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13404. } else
  13405. #endif
  13406. {
  13407. __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13408. __Pyx_GOTREF(__pyx_t_16);
  13409. if (__pyx_t_10) {
  13410. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13411. }
  13412. __Pyx_INCREF(__pyx_v_graph_id);
  13413. __Pyx_GIVEREF(__pyx_v_graph_id);
  13414. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_v_graph_id);
  13415. __Pyx_GIVEREF(__pyx_t_11);
  13416. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
  13417. __Pyx_GIVEREF(__pyx_t_5);
  13418. PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_6, __pyx_t_5);
  13419. __Pyx_GIVEREF(__pyx_t_12);
  13420. PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_6, __pyx_t_12);
  13421. __pyx_t_11 = 0;
  13422. __pyx_t_5 = 0;
  13423. __pyx_t_12 = 0;
  13424. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1346, __pyx_L1_error)
  13425. __Pyx_GOTREF(__pyx_t_4);
  13426. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13427. }
  13428. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13429. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13430. /* "gedlibpy.pyx":1345
  13431. * for node in nx_graph.nodes:
  13432. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13433. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13434. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13435. * return graph_id
  13436. */
  13437. }
  13438. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13439. /* "gedlibpy.pyx":1347
  13440. * for edge in nx_graph.edges:
  13441. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13442. * return graph_id # <<<<<<<<<<<<<<
  13443. *
  13444. *
  13445. */
  13446. __Pyx_XDECREF(__pyx_r);
  13447. __Pyx_INCREF(__pyx_v_graph_id);
  13448. __pyx_r = __pyx_v_graph_id;
  13449. goto __pyx_L0;
  13450. /* "gedlibpy.pyx":1316
  13451. *
  13452. *
  13453. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  13454. * """
  13455. * Loads NetworkX Graph into the GED environment.
  13456. */
  13457. /* function exit code */
  13458. __pyx_L1_error:;
  13459. __Pyx_XDECREF(__pyx_t_3);
  13460. __Pyx_XDECREF(__pyx_t_4);
  13461. __Pyx_XDECREF(__pyx_t_5);
  13462. __Pyx_XDECREF(__pyx_t_7);
  13463. __Pyx_XDECREF(__pyx_t_10);
  13464. __Pyx_XDECREF(__pyx_t_11);
  13465. __Pyx_XDECREF(__pyx_t_12);
  13466. __Pyx_XDECREF(__pyx_t_13);
  13467. __Pyx_XDECREF(__pyx_t_14);
  13468. __Pyx_XDECREF(__pyx_t_15);
  13469. __Pyx_XDECREF(__pyx_t_16);
  13470. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13471. __pyx_r = NULL;
  13472. __pyx_L0:;
  13473. __Pyx_XDECREF(__pyx_v_node);
  13474. __Pyx_XDECREF(__pyx_v_edge);
  13475. __Pyx_XDECREF(__pyx_v_graph_id);
  13476. __Pyx_XGIVEREF(__pyx_r);
  13477. __Pyx_RefNannyFinishContext();
  13478. return __pyx_r;
  13479. }
  13480. /* "gedlibpy.pyx":1350
  13481. *
  13482. *
  13483. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13484. * """
  13485. * Computes the edit cost between two graphs induced by a node map.
  13486. */
  13487. /* Python wrapper */
  13488. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13489. 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\t\tnode_map: gklearn.ged.env.NodeMap.\n\t\t\tThe NodeMap instance whose reduced cost will be computed and re-assigned.\n\n\t\tReturns\n\t\t-------\n\t\tNone.\t\t\n\t\t";
  13490. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13491. PyObject *__pyx_v_g_id = 0;
  13492. PyObject *__pyx_v_h_id = 0;
  13493. PyObject *__pyx_v_node_map = 0;
  13494. PyObject *__pyx_r = 0;
  13495. __Pyx_RefNannyDeclarations
  13496. __Pyx_RefNannySetupContext("compute_induced_cost (wrapper)", 0);
  13497. {
  13498. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,&__pyx_n_s_node_map,0};
  13499. PyObject* values[3] = {0,0,0};
  13500. if (unlikely(__pyx_kwds)) {
  13501. Py_ssize_t kw_args;
  13502. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13503. switch (pos_args) {
  13504. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13505. CYTHON_FALLTHROUGH;
  13506. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13507. CYTHON_FALLTHROUGH;
  13508. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13509. CYTHON_FALLTHROUGH;
  13510. case 0: break;
  13511. default: goto __pyx_L5_argtuple_error;
  13512. }
  13513. kw_args = PyDict_Size(__pyx_kwds);
  13514. switch (pos_args) {
  13515. case 0:
  13516. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g_id)) != 0)) kw_args--;
  13517. else goto __pyx_L5_argtuple_error;
  13518. CYTHON_FALLTHROUGH;
  13519. case 1:
  13520. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h_id)) != 0)) kw_args--;
  13521. else {
  13522. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 1); __PYX_ERR(0, 1350, __pyx_L3_error)
  13523. }
  13524. CYTHON_FALLTHROUGH;
  13525. case 2:
  13526. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_map)) != 0)) kw_args--;
  13527. else {
  13528. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 2); __PYX_ERR(0, 1350, __pyx_L3_error)
  13529. }
  13530. }
  13531. if (unlikely(kw_args > 0)) {
  13532. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1350, __pyx_L3_error)
  13533. }
  13534. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  13535. goto __pyx_L5_argtuple_error;
  13536. } else {
  13537. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13538. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13539. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13540. }
  13541. __pyx_v_g_id = values[0];
  13542. __pyx_v_h_id = values[1];
  13543. __pyx_v_node_map = values[2];
  13544. }
  13545. goto __pyx_L4_argument_unpacking_done;
  13546. __pyx_L5_argtuple_error:;
  13547. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1350, __pyx_L3_error)
  13548. __pyx_L3_error:;
  13549. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13550. __Pyx_RefNannyFinishContext();
  13551. return NULL;
  13552. __pyx_L4_argument_unpacking_done:;
  13553. __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, __pyx_v_node_map);
  13554. /* function exit code */
  13555. __Pyx_RefNannyFinishContext();
  13556. return __pyx_r;
  13557. }
  13558. 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, PyObject *__pyx_v_node_map) {
  13559. PyObject *__pyx_v_relation = NULL;
  13560. PyObject *__pyx_v_dummy_node = NULL;
  13561. PyObject *__pyx_v_i = NULL;
  13562. PyObject *__pyx_v_val = NULL;
  13563. PyObject *__pyx_v_val1 = NULL;
  13564. PyObject *__pyx_v_val2 = NULL;
  13565. double __pyx_v_induced_cost;
  13566. PyObject *__pyx_r = NULL;
  13567. __Pyx_RefNannyDeclarations
  13568. PyObject *__pyx_t_1 = NULL;
  13569. PyObject *__pyx_t_2 = NULL;
  13570. PyObject *__pyx_t_3 = NULL;
  13571. Py_ssize_t __pyx_t_4;
  13572. PyObject *__pyx_t_5 = NULL;
  13573. PyObject *__pyx_t_6 = NULL;
  13574. PyObject *__pyx_t_7 = NULL;
  13575. int __pyx_t_8;
  13576. size_t __pyx_t_9;
  13577. size_t __pyx_t_10;
  13578. std::vector<std::pair<size_t,size_t> > __pyx_t_11;
  13579. double __pyx_t_12;
  13580. __Pyx_RefNannySetupContext("compute_induced_cost", 0);
  13581. /* "gedlibpy.pyx":1367
  13582. * None.
  13583. * """
  13584. * relation = [] # <<<<<<<<<<<<<<
  13585. * node_map.as_relation(relation)
  13586. * # print(relation)
  13587. */
  13588. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1367, __pyx_L1_error)
  13589. __Pyx_GOTREF(__pyx_t_1);
  13590. __pyx_v_relation = ((PyObject*)__pyx_t_1);
  13591. __pyx_t_1 = 0;
  13592. /* "gedlibpy.pyx":1368
  13593. * """
  13594. * relation = []
  13595. * node_map.as_relation(relation) # <<<<<<<<<<<<<<
  13596. * # print(relation)
  13597. * dummy_node = get_dummy_node()
  13598. */
  13599. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_as_relation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1368, __pyx_L1_error)
  13600. __Pyx_GOTREF(__pyx_t_2);
  13601. __pyx_t_3 = NULL;
  13602. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  13603. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  13604. if (likely(__pyx_t_3)) {
  13605. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13606. __Pyx_INCREF(__pyx_t_3);
  13607. __Pyx_INCREF(function);
  13608. __Pyx_DECREF_SET(__pyx_t_2, function);
  13609. }
  13610. }
  13611. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_relation) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_relation);
  13612. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  13613. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1368, __pyx_L1_error)
  13614. __Pyx_GOTREF(__pyx_t_1);
  13615. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13616. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13617. /* "gedlibpy.pyx":1370
  13618. * node_map.as_relation(relation)
  13619. * # print(relation)
  13620. * dummy_node = get_dummy_node() # <<<<<<<<<<<<<<
  13621. * # print(dummy_node)
  13622. * for i, val in enumerate(relation):
  13623. */
  13624. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_dummy_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error)
  13625. __Pyx_GOTREF(__pyx_t_2);
  13626. __pyx_t_3 = NULL;
  13627. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  13628. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  13629. if (likely(__pyx_t_3)) {
  13630. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13631. __Pyx_INCREF(__pyx_t_3);
  13632. __Pyx_INCREF(function);
  13633. __Pyx_DECREF_SET(__pyx_t_2, function);
  13634. }
  13635. }
  13636. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  13637. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  13638. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error)
  13639. __Pyx_GOTREF(__pyx_t_1);
  13640. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13641. __pyx_v_dummy_node = __pyx_t_1;
  13642. __pyx_t_1 = 0;
  13643. /* "gedlibpy.pyx":1372
  13644. * dummy_node = get_dummy_node()
  13645. * # print(dummy_node)
  13646. * for i, val in enumerate(relation): # <<<<<<<<<<<<<<
  13647. * val1 = dummy_node if val[0] == np.inf else val[0]
  13648. * val2 = dummy_node if val[1] == np.inf else val[1]
  13649. */
  13650. __Pyx_INCREF(__pyx_int_0);
  13651. __pyx_t_1 = __pyx_int_0;
  13652. __pyx_t_2 = __pyx_v_relation; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  13653. for (;;) {
  13654. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
  13655. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13656. __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 1372, __pyx_L1_error)
  13657. #else
  13658. __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  13659. __Pyx_GOTREF(__pyx_t_3);
  13660. #endif
  13661. __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
  13662. __pyx_t_3 = 0;
  13663. __Pyx_INCREF(__pyx_t_1);
  13664. __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
  13665. __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1372, __pyx_L1_error)
  13666. __Pyx_GOTREF(__pyx_t_3);
  13667. __Pyx_DECREF(__pyx_t_1);
  13668. __pyx_t_1 = __pyx_t_3;
  13669. __pyx_t_3 = 0;
  13670. /* "gedlibpy.pyx":1373
  13671. * # print(dummy_node)
  13672. * for i, val in enumerate(relation):
  13673. * val1 = dummy_node if val[0] == np.inf else val[0] # <<<<<<<<<<<<<<
  13674. * val2 = dummy_node if val[1] == np.inf else val[1]
  13675. * relation[i] = tuple((val1, val2))
  13676. */
  13677. __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13678. __Pyx_GOTREF(__pyx_t_5);
  13679. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13680. __Pyx_GOTREF(__pyx_t_6);
  13681. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13682. __Pyx_GOTREF(__pyx_t_7);
  13683. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13684. __pyx_t_6 = PyObject_RichCompare(__pyx_t_5, __pyx_t_7, Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13685. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13686. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13687. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13688. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13689. if (__pyx_t_8) {
  13690. __Pyx_INCREF(__pyx_v_dummy_node);
  13691. __pyx_t_3 = __pyx_v_dummy_node;
  13692. } else {
  13693. __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_val, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  13694. __Pyx_GOTREF(__pyx_t_6);
  13695. __pyx_t_3 = __pyx_t_6;
  13696. __pyx_t_6 = 0;
  13697. }
  13698. __Pyx_XDECREF_SET(__pyx_v_val1, __pyx_t_3);
  13699. __pyx_t_3 = 0;
  13700. /* "gedlibpy.pyx":1374
  13701. * for i, val in enumerate(relation):
  13702. * val1 = dummy_node if val[0] == np.inf else val[0]
  13703. * val2 = dummy_node if val[1] == np.inf else val[1] # <<<<<<<<<<<<<<
  13704. * relation[i] = tuple((val1, val2))
  13705. * # print(relation)
  13706. */
  13707. __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13708. __Pyx_GOTREF(__pyx_t_6);
  13709. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13710. __Pyx_GOTREF(__pyx_t_7);
  13711. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13712. __Pyx_GOTREF(__pyx_t_5);
  13713. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13714. __pyx_t_7 = PyObject_RichCompare(__pyx_t_6, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13715. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13716. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13717. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13718. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13719. if (__pyx_t_8) {
  13720. __Pyx_INCREF(__pyx_v_dummy_node);
  13721. __pyx_t_3 = __pyx_v_dummy_node;
  13722. } else {
  13723. __pyx_t_7 = __Pyx_GetItemInt(__pyx_v_val, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1374, __pyx_L1_error)
  13724. __Pyx_GOTREF(__pyx_t_7);
  13725. __pyx_t_3 = __pyx_t_7;
  13726. __pyx_t_7 = 0;
  13727. }
  13728. __Pyx_XDECREF_SET(__pyx_v_val2, __pyx_t_3);
  13729. __pyx_t_3 = 0;
  13730. /* "gedlibpy.pyx":1375
  13731. * val1 = dummy_node if val[0] == np.inf else val[0]
  13732. * val2 = dummy_node if val[1] == np.inf else val[1]
  13733. * relation[i] = tuple((val1, val2)) # <<<<<<<<<<<<<<
  13734. * # print(relation)
  13735. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation)
  13736. */
  13737. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1375, __pyx_L1_error)
  13738. __Pyx_GOTREF(__pyx_t_3);
  13739. __Pyx_INCREF(__pyx_v_val1);
  13740. __Pyx_GIVEREF(__pyx_v_val1);
  13741. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val1);
  13742. __Pyx_INCREF(__pyx_v_val2);
  13743. __Pyx_GIVEREF(__pyx_v_val2);
  13744. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_val2);
  13745. if (unlikely(PyObject_SetItem(__pyx_v_relation, __pyx_v_i, __pyx_t_3) < 0)) __PYX_ERR(0, 1375, __pyx_L1_error)
  13746. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13747. /* "gedlibpy.pyx":1372
  13748. * dummy_node = get_dummy_node()
  13749. * # print(dummy_node)
  13750. * for i, val in enumerate(relation): # <<<<<<<<<<<<<<
  13751. * val1 = dummy_node if val[0] == np.inf else val[0]
  13752. * val2 = dummy_node if val[1] == np.inf else val[1]
  13753. */
  13754. }
  13755. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13756. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13757. /* "gedlibpy.pyx":1377
  13758. * relation[i] = tuple((val1, val2))
  13759. * # print(relation)
  13760. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) # <<<<<<<<<<<<<<
  13761. * node_map.set_induced_cost(induced_cost)
  13762. *
  13763. */
  13764. __pyx_t_9 = __Pyx_PyInt_As_size_t(__pyx_v_g_id); if (unlikely((__pyx_t_9 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  13765. __pyx_t_10 = __Pyx_PyInt_As_size_t(__pyx_v_h_id); if (unlikely((__pyx_t_10 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  13766. __pyx_t_11 = __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(__pyx_v_relation); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  13767. try {
  13768. __pyx_t_12 = __pyx_v_self->c_env->computeInducedCost(__pyx_t_9, __pyx_t_10, __pyx_t_11);
  13769. } catch(...) {
  13770. __Pyx_CppExn2PyErr();
  13771. __PYX_ERR(0, 1377, __pyx_L1_error)
  13772. }
  13773. __pyx_v_induced_cost = __pyx_t_12;
  13774. /* "gedlibpy.pyx":1378
  13775. * # print(relation)
  13776. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation)
  13777. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  13778. *
  13779. *
  13780. */
  13781. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1378, __pyx_L1_error)
  13782. __Pyx_GOTREF(__pyx_t_2);
  13783. __pyx_t_3 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1378, __pyx_L1_error)
  13784. __Pyx_GOTREF(__pyx_t_3);
  13785. __pyx_t_7 = NULL;
  13786. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  13787. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  13788. if (likely(__pyx_t_7)) {
  13789. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13790. __Pyx_INCREF(__pyx_t_7);
  13791. __Pyx_INCREF(function);
  13792. __Pyx_DECREF_SET(__pyx_t_2, function);
  13793. }
  13794. }
  13795. __pyx_t_1 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_7, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  13796. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13797. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13798. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
  13799. __Pyx_GOTREF(__pyx_t_1);
  13800. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13801. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13802. /* "gedlibpy.pyx":1350
  13803. *
  13804. *
  13805. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13806. * """
  13807. * Computes the edit cost between two graphs induced by a node map.
  13808. */
  13809. /* function exit code */
  13810. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13811. goto __pyx_L0;
  13812. __pyx_L1_error:;
  13813. __Pyx_XDECREF(__pyx_t_1);
  13814. __Pyx_XDECREF(__pyx_t_2);
  13815. __Pyx_XDECREF(__pyx_t_3);
  13816. __Pyx_XDECREF(__pyx_t_5);
  13817. __Pyx_XDECREF(__pyx_t_6);
  13818. __Pyx_XDECREF(__pyx_t_7);
  13819. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13820. __pyx_r = NULL;
  13821. __pyx_L0:;
  13822. __Pyx_XDECREF(__pyx_v_relation);
  13823. __Pyx_XDECREF(__pyx_v_dummy_node);
  13824. __Pyx_XDECREF(__pyx_v_i);
  13825. __Pyx_XDECREF(__pyx_v_val);
  13826. __Pyx_XDECREF(__pyx_v_val1);
  13827. __Pyx_XDECREF(__pyx_v_val2);
  13828. __Pyx_XGIVEREF(__pyx_r);
  13829. __Pyx_RefNannyFinishContext();
  13830. return __pyx_r;
  13831. }
  13832. /* "(tree fragment)":1
  13833. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13834. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13835. * def __setstate_cython__(self, __pyx_state):
  13836. */
  13837. /* Python wrapper */
  13838. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  13839. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  13840. PyObject *__pyx_r = 0;
  13841. __Pyx_RefNannyDeclarations
  13842. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  13843. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  13844. /* function exit code */
  13845. __Pyx_RefNannyFinishContext();
  13846. return __pyx_r;
  13847. }
  13848. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  13849. PyObject *__pyx_r = NULL;
  13850. __Pyx_RefNannyDeclarations
  13851. PyObject *__pyx_t_1 = NULL;
  13852. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  13853. /* "(tree fragment)":2
  13854. * def __reduce_cython__(self):
  13855. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13856. * def __setstate_cython__(self, __pyx_state):
  13857. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13858. */
  13859. __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)
  13860. __Pyx_GOTREF(__pyx_t_1);
  13861. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13862. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13863. __PYX_ERR(1, 2, __pyx_L1_error)
  13864. /* "(tree fragment)":1
  13865. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13866. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13867. * def __setstate_cython__(self, __pyx_state):
  13868. */
  13869. /* function exit code */
  13870. __pyx_L1_error:;
  13871. __Pyx_XDECREF(__pyx_t_1);
  13872. __Pyx_AddTraceback("gedlibpy.GEDEnv.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13873. __pyx_r = NULL;
  13874. __Pyx_XGIVEREF(__pyx_r);
  13875. __Pyx_RefNannyFinishContext();
  13876. return __pyx_r;
  13877. }
  13878. /* "(tree fragment)":3
  13879. * def __reduce_cython__(self):
  13880. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13881. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13882. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13883. */
  13884. /* Python wrapper */
  13885. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  13886. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  13887. PyObject *__pyx_r = 0;
  13888. __Pyx_RefNannyDeclarations
  13889. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  13890. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  13891. /* function exit code */
  13892. __Pyx_RefNannyFinishContext();
  13893. return __pyx_r;
  13894. }
  13895. 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) {
  13896. PyObject *__pyx_r = NULL;
  13897. __Pyx_RefNannyDeclarations
  13898. PyObject *__pyx_t_1 = NULL;
  13899. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  13900. /* "(tree fragment)":4
  13901. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13902. * def __setstate_cython__(self, __pyx_state):
  13903. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13904. */
  13905. __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)
  13906. __Pyx_GOTREF(__pyx_t_1);
  13907. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13908. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13909. __PYX_ERR(1, 4, __pyx_L1_error)
  13910. /* "(tree fragment)":3
  13911. * def __reduce_cython__(self):
  13912. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13913. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13914. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13915. */
  13916. /* function exit code */
  13917. __pyx_L1_error:;
  13918. __Pyx_XDECREF(__pyx_t_1);
  13919. __Pyx_AddTraceback("gedlibpy.GEDEnv.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13920. __pyx_r = NULL;
  13921. __Pyx_XGIVEREF(__pyx_r);
  13922. __Pyx_RefNannyFinishContext();
  13923. return __pyx_r;
  13924. }
  13925. /* "gedlibpy.pyx":1408
  13926. * :type message: string
  13927. * """
  13928. * def __init__(self, message): # <<<<<<<<<<<<<<
  13929. * """
  13930. * Inits the error with its message.
  13931. */
  13932. /* Python wrapper */
  13933. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13934. 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";
  13935. 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__};
  13936. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13937. PyObject *__pyx_v_self = 0;
  13938. PyObject *__pyx_v_message = 0;
  13939. PyObject *__pyx_r = 0;
  13940. __Pyx_RefNannyDeclarations
  13941. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13942. {
  13943. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13944. PyObject* values[2] = {0,0};
  13945. if (unlikely(__pyx_kwds)) {
  13946. Py_ssize_t kw_args;
  13947. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13948. switch (pos_args) {
  13949. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13950. CYTHON_FALLTHROUGH;
  13951. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13952. CYTHON_FALLTHROUGH;
  13953. case 0: break;
  13954. default: goto __pyx_L5_argtuple_error;
  13955. }
  13956. kw_args = PyDict_Size(__pyx_kwds);
  13957. switch (pos_args) {
  13958. case 0:
  13959. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13960. else goto __pyx_L5_argtuple_error;
  13961. CYTHON_FALLTHROUGH;
  13962. case 1:
  13963. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13964. else {
  13965. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1408, __pyx_L3_error)
  13966. }
  13967. }
  13968. if (unlikely(kw_args > 0)) {
  13969. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1408, __pyx_L3_error)
  13970. }
  13971. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13972. goto __pyx_L5_argtuple_error;
  13973. } else {
  13974. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13975. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13976. }
  13977. __pyx_v_self = values[0];
  13978. __pyx_v_message = values[1];
  13979. }
  13980. goto __pyx_L4_argument_unpacking_done;
  13981. __pyx_L5_argtuple_error:;
  13982. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1408, __pyx_L3_error)
  13983. __pyx_L3_error:;
  13984. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13985. __Pyx_RefNannyFinishContext();
  13986. return NULL;
  13987. __pyx_L4_argument_unpacking_done:;
  13988. __pyx_r = __pyx_pf_8gedlibpy_13EditCostError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13989. /* function exit code */
  13990. __Pyx_RefNannyFinishContext();
  13991. return __pyx_r;
  13992. }
  13993. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13994. PyObject *__pyx_r = NULL;
  13995. __Pyx_RefNannyDeclarations
  13996. __Pyx_RefNannySetupContext("__init__", 0);
  13997. /* "gedlibpy.pyx":1415
  13998. * :type message: string
  13999. * """
  14000. * self.message = message # <<<<<<<<<<<<<<
  14001. *
  14002. *
  14003. */
  14004. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1415, __pyx_L1_error)
  14005. /* "gedlibpy.pyx":1408
  14006. * :type message: string
  14007. * """
  14008. * def __init__(self, message): # <<<<<<<<<<<<<<
  14009. * """
  14010. * Inits the error with its message.
  14011. */
  14012. /* function exit code */
  14013. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14014. goto __pyx_L0;
  14015. __pyx_L1_error:;
  14016. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14017. __pyx_r = NULL;
  14018. __pyx_L0:;
  14019. __Pyx_XGIVEREF(__pyx_r);
  14020. __Pyx_RefNannyFinishContext();
  14021. return __pyx_r;
  14022. }
  14023. /* "gedlibpy.pyx":1425
  14024. * :type message: string
  14025. * """
  14026. * def __init__(self, message): # <<<<<<<<<<<<<<
  14027. * """
  14028. * Inits the error with its message.
  14029. */
  14030. /* Python wrapper */
  14031. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  14032. 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";
  14033. 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__};
  14034. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  14035. PyObject *__pyx_v_self = 0;
  14036. PyObject *__pyx_v_message = 0;
  14037. PyObject *__pyx_r = 0;
  14038. __Pyx_RefNannyDeclarations
  14039. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  14040. {
  14041. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  14042. PyObject* values[2] = {0,0};
  14043. if (unlikely(__pyx_kwds)) {
  14044. Py_ssize_t kw_args;
  14045. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  14046. switch (pos_args) {
  14047. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14048. CYTHON_FALLTHROUGH;
  14049. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14050. CYTHON_FALLTHROUGH;
  14051. case 0: break;
  14052. default: goto __pyx_L5_argtuple_error;
  14053. }
  14054. kw_args = PyDict_Size(__pyx_kwds);
  14055. switch (pos_args) {
  14056. case 0:
  14057. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  14058. else goto __pyx_L5_argtuple_error;
  14059. CYTHON_FALLTHROUGH;
  14060. case 1:
  14061. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  14062. else {
  14063. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1425, __pyx_L3_error)
  14064. }
  14065. }
  14066. if (unlikely(kw_args > 0)) {
  14067. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1425, __pyx_L3_error)
  14068. }
  14069. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  14070. goto __pyx_L5_argtuple_error;
  14071. } else {
  14072. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14073. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14074. }
  14075. __pyx_v_self = values[0];
  14076. __pyx_v_message = values[1];
  14077. }
  14078. goto __pyx_L4_argument_unpacking_done;
  14079. __pyx_L5_argtuple_error:;
  14080. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1425, __pyx_L3_error)
  14081. __pyx_L3_error:;
  14082. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14083. __Pyx_RefNannyFinishContext();
  14084. return NULL;
  14085. __pyx_L4_argument_unpacking_done:;
  14086. __pyx_r = __pyx_pf_8gedlibpy_11MethodError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  14087. /* function exit code */
  14088. __Pyx_RefNannyFinishContext();
  14089. return __pyx_r;
  14090. }
  14091. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  14092. PyObject *__pyx_r = NULL;
  14093. __Pyx_RefNannyDeclarations
  14094. __Pyx_RefNannySetupContext("__init__", 0);
  14095. /* "gedlibpy.pyx":1432
  14096. * :type message: string
  14097. * """
  14098. * self.message = message # <<<<<<<<<<<<<<
  14099. *
  14100. *
  14101. */
  14102. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1432, __pyx_L1_error)
  14103. /* "gedlibpy.pyx":1425
  14104. * :type message: string
  14105. * """
  14106. * def __init__(self, message): # <<<<<<<<<<<<<<
  14107. * """
  14108. * Inits the error with its message.
  14109. */
  14110. /* function exit code */
  14111. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14112. goto __pyx_L0;
  14113. __pyx_L1_error:;
  14114. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14115. __pyx_r = NULL;
  14116. __pyx_L0:;
  14117. __Pyx_XGIVEREF(__pyx_r);
  14118. __Pyx_RefNannyFinishContext();
  14119. return __pyx_r;
  14120. }
  14121. /* "gedlibpy.pyx":1442
  14122. * :type message: string
  14123. * """
  14124. * def __init__(self, message): # <<<<<<<<<<<<<<
  14125. * """
  14126. * Inits the error with its message.
  14127. */
  14128. /* Python wrapper */
  14129. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  14130. 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";
  14131. 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__};
  14132. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  14133. PyObject *__pyx_v_self = 0;
  14134. PyObject *__pyx_v_message = 0;
  14135. PyObject *__pyx_r = 0;
  14136. __Pyx_RefNannyDeclarations
  14137. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  14138. {
  14139. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  14140. PyObject* values[2] = {0,0};
  14141. if (unlikely(__pyx_kwds)) {
  14142. Py_ssize_t kw_args;
  14143. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  14144. switch (pos_args) {
  14145. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14146. CYTHON_FALLTHROUGH;
  14147. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14148. CYTHON_FALLTHROUGH;
  14149. case 0: break;
  14150. default: goto __pyx_L5_argtuple_error;
  14151. }
  14152. kw_args = PyDict_Size(__pyx_kwds);
  14153. switch (pos_args) {
  14154. case 0:
  14155. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  14156. else goto __pyx_L5_argtuple_error;
  14157. CYTHON_FALLTHROUGH;
  14158. case 1:
  14159. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  14160. else {
  14161. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1442, __pyx_L3_error)
  14162. }
  14163. }
  14164. if (unlikely(kw_args > 0)) {
  14165. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1442, __pyx_L3_error)
  14166. }
  14167. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  14168. goto __pyx_L5_argtuple_error;
  14169. } else {
  14170. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14171. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14172. }
  14173. __pyx_v_self = values[0];
  14174. __pyx_v_message = values[1];
  14175. }
  14176. goto __pyx_L4_argument_unpacking_done;
  14177. __pyx_L5_argtuple_error:;
  14178. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1442, __pyx_L3_error)
  14179. __pyx_L3_error:;
  14180. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14181. __Pyx_RefNannyFinishContext();
  14182. return NULL;
  14183. __pyx_L4_argument_unpacking_done:;
  14184. __pyx_r = __pyx_pf_8gedlibpy_9InitError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  14185. /* function exit code */
  14186. __Pyx_RefNannyFinishContext();
  14187. return __pyx_r;
  14188. }
  14189. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  14190. PyObject *__pyx_r = NULL;
  14191. __Pyx_RefNannyDeclarations
  14192. __Pyx_RefNannySetupContext("__init__", 0);
  14193. /* "gedlibpy.pyx":1449
  14194. * :type message: string
  14195. * """
  14196. * self.message = message # <<<<<<<<<<<<<<
  14197. *
  14198. *
  14199. */
  14200. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1449, __pyx_L1_error)
  14201. /* "gedlibpy.pyx":1442
  14202. * :type message: string
  14203. * """
  14204. * def __init__(self, message): # <<<<<<<<<<<<<<
  14205. * """
  14206. * Inits the error with its message.
  14207. */
  14208. /* function exit code */
  14209. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14210. goto __pyx_L0;
  14211. __pyx_L1_error:;
  14212. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14213. __pyx_r = NULL;
  14214. __pyx_L0:;
  14215. __Pyx_XGIVEREF(__pyx_r);
  14216. __Pyx_RefNannyFinishContext();
  14217. return __pyx_r;
  14218. }
  14219. /* "gedlibpy.pyx":1456
  14220. * #########################################
  14221. *
  14222. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14223. * """
  14224. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14225. */
  14226. /* Python wrapper */
  14227. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u); /*proto*/
  14228. 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";
  14229. 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};
  14230. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14231. PyObject *__pyx_r = 0;
  14232. __Pyx_RefNannyDeclarations
  14233. __Pyx_RefNannySetupContext("encode_your_map (wrapper)", 0);
  14234. __pyx_r = __pyx_pf_8gedlibpy_8encode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_u));
  14235. /* function exit code */
  14236. __Pyx_RefNannyFinishContext();
  14237. return __pyx_r;
  14238. }
  14239. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14240. PyObject *__pyx_v_res = NULL;
  14241. PyObject *__pyx_v_key = NULL;
  14242. PyObject *__pyx_v_value = NULL;
  14243. PyObject *__pyx_r = NULL;
  14244. __Pyx_RefNannyDeclarations
  14245. PyObject *__pyx_t_1 = NULL;
  14246. Py_ssize_t __pyx_t_2;
  14247. Py_ssize_t __pyx_t_3;
  14248. int __pyx_t_4;
  14249. PyObject *__pyx_t_5 = NULL;
  14250. PyObject *__pyx_t_6 = NULL;
  14251. int __pyx_t_7;
  14252. PyObject *__pyx_t_8 = NULL;
  14253. PyObject *__pyx_t_9 = NULL;
  14254. __Pyx_RefNannySetupContext("encode_your_map", 0);
  14255. /* "gedlibpy.pyx":1468
  14256. *
  14257. * """
  14258. * res = {} # <<<<<<<<<<<<<<
  14259. * for key, value in map_u.items():
  14260. * res[key.encode('utf-8')] = value.encode('utf-8')
  14261. */
  14262. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1468, __pyx_L1_error)
  14263. __Pyx_GOTREF(__pyx_t_1);
  14264. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14265. __pyx_t_1 = 0;
  14266. /* "gedlibpy.pyx":1469
  14267. * """
  14268. * res = {}
  14269. * for key, value in map_u.items(): # <<<<<<<<<<<<<<
  14270. * res[key.encode('utf-8')] = value.encode('utf-8')
  14271. * return res
  14272. */
  14273. __pyx_t_2 = 0;
  14274. if (unlikely(__pyx_v_map_u == Py_None)) {
  14275. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14276. __PYX_ERR(0, 1469, __pyx_L1_error)
  14277. }
  14278. __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, 1469, __pyx_L1_error)
  14279. __Pyx_GOTREF(__pyx_t_5);
  14280. __Pyx_XDECREF(__pyx_t_1);
  14281. __pyx_t_1 = __pyx_t_5;
  14282. __pyx_t_5 = 0;
  14283. while (1) {
  14284. __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);
  14285. if (unlikely(__pyx_t_7 == 0)) break;
  14286. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1469, __pyx_L1_error)
  14287. __Pyx_GOTREF(__pyx_t_5);
  14288. __Pyx_GOTREF(__pyx_t_6);
  14289. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14290. __pyx_t_5 = 0;
  14291. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14292. __pyx_t_6 = 0;
  14293. /* "gedlibpy.pyx":1470
  14294. * res = {}
  14295. * for key, value in map_u.items():
  14296. * res[key.encode('utf-8')] = value.encode('utf-8') # <<<<<<<<<<<<<<
  14297. * return res
  14298. *
  14299. */
  14300. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14301. __Pyx_GOTREF(__pyx_t_5);
  14302. __pyx_t_8 = NULL;
  14303. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14304. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14305. if (likely(__pyx_t_8)) {
  14306. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14307. __Pyx_INCREF(__pyx_t_8);
  14308. __Pyx_INCREF(function);
  14309. __Pyx_DECREF_SET(__pyx_t_5, function);
  14310. }
  14311. }
  14312. __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);
  14313. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14314. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14315. __Pyx_GOTREF(__pyx_t_6);
  14316. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14317. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14318. __Pyx_GOTREF(__pyx_t_8);
  14319. __pyx_t_9 = NULL;
  14320. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14321. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14322. if (likely(__pyx_t_9)) {
  14323. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14324. __Pyx_INCREF(__pyx_t_9);
  14325. __Pyx_INCREF(function);
  14326. __Pyx_DECREF_SET(__pyx_t_8, function);
  14327. }
  14328. }
  14329. __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);
  14330. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14331. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14332. __Pyx_GOTREF(__pyx_t_5);
  14333. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14334. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1470, __pyx_L1_error)
  14335. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14336. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14337. }
  14338. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14339. /* "gedlibpy.pyx":1471
  14340. * for key, value in map_u.items():
  14341. * res[key.encode('utf-8')] = value.encode('utf-8')
  14342. * return res # <<<<<<<<<<<<<<
  14343. *
  14344. *
  14345. */
  14346. __Pyx_XDECREF(__pyx_r);
  14347. __Pyx_INCREF(__pyx_v_res);
  14348. __pyx_r = __pyx_v_res;
  14349. goto __pyx_L0;
  14350. /* "gedlibpy.pyx":1456
  14351. * #########################################
  14352. *
  14353. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14354. * """
  14355. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14356. */
  14357. /* function exit code */
  14358. __pyx_L1_error:;
  14359. __Pyx_XDECREF(__pyx_t_1);
  14360. __Pyx_XDECREF(__pyx_t_5);
  14361. __Pyx_XDECREF(__pyx_t_6);
  14362. __Pyx_XDECREF(__pyx_t_8);
  14363. __Pyx_XDECREF(__pyx_t_9);
  14364. __Pyx_AddTraceback("gedlibpy.encode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14365. __pyx_r = NULL;
  14366. __pyx_L0:;
  14367. __Pyx_XDECREF(__pyx_v_res);
  14368. __Pyx_XDECREF(__pyx_v_key);
  14369. __Pyx_XDECREF(__pyx_v_value);
  14370. __Pyx_XGIVEREF(__pyx_r);
  14371. __Pyx_RefNannyFinishContext();
  14372. return __pyx_r;
  14373. }
  14374. /* "gedlibpy.pyx":1474
  14375. *
  14376. *
  14377. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14378. * """
  14379. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14380. */
  14381. /* Python wrapper */
  14382. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b); /*proto*/
  14383. 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";
  14384. 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};
  14385. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14386. PyObject *__pyx_r = 0;
  14387. __Pyx_RefNannyDeclarations
  14388. __Pyx_RefNannySetupContext("decode_your_map (wrapper)", 0);
  14389. __pyx_r = __pyx_pf_8gedlibpy_10decode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_b));
  14390. /* function exit code */
  14391. __Pyx_RefNannyFinishContext();
  14392. return __pyx_r;
  14393. }
  14394. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14395. PyObject *__pyx_v_res = NULL;
  14396. PyObject *__pyx_v_key = NULL;
  14397. PyObject *__pyx_v_value = NULL;
  14398. PyObject *__pyx_r = NULL;
  14399. __Pyx_RefNannyDeclarations
  14400. PyObject *__pyx_t_1 = NULL;
  14401. Py_ssize_t __pyx_t_2;
  14402. Py_ssize_t __pyx_t_3;
  14403. int __pyx_t_4;
  14404. PyObject *__pyx_t_5 = NULL;
  14405. PyObject *__pyx_t_6 = NULL;
  14406. int __pyx_t_7;
  14407. PyObject *__pyx_t_8 = NULL;
  14408. PyObject *__pyx_t_9 = NULL;
  14409. __Pyx_RefNannySetupContext("decode_your_map", 0);
  14410. /* "gedlibpy.pyx":1486
  14411. *
  14412. * """
  14413. * res = {} # <<<<<<<<<<<<<<
  14414. * for key, value in map_b.items():
  14415. * res[key.decode('utf-8')] = value.decode('utf-8')
  14416. */
  14417. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1486, __pyx_L1_error)
  14418. __Pyx_GOTREF(__pyx_t_1);
  14419. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14420. __pyx_t_1 = 0;
  14421. /* "gedlibpy.pyx":1487
  14422. * """
  14423. * res = {}
  14424. * for key, value in map_b.items(): # <<<<<<<<<<<<<<
  14425. * res[key.decode('utf-8')] = value.decode('utf-8')
  14426. * return res
  14427. */
  14428. __pyx_t_2 = 0;
  14429. if (unlikely(__pyx_v_map_b == Py_None)) {
  14430. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14431. __PYX_ERR(0, 1487, __pyx_L1_error)
  14432. }
  14433. __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, 1487, __pyx_L1_error)
  14434. __Pyx_GOTREF(__pyx_t_5);
  14435. __Pyx_XDECREF(__pyx_t_1);
  14436. __pyx_t_1 = __pyx_t_5;
  14437. __pyx_t_5 = 0;
  14438. while (1) {
  14439. __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);
  14440. if (unlikely(__pyx_t_7 == 0)) break;
  14441. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1487, __pyx_L1_error)
  14442. __Pyx_GOTREF(__pyx_t_5);
  14443. __Pyx_GOTREF(__pyx_t_6);
  14444. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14445. __pyx_t_5 = 0;
  14446. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14447. __pyx_t_6 = 0;
  14448. /* "gedlibpy.pyx":1488
  14449. * res = {}
  14450. * for key, value in map_b.items():
  14451. * res[key.decode('utf-8')] = value.decode('utf-8') # <<<<<<<<<<<<<<
  14452. * return res
  14453. *
  14454. */
  14455. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1488, __pyx_L1_error)
  14456. __Pyx_GOTREF(__pyx_t_5);
  14457. __pyx_t_8 = NULL;
  14458. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14459. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14460. if (likely(__pyx_t_8)) {
  14461. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14462. __Pyx_INCREF(__pyx_t_8);
  14463. __Pyx_INCREF(function);
  14464. __Pyx_DECREF_SET(__pyx_t_5, function);
  14465. }
  14466. }
  14467. __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);
  14468. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14469. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1488, __pyx_L1_error)
  14470. __Pyx_GOTREF(__pyx_t_6);
  14471. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14472. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1488, __pyx_L1_error)
  14473. __Pyx_GOTREF(__pyx_t_8);
  14474. __pyx_t_9 = NULL;
  14475. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14476. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14477. if (likely(__pyx_t_9)) {
  14478. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14479. __Pyx_INCREF(__pyx_t_9);
  14480. __Pyx_INCREF(function);
  14481. __Pyx_DECREF_SET(__pyx_t_8, function);
  14482. }
  14483. }
  14484. __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);
  14485. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14486. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1488, __pyx_L1_error)
  14487. __Pyx_GOTREF(__pyx_t_5);
  14488. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14489. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1488, __pyx_L1_error)
  14490. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14491. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14492. }
  14493. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14494. /* "gedlibpy.pyx":1489
  14495. * for key, value in map_b.items():
  14496. * res[key.decode('utf-8')] = value.decode('utf-8')
  14497. * return res # <<<<<<<<<<<<<<
  14498. *
  14499. *
  14500. */
  14501. __Pyx_XDECREF(__pyx_r);
  14502. __Pyx_INCREF(__pyx_v_res);
  14503. __pyx_r = __pyx_v_res;
  14504. goto __pyx_L0;
  14505. /* "gedlibpy.pyx":1474
  14506. *
  14507. *
  14508. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14509. * """
  14510. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14511. */
  14512. /* function exit code */
  14513. __pyx_L1_error:;
  14514. __Pyx_XDECREF(__pyx_t_1);
  14515. __Pyx_XDECREF(__pyx_t_5);
  14516. __Pyx_XDECREF(__pyx_t_6);
  14517. __Pyx_XDECREF(__pyx_t_8);
  14518. __Pyx_XDECREF(__pyx_t_9);
  14519. __Pyx_AddTraceback("gedlibpy.decode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14520. __pyx_r = NULL;
  14521. __pyx_L0:;
  14522. __Pyx_XDECREF(__pyx_v_res);
  14523. __Pyx_XDECREF(__pyx_v_key);
  14524. __Pyx_XDECREF(__pyx_v_value);
  14525. __Pyx_XGIVEREF(__pyx_r);
  14526. __Pyx_RefNannyFinishContext();
  14527. return __pyx_r;
  14528. }
  14529. /* "gedlibpy.pyx":1492
  14530. *
  14531. *
  14532. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14533. * """
  14534. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14535. */
  14536. /* Python wrapper */
  14537. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /*proto*/
  14538. 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";
  14539. 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};
  14540. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14541. PyObject *__pyx_r = 0;
  14542. __Pyx_RefNannyDeclarations
  14543. __Pyx_RefNannySetupContext("decode_graph_edges (wrapper)", 0);
  14544. __pyx_r = __pyx_pf_8gedlibpy_12decode_graph_edges(__pyx_self, ((PyObject *)__pyx_v_map_edge_b));
  14545. /* function exit code */
  14546. __Pyx_RefNannyFinishContext();
  14547. return __pyx_r;
  14548. }
  14549. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14550. PyObject *__pyx_v_map_edges = NULL;
  14551. PyObject *__pyx_v_key = NULL;
  14552. PyObject *__pyx_v_value = NULL;
  14553. PyObject *__pyx_r = NULL;
  14554. __Pyx_RefNannyDeclarations
  14555. PyObject *__pyx_t_1 = NULL;
  14556. Py_ssize_t __pyx_t_2;
  14557. Py_ssize_t __pyx_t_3;
  14558. int __pyx_t_4;
  14559. PyObject *__pyx_t_5 = NULL;
  14560. PyObject *__pyx_t_6 = NULL;
  14561. int __pyx_t_7;
  14562. PyObject *__pyx_t_8 = NULL;
  14563. __Pyx_RefNannySetupContext("decode_graph_edges", 0);
  14564. /* "gedlibpy.pyx":1510
  14565. * This is a helper function for function `GEDEnv.get_graph_edges()`.
  14566. * """
  14567. * map_edges = {} # <<<<<<<<<<<<<<
  14568. * for key, value in map_edge_b.items():
  14569. * map_edges[key] = decode_your_map(value)
  14570. */
  14571. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1510, __pyx_L1_error)
  14572. __Pyx_GOTREF(__pyx_t_1);
  14573. __pyx_v_map_edges = ((PyObject*)__pyx_t_1);
  14574. __pyx_t_1 = 0;
  14575. /* "gedlibpy.pyx":1511
  14576. * """
  14577. * map_edges = {}
  14578. * for key, value in map_edge_b.items(): # <<<<<<<<<<<<<<
  14579. * map_edges[key] = decode_your_map(value)
  14580. * return map_edges
  14581. */
  14582. __pyx_t_2 = 0;
  14583. if (unlikely(__pyx_v_map_edge_b == Py_None)) {
  14584. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14585. __PYX_ERR(0, 1511, __pyx_L1_error)
  14586. }
  14587. __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, 1511, __pyx_L1_error)
  14588. __Pyx_GOTREF(__pyx_t_5);
  14589. __Pyx_XDECREF(__pyx_t_1);
  14590. __pyx_t_1 = __pyx_t_5;
  14591. __pyx_t_5 = 0;
  14592. while (1) {
  14593. __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);
  14594. if (unlikely(__pyx_t_7 == 0)) break;
  14595. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1511, __pyx_L1_error)
  14596. __Pyx_GOTREF(__pyx_t_5);
  14597. __Pyx_GOTREF(__pyx_t_6);
  14598. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14599. __pyx_t_5 = 0;
  14600. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14601. __pyx_t_6 = 0;
  14602. /* "gedlibpy.pyx":1512
  14603. * map_edges = {}
  14604. * for key, value in map_edge_b.items():
  14605. * map_edges[key] = decode_your_map(value) # <<<<<<<<<<<<<<
  14606. * return map_edges
  14607. *
  14608. */
  14609. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1512, __pyx_L1_error)
  14610. __Pyx_GOTREF(__pyx_t_5);
  14611. __pyx_t_8 = NULL;
  14612. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
  14613. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14614. if (likely(__pyx_t_8)) {
  14615. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14616. __Pyx_INCREF(__pyx_t_8);
  14617. __Pyx_INCREF(function);
  14618. __Pyx_DECREF_SET(__pyx_t_5, function);
  14619. }
  14620. }
  14621. __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);
  14622. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14623. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1512, __pyx_L1_error)
  14624. __Pyx_GOTREF(__pyx_t_6);
  14625. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14626. if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1512, __pyx_L1_error)
  14627. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14628. }
  14629. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14630. /* "gedlibpy.pyx":1513
  14631. * for key, value in map_edge_b.items():
  14632. * map_edges[key] = decode_your_map(value)
  14633. * return map_edges # <<<<<<<<<<<<<<
  14634. *
  14635. *
  14636. */
  14637. __Pyx_XDECREF(__pyx_r);
  14638. __Pyx_INCREF(__pyx_v_map_edges);
  14639. __pyx_r = __pyx_v_map_edges;
  14640. goto __pyx_L0;
  14641. /* "gedlibpy.pyx":1492
  14642. *
  14643. *
  14644. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14645. * """
  14646. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14647. */
  14648. /* function exit code */
  14649. __pyx_L1_error:;
  14650. __Pyx_XDECREF(__pyx_t_1);
  14651. __Pyx_XDECREF(__pyx_t_5);
  14652. __Pyx_XDECREF(__pyx_t_6);
  14653. __Pyx_XDECREF(__pyx_t_8);
  14654. __Pyx_AddTraceback("gedlibpy.decode_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14655. __pyx_r = NULL;
  14656. __pyx_L0:;
  14657. __Pyx_XDECREF(__pyx_v_map_edges);
  14658. __Pyx_XDECREF(__pyx_v_key);
  14659. __Pyx_XDECREF(__pyx_v_value);
  14660. __Pyx_XGIVEREF(__pyx_r);
  14661. __Pyx_RefNannyFinishContext();
  14662. return __pyx_r;
  14663. }
  14664. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  14665. * # experimental exception made for __getbuffer__ and __releasebuffer__
  14666. * # -- the details of this may change.
  14667. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  14668. * # This implementation of getbuffer is geared towards Cython
  14669. * # requirements, and does not yet fulfill the PEP.
  14670. */
  14671. /* Python wrapper */
  14672. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  14673. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14674. int __pyx_r;
  14675. __Pyx_RefNannyDeclarations
  14676. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  14677. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  14678. /* function exit code */
  14679. __Pyx_RefNannyFinishContext();
  14680. return __pyx_r;
  14681. }
  14682. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14683. int __pyx_v_i;
  14684. int __pyx_v_ndim;
  14685. int __pyx_v_endian_detector;
  14686. int __pyx_v_little_endian;
  14687. int __pyx_v_t;
  14688. char *__pyx_v_f;
  14689. PyArray_Descr *__pyx_v_descr = 0;
  14690. int __pyx_v_offset;
  14691. int __pyx_r;
  14692. __Pyx_RefNannyDeclarations
  14693. int __pyx_t_1;
  14694. int __pyx_t_2;
  14695. PyObject *__pyx_t_3 = NULL;
  14696. int __pyx_t_4;
  14697. int __pyx_t_5;
  14698. int __pyx_t_6;
  14699. PyArray_Descr *__pyx_t_7;
  14700. PyObject *__pyx_t_8 = NULL;
  14701. char *__pyx_t_9;
  14702. if (__pyx_v_info == NULL) {
  14703. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  14704. return -1;
  14705. }
  14706. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  14707. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  14708. __Pyx_GIVEREF(__pyx_v_info->obj);
  14709. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
  14710. *
  14711. * cdef int i, ndim
  14712. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  14713. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14714. *
  14715. */
  14716. __pyx_v_endian_detector = 1;
  14717. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
  14718. * cdef int i, ndim
  14719. * cdef int endian_detector = 1
  14720. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  14721. *
  14722. * ndim = PyArray_NDIM(self)
  14723. */
  14724. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  14725. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
  14726. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14727. *
  14728. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  14729. *
  14730. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14731. */
  14732. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  14733. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14734. * ndim = PyArray_NDIM(self)
  14735. *
  14736. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14737. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14738. * raise ValueError(u"ndarray is not C contiguous")
  14739. */
  14740. __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  14741. if (__pyx_t_2) {
  14742. } else {
  14743. __pyx_t_1 = __pyx_t_2;
  14744. goto __pyx_L4_bool_binop_done;
  14745. }
  14746. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
  14747. *
  14748. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14749. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14750. * raise ValueError(u"ndarray is not C contiguous")
  14751. *
  14752. */
  14753. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  14754. __pyx_t_1 = __pyx_t_2;
  14755. __pyx_L4_bool_binop_done:;
  14756. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14757. * ndim = PyArray_NDIM(self)
  14758. *
  14759. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14760. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14761. * raise ValueError(u"ndarray is not C contiguous")
  14762. */
  14763. if (unlikely(__pyx_t_1)) {
  14764. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  14765. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14766. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14767. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  14768. *
  14769. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14770. */
  14771. __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)
  14772. __Pyx_GOTREF(__pyx_t_3);
  14773. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14774. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14775. __PYX_ERR(2, 272, __pyx_L1_error)
  14776. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14777. * ndim = PyArray_NDIM(self)
  14778. *
  14779. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14780. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14781. * raise ValueError(u"ndarray is not C contiguous")
  14782. */
  14783. }
  14784. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14785. * raise ValueError(u"ndarray is not C contiguous")
  14786. *
  14787. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14788. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14789. * raise ValueError(u"ndarray is not Fortran contiguous")
  14790. */
  14791. __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  14792. if (__pyx_t_2) {
  14793. } else {
  14794. __pyx_t_1 = __pyx_t_2;
  14795. goto __pyx_L7_bool_binop_done;
  14796. }
  14797. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
  14798. *
  14799. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14800. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14801. * raise ValueError(u"ndarray is not Fortran contiguous")
  14802. *
  14803. */
  14804. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  14805. __pyx_t_1 = __pyx_t_2;
  14806. __pyx_L7_bool_binop_done:;
  14807. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14808. * raise ValueError(u"ndarray is not C contiguous")
  14809. *
  14810. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14811. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14812. * raise ValueError(u"ndarray is not Fortran contiguous")
  14813. */
  14814. if (unlikely(__pyx_t_1)) {
  14815. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  14816. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14817. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14818. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  14819. *
  14820. * info.buf = PyArray_DATA(self)
  14821. */
  14822. __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)
  14823. __Pyx_GOTREF(__pyx_t_3);
  14824. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14825. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14826. __PYX_ERR(2, 276, __pyx_L1_error)
  14827. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14828. * raise ValueError(u"ndarray is not C contiguous")
  14829. *
  14830. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14831. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14832. * raise ValueError(u"ndarray is not Fortran contiguous")
  14833. */
  14834. }
  14835. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
  14836. * raise ValueError(u"ndarray is not Fortran contiguous")
  14837. *
  14838. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  14839. * info.ndim = ndim
  14840. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14841. */
  14842. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  14843. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
  14844. *
  14845. * info.buf = PyArray_DATA(self)
  14846. * info.ndim = ndim # <<<<<<<<<<<<<<
  14847. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14848. * # Allocate new buffer for strides and shape info.
  14849. */
  14850. __pyx_v_info->ndim = __pyx_v_ndim;
  14851. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14852. * info.buf = PyArray_DATA(self)
  14853. * info.ndim = ndim
  14854. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14855. * # Allocate new buffer for strides and shape info.
  14856. * # This is allocated as one block, strides first.
  14857. */
  14858. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  14859. if (__pyx_t_1) {
  14860. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
  14861. * # Allocate new buffer for strides and shape info.
  14862. * # This is allocated as one block, strides first.
  14863. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
  14864. * info.shape = info.strides + ndim
  14865. * for i in range(ndim):
  14866. */
  14867. __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
  14868. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
  14869. * # This is allocated as one block, strides first.
  14870. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14871. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  14872. * for i in range(ndim):
  14873. * info.strides[i] = PyArray_STRIDES(self)[i]
  14874. */
  14875. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  14876. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
  14877. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14878. * info.shape = info.strides + ndim
  14879. * for i in range(ndim): # <<<<<<<<<<<<<<
  14880. * info.strides[i] = PyArray_STRIDES(self)[i]
  14881. * info.shape[i] = PyArray_DIMS(self)[i]
  14882. */
  14883. __pyx_t_4 = __pyx_v_ndim;
  14884. __pyx_t_5 = __pyx_t_4;
  14885. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  14886. __pyx_v_i = __pyx_t_6;
  14887. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
  14888. * info.shape = info.strides + ndim
  14889. * for i in range(ndim):
  14890. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  14891. * info.shape[i] = PyArray_DIMS(self)[i]
  14892. * else:
  14893. */
  14894. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  14895. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
  14896. * for i in range(ndim):
  14897. * info.strides[i] = PyArray_STRIDES(self)[i]
  14898. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  14899. * else:
  14900. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14901. */
  14902. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  14903. }
  14904. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14905. * info.buf = PyArray_DATA(self)
  14906. * info.ndim = ndim
  14907. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14908. * # Allocate new buffer for strides and shape info.
  14909. * # This is allocated as one block, strides first.
  14910. */
  14911. goto __pyx_L9;
  14912. }
  14913. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
  14914. * info.shape[i] = PyArray_DIMS(self)[i]
  14915. * else:
  14916. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  14917. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14918. * info.suboffsets = NULL
  14919. */
  14920. /*else*/ {
  14921. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  14922. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
  14923. * else:
  14924. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14925. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  14926. * info.suboffsets = NULL
  14927. * info.itemsize = PyArray_ITEMSIZE(self)
  14928. */
  14929. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  14930. }
  14931. __pyx_L9:;
  14932. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
  14933. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14934. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14935. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  14936. * info.itemsize = PyArray_ITEMSIZE(self)
  14937. * info.readonly = not PyArray_ISWRITEABLE(self)
  14938. */
  14939. __pyx_v_info->suboffsets = NULL;
  14940. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
  14941. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14942. * info.suboffsets = NULL
  14943. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  14944. * info.readonly = not PyArray_ISWRITEABLE(self)
  14945. *
  14946. */
  14947. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  14948. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
  14949. * info.suboffsets = NULL
  14950. * info.itemsize = PyArray_ITEMSIZE(self)
  14951. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  14952. *
  14953. * cdef int t
  14954. */
  14955. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  14956. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
  14957. *
  14958. * cdef int t
  14959. * cdef char* f = NULL # <<<<<<<<<<<<<<
  14960. * cdef dtype descr = <dtype>PyArray_DESCR(self)
  14961. * cdef int offset
  14962. */
  14963. __pyx_v_f = NULL;
  14964. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
  14965. * cdef int t
  14966. * cdef char* f = NULL
  14967. * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
  14968. * cdef int offset
  14969. *
  14970. */
  14971. __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  14972. __pyx_t_3 = ((PyObject *)__pyx_t_7);
  14973. __Pyx_INCREF(__pyx_t_3);
  14974. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  14975. __pyx_t_3 = 0;
  14976. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
  14977. * cdef int offset
  14978. *
  14979. * info.obj = self # <<<<<<<<<<<<<<
  14980. *
  14981. * if not PyDataType_HASFIELDS(descr):
  14982. */
  14983. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  14984. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  14985. __Pyx_GOTREF(__pyx_v_info->obj);
  14986. __Pyx_DECREF(__pyx_v_info->obj);
  14987. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  14988. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  14989. * info.obj = self
  14990. *
  14991. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  14992. * t = descr.type_num
  14993. * if ((descr.byteorder == c'>' and little_endian) or
  14994. */
  14995. __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  14996. if (__pyx_t_1) {
  14997. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
  14998. *
  14999. * if not PyDataType_HASFIELDS(descr):
  15000. * t = descr.type_num # <<<<<<<<<<<<<<
  15001. * if ((descr.byteorder == c'>' and little_endian) or
  15002. * (descr.byteorder == c'<' and not little_endian)):
  15003. */
  15004. __pyx_t_4 = __pyx_v_descr->type_num;
  15005. __pyx_v_t = __pyx_t_4;
  15006. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15007. * if not PyDataType_HASFIELDS(descr):
  15008. * t = descr.type_num
  15009. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15010. * (descr.byteorder == c'<' and not little_endian)):
  15011. * raise ValueError(u"Non-native byte order not supported")
  15012. */
  15013. __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
  15014. if (!__pyx_t_2) {
  15015. goto __pyx_L15_next_or;
  15016. } else {
  15017. }
  15018. __pyx_t_2 = (__pyx_v_little_endian != 0);
  15019. if (!__pyx_t_2) {
  15020. } else {
  15021. __pyx_t_1 = __pyx_t_2;
  15022. goto __pyx_L14_bool_binop_done;
  15023. }
  15024. __pyx_L15_next_or:;
  15025. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
  15026. * t = descr.type_num
  15027. * if ((descr.byteorder == c'>' and little_endian) or
  15028. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15029. * raise ValueError(u"Non-native byte order not supported")
  15030. * if t == NPY_BYTE: f = "b"
  15031. */
  15032. __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
  15033. if (__pyx_t_2) {
  15034. } else {
  15035. __pyx_t_1 = __pyx_t_2;
  15036. goto __pyx_L14_bool_binop_done;
  15037. }
  15038. __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
  15039. __pyx_t_1 = __pyx_t_2;
  15040. __pyx_L14_bool_binop_done:;
  15041. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15042. * if not PyDataType_HASFIELDS(descr):
  15043. * t = descr.type_num
  15044. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15045. * (descr.byteorder == c'<' and not little_endian)):
  15046. * raise ValueError(u"Non-native byte order not supported")
  15047. */
  15048. if (unlikely(__pyx_t_1)) {
  15049. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  15050. * if ((descr.byteorder == c'>' and little_endian) or
  15051. * (descr.byteorder == c'<' and not little_endian)):
  15052. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15053. * if t == NPY_BYTE: f = "b"
  15054. * elif t == NPY_UBYTE: f = "B"
  15055. */
  15056. __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)
  15057. __Pyx_GOTREF(__pyx_t_3);
  15058. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15059. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15060. __PYX_ERR(2, 306, __pyx_L1_error)
  15061. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15062. * if not PyDataType_HASFIELDS(descr):
  15063. * t = descr.type_num
  15064. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15065. * (descr.byteorder == c'<' and not little_endian)):
  15066. * raise ValueError(u"Non-native byte order not supported")
  15067. */
  15068. }
  15069. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
  15070. * (descr.byteorder == c'<' and not little_endian)):
  15071. * raise ValueError(u"Non-native byte order not supported")
  15072. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  15073. * elif t == NPY_UBYTE: f = "B"
  15074. * elif t == NPY_SHORT: f = "h"
  15075. */
  15076. switch (__pyx_v_t) {
  15077. case NPY_BYTE:
  15078. __pyx_v_f = ((char *)"b");
  15079. break;
  15080. case NPY_UBYTE:
  15081. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
  15082. * raise ValueError(u"Non-native byte order not supported")
  15083. * if t == NPY_BYTE: f = "b"
  15084. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  15085. * elif t == NPY_SHORT: f = "h"
  15086. * elif t == NPY_USHORT: f = "H"
  15087. */
  15088. __pyx_v_f = ((char *)"B");
  15089. break;
  15090. case NPY_SHORT:
  15091. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
  15092. * if t == NPY_BYTE: f = "b"
  15093. * elif t == NPY_UBYTE: f = "B"
  15094. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  15095. * elif t == NPY_USHORT: f = "H"
  15096. * elif t == NPY_INT: f = "i"
  15097. */
  15098. __pyx_v_f = ((char *)"h");
  15099. break;
  15100. case NPY_USHORT:
  15101. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
  15102. * elif t == NPY_UBYTE: f = "B"
  15103. * elif t == NPY_SHORT: f = "h"
  15104. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  15105. * elif t == NPY_INT: f = "i"
  15106. * elif t == NPY_UINT: f = "I"
  15107. */
  15108. __pyx_v_f = ((char *)"H");
  15109. break;
  15110. case NPY_INT:
  15111. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
  15112. * elif t == NPY_SHORT: f = "h"
  15113. * elif t == NPY_USHORT: f = "H"
  15114. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  15115. * elif t == NPY_UINT: f = "I"
  15116. * elif t == NPY_LONG: f = "l"
  15117. */
  15118. __pyx_v_f = ((char *)"i");
  15119. break;
  15120. case NPY_UINT:
  15121. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
  15122. * elif t == NPY_USHORT: f = "H"
  15123. * elif t == NPY_INT: f = "i"
  15124. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  15125. * elif t == NPY_LONG: f = "l"
  15126. * elif t == NPY_ULONG: f = "L"
  15127. */
  15128. __pyx_v_f = ((char *)"I");
  15129. break;
  15130. case NPY_LONG:
  15131. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
  15132. * elif t == NPY_INT: f = "i"
  15133. * elif t == NPY_UINT: f = "I"
  15134. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  15135. * elif t == NPY_ULONG: f = "L"
  15136. * elif t == NPY_LONGLONG: f = "q"
  15137. */
  15138. __pyx_v_f = ((char *)"l");
  15139. break;
  15140. case NPY_ULONG:
  15141. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
  15142. * elif t == NPY_UINT: f = "I"
  15143. * elif t == NPY_LONG: f = "l"
  15144. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  15145. * elif t == NPY_LONGLONG: f = "q"
  15146. * elif t == NPY_ULONGLONG: f = "Q"
  15147. */
  15148. __pyx_v_f = ((char *)"L");
  15149. break;
  15150. case NPY_LONGLONG:
  15151. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
  15152. * elif t == NPY_LONG: f = "l"
  15153. * elif t == NPY_ULONG: f = "L"
  15154. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  15155. * elif t == NPY_ULONGLONG: f = "Q"
  15156. * elif t == NPY_FLOAT: f = "f"
  15157. */
  15158. __pyx_v_f = ((char *)"q");
  15159. break;
  15160. case NPY_ULONGLONG:
  15161. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
  15162. * elif t == NPY_ULONG: f = "L"
  15163. * elif t == NPY_LONGLONG: f = "q"
  15164. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  15165. * elif t == NPY_FLOAT: f = "f"
  15166. * elif t == NPY_DOUBLE: f = "d"
  15167. */
  15168. __pyx_v_f = ((char *)"Q");
  15169. break;
  15170. case NPY_FLOAT:
  15171. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
  15172. * elif t == NPY_LONGLONG: f = "q"
  15173. * elif t == NPY_ULONGLONG: f = "Q"
  15174. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  15175. * elif t == NPY_DOUBLE: f = "d"
  15176. * elif t == NPY_LONGDOUBLE: f = "g"
  15177. */
  15178. __pyx_v_f = ((char *)"f");
  15179. break;
  15180. case NPY_DOUBLE:
  15181. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
  15182. * elif t == NPY_ULONGLONG: f = "Q"
  15183. * elif t == NPY_FLOAT: f = "f"
  15184. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  15185. * elif t == NPY_LONGDOUBLE: f = "g"
  15186. * elif t == NPY_CFLOAT: f = "Zf"
  15187. */
  15188. __pyx_v_f = ((char *)"d");
  15189. break;
  15190. case NPY_LONGDOUBLE:
  15191. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
  15192. * elif t == NPY_FLOAT: f = "f"
  15193. * elif t == NPY_DOUBLE: f = "d"
  15194. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  15195. * elif t == NPY_CFLOAT: f = "Zf"
  15196. * elif t == NPY_CDOUBLE: f = "Zd"
  15197. */
  15198. __pyx_v_f = ((char *)"g");
  15199. break;
  15200. case NPY_CFLOAT:
  15201. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
  15202. * elif t == NPY_DOUBLE: f = "d"
  15203. * elif t == NPY_LONGDOUBLE: f = "g"
  15204. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  15205. * elif t == NPY_CDOUBLE: f = "Zd"
  15206. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15207. */
  15208. __pyx_v_f = ((char *)"Zf");
  15209. break;
  15210. case NPY_CDOUBLE:
  15211. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
  15212. * elif t == NPY_LONGDOUBLE: f = "g"
  15213. * elif t == NPY_CFLOAT: f = "Zf"
  15214. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  15215. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15216. * elif t == NPY_OBJECT: f = "O"
  15217. */
  15218. __pyx_v_f = ((char *)"Zd");
  15219. break;
  15220. case NPY_CLONGDOUBLE:
  15221. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
  15222. * elif t == NPY_CFLOAT: f = "Zf"
  15223. * elif t == NPY_CDOUBLE: f = "Zd"
  15224. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  15225. * elif t == NPY_OBJECT: f = "O"
  15226. * else:
  15227. */
  15228. __pyx_v_f = ((char *)"Zg");
  15229. break;
  15230. case NPY_OBJECT:
  15231. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
  15232. * elif t == NPY_CDOUBLE: f = "Zd"
  15233. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15234. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  15235. * else:
  15236. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15237. */
  15238. __pyx_v_f = ((char *)"O");
  15239. break;
  15240. default:
  15241. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
  15242. * elif t == NPY_OBJECT: f = "O"
  15243. * else:
  15244. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  15245. * info.format = f
  15246. * return
  15247. */
  15248. __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15249. __Pyx_GOTREF(__pyx_t_3);
  15250. __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)
  15251. __Pyx_GOTREF(__pyx_t_8);
  15252. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15253. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15254. __Pyx_GOTREF(__pyx_t_3);
  15255. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  15256. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15257. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15258. __PYX_ERR(2, 325, __pyx_L1_error)
  15259. break;
  15260. }
  15261. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
  15262. * else:
  15263. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15264. * info.format = f # <<<<<<<<<<<<<<
  15265. * return
  15266. * else:
  15267. */
  15268. __pyx_v_info->format = __pyx_v_f;
  15269. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
  15270. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15271. * info.format = f
  15272. * return # <<<<<<<<<<<<<<
  15273. * else:
  15274. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15275. */
  15276. __pyx_r = 0;
  15277. goto __pyx_L0;
  15278. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  15279. * info.obj = self
  15280. *
  15281. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  15282. * t = descr.type_num
  15283. * if ((descr.byteorder == c'>' and little_endian) or
  15284. */
  15285. }
  15286. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
  15287. * return
  15288. * else:
  15289. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  15290. * info.format[0] = c'^' # Native data types, manual alignment
  15291. * offset = 0
  15292. */
  15293. /*else*/ {
  15294. __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
  15295. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
  15296. * else:
  15297. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15298. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  15299. * offset = 0
  15300. * f = _util_dtypestring(descr, info.format + 1,
  15301. */
  15302. (__pyx_v_info->format[0]) = '^';
  15303. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
  15304. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15305. * info.format[0] = c'^' # Native data types, manual alignment
  15306. * offset = 0 # <<<<<<<<<<<<<<
  15307. * f = _util_dtypestring(descr, info.format + 1,
  15308. * info.format + _buffer_format_string_len,
  15309. */
  15310. __pyx_v_offset = 0;
  15311. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
  15312. * info.format[0] = c'^' # Native data types, manual alignment
  15313. * offset = 0
  15314. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  15315. * info.format + _buffer_format_string_len,
  15316. * &offset)
  15317. */
  15318. __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)
  15319. __pyx_v_f = __pyx_t_9;
  15320. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
  15321. * info.format + _buffer_format_string_len,
  15322. * &offset)
  15323. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  15324. *
  15325. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15326. */
  15327. (__pyx_v_f[0]) = '\x00';
  15328. }
  15329. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  15330. * # experimental exception made for __getbuffer__ and __releasebuffer__
  15331. * # -- the details of this may change.
  15332. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  15333. * # This implementation of getbuffer is geared towards Cython
  15334. * # requirements, and does not yet fulfill the PEP.
  15335. */
  15336. /* function exit code */
  15337. __pyx_r = 0;
  15338. goto __pyx_L0;
  15339. __pyx_L1_error:;
  15340. __Pyx_XDECREF(__pyx_t_3);
  15341. __Pyx_XDECREF(__pyx_t_8);
  15342. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15343. __pyx_r = -1;
  15344. if (__pyx_v_info->obj != NULL) {
  15345. __Pyx_GOTREF(__pyx_v_info->obj);
  15346. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15347. }
  15348. goto __pyx_L2;
  15349. __pyx_L0:;
  15350. if (__pyx_v_info->obj == Py_None) {
  15351. __Pyx_GOTREF(__pyx_v_info->obj);
  15352. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15353. }
  15354. __pyx_L2:;
  15355. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  15356. __Pyx_RefNannyFinishContext();
  15357. return __pyx_r;
  15358. }
  15359. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15360. * f[0] = c'\0' # Terminate format string
  15361. *
  15362. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15363. * if PyArray_HASFIELDS(self):
  15364. * PyObject_Free(info.format)
  15365. */
  15366. /* Python wrapper */
  15367. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  15368. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15369. __Pyx_RefNannyDeclarations
  15370. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  15371. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  15372. /* function exit code */
  15373. __Pyx_RefNannyFinishContext();
  15374. }
  15375. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15376. __Pyx_RefNannyDeclarations
  15377. int __pyx_t_1;
  15378. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  15379. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15380. *
  15381. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15382. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15383. * PyObject_Free(info.format)
  15384. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15385. */
  15386. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  15387. if (__pyx_t_1) {
  15388. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
  15389. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15390. * if PyArray_HASFIELDS(self):
  15391. * PyObject_Free(info.format) # <<<<<<<<<<<<<<
  15392. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15393. * PyObject_Free(info.strides)
  15394. */
  15395. PyObject_Free(__pyx_v_info->format);
  15396. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15397. *
  15398. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15399. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15400. * PyObject_Free(info.format)
  15401. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15402. */
  15403. }
  15404. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15405. * if PyArray_HASFIELDS(self):
  15406. * PyObject_Free(info.format)
  15407. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15408. * PyObject_Free(info.strides)
  15409. * # info.shape was stored after info.strides in the same block
  15410. */
  15411. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  15412. if (__pyx_t_1) {
  15413. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
  15414. * PyObject_Free(info.format)
  15415. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15416. * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
  15417. * # info.shape was stored after info.strides in the same block
  15418. *
  15419. */
  15420. PyObject_Free(__pyx_v_info->strides);
  15421. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15422. * if PyArray_HASFIELDS(self):
  15423. * PyObject_Free(info.format)
  15424. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15425. * PyObject_Free(info.strides)
  15426. * # info.shape was stored after info.strides in the same block
  15427. */
  15428. }
  15429. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15430. * f[0] = c'\0' # Terminate format string
  15431. *
  15432. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15433. * if PyArray_HASFIELDS(self):
  15434. * PyObject_Free(info.format)
  15435. */
  15436. /* function exit code */
  15437. __Pyx_RefNannyFinishContext();
  15438. }
  15439. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15440. * ctypedef npy_cdouble complex_t
  15441. *
  15442. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15443. * return PyArray_MultiIterNew(1, <void*>a)
  15444. *
  15445. */
  15446. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  15447. PyObject *__pyx_r = NULL;
  15448. __Pyx_RefNannyDeclarations
  15449. PyObject *__pyx_t_1 = NULL;
  15450. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  15451. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
  15452. *
  15453. * cdef inline object PyArray_MultiIterNew1(a):
  15454. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  15455. *
  15456. * cdef inline object PyArray_MultiIterNew2(a, b):
  15457. */
  15458. __Pyx_XDECREF(__pyx_r);
  15459. __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
  15460. __Pyx_GOTREF(__pyx_t_1);
  15461. __pyx_r = __pyx_t_1;
  15462. __pyx_t_1 = 0;
  15463. goto __pyx_L0;
  15464. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15465. * ctypedef npy_cdouble complex_t
  15466. *
  15467. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15468. * return PyArray_MultiIterNew(1, <void*>a)
  15469. *
  15470. */
  15471. /* function exit code */
  15472. __pyx_L1_error:;
  15473. __Pyx_XDECREF(__pyx_t_1);
  15474. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15475. __pyx_r = 0;
  15476. __pyx_L0:;
  15477. __Pyx_XGIVEREF(__pyx_r);
  15478. __Pyx_RefNannyFinishContext();
  15479. return __pyx_r;
  15480. }
  15481. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15482. * return PyArray_MultiIterNew(1, <void*>a)
  15483. *
  15484. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15485. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15486. *
  15487. */
  15488. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  15489. PyObject *__pyx_r = NULL;
  15490. __Pyx_RefNannyDeclarations
  15491. PyObject *__pyx_t_1 = NULL;
  15492. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  15493. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
  15494. *
  15495. * cdef inline object PyArray_MultiIterNew2(a, b):
  15496. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  15497. *
  15498. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15499. */
  15500. __Pyx_XDECREF(__pyx_r);
  15501. __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)
  15502. __Pyx_GOTREF(__pyx_t_1);
  15503. __pyx_r = __pyx_t_1;
  15504. __pyx_t_1 = 0;
  15505. goto __pyx_L0;
  15506. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15507. * return PyArray_MultiIterNew(1, <void*>a)
  15508. *
  15509. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15510. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15511. *
  15512. */
  15513. /* function exit code */
  15514. __pyx_L1_error:;
  15515. __Pyx_XDECREF(__pyx_t_1);
  15516. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15517. __pyx_r = 0;
  15518. __pyx_L0:;
  15519. __Pyx_XGIVEREF(__pyx_r);
  15520. __Pyx_RefNannyFinishContext();
  15521. return __pyx_r;
  15522. }
  15523. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15524. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15525. *
  15526. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15527. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15528. *
  15529. */
  15530. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  15531. PyObject *__pyx_r = NULL;
  15532. __Pyx_RefNannyDeclarations
  15533. PyObject *__pyx_t_1 = NULL;
  15534. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  15535. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
  15536. *
  15537. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15538. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  15539. *
  15540. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15541. */
  15542. __Pyx_XDECREF(__pyx_r);
  15543. __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)
  15544. __Pyx_GOTREF(__pyx_t_1);
  15545. __pyx_r = __pyx_t_1;
  15546. __pyx_t_1 = 0;
  15547. goto __pyx_L0;
  15548. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15549. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15550. *
  15551. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15552. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15553. *
  15554. */
  15555. /* function exit code */
  15556. __pyx_L1_error:;
  15557. __Pyx_XDECREF(__pyx_t_1);
  15558. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15559. __pyx_r = 0;
  15560. __pyx_L0:;
  15561. __Pyx_XGIVEREF(__pyx_r);
  15562. __Pyx_RefNannyFinishContext();
  15563. return __pyx_r;
  15564. }
  15565. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15566. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15567. *
  15568. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15569. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15570. *
  15571. */
  15572. 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) {
  15573. PyObject *__pyx_r = NULL;
  15574. __Pyx_RefNannyDeclarations
  15575. PyObject *__pyx_t_1 = NULL;
  15576. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  15577. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
  15578. *
  15579. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15580. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  15581. *
  15582. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15583. */
  15584. __Pyx_XDECREF(__pyx_r);
  15585. __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)
  15586. __Pyx_GOTREF(__pyx_t_1);
  15587. __pyx_r = __pyx_t_1;
  15588. __pyx_t_1 = 0;
  15589. goto __pyx_L0;
  15590. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15591. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15592. *
  15593. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15594. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15595. *
  15596. */
  15597. /* function exit code */
  15598. __pyx_L1_error:;
  15599. __Pyx_XDECREF(__pyx_t_1);
  15600. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15601. __pyx_r = 0;
  15602. __pyx_L0:;
  15603. __Pyx_XGIVEREF(__pyx_r);
  15604. __Pyx_RefNannyFinishContext();
  15605. return __pyx_r;
  15606. }
  15607. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15608. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15609. *
  15610. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15611. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15612. *
  15613. */
  15614. 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) {
  15615. PyObject *__pyx_r = NULL;
  15616. __Pyx_RefNannyDeclarations
  15617. PyObject *__pyx_t_1 = NULL;
  15618. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  15619. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
  15620. *
  15621. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15622. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  15623. *
  15624. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15625. */
  15626. __Pyx_XDECREF(__pyx_r);
  15627. __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)
  15628. __Pyx_GOTREF(__pyx_t_1);
  15629. __pyx_r = __pyx_t_1;
  15630. __pyx_t_1 = 0;
  15631. goto __pyx_L0;
  15632. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15633. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15634. *
  15635. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15636. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15637. *
  15638. */
  15639. /* function exit code */
  15640. __pyx_L1_error:;
  15641. __Pyx_XDECREF(__pyx_t_1);
  15642. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15643. __pyx_r = 0;
  15644. __pyx_L0:;
  15645. __Pyx_XGIVEREF(__pyx_r);
  15646. __Pyx_RefNannyFinishContext();
  15647. return __pyx_r;
  15648. }
  15649. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15650. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15651. *
  15652. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15653. * if PyDataType_HASSUBARRAY(d):
  15654. * return <tuple>d.subarray.shape
  15655. */
  15656. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  15657. PyObject *__pyx_r = NULL;
  15658. __Pyx_RefNannyDeclarations
  15659. int __pyx_t_1;
  15660. __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
  15661. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15662. *
  15663. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15664. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15665. * return <tuple>d.subarray.shape
  15666. * else:
  15667. */
  15668. __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  15669. if (__pyx_t_1) {
  15670. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
  15671. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15672. * if PyDataType_HASSUBARRAY(d):
  15673. * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
  15674. * else:
  15675. * return ()
  15676. */
  15677. __Pyx_XDECREF(__pyx_r);
  15678. __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
  15679. __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
  15680. goto __pyx_L0;
  15681. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15682. *
  15683. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15684. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15685. * return <tuple>d.subarray.shape
  15686. * else:
  15687. */
  15688. }
  15689. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
  15690. * return <tuple>d.subarray.shape
  15691. * else:
  15692. * return () # <<<<<<<<<<<<<<
  15693. *
  15694. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  15695. */
  15696. /*else*/ {
  15697. __Pyx_XDECREF(__pyx_r);
  15698. __Pyx_INCREF(__pyx_empty_tuple);
  15699. __pyx_r = __pyx_empty_tuple;
  15700. goto __pyx_L0;
  15701. }
  15702. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15703. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15704. *
  15705. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15706. * if PyDataType_HASSUBARRAY(d):
  15707. * return <tuple>d.subarray.shape
  15708. */
  15709. /* function exit code */
  15710. __pyx_L0:;
  15711. __Pyx_XGIVEREF(__pyx_r);
  15712. __Pyx_RefNannyFinishContext();
  15713. return __pyx_r;
  15714. }
  15715. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  15716. * return ()
  15717. *
  15718. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  15719. * # Recursive utility function used in __getbuffer__ to get format
  15720. * # string. The new location in the format string is returned.
  15721. */
  15722. 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) {
  15723. PyArray_Descr *__pyx_v_child = 0;
  15724. int __pyx_v_endian_detector;
  15725. int __pyx_v_little_endian;
  15726. PyObject *__pyx_v_fields = 0;
  15727. PyObject *__pyx_v_childname = NULL;
  15728. PyObject *__pyx_v_new_offset = NULL;
  15729. PyObject *__pyx_v_t = NULL;
  15730. char *__pyx_r;
  15731. __Pyx_RefNannyDeclarations
  15732. PyObject *__pyx_t_1 = NULL;
  15733. Py_ssize_t __pyx_t_2;
  15734. PyObject *__pyx_t_3 = NULL;
  15735. PyObject *__pyx_t_4 = NULL;
  15736. int __pyx_t_5;
  15737. int __pyx_t_6;
  15738. int __pyx_t_7;
  15739. long __pyx_t_8;
  15740. char *__pyx_t_9;
  15741. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  15742. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
  15743. *
  15744. * cdef dtype child
  15745. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  15746. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  15747. * cdef tuple fields
  15748. */
  15749. __pyx_v_endian_detector = 1;
  15750. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
  15751. * cdef dtype child
  15752. * cdef int endian_detector = 1
  15753. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  15754. * cdef tuple fields
  15755. *
  15756. */
  15757. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  15758. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  15759. * cdef tuple fields
  15760. *
  15761. * for childname in descr.names: # <<<<<<<<<<<<<<
  15762. * fields = descr.fields[childname]
  15763. * child, new_offset = fields
  15764. */
  15765. if (unlikely(__pyx_v_descr->names == Py_None)) {
  15766. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  15767. __PYX_ERR(2, 851, __pyx_L1_error)
  15768. }
  15769. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  15770. for (;;) {
  15771. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  15772. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15773. __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)
  15774. #else
  15775. __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)
  15776. __Pyx_GOTREF(__pyx_t_3);
  15777. #endif
  15778. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  15779. __pyx_t_3 = 0;
  15780. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
  15781. *
  15782. * for childname in descr.names:
  15783. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  15784. * child, new_offset = fields
  15785. *
  15786. */
  15787. if (unlikely(__pyx_v_descr->fields == Py_None)) {
  15788. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  15789. __PYX_ERR(2, 852, __pyx_L1_error)
  15790. }
  15791. __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)
  15792. __Pyx_GOTREF(__pyx_t_3);
  15793. 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)
  15794. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  15795. __pyx_t_3 = 0;
  15796. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
  15797. * for childname in descr.names:
  15798. * fields = descr.fields[childname]
  15799. * child, new_offset = fields # <<<<<<<<<<<<<<
  15800. *
  15801. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15802. */
  15803. if (likely(__pyx_v_fields != Py_None)) {
  15804. PyObject* sequence = __pyx_v_fields;
  15805. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  15806. if (unlikely(size != 2)) {
  15807. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  15808. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  15809. __PYX_ERR(2, 853, __pyx_L1_error)
  15810. }
  15811. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15812. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  15813. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  15814. __Pyx_INCREF(__pyx_t_3);
  15815. __Pyx_INCREF(__pyx_t_4);
  15816. #else
  15817. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
  15818. __Pyx_GOTREF(__pyx_t_3);
  15819. __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
  15820. __Pyx_GOTREF(__pyx_t_4);
  15821. #endif
  15822. } else {
  15823. __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
  15824. }
  15825. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
  15826. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  15827. __pyx_t_3 = 0;
  15828. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  15829. __pyx_t_4 = 0;
  15830. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15831. * child, new_offset = fields
  15832. *
  15833. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15834. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15835. *
  15836. */
  15837. __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
  15838. __Pyx_GOTREF(__pyx_t_4);
  15839. __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
  15840. __Pyx_GOTREF(__pyx_t_3);
  15841. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15842. __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)
  15843. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15844. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  15845. if (unlikely(__pyx_t_6)) {
  15846. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  15847. *
  15848. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15849. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  15850. *
  15851. * if ((child.byteorder == c'>' and little_endian) or
  15852. */
  15853. __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)
  15854. __Pyx_GOTREF(__pyx_t_3);
  15855. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15856. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15857. __PYX_ERR(2, 856, __pyx_L1_error)
  15858. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15859. * child, new_offset = fields
  15860. *
  15861. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15862. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15863. *
  15864. */
  15865. }
  15866. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15867. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15868. *
  15869. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15870. * (child.byteorder == c'<' and not little_endian)):
  15871. * raise ValueError(u"Non-native byte order not supported")
  15872. */
  15873. __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
  15874. if (!__pyx_t_7) {
  15875. goto __pyx_L8_next_or;
  15876. } else {
  15877. }
  15878. __pyx_t_7 = (__pyx_v_little_endian != 0);
  15879. if (!__pyx_t_7) {
  15880. } else {
  15881. __pyx_t_6 = __pyx_t_7;
  15882. goto __pyx_L7_bool_binop_done;
  15883. }
  15884. __pyx_L8_next_or:;
  15885. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
  15886. *
  15887. * if ((child.byteorder == c'>' and little_endian) or
  15888. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15889. * raise ValueError(u"Non-native byte order not supported")
  15890. * # One could encode it in the format string and have Cython
  15891. */
  15892. __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
  15893. if (__pyx_t_7) {
  15894. } else {
  15895. __pyx_t_6 = __pyx_t_7;
  15896. goto __pyx_L7_bool_binop_done;
  15897. }
  15898. __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
  15899. __pyx_t_6 = __pyx_t_7;
  15900. __pyx_L7_bool_binop_done:;
  15901. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15902. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15903. *
  15904. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15905. * (child.byteorder == c'<' and not little_endian)):
  15906. * raise ValueError(u"Non-native byte order not supported")
  15907. */
  15908. if (unlikely(__pyx_t_6)) {
  15909. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
  15910. * if ((child.byteorder == c'>' and little_endian) or
  15911. * (child.byteorder == c'<' and not little_endian)):
  15912. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15913. * # One could encode it in the format string and have Cython
  15914. * # complain instead, BUT: < and > in format strings also imply
  15915. */
  15916. __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)
  15917. __Pyx_GOTREF(__pyx_t_3);
  15918. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15919. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15920. __PYX_ERR(2, 860, __pyx_L1_error)
  15921. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15922. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15923. *
  15924. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15925. * (child.byteorder == c'<' and not little_endian)):
  15926. * raise ValueError(u"Non-native byte order not supported")
  15927. */
  15928. }
  15929. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
  15930. *
  15931. * # Output padding bytes
  15932. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  15933. * f[0] = 120 # "x"; pad byte
  15934. * f += 1
  15935. */
  15936. while (1) {
  15937. __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
  15938. __Pyx_GOTREF(__pyx_t_3);
  15939. __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)
  15940. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15941. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
  15942. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15943. if (!__pyx_t_6) break;
  15944. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
  15945. * # Output padding bytes
  15946. * while offset[0] < new_offset:
  15947. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  15948. * f += 1
  15949. * offset[0] += 1
  15950. */
  15951. (__pyx_v_f[0]) = 0x78;
  15952. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
  15953. * while offset[0] < new_offset:
  15954. * f[0] = 120 # "x"; pad byte
  15955. * f += 1 # <<<<<<<<<<<<<<
  15956. * offset[0] += 1
  15957. *
  15958. */
  15959. __pyx_v_f = (__pyx_v_f + 1);
  15960. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
  15961. * f[0] = 120 # "x"; pad byte
  15962. * f += 1
  15963. * offset[0] += 1 # <<<<<<<<<<<<<<
  15964. *
  15965. * offset[0] += child.itemsize
  15966. */
  15967. __pyx_t_8 = 0;
  15968. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
  15969. }
  15970. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
  15971. * offset[0] += 1
  15972. *
  15973. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  15974. *
  15975. * if not PyDataType_HASFIELDS(child):
  15976. */
  15977. __pyx_t_8 = 0;
  15978. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
  15979. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  15980. * offset[0] += child.itemsize
  15981. *
  15982. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  15983. * t = child.type_num
  15984. * if end - f < 5:
  15985. */
  15986. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  15987. if (__pyx_t_6) {
  15988. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
  15989. *
  15990. * if not PyDataType_HASFIELDS(child):
  15991. * t = child.type_num # <<<<<<<<<<<<<<
  15992. * if end - f < 5:
  15993. * raise RuntimeError(u"Format string allocated too short.")
  15994. */
  15995. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
  15996. __Pyx_GOTREF(__pyx_t_4);
  15997. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  15998. __pyx_t_4 = 0;
  15999. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  16000. * if not PyDataType_HASFIELDS(child):
  16001. * t = child.type_num
  16002. * if end - f < 5: # <<<<<<<<<<<<<<
  16003. * raise RuntimeError(u"Format string allocated too short.")
  16004. *
  16005. */
  16006. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  16007. if (unlikely(__pyx_t_6)) {
  16008. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  16009. * t = child.type_num
  16010. * if end - f < 5:
  16011. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  16012. *
  16013. * # Until ticket #99 is fixed, use integers to avoid warnings
  16014. */
  16015. __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)
  16016. __Pyx_GOTREF(__pyx_t_4);
  16017. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  16018. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16019. __PYX_ERR(2, 880, __pyx_L1_error)
  16020. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  16021. * if not PyDataType_HASFIELDS(child):
  16022. * t = child.type_num
  16023. * if end - f < 5: # <<<<<<<<<<<<<<
  16024. * raise RuntimeError(u"Format string allocated too short.")
  16025. *
  16026. */
  16027. }
  16028. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
  16029. *
  16030. * # Until ticket #99 is fixed, use integers to avoid warnings
  16031. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  16032. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16033. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16034. */
  16035. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
  16036. __Pyx_GOTREF(__pyx_t_4);
  16037. __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)
  16038. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16039. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
  16040. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16041. if (__pyx_t_6) {
  16042. (__pyx_v_f[0]) = 98;
  16043. goto __pyx_L15;
  16044. }
  16045. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
  16046. * # Until ticket #99 is fixed, use integers to avoid warnings
  16047. * if t == NPY_BYTE: f[0] = 98 #"b"
  16048. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  16049. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16050. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16051. */
  16052. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
  16053. __Pyx_GOTREF(__pyx_t_3);
  16054. __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)
  16055. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16056. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
  16057. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16058. if (__pyx_t_6) {
  16059. (__pyx_v_f[0]) = 66;
  16060. goto __pyx_L15;
  16061. }
  16062. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
  16063. * if t == NPY_BYTE: f[0] = 98 #"b"
  16064. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16065. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  16066. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16067. * elif t == NPY_INT: f[0] = 105 #"i"
  16068. */
  16069. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
  16070. __Pyx_GOTREF(__pyx_t_4);
  16071. __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)
  16072. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16073. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
  16074. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16075. if (__pyx_t_6) {
  16076. (__pyx_v_f[0]) = 0x68;
  16077. goto __pyx_L15;
  16078. }
  16079. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
  16080. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16081. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16082. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  16083. * elif t == NPY_INT: f[0] = 105 #"i"
  16084. * elif t == NPY_UINT: f[0] = 73 #"I"
  16085. */
  16086. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
  16087. __Pyx_GOTREF(__pyx_t_3);
  16088. __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)
  16089. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16090. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
  16091. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16092. if (__pyx_t_6) {
  16093. (__pyx_v_f[0]) = 72;
  16094. goto __pyx_L15;
  16095. }
  16096. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
  16097. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16098. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16099. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  16100. * elif t == NPY_UINT: f[0] = 73 #"I"
  16101. * elif t == NPY_LONG: f[0] = 108 #"l"
  16102. */
  16103. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
  16104. __Pyx_GOTREF(__pyx_t_4);
  16105. __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)
  16106. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16107. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
  16108. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16109. if (__pyx_t_6) {
  16110. (__pyx_v_f[0]) = 0x69;
  16111. goto __pyx_L15;
  16112. }
  16113. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
  16114. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16115. * elif t == NPY_INT: f[0] = 105 #"i"
  16116. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  16117. * elif t == NPY_LONG: f[0] = 108 #"l"
  16118. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16119. */
  16120. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
  16121. __Pyx_GOTREF(__pyx_t_3);
  16122. __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)
  16123. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16124. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
  16125. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16126. if (__pyx_t_6) {
  16127. (__pyx_v_f[0]) = 73;
  16128. goto __pyx_L15;
  16129. }
  16130. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
  16131. * elif t == NPY_INT: f[0] = 105 #"i"
  16132. * elif t == NPY_UINT: f[0] = 73 #"I"
  16133. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  16134. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16135. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16136. */
  16137. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
  16138. __Pyx_GOTREF(__pyx_t_4);
  16139. __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)
  16140. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16141. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
  16142. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16143. if (__pyx_t_6) {
  16144. (__pyx_v_f[0]) = 0x6C;
  16145. goto __pyx_L15;
  16146. }
  16147. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
  16148. * elif t == NPY_UINT: f[0] = 73 #"I"
  16149. * elif t == NPY_LONG: f[0] = 108 #"l"
  16150. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  16151. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16152. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16153. */
  16154. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
  16155. __Pyx_GOTREF(__pyx_t_3);
  16156. __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)
  16157. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16158. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
  16159. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16160. if (__pyx_t_6) {
  16161. (__pyx_v_f[0]) = 76;
  16162. goto __pyx_L15;
  16163. }
  16164. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
  16165. * elif t == NPY_LONG: f[0] = 108 #"l"
  16166. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16167. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  16168. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16169. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16170. */
  16171. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
  16172. __Pyx_GOTREF(__pyx_t_4);
  16173. __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)
  16174. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16175. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
  16176. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16177. if (__pyx_t_6) {
  16178. (__pyx_v_f[0]) = 0x71;
  16179. goto __pyx_L15;
  16180. }
  16181. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
  16182. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16183. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16184. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  16185. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16186. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16187. */
  16188. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
  16189. __Pyx_GOTREF(__pyx_t_3);
  16190. __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)
  16191. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16192. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
  16193. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16194. if (__pyx_t_6) {
  16195. (__pyx_v_f[0]) = 81;
  16196. goto __pyx_L15;
  16197. }
  16198. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
  16199. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16200. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16201. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  16202. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16203. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16204. */
  16205. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
  16206. __Pyx_GOTREF(__pyx_t_4);
  16207. __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)
  16208. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16209. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
  16210. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16211. if (__pyx_t_6) {
  16212. (__pyx_v_f[0]) = 0x66;
  16213. goto __pyx_L15;
  16214. }
  16215. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
  16216. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16217. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16218. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  16219. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16220. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16221. */
  16222. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
  16223. __Pyx_GOTREF(__pyx_t_3);
  16224. __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)
  16225. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16226. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
  16227. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16228. if (__pyx_t_6) {
  16229. (__pyx_v_f[0]) = 0x64;
  16230. goto __pyx_L15;
  16231. }
  16232. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
  16233. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16234. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16235. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  16236. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16237. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16238. */
  16239. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
  16240. __Pyx_GOTREF(__pyx_t_4);
  16241. __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)
  16242. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16243. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
  16244. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16245. if (__pyx_t_6) {
  16246. (__pyx_v_f[0]) = 0x67;
  16247. goto __pyx_L15;
  16248. }
  16249. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
  16250. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16251. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16252. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  16253. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16254. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16255. */
  16256. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
  16257. __Pyx_GOTREF(__pyx_t_3);
  16258. __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)
  16259. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16260. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
  16261. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16262. if (__pyx_t_6) {
  16263. (__pyx_v_f[0]) = 90;
  16264. (__pyx_v_f[1]) = 0x66;
  16265. __pyx_v_f = (__pyx_v_f + 1);
  16266. goto __pyx_L15;
  16267. }
  16268. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
  16269. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16270. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16271. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  16272. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16273. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16274. */
  16275. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
  16276. __Pyx_GOTREF(__pyx_t_4);
  16277. __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)
  16278. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16279. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
  16280. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16281. if (__pyx_t_6) {
  16282. (__pyx_v_f[0]) = 90;
  16283. (__pyx_v_f[1]) = 0x64;
  16284. __pyx_v_f = (__pyx_v_f + 1);
  16285. goto __pyx_L15;
  16286. }
  16287. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
  16288. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16289. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16290. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  16291. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16292. * else:
  16293. */
  16294. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
  16295. __Pyx_GOTREF(__pyx_t_3);
  16296. __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)
  16297. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16298. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
  16299. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16300. if (__pyx_t_6) {
  16301. (__pyx_v_f[0]) = 90;
  16302. (__pyx_v_f[1]) = 0x67;
  16303. __pyx_v_f = (__pyx_v_f + 1);
  16304. goto __pyx_L15;
  16305. }
  16306. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
  16307. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16308. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16309. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  16310. * else:
  16311. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16312. */
  16313. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
  16314. __Pyx_GOTREF(__pyx_t_4);
  16315. __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)
  16316. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16317. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
  16318. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16319. if (likely(__pyx_t_6)) {
  16320. (__pyx_v_f[0]) = 79;
  16321. goto __pyx_L15;
  16322. }
  16323. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
  16324. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16325. * else:
  16326. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  16327. * f += 1
  16328. * else:
  16329. */
  16330. /*else*/ {
  16331. __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)
  16332. __Pyx_GOTREF(__pyx_t_3);
  16333. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
  16334. __Pyx_GOTREF(__pyx_t_4);
  16335. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16336. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  16337. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16338. __PYX_ERR(2, 901, __pyx_L1_error)
  16339. }
  16340. __pyx_L15:;
  16341. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
  16342. * else:
  16343. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16344. * f += 1 # <<<<<<<<<<<<<<
  16345. * else:
  16346. * # Cython ignores struct boundary information ("T{...}"),
  16347. */
  16348. __pyx_v_f = (__pyx_v_f + 1);
  16349. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  16350. * offset[0] += child.itemsize
  16351. *
  16352. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  16353. * t = child.type_num
  16354. * if end - f < 5:
  16355. */
  16356. goto __pyx_L13;
  16357. }
  16358. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
  16359. * # Cython ignores struct boundary information ("T{...}"),
  16360. * # so don't output it
  16361. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  16362. * return f
  16363. *
  16364. */
  16365. /*else*/ {
  16366. __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)
  16367. __pyx_v_f = __pyx_t_9;
  16368. }
  16369. __pyx_L13:;
  16370. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  16371. * cdef tuple fields
  16372. *
  16373. * for childname in descr.names: # <<<<<<<<<<<<<<
  16374. * fields = descr.fields[childname]
  16375. * child, new_offset = fields
  16376. */
  16377. }
  16378. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16379. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
  16380. * # so don't output it
  16381. * f = _util_dtypestring(child, f, end, offset)
  16382. * return f # <<<<<<<<<<<<<<
  16383. *
  16384. *
  16385. */
  16386. __pyx_r = __pyx_v_f;
  16387. goto __pyx_L0;
  16388. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  16389. * return ()
  16390. *
  16391. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  16392. * # Recursive utility function used in __getbuffer__ to get format
  16393. * # string. The new location in the format string is returned.
  16394. */
  16395. /* function exit code */
  16396. __pyx_L1_error:;
  16397. __Pyx_XDECREF(__pyx_t_1);
  16398. __Pyx_XDECREF(__pyx_t_3);
  16399. __Pyx_XDECREF(__pyx_t_4);
  16400. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16401. __pyx_r = NULL;
  16402. __pyx_L0:;
  16403. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  16404. __Pyx_XDECREF(__pyx_v_fields);
  16405. __Pyx_XDECREF(__pyx_v_childname);
  16406. __Pyx_XDECREF(__pyx_v_new_offset);
  16407. __Pyx_XDECREF(__pyx_v_t);
  16408. __Pyx_RefNannyFinishContext();
  16409. return __pyx_r;
  16410. }
  16411. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16412. * int _import_umath() except -1
  16413. *
  16414. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16415. * Py_INCREF(base) # important to do this before stealing the reference below!
  16416. * PyArray_SetBaseObject(arr, base)
  16417. */
  16418. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  16419. __Pyx_RefNannyDeclarations
  16420. __Pyx_RefNannySetupContext("set_array_base", 0);
  16421. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
  16422. *
  16423. * cdef inline void set_array_base(ndarray arr, object base):
  16424. * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
  16425. * PyArray_SetBaseObject(arr, base)
  16426. *
  16427. */
  16428. Py_INCREF(__pyx_v_base);
  16429. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
  16430. * cdef inline void set_array_base(ndarray arr, object base):
  16431. * Py_INCREF(base) # important to do this before stealing the reference below!
  16432. * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
  16433. *
  16434. * cdef inline object get_array_base(ndarray arr):
  16435. */
  16436. (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
  16437. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16438. * int _import_umath() except -1
  16439. *
  16440. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16441. * Py_INCREF(base) # important to do this before stealing the reference below!
  16442. * PyArray_SetBaseObject(arr, base)
  16443. */
  16444. /* function exit code */
  16445. __Pyx_RefNannyFinishContext();
  16446. }
  16447. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16448. * PyArray_SetBaseObject(arr, base)
  16449. *
  16450. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16451. * base = PyArray_BASE(arr)
  16452. * if base is NULL:
  16453. */
  16454. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  16455. PyObject *__pyx_v_base;
  16456. PyObject *__pyx_r = NULL;
  16457. __Pyx_RefNannyDeclarations
  16458. int __pyx_t_1;
  16459. __Pyx_RefNannySetupContext("get_array_base", 0);
  16460. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
  16461. *
  16462. * cdef inline object get_array_base(ndarray arr):
  16463. * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
  16464. * if base is NULL:
  16465. * return None
  16466. */
  16467. __pyx_v_base = PyArray_BASE(__pyx_v_arr);
  16468. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16469. * cdef inline object get_array_base(ndarray arr):
  16470. * base = PyArray_BASE(arr)
  16471. * if base is NULL: # <<<<<<<<<<<<<<
  16472. * return None
  16473. * return <object>base
  16474. */
  16475. __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  16476. if (__pyx_t_1) {
  16477. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
  16478. * base = PyArray_BASE(arr)
  16479. * if base is NULL:
  16480. * return None # <<<<<<<<<<<<<<
  16481. * return <object>base
  16482. *
  16483. */
  16484. __Pyx_XDECREF(__pyx_r);
  16485. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  16486. goto __pyx_L0;
  16487. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16488. * cdef inline object get_array_base(ndarray arr):
  16489. * base = PyArray_BASE(arr)
  16490. * if base is NULL: # <<<<<<<<<<<<<<
  16491. * return None
  16492. * return <object>base
  16493. */
  16494. }
  16495. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
  16496. * if base is NULL:
  16497. * return None
  16498. * return <object>base # <<<<<<<<<<<<<<
  16499. *
  16500. * # Versions of the import_* functions which are more suitable for
  16501. */
  16502. __Pyx_XDECREF(__pyx_r);
  16503. __Pyx_INCREF(((PyObject *)__pyx_v_base));
  16504. __pyx_r = ((PyObject *)__pyx_v_base);
  16505. goto __pyx_L0;
  16506. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16507. * PyArray_SetBaseObject(arr, base)
  16508. *
  16509. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16510. * base = PyArray_BASE(arr)
  16511. * if base is NULL:
  16512. */
  16513. /* function exit code */
  16514. __pyx_L0:;
  16515. __Pyx_XGIVEREF(__pyx_r);
  16516. __Pyx_RefNannyFinishContext();
  16517. return __pyx_r;
  16518. }
  16519. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16520. * # Versions of the import_* functions which are more suitable for
  16521. * # Cython code.
  16522. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16523. * try:
  16524. * _import_array()
  16525. */
  16526. static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  16527. int __pyx_r;
  16528. __Pyx_RefNannyDeclarations
  16529. PyObject *__pyx_t_1 = NULL;
  16530. PyObject *__pyx_t_2 = NULL;
  16531. PyObject *__pyx_t_3 = NULL;
  16532. int __pyx_t_4;
  16533. PyObject *__pyx_t_5 = NULL;
  16534. PyObject *__pyx_t_6 = NULL;
  16535. PyObject *__pyx_t_7 = NULL;
  16536. PyObject *__pyx_t_8 = NULL;
  16537. __Pyx_RefNannySetupContext("import_array", 0);
  16538. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16539. * # Cython code.
  16540. * cdef inline int import_array() except -1:
  16541. * try: # <<<<<<<<<<<<<<
  16542. * _import_array()
  16543. * except Exception:
  16544. */
  16545. {
  16546. __Pyx_PyThreadState_declare
  16547. __Pyx_PyThreadState_assign
  16548. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16549. __Pyx_XGOTREF(__pyx_t_1);
  16550. __Pyx_XGOTREF(__pyx_t_2);
  16551. __Pyx_XGOTREF(__pyx_t_3);
  16552. /*try:*/ {
  16553. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
  16554. * cdef inline int import_array() except -1:
  16555. * try:
  16556. * _import_array() # <<<<<<<<<<<<<<
  16557. * except Exception:
  16558. * raise ImportError("numpy.core.multiarray failed to import")
  16559. */
  16560. __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
  16561. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16562. * # Cython code.
  16563. * cdef inline int import_array() except -1:
  16564. * try: # <<<<<<<<<<<<<<
  16565. * _import_array()
  16566. * except Exception:
  16567. */
  16568. }
  16569. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16570. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16571. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16572. goto __pyx_L8_try_end;
  16573. __pyx_L3_error:;
  16574. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
  16575. * try:
  16576. * _import_array()
  16577. * except Exception: # <<<<<<<<<<<<<<
  16578. * raise ImportError("numpy.core.multiarray failed to import")
  16579. *
  16580. */
  16581. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16582. if (__pyx_t_4) {
  16583. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16584. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
  16585. __Pyx_GOTREF(__pyx_t_5);
  16586. __Pyx_GOTREF(__pyx_t_6);
  16587. __Pyx_GOTREF(__pyx_t_7);
  16588. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  16589. * _import_array()
  16590. * except Exception:
  16591. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  16592. *
  16593. * cdef inline int import_umath() except -1:
  16594. */
  16595. __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)
  16596. __Pyx_GOTREF(__pyx_t_8);
  16597. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16598. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16599. __PYX_ERR(2, 1038, __pyx_L5_except_error)
  16600. }
  16601. goto __pyx_L5_except_error;
  16602. __pyx_L5_except_error:;
  16603. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16604. * # Cython code.
  16605. * cdef inline int import_array() except -1:
  16606. * try: # <<<<<<<<<<<<<<
  16607. * _import_array()
  16608. * except Exception:
  16609. */
  16610. __Pyx_XGIVEREF(__pyx_t_1);
  16611. __Pyx_XGIVEREF(__pyx_t_2);
  16612. __Pyx_XGIVEREF(__pyx_t_3);
  16613. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16614. goto __pyx_L1_error;
  16615. __pyx_L8_try_end:;
  16616. }
  16617. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16618. * # Versions of the import_* functions which are more suitable for
  16619. * # Cython code.
  16620. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16621. * try:
  16622. * _import_array()
  16623. */
  16624. /* function exit code */
  16625. __pyx_r = 0;
  16626. goto __pyx_L0;
  16627. __pyx_L1_error:;
  16628. __Pyx_XDECREF(__pyx_t_5);
  16629. __Pyx_XDECREF(__pyx_t_6);
  16630. __Pyx_XDECREF(__pyx_t_7);
  16631. __Pyx_XDECREF(__pyx_t_8);
  16632. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16633. __pyx_r = -1;
  16634. __pyx_L0:;
  16635. __Pyx_RefNannyFinishContext();
  16636. return __pyx_r;
  16637. }
  16638. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16639. * raise ImportError("numpy.core.multiarray failed to import")
  16640. *
  16641. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16642. * try:
  16643. * _import_umath()
  16644. */
  16645. static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  16646. int __pyx_r;
  16647. __Pyx_RefNannyDeclarations
  16648. PyObject *__pyx_t_1 = NULL;
  16649. PyObject *__pyx_t_2 = NULL;
  16650. PyObject *__pyx_t_3 = NULL;
  16651. int __pyx_t_4;
  16652. PyObject *__pyx_t_5 = NULL;
  16653. PyObject *__pyx_t_6 = NULL;
  16654. PyObject *__pyx_t_7 = NULL;
  16655. PyObject *__pyx_t_8 = NULL;
  16656. __Pyx_RefNannySetupContext("import_umath", 0);
  16657. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16658. *
  16659. * cdef inline int import_umath() except -1:
  16660. * try: # <<<<<<<<<<<<<<
  16661. * _import_umath()
  16662. * except Exception:
  16663. */
  16664. {
  16665. __Pyx_PyThreadState_declare
  16666. __Pyx_PyThreadState_assign
  16667. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16668. __Pyx_XGOTREF(__pyx_t_1);
  16669. __Pyx_XGOTREF(__pyx_t_2);
  16670. __Pyx_XGOTREF(__pyx_t_3);
  16671. /*try:*/ {
  16672. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
  16673. * cdef inline int import_umath() except -1:
  16674. * try:
  16675. * _import_umath() # <<<<<<<<<<<<<<
  16676. * except Exception:
  16677. * raise ImportError("numpy.core.umath failed to import")
  16678. */
  16679. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
  16680. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16681. *
  16682. * cdef inline int import_umath() except -1:
  16683. * try: # <<<<<<<<<<<<<<
  16684. * _import_umath()
  16685. * except Exception:
  16686. */
  16687. }
  16688. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16689. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16690. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16691. goto __pyx_L8_try_end;
  16692. __pyx_L3_error:;
  16693. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
  16694. * try:
  16695. * _import_umath()
  16696. * except Exception: # <<<<<<<<<<<<<<
  16697. * raise ImportError("numpy.core.umath failed to import")
  16698. *
  16699. */
  16700. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16701. if (__pyx_t_4) {
  16702. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16703. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
  16704. __Pyx_GOTREF(__pyx_t_5);
  16705. __Pyx_GOTREF(__pyx_t_6);
  16706. __Pyx_GOTREF(__pyx_t_7);
  16707. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  16708. * _import_umath()
  16709. * except Exception:
  16710. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16711. *
  16712. * cdef inline int import_ufunc() except -1:
  16713. */
  16714. __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)
  16715. __Pyx_GOTREF(__pyx_t_8);
  16716. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16717. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16718. __PYX_ERR(2, 1044, __pyx_L5_except_error)
  16719. }
  16720. goto __pyx_L5_except_error;
  16721. __pyx_L5_except_error:;
  16722. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16723. *
  16724. * cdef inline int import_umath() except -1:
  16725. * try: # <<<<<<<<<<<<<<
  16726. * _import_umath()
  16727. * except Exception:
  16728. */
  16729. __Pyx_XGIVEREF(__pyx_t_1);
  16730. __Pyx_XGIVEREF(__pyx_t_2);
  16731. __Pyx_XGIVEREF(__pyx_t_3);
  16732. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16733. goto __pyx_L1_error;
  16734. __pyx_L8_try_end:;
  16735. }
  16736. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16737. * raise ImportError("numpy.core.multiarray failed to import")
  16738. *
  16739. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16740. * try:
  16741. * _import_umath()
  16742. */
  16743. /* function exit code */
  16744. __pyx_r = 0;
  16745. goto __pyx_L0;
  16746. __pyx_L1_error:;
  16747. __Pyx_XDECREF(__pyx_t_5);
  16748. __Pyx_XDECREF(__pyx_t_6);
  16749. __Pyx_XDECREF(__pyx_t_7);
  16750. __Pyx_XDECREF(__pyx_t_8);
  16751. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16752. __pyx_r = -1;
  16753. __pyx_L0:;
  16754. __Pyx_RefNannyFinishContext();
  16755. return __pyx_r;
  16756. }
  16757. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16758. * raise ImportError("numpy.core.umath failed to import")
  16759. *
  16760. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16761. * try:
  16762. * _import_umath()
  16763. */
  16764. static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  16765. int __pyx_r;
  16766. __Pyx_RefNannyDeclarations
  16767. PyObject *__pyx_t_1 = NULL;
  16768. PyObject *__pyx_t_2 = NULL;
  16769. PyObject *__pyx_t_3 = NULL;
  16770. int __pyx_t_4;
  16771. PyObject *__pyx_t_5 = NULL;
  16772. PyObject *__pyx_t_6 = NULL;
  16773. PyObject *__pyx_t_7 = NULL;
  16774. PyObject *__pyx_t_8 = NULL;
  16775. __Pyx_RefNannySetupContext("import_ufunc", 0);
  16776. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16777. *
  16778. * cdef inline int import_ufunc() except -1:
  16779. * try: # <<<<<<<<<<<<<<
  16780. * _import_umath()
  16781. * except Exception:
  16782. */
  16783. {
  16784. __Pyx_PyThreadState_declare
  16785. __Pyx_PyThreadState_assign
  16786. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16787. __Pyx_XGOTREF(__pyx_t_1);
  16788. __Pyx_XGOTREF(__pyx_t_2);
  16789. __Pyx_XGOTREF(__pyx_t_3);
  16790. /*try:*/ {
  16791. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
  16792. * cdef inline int import_ufunc() except -1:
  16793. * try:
  16794. * _import_umath() # <<<<<<<<<<<<<<
  16795. * except Exception:
  16796. * raise ImportError("numpy.core.umath failed to import")
  16797. */
  16798. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
  16799. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16800. *
  16801. * cdef inline int import_ufunc() except -1:
  16802. * try: # <<<<<<<<<<<<<<
  16803. * _import_umath()
  16804. * except Exception:
  16805. */
  16806. }
  16807. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16808. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16809. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16810. goto __pyx_L8_try_end;
  16811. __pyx_L3_error:;
  16812. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
  16813. * try:
  16814. * _import_umath()
  16815. * except Exception: # <<<<<<<<<<<<<<
  16816. * raise ImportError("numpy.core.umath failed to import")
  16817. */
  16818. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16819. if (__pyx_t_4) {
  16820. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16821. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
  16822. __Pyx_GOTREF(__pyx_t_5);
  16823. __Pyx_GOTREF(__pyx_t_6);
  16824. __Pyx_GOTREF(__pyx_t_7);
  16825. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
  16826. * _import_umath()
  16827. * except Exception:
  16828. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16829. */
  16830. __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)
  16831. __Pyx_GOTREF(__pyx_t_8);
  16832. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16833. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16834. __PYX_ERR(2, 1050, __pyx_L5_except_error)
  16835. }
  16836. goto __pyx_L5_except_error;
  16837. __pyx_L5_except_error:;
  16838. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16839. *
  16840. * cdef inline int import_ufunc() except -1:
  16841. * try: # <<<<<<<<<<<<<<
  16842. * _import_umath()
  16843. * except Exception:
  16844. */
  16845. __Pyx_XGIVEREF(__pyx_t_1);
  16846. __Pyx_XGIVEREF(__pyx_t_2);
  16847. __Pyx_XGIVEREF(__pyx_t_3);
  16848. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16849. goto __pyx_L1_error;
  16850. __pyx_L8_try_end:;
  16851. }
  16852. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16853. * raise ImportError("numpy.core.umath failed to import")
  16854. *
  16855. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16856. * try:
  16857. * _import_umath()
  16858. */
  16859. /* function exit code */
  16860. __pyx_r = 0;
  16861. goto __pyx_L0;
  16862. __pyx_L1_error:;
  16863. __Pyx_XDECREF(__pyx_t_5);
  16864. __Pyx_XDECREF(__pyx_t_6);
  16865. __Pyx_XDECREF(__pyx_t_7);
  16866. __Pyx_XDECREF(__pyx_t_8);
  16867. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16868. __pyx_r = -1;
  16869. __pyx_L0:;
  16870. __Pyx_RefNannyFinishContext();
  16871. return __pyx_r;
  16872. }
  16873. /* "array.pxd":93
  16874. * __data_union data
  16875. *
  16876. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16877. * # This implementation of getbuffer is geared towards Cython
  16878. * # requirements, and does not yet fulfill the PEP.
  16879. */
  16880. /* Python wrapper */
  16881. 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*/
  16882. static CYTHON_UNUSED int __pyx_pw_7cpython_5array_5array_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  16883. int __pyx_r;
  16884. __Pyx_RefNannyDeclarations
  16885. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  16886. __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  16887. /* function exit code */
  16888. __Pyx_RefNannyFinishContext();
  16889. return __pyx_r;
  16890. }
  16891. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
  16892. PyObject *__pyx_v_item_count = NULL;
  16893. int __pyx_r;
  16894. __Pyx_RefNannyDeclarations
  16895. PyObject *__pyx_t_1 = NULL;
  16896. char *__pyx_t_2;
  16897. int __pyx_t_3;
  16898. PyObject *__pyx_t_4 = NULL;
  16899. Py_ssize_t __pyx_t_5;
  16900. int __pyx_t_6;
  16901. char __pyx_t_7;
  16902. if (__pyx_v_info == NULL) {
  16903. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  16904. return -1;
  16905. }
  16906. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  16907. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  16908. __Pyx_GIVEREF(__pyx_v_info->obj);
  16909. /* "array.pxd":98
  16910. * # In particular strided access is always provided regardless
  16911. * # of flags
  16912. * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
  16913. *
  16914. * info.suboffsets = NULL
  16915. */
  16916. __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
  16917. __Pyx_GOTREF(__pyx_t_1);
  16918. __pyx_v_item_count = __pyx_t_1;
  16919. __pyx_t_1 = 0;
  16920. /* "array.pxd":100
  16921. * item_count = Py_SIZE(self)
  16922. *
  16923. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  16924. * info.buf = self.data.as_chars
  16925. * info.readonly = 0
  16926. */
  16927. __pyx_v_info->suboffsets = NULL;
  16928. /* "array.pxd":101
  16929. *
  16930. * info.suboffsets = NULL
  16931. * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
  16932. * info.readonly = 0
  16933. * info.ndim = 1
  16934. */
  16935. __pyx_t_2 = __pyx_v_self->data.as_chars;
  16936. __pyx_v_info->buf = __pyx_t_2;
  16937. /* "array.pxd":102
  16938. * info.suboffsets = NULL
  16939. * info.buf = self.data.as_chars
  16940. * info.readonly = 0 # <<<<<<<<<<<<<<
  16941. * info.ndim = 1
  16942. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16943. */
  16944. __pyx_v_info->readonly = 0;
  16945. /* "array.pxd":103
  16946. * info.buf = self.data.as_chars
  16947. * info.readonly = 0
  16948. * info.ndim = 1 # <<<<<<<<<<<<<<
  16949. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16950. * info.len = info.itemsize * item_count
  16951. */
  16952. __pyx_v_info->ndim = 1;
  16953. /* "array.pxd":104
  16954. * info.readonly = 0
  16955. * info.ndim = 1
  16956. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
  16957. * info.len = info.itemsize * item_count
  16958. *
  16959. */
  16960. __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
  16961. __pyx_v_info->itemsize = __pyx_t_3;
  16962. /* "array.pxd":105
  16963. * info.ndim = 1
  16964. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16965. * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
  16966. *
  16967. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16968. */
  16969. __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  16970. __Pyx_GOTREF(__pyx_t_1);
  16971. __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 105, __pyx_L1_error)
  16972. __Pyx_GOTREF(__pyx_t_4);
  16973. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16974. __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)
  16975. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16976. __pyx_v_info->len = __pyx_t_5;
  16977. /* "array.pxd":107
  16978. * info.len = info.itemsize * item_count
  16979. *
  16980. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
  16981. * if not info.shape:
  16982. * raise MemoryError()
  16983. */
  16984. __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
  16985. /* "array.pxd":108
  16986. *
  16987. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16988. * if not info.shape: # <<<<<<<<<<<<<<
  16989. * raise MemoryError()
  16990. * info.shape[0] = item_count # constant regardless of resizing
  16991. */
  16992. __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
  16993. if (unlikely(__pyx_t_6)) {
  16994. /* "array.pxd":109
  16995. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16996. * if not info.shape:
  16997. * raise MemoryError() # <<<<<<<<<<<<<<
  16998. * info.shape[0] = item_count # constant regardless of resizing
  16999. * info.strides = &info.itemsize
  17000. */
  17001. PyErr_NoMemory(); __PYX_ERR(3, 109, __pyx_L1_error)
  17002. /* "array.pxd":108
  17003. *
  17004. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  17005. * if not info.shape: # <<<<<<<<<<<<<<
  17006. * raise MemoryError()
  17007. * info.shape[0] = item_count # constant regardless of resizing
  17008. */
  17009. }
  17010. /* "array.pxd":110
  17011. * if not info.shape:
  17012. * raise MemoryError()
  17013. * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
  17014. * info.strides = &info.itemsize
  17015. *
  17016. */
  17017. __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)
  17018. (__pyx_v_info->shape[0]) = __pyx_t_5;
  17019. /* "array.pxd":111
  17020. * raise MemoryError()
  17021. * info.shape[0] = item_count # constant regardless of resizing
  17022. * info.strides = &info.itemsize # <<<<<<<<<<<<<<
  17023. *
  17024. * info.format = <char*> (info.shape + 1)
  17025. */
  17026. __pyx_v_info->strides = (&__pyx_v_info->itemsize);
  17027. /* "array.pxd":113
  17028. * info.strides = &info.itemsize
  17029. *
  17030. * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
  17031. * info.format[0] = self.ob_descr.typecode
  17032. * info.format[1] = 0
  17033. */
  17034. __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
  17035. /* "array.pxd":114
  17036. *
  17037. * info.format = <char*> (info.shape + 1)
  17038. * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
  17039. * info.format[1] = 0
  17040. * info.obj = self
  17041. */
  17042. __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
  17043. (__pyx_v_info->format[0]) = __pyx_t_7;
  17044. /* "array.pxd":115
  17045. * info.format = <char*> (info.shape + 1)
  17046. * info.format[0] = self.ob_descr.typecode
  17047. * info.format[1] = 0 # <<<<<<<<<<<<<<
  17048. * info.obj = self
  17049. *
  17050. */
  17051. (__pyx_v_info->format[1]) = 0;
  17052. /* "array.pxd":116
  17053. * info.format[0] = self.ob_descr.typecode
  17054. * info.format[1] = 0
  17055. * info.obj = self # <<<<<<<<<<<<<<
  17056. *
  17057. * def __releasebuffer__(self, Py_buffer* info):
  17058. */
  17059. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  17060. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  17061. __Pyx_GOTREF(__pyx_v_info->obj);
  17062. __Pyx_DECREF(__pyx_v_info->obj);
  17063. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  17064. /* "array.pxd":93
  17065. * __data_union data
  17066. *
  17067. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  17068. * # This implementation of getbuffer is geared towards Cython
  17069. * # requirements, and does not yet fulfill the PEP.
  17070. */
  17071. /* function exit code */
  17072. __pyx_r = 0;
  17073. goto __pyx_L0;
  17074. __pyx_L1_error:;
  17075. __Pyx_XDECREF(__pyx_t_1);
  17076. __Pyx_XDECREF(__pyx_t_4);
  17077. __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17078. __pyx_r = -1;
  17079. if (__pyx_v_info->obj != NULL) {
  17080. __Pyx_GOTREF(__pyx_v_info->obj);
  17081. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  17082. }
  17083. goto __pyx_L2;
  17084. __pyx_L0:;
  17085. if (__pyx_v_info->obj == Py_None) {
  17086. __Pyx_GOTREF(__pyx_v_info->obj);
  17087. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  17088. }
  17089. __pyx_L2:;
  17090. __Pyx_XDECREF(__pyx_v_item_count);
  17091. __Pyx_RefNannyFinishContext();
  17092. return __pyx_r;
  17093. }
  17094. /* "array.pxd":118
  17095. * info.obj = self
  17096. *
  17097. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  17098. * PyObject_Free(info.shape)
  17099. *
  17100. */
  17101. /* Python wrapper */
  17102. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  17103. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  17104. __Pyx_RefNannyDeclarations
  17105. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  17106. __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  17107. /* function exit code */
  17108. __Pyx_RefNannyFinishContext();
  17109. }
  17110. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  17111. __Pyx_RefNannyDeclarations
  17112. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  17113. /* "array.pxd":119
  17114. *
  17115. * def __releasebuffer__(self, Py_buffer* info):
  17116. * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
  17117. *
  17118. * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
  17119. */
  17120. PyObject_Free(__pyx_v_info->shape);
  17121. /* "array.pxd":118
  17122. * info.obj = self
  17123. *
  17124. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  17125. * PyObject_Free(info.shape)
  17126. *
  17127. */
  17128. /* function exit code */
  17129. __Pyx_RefNannyFinishContext();
  17130. }
  17131. /* "array.pxd":130
  17132. *
  17133. *
  17134. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  17135. * """ fast creation of a new array, given a template array.
  17136. * type will be same as template.
  17137. */
  17138. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
  17139. arrayobject *__pyx_v_op = NULL;
  17140. arrayobject *__pyx_r = NULL;
  17141. __Pyx_RefNannyDeclarations
  17142. PyObject *__pyx_t_1 = NULL;
  17143. int __pyx_t_2;
  17144. int __pyx_t_3;
  17145. int __pyx_t_4;
  17146. __Pyx_RefNannySetupContext("clone", 0);
  17147. /* "array.pxd":134
  17148. * type will be same as template.
  17149. * if zero is true, new array will be initialized with zeroes."""
  17150. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
  17151. * if zero and op is not None:
  17152. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17153. */
  17154. __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)
  17155. __Pyx_GOTREF(__pyx_t_1);
  17156. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  17157. __pyx_t_1 = 0;
  17158. /* "array.pxd":135
  17159. * if zero is true, new array will be initialized with zeroes."""
  17160. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17161. * if zero and op is not None: # <<<<<<<<<<<<<<
  17162. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17163. * return op
  17164. */
  17165. __pyx_t_3 = (__pyx_v_zero != 0);
  17166. if (__pyx_t_3) {
  17167. } else {
  17168. __pyx_t_2 = __pyx_t_3;
  17169. goto __pyx_L4_bool_binop_done;
  17170. }
  17171. __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
  17172. __pyx_t_4 = (__pyx_t_3 != 0);
  17173. __pyx_t_2 = __pyx_t_4;
  17174. __pyx_L4_bool_binop_done:;
  17175. if (__pyx_t_2) {
  17176. /* "array.pxd":136
  17177. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17178. * if zero and op is not None:
  17179. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17180. * return op
  17181. *
  17182. */
  17183. (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
  17184. /* "array.pxd":135
  17185. * if zero is true, new array will be initialized with zeroes."""
  17186. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17187. * if zero and op is not None: # <<<<<<<<<<<<<<
  17188. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17189. * return op
  17190. */
  17191. }
  17192. /* "array.pxd":137
  17193. * if zero and op is not None:
  17194. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17195. * return op # <<<<<<<<<<<<<<
  17196. *
  17197. * cdef inline array copy(array self):
  17198. */
  17199. __Pyx_XDECREF(((PyObject *)__pyx_r));
  17200. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  17201. __pyx_r = __pyx_v_op;
  17202. goto __pyx_L0;
  17203. /* "array.pxd":130
  17204. *
  17205. *
  17206. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  17207. * """ fast creation of a new array, given a template array.
  17208. * type will be same as template.
  17209. */
  17210. /* function exit code */
  17211. __pyx_L1_error:;
  17212. __Pyx_XDECREF(__pyx_t_1);
  17213. __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17214. __pyx_r = 0;
  17215. __pyx_L0:;
  17216. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17217. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17218. __Pyx_RefNannyFinishContext();
  17219. return __pyx_r;
  17220. }
  17221. /* "array.pxd":139
  17222. * return op
  17223. *
  17224. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17225. * """ make a copy of an array. """
  17226. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17227. */
  17228. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
  17229. arrayobject *__pyx_v_op = NULL;
  17230. arrayobject *__pyx_r = NULL;
  17231. __Pyx_RefNannyDeclarations
  17232. PyObject *__pyx_t_1 = NULL;
  17233. __Pyx_RefNannySetupContext("copy", 0);
  17234. /* "array.pxd":141
  17235. * cdef inline array copy(array self):
  17236. * """ make a copy of an array. """
  17237. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
  17238. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17239. * return op
  17240. */
  17241. __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)
  17242. __Pyx_GOTREF(__pyx_t_1);
  17243. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  17244. __pyx_t_1 = 0;
  17245. /* "array.pxd":142
  17246. * """ make a copy of an array. """
  17247. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17248. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17249. * return op
  17250. *
  17251. */
  17252. (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)));
  17253. /* "array.pxd":143
  17254. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17255. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17256. * return op # <<<<<<<<<<<<<<
  17257. *
  17258. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
  17259. */
  17260. __Pyx_XDECREF(((PyObject *)__pyx_r));
  17261. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  17262. __pyx_r = __pyx_v_op;
  17263. goto __pyx_L0;
  17264. /* "array.pxd":139
  17265. * return op
  17266. *
  17267. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17268. * """ make a copy of an array. """
  17269. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17270. */
  17271. /* function exit code */
  17272. __pyx_L1_error:;
  17273. __Pyx_XDECREF(__pyx_t_1);
  17274. __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17275. __pyx_r = 0;
  17276. __pyx_L0:;
  17277. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17278. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17279. __Pyx_RefNannyFinishContext();
  17280. return __pyx_r;
  17281. }
  17282. /* "array.pxd":145
  17283. * return op
  17284. *
  17285. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17286. * """ efficient appending of new stuff of same type
  17287. * (e.g. of same array type)
  17288. */
  17289. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  17290. Py_ssize_t __pyx_v_itemsize;
  17291. Py_ssize_t __pyx_v_origsize;
  17292. int __pyx_r;
  17293. __Pyx_RefNannyDeclarations
  17294. int __pyx_t_1;
  17295. __Pyx_RefNannySetupContext("extend_buffer", 0);
  17296. /* "array.pxd":149
  17297. * (e.g. of same array type)
  17298. * n: number of elements (not number of bytes!) """
  17299. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
  17300. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17301. * resize_smart(self, origsize + n)
  17302. */
  17303. __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
  17304. __pyx_v_itemsize = __pyx_t_1;
  17305. /* "array.pxd":150
  17306. * n: number of elements (not number of bytes!) """
  17307. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17308. * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
  17309. * resize_smart(self, origsize + n)
  17310. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17311. */
  17312. __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
  17313. /* "array.pxd":151
  17314. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17315. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17316. * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
  17317. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17318. * return 0
  17319. */
  17320. __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)
  17321. /* "array.pxd":152
  17322. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17323. * resize_smart(self, origsize + n)
  17324. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
  17325. * return 0
  17326. *
  17327. */
  17328. (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
  17329. /* "array.pxd":153
  17330. * resize_smart(self, origsize + n)
  17331. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17332. * return 0 # <<<<<<<<<<<<<<
  17333. *
  17334. * cdef inline int extend(array self, array other) except -1:
  17335. */
  17336. __pyx_r = 0;
  17337. goto __pyx_L0;
  17338. /* "array.pxd":145
  17339. * return op
  17340. *
  17341. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17342. * """ efficient appending of new stuff of same type
  17343. * (e.g. of same array type)
  17344. */
  17345. /* function exit code */
  17346. __pyx_L1_error:;
  17347. __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17348. __pyx_r = -1;
  17349. __pyx_L0:;
  17350. __Pyx_RefNannyFinishContext();
  17351. return __pyx_r;
  17352. }
  17353. /* "array.pxd":155
  17354. * return 0
  17355. *
  17356. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17357. * """ extend array with data from another array; types must match. """
  17358. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17359. */
  17360. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  17361. int __pyx_r;
  17362. __Pyx_RefNannyDeclarations
  17363. int __pyx_t_1;
  17364. int __pyx_t_2;
  17365. __Pyx_RefNannySetupContext("extend", 0);
  17366. /* "array.pxd":157
  17367. * cdef inline int extend(array self, array other) except -1:
  17368. * """ extend array with data from another array; types must match. """
  17369. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17370. * PyErr_BadArgument()
  17371. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17372. */
  17373. __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
  17374. if (__pyx_t_1) {
  17375. /* "array.pxd":158
  17376. * """ extend array with data from another array; types must match. """
  17377. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17378. * PyErr_BadArgument() # <<<<<<<<<<<<<<
  17379. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17380. *
  17381. */
  17382. __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 158, __pyx_L1_error)
  17383. /* "array.pxd":157
  17384. * cdef inline int extend(array self, array other) except -1:
  17385. * """ extend array with data from another array; types must match. """
  17386. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17387. * PyErr_BadArgument()
  17388. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17389. */
  17390. }
  17391. /* "array.pxd":159
  17392. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17393. * PyErr_BadArgument()
  17394. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
  17395. *
  17396. * cdef inline void zero(array self):
  17397. */
  17398. __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)
  17399. __pyx_r = __pyx_t_2;
  17400. goto __pyx_L0;
  17401. /* "array.pxd":155
  17402. * return 0
  17403. *
  17404. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17405. * """ extend array with data from another array; types must match. """
  17406. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17407. */
  17408. /* function exit code */
  17409. __pyx_L1_error:;
  17410. __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17411. __pyx_r = -1;
  17412. __pyx_L0:;
  17413. __Pyx_RefNannyFinishContext();
  17414. return __pyx_r;
  17415. }
  17416. /* "array.pxd":161
  17417. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17418. *
  17419. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17420. * """ set all elements of array to zero. """
  17421. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17422. */
  17423. static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
  17424. __Pyx_RefNannyDeclarations
  17425. __Pyx_RefNannySetupContext("zero", 0);
  17426. /* "array.pxd":163
  17427. * cdef inline void zero(array self):
  17428. * """ set all elements of array to zero. """
  17429. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17430. */
  17431. (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
  17432. /* "array.pxd":161
  17433. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17434. *
  17435. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17436. * """ set all elements of array to zero. """
  17437. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17438. */
  17439. /* function exit code */
  17440. __Pyx_RefNannyFinishContext();
  17441. }
  17442. /* "string.to_py":31
  17443. *
  17444. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17445. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17446. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17447. * cdef extern from *:
  17448. */
  17449. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17450. PyObject *__pyx_r = NULL;
  17451. __Pyx_RefNannyDeclarations
  17452. PyObject *__pyx_t_1 = NULL;
  17453. __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
  17454. /* "string.to_py":32
  17455. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17456. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
  17457. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17458. * cdef extern from *:
  17459. * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
  17460. */
  17461. __Pyx_XDECREF(__pyx_r);
  17462. __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)
  17463. __Pyx_GOTREF(__pyx_t_1);
  17464. __pyx_r = __pyx_t_1;
  17465. __pyx_t_1 = 0;
  17466. goto __pyx_L0;
  17467. /* "string.to_py":31
  17468. *
  17469. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17470. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17471. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17472. * cdef extern from *:
  17473. */
  17474. /* function exit code */
  17475. __pyx_L1_error:;
  17476. __Pyx_XDECREF(__pyx_t_1);
  17477. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17478. __pyx_r = 0;
  17479. __pyx_L0:;
  17480. __Pyx_XGIVEREF(__pyx_r);
  17481. __Pyx_RefNannyFinishContext();
  17482. return __pyx_r;
  17483. }
  17484. /* "string.to_py":37
  17485. *
  17486. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17487. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17488. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17489. * cdef extern from *:
  17490. */
  17491. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17492. PyObject *__pyx_r = NULL;
  17493. __Pyx_RefNannyDeclarations
  17494. PyObject *__pyx_t_1 = NULL;
  17495. __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
  17496. /* "string.to_py":38
  17497. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17498. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
  17499. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17500. * cdef extern from *:
  17501. * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
  17502. */
  17503. __Pyx_XDECREF(__pyx_r);
  17504. __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)
  17505. __Pyx_GOTREF(__pyx_t_1);
  17506. __pyx_r = __pyx_t_1;
  17507. __pyx_t_1 = 0;
  17508. goto __pyx_L0;
  17509. /* "string.to_py":37
  17510. *
  17511. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17512. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17513. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17514. * cdef extern from *:
  17515. */
  17516. /* function exit code */
  17517. __pyx_L1_error:;
  17518. __Pyx_XDECREF(__pyx_t_1);
  17519. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17520. __pyx_r = 0;
  17521. __pyx_L0:;
  17522. __Pyx_XGIVEREF(__pyx_r);
  17523. __Pyx_RefNannyFinishContext();
  17524. return __pyx_r;
  17525. }
  17526. /* "string.to_py":43
  17527. *
  17528. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17529. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17530. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17531. * cdef extern from *:
  17532. */
  17533. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17534. PyObject *__pyx_r = NULL;
  17535. __Pyx_RefNannyDeclarations
  17536. PyObject *__pyx_t_1 = NULL;
  17537. __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
  17538. /* "string.to_py":44
  17539. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17540. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
  17541. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17542. * cdef extern from *:
  17543. * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
  17544. */
  17545. __Pyx_XDECREF(__pyx_r);
  17546. __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)
  17547. __Pyx_GOTREF(__pyx_t_1);
  17548. __pyx_r = __pyx_t_1;
  17549. __pyx_t_1 = 0;
  17550. goto __pyx_L0;
  17551. /* "string.to_py":43
  17552. *
  17553. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17554. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17555. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17556. * cdef extern from *:
  17557. */
  17558. /* function exit code */
  17559. __pyx_L1_error:;
  17560. __Pyx_XDECREF(__pyx_t_1);
  17561. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17562. __pyx_r = 0;
  17563. __pyx_L0:;
  17564. __Pyx_XGIVEREF(__pyx_r);
  17565. __Pyx_RefNannyFinishContext();
  17566. return __pyx_r;
  17567. }
  17568. /* "string.to_py":49
  17569. *
  17570. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17571. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17572. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17573. * cdef extern from *:
  17574. */
  17575. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17576. PyObject *__pyx_r = NULL;
  17577. __Pyx_RefNannyDeclarations
  17578. PyObject *__pyx_t_1 = NULL;
  17579. __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
  17580. /* "string.to_py":50
  17581. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17582. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
  17583. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17584. * cdef extern from *:
  17585. * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
  17586. */
  17587. __Pyx_XDECREF(__pyx_r);
  17588. __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)
  17589. __Pyx_GOTREF(__pyx_t_1);
  17590. __pyx_r = __pyx_t_1;
  17591. __pyx_t_1 = 0;
  17592. goto __pyx_L0;
  17593. /* "string.to_py":49
  17594. *
  17595. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17596. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17597. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17598. * cdef extern from *:
  17599. */
  17600. /* function exit code */
  17601. __pyx_L1_error:;
  17602. __Pyx_XDECREF(__pyx_t_1);
  17603. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17604. __pyx_r = 0;
  17605. __pyx_L0:;
  17606. __Pyx_XGIVEREF(__pyx_r);
  17607. __Pyx_RefNannyFinishContext();
  17608. return __pyx_r;
  17609. }
  17610. /* "string.to_py":55
  17611. *
  17612. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17613. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17614. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17615. *
  17616. */
  17617. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17618. PyObject *__pyx_r = NULL;
  17619. __Pyx_RefNannyDeclarations
  17620. PyObject *__pyx_t_1 = NULL;
  17621. __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
  17622. /* "string.to_py":56
  17623. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17624. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
  17625. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17626. *
  17627. */
  17628. __Pyx_XDECREF(__pyx_r);
  17629. __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)
  17630. __Pyx_GOTREF(__pyx_t_1);
  17631. __pyx_r = __pyx_t_1;
  17632. __pyx_t_1 = 0;
  17633. goto __pyx_L0;
  17634. /* "string.to_py":55
  17635. *
  17636. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17637. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17638. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17639. *
  17640. */
  17641. /* function exit code */
  17642. __pyx_L1_error:;
  17643. __Pyx_XDECREF(__pyx_t_1);
  17644. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17645. __pyx_r = 0;
  17646. __pyx_L0:;
  17647. __Pyx_XGIVEREF(__pyx_r);
  17648. __Pyx_RefNannyFinishContext();
  17649. return __pyx_r;
  17650. }
  17651. /* "string.from_py":13
  17652. *
  17653. * @cname("__pyx_convert_string_from_py_std__in_string")
  17654. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17655. * cdef Py_ssize_t length = 0
  17656. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17657. */
  17658. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  17659. Py_ssize_t __pyx_v_length;
  17660. char const *__pyx_v_data;
  17661. std::string __pyx_r;
  17662. __Pyx_RefNannyDeclarations
  17663. char const *__pyx_t_1;
  17664. __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
  17665. /* "string.from_py":14
  17666. * @cname("__pyx_convert_string_from_py_std__in_string")
  17667. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17668. * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
  17669. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17670. * return string(data, length)
  17671. */
  17672. __pyx_v_length = 0;
  17673. /* "string.from_py":15
  17674. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17675. * cdef Py_ssize_t length = 0
  17676. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
  17677. * return string(data, length)
  17678. *
  17679. */
  17680. __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)
  17681. __pyx_v_data = __pyx_t_1;
  17682. /* "string.from_py":16
  17683. * cdef Py_ssize_t length = 0
  17684. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17685. * return string(data, length) # <<<<<<<<<<<<<<
  17686. *
  17687. *
  17688. */
  17689. __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  17690. goto __pyx_L0;
  17691. /* "string.from_py":13
  17692. *
  17693. * @cname("__pyx_convert_string_from_py_std__in_string")
  17694. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17695. * cdef Py_ssize_t length = 0
  17696. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17697. */
  17698. /* function exit code */
  17699. __pyx_L1_error:;
  17700. __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17701. __Pyx_pretend_to_initialize(&__pyx_r);
  17702. __pyx_L0:;
  17703. __Pyx_RefNannyFinishContext();
  17704. return __pyx_r;
  17705. }
  17706. /* "pair.to_py":158
  17707. *
  17708. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17709. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17710. * return p.first, p.second
  17711. *
  17712. */
  17713. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &__pyx_v_p) {
  17714. PyObject *__pyx_r = NULL;
  17715. __Pyx_RefNannyDeclarations
  17716. PyObject *__pyx_t_1 = NULL;
  17717. PyObject *__pyx_t_2 = NULL;
  17718. PyObject *__pyx_t_3 = NULL;
  17719. __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_size_t____size_t", 0);
  17720. /* "pair.to_py":159
  17721. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17722. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p):
  17723. * return p.first, p.second # <<<<<<<<<<<<<<
  17724. *
  17725. *
  17726. */
  17727. __Pyx_XDECREF(__pyx_r);
  17728. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
  17729. __Pyx_GOTREF(__pyx_t_1);
  17730. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error)
  17731. __Pyx_GOTREF(__pyx_t_2);
  17732. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error)
  17733. __Pyx_GOTREF(__pyx_t_3);
  17734. __Pyx_GIVEREF(__pyx_t_1);
  17735. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  17736. __Pyx_GIVEREF(__pyx_t_2);
  17737. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  17738. __pyx_t_1 = 0;
  17739. __pyx_t_2 = 0;
  17740. __pyx_r = __pyx_t_3;
  17741. __pyx_t_3 = 0;
  17742. goto __pyx_L0;
  17743. /* "pair.to_py":158
  17744. *
  17745. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17746. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17747. * return p.first, p.second
  17748. *
  17749. */
  17750. /* function exit code */
  17751. __pyx_L1_error:;
  17752. __Pyx_XDECREF(__pyx_t_1);
  17753. __Pyx_XDECREF(__pyx_t_2);
  17754. __Pyx_XDECREF(__pyx_t_3);
  17755. __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_size_t____size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17756. __pyx_r = 0;
  17757. __pyx_L0:;
  17758. __Pyx_XGIVEREF(__pyx_r);
  17759. __Pyx_RefNannyFinishContext();
  17760. return __pyx_r;
  17761. }
  17762. /* "vector.to_py":60
  17763. *
  17764. * @cname("__pyx_convert_vector_to_py_size_t")
  17765. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17766. * return [v[i] for i in range(v.size())]
  17767. *
  17768. */
  17769. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &__pyx_v_v) {
  17770. size_t __pyx_v_i;
  17771. PyObject *__pyx_r = NULL;
  17772. __Pyx_RefNannyDeclarations
  17773. PyObject *__pyx_t_1 = NULL;
  17774. size_t __pyx_t_2;
  17775. size_t __pyx_t_3;
  17776. size_t __pyx_t_4;
  17777. PyObject *__pyx_t_5 = NULL;
  17778. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_size_t", 0);
  17779. /* "vector.to_py":61
  17780. * @cname("__pyx_convert_vector_to_py_size_t")
  17781. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v):
  17782. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17783. *
  17784. *
  17785. */
  17786. __Pyx_XDECREF(__pyx_r);
  17787. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17788. __Pyx_GOTREF(__pyx_t_1);
  17789. __pyx_t_2 = __pyx_v_v.size();
  17790. __pyx_t_3 = __pyx_t_2;
  17791. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17792. __pyx_v_i = __pyx_t_4;
  17793. __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)
  17794. __Pyx_GOTREF(__pyx_t_5);
  17795. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17796. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17797. }
  17798. __pyx_r = __pyx_t_1;
  17799. __pyx_t_1 = 0;
  17800. goto __pyx_L0;
  17801. /* "vector.to_py":60
  17802. *
  17803. * @cname("__pyx_convert_vector_to_py_size_t")
  17804. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17805. * return [v[i] for i in range(v.size())]
  17806. *
  17807. */
  17808. /* function exit code */
  17809. __pyx_L1_error:;
  17810. __Pyx_XDECREF(__pyx_t_1);
  17811. __Pyx_XDECREF(__pyx_t_5);
  17812. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17813. __pyx_r = 0;
  17814. __pyx_L0:;
  17815. __Pyx_XGIVEREF(__pyx_r);
  17816. __Pyx_RefNannyFinishContext();
  17817. return __pyx_r;
  17818. }
  17819. /* "map.from_py":174
  17820. *
  17821. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17822. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17823. * cdef dict d = o
  17824. * cdef map[X,Y] m
  17825. */
  17826. 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) {
  17827. PyObject *__pyx_v_d = 0;
  17828. std::map<std::string,std::string> __pyx_v_m;
  17829. PyObject *__pyx_v_key = NULL;
  17830. PyObject *__pyx_v_value = NULL;
  17831. std::map<std::string,std::string> __pyx_r;
  17832. __Pyx_RefNannyDeclarations
  17833. PyObject *__pyx_t_1 = NULL;
  17834. Py_ssize_t __pyx_t_2;
  17835. Py_ssize_t __pyx_t_3;
  17836. int __pyx_t_4;
  17837. PyObject *__pyx_t_5 = NULL;
  17838. PyObject *__pyx_t_6 = NULL;
  17839. int __pyx_t_7;
  17840. std::string __pyx_t_8;
  17841. std::string __pyx_t_9;
  17842. __Pyx_RefNannySetupContext("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);
  17843. /* "map.from_py":175
  17844. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17845. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
  17846. * cdef dict d = o # <<<<<<<<<<<<<<
  17847. * cdef map[X,Y] m
  17848. * for key, value in d.iteritems():
  17849. */
  17850. 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)
  17851. __pyx_t_1 = __pyx_v_o;
  17852. __Pyx_INCREF(__pyx_t_1);
  17853. __pyx_v_d = ((PyObject*)__pyx_t_1);
  17854. __pyx_t_1 = 0;
  17855. /* "map.from_py":177
  17856. * cdef dict d = o
  17857. * cdef map[X,Y] m
  17858. * for key, value in d.iteritems(): # <<<<<<<<<<<<<<
  17859. * m.insert(pair[X,Y](<X>key, <Y>value))
  17860. * return m
  17861. */
  17862. __pyx_t_2 = 0;
  17863. if (unlikely(__pyx_v_d == Py_None)) {
  17864. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
  17865. __PYX_ERR(1, 177, __pyx_L1_error)
  17866. }
  17867. __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)
  17868. __Pyx_GOTREF(__pyx_t_5);
  17869. __Pyx_XDECREF(__pyx_t_1);
  17870. __pyx_t_1 = __pyx_t_5;
  17871. __pyx_t_5 = 0;
  17872. while (1) {
  17873. __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);
  17874. if (unlikely(__pyx_t_7 == 0)) break;
  17875. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 177, __pyx_L1_error)
  17876. __Pyx_GOTREF(__pyx_t_5);
  17877. __Pyx_GOTREF(__pyx_t_6);
  17878. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  17879. __pyx_t_5 = 0;
  17880. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  17881. __pyx_t_6 = 0;
  17882. /* "map.from_py":178
  17883. * cdef map[X,Y] m
  17884. * for key, value in d.iteritems():
  17885. * m.insert(pair[X,Y](<X>key, <Y>value)) # <<<<<<<<<<<<<<
  17886. * return m
  17887. *
  17888. */
  17889. __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)
  17890. __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)
  17891. __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  17892. }
  17893. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17894. /* "map.from_py":179
  17895. * for key, value in d.iteritems():
  17896. * m.insert(pair[X,Y](<X>key, <Y>value))
  17897. * return m # <<<<<<<<<<<<<<
  17898. *
  17899. *
  17900. */
  17901. __pyx_r = __pyx_v_m;
  17902. goto __pyx_L0;
  17903. /* "map.from_py":174
  17904. *
  17905. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17906. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17907. * cdef dict d = o
  17908. * cdef map[X,Y] m
  17909. */
  17910. /* function exit code */
  17911. __pyx_L1_error:;
  17912. __Pyx_XDECREF(__pyx_t_1);
  17913. __Pyx_XDECREF(__pyx_t_5);
  17914. __Pyx_XDECREF(__pyx_t_6);
  17915. __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);
  17916. __Pyx_pretend_to_initialize(&__pyx_r);
  17917. __pyx_L0:;
  17918. __Pyx_XDECREF(__pyx_v_d);
  17919. __Pyx_XDECREF(__pyx_v_key);
  17920. __Pyx_XDECREF(__pyx_v_value);
  17921. __Pyx_RefNannyFinishContext();
  17922. return __pyx_r;
  17923. }
  17924. /* "map.to_py":201
  17925. *
  17926. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17927. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17928. * o = {}
  17929. * cdef const map[X,Y].value_type *key_value
  17930. */
  17931. 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) {
  17932. PyObject *__pyx_v_o = NULL;
  17933. std::map<std::string,std::string> ::value_type const *__pyx_v_key_value;
  17934. std::map<std::string,std::string> ::const_iterator __pyx_v_iter;
  17935. PyObject *__pyx_r = NULL;
  17936. __Pyx_RefNannyDeclarations
  17937. PyObject *__pyx_t_1 = NULL;
  17938. int __pyx_t_2;
  17939. PyObject *__pyx_t_3 = NULL;
  17940. __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", 0);
  17941. /* "map.to_py":202
  17942. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17943. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):
  17944. * o = {} # <<<<<<<<<<<<<<
  17945. * cdef const map[X,Y].value_type *key_value
  17946. * cdef map[X,Y].const_iterator iter = s.begin()
  17947. */
  17948. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17949. __Pyx_GOTREF(__pyx_t_1);
  17950. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17951. __pyx_t_1 = 0;
  17952. /* "map.to_py":204
  17953. * o = {}
  17954. * cdef const map[X,Y].value_type *key_value
  17955. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17956. * while iter != s.end():
  17957. * key_value = &cython.operator.dereference(iter)
  17958. */
  17959. __pyx_v_iter = __pyx_v_s.begin();
  17960. /* "map.to_py":205
  17961. * cdef const map[X,Y].value_type *key_value
  17962. * cdef map[X,Y].const_iterator iter = s.begin()
  17963. * while iter != s.end(): # <<<<<<<<<<<<<<
  17964. * key_value = &cython.operator.dereference(iter)
  17965. * o[key_value.first] = key_value.second
  17966. */
  17967. while (1) {
  17968. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17969. if (!__pyx_t_2) break;
  17970. /* "map.to_py":206
  17971. * cdef map[X,Y].const_iterator iter = s.begin()
  17972. * while iter != s.end():
  17973. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17974. * o[key_value.first] = key_value.second
  17975. * cython.operator.preincrement(iter)
  17976. */
  17977. __pyx_v_key_value = (&(*__pyx_v_iter));
  17978. /* "map.to_py":207
  17979. * while iter != s.end():
  17980. * key_value = &cython.operator.dereference(iter)
  17981. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17982. * cython.operator.preincrement(iter)
  17983. * return o
  17984. */
  17985. __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)
  17986. __Pyx_GOTREF(__pyx_t_1);
  17987. __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)
  17988. __Pyx_GOTREF(__pyx_t_3);
  17989. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17990. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17991. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17992. /* "map.to_py":208
  17993. * key_value = &cython.operator.dereference(iter)
  17994. * o[key_value.first] = key_value.second
  17995. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17996. * return o
  17997. *
  17998. */
  17999. (void)((++__pyx_v_iter));
  18000. }
  18001. /* "map.to_py":209
  18002. * o[key_value.first] = key_value.second
  18003. * cython.operator.preincrement(iter)
  18004. * return o # <<<<<<<<<<<<<<
  18005. *
  18006. *
  18007. */
  18008. __Pyx_XDECREF(__pyx_r);
  18009. __Pyx_INCREF(__pyx_v_o);
  18010. __pyx_r = __pyx_v_o;
  18011. goto __pyx_L0;
  18012. /* "map.to_py":201
  18013. *
  18014. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  18015. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  18016. * o = {}
  18017. * cdef const map[X,Y].value_type *key_value
  18018. */
  18019. /* function exit code */
  18020. __pyx_L1_error:;
  18021. __Pyx_XDECREF(__pyx_t_1);
  18022. __Pyx_XDECREF(__pyx_t_3);
  18023. __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18024. __pyx_r = 0;
  18025. __pyx_L0:;
  18026. __Pyx_XDECREF(__pyx_v_o);
  18027. __Pyx_XGIVEREF(__pyx_r);
  18028. __Pyx_RefNannyFinishContext();
  18029. return __pyx_r;
  18030. }
  18031. 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) {
  18032. PyObject *__pyx_v_o = NULL;
  18033. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::value_type const *__pyx_v_key_value;
  18034. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::const_iterator __pyx_v_iter;
  18035. PyObject *__pyx_r = NULL;
  18036. __Pyx_RefNannyDeclarations
  18037. PyObject *__pyx_t_1 = NULL;
  18038. int __pyx_t_2;
  18039. PyObject *__pyx_t_3 = NULL;
  18040. __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);
  18041. /* "map.to_py":202
  18042. * @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___")
  18043. * 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):
  18044. * o = {} # <<<<<<<<<<<<<<
  18045. * cdef const map[X,Y].value_type *key_value
  18046. * cdef map[X,Y].const_iterator iter = s.begin()
  18047. */
  18048. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  18049. __Pyx_GOTREF(__pyx_t_1);
  18050. __pyx_v_o = ((PyObject*)__pyx_t_1);
  18051. __pyx_t_1 = 0;
  18052. /* "map.to_py":204
  18053. * o = {}
  18054. * cdef const map[X,Y].value_type *key_value
  18055. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  18056. * while iter != s.end():
  18057. * key_value = &cython.operator.dereference(iter)
  18058. */
  18059. __pyx_v_iter = __pyx_v_s.begin();
  18060. /* "map.to_py":205
  18061. * cdef const map[X,Y].value_type *key_value
  18062. * cdef map[X,Y].const_iterator iter = s.begin()
  18063. * while iter != s.end(): # <<<<<<<<<<<<<<
  18064. * key_value = &cython.operator.dereference(iter)
  18065. * o[key_value.first] = key_value.second
  18066. */
  18067. while (1) {
  18068. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  18069. if (!__pyx_t_2) break;
  18070. /* "map.to_py":206
  18071. * cdef map[X,Y].const_iterator iter = s.begin()
  18072. * while iter != s.end():
  18073. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  18074. * o[key_value.first] = key_value.second
  18075. * cython.operator.preincrement(iter)
  18076. */
  18077. __pyx_v_key_value = (&(*__pyx_v_iter));
  18078. /* "map.to_py":207
  18079. * while iter != s.end():
  18080. * key_value = &cython.operator.dereference(iter)
  18081. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  18082. * cython.operator.preincrement(iter)
  18083. * return o
  18084. */
  18085. __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)
  18086. __Pyx_GOTREF(__pyx_t_1);
  18087. __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)
  18088. __Pyx_GOTREF(__pyx_t_3);
  18089. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  18090. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  18091. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18092. /* "map.to_py":208
  18093. * key_value = &cython.operator.dereference(iter)
  18094. * o[key_value.first] = key_value.second
  18095. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  18096. * return o
  18097. *
  18098. */
  18099. (void)((++__pyx_v_iter));
  18100. }
  18101. /* "map.to_py":209
  18102. * o[key_value.first] = key_value.second
  18103. * cython.operator.preincrement(iter)
  18104. * return o # <<<<<<<<<<<<<<
  18105. *
  18106. *
  18107. */
  18108. __Pyx_XDECREF(__pyx_r);
  18109. __Pyx_INCREF(__pyx_v_o);
  18110. __pyx_r = __pyx_v_o;
  18111. goto __pyx_L0;
  18112. /* "map.to_py":201
  18113. *
  18114. * @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___")
  18115. * 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): # <<<<<<<<<<<<<<
  18116. * o = {}
  18117. * cdef const map[X,Y].value_type *key_value
  18118. */
  18119. /* function exit code */
  18120. __pyx_L1_error:;
  18121. __Pyx_XDECREF(__pyx_t_1);
  18122. __Pyx_XDECREF(__pyx_t_3);
  18123. __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);
  18124. __pyx_r = 0;
  18125. __pyx_L0:;
  18126. __Pyx_XDECREF(__pyx_v_o);
  18127. __Pyx_XGIVEREF(__pyx_r);
  18128. __Pyx_RefNannyFinishContext();
  18129. return __pyx_r;
  18130. }
  18131. /* "vector.to_py":60
  18132. *
  18133. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18134. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18135. * return [v[i] for i in range(v.size())]
  18136. *
  18137. */
  18138. 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) {
  18139. size_t __pyx_v_i;
  18140. PyObject *__pyx_r = NULL;
  18141. __Pyx_RefNannyDeclarations
  18142. PyObject *__pyx_t_1 = NULL;
  18143. size_t __pyx_t_2;
  18144. size_t __pyx_t_3;
  18145. size_t __pyx_t_4;
  18146. PyObject *__pyx_t_5 = NULL;
  18147. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18148. /* "vector.to_py":61
  18149. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18150. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v):
  18151. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18152. *
  18153. *
  18154. */
  18155. __Pyx_XDECREF(__pyx_r);
  18156. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18157. __Pyx_GOTREF(__pyx_t_1);
  18158. __pyx_t_2 = __pyx_v_v.size();
  18159. __pyx_t_3 = __pyx_t_2;
  18160. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18161. __pyx_v_i = __pyx_t_4;
  18162. __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)
  18163. __Pyx_GOTREF(__pyx_t_5);
  18164. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18165. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18166. }
  18167. __pyx_r = __pyx_t_1;
  18168. __pyx_t_1 = 0;
  18169. goto __pyx_L0;
  18170. /* "vector.to_py":60
  18171. *
  18172. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18173. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18174. * return [v[i] for i in range(v.size())]
  18175. *
  18176. */
  18177. /* function exit code */
  18178. __pyx_L1_error:;
  18179. __Pyx_XDECREF(__pyx_t_1);
  18180. __Pyx_XDECREF(__pyx_t_5);
  18181. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18182. __pyx_r = 0;
  18183. __pyx_L0:;
  18184. __Pyx_XGIVEREF(__pyx_r);
  18185. __Pyx_RefNannyFinishContext();
  18186. return __pyx_r;
  18187. }
  18188. /* "vector.from_py":45
  18189. *
  18190. * @cname("__pyx_convert_vector_from_py_double")
  18191. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  18192. * cdef vector[X] v
  18193. * for item in o:
  18194. */
  18195. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  18196. std::vector<double> __pyx_v_v;
  18197. PyObject *__pyx_v_item = NULL;
  18198. std::vector<double> __pyx_r;
  18199. __Pyx_RefNannyDeclarations
  18200. PyObject *__pyx_t_1 = NULL;
  18201. Py_ssize_t __pyx_t_2;
  18202. PyObject *(*__pyx_t_3)(PyObject *);
  18203. PyObject *__pyx_t_4 = NULL;
  18204. double __pyx_t_5;
  18205. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  18206. /* "vector.from_py":47
  18207. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  18208. * cdef vector[X] v
  18209. * for item in o: # <<<<<<<<<<<<<<
  18210. * v.push_back(<X>item)
  18211. * return v
  18212. */
  18213. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18214. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18215. __pyx_t_3 = NULL;
  18216. } else {
  18217. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18218. __Pyx_GOTREF(__pyx_t_1);
  18219. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18220. }
  18221. for (;;) {
  18222. if (likely(!__pyx_t_3)) {
  18223. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18224. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18225. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18226. __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)
  18227. #else
  18228. __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)
  18229. __Pyx_GOTREF(__pyx_t_4);
  18230. #endif
  18231. } else {
  18232. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18233. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18234. __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)
  18235. #else
  18236. __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)
  18237. __Pyx_GOTREF(__pyx_t_4);
  18238. #endif
  18239. }
  18240. } else {
  18241. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18242. if (unlikely(!__pyx_t_4)) {
  18243. PyObject* exc_type = PyErr_Occurred();
  18244. if (exc_type) {
  18245. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18246. else __PYX_ERR(1, 47, __pyx_L1_error)
  18247. }
  18248. break;
  18249. }
  18250. __Pyx_GOTREF(__pyx_t_4);
  18251. }
  18252. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18253. __pyx_t_4 = 0;
  18254. /* "vector.from_py":48
  18255. * cdef vector[X] v
  18256. * for item in o:
  18257. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18258. * return v
  18259. *
  18260. */
  18261. __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)
  18262. __pyx_v_v.push_back(((double)__pyx_t_5));
  18263. /* "vector.from_py":47
  18264. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  18265. * cdef vector[X] v
  18266. * for item in o: # <<<<<<<<<<<<<<
  18267. * v.push_back(<X>item)
  18268. * return v
  18269. */
  18270. }
  18271. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18272. /* "vector.from_py":49
  18273. * for item in o:
  18274. * v.push_back(<X>item)
  18275. * return v # <<<<<<<<<<<<<<
  18276. *
  18277. *
  18278. */
  18279. __pyx_r = __pyx_v_v;
  18280. goto __pyx_L0;
  18281. /* "vector.from_py":45
  18282. *
  18283. * @cname("__pyx_convert_vector_from_py_double")
  18284. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  18285. * cdef vector[X] v
  18286. * for item in o:
  18287. */
  18288. /* function exit code */
  18289. __pyx_L1_error:;
  18290. __Pyx_XDECREF(__pyx_t_1);
  18291. __Pyx_XDECREF(__pyx_t_4);
  18292. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18293. __Pyx_pretend_to_initialize(&__pyx_r);
  18294. __pyx_L0:;
  18295. __Pyx_XDECREF(__pyx_v_item);
  18296. __Pyx_RefNannyFinishContext();
  18297. return __pyx_r;
  18298. }
  18299. /* "vector.to_py":60
  18300. *
  18301. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18302. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18303. * return [v[i] for i in range(v.size())]
  18304. *
  18305. */
  18306. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &__pyx_v_v) {
  18307. size_t __pyx_v_i;
  18308. PyObject *__pyx_r = NULL;
  18309. __Pyx_RefNannyDeclarations
  18310. PyObject *__pyx_t_1 = NULL;
  18311. size_t __pyx_t_2;
  18312. size_t __pyx_t_3;
  18313. size_t __pyx_t_4;
  18314. PyObject *__pyx_t_5 = NULL;
  18315. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_npy_uint64", 0);
  18316. /* "vector.to_py":61
  18317. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18318. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v):
  18319. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18320. *
  18321. *
  18322. */
  18323. __Pyx_XDECREF(__pyx_r);
  18324. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18325. __Pyx_GOTREF(__pyx_t_1);
  18326. __pyx_t_2 = __pyx_v_v.size();
  18327. __pyx_t_3 = __pyx_t_2;
  18328. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18329. __pyx_v_i = __pyx_t_4;
  18330. __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)
  18331. __Pyx_GOTREF(__pyx_t_5);
  18332. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18333. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18334. }
  18335. __pyx_r = __pyx_t_1;
  18336. __pyx_t_1 = 0;
  18337. goto __pyx_L0;
  18338. /* "vector.to_py":60
  18339. *
  18340. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18341. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18342. * return [v[i] for i in range(v.size())]
  18343. *
  18344. */
  18345. /* function exit code */
  18346. __pyx_L1_error:;
  18347. __Pyx_XDECREF(__pyx_t_1);
  18348. __Pyx_XDECREF(__pyx_t_5);
  18349. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_npy_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18350. __pyx_r = 0;
  18351. __pyx_L0:;
  18352. __Pyx_XGIVEREF(__pyx_r);
  18353. __Pyx_RefNannyFinishContext();
  18354. return __pyx_r;
  18355. }
  18356. 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) {
  18357. size_t __pyx_v_i;
  18358. PyObject *__pyx_r = NULL;
  18359. __Pyx_RefNannyDeclarations
  18360. PyObject *__pyx_t_1 = NULL;
  18361. size_t __pyx_t_2;
  18362. size_t __pyx_t_3;
  18363. size_t __pyx_t_4;
  18364. PyObject *__pyx_t_5 = NULL;
  18365. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  18366. /* "vector.to_py":61
  18367. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18368. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v):
  18369. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18370. *
  18371. *
  18372. */
  18373. __Pyx_XDECREF(__pyx_r);
  18374. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18375. __Pyx_GOTREF(__pyx_t_1);
  18376. __pyx_t_2 = __pyx_v_v.size();
  18377. __pyx_t_3 = __pyx_t_2;
  18378. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18379. __pyx_v_i = __pyx_t_4;
  18380. __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)
  18381. __Pyx_GOTREF(__pyx_t_5);
  18382. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18383. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18384. }
  18385. __pyx_r = __pyx_t_1;
  18386. __pyx_t_1 = 0;
  18387. goto __pyx_L0;
  18388. /* "vector.to_py":60
  18389. *
  18390. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18391. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18392. * return [v[i] for i in range(v.size())]
  18393. *
  18394. */
  18395. /* function exit code */
  18396. __pyx_L1_error:;
  18397. __Pyx_XDECREF(__pyx_t_1);
  18398. __Pyx_XDECREF(__pyx_t_5);
  18399. __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);
  18400. __pyx_r = 0;
  18401. __pyx_L0:;
  18402. __Pyx_XGIVEREF(__pyx_r);
  18403. __Pyx_RefNannyFinishContext();
  18404. return __pyx_r;
  18405. }
  18406. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &__pyx_v_v) {
  18407. size_t __pyx_v_i;
  18408. PyObject *__pyx_r = NULL;
  18409. __Pyx_RefNannyDeclarations
  18410. PyObject *__pyx_t_1 = NULL;
  18411. size_t __pyx_t_2;
  18412. size_t __pyx_t_3;
  18413. size_t __pyx_t_4;
  18414. PyObject *__pyx_t_5 = NULL;
  18415. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0);
  18416. /* "vector.to_py":61
  18417. * @cname("__pyx_convert_vector_to_py_int")
  18418. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v):
  18419. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18420. *
  18421. *
  18422. */
  18423. __Pyx_XDECREF(__pyx_r);
  18424. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18425. __Pyx_GOTREF(__pyx_t_1);
  18426. __pyx_t_2 = __pyx_v_v.size();
  18427. __pyx_t_3 = __pyx_t_2;
  18428. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18429. __pyx_v_i = __pyx_t_4;
  18430. __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)
  18431. __Pyx_GOTREF(__pyx_t_5);
  18432. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18433. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18434. }
  18435. __pyx_r = __pyx_t_1;
  18436. __pyx_t_1 = 0;
  18437. goto __pyx_L0;
  18438. /* "vector.to_py":60
  18439. *
  18440. * @cname("__pyx_convert_vector_to_py_int")
  18441. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<<
  18442. * return [v[i] for i in range(v.size())]
  18443. *
  18444. */
  18445. /* function exit code */
  18446. __pyx_L1_error:;
  18447. __Pyx_XDECREF(__pyx_t_1);
  18448. __Pyx_XDECREF(__pyx_t_5);
  18449. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18450. __pyx_r = 0;
  18451. __pyx_L0:;
  18452. __Pyx_XGIVEREF(__pyx_r);
  18453. __Pyx_RefNannyFinishContext();
  18454. return __pyx_r;
  18455. }
  18456. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &__pyx_v_v) {
  18457. size_t __pyx_v_i;
  18458. PyObject *__pyx_r = NULL;
  18459. __Pyx_RefNannyDeclarations
  18460. PyObject *__pyx_t_1 = NULL;
  18461. size_t __pyx_t_2;
  18462. size_t __pyx_t_3;
  18463. size_t __pyx_t_4;
  18464. PyObject *__pyx_t_5 = NULL;
  18465. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", 0);
  18466. /* "vector.to_py":61
  18467. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18468. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v):
  18469. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18470. *
  18471. *
  18472. */
  18473. __Pyx_XDECREF(__pyx_r);
  18474. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18475. __Pyx_GOTREF(__pyx_t_1);
  18476. __pyx_t_2 = __pyx_v_v.size();
  18477. __pyx_t_3 = __pyx_t_2;
  18478. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18479. __pyx_v_i = __pyx_t_4;
  18480. __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)
  18481. __Pyx_GOTREF(__pyx_t_5);
  18482. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18483. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18484. }
  18485. __pyx_r = __pyx_t_1;
  18486. __pyx_t_1 = 0;
  18487. goto __pyx_L0;
  18488. /* "vector.to_py":60
  18489. *
  18490. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18491. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18492. * return [v[i] for i in range(v.size())]
  18493. *
  18494. */
  18495. /* function exit code */
  18496. __pyx_L1_error:;
  18497. __Pyx_XDECREF(__pyx_t_1);
  18498. __Pyx_XDECREF(__pyx_t_5);
  18499. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18500. __pyx_r = 0;
  18501. __pyx_L0:;
  18502. __Pyx_XGIVEREF(__pyx_r);
  18503. __Pyx_RefNannyFinishContext();
  18504. return __pyx_r;
  18505. }
  18506. 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) {
  18507. size_t __pyx_v_i;
  18508. PyObject *__pyx_r = NULL;
  18509. __Pyx_RefNannyDeclarations
  18510. PyObject *__pyx_t_1 = NULL;
  18511. size_t __pyx_t_2;
  18512. size_t __pyx_t_3;
  18513. size_t __pyx_t_4;
  18514. PyObject *__pyx_t_5 = NULL;
  18515. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", 0);
  18516. /* "vector.to_py":61
  18517. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18518. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v):
  18519. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18520. *
  18521. *
  18522. */
  18523. __Pyx_XDECREF(__pyx_r);
  18524. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18525. __Pyx_GOTREF(__pyx_t_1);
  18526. __pyx_t_2 = __pyx_v_v.size();
  18527. __pyx_t_3 = __pyx_t_2;
  18528. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18529. __pyx_v_i = __pyx_t_4;
  18530. __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)
  18531. __Pyx_GOTREF(__pyx_t_5);
  18532. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18533. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18534. }
  18535. __pyx_r = __pyx_t_1;
  18536. __pyx_t_1 = 0;
  18537. goto __pyx_L0;
  18538. /* "vector.to_py":60
  18539. *
  18540. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18541. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18542. * return [v[i] for i in range(v.size())]
  18543. *
  18544. */
  18545. /* function exit code */
  18546. __pyx_L1_error:;
  18547. __Pyx_XDECREF(__pyx_t_1);
  18548. __Pyx_XDECREF(__pyx_t_5);
  18549. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18550. __pyx_r = 0;
  18551. __pyx_L0:;
  18552. __Pyx_XGIVEREF(__pyx_r);
  18553. __Pyx_RefNannyFinishContext();
  18554. return __pyx_r;
  18555. }
  18556. /* "vector.from_py":45
  18557. *
  18558. * @cname("__pyx_convert_vector_from_py_size_t")
  18559. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18560. * cdef vector[X] v
  18561. * for item in o:
  18562. */
  18563. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *__pyx_v_o) {
  18564. std::vector<size_t> __pyx_v_v;
  18565. PyObject *__pyx_v_item = NULL;
  18566. std::vector<size_t> __pyx_r;
  18567. __Pyx_RefNannyDeclarations
  18568. PyObject *__pyx_t_1 = NULL;
  18569. Py_ssize_t __pyx_t_2;
  18570. PyObject *(*__pyx_t_3)(PyObject *);
  18571. PyObject *__pyx_t_4 = NULL;
  18572. size_t __pyx_t_5;
  18573. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_size_t", 0);
  18574. /* "vector.from_py":47
  18575. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18576. * cdef vector[X] v
  18577. * for item in o: # <<<<<<<<<<<<<<
  18578. * v.push_back(<X>item)
  18579. * return v
  18580. */
  18581. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18582. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18583. __pyx_t_3 = NULL;
  18584. } else {
  18585. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18586. __Pyx_GOTREF(__pyx_t_1);
  18587. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18588. }
  18589. for (;;) {
  18590. if (likely(!__pyx_t_3)) {
  18591. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18592. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18593. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18594. __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)
  18595. #else
  18596. __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)
  18597. __Pyx_GOTREF(__pyx_t_4);
  18598. #endif
  18599. } else {
  18600. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18601. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18602. __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)
  18603. #else
  18604. __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)
  18605. __Pyx_GOTREF(__pyx_t_4);
  18606. #endif
  18607. }
  18608. } else {
  18609. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18610. if (unlikely(!__pyx_t_4)) {
  18611. PyObject* exc_type = PyErr_Occurred();
  18612. if (exc_type) {
  18613. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18614. else __PYX_ERR(1, 47, __pyx_L1_error)
  18615. }
  18616. break;
  18617. }
  18618. __Pyx_GOTREF(__pyx_t_4);
  18619. }
  18620. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18621. __pyx_t_4 = 0;
  18622. /* "vector.from_py":48
  18623. * cdef vector[X] v
  18624. * for item in o:
  18625. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18626. * return v
  18627. *
  18628. */
  18629. __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)
  18630. __pyx_v_v.push_back(((size_t)__pyx_t_5));
  18631. /* "vector.from_py":47
  18632. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18633. * cdef vector[X] v
  18634. * for item in o: # <<<<<<<<<<<<<<
  18635. * v.push_back(<X>item)
  18636. * return v
  18637. */
  18638. }
  18639. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18640. /* "vector.from_py":49
  18641. * for item in o:
  18642. * v.push_back(<X>item)
  18643. * return v # <<<<<<<<<<<<<<
  18644. *
  18645. *
  18646. */
  18647. __pyx_r = __pyx_v_v;
  18648. goto __pyx_L0;
  18649. /* "vector.from_py":45
  18650. *
  18651. * @cname("__pyx_convert_vector_from_py_size_t")
  18652. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18653. * cdef vector[X] v
  18654. * for item in o:
  18655. */
  18656. /* function exit code */
  18657. __pyx_L1_error:;
  18658. __Pyx_XDECREF(__pyx_t_1);
  18659. __Pyx_XDECREF(__pyx_t_4);
  18660. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18661. __Pyx_pretend_to_initialize(&__pyx_r);
  18662. __pyx_L0:;
  18663. __Pyx_XDECREF(__pyx_v_item);
  18664. __Pyx_RefNannyFinishContext();
  18665. return __pyx_r;
  18666. }
  18667. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *__pyx_v_o) {
  18668. std::vector<std::vector<size_t> > __pyx_v_v;
  18669. PyObject *__pyx_v_item = NULL;
  18670. std::vector<std::vector<size_t> > __pyx_r;
  18671. __Pyx_RefNannyDeclarations
  18672. PyObject *__pyx_t_1 = NULL;
  18673. Py_ssize_t __pyx_t_2;
  18674. PyObject *(*__pyx_t_3)(PyObject *);
  18675. PyObject *__pyx_t_4 = NULL;
  18676. std::vector<size_t> __pyx_t_5;
  18677. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18678. /* "vector.from_py":47
  18679. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18680. * cdef vector[X] v
  18681. * for item in o: # <<<<<<<<<<<<<<
  18682. * v.push_back(<X>item)
  18683. * return v
  18684. */
  18685. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18686. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18687. __pyx_t_3 = NULL;
  18688. } else {
  18689. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18690. __Pyx_GOTREF(__pyx_t_1);
  18691. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18692. }
  18693. for (;;) {
  18694. if (likely(!__pyx_t_3)) {
  18695. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18696. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18697. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18698. __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)
  18699. #else
  18700. __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)
  18701. __Pyx_GOTREF(__pyx_t_4);
  18702. #endif
  18703. } else {
  18704. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18705. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18706. __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)
  18707. #else
  18708. __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)
  18709. __Pyx_GOTREF(__pyx_t_4);
  18710. #endif
  18711. }
  18712. } else {
  18713. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18714. if (unlikely(!__pyx_t_4)) {
  18715. PyObject* exc_type = PyErr_Occurred();
  18716. if (exc_type) {
  18717. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18718. else __PYX_ERR(1, 47, __pyx_L1_error)
  18719. }
  18720. break;
  18721. }
  18722. __Pyx_GOTREF(__pyx_t_4);
  18723. }
  18724. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18725. __pyx_t_4 = 0;
  18726. /* "vector.from_py":48
  18727. * cdef vector[X] v
  18728. * for item in o:
  18729. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18730. * return v
  18731. *
  18732. */
  18733. __pyx_t_5 = __pyx_convert_vector_from_py_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18734. __pyx_v_v.push_back(((std::vector<size_t> )__pyx_t_5));
  18735. /* "vector.from_py":47
  18736. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18737. * cdef vector[X] v
  18738. * for item in o: # <<<<<<<<<<<<<<
  18739. * v.push_back(<X>item)
  18740. * return v
  18741. */
  18742. }
  18743. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18744. /* "vector.from_py":49
  18745. * for item in o:
  18746. * v.push_back(<X>item)
  18747. * return v # <<<<<<<<<<<<<<
  18748. *
  18749. *
  18750. */
  18751. __pyx_r = __pyx_v_v;
  18752. goto __pyx_L0;
  18753. /* "vector.from_py":45
  18754. *
  18755. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___")
  18756. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  18757. * cdef vector[X] v
  18758. * for item in o:
  18759. */
  18760. /* function exit code */
  18761. __pyx_L1_error:;
  18762. __Pyx_XDECREF(__pyx_t_1);
  18763. __Pyx_XDECREF(__pyx_t_4);
  18764. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18765. __Pyx_pretend_to_initialize(&__pyx_r);
  18766. __pyx_L0:;
  18767. __Pyx_XDECREF(__pyx_v_item);
  18768. __Pyx_RefNannyFinishContext();
  18769. return __pyx_r;
  18770. }
  18771. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *__pyx_v_o) {
  18772. std::vector<std::vector<double> > __pyx_v_v;
  18773. PyObject *__pyx_v_item = NULL;
  18774. std::vector<std::vector<double> > __pyx_r;
  18775. __Pyx_RefNannyDeclarations
  18776. PyObject *__pyx_t_1 = NULL;
  18777. Py_ssize_t __pyx_t_2;
  18778. PyObject *(*__pyx_t_3)(PyObject *);
  18779. PyObject *__pyx_t_4 = NULL;
  18780. std::vector<double> __pyx_t_5;
  18781. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", 0);
  18782. /* "vector.from_py":47
  18783. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18784. * cdef vector[X] v
  18785. * for item in o: # <<<<<<<<<<<<<<
  18786. * v.push_back(<X>item)
  18787. * return v
  18788. */
  18789. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18790. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18791. __pyx_t_3 = NULL;
  18792. } else {
  18793. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18794. __Pyx_GOTREF(__pyx_t_1);
  18795. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18796. }
  18797. for (;;) {
  18798. if (likely(!__pyx_t_3)) {
  18799. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18800. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18801. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18802. __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)
  18803. #else
  18804. __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)
  18805. __Pyx_GOTREF(__pyx_t_4);
  18806. #endif
  18807. } else {
  18808. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18809. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18810. __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)
  18811. #else
  18812. __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)
  18813. __Pyx_GOTREF(__pyx_t_4);
  18814. #endif
  18815. }
  18816. } else {
  18817. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18818. if (unlikely(!__pyx_t_4)) {
  18819. PyObject* exc_type = PyErr_Occurred();
  18820. if (exc_type) {
  18821. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18822. else __PYX_ERR(1, 47, __pyx_L1_error)
  18823. }
  18824. break;
  18825. }
  18826. __Pyx_GOTREF(__pyx_t_4);
  18827. }
  18828. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18829. __pyx_t_4 = 0;
  18830. /* "vector.from_py":48
  18831. * cdef vector[X] v
  18832. * for item in o:
  18833. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18834. * return v
  18835. *
  18836. */
  18837. __pyx_t_5 = __pyx_convert_vector_from_py_double(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18838. __pyx_v_v.push_back(((std::vector<double> )__pyx_t_5));
  18839. /* "vector.from_py":47
  18840. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18841. * cdef vector[X] v
  18842. * for item in o: # <<<<<<<<<<<<<<
  18843. * v.push_back(<X>item)
  18844. * return v
  18845. */
  18846. }
  18847. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18848. /* "vector.from_py":49
  18849. * for item in o:
  18850. * v.push_back(<X>item)
  18851. * return v # <<<<<<<<<<<<<<
  18852. *
  18853. *
  18854. */
  18855. __pyx_r = __pyx_v_v;
  18856. goto __pyx_L0;
  18857. /* "vector.from_py":45
  18858. *
  18859. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___")
  18860. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *: # <<<<<<<<<<<<<<
  18861. * cdef vector[X] v
  18862. * for item in o:
  18863. */
  18864. /* function exit code */
  18865. __pyx_L1_error:;
  18866. __Pyx_XDECREF(__pyx_t_1);
  18867. __Pyx_XDECREF(__pyx_t_4);
  18868. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18869. __Pyx_pretend_to_initialize(&__pyx_r);
  18870. __pyx_L0:;
  18871. __Pyx_XDECREF(__pyx_v_item);
  18872. __Pyx_RefNannyFinishContext();
  18873. return __pyx_r;
  18874. }
  18875. /* "vector.to_py":60
  18876. *
  18877. * @cname("__pyx_convert_vector_to_py_double")
  18878. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18879. * return [v[i] for i in range(v.size())]
  18880. *
  18881. */
  18882. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &__pyx_v_v) {
  18883. size_t __pyx_v_i;
  18884. PyObject *__pyx_r = NULL;
  18885. __Pyx_RefNannyDeclarations
  18886. PyObject *__pyx_t_1 = NULL;
  18887. size_t __pyx_t_2;
  18888. size_t __pyx_t_3;
  18889. size_t __pyx_t_4;
  18890. PyObject *__pyx_t_5 = NULL;
  18891. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
  18892. /* "vector.to_py":61
  18893. * @cname("__pyx_convert_vector_to_py_double")
  18894. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):
  18895. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18896. *
  18897. *
  18898. */
  18899. __Pyx_XDECREF(__pyx_r);
  18900. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18901. __Pyx_GOTREF(__pyx_t_1);
  18902. __pyx_t_2 = __pyx_v_v.size();
  18903. __pyx_t_3 = __pyx_t_2;
  18904. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18905. __pyx_v_i = __pyx_t_4;
  18906. __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  18907. __Pyx_GOTREF(__pyx_t_5);
  18908. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18909. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18910. }
  18911. __pyx_r = __pyx_t_1;
  18912. __pyx_t_1 = 0;
  18913. goto __pyx_L0;
  18914. /* "vector.to_py":60
  18915. *
  18916. * @cname("__pyx_convert_vector_to_py_double")
  18917. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18918. * return [v[i] for i in range(v.size())]
  18919. *
  18920. */
  18921. /* function exit code */
  18922. __pyx_L1_error:;
  18923. __Pyx_XDECREF(__pyx_t_1);
  18924. __Pyx_XDECREF(__pyx_t_5);
  18925. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18926. __pyx_r = 0;
  18927. __pyx_L0:;
  18928. __Pyx_XGIVEREF(__pyx_r);
  18929. __Pyx_RefNannyFinishContext();
  18930. return __pyx_r;
  18931. }
  18932. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &__pyx_v_v) {
  18933. size_t __pyx_v_i;
  18934. PyObject *__pyx_r = NULL;
  18935. __Pyx_RefNannyDeclarations
  18936. PyObject *__pyx_t_1 = NULL;
  18937. size_t __pyx_t_2;
  18938. size_t __pyx_t_3;
  18939. size_t __pyx_t_4;
  18940. PyObject *__pyx_t_5 = NULL;
  18941. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", 0);
  18942. /* "vector.to_py":61
  18943. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18944. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v):
  18945. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18946. *
  18947. *
  18948. */
  18949. __Pyx_XDECREF(__pyx_r);
  18950. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18951. __Pyx_GOTREF(__pyx_t_1);
  18952. __pyx_t_2 = __pyx_v_v.size();
  18953. __pyx_t_3 = __pyx_t_2;
  18954. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18955. __pyx_v_i = __pyx_t_4;
  18956. __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)
  18957. __Pyx_GOTREF(__pyx_t_5);
  18958. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18959. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18960. }
  18961. __pyx_r = __pyx_t_1;
  18962. __pyx_t_1 = 0;
  18963. goto __pyx_L0;
  18964. /* "vector.to_py":60
  18965. *
  18966. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18967. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18968. * return [v[i] for i in range(v.size())]
  18969. *
  18970. */
  18971. /* function exit code */
  18972. __pyx_L1_error:;
  18973. __Pyx_XDECREF(__pyx_t_1);
  18974. __Pyx_XDECREF(__pyx_t_5);
  18975. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18976. __pyx_r = 0;
  18977. __pyx_L0:;
  18978. __Pyx_XGIVEREF(__pyx_r);
  18979. __Pyx_RefNannyFinishContext();
  18980. return __pyx_r;
  18981. }
  18982. /* "vector.from_py":45
  18983. *
  18984. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18985. * 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 *: # <<<<<<<<<<<<<<
  18986. * cdef vector[X] v
  18987. * for item in o:
  18988. */
  18989. 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) {
  18990. std::vector<std::map<std::string,std::string> > __pyx_v_v;
  18991. PyObject *__pyx_v_item = NULL;
  18992. std::vector<std::map<std::string,std::string> > __pyx_r;
  18993. __Pyx_RefNannyDeclarations
  18994. PyObject *__pyx_t_1 = NULL;
  18995. Py_ssize_t __pyx_t_2;
  18996. PyObject *(*__pyx_t_3)(PyObject *);
  18997. PyObject *__pyx_t_4 = NULL;
  18998. std::map<std::string,std::string> __pyx_t_5;
  18999. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);
  19000. /* "vector.from_py":47
  19001. * 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 *:
  19002. * cdef vector[X] v
  19003. * for item in o: # <<<<<<<<<<<<<<
  19004. * v.push_back(<X>item)
  19005. * return v
  19006. */
  19007. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  19008. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  19009. __pyx_t_3 = NULL;
  19010. } else {
  19011. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  19012. __Pyx_GOTREF(__pyx_t_1);
  19013. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  19014. }
  19015. for (;;) {
  19016. if (likely(!__pyx_t_3)) {
  19017. if (likely(PyList_CheckExact(__pyx_t_1))) {
  19018. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  19019. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19020. __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)
  19021. #else
  19022. __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)
  19023. __Pyx_GOTREF(__pyx_t_4);
  19024. #endif
  19025. } else {
  19026. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  19027. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19028. __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)
  19029. #else
  19030. __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)
  19031. __Pyx_GOTREF(__pyx_t_4);
  19032. #endif
  19033. }
  19034. } else {
  19035. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  19036. if (unlikely(!__pyx_t_4)) {
  19037. PyObject* exc_type = PyErr_Occurred();
  19038. if (exc_type) {
  19039. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  19040. else __PYX_ERR(1, 47, __pyx_L1_error)
  19041. }
  19042. break;
  19043. }
  19044. __Pyx_GOTREF(__pyx_t_4);
  19045. }
  19046. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  19047. __pyx_t_4 = 0;
  19048. /* "vector.from_py":48
  19049. * cdef vector[X] v
  19050. * for item in o:
  19051. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  19052. * return v
  19053. *
  19054. */
  19055. __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)
  19056. __pyx_v_v.push_back(((std::map<std::string,std::string> )__pyx_t_5));
  19057. /* "vector.from_py":47
  19058. * 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 *:
  19059. * cdef vector[X] v
  19060. * for item in o: # <<<<<<<<<<<<<<
  19061. * v.push_back(<X>item)
  19062. * return v
  19063. */
  19064. }
  19065. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19066. /* "vector.from_py":49
  19067. * for item in o:
  19068. * v.push_back(<X>item)
  19069. * return v # <<<<<<<<<<<<<<
  19070. *
  19071. *
  19072. */
  19073. __pyx_r = __pyx_v_v;
  19074. goto __pyx_L0;
  19075. /* "vector.from_py":45
  19076. *
  19077. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  19078. * 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 *: # <<<<<<<<<<<<<<
  19079. * cdef vector[X] v
  19080. * for item in o:
  19081. */
  19082. /* function exit code */
  19083. __pyx_L1_error:;
  19084. __Pyx_XDECREF(__pyx_t_1);
  19085. __Pyx_XDECREF(__pyx_t_4);
  19086. __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);
  19087. __Pyx_pretend_to_initialize(&__pyx_r);
  19088. __pyx_L0:;
  19089. __Pyx_XDECREF(__pyx_v_item);
  19090. __Pyx_RefNannyFinishContext();
  19091. return __pyx_r;
  19092. }
  19093. /* "pair.from_py":145
  19094. *
  19095. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19096. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<<
  19097. * x, y = o
  19098. * return pair[X,Y](<X>x, <Y>y)
  19099. */
  19100. static std::pair<size_t,size_t> __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *__pyx_v_o) {
  19101. PyObject *__pyx_v_x = NULL;
  19102. PyObject *__pyx_v_y = NULL;
  19103. std::pair<size_t,size_t> __pyx_r;
  19104. __Pyx_RefNannyDeclarations
  19105. PyObject *__pyx_t_1 = NULL;
  19106. PyObject *__pyx_t_2 = NULL;
  19107. PyObject *__pyx_t_3 = NULL;
  19108. PyObject *(*__pyx_t_4)(PyObject *);
  19109. size_t __pyx_t_5;
  19110. size_t __pyx_t_6;
  19111. __Pyx_RefNannySetupContext("__pyx_convert_pair_from_py_size_t__and_size_t", 0);
  19112. /* "pair.from_py":146
  19113. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19114. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *:
  19115. * x, y = o # <<<<<<<<<<<<<<
  19116. * return pair[X,Y](<X>x, <Y>y)
  19117. *
  19118. */
  19119. if ((likely(PyTuple_CheckExact(__pyx_v_o))) || (PyList_CheckExact(__pyx_v_o))) {
  19120. PyObject* sequence = __pyx_v_o;
  19121. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  19122. if (unlikely(size != 2)) {
  19123. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  19124. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  19125. __PYX_ERR(1, 146, __pyx_L1_error)
  19126. }
  19127. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19128. if (likely(PyTuple_CheckExact(sequence))) {
  19129. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  19130. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
  19131. } else {
  19132. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  19133. __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
  19134. }
  19135. __Pyx_INCREF(__pyx_t_1);
  19136. __Pyx_INCREF(__pyx_t_2);
  19137. #else
  19138. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error)
  19139. __Pyx_GOTREF(__pyx_t_1);
  19140. __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error)
  19141. __Pyx_GOTREF(__pyx_t_2);
  19142. #endif
  19143. } else {
  19144. Py_ssize_t index = -1;
  19145. __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 146, __pyx_L1_error)
  19146. __Pyx_GOTREF(__pyx_t_3);
  19147. __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
  19148. index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
  19149. __Pyx_GOTREF(__pyx_t_1);
  19150. index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  19151. __Pyx_GOTREF(__pyx_t_2);
  19152. if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 146, __pyx_L1_error)
  19153. __pyx_t_4 = NULL;
  19154. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19155. goto __pyx_L4_unpacking_done;
  19156. __pyx_L3_unpacking_failed:;
  19157. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19158. __pyx_t_4 = NULL;
  19159. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  19160. __PYX_ERR(1, 146, __pyx_L1_error)
  19161. __pyx_L4_unpacking_done:;
  19162. }
  19163. __pyx_v_x = __pyx_t_1;
  19164. __pyx_t_1 = 0;
  19165. __pyx_v_y = __pyx_t_2;
  19166. __pyx_t_2 = 0;
  19167. /* "pair.from_py":147
  19168. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *:
  19169. * x, y = o
  19170. * return pair[X,Y](<X>x, <Y>y) # <<<<<<<<<<<<<<
  19171. *
  19172. *
  19173. */
  19174. __pyx_t_5 = __Pyx_PyInt_As_size_t(__pyx_v_x); if (unlikely((__pyx_t_5 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error)
  19175. __pyx_t_6 = __Pyx_PyInt_As_size_t(__pyx_v_y); if (unlikely((__pyx_t_6 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 147, __pyx_L1_error)
  19176. __pyx_r = std::pair<size_t,size_t> (((size_t)__pyx_t_5), ((size_t)__pyx_t_6));
  19177. goto __pyx_L0;
  19178. /* "pair.from_py":145
  19179. *
  19180. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19181. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<<
  19182. * x, y = o
  19183. * return pair[X,Y](<X>x, <Y>y)
  19184. */
  19185. /* function exit code */
  19186. __pyx_L1_error:;
  19187. __Pyx_XDECREF(__pyx_t_1);
  19188. __Pyx_XDECREF(__pyx_t_2);
  19189. __Pyx_XDECREF(__pyx_t_3);
  19190. __Pyx_AddTraceback("pair.from_py.__pyx_convert_pair_from_py_size_t__and_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  19191. __Pyx_pretend_to_initialize(&__pyx_r);
  19192. __pyx_L0:;
  19193. __Pyx_XDECREF(__pyx_v_x);
  19194. __Pyx_XDECREF(__pyx_v_y);
  19195. __Pyx_RefNannyFinishContext();
  19196. return __pyx_r;
  19197. }
  19198. /* "vector.from_py":45
  19199. *
  19200. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  19201. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  19202. * cdef vector[X] v
  19203. * for item in o:
  19204. */
  19205. static std::vector<std::pair<size_t,size_t> > __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(PyObject *__pyx_v_o) {
  19206. std::vector<std::pair<size_t,size_t> > __pyx_v_v;
  19207. PyObject *__pyx_v_item = NULL;
  19208. std::vector<std::pair<size_t,size_t> > __pyx_r;
  19209. __Pyx_RefNannyDeclarations
  19210. PyObject *__pyx_t_1 = NULL;
  19211. Py_ssize_t __pyx_t_2;
  19212. PyObject *(*__pyx_t_3)(PyObject *);
  19213. PyObject *__pyx_t_4 = NULL;
  19214. std::pair<size_t,size_t> __pyx_t_5;
  19215. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  19216. /* "vector.from_py":47
  19217. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *:
  19218. * cdef vector[X] v
  19219. * for item in o: # <<<<<<<<<<<<<<
  19220. * v.push_back(<X>item)
  19221. * return v
  19222. */
  19223. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  19224. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  19225. __pyx_t_3 = NULL;
  19226. } else {
  19227. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  19228. __Pyx_GOTREF(__pyx_t_1);
  19229. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  19230. }
  19231. for (;;) {
  19232. if (likely(!__pyx_t_3)) {
  19233. if (likely(PyList_CheckExact(__pyx_t_1))) {
  19234. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  19235. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19236. __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)
  19237. #else
  19238. __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)
  19239. __Pyx_GOTREF(__pyx_t_4);
  19240. #endif
  19241. } else {
  19242. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  19243. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19244. __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)
  19245. #else
  19246. __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)
  19247. __Pyx_GOTREF(__pyx_t_4);
  19248. #endif
  19249. }
  19250. } else {
  19251. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  19252. if (unlikely(!__pyx_t_4)) {
  19253. PyObject* exc_type = PyErr_Occurred();
  19254. if (exc_type) {
  19255. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  19256. else __PYX_ERR(1, 47, __pyx_L1_error)
  19257. }
  19258. break;
  19259. }
  19260. __Pyx_GOTREF(__pyx_t_4);
  19261. }
  19262. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  19263. __pyx_t_4 = 0;
  19264. /* "vector.from_py":48
  19265. * cdef vector[X] v
  19266. * for item in o:
  19267. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  19268. * return v
  19269. *
  19270. */
  19271. __pyx_t_5 = __pyx_convert_pair_from_py_size_t__and_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  19272. __pyx_v_v.push_back(((std::pair<size_t,size_t> )__pyx_t_5));
  19273. /* "vector.from_py":47
  19274. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *:
  19275. * cdef vector[X] v
  19276. * for item in o: # <<<<<<<<<<<<<<
  19277. * v.push_back(<X>item)
  19278. * return v
  19279. */
  19280. }
  19281. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19282. /* "vector.from_py":49
  19283. * for item in o:
  19284. * v.push_back(<X>item)
  19285. * return v # <<<<<<<<<<<<<<
  19286. *
  19287. *
  19288. */
  19289. __pyx_r = __pyx_v_v;
  19290. goto __pyx_L0;
  19291. /* "vector.from_py":45
  19292. *
  19293. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  19294. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  19295. * cdef vector[X] v
  19296. * for item in o:
  19297. */
  19298. /* function exit code */
  19299. __pyx_L1_error:;
  19300. __Pyx_XDECREF(__pyx_t_1);
  19301. __Pyx_XDECREF(__pyx_t_4);
  19302. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  19303. __Pyx_pretend_to_initialize(&__pyx_r);
  19304. __pyx_L0:;
  19305. __Pyx_XDECREF(__pyx_v_item);
  19306. __Pyx_RefNannyFinishContext();
  19307. return __pyx_r;
  19308. }
  19309. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  19310. PyObject *o;
  19311. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  19312. o = (*t->tp_alloc)(t, 0);
  19313. } else {
  19314. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  19315. }
  19316. if (unlikely(!o)) return 0;
  19317. if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  19318. return o;
  19319. bad:
  19320. Py_DECREF(o); o = 0;
  19321. return NULL;
  19322. }
  19323. static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) {
  19324. #if CYTHON_USE_TP_FINALIZE
  19325. 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))) {
  19326. if (PyObject_CallFinalizerFromDealloc(o)) return;
  19327. }
  19328. #endif
  19329. {
  19330. PyObject *etype, *eval, *etb;
  19331. PyErr_Fetch(&etype, &eval, &etb);
  19332. ++Py_REFCNT(o);
  19333. __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o);
  19334. --Py_REFCNT(o);
  19335. PyErr_Restore(etype, eval, etb);
  19336. }
  19337. (*Py_TYPE(o)->tp_free)(o);
  19338. }
  19339. static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = {
  19340. {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized},
  19341. {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env},
  19342. {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs},
  19343. {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids},
  19344. {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids},
  19345. {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class},
  19346. {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name},
  19347. {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph},
  19348. {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node},
  19349. {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge},
  19350. {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge},
  19351. {"clear_graph", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph},
  19352. {"get_graph_internal_id", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id},
  19353. {"get_graph_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes},
  19354. {"get_graph_num_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_32get_graph_num_edges},
  19355. {"get_original_node_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_34get_original_node_ids},
  19356. {"get_graph_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_36get_graph_node_labels},
  19357. {"get_graph_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_38get_graph_edges},
  19358. {"get_graph_adjacence_matrix", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix},
  19359. {"set_edit_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_42set_edit_cost},
  19360. {"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},
  19361. {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_47init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_46init},
  19362. {"set_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_49set_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_48set_method},
  19363. {"init_method", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_51init_method, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_50init_method},
  19364. {"get_init_time", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_52get_init_time},
  19365. {"run_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_55run_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_54run_method},
  19366. {"get_upper_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_56get_upper_bound},
  19367. {"get_lower_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_58get_lower_bound},
  19368. {"get_forward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_60get_forward_map},
  19369. {"get_backward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_62get_backward_map},
  19370. {"get_node_image", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_64get_node_image},
  19371. {"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},
  19372. {"get_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_68get_induced_cost},
  19373. {"get_node_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map},
  19374. {"get_assignment_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_72get_assignment_matrix},
  19375. {"get_all_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_74get_all_map},
  19376. {"get_runtime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_76get_runtime},
  19377. {"quasimetric_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_78quasimetric_cost},
  19378. {"hungarian_LSAP", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_80hungarian_LSAP},
  19379. {"hungarian_LSAPE", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_82hungarian_LSAPE},
  19380. {"add_random_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_84add_random_graph},
  19381. {"add_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_86add_nx_graph},
  19382. {"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},
  19383. {"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},
  19384. {"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},
  19385. {"get_num_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_94get_num_node_labels},
  19386. {"get_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_96get_node_label},
  19387. {"get_num_edge_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_98get_num_edge_labels},
  19388. {"get_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_100get_edge_label},
  19389. {"get_avg_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_102get_avg_num_nodes},
  19390. {"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},
  19391. {"get_node_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_106get_node_del_cost},
  19392. {"get_node_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_108get_node_ins_cost},
  19393. {"get_median_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_110get_median_node_label},
  19394. {"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},
  19395. {"get_edge_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_114get_edge_del_cost},
  19396. {"get_edge_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_116get_edge_ins_cost},
  19397. {"get_median_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_118get_median_edge_label},
  19398. {"get_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_120get_nx_graph},
  19399. {"get_init_type", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_122get_init_type},
  19400. {"load_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_124load_nx_graph},
  19401. {"compute_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost},
  19402. {"__reduce_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__, METH_NOARGS, 0},
  19403. {"__setstate_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__, METH_O, 0},
  19404. {0, 0, 0, 0}
  19405. };
  19406. static PyTypeObject __pyx_type_8gedlibpy_GEDEnv = {
  19407. PyVarObject_HEAD_INIT(0, 0)
  19408. "gedlibpy.GEDEnv", /*tp_name*/
  19409. sizeof(struct __pyx_obj_8gedlibpy_GEDEnv), /*tp_basicsize*/
  19410. 0, /*tp_itemsize*/
  19411. __pyx_tp_dealloc_8gedlibpy_GEDEnv, /*tp_dealloc*/
  19412. #if PY_VERSION_HEX < 0x030800b4
  19413. 0, /*tp_print*/
  19414. #endif
  19415. #if PY_VERSION_HEX >= 0x030800b4
  19416. 0, /*tp_vectorcall_offset*/
  19417. #endif
  19418. 0, /*tp_getattr*/
  19419. 0, /*tp_setattr*/
  19420. #if PY_MAJOR_VERSION < 3
  19421. 0, /*tp_compare*/
  19422. #endif
  19423. #if PY_MAJOR_VERSION >= 3
  19424. 0, /*tp_as_async*/
  19425. #endif
  19426. 0, /*tp_repr*/
  19427. 0, /*tp_as_number*/
  19428. 0, /*tp_as_sequence*/
  19429. 0, /*tp_as_mapping*/
  19430. 0, /*tp_hash*/
  19431. 0, /*tp_call*/
  19432. 0, /*tp_str*/
  19433. 0, /*tp_getattro*/
  19434. 0, /*tp_setattro*/
  19435. 0, /*tp_as_buffer*/
  19436. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  19437. "Cython wrapper class for C++ class PyGEDEnv\n\t", /*tp_doc*/
  19438. 0, /*tp_traverse*/
  19439. 0, /*tp_clear*/
  19440. 0, /*tp_richcompare*/
  19441. 0, /*tp_weaklistoffset*/
  19442. 0, /*tp_iter*/
  19443. 0, /*tp_iternext*/
  19444. __pyx_methods_8gedlibpy_GEDEnv, /*tp_methods*/
  19445. 0, /*tp_members*/
  19446. 0, /*tp_getset*/
  19447. 0, /*tp_base*/
  19448. 0, /*tp_dict*/
  19449. 0, /*tp_descr_get*/
  19450. 0, /*tp_descr_set*/
  19451. 0, /*tp_dictoffset*/
  19452. 0, /*tp_init*/
  19453. 0, /*tp_alloc*/
  19454. __pyx_tp_new_8gedlibpy_GEDEnv, /*tp_new*/
  19455. 0, /*tp_free*/
  19456. 0, /*tp_is_gc*/
  19457. 0, /*tp_bases*/
  19458. 0, /*tp_mro*/
  19459. 0, /*tp_cache*/
  19460. 0, /*tp_subclasses*/
  19461. 0, /*tp_weaklist*/
  19462. 0, /*tp_del*/
  19463. 0, /*tp_version_tag*/
  19464. #if PY_VERSION_HEX >= 0x030400a1
  19465. 0, /*tp_finalize*/
  19466. #endif
  19467. #if PY_VERSION_HEX >= 0x030800b1
  19468. 0, /*tp_vectorcall*/
  19469. #endif
  19470. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  19471. 0, /*tp_print*/
  19472. #endif
  19473. };
  19474. static PyMethodDef __pyx_methods[] = {
  19475. {0, 0, 0, 0}
  19476. };
  19477. static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  19478. static const char* internal_type_names[] = {
  19479. "GEDEnv",
  19480. "PyGEDEnv",
  19481. "UINT32_t",
  19482. "X",
  19483. "Y",
  19484. "__pyx_ctuple_2ae87__58ae9__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",
  19485. "__pyx_ctuple_2ae87__58ae9__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",
  19486. "__pyx_ctuple_Py_ssize_t",
  19487. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t",
  19488. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t_struct",
  19489. "__pyx_ctuple_Py_ssize_t_struct",
  19490. "__pyx_ctuple_double",
  19491. "__pyx_ctuple_double_struct",
  19492. "__pyx_ctuple_size_t",
  19493. "__pyx_ctuple_size_t__space___const___and_size_t__space___const_",
  19494. "__pyx_ctuple_size_t__space___const___and_size_t__space___const__struct",
  19495. "__pyx_ctuple_size_t_struct",
  19496. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng",
  19497. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng_struct",
  19498. "bool",
  19499. "list",
  19500. "map",
  19501. "pair",
  19502. "string",
  19503. "vector",
  19504. 0
  19505. };
  19506. const char** type_name = internal_type_names;
  19507. while (*type_name) {
  19508. if (__Pyx_StrEq(name, *type_name)) {
  19509. PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
  19510. goto bad;
  19511. }
  19512. type_name++;
  19513. }
  19514. if (0);
  19515. else {
  19516. if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  19517. }
  19518. return 0;
  19519. bad:
  19520. return -1;
  19521. }
  19522. static int
  19523. __Pyx_import_all_from(PyObject *locals, PyObject *v)
  19524. {
  19525. PyObject *all = PyObject_GetAttrString(v, "__all__");
  19526. PyObject *dict, *name, *value;
  19527. int skip_leading_underscores = 0;
  19528. int pos, err;
  19529. if (all == NULL) {
  19530. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19531. return -1;
  19532. PyErr_Clear();
  19533. dict = PyObject_GetAttrString(v, "__dict__");
  19534. if (dict == NULL) {
  19535. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19536. return -1;
  19537. PyErr_SetString(PyExc_ImportError,
  19538. "from-import-* object has no __dict__ and no __all__");
  19539. return -1;
  19540. }
  19541. #if PY_MAJOR_VERSION < 3
  19542. all = PyObject_CallMethod(dict, (char *)"keys", NULL);
  19543. #else
  19544. all = PyMapping_Keys(dict);
  19545. #endif
  19546. Py_DECREF(dict);
  19547. if (all == NULL)
  19548. return -1;
  19549. skip_leading_underscores = 1;
  19550. }
  19551. for (pos = 0, err = 0; ; pos++) {
  19552. name = PySequence_GetItem(all, pos);
  19553. if (name == NULL) {
  19554. if (!PyErr_ExceptionMatches(PyExc_IndexError))
  19555. err = -1;
  19556. else
  19557. PyErr_Clear();
  19558. break;
  19559. }
  19560. if (skip_leading_underscores &&
  19561. #if PY_MAJOR_VERSION < 3
  19562. PyString_Check(name) &&
  19563. PyString_AS_STRING(name)[0] == '_')
  19564. #else
  19565. PyUnicode_Check(name) &&
  19566. PyUnicode_AS_UNICODE(name)[0] == '_')
  19567. #endif
  19568. {
  19569. Py_DECREF(name);
  19570. continue;
  19571. }
  19572. value = PyObject_GetAttr(v, name);
  19573. if (value == NULL)
  19574. err = -1;
  19575. else if (PyDict_CheckExact(locals))
  19576. err = PyDict_SetItem(locals, name, value);
  19577. else
  19578. err = PyObject_SetItem(locals, name, value);
  19579. Py_DECREF(name);
  19580. Py_XDECREF(value);
  19581. if (err != 0)
  19582. break;
  19583. }
  19584. Py_DECREF(all);
  19585. return err;
  19586. }
  19587. static int __pyx_import_star(PyObject* m) {
  19588. int i;
  19589. int ret = -1;
  19590. char* s;
  19591. PyObject *locals = 0;
  19592. PyObject *list = 0;
  19593. #if PY_MAJOR_VERSION >= 3
  19594. PyObject *utf8_name = 0;
  19595. #endif
  19596. PyObject *name;
  19597. PyObject *item;
  19598. locals = PyDict_New(); if (!locals) goto bad;
  19599. if (__Pyx_import_all_from(locals, m) < 0) goto bad;
  19600. list = PyDict_Items(locals); if (!list) goto bad;
  19601. for(i=0; i<PyList_GET_SIZE(list); i++) {
  19602. name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
  19603. item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
  19604. #if PY_MAJOR_VERSION >= 3
  19605. utf8_name = PyUnicode_AsUTF8String(name);
  19606. if (!utf8_name) goto bad;
  19607. s = PyBytes_AS_STRING(utf8_name);
  19608. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19609. Py_DECREF(utf8_name); utf8_name = 0;
  19610. #else
  19611. s = PyString_AsString(name);
  19612. if (!s) goto bad;
  19613. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19614. #endif
  19615. }
  19616. ret = 0;
  19617. bad:
  19618. Py_XDECREF(locals);
  19619. Py_XDECREF(list);
  19620. #if PY_MAJOR_VERSION >= 3
  19621. Py_XDECREF(utf8_name);
  19622. #endif
  19623. return ret;
  19624. }
  19625. #if PY_MAJOR_VERSION >= 3
  19626. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19627. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  19628. static int __pyx_pymod_exec_gedlibpy(PyObject* module); /*proto*/
  19629. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  19630. {Py_mod_create, (void*)__pyx_pymod_create},
  19631. {Py_mod_exec, (void*)__pyx_pymod_exec_gedlibpy},
  19632. {0, NULL}
  19633. };
  19634. #endif
  19635. static struct PyModuleDef __pyx_moduledef = {
  19636. PyModuleDef_HEAD_INIT,
  19637. "gedlibpy",
  19638. __pyx_k_Python_GedLib_module_This_modul, /* m_doc */
  19639. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19640. 0, /* m_size */
  19641. #else
  19642. -1, /* m_size */
  19643. #endif
  19644. __pyx_methods /* m_methods */,
  19645. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19646. __pyx_moduledef_slots, /* m_slots */
  19647. #else
  19648. NULL, /* m_reload */
  19649. #endif
  19650. NULL, /* m_traverse */
  19651. NULL, /* m_clear */
  19652. NULL /* m_free */
  19653. };
  19654. #endif
  19655. #ifndef CYTHON_SMALL_CODE
  19656. #if defined(__clang__)
  19657. #define CYTHON_SMALL_CODE
  19658. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  19659. #define CYTHON_SMALL_CODE __attribute__((cold))
  19660. #else
  19661. #define CYTHON_SMALL_CODE
  19662. #endif
  19663. #endif
  19664. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  19665. {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  19666. {&__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},
  19667. {&__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},
  19668. {&__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},
  19669. {&__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},
  19670. {&__pyx_kp_u_Computation_between_graph, __pyx_k_Computation_between_graph, sizeof(__pyx_k_Computation_between_graph), 0, 1, 0, 0},
  19671. {&__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES, __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES, sizeof(__pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES), 0, 1, 0, 1},
  19672. {&__pyx_n_s_EditCostError, __pyx_k_EditCostError, sizeof(__pyx_k_EditCostError), 0, 0, 1, 1},
  19673. {&__pyx_n_s_EditCostError___init, __pyx_k_EditCostError___init, sizeof(__pyx_k_EditCostError___init), 0, 0, 1, 1},
  19674. {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
  19675. {&__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},
  19676. {&__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},
  19677. {&__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},
  19678. {&__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},
  19679. {&__pyx_n_s_GEDEnv, __pyx_k_GEDEnv, sizeof(__pyx_k_GEDEnv), 0, 0, 1, 1},
  19680. {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  19681. {&__pyx_kp_u_Graphs_loaded, __pyx_k_Graphs_loaded, sizeof(__pyx_k_Graphs_loaded), 0, 1, 0, 0},
  19682. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  19683. {&__pyx_n_s_InitError, __pyx_k_InitError, sizeof(__pyx_k_InitError), 0, 0, 1, 1},
  19684. {&__pyx_n_s_InitError___init, __pyx_k_InitError___init, sizeof(__pyx_k_InitError___init), 0, 0, 1, 1},
  19685. {&__pyx_kp_u_Initialization_in_progress, __pyx_k_Initialization_in_progress, sizeof(__pyx_k_Initialization_in_progress), 0, 1, 0, 0},
  19686. {&__pyx_kp_u_Initialization_terminated, __pyx_k_Initialization_terminated, sizeof(__pyx_k_Initialization_terminated), 0, 1, 0, 0},
  19687. {&__pyx_n_s_LoadLibrary, __pyx_k_LoadLibrary, sizeof(__pyx_k_LoadLibrary), 0, 0, 1, 1},
  19688. {&__pyx_kp_u_Loading_graphs_in_progress, __pyx_k_Loading_graphs_in_progress, sizeof(__pyx_k_Loading_graphs_in_progress), 0, 1, 0, 0},
  19689. {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  19690. {&__pyx_n_s_MethodError, __pyx_k_MethodError, sizeof(__pyx_k_MethodError), 0, 0, 1, 1},
  19691. {&__pyx_n_s_MethodError___init, __pyx_k_MethodError___init, sizeof(__pyx_k_MethodError___init), 0, 0, 1, 1},
  19692. {&__pyx_n_s_NodeMap, __pyx_k_NodeMap, sizeof(__pyx_k_NodeMap), 0, 0, 1, 1},
  19693. {&__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},
  19694. {&__pyx_kp_u_Number_of_graphs, __pyx_k_Number_of_graphs, sizeof(__pyx_k_Number_of_graphs), 0, 1, 0, 0},
  19695. {&__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},
  19696. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  19697. {&__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},
  19698. {&__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},
  19699. {&__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},
  19700. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  19701. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  19702. {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1},
  19703. {&__pyx_n_s_add_assignment, __pyx_k_add_assignment, sizeof(__pyx_k_add_assignment), 0, 0, 1, 1},
  19704. {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1},
  19705. {&__pyx_n_s_add_graph, __pyx_k_add_graph, sizeof(__pyx_k_add_graph), 0, 0, 1, 1},
  19706. {&__pyx_n_s_add_node, __pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 0, 1, 1},
  19707. {&__pyx_n_s_add_nx_graph, __pyx_k_add_nx_graph, sizeof(__pyx_k_add_nx_graph), 0, 0, 1, 1},
  19708. {&__pyx_n_s_adj_lists, __pyx_k_adj_lists, sizeof(__pyx_k_adj_lists), 0, 0, 1, 1},
  19709. {&__pyx_n_s_adj_matrix, __pyx_k_adj_matrix, sizeof(__pyx_k_adj_matrix), 0, 0, 1, 1},
  19710. {&__pyx_n_s_as_relation, __pyx_k_as_relation, sizeof(__pyx_k_as_relation), 0, 0, 1, 1},
  19711. {&__pyx_n_s_cdll, __pyx_k_cdll, sizeof(__pyx_k_cdll), 0, 0, 1, 1},
  19712. {&__pyx_n_s_classe, __pyx_k_classe, sizeof(__pyx_k_classe), 0, 0, 1, 1},
  19713. {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1},
  19714. {&__pyx_n_s_clear_graph, __pyx_k_clear_graph, sizeof(__pyx_k_clear_graph), 0, 0, 1, 1},
  19715. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  19716. {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  19717. {&__pyx_n_s_dataset, __pyx_k_dataset, sizeof(__pyx_k_dataset), 0, 0, 1, 1},
  19718. {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  19719. {&__pyx_n_s_decode_graph_edges, __pyx_k_decode_graph_edges, sizeof(__pyx_k_decode_graph_edges), 0, 0, 1, 1},
  19720. {&__pyx_n_s_decode_your_map, __pyx_k_decode_your_map, sizeof(__pyx_k_decode_your_map), 0, 0, 1, 1},
  19721. {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  19722. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  19723. {&__pyx_n_s_edge_label, __pyx_k_edge_label, sizeof(__pyx_k_edge_label), 0, 0, 1, 1},
  19724. {&__pyx_n_s_edge_label_1, __pyx_k_edge_label_1, sizeof(__pyx_k_edge_label_1), 0, 0, 1, 1},
  19725. {&__pyx_n_s_edge_label_2, __pyx_k_edge_label_2, sizeof(__pyx_k_edge_label_2), 0, 0, 1, 1},
  19726. {&__pyx_n_s_edge_label_b, __pyx_k_edge_label_b, sizeof(__pyx_k_edge_label_b), 0, 0, 1, 1},
  19727. {&__pyx_n_s_edge_list, __pyx_k_edge_list, sizeof(__pyx_k_edge_list), 0, 0, 1, 1},
  19728. {&__pyx_n_s_edge_type, __pyx_k_edge_type, sizeof(__pyx_k_edge_type), 0, 0, 1, 1},
  19729. {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  19730. {&__pyx_n_s_edit_cost, __pyx_k_edit_cost, sizeof(__pyx_k_edit_cost), 0, 0, 1, 1},
  19731. {&__pyx_n_s_edit_cost_constant, __pyx_k_edit_cost_constant, sizeof(__pyx_k_edit_cost_constant), 0, 0, 1, 1},
  19732. {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  19733. {&__pyx_n_s_encode_your_map, __pyx_k_encode_your_map, sizeof(__pyx_k_encode_your_map), 0, 0, 1, 1},
  19734. {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  19735. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  19736. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  19737. {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1},
  19738. {&__pyx_n_s_g2, __pyx_k_g2, sizeof(__pyx_k_g2), 0, 0, 1, 1},
  19739. {&__pyx_n_s_g_id, __pyx_k_g_id, sizeof(__pyx_k_g_id), 0, 0, 1, 1},
  19740. {&__pyx_n_s_gedlibpy, __pyx_k_gedlibpy, sizeof(__pyx_k_gedlibpy), 0, 0, 1, 1},
  19741. {&__pyx_kp_s_gedlibpy_pyx, __pyx_k_gedlibpy_pyx, sizeof(__pyx_k_gedlibpy_pyx), 0, 0, 1, 0},
  19742. {&__pyx_n_s_get_dummy_node, __pyx_k_get_dummy_node, sizeof(__pyx_k_get_dummy_node), 0, 0, 1, 1},
  19743. {&__pyx_n_s_get_edge_data, __pyx_k_get_edge_data, sizeof(__pyx_k_get_edge_data), 0, 0, 1, 1},
  19744. {&__pyx_n_s_get_edit_cost_options, __pyx_k_get_edit_cost_options, sizeof(__pyx_k_get_edit_cost_options), 0, 0, 1, 1},
  19745. {&__pyx_n_s_get_graph_edges, __pyx_k_get_graph_edges, sizeof(__pyx_k_get_graph_edges), 0, 0, 1, 1},
  19746. {&__pyx_n_s_get_graph_node_labels, __pyx_k_get_graph_node_labels, sizeof(__pyx_k_get_graph_node_labels), 0, 0, 1, 1},
  19747. {&__pyx_n_s_get_graph_num_nodes, __pyx_k_get_graph_num_nodes, sizeof(__pyx_k_get_graph_num_nodes), 0, 0, 1, 1},
  19748. {&__pyx_n_s_get_init_options, __pyx_k_get_init_options, sizeof(__pyx_k_get_init_options), 0, 0, 1, 1},
  19749. {&__pyx_n_s_get_method_options, __pyx_k_get_method_options, sizeof(__pyx_k_get_method_options), 0, 0, 1, 1},
  19750. {&__pyx_n_s_get_node_map, __pyx_k_get_node_map, sizeof(__pyx_k_get_node_map), 0, 0, 1, 1},
  19751. {&__pyx_n_s_get_original_node_ids, __pyx_k_get_original_node_ids, sizeof(__pyx_k_get_original_node_ids), 0, 0, 1, 1},
  19752. {&__pyx_n_s_get_upper_bound, __pyx_k_get_upper_bound, sizeof(__pyx_k_get_upper_bound), 0, 0, 1, 1},
  19753. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  19754. {&__pyx_n_s_gklearn_ged_env, __pyx_k_gklearn_ged_env, sizeof(__pyx_k_gklearn_ged_env), 0, 0, 1, 1},
  19755. {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
  19756. {&__pyx_n_s_graph_class, __pyx_k_graph_class, sizeof(__pyx_k_graph_class), 0, 0, 1, 1},
  19757. {&__pyx_n_s_graph_id, __pyx_k_graph_id, sizeof(__pyx_k_graph_id), 0, 0, 1, 1},
  19758. {&__pyx_n_s_graph_ids, __pyx_k_graph_ids, sizeof(__pyx_k_graph_ids), 0, 0, 1, 1},
  19759. {&__pyx_n_s_graph_name, __pyx_k_graph_name, sizeof(__pyx_k_graph_name), 0, 0, 1, 1},
  19760. {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  19761. {&__pyx_n_s_h_id, __pyx_k_h_id, sizeof(__pyx_k_h_id), 0, 0, 1, 1},
  19762. {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
  19763. {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
  19764. {&__pyx_n_s_ignore_duplicates, __pyx_k_ignore_duplicates, sizeof(__pyx_k_ignore_duplicates), 0, 0, 1, 1},
  19765. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  19766. {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  19767. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  19768. {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  19769. {&__pyx_n_s_init_method, __pyx_k_init_method, sizeof(__pyx_k_init_method), 0, 0, 1, 1},
  19770. {&__pyx_n_s_init_option, __pyx_k_init_option, sizeof(__pyx_k_init_option), 0, 0, 1, 1},
  19771. {&__pyx_n_s_is_initialized, __pyx_k_is_initialized, sizeof(__pyx_k_is_initialized), 0, 0, 1, 1},
  19772. {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  19773. {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  19774. {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  19775. {&__pyx_n_s_lib1, __pyx_k_lib1, sizeof(__pyx_k_lib1), 0, 0, 1, 1},
  19776. {&__pyx_n_s_lib2, __pyx_k_lib2, sizeof(__pyx_k_lib2), 0, 0, 1, 1},
  19777. {&__pyx_n_s_lib3, __pyx_k_lib3, sizeof(__pyx_k_lib3), 0, 0, 1, 1},
  19778. {&__pyx_n_s_lib4, __pyx_k_lib4, sizeof(__pyx_k_lib4), 0, 0, 1, 1},
  19779. {&__pyx_kp_u_lib_fann_libdoublefann_so, __pyx_k_lib_fann_libdoublefann_so, sizeof(__pyx_k_lib_fann_libdoublefann_so), 0, 1, 0, 0},
  19780. {&__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},
  19781. {&__pyx_kp_u_lib_nomad_libnomad_so, __pyx_k_lib_nomad_libnomad_so, sizeof(__pyx_k_lib_nomad_libnomad_so), 0, 1, 0, 0},
  19782. {&__pyx_kp_u_lib_nomad_libsgtelib_so, __pyx_k_lib_nomad_libsgtelib_so, sizeof(__pyx_k_lib_nomad_libsgtelib_so), 0, 1, 0, 0},
  19783. {&__pyx_n_s_list_of_edges, __pyx_k_list_of_edges, sizeof(__pyx_k_list_of_edges), 0, 0, 1, 1},
  19784. {&__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},
  19785. {&__pyx_n_s_list_of_init_options, __pyx_k_list_of_init_options, sizeof(__pyx_k_list_of_init_options), 0, 0, 1, 1},
  19786. {&__pyx_n_s_list_of_method_options, __pyx_k_list_of_method_options, sizeof(__pyx_k_list_of_method_options), 0, 0, 1, 1},
  19787. {&__pyx_n_s_list_of_nodes, __pyx_k_list_of_nodes, sizeof(__pyx_k_list_of_nodes), 0, 0, 1, 1},
  19788. {&__pyx_n_s_load_GXL_graphs, __pyx_k_load_GXL_graphs, sizeof(__pyx_k_load_GXL_graphs), 0, 0, 1, 1},
  19789. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  19790. {&__pyx_n_s_map_b, __pyx_k_map_b, sizeof(__pyx_k_map_b), 0, 0, 1, 1},
  19791. {&__pyx_n_s_map_edge_b, __pyx_k_map_edge_b, sizeof(__pyx_k_map_edge_b), 0, 0, 1, 1},
  19792. {&__pyx_n_s_map_edges, __pyx_k_map_edges, sizeof(__pyx_k_map_edges), 0, 0, 1, 1},
  19793. {&__pyx_n_s_map_u, __pyx_k_map_u, sizeof(__pyx_k_map_u), 0, 0, 1, 1},
  19794. {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  19795. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  19796. {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  19797. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  19798. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  19799. {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  19800. {&__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},
  19801. {&__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},
  19802. {&__pyx_n_s_networkx, __pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 0, 1, 1},
  19803. {&__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},
  19804. {&__pyx_n_s_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1},
  19805. {&__pyx_n_s_node_label, __pyx_k_node_label, sizeof(__pyx_k_node_label), 0, 0, 1, 1},
  19806. {&__pyx_n_s_node_label_1, __pyx_k_node_label_1, sizeof(__pyx_k_node_label_1), 0, 0, 1, 1},
  19807. {&__pyx_n_s_node_label_2, __pyx_k_node_label_2, sizeof(__pyx_k_node_label_2), 0, 0, 1, 1},
  19808. {&__pyx_n_s_node_map, __pyx_k_node_map, sizeof(__pyx_k_node_map), 0, 0, 1, 1},
  19809. {&__pyx_n_s_node_type, __pyx_k_node_type, sizeof(__pyx_k_node_type), 0, 0, 1, 1},
  19810. {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  19811. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  19812. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  19813. {&__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},
  19814. {&__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},
  19815. {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
  19816. {&__pyx_n_s_nx_graph, __pyx_k_nx_graph, sizeof(__pyx_k_nx_graph), 0, 0, 1, 1},
  19817. {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
  19818. {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  19819. {&__pyx_n_u_original_node_ids, __pyx_k_original_node_ids, sizeof(__pyx_k_original_node_ids), 0, 1, 0, 1},
  19820. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  19821. {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  19822. {&__pyx_n_s_path_XML, __pyx_k_path_XML, sizeof(__pyx_k_path_XML), 0, 0, 1, 1},
  19823. {&__pyx_n_s_path_folder, __pyx_k_path_folder, sizeof(__pyx_k_path_folder), 0, 0, 1, 1},
  19824. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  19825. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  19826. {&__pyx_n_s_print_to_stdout, __pyx_k_print_to_stdout, sizeof(__pyx_k_print_to_stdout), 0, 0, 1, 1},
  19827. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  19828. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  19829. {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1},
  19830. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  19831. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  19832. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  19833. {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  19834. {&__pyx_n_s_restart_env, __pyx_k_restart_env, sizeof(__pyx_k_restart_env), 0, 0, 1, 1},
  19835. {&__pyx_n_s_run_method, __pyx_k_run_method, sizeof(__pyx_k_run_method), 0, 0, 1, 1},
  19836. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  19837. {&__pyx_n_s_set_edit_cost, __pyx_k_set_edit_cost, sizeof(__pyx_k_set_edit_cost), 0, 0, 1, 1},
  19838. {&__pyx_n_s_set_induced_cost, __pyx_k_set_induced_cost, sizeof(__pyx_k_set_induced_cost), 0, 0, 1, 1},
  19839. {&__pyx_n_s_set_method, __pyx_k_set_method, sizeof(__pyx_k_set_method), 0, 0, 1, 1},
  19840. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  19841. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  19842. {&__pyx_n_s_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 0, 1, 1},
  19843. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  19844. {&__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},
  19845. {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  19846. {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  19847. {&__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},
  19848. {0, 0, 0, 0, 0, 0, 0}
  19849. };
  19850. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  19851. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 758, __pyx_L1_error)
  19852. __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 985, __pyx_L1_error)
  19853. __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1372, __pyx_L1_error)
  19854. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  19855. __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
  19856. __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
  19857. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
  19858. __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 109, __pyx_L1_error)
  19859. return 0;
  19860. __pyx_L1_error:;
  19861. return -1;
  19862. }
  19863. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  19864. __Pyx_RefNannyDeclarations
  19865. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  19866. /* "gedlibpy.pyx":985
  19867. * self.restart_env()
  19868. *
  19869. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  19870. * for graph in dataset :
  19871. * self.add_nx_graph(graph, classes)
  19872. */
  19873. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Loading_graphs_in_progress); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 985, __pyx_L1_error)
  19874. __Pyx_GOTREF(__pyx_tuple__4);
  19875. __Pyx_GIVEREF(__pyx_tuple__4);
  19876. /* "gedlibpy.pyx":989
  19877. * self.add_nx_graph(graph, classes)
  19878. * listID = self.graph_ids()
  19879. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  19880. * print("Number of graphs = " + str(listID[1]))
  19881. *
  19882. */
  19883. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 989, __pyx_L1_error)
  19884. __Pyx_GOTREF(__pyx_tuple__5);
  19885. __Pyx_GIVEREF(__pyx_tuple__5);
  19886. /* "gedlibpy.pyx":993
  19887. *
  19888. * self.set_edit_cost(edit_cost)
  19889. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  19890. * self.init(init_option)
  19891. * print("Initialization terminated !")
  19892. */
  19893. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 993, __pyx_L1_error)
  19894. __Pyx_GOTREF(__pyx_tuple__6);
  19895. __Pyx_GIVEREF(__pyx_tuple__6);
  19896. /* "gedlibpy.pyx":995
  19897. * print("Initialization in progress...")
  19898. * self.init(init_option)
  19899. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  19900. *
  19901. * self.set_method(method, options)
  19902. */
  19903. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 995, __pyx_L1_error)
  19904. __Pyx_GOTREF(__pyx_tuple__7);
  19905. __Pyx_GIVEREF(__pyx_tuple__7);
  19906. /* "gedlibpy.pyx":1010
  19907. * resMapping[g][h] = self.get_node_map(g, h)
  19908. *
  19909. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  19910. * return resDistance, resMapping
  19911. *
  19912. */
  19913. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Finish_The_return_contains_edit); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1010, __pyx_L1_error)
  19914. __Pyx_GOTREF(__pyx_tuple__8);
  19915. __Pyx_GIVEREF(__pyx_tuple__8);
  19916. /* "gedlibpy.pyx":1065
  19917. * #return res
  19918. *
  19919. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  19920. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  19921. * return listID
  19922. */
  19923. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Finish_You_can_check_the_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1065, __pyx_L1_error)
  19924. __Pyx_GOTREF(__pyx_tuple__9);
  19925. __Pyx_GIVEREF(__pyx_tuple__9);
  19926. /* "gedlibpy.pyx":1066
  19927. *
  19928. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  19929. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  19930. * return listID
  19931. *
  19932. */
  19933. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Please_don_t_restart_the_environ); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1066, __pyx_L1_error)
  19934. __Pyx_GOTREF(__pyx_tuple__10);
  19935. __Pyx_GIVEREF(__pyx_tuple__10);
  19936. /* "(tree fragment)":2
  19937. * def __reduce_cython__(self):
  19938. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19939. * def __setstate_cython__(self, __pyx_state):
  19940. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19941. */
  19942. __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)
  19943. __Pyx_GOTREF(__pyx_tuple__11);
  19944. __Pyx_GIVEREF(__pyx_tuple__11);
  19945. /* "(tree fragment)":4
  19946. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19947. * def __setstate_cython__(self, __pyx_state):
  19948. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19949. */
  19950. __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)
  19951. __Pyx_GOTREF(__pyx_tuple__12);
  19952. __Pyx_GIVEREF(__pyx_tuple__12);
  19953. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  19954. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  19955. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  19956. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  19957. *
  19958. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19959. */
  19960. __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)
  19961. __Pyx_GOTREF(__pyx_tuple__13);
  19962. __Pyx_GIVEREF(__pyx_tuple__13);
  19963. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  19964. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19965. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  19966. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  19967. *
  19968. * info.buf = PyArray_DATA(self)
  19969. */
  19970. __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)
  19971. __Pyx_GOTREF(__pyx_tuple__14);
  19972. __Pyx_GIVEREF(__pyx_tuple__14);
  19973. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  19974. * if ((descr.byteorder == c'>' and little_endian) or
  19975. * (descr.byteorder == c'<' and not little_endian)):
  19976. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  19977. * if t == NPY_BYTE: f = "b"
  19978. * elif t == NPY_UBYTE: f = "B"
  19979. */
  19980. __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)
  19981. __Pyx_GOTREF(__pyx_tuple__15);
  19982. __Pyx_GIVEREF(__pyx_tuple__15);
  19983. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  19984. *
  19985. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  19986. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  19987. *
  19988. * if ((child.byteorder == c'>' and little_endian) or
  19989. */
  19990. __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)
  19991. __Pyx_GOTREF(__pyx_tuple__16);
  19992. __Pyx_GIVEREF(__pyx_tuple__16);
  19993. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  19994. * t = child.type_num
  19995. * if end - f < 5:
  19996. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  19997. *
  19998. * # Until ticket #99 is fixed, use integers to avoid warnings
  19999. */
  20000. __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)
  20001. __Pyx_GOTREF(__pyx_tuple__17);
  20002. __Pyx_GIVEREF(__pyx_tuple__17);
  20003. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  20004. * _import_array()
  20005. * except Exception:
  20006. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  20007. *
  20008. * cdef inline int import_umath() except -1:
  20009. */
  20010. __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)
  20011. __Pyx_GOTREF(__pyx_tuple__18);
  20012. __Pyx_GIVEREF(__pyx_tuple__18);
  20013. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  20014. * _import_umath()
  20015. * except Exception:
  20016. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  20017. *
  20018. * cdef inline int import_ufunc() except -1:
  20019. */
  20020. __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)
  20021. __Pyx_GOTREF(__pyx_tuple__19);
  20022. __Pyx_GIVEREF(__pyx_tuple__19);
  20023. /* "gedlibpy.pyx":129
  20024. *
  20025. *
  20026. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  20027. * """
  20028. * Searchs the differents edit cost functions and returns the result.
  20029. */
  20030. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 129, __pyx_L1_error)
  20031. __Pyx_GOTREF(__pyx_tuple__21);
  20032. __Pyx_GIVEREF(__pyx_tuple__21);
  20033. __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, 129, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 129, __pyx_L1_error)
  20034. /* "gedlibpy.pyx":143
  20035. *
  20036. *
  20037. * def get_method_options() : # <<<<<<<<<<<<<<
  20038. * """
  20039. * Searchs the differents method for edit distance computation between graphs and returns the result.
  20040. */
  20041. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 143, __pyx_L1_error)
  20042. __Pyx_GOTREF(__pyx_tuple__23);
  20043. __Pyx_GIVEREF(__pyx_tuple__23);
  20044. __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, 143, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 143, __pyx_L1_error)
  20045. /* "gedlibpy.pyx":156
  20046. *
  20047. *
  20048. * def get_init_options() : # <<<<<<<<<<<<<<
  20049. * """
  20050. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  20051. */
  20052. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 156, __pyx_L1_error)
  20053. __Pyx_GOTREF(__pyx_tuple__25);
  20054. __Pyx_GIVEREF(__pyx_tuple__25);
  20055. __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, 156, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 156, __pyx_L1_error)
  20056. /* "gedlibpy.pyx":169
  20057. *
  20058. *
  20059. * def get_dummy_node() : # <<<<<<<<<<<<<<
  20060. * """
  20061. * Returns the ID of a dummy node.
  20062. */
  20063. __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, 169, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 169, __pyx_L1_error)
  20064. /* "gedlibpy.pyx":1408
  20065. * :type message: string
  20066. * """
  20067. * def __init__(self, message): # <<<<<<<<<<<<<<
  20068. * """
  20069. * Inits the error with its message.
  20070. */
  20071. __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1408, __pyx_L1_error)
  20072. __Pyx_GOTREF(__pyx_tuple__28);
  20073. __Pyx_GIVEREF(__pyx_tuple__28);
  20074. __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, 1408, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1408, __pyx_L1_error)
  20075. /* "gedlibpy.pyx":1425
  20076. * :type message: string
  20077. * """
  20078. * def __init__(self, message): # <<<<<<<<<<<<<<
  20079. * """
  20080. * Inits the error with its message.
  20081. */
  20082. __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1425, __pyx_L1_error)
  20083. __Pyx_GOTREF(__pyx_tuple__30);
  20084. __Pyx_GIVEREF(__pyx_tuple__30);
  20085. __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, 1425, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1425, __pyx_L1_error)
  20086. /* "gedlibpy.pyx":1442
  20087. * :type message: string
  20088. * """
  20089. * def __init__(self, message): # <<<<<<<<<<<<<<
  20090. * """
  20091. * Inits the error with its message.
  20092. */
  20093. __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1442, __pyx_L1_error)
  20094. __Pyx_GOTREF(__pyx_tuple__32);
  20095. __Pyx_GIVEREF(__pyx_tuple__32);
  20096. __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, 1442, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1442, __pyx_L1_error)
  20097. /* "gedlibpy.pyx":1456
  20098. * #########################################
  20099. *
  20100. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20101. * """
  20102. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20103. */
  20104. __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, 1456, __pyx_L1_error)
  20105. __Pyx_GOTREF(__pyx_tuple__34);
  20106. __Pyx_GIVEREF(__pyx_tuple__34);
  20107. __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, 1456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1456, __pyx_L1_error)
  20108. /* "gedlibpy.pyx":1474
  20109. *
  20110. *
  20111. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20112. * """
  20113. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20114. */
  20115. __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, 1474, __pyx_L1_error)
  20116. __Pyx_GOTREF(__pyx_tuple__36);
  20117. __Pyx_GIVEREF(__pyx_tuple__36);
  20118. __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, 1474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1474, __pyx_L1_error)
  20119. /* "gedlibpy.pyx":1492
  20120. *
  20121. *
  20122. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20123. * """
  20124. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  20125. */
  20126. __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, 1492, __pyx_L1_error)
  20127. __Pyx_GOTREF(__pyx_tuple__38);
  20128. __Pyx_GIVEREF(__pyx_tuple__38);
  20129. __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, 1492, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1492, __pyx_L1_error)
  20130. __Pyx_RefNannyFinishContext();
  20131. return 0;
  20132. __pyx_L1_error:;
  20133. __Pyx_RefNannyFinishContext();
  20134. return -1;
  20135. }
  20136. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  20137. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  20138. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  20139. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  20140. return 0;
  20141. __pyx_L1_error:;
  20142. return -1;
  20143. }
  20144. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  20145. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  20146. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  20147. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  20148. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  20149. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  20150. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  20151. static int __Pyx_modinit_global_init_code(void) {
  20152. __Pyx_RefNannyDeclarations
  20153. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  20154. /*--- Global init code ---*/
  20155. __Pyx_RefNannyFinishContext();
  20156. return 0;
  20157. }
  20158. static int __Pyx_modinit_variable_export_code(void) {
  20159. __Pyx_RefNannyDeclarations
  20160. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  20161. /*--- Variable export code ---*/
  20162. __Pyx_RefNannyFinishContext();
  20163. return 0;
  20164. }
  20165. static int __Pyx_modinit_function_export_code(void) {
  20166. __Pyx_RefNannyDeclarations
  20167. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  20168. /*--- Function export code ---*/
  20169. __Pyx_RefNannyFinishContext();
  20170. return 0;
  20171. }
  20172. static int __Pyx_modinit_type_init_code(void) {
  20173. __Pyx_RefNannyDeclarations
  20174. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  20175. /*--- Type init code ---*/
  20176. if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
  20177. #if PY_VERSION_HEX < 0x030800B1
  20178. __pyx_type_8gedlibpy_GEDEnv.tp_print = 0;
  20179. #endif
  20180. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8gedlibpy_GEDEnv.tp_dictoffset && __pyx_type_8gedlibpy_GEDEnv.tp_getattro == PyObject_GenericGetAttr)) {
  20181. __pyx_type_8gedlibpy_GEDEnv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  20182. }
  20183. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
  20184. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 182, __pyx_L1_error)
  20185. __pyx_ptype_8gedlibpy_GEDEnv = &__pyx_type_8gedlibpy_GEDEnv;
  20186. __Pyx_RefNannyFinishContext();
  20187. return 0;
  20188. __pyx_L1_error:;
  20189. __Pyx_RefNannyFinishContext();
  20190. return -1;
  20191. }
  20192. static int __Pyx_modinit_type_import_code(void) {
  20193. __Pyx_RefNannyDeclarations
  20194. PyObject *__pyx_t_1 = NULL;
  20195. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  20196. /*--- Type import code ---*/
  20197. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  20198. __Pyx_GOTREF(__pyx_t_1);
  20199. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  20200. #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  20201. sizeof(PyTypeObject),
  20202. #else
  20203. sizeof(PyHeapTypeObject),
  20204. #endif
  20205. __Pyx_ImportType_CheckSize_Warn);
  20206. if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
  20207. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20208. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  20209. __Pyx_GOTREF(__pyx_t_1);
  20210. __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
  20211. if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
  20212. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20213. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  20214. __Pyx_GOTREF(__pyx_t_1);
  20215. __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
  20216. if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
  20217. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20218. __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
  20219. __Pyx_GOTREF(__pyx_t_1);
  20220. __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
  20221. if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
  20222. __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
  20223. if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
  20224. __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
  20225. if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
  20226. __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
  20227. if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
  20228. __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
  20229. if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
  20230. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20231. __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 58, __pyx_L1_error)
  20232. __Pyx_GOTREF(__pyx_t_1);
  20233. __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn);
  20234. if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 58, __pyx_L1_error)
  20235. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20236. __Pyx_RefNannyFinishContext();
  20237. return 0;
  20238. __pyx_L1_error:;
  20239. __Pyx_XDECREF(__pyx_t_1);
  20240. __Pyx_RefNannyFinishContext();
  20241. return -1;
  20242. }
  20243. static int __Pyx_modinit_variable_import_code(void) {
  20244. __Pyx_RefNannyDeclarations
  20245. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  20246. /*--- Variable import code ---*/
  20247. __Pyx_RefNannyFinishContext();
  20248. return 0;
  20249. }
  20250. static int __Pyx_modinit_function_import_code(void) {
  20251. __Pyx_RefNannyDeclarations
  20252. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  20253. /*--- Function import code ---*/
  20254. __Pyx_RefNannyFinishContext();
  20255. return 0;
  20256. }
  20257. #if PY_MAJOR_VERSION < 3
  20258. #ifdef CYTHON_NO_PYINIT_EXPORT
  20259. #define __Pyx_PyMODINIT_FUNC void
  20260. #else
  20261. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  20262. #endif
  20263. #else
  20264. #ifdef CYTHON_NO_PYINIT_EXPORT
  20265. #define __Pyx_PyMODINIT_FUNC PyObject *
  20266. #else
  20267. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  20268. #endif
  20269. #endif
  20270. #if PY_MAJOR_VERSION < 3
  20271. __Pyx_PyMODINIT_FUNC initgedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  20272. __Pyx_PyMODINIT_FUNC initgedlibpy(void)
  20273. #else
  20274. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  20275. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)
  20276. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20277. {
  20278. return PyModuleDef_Init(&__pyx_moduledef);
  20279. }
  20280. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  20281. #if PY_VERSION_HEX >= 0x030700A1
  20282. static PY_INT64_T main_interpreter_id = -1;
  20283. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  20284. if (main_interpreter_id == -1) {
  20285. main_interpreter_id = current_id;
  20286. return (unlikely(current_id == -1)) ? -1 : 0;
  20287. } else if (unlikely(main_interpreter_id != current_id))
  20288. #else
  20289. static PyInterpreterState *main_interpreter = NULL;
  20290. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  20291. if (!main_interpreter) {
  20292. main_interpreter = current_interpreter;
  20293. } else if (unlikely(main_interpreter != current_interpreter))
  20294. #endif
  20295. {
  20296. PyErr_SetString(
  20297. PyExc_ImportError,
  20298. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  20299. return -1;
  20300. }
  20301. return 0;
  20302. }
  20303. 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) {
  20304. PyObject *value = PyObject_GetAttrString(spec, from_name);
  20305. int result = 0;
  20306. if (likely(value)) {
  20307. if (allow_none || value != Py_None) {
  20308. result = PyDict_SetItemString(moddict, to_name, value);
  20309. }
  20310. Py_DECREF(value);
  20311. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  20312. PyErr_Clear();
  20313. } else {
  20314. result = -1;
  20315. }
  20316. return result;
  20317. }
  20318. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  20319. PyObject *module = NULL, *moddict, *modname;
  20320. if (__Pyx_check_single_interpreter())
  20321. return NULL;
  20322. if (__pyx_m)
  20323. return __Pyx_NewRef(__pyx_m);
  20324. modname = PyObject_GetAttrString(spec, "name");
  20325. if (unlikely(!modname)) goto bad;
  20326. module = PyModule_NewObject(modname);
  20327. Py_DECREF(modname);
  20328. if (unlikely(!module)) goto bad;
  20329. moddict = PyModule_GetDict(module);
  20330. if (unlikely(!moddict)) goto bad;
  20331. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  20332. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  20333. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  20334. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  20335. return module;
  20336. bad:
  20337. Py_XDECREF(module);
  20338. return NULL;
  20339. }
  20340. static CYTHON_SMALL_CODE int __pyx_pymod_exec_gedlibpy(PyObject *__pyx_pyinit_module)
  20341. #endif
  20342. #endif
  20343. {
  20344. PyObject *__pyx_t_1 = NULL;
  20345. PyObject *__pyx_t_2 = NULL;
  20346. PyObject *__pyx_t_3 = NULL;
  20347. PyObject *__pyx_t_4 = NULL;
  20348. PyObject *__pyx_t_5 = NULL;
  20349. __Pyx_RefNannyDeclarations
  20350. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20351. if (__pyx_m) {
  20352. if (__pyx_m == __pyx_pyinit_module) return 0;
  20353. PyErr_SetString(PyExc_RuntimeError, "Module 'gedlibpy' has already been imported. Re-initialisation is not supported.");
  20354. return -1;
  20355. }
  20356. #elif PY_MAJOR_VERSION >= 3
  20357. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  20358. #endif
  20359. #if CYTHON_REFNANNY
  20360. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  20361. if (!__Pyx_RefNanny) {
  20362. PyErr_Clear();
  20363. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  20364. if (!__Pyx_RefNanny)
  20365. Py_FatalError("failed to import 'refnanny' module");
  20366. }
  20367. #endif
  20368. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)", 0);
  20369. if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20370. #ifdef __Pxy_PyFrame_Initialize_Offsets
  20371. __Pxy_PyFrame_Initialize_Offsets();
  20372. #endif
  20373. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  20374. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  20375. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  20376. #ifdef __Pyx_CyFunction_USED
  20377. if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20378. #endif
  20379. #ifdef __Pyx_FusedFunction_USED
  20380. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20381. #endif
  20382. #ifdef __Pyx_Coroutine_USED
  20383. if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20384. #endif
  20385. #ifdef __Pyx_Generator_USED
  20386. if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20387. #endif
  20388. #ifdef __Pyx_AsyncGen_USED
  20389. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20390. #endif
  20391. #ifdef __Pyx_StopAsyncIteration_USED
  20392. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20393. #endif
  20394. /*--- Library function declarations ---*/
  20395. /*--- Threads initialization code ---*/
  20396. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  20397. #ifdef WITH_THREAD /* Python build with threading support? */
  20398. PyEval_InitThreads();
  20399. #endif
  20400. #endif
  20401. /*--- Module creation code ---*/
  20402. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20403. __pyx_m = __pyx_pyinit_module;
  20404. Py_INCREF(__pyx_m);
  20405. #else
  20406. #if PY_MAJOR_VERSION < 3
  20407. __pyx_m = Py_InitModule4("gedlibpy", __pyx_methods, __pyx_k_Python_GedLib_module_This_modul, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  20408. #else
  20409. __pyx_m = PyModule_Create(&__pyx_moduledef);
  20410. #endif
  20411. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  20412. #endif
  20413. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  20414. Py_INCREF(__pyx_d);
  20415. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  20416. Py_INCREF(__pyx_b);
  20417. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  20418. Py_INCREF(__pyx_cython_runtime);
  20419. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  20420. /*--- Initialize various global constants etc. ---*/
  20421. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20422. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  20423. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20424. #endif
  20425. if (__pyx_module_is_main_gedlibpy) {
  20426. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20427. }
  20428. #if PY_MAJOR_VERSION >= 3
  20429. {
  20430. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  20431. if (!PyDict_GetItemString(modules, "gedlibpy")) {
  20432. if (unlikely(PyDict_SetItemString(modules, "gedlibpy", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  20433. }
  20434. }
  20435. #endif
  20436. /*--- Builtin init code ---*/
  20437. if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  20438. /*--- Constants init code ---*/
  20439. if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  20440. /*--- Global type/function init code ---*/
  20441. (void)__Pyx_modinit_global_init_code();
  20442. (void)__Pyx_modinit_variable_export_code();
  20443. (void)__Pyx_modinit_function_export_code();
  20444. if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  20445. if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  20446. (void)__Pyx_modinit_variable_import_code();
  20447. (void)__Pyx_modinit_function_import_code();
  20448. /*--- Execution code ---*/
  20449. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  20450. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20451. #endif
  20452. /* "gedlibpy.pyx":116
  20453. *
  20454. * import cython
  20455. * import numpy as np # <<<<<<<<<<<<<<
  20456. * import networkx as nx
  20457. * from gklearn.ged.env import NodeMap
  20458. */
  20459. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
  20460. __Pyx_GOTREF(__pyx_t_1);
  20461. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
  20462. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20463. /* "gedlibpy.pyx":117
  20464. * import cython
  20465. * import numpy as np
  20466. * import networkx as nx # <<<<<<<<<<<<<<
  20467. * from gklearn.ged.env import NodeMap
  20468. *
  20469. */
  20470. __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  20471. __Pyx_GOTREF(__pyx_t_1);
  20472. if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
  20473. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20474. /* "gedlibpy.pyx":118
  20475. * import numpy as np
  20476. * import networkx as nx
  20477. * from gklearn.ged.env import NodeMap # <<<<<<<<<<<<<<
  20478. *
  20479. * # import librariesImport
  20480. */
  20481. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  20482. __Pyx_GOTREF(__pyx_t_1);
  20483. __Pyx_INCREF(__pyx_n_s_NodeMap);
  20484. __Pyx_GIVEREF(__pyx_n_s_NodeMap);
  20485. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NodeMap);
  20486. __pyx_t_2 = __Pyx_Import(__pyx_n_s_gklearn_ged_env, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 118, __pyx_L1_error)
  20487. __Pyx_GOTREF(__pyx_t_2);
  20488. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20489. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 118, __pyx_L1_error)
  20490. __Pyx_GOTREF(__pyx_t_1);
  20491. if (PyDict_SetItem(__pyx_d, __pyx_n_s_NodeMap, __pyx_t_1) < 0) __PYX_ERR(0, 118, __pyx_L1_error)
  20492. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20493. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20494. /* "gedlibpy.pyx":121
  20495. *
  20496. * # import librariesImport
  20497. * from ctypes import * # <<<<<<<<<<<<<<
  20498. * import os
  20499. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20500. */
  20501. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
  20502. __Pyx_GOTREF(__pyx_t_2);
  20503. __Pyx_INCREF(__pyx_n_s__20);
  20504. __Pyx_GIVEREF(__pyx_n_s__20);
  20505. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__20);
  20506. __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  20507. __Pyx_GOTREF(__pyx_t_1);
  20508. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20509. if (__pyx_import_star(__pyx_t_1) < 0) __PYX_ERR(0, 121, __pyx_L1_error);
  20510. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20511. /* "gedlibpy.pyx":122
  20512. * # import librariesImport
  20513. * from ctypes import *
  20514. * import os # <<<<<<<<<<<<<<
  20515. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20516. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20517. */
  20518. __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20519. __Pyx_GOTREF(__pyx_t_1);
  20520. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  20521. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20522. /* "gedlibpy.pyx":123
  20523. * from ctypes import *
  20524. * import os
  20525. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') # <<<<<<<<<<<<<<
  20526. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20527. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20528. */
  20529. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20530. __Pyx_GOTREF(__pyx_t_1);
  20531. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  20532. __Pyx_GOTREF(__pyx_t_2);
  20533. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20534. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20535. __Pyx_GOTREF(__pyx_t_1);
  20536. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  20537. __Pyx_GOTREF(__pyx_t_3);
  20538. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20539. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20540. __Pyx_GOTREF(__pyx_t_1);
  20541. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20542. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  20543. __Pyx_GOTREF(__pyx_t_3);
  20544. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20545. __Pyx_GOTREF(__pyx_t_4);
  20546. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20547. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  20548. __Pyx_GOTREF(__pyx_t_3);
  20549. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20550. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20551. __Pyx_GOTREF(__pyx_t_4);
  20552. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  20553. __Pyx_GOTREF(__pyx_t_5);
  20554. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20555. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20556. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20557. __Pyx_GOTREF(__pyx_t_4);
  20558. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20559. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20560. __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_fann_libdoublefann_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  20561. __Pyx_GOTREF(__pyx_t_5);
  20562. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20563. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20564. __Pyx_GOTREF(__pyx_t_4);
  20565. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20566. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20567. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
  20568. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20569. /* "gedlibpy.pyx":124
  20570. * import os
  20571. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20572. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') # <<<<<<<<<<<<<<
  20573. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20574. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20575. */
  20576. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20577. __Pyx_GOTREF(__pyx_t_4);
  20578. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
  20579. __Pyx_GOTREF(__pyx_t_5);
  20580. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20581. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20582. __Pyx_GOTREF(__pyx_t_4);
  20583. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20584. __Pyx_GOTREF(__pyx_t_2);
  20585. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20586. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20587. __Pyx_GOTREF(__pyx_t_4);
  20588. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20589. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20590. __Pyx_GOTREF(__pyx_t_2);
  20591. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20592. __Pyx_GOTREF(__pyx_t_1);
  20593. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20594. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20595. __Pyx_GOTREF(__pyx_t_2);
  20596. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20597. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20598. __Pyx_GOTREF(__pyx_t_1);
  20599. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
  20600. __Pyx_GOTREF(__pyx_t_3);
  20601. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20602. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20603. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20604. __Pyx_GOTREF(__pyx_t_1);
  20605. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20606. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20607. __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_lib_libsvm_3_22_libsvm_so); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
  20608. __Pyx_GOTREF(__pyx_t_3);
  20609. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20610. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20611. __Pyx_GOTREF(__pyx_t_1);
  20612. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20613. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20614. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_1) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  20615. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20616. /* "gedlibpy.pyx":125
  20617. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20618. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20619. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') # <<<<<<<<<<<<<<
  20620. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20621. *
  20622. */
  20623. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20624. __Pyx_GOTREF(__pyx_t_1);
  20625. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  20626. __Pyx_GOTREF(__pyx_t_3);
  20627. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20628. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20629. __Pyx_GOTREF(__pyx_t_1);
  20630. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20631. __Pyx_GOTREF(__pyx_t_5);
  20632. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20633. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20634. __Pyx_GOTREF(__pyx_t_1);
  20635. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20636. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20637. __Pyx_GOTREF(__pyx_t_5);
  20638. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20639. __Pyx_GOTREF(__pyx_t_4);
  20640. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20641. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20642. __Pyx_GOTREF(__pyx_t_5);
  20643. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20644. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20645. __Pyx_GOTREF(__pyx_t_4);
  20646. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  20647. __Pyx_GOTREF(__pyx_t_2);
  20648. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20649. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20650. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20651. __Pyx_GOTREF(__pyx_t_4);
  20652. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20653. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20654. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_nomad_libnomad_so); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  20655. __Pyx_GOTREF(__pyx_t_2);
  20656. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20657. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20658. __Pyx_GOTREF(__pyx_t_4);
  20659. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20660. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20661. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  20662. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20663. /* "gedlibpy.pyx":126
  20664. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20665. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20666. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') # <<<<<<<<<<<<<<
  20667. *
  20668. *
  20669. */
  20670. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  20671. __Pyx_GOTREF(__pyx_t_4);
  20672. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
  20673. __Pyx_GOTREF(__pyx_t_2);
  20674. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20675. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  20676. __Pyx_GOTREF(__pyx_t_4);
  20677. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  20678. __Pyx_GOTREF(__pyx_t_3);
  20679. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20680. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 126, __pyx_L1_error)
  20681. __Pyx_GOTREF(__pyx_t_4);
  20682. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20683. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  20684. __Pyx_GOTREF(__pyx_t_3);
  20685. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  20686. __Pyx_GOTREF(__pyx_t_1);
  20687. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20688. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
  20689. __Pyx_GOTREF(__pyx_t_3);
  20690. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20691. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  20692. __Pyx_GOTREF(__pyx_t_1);
  20693. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
  20694. __Pyx_GOTREF(__pyx_t_5);
  20695. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20696. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20697. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  20698. __Pyx_GOTREF(__pyx_t_1);
  20699. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20700. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20701. __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_lib_nomad_libsgtelib_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 126, __pyx_L1_error)
  20702. __Pyx_GOTREF(__pyx_t_5);
  20703. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20704. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 126, __pyx_L1_error)
  20705. __Pyx_GOTREF(__pyx_t_1);
  20706. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20707. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20708. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_1) < 0) __PYX_ERR(0, 126, __pyx_L1_error)
  20709. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20710. /* "gedlibpy.pyx":129
  20711. *
  20712. *
  20713. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  20714. * """
  20715. * Searchs the differents edit cost functions and returns the result.
  20716. */
  20717. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_1get_edit_cost_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
  20718. __Pyx_GOTREF(__pyx_t_1);
  20719. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_1) < 0) __PYX_ERR(0, 129, __pyx_L1_error)
  20720. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20721. /* "gedlibpy.pyx":143
  20722. *
  20723. *
  20724. * def get_method_options() : # <<<<<<<<<<<<<<
  20725. * """
  20726. * Searchs the differents method for edit distance computation between graphs and returns the result.
  20727. */
  20728. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_3get_method_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 143, __pyx_L1_error)
  20729. __Pyx_GOTREF(__pyx_t_1);
  20730. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 143, __pyx_L1_error)
  20731. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20732. /* "gedlibpy.pyx":156
  20733. *
  20734. *
  20735. * def get_init_options() : # <<<<<<<<<<<<<<
  20736. * """
  20737. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  20738. */
  20739. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_5get_init_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 156, __pyx_L1_error)
  20740. __Pyx_GOTREF(__pyx_t_1);
  20741. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_1) < 0) __PYX_ERR(0, 156, __pyx_L1_error)
  20742. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20743. /* "gedlibpy.pyx":169
  20744. *
  20745. *
  20746. * def get_dummy_node() : # <<<<<<<<<<<<<<
  20747. * """
  20748. * Returns the ID of a dummy node.
  20749. */
  20750. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_7get_dummy_node, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 169, __pyx_L1_error)
  20751. __Pyx_GOTREF(__pyx_t_1);
  20752. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_1) < 0) __PYX_ERR(0, 169, __pyx_L1_error)
  20753. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20754. /* "gedlibpy.pyx":493
  20755. *
  20756. *
  20757. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20758. * """
  20759. * Sets an edit cost function to the environment, if it exists.
  20760. */
  20761. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
  20762. __Pyx_GOTREF(__pyx_t_1);
  20763. __pyx_k__2 = __pyx_t_1;
  20764. __Pyx_GIVEREF(__pyx_t_1);
  20765. __pyx_t_1 = 0;
  20766. /* "gedlibpy.pyx":512
  20767. *
  20768. *
  20769. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20770. * """
  20771. * Sets an personal edit cost function to the environment.
  20772. */
  20773. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  20774. __Pyx_GOTREF(__pyx_t_1);
  20775. __pyx_k__3 = __pyx_t_1;
  20776. __Pyx_GIVEREF(__pyx_t_1);
  20777. __pyx_t_1 = 0;
  20778. /* "gedlibpy.pyx":1385
  20779. * #####################################################################
  20780. *
  20781. * list_of_edit_cost_options = get_edit_cost_options() # <<<<<<<<<<<<<<
  20782. * list_of_method_options = get_method_options()
  20783. * list_of_init_options = get_init_options()
  20784. */
  20785. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1385, __pyx_L1_error)
  20786. __Pyx_GOTREF(__pyx_t_1);
  20787. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1385, __pyx_L1_error)
  20788. __Pyx_GOTREF(__pyx_t_5);
  20789. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20790. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1385, __pyx_L1_error)
  20791. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20792. /* "gedlibpy.pyx":1386
  20793. *
  20794. * list_of_edit_cost_options = get_edit_cost_options()
  20795. * list_of_method_options = get_method_options() # <<<<<<<<<<<<<<
  20796. * list_of_init_options = get_init_options()
  20797. *
  20798. */
  20799. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L1_error)
  20800. __Pyx_GOTREF(__pyx_t_5);
  20801. __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
  20802. __Pyx_GOTREF(__pyx_t_1);
  20803. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20804. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 1386, __pyx_L1_error)
  20805. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20806. /* "gedlibpy.pyx":1387
  20807. * list_of_edit_cost_options = get_edit_cost_options()
  20808. * list_of_method_options = get_method_options()
  20809. * list_of_init_options = get_init_options() # <<<<<<<<<<<<<<
  20810. *
  20811. *
  20812. */
  20813. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1387, __pyx_L1_error)
  20814. __Pyx_GOTREF(__pyx_t_1);
  20815. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1387, __pyx_L1_error)
  20816. __Pyx_GOTREF(__pyx_t_5);
  20817. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20818. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1387, __pyx_L1_error)
  20819. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20820. /* "gedlibpy.pyx":1394
  20821. * #####################
  20822. *
  20823. * class Error(Exception): # <<<<<<<<<<<<<<
  20824. * """
  20825. * Class for error's management. This one is general.
  20826. */
  20827. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1394, __pyx_L1_error)
  20828. __Pyx_GOTREF(__pyx_t_5);
  20829. __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20830. __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20831. PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20832. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1394, __pyx_L1_error)
  20833. __Pyx_GOTREF(__pyx_t_1);
  20834. __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __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_2)) __PYX_ERR(0, 1394, __pyx_L1_error)
  20835. __Pyx_GOTREF(__pyx_t_2);
  20836. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_Error, __pyx_t_5, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1394, __pyx_L1_error)
  20837. __Pyx_GOTREF(__pyx_t_4);
  20838. if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1394, __pyx_L1_error)
  20839. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20840. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20841. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20842. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20843. /* "gedlibpy.pyx":1401
  20844. *
  20845. *
  20846. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20847. * """
  20848. * 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).
  20849. */
  20850. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
  20851. __Pyx_GOTREF(__pyx_t_5);
  20852. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1401, __pyx_L1_error)
  20853. __Pyx_GOTREF(__pyx_t_1);
  20854. __Pyx_GIVEREF(__pyx_t_5);
  20855. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20856. __pyx_t_5 = 0;
  20857. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1401, __pyx_L1_error)
  20858. __Pyx_GOTREF(__pyx_t_5);
  20859. __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __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_2)) __PYX_ERR(0, 1401, __pyx_L1_error)
  20860. __Pyx_GOTREF(__pyx_t_2);
  20861. /* "gedlibpy.pyx":1408
  20862. * :type message: string
  20863. * """
  20864. * def __init__(self, message): # <<<<<<<<<<<<<<
  20865. * """
  20866. * Inits the error with its message.
  20867. */
  20868. __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, 1408, __pyx_L1_error)
  20869. __Pyx_GOTREF(__pyx_t_4);
  20870. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1408, __pyx_L1_error)
  20871. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20872. /* "gedlibpy.pyx":1401
  20873. *
  20874. *
  20875. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20876. * """
  20877. * 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).
  20878. */
  20879. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_EditCostError, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error)
  20880. __Pyx_GOTREF(__pyx_t_4);
  20881. if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1401, __pyx_L1_error)
  20882. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20883. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20884. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20885. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20886. /* "gedlibpy.pyx":1418
  20887. *
  20888. *
  20889. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20890. * """
  20891. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20892. */
  20893. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
  20894. __Pyx_GOTREF(__pyx_t_1);
  20895. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1418, __pyx_L1_error)
  20896. __Pyx_GOTREF(__pyx_t_5);
  20897. __Pyx_GIVEREF(__pyx_t_1);
  20898. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  20899. __pyx_t_1 = 0;
  20900. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1418, __pyx_L1_error)
  20901. __Pyx_GOTREF(__pyx_t_1);
  20902. __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_1, __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_2)) __PYX_ERR(0, 1418, __pyx_L1_error)
  20903. __Pyx_GOTREF(__pyx_t_2);
  20904. /* "gedlibpy.pyx":1425
  20905. * :type message: string
  20906. * """
  20907. * def __init__(self, message): # <<<<<<<<<<<<<<
  20908. * """
  20909. * Inits the error with its message.
  20910. */
  20911. __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, 1425, __pyx_L1_error)
  20912. __Pyx_GOTREF(__pyx_t_4);
  20913. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1425, __pyx_L1_error)
  20914. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20915. /* "gedlibpy.pyx":1418
  20916. *
  20917. *
  20918. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20919. * """
  20920. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20921. */
  20922. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_1, __pyx_n_s_MethodError, __pyx_t_5, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1418, __pyx_L1_error)
  20923. __Pyx_GOTREF(__pyx_t_4);
  20924. if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1418, __pyx_L1_error)
  20925. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20926. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20927. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20928. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20929. /* "gedlibpy.pyx":1435
  20930. *
  20931. *
  20932. * class InitError(Error) : # <<<<<<<<<<<<<<
  20933. * """
  20934. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20935. */
  20936. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1435, __pyx_L1_error)
  20937. __Pyx_GOTREF(__pyx_t_5);
  20938. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
  20939. __Pyx_GOTREF(__pyx_t_1);
  20940. __Pyx_GIVEREF(__pyx_t_5);
  20941. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20942. __pyx_t_5 = 0;
  20943. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1435, __pyx_L1_error)
  20944. __Pyx_GOTREF(__pyx_t_5);
  20945. __pyx_t_2 = __Pyx_Py3MetaclassPrepare(__pyx_t_5, __pyx_t_1, __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_2)) __PYX_ERR(0, 1435, __pyx_L1_error)
  20946. __Pyx_GOTREF(__pyx_t_2);
  20947. /* "gedlibpy.pyx":1442
  20948. * :type message: string
  20949. * """
  20950. * def __init__(self, message): # <<<<<<<<<<<<<<
  20951. * """
  20952. * Inits the error with its message.
  20953. */
  20954. __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, 1442, __pyx_L1_error)
  20955. __Pyx_GOTREF(__pyx_t_4);
  20956. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1442, __pyx_L1_error)
  20957. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20958. /* "gedlibpy.pyx":1435
  20959. *
  20960. *
  20961. * class InitError(Error) : # <<<<<<<<<<<<<<
  20962. * """
  20963. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20964. */
  20965. __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_5, __pyx_n_s_InitError, __pyx_t_1, __pyx_t_2, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1435, __pyx_L1_error)
  20966. __Pyx_GOTREF(__pyx_t_4);
  20967. if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1435, __pyx_L1_error)
  20968. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20969. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20970. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20971. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20972. /* "gedlibpy.pyx":1456
  20973. * #########################################
  20974. *
  20975. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20976. * """
  20977. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20978. */
  20979. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1456, __pyx_L1_error)
  20980. __Pyx_GOTREF(__pyx_t_1);
  20981. if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1456, __pyx_L1_error)
  20982. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20983. /* "gedlibpy.pyx":1474
  20984. *
  20985. *
  20986. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20987. * """
  20988. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20989. */
  20990. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error)
  20991. __Pyx_GOTREF(__pyx_t_1);
  20992. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1474, __pyx_L1_error)
  20993. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20994. /* "gedlibpy.pyx":1492
  20995. *
  20996. *
  20997. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20998. * """
  20999. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  21000. */
  21001. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1492, __pyx_L1_error)
  21002. __Pyx_GOTREF(__pyx_t_1);
  21003. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_1) < 0) __PYX_ERR(0, 1492, __pyx_L1_error)
  21004. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  21005. /* "gedlibpy.pyx":1
  21006. * # distutils: language = c++ # <<<<<<<<<<<<<<
  21007. *
  21008. * """
  21009. */
  21010. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  21011. __Pyx_GOTREF(__pyx_t_1);
  21012. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  21013. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  21014. /* "vector.from_py":45
  21015. *
  21016. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  21017. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  21018. * cdef vector[X] v
  21019. * for item in o:
  21020. */
  21021. /*--- Wrapped vars code ---*/
  21022. goto __pyx_L0;
  21023. __pyx_L1_error:;
  21024. __Pyx_XDECREF(__pyx_t_1);
  21025. __Pyx_XDECREF(__pyx_t_2);
  21026. __Pyx_XDECREF(__pyx_t_3);
  21027. __Pyx_XDECREF(__pyx_t_4);
  21028. __Pyx_XDECREF(__pyx_t_5);
  21029. if (__pyx_m) {
  21030. if (__pyx_d) {
  21031. __Pyx_AddTraceback("init gedlibpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  21032. }
  21033. Py_CLEAR(__pyx_m);
  21034. } else if (!PyErr_Occurred()) {
  21035. PyErr_SetString(PyExc_ImportError, "init gedlibpy");
  21036. }
  21037. __pyx_L0:;
  21038. __Pyx_RefNannyFinishContext();
  21039. #if CYTHON_PEP489_MULTI_PHASE_INIT
  21040. return (__pyx_m != NULL) ? 0 : -1;
  21041. #elif PY_MAJOR_VERSION >= 3
  21042. return __pyx_m;
  21043. #else
  21044. return;
  21045. #endif
  21046. }
  21047. /* --- Runtime support code --- */
  21048. /* Refnanny */
  21049. #if CYTHON_REFNANNY
  21050. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  21051. PyObject *m = NULL, *p = NULL;
  21052. void *r = NULL;
  21053. m = PyImport_ImportModule(modname);
  21054. if (!m) goto end;
  21055. p = PyObject_GetAttrString(m, "RefNannyAPI");
  21056. if (!p) goto end;
  21057. r = PyLong_AsVoidPtr(p);
  21058. end:
  21059. Py_XDECREF(p);
  21060. Py_XDECREF(m);
  21061. return (__Pyx_RefNannyAPIStruct *)r;
  21062. }
  21063. #endif
  21064. /* PyObjectGetAttrStr */
  21065. #if CYTHON_USE_TYPE_SLOTS
  21066. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  21067. PyTypeObject* tp = Py_TYPE(obj);
  21068. if (likely(tp->tp_getattro))
  21069. return tp->tp_getattro(obj, attr_name);
  21070. #if PY_MAJOR_VERSION < 3
  21071. if (likely(tp->tp_getattr))
  21072. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  21073. #endif
  21074. return PyObject_GetAttr(obj, attr_name);
  21075. }
  21076. #endif
  21077. /* GetBuiltinName */
  21078. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  21079. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  21080. if (unlikely(!result)) {
  21081. PyErr_Format(PyExc_NameError,
  21082. #if PY_MAJOR_VERSION >= 3
  21083. "name '%U' is not defined", name);
  21084. #else
  21085. "name '%.200s' is not defined", PyString_AS_STRING(name));
  21086. #endif
  21087. }
  21088. return result;
  21089. }
  21090. /* decode_c_bytes */
  21091. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  21092. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  21093. const char* encoding, const char* errors,
  21094. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  21095. if (unlikely((start < 0) | (stop < 0))) {
  21096. if (start < 0) {
  21097. start += length;
  21098. if (start < 0)
  21099. start = 0;
  21100. }
  21101. if (stop < 0)
  21102. stop += length;
  21103. }
  21104. if (stop > length)
  21105. stop = length;
  21106. length = stop - start;
  21107. if (unlikely(length <= 0))
  21108. return PyUnicode_FromUnicode(NULL, 0);
  21109. cstring += start;
  21110. if (decode_func) {
  21111. return decode_func(cstring, length, errors);
  21112. } else {
  21113. return PyUnicode_Decode(cstring, length, encoding, errors);
  21114. }
  21115. }
  21116. /* RaiseArgTupleInvalid */
  21117. static void __Pyx_RaiseArgtupleInvalid(
  21118. const char* func_name,
  21119. int exact,
  21120. Py_ssize_t num_min,
  21121. Py_ssize_t num_max,
  21122. Py_ssize_t num_found)
  21123. {
  21124. Py_ssize_t num_expected;
  21125. const char *more_or_less;
  21126. if (num_found < num_min) {
  21127. num_expected = num_min;
  21128. more_or_less = "at least";
  21129. } else {
  21130. num_expected = num_max;
  21131. more_or_less = "at most";
  21132. }
  21133. if (exact) {
  21134. more_or_less = "exactly";
  21135. }
  21136. PyErr_Format(PyExc_TypeError,
  21137. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  21138. func_name, more_or_less, num_expected,
  21139. (num_expected == 1) ? "" : "s", num_found);
  21140. }
  21141. /* KeywordStringCheck */
  21142. static int __Pyx_CheckKeywordStrings(
  21143. PyObject *kwdict,
  21144. const char* function_name,
  21145. int kw_allowed)
  21146. {
  21147. PyObject* key = 0;
  21148. Py_ssize_t pos = 0;
  21149. #if CYTHON_COMPILING_IN_PYPY
  21150. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  21151. goto invalid_keyword;
  21152. return 1;
  21153. #else
  21154. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  21155. #if PY_MAJOR_VERSION < 3
  21156. if (unlikely(!PyString_Check(key)))
  21157. #endif
  21158. if (unlikely(!PyUnicode_Check(key)))
  21159. goto invalid_keyword_type;
  21160. }
  21161. if ((!kw_allowed) && unlikely(key))
  21162. goto invalid_keyword;
  21163. return 1;
  21164. invalid_keyword_type:
  21165. PyErr_Format(PyExc_TypeError,
  21166. "%.200s() keywords must be strings", function_name);
  21167. return 0;
  21168. #endif
  21169. invalid_keyword:
  21170. PyErr_Format(PyExc_TypeError,
  21171. #if PY_MAJOR_VERSION < 3
  21172. "%.200s() got an unexpected keyword argument '%.200s'",
  21173. function_name, PyString_AsString(key));
  21174. #else
  21175. "%s() got an unexpected keyword argument '%U'",
  21176. function_name, key);
  21177. #endif
  21178. return 0;
  21179. }
  21180. /* RaiseDoubleKeywords */
  21181. static void __Pyx_RaiseDoubleKeywordsError(
  21182. const char* func_name,
  21183. PyObject* kw_name)
  21184. {
  21185. PyErr_Format(PyExc_TypeError,
  21186. #if PY_MAJOR_VERSION >= 3
  21187. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  21188. #else
  21189. "%s() got multiple values for keyword argument '%s'", func_name,
  21190. PyString_AsString(kw_name));
  21191. #endif
  21192. }
  21193. /* ParseKeywords */
  21194. static int __Pyx_ParseOptionalKeywords(
  21195. PyObject *kwds,
  21196. PyObject **argnames[],
  21197. PyObject *kwds2,
  21198. PyObject *values[],
  21199. Py_ssize_t num_pos_args,
  21200. const char* function_name)
  21201. {
  21202. PyObject *key = 0, *value = 0;
  21203. Py_ssize_t pos = 0;
  21204. PyObject*** name;
  21205. PyObject*** first_kw_arg = argnames + num_pos_args;
  21206. while (PyDict_Next(kwds, &pos, &key, &value)) {
  21207. name = first_kw_arg;
  21208. while (*name && (**name != key)) name++;
  21209. if (*name) {
  21210. values[name-argnames] = value;
  21211. continue;
  21212. }
  21213. name = first_kw_arg;
  21214. #if PY_MAJOR_VERSION < 3
  21215. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  21216. while (*name) {
  21217. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  21218. && _PyString_Eq(**name, key)) {
  21219. values[name-argnames] = value;
  21220. break;
  21221. }
  21222. name++;
  21223. }
  21224. if (*name) continue;
  21225. else {
  21226. PyObject*** argname = argnames;
  21227. while (argname != first_kw_arg) {
  21228. if ((**argname == key) || (
  21229. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  21230. && _PyString_Eq(**argname, key))) {
  21231. goto arg_passed_twice;
  21232. }
  21233. argname++;
  21234. }
  21235. }
  21236. } else
  21237. #endif
  21238. if (likely(PyUnicode_Check(key))) {
  21239. while (*name) {
  21240. int cmp = (**name == key) ? 0 :
  21241. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  21242. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  21243. #endif
  21244. PyUnicode_Compare(**name, key);
  21245. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  21246. if (cmp == 0) {
  21247. values[name-argnames] = value;
  21248. break;
  21249. }
  21250. name++;
  21251. }
  21252. if (*name) continue;
  21253. else {
  21254. PyObject*** argname = argnames;
  21255. while (argname != first_kw_arg) {
  21256. int cmp = (**argname == key) ? 0 :
  21257. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  21258. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  21259. #endif
  21260. PyUnicode_Compare(**argname, key);
  21261. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  21262. if (cmp == 0) goto arg_passed_twice;
  21263. argname++;
  21264. }
  21265. }
  21266. } else
  21267. goto invalid_keyword_type;
  21268. if (kwds2) {
  21269. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  21270. } else {
  21271. goto invalid_keyword;
  21272. }
  21273. }
  21274. return 0;
  21275. arg_passed_twice:
  21276. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  21277. goto bad;
  21278. invalid_keyword_type:
  21279. PyErr_Format(PyExc_TypeError,
  21280. "%.200s() keywords must be strings", function_name);
  21281. goto bad;
  21282. invalid_keyword:
  21283. PyErr_Format(PyExc_TypeError,
  21284. #if PY_MAJOR_VERSION < 3
  21285. "%.200s() got an unexpected keyword argument '%.200s'",
  21286. function_name, PyString_AsString(key));
  21287. #else
  21288. "%s() got an unexpected keyword argument '%U'",
  21289. function_name, key);
  21290. #endif
  21291. bad:
  21292. return -1;
  21293. }
  21294. /* PyCFunctionFastCall */
  21295. #if CYTHON_FAST_PYCCALL
  21296. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  21297. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  21298. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  21299. PyObject *self = PyCFunction_GET_SELF(func);
  21300. int flags = PyCFunction_GET_FLAGS(func);
  21301. assert(PyCFunction_Check(func));
  21302. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
  21303. assert(nargs >= 0);
  21304. assert(nargs == 0 || args != NULL);
  21305. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  21306. because it may clear it (directly or indirectly) and so the
  21307. caller loses its exception */
  21308. assert(!PyErr_Occurred());
  21309. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  21310. return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
  21311. } else {
  21312. return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
  21313. }
  21314. }
  21315. #endif
  21316. /* PyFunctionFastCall */
  21317. #if CYTHON_FAST_PYCALL
  21318. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  21319. PyObject *globals) {
  21320. PyFrameObject *f;
  21321. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21322. PyObject **fastlocals;
  21323. Py_ssize_t i;
  21324. PyObject *result;
  21325. assert(globals != NULL);
  21326. /* XXX Perhaps we should create a specialized
  21327. PyFrame_New() that doesn't take locals, but does
  21328. take builtins without sanity checking them.
  21329. */
  21330. assert(tstate != NULL);
  21331. f = PyFrame_New(tstate, co, globals, NULL);
  21332. if (f == NULL) {
  21333. return NULL;
  21334. }
  21335. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  21336. for (i = 0; i < na; i++) {
  21337. Py_INCREF(*args);
  21338. fastlocals[i] = *args++;
  21339. }
  21340. result = PyEval_EvalFrameEx(f,0);
  21341. ++tstate->recursion_depth;
  21342. Py_DECREF(f);
  21343. --tstate->recursion_depth;
  21344. return result;
  21345. }
  21346. #if 1 || PY_VERSION_HEX < 0x030600B1
  21347. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  21348. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  21349. PyObject *globals = PyFunction_GET_GLOBALS(func);
  21350. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  21351. PyObject *closure;
  21352. #if PY_MAJOR_VERSION >= 3
  21353. PyObject *kwdefs;
  21354. #endif
  21355. PyObject *kwtuple, **k;
  21356. PyObject **d;
  21357. Py_ssize_t nd;
  21358. Py_ssize_t nk;
  21359. PyObject *result;
  21360. assert(kwargs == NULL || PyDict_Check(kwargs));
  21361. nk = kwargs ? PyDict_Size(kwargs) : 0;
  21362. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  21363. return NULL;
  21364. }
  21365. if (
  21366. #if PY_MAJOR_VERSION >= 3
  21367. co->co_kwonlyargcount == 0 &&
  21368. #endif
  21369. likely(kwargs == NULL || nk == 0) &&
  21370. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  21371. if (argdefs == NULL && co->co_argcount == nargs) {
  21372. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  21373. goto done;
  21374. }
  21375. else if (nargs == 0 && argdefs != NULL
  21376. && co->co_argcount == Py_SIZE(argdefs)) {
  21377. /* function called with no arguments, but all parameters have
  21378. a default value: use default values as arguments .*/
  21379. args = &PyTuple_GET_ITEM(argdefs, 0);
  21380. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  21381. goto done;
  21382. }
  21383. }
  21384. if (kwargs != NULL) {
  21385. Py_ssize_t pos, i;
  21386. kwtuple = PyTuple_New(2 * nk);
  21387. if (kwtuple == NULL) {
  21388. result = NULL;
  21389. goto done;
  21390. }
  21391. k = &PyTuple_GET_ITEM(kwtuple, 0);
  21392. pos = i = 0;
  21393. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  21394. Py_INCREF(k[i]);
  21395. Py_INCREF(k[i+1]);
  21396. i += 2;
  21397. }
  21398. nk = i / 2;
  21399. }
  21400. else {
  21401. kwtuple = NULL;
  21402. k = NULL;
  21403. }
  21404. closure = PyFunction_GET_CLOSURE(func);
  21405. #if PY_MAJOR_VERSION >= 3
  21406. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  21407. #endif
  21408. if (argdefs != NULL) {
  21409. d = &PyTuple_GET_ITEM(argdefs, 0);
  21410. nd = Py_SIZE(argdefs);
  21411. }
  21412. else {
  21413. d = NULL;
  21414. nd = 0;
  21415. }
  21416. #if PY_MAJOR_VERSION >= 3
  21417. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  21418. args, (int)nargs,
  21419. k, (int)nk,
  21420. d, (int)nd, kwdefs, closure);
  21421. #else
  21422. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  21423. args, (int)nargs,
  21424. k, (int)nk,
  21425. d, (int)nd, closure);
  21426. #endif
  21427. Py_XDECREF(kwtuple);
  21428. done:
  21429. Py_LeaveRecursiveCall();
  21430. return result;
  21431. }
  21432. #endif
  21433. #endif
  21434. /* PyObjectCall */
  21435. #if CYTHON_COMPILING_IN_CPYTHON
  21436. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  21437. PyObject *result;
  21438. ternaryfunc call = func->ob_type->tp_call;
  21439. if (unlikely(!call))
  21440. return PyObject_Call(func, arg, kw);
  21441. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21442. return NULL;
  21443. result = (*call)(func, arg, kw);
  21444. Py_LeaveRecursiveCall();
  21445. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21446. PyErr_SetString(
  21447. PyExc_SystemError,
  21448. "NULL result without error in PyObject_Call");
  21449. }
  21450. return result;
  21451. }
  21452. #endif
  21453. /* PyObjectCall2Args */
  21454. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  21455. PyObject *args, *result = NULL;
  21456. #if CYTHON_FAST_PYCALL
  21457. if (PyFunction_Check(function)) {
  21458. PyObject *args[2] = {arg1, arg2};
  21459. return __Pyx_PyFunction_FastCall(function, args, 2);
  21460. }
  21461. #endif
  21462. #if CYTHON_FAST_PYCCALL
  21463. if (__Pyx_PyFastCFunction_Check(function)) {
  21464. PyObject *args[2] = {arg1, arg2};
  21465. return __Pyx_PyCFunction_FastCall(function, args, 2);
  21466. }
  21467. #endif
  21468. args = PyTuple_New(2);
  21469. if (unlikely(!args)) goto done;
  21470. Py_INCREF(arg1);
  21471. PyTuple_SET_ITEM(args, 0, arg1);
  21472. Py_INCREF(arg2);
  21473. PyTuple_SET_ITEM(args, 1, arg2);
  21474. Py_INCREF(function);
  21475. result = __Pyx_PyObject_Call(function, args, NULL);
  21476. Py_DECREF(args);
  21477. Py_DECREF(function);
  21478. done:
  21479. return result;
  21480. }
  21481. /* PyObjectCallMethO */
  21482. #if CYTHON_COMPILING_IN_CPYTHON
  21483. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  21484. PyObject *self, *result;
  21485. PyCFunction cfunc;
  21486. cfunc = PyCFunction_GET_FUNCTION(func);
  21487. self = PyCFunction_GET_SELF(func);
  21488. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21489. return NULL;
  21490. result = cfunc(self, arg);
  21491. Py_LeaveRecursiveCall();
  21492. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21493. PyErr_SetString(
  21494. PyExc_SystemError,
  21495. "NULL result without error in PyObject_Call");
  21496. }
  21497. return result;
  21498. }
  21499. #endif
  21500. /* PyObjectCallOneArg */
  21501. #if CYTHON_COMPILING_IN_CPYTHON
  21502. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21503. PyObject *result;
  21504. PyObject *args = PyTuple_New(1);
  21505. if (unlikely(!args)) return NULL;
  21506. Py_INCREF(arg);
  21507. PyTuple_SET_ITEM(args, 0, arg);
  21508. result = __Pyx_PyObject_Call(func, args, NULL);
  21509. Py_DECREF(args);
  21510. return result;
  21511. }
  21512. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21513. #if CYTHON_FAST_PYCALL
  21514. if (PyFunction_Check(func)) {
  21515. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  21516. }
  21517. #endif
  21518. if (likely(PyCFunction_Check(func))) {
  21519. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  21520. return __Pyx_PyObject_CallMethO(func, arg);
  21521. #if CYTHON_FAST_PYCCALL
  21522. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  21523. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  21524. #endif
  21525. }
  21526. }
  21527. return __Pyx__PyObject_CallOneArg(func, arg);
  21528. }
  21529. #else
  21530. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21531. PyObject *result;
  21532. PyObject *args = PyTuple_Pack(1, arg);
  21533. if (unlikely(!args)) return NULL;
  21534. result = __Pyx_PyObject_Call(func, args, NULL);
  21535. Py_DECREF(args);
  21536. return result;
  21537. }
  21538. #endif
  21539. /* PyDictVersioning */
  21540. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  21541. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  21542. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21543. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  21544. }
  21545. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  21546. PyObject **dictptr = NULL;
  21547. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  21548. if (offset) {
  21549. #if CYTHON_COMPILING_IN_CPYTHON
  21550. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  21551. #else
  21552. dictptr = _PyObject_GetDictPtr(obj);
  21553. #endif
  21554. }
  21555. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  21556. }
  21557. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  21558. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21559. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  21560. return 0;
  21561. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  21562. }
  21563. #endif
  21564. /* GetModuleGlobalName */
  21565. #if CYTHON_USE_DICT_VERSIONS
  21566. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  21567. #else
  21568. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  21569. #endif
  21570. {
  21571. PyObject *result;
  21572. #if !CYTHON_AVOID_BORROWED_REFS
  21573. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  21574. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  21575. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21576. if (likely(result)) {
  21577. return __Pyx_NewRef(result);
  21578. } else if (unlikely(PyErr_Occurred())) {
  21579. return NULL;
  21580. }
  21581. #else
  21582. result = PyDict_GetItem(__pyx_d, name);
  21583. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21584. if (likely(result)) {
  21585. return __Pyx_NewRef(result);
  21586. }
  21587. #endif
  21588. #else
  21589. result = PyObject_GetItem(__pyx_d, name);
  21590. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21591. if (likely(result)) {
  21592. return __Pyx_NewRef(result);
  21593. }
  21594. PyErr_Clear();
  21595. #endif
  21596. return __Pyx_GetBuiltinName(name);
  21597. }
  21598. /* PyErrFetchRestore */
  21599. #if CYTHON_FAST_THREAD_STATE
  21600. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  21601. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21602. tmp_type = tstate->curexc_type;
  21603. tmp_value = tstate->curexc_value;
  21604. tmp_tb = tstate->curexc_traceback;
  21605. tstate->curexc_type = type;
  21606. tstate->curexc_value = value;
  21607. tstate->curexc_traceback = tb;
  21608. Py_XDECREF(tmp_type);
  21609. Py_XDECREF(tmp_value);
  21610. Py_XDECREF(tmp_tb);
  21611. }
  21612. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  21613. *type = tstate->curexc_type;
  21614. *value = tstate->curexc_value;
  21615. *tb = tstate->curexc_traceback;
  21616. tstate->curexc_type = 0;
  21617. tstate->curexc_value = 0;
  21618. tstate->curexc_traceback = 0;
  21619. }
  21620. #endif
  21621. /* RaiseException */
  21622. #if PY_MAJOR_VERSION < 3
  21623. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  21624. CYTHON_UNUSED PyObject *cause) {
  21625. __Pyx_PyThreadState_declare
  21626. Py_XINCREF(type);
  21627. if (!value || value == Py_None)
  21628. value = NULL;
  21629. else
  21630. Py_INCREF(value);
  21631. if (!tb || tb == Py_None)
  21632. tb = NULL;
  21633. else {
  21634. Py_INCREF(tb);
  21635. if (!PyTraceBack_Check(tb)) {
  21636. PyErr_SetString(PyExc_TypeError,
  21637. "raise: arg 3 must be a traceback or None");
  21638. goto raise_error;
  21639. }
  21640. }
  21641. if (PyType_Check(type)) {
  21642. #if CYTHON_COMPILING_IN_PYPY
  21643. if (!value) {
  21644. Py_INCREF(Py_None);
  21645. value = Py_None;
  21646. }
  21647. #endif
  21648. PyErr_NormalizeException(&type, &value, &tb);
  21649. } else {
  21650. if (value) {
  21651. PyErr_SetString(PyExc_TypeError,
  21652. "instance exception may not have a separate value");
  21653. goto raise_error;
  21654. }
  21655. value = type;
  21656. type = (PyObject*) Py_TYPE(type);
  21657. Py_INCREF(type);
  21658. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  21659. PyErr_SetString(PyExc_TypeError,
  21660. "raise: exception class must be a subclass of BaseException");
  21661. goto raise_error;
  21662. }
  21663. }
  21664. __Pyx_PyThreadState_assign
  21665. __Pyx_ErrRestore(type, value, tb);
  21666. return;
  21667. raise_error:
  21668. Py_XDECREF(value);
  21669. Py_XDECREF(type);
  21670. Py_XDECREF(tb);
  21671. return;
  21672. }
  21673. #else
  21674. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  21675. PyObject* owned_instance = NULL;
  21676. if (tb == Py_None) {
  21677. tb = 0;
  21678. } else if (tb && !PyTraceBack_Check(tb)) {
  21679. PyErr_SetString(PyExc_TypeError,
  21680. "raise: arg 3 must be a traceback or None");
  21681. goto bad;
  21682. }
  21683. if (value == Py_None)
  21684. value = 0;
  21685. if (PyExceptionInstance_Check(type)) {
  21686. if (value) {
  21687. PyErr_SetString(PyExc_TypeError,
  21688. "instance exception may not have a separate value");
  21689. goto bad;
  21690. }
  21691. value = type;
  21692. type = (PyObject*) Py_TYPE(value);
  21693. } else if (PyExceptionClass_Check(type)) {
  21694. PyObject *instance_class = NULL;
  21695. if (value && PyExceptionInstance_Check(value)) {
  21696. instance_class = (PyObject*) Py_TYPE(value);
  21697. if (instance_class != type) {
  21698. int is_subclass = PyObject_IsSubclass(instance_class, type);
  21699. if (!is_subclass) {
  21700. instance_class = NULL;
  21701. } else if (unlikely(is_subclass == -1)) {
  21702. goto bad;
  21703. } else {
  21704. type = instance_class;
  21705. }
  21706. }
  21707. }
  21708. if (!instance_class) {
  21709. PyObject *args;
  21710. if (!value)
  21711. args = PyTuple_New(0);
  21712. else if (PyTuple_Check(value)) {
  21713. Py_INCREF(value);
  21714. args = value;
  21715. } else
  21716. args = PyTuple_Pack(1, value);
  21717. if (!args)
  21718. goto bad;
  21719. owned_instance = PyObject_Call(type, args, NULL);
  21720. Py_DECREF(args);
  21721. if (!owned_instance)
  21722. goto bad;
  21723. value = owned_instance;
  21724. if (!PyExceptionInstance_Check(value)) {
  21725. PyErr_Format(PyExc_TypeError,
  21726. "calling %R should have returned an instance of "
  21727. "BaseException, not %R",
  21728. type, Py_TYPE(value));
  21729. goto bad;
  21730. }
  21731. }
  21732. } else {
  21733. PyErr_SetString(PyExc_TypeError,
  21734. "raise: exception class must be a subclass of BaseException");
  21735. goto bad;
  21736. }
  21737. if (cause) {
  21738. PyObject *fixed_cause;
  21739. if (cause == Py_None) {
  21740. fixed_cause = NULL;
  21741. } else if (PyExceptionClass_Check(cause)) {
  21742. fixed_cause = PyObject_CallObject(cause, NULL);
  21743. if (fixed_cause == NULL)
  21744. goto bad;
  21745. } else if (PyExceptionInstance_Check(cause)) {
  21746. fixed_cause = cause;
  21747. Py_INCREF(fixed_cause);
  21748. } else {
  21749. PyErr_SetString(PyExc_TypeError,
  21750. "exception causes must derive from "
  21751. "BaseException");
  21752. goto bad;
  21753. }
  21754. PyException_SetCause(value, fixed_cause);
  21755. }
  21756. PyErr_SetObject(type, value);
  21757. if (tb) {
  21758. #if CYTHON_COMPILING_IN_PYPY
  21759. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21760. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  21761. Py_INCREF(tb);
  21762. PyErr_Restore(tmp_type, tmp_value, tb);
  21763. Py_XDECREF(tmp_tb);
  21764. #else
  21765. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21766. PyObject* tmp_tb = tstate->curexc_traceback;
  21767. if (tb != tmp_tb) {
  21768. Py_INCREF(tb);
  21769. tstate->curexc_traceback = tb;
  21770. Py_XDECREF(tmp_tb);
  21771. }
  21772. #endif
  21773. }
  21774. bad:
  21775. Py_XDECREF(owned_instance);
  21776. return;
  21777. }
  21778. #endif
  21779. /* GetItemInt */
  21780. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  21781. PyObject *r;
  21782. if (!j) return NULL;
  21783. r = PyObject_GetItem(o, j);
  21784. Py_DECREF(j);
  21785. return r;
  21786. }
  21787. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  21788. CYTHON_NCP_UNUSED int wraparound,
  21789. CYTHON_NCP_UNUSED int boundscheck) {
  21790. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21791. Py_ssize_t wrapped_i = i;
  21792. if (wraparound & unlikely(i < 0)) {
  21793. wrapped_i += PyList_GET_SIZE(o);
  21794. }
  21795. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
  21796. PyObject *r = PyList_GET_ITEM(o, wrapped_i);
  21797. Py_INCREF(r);
  21798. return r;
  21799. }
  21800. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21801. #else
  21802. return PySequence_GetItem(o, i);
  21803. #endif
  21804. }
  21805. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  21806. CYTHON_NCP_UNUSED int wraparound,
  21807. CYTHON_NCP_UNUSED int boundscheck) {
  21808. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21809. Py_ssize_t wrapped_i = i;
  21810. if (wraparound & unlikely(i < 0)) {
  21811. wrapped_i += PyTuple_GET_SIZE(o);
  21812. }
  21813. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
  21814. PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
  21815. Py_INCREF(r);
  21816. return r;
  21817. }
  21818. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21819. #else
  21820. return PySequence_GetItem(o, i);
  21821. #endif
  21822. }
  21823. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
  21824. CYTHON_NCP_UNUSED int wraparound,
  21825. CYTHON_NCP_UNUSED int boundscheck) {
  21826. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
  21827. if (is_list || PyList_CheckExact(o)) {
  21828. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  21829. if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
  21830. PyObject *r = PyList_GET_ITEM(o, n);
  21831. Py_INCREF(r);
  21832. return r;
  21833. }
  21834. }
  21835. else if (PyTuple_CheckExact(o)) {
  21836. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  21837. if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
  21838. PyObject *r = PyTuple_GET_ITEM(o, n);
  21839. Py_INCREF(r);
  21840. return r;
  21841. }
  21842. } else {
  21843. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  21844. if (likely(m && m->sq_item)) {
  21845. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  21846. Py_ssize_t l = m->sq_length(o);
  21847. if (likely(l >= 0)) {
  21848. i += l;
  21849. } else {
  21850. if (!PyErr_ExceptionMatches(PyExc_OverflowError))
  21851. return NULL;
  21852. PyErr_Clear();
  21853. }
  21854. }
  21855. return m->sq_item(o, i);
  21856. }
  21857. }
  21858. #else
  21859. if (is_list || PySequence_Check(o)) {
  21860. return PySequence_GetItem(o, i);
  21861. }
  21862. #endif
  21863. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21864. }
  21865. /* ObjectGetItem */
  21866. #if CYTHON_USE_TYPE_SLOTS
  21867. static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
  21868. PyObject *runerr;
  21869. Py_ssize_t key_value;
  21870. PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
  21871. if (unlikely(!(m && m->sq_item))) {
  21872. PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
  21873. return NULL;
  21874. }
  21875. key_value = __Pyx_PyIndex_AsSsize_t(index);
  21876. if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
  21877. return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
  21878. }
  21879. if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
  21880. PyErr_Clear();
  21881. PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
  21882. }
  21883. return NULL;
  21884. }
  21885. static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
  21886. PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
  21887. if (likely(m && m->mp_subscript)) {
  21888. return m->mp_subscript(obj, key);
  21889. }
  21890. return __Pyx_PyObject_GetIndex(obj, key);
  21891. }
  21892. #endif
  21893. /* PyObjectCallNoArg */
  21894. #if CYTHON_COMPILING_IN_CPYTHON
  21895. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
  21896. #if CYTHON_FAST_PYCALL
  21897. if (PyFunction_Check(func)) {
  21898. return __Pyx_PyFunction_FastCall(func, NULL, 0);
  21899. }
  21900. #endif
  21901. #ifdef __Pyx_CyFunction_USED
  21902. if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
  21903. #else
  21904. if (likely(PyCFunction_Check(func)))
  21905. #endif
  21906. {
  21907. if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
  21908. return __Pyx_PyObject_CallMethO(func, NULL);
  21909. }
  21910. }
  21911. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
  21912. }
  21913. #endif
  21914. /* IterFinish */
  21915. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  21916. #if CYTHON_FAST_THREAD_STATE
  21917. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21918. PyObject* exc_type = tstate->curexc_type;
  21919. if (unlikely(exc_type)) {
  21920. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
  21921. PyObject *exc_value, *exc_tb;
  21922. exc_value = tstate->curexc_value;
  21923. exc_tb = tstate->curexc_traceback;
  21924. tstate->curexc_type = 0;
  21925. tstate->curexc_value = 0;
  21926. tstate->curexc_traceback = 0;
  21927. Py_DECREF(exc_type);
  21928. Py_XDECREF(exc_value);
  21929. Py_XDECREF(exc_tb);
  21930. return 0;
  21931. } else {
  21932. return -1;
  21933. }
  21934. }
  21935. return 0;
  21936. #else
  21937. if (unlikely(PyErr_Occurred())) {
  21938. if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
  21939. PyErr_Clear();
  21940. return 0;
  21941. } else {
  21942. return -1;
  21943. }
  21944. }
  21945. return 0;
  21946. #endif
  21947. }
  21948. /* PyObjectGetMethod */
  21949. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
  21950. PyObject *attr;
  21951. #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
  21952. PyTypeObject *tp = Py_TYPE(obj);
  21953. PyObject *descr;
  21954. descrgetfunc f = NULL;
  21955. PyObject **dictptr, *dict;
  21956. int meth_found = 0;
  21957. assert (*method == NULL);
  21958. if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
  21959. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21960. goto try_unpack;
  21961. }
  21962. if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
  21963. return 0;
  21964. }
  21965. descr = _PyType_Lookup(tp, name);
  21966. if (likely(descr != NULL)) {
  21967. Py_INCREF(descr);
  21968. #if PY_MAJOR_VERSION >= 3
  21969. #ifdef __Pyx_CyFunction_USED
  21970. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
  21971. #else
  21972. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
  21973. #endif
  21974. #else
  21975. #ifdef __Pyx_CyFunction_USED
  21976. if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
  21977. #else
  21978. if (likely(PyFunction_Check(descr)))
  21979. #endif
  21980. #endif
  21981. {
  21982. meth_found = 1;
  21983. } else {
  21984. f = Py_TYPE(descr)->tp_descr_get;
  21985. if (f != NULL && PyDescr_IsData(descr)) {
  21986. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21987. Py_DECREF(descr);
  21988. goto try_unpack;
  21989. }
  21990. }
  21991. }
  21992. dictptr = _PyObject_GetDictPtr(obj);
  21993. if (dictptr != NULL && (dict = *dictptr) != NULL) {
  21994. Py_INCREF(dict);
  21995. attr = __Pyx_PyDict_GetItemStr(dict, name);
  21996. if (attr != NULL) {
  21997. Py_INCREF(attr);
  21998. Py_DECREF(dict);
  21999. Py_XDECREF(descr);
  22000. goto try_unpack;
  22001. }
  22002. Py_DECREF(dict);
  22003. }
  22004. if (meth_found) {
  22005. *method = descr;
  22006. return 1;
  22007. }
  22008. if (f != NULL) {
  22009. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  22010. Py_DECREF(descr);
  22011. goto try_unpack;
  22012. }
  22013. if (descr != NULL) {
  22014. *method = descr;
  22015. return 0;
  22016. }
  22017. PyErr_Format(PyExc_AttributeError,
  22018. #if PY_MAJOR_VERSION >= 3
  22019. "'%.50s' object has no attribute '%U'",
  22020. tp->tp_name, name);
  22021. #else
  22022. "'%.50s' object has no attribute '%.400s'",
  22023. tp->tp_name, PyString_AS_STRING(name));
  22024. #endif
  22025. return 0;
  22026. #else
  22027. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  22028. goto try_unpack;
  22029. #endif
  22030. try_unpack:
  22031. #if CYTHON_UNPACK_METHODS
  22032. if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
  22033. PyObject *function = PyMethod_GET_FUNCTION(attr);
  22034. Py_INCREF(function);
  22035. Py_DECREF(attr);
  22036. *method = function;
  22037. return 1;
  22038. }
  22039. #endif
  22040. *method = attr;
  22041. return 0;
  22042. }
  22043. /* PyObjectCallMethod0 */
  22044. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
  22045. PyObject *method = NULL, *result = NULL;
  22046. int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
  22047. if (likely(is_method)) {
  22048. result = __Pyx_PyObject_CallOneArg(method, obj);
  22049. Py_DECREF(method);
  22050. return result;
  22051. }
  22052. if (unlikely(!method)) goto bad;
  22053. result = __Pyx_PyObject_CallNoArg(method);
  22054. Py_DECREF(method);
  22055. bad:
  22056. return result;
  22057. }
  22058. /* RaiseNeedMoreValuesToUnpack */
  22059. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  22060. PyErr_Format(PyExc_ValueError,
  22061. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  22062. index, (index == 1) ? "" : "s");
  22063. }
  22064. /* RaiseTooManyValuesToUnpack */
  22065. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  22066. PyErr_Format(PyExc_ValueError,
  22067. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  22068. }
  22069. /* UnpackItemEndCheck */
  22070. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  22071. if (unlikely(retval)) {
  22072. Py_DECREF(retval);
  22073. __Pyx_RaiseTooManyValuesError(expected);
  22074. return -1;
  22075. } else {
  22076. return __Pyx_IterFinish();
  22077. }
  22078. return 0;
  22079. }
  22080. /* RaiseNoneIterError */
  22081. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  22082. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  22083. }
  22084. /* UnpackTupleError */
  22085. static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
  22086. if (t == Py_None) {
  22087. __Pyx_RaiseNoneNotIterableError();
  22088. } else if (PyTuple_GET_SIZE(t) < index) {
  22089. __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
  22090. } else {
  22091. __Pyx_RaiseTooManyValuesError(index);
  22092. }
  22093. }
  22094. /* UnpackTuple2 */
  22095. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  22096. PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
  22097. PyObject *value1 = NULL, *value2 = NULL;
  22098. #if CYTHON_COMPILING_IN_PYPY
  22099. value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
  22100. value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
  22101. #else
  22102. value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
  22103. value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
  22104. #endif
  22105. if (decref_tuple) {
  22106. Py_DECREF(tuple);
  22107. }
  22108. *pvalue1 = value1;
  22109. *pvalue2 = value2;
  22110. return 0;
  22111. #if CYTHON_COMPILING_IN_PYPY
  22112. bad:
  22113. Py_XDECREF(value1);
  22114. Py_XDECREF(value2);
  22115. if (decref_tuple) { Py_XDECREF(tuple); }
  22116. return -1;
  22117. #endif
  22118. }
  22119. static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
  22120. int has_known_size, int decref_tuple) {
  22121. Py_ssize_t index;
  22122. PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
  22123. iternextfunc iternext;
  22124. iter = PyObject_GetIter(tuple);
  22125. if (unlikely(!iter)) goto bad;
  22126. if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
  22127. iternext = Py_TYPE(iter)->tp_iternext;
  22128. value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
  22129. value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
  22130. if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
  22131. Py_DECREF(iter);
  22132. *pvalue1 = value1;
  22133. *pvalue2 = value2;
  22134. return 0;
  22135. unpacking_failed:
  22136. if (!has_known_size && __Pyx_IterFinish() == 0)
  22137. __Pyx_RaiseNeedMoreValuesError(index);
  22138. bad:
  22139. Py_XDECREF(iter);
  22140. Py_XDECREF(value1);
  22141. Py_XDECREF(value2);
  22142. if (decref_tuple) { Py_XDECREF(tuple); }
  22143. return -1;
  22144. }
  22145. /* dict_iter */
  22146. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
  22147. Py_ssize_t* p_orig_length, int* p_source_is_dict) {
  22148. is_dict = is_dict || likely(PyDict_CheckExact(iterable));
  22149. *p_source_is_dict = is_dict;
  22150. if (is_dict) {
  22151. #if !CYTHON_COMPILING_IN_PYPY
  22152. *p_orig_length = PyDict_Size(iterable);
  22153. Py_INCREF(iterable);
  22154. return iterable;
  22155. #elif PY_MAJOR_VERSION >= 3
  22156. static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
  22157. PyObject **pp = NULL;
  22158. if (method_name) {
  22159. const char *name = PyUnicode_AsUTF8(method_name);
  22160. if (strcmp(name, "iteritems") == 0) pp = &py_items;
  22161. else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
  22162. else if (strcmp(name, "itervalues") == 0) pp = &py_values;
  22163. if (pp) {
  22164. if (!*pp) {
  22165. *pp = PyUnicode_FromString(name + 4);
  22166. if (!*pp)
  22167. return NULL;
  22168. }
  22169. method_name = *pp;
  22170. }
  22171. }
  22172. #endif
  22173. }
  22174. *p_orig_length = 0;
  22175. if (method_name) {
  22176. PyObject* iter;
  22177. iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
  22178. if (!iterable)
  22179. return NULL;
  22180. #if !CYTHON_COMPILING_IN_PYPY
  22181. if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
  22182. return iterable;
  22183. #endif
  22184. iter = PyObject_GetIter(iterable);
  22185. Py_DECREF(iterable);
  22186. return iter;
  22187. }
  22188. return PyObject_GetIter(iterable);
  22189. }
  22190. static CYTHON_INLINE int __Pyx_dict_iter_next(
  22191. PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
  22192. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
  22193. PyObject* next_item;
  22194. #if !CYTHON_COMPILING_IN_PYPY
  22195. if (source_is_dict) {
  22196. PyObject *key, *value;
  22197. if (unlikely(orig_length != PyDict_Size(iter_obj))) {
  22198. PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
  22199. return -1;
  22200. }
  22201. if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
  22202. return 0;
  22203. }
  22204. if (pitem) {
  22205. PyObject* tuple = PyTuple_New(2);
  22206. if (unlikely(!tuple)) {
  22207. return -1;
  22208. }
  22209. Py_INCREF(key);
  22210. Py_INCREF(value);
  22211. PyTuple_SET_ITEM(tuple, 0, key);
  22212. PyTuple_SET_ITEM(tuple, 1, value);
  22213. *pitem = tuple;
  22214. } else {
  22215. if (pkey) {
  22216. Py_INCREF(key);
  22217. *pkey = key;
  22218. }
  22219. if (pvalue) {
  22220. Py_INCREF(value);
  22221. *pvalue = value;
  22222. }
  22223. }
  22224. return 1;
  22225. } else if (PyTuple_CheckExact(iter_obj)) {
  22226. Py_ssize_t pos = *ppos;
  22227. if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
  22228. *ppos = pos + 1;
  22229. next_item = PyTuple_GET_ITEM(iter_obj, pos);
  22230. Py_INCREF(next_item);
  22231. } else if (PyList_CheckExact(iter_obj)) {
  22232. Py_ssize_t pos = *ppos;
  22233. if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
  22234. *ppos = pos + 1;
  22235. next_item = PyList_GET_ITEM(iter_obj, pos);
  22236. Py_INCREF(next_item);
  22237. } else
  22238. #endif
  22239. {
  22240. next_item = PyIter_Next(iter_obj);
  22241. if (unlikely(!next_item)) {
  22242. return __Pyx_IterFinish();
  22243. }
  22244. }
  22245. if (pitem) {
  22246. *pitem = next_item;
  22247. } else if (pkey && pvalue) {
  22248. if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
  22249. return -1;
  22250. } else if (pkey) {
  22251. *pkey = next_item;
  22252. } else {
  22253. *pvalue = next_item;
  22254. }
  22255. return 1;
  22256. }
  22257. /* PyIntBinop */
  22258. #if !CYTHON_COMPILING_IN_PYPY
  22259. static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
  22260. (void)inplace;
  22261. (void)zerodivision_check;
  22262. #if PY_MAJOR_VERSION < 3
  22263. if (likely(PyInt_CheckExact(op1))) {
  22264. const long b = intval;
  22265. long x;
  22266. long a = PyInt_AS_LONG(op1);
  22267. x = (long)((unsigned long)a + b);
  22268. if (likely((x^a) >= 0 || (x^b) >= 0))
  22269. return PyInt_FromLong(x);
  22270. return PyLong_Type.tp_as_number->nb_add(op1, op2);
  22271. }
  22272. #endif
  22273. #if CYTHON_USE_PYLONG_INTERNALS
  22274. if (likely(PyLong_CheckExact(op1))) {
  22275. const long b = intval;
  22276. long a, x;
  22277. #ifdef HAVE_LONG_LONG
  22278. const PY_LONG_LONG llb = intval;
  22279. PY_LONG_LONG lla, llx;
  22280. #endif
  22281. const digit* digits = ((PyLongObject*)op1)->ob_digit;
  22282. const Py_ssize_t size = Py_SIZE(op1);
  22283. if (likely(__Pyx_sst_abs(size) <= 1)) {
  22284. a = likely(size) ? digits[0] : 0;
  22285. if (size == -1) a = -a;
  22286. } else {
  22287. switch (size) {
  22288. case -2:
  22289. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  22290. a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22291. break;
  22292. #ifdef HAVE_LONG_LONG
  22293. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
  22294. lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22295. goto long_long;
  22296. #endif
  22297. }
  22298. CYTHON_FALLTHROUGH;
  22299. case 2:
  22300. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  22301. a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22302. break;
  22303. #ifdef HAVE_LONG_LONG
  22304. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
  22305. lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22306. goto long_long;
  22307. #endif
  22308. }
  22309. CYTHON_FALLTHROUGH;
  22310. case -3:
  22311. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  22312. a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22313. break;
  22314. #ifdef HAVE_LONG_LONG
  22315. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
  22316. lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22317. goto long_long;
  22318. #endif
  22319. }
  22320. CYTHON_FALLTHROUGH;
  22321. case 3:
  22322. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  22323. a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22324. break;
  22325. #ifdef HAVE_LONG_LONG
  22326. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
  22327. lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22328. goto long_long;
  22329. #endif
  22330. }
  22331. CYTHON_FALLTHROUGH;
  22332. case -4:
  22333. if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  22334. a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22335. break;
  22336. #ifdef HAVE_LONG_LONG
  22337. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
  22338. lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22339. goto long_long;
  22340. #endif
  22341. }
  22342. CYTHON_FALLTHROUGH;
  22343. case 4:
  22344. if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  22345. a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22346. break;
  22347. #ifdef HAVE_LONG_LONG
  22348. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
  22349. lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22350. goto long_long;
  22351. #endif
  22352. }
  22353. CYTHON_FALLTHROUGH;
  22354. default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
  22355. }
  22356. }
  22357. x = a + b;
  22358. return PyLong_FromLong(x);
  22359. #ifdef HAVE_LONG_LONG
  22360. long_long:
  22361. llx = lla + llb;
  22362. return PyLong_FromLongLong(llx);
  22363. #endif
  22364. }
  22365. #endif
  22366. if (PyFloat_CheckExact(op1)) {
  22367. const long b = intval;
  22368. double a = PyFloat_AS_DOUBLE(op1);
  22369. double result;
  22370. PyFPE_START_PROTECT("add", return NULL)
  22371. result = ((double)a) + (double)b;
  22372. PyFPE_END_PROTECT(result)
  22373. return PyFloat_FromDouble(result);
  22374. }
  22375. return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
  22376. }
  22377. #endif
  22378. /* PyObjectSetAttrStr */
  22379. #if CYTHON_USE_TYPE_SLOTS
  22380. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  22381. PyTypeObject* tp = Py_TYPE(obj);
  22382. if (likely(tp->tp_setattro))
  22383. return tp->tp_setattro(obj, attr_name, value);
  22384. #if PY_MAJOR_VERSION < 3
  22385. if (likely(tp->tp_setattr))
  22386. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  22387. #endif
  22388. return PyObject_SetAttr(obj, attr_name, value);
  22389. }
  22390. #endif
  22391. /* DictGetItem */
  22392. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  22393. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
  22394. PyObject *value;
  22395. value = PyDict_GetItemWithError(d, key);
  22396. if (unlikely(!value)) {
  22397. if (!PyErr_Occurred()) {
  22398. if (unlikely(PyTuple_Check(key))) {
  22399. PyObject* args = PyTuple_Pack(1, key);
  22400. if (likely(args)) {
  22401. PyErr_SetObject(PyExc_KeyError, args);
  22402. Py_DECREF(args);
  22403. }
  22404. } else {
  22405. PyErr_SetObject(PyExc_KeyError, key);
  22406. }
  22407. }
  22408. return NULL;
  22409. }
  22410. Py_INCREF(value);
  22411. return value;
  22412. }
  22413. #endif
  22414. /* ExtTypeTest */
  22415. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  22416. if (unlikely(!type)) {
  22417. PyErr_SetString(PyExc_SystemError, "Missing type object");
  22418. return 0;
  22419. }
  22420. if (likely(__Pyx_TypeCheck(obj, type)))
  22421. return 1;
  22422. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  22423. Py_TYPE(obj)->tp_name, type->tp_name);
  22424. return 0;
  22425. }
  22426. /* GetTopmostException */
  22427. #if CYTHON_USE_EXC_INFO_STACK
  22428. static _PyErr_StackItem *
  22429. __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
  22430. {
  22431. _PyErr_StackItem *exc_info = tstate->exc_info;
  22432. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  22433. exc_info->previous_item != NULL)
  22434. {
  22435. exc_info = exc_info->previous_item;
  22436. }
  22437. return exc_info;
  22438. }
  22439. #endif
  22440. /* SaveResetException */
  22441. #if CYTHON_FAST_THREAD_STATE
  22442. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  22443. #if CYTHON_USE_EXC_INFO_STACK
  22444. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  22445. *type = exc_info->exc_type;
  22446. *value = exc_info->exc_value;
  22447. *tb = exc_info->exc_traceback;
  22448. #else
  22449. *type = tstate->exc_type;
  22450. *value = tstate->exc_value;
  22451. *tb = tstate->exc_traceback;
  22452. #endif
  22453. Py_XINCREF(*type);
  22454. Py_XINCREF(*value);
  22455. Py_XINCREF(*tb);
  22456. }
  22457. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  22458. PyObject *tmp_type, *tmp_value, *tmp_tb;
  22459. #if CYTHON_USE_EXC_INFO_STACK
  22460. _PyErr_StackItem *exc_info = tstate->exc_info;
  22461. tmp_type = exc_info->exc_type;
  22462. tmp_value = exc_info->exc_value;
  22463. tmp_tb = exc_info->exc_traceback;
  22464. exc_info->exc_type = type;
  22465. exc_info->exc_value = value;
  22466. exc_info->exc_traceback = tb;
  22467. #else
  22468. tmp_type = tstate->exc_type;
  22469. tmp_value = tstate->exc_value;
  22470. tmp_tb = tstate->exc_traceback;
  22471. tstate->exc_type = type;
  22472. tstate->exc_value = value;
  22473. tstate->exc_traceback = tb;
  22474. #endif
  22475. Py_XDECREF(tmp_type);
  22476. Py_XDECREF(tmp_value);
  22477. Py_XDECREF(tmp_tb);
  22478. }
  22479. #endif
  22480. /* PyErrExceptionMatches */
  22481. #if CYTHON_FAST_THREAD_STATE
  22482. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  22483. Py_ssize_t i, n;
  22484. n = PyTuple_GET_SIZE(tuple);
  22485. #if PY_MAJOR_VERSION >= 3
  22486. for (i=0; i<n; i++) {
  22487. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  22488. }
  22489. #endif
  22490. for (i=0; i<n; i++) {
  22491. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  22492. }
  22493. return 0;
  22494. }
  22495. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  22496. PyObject *exc_type = tstate->curexc_type;
  22497. if (exc_type == err) return 1;
  22498. if (unlikely(!exc_type)) return 0;
  22499. if (unlikely(PyTuple_Check(err)))
  22500. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  22501. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  22502. }
  22503. #endif
  22504. /* GetException */
  22505. #if CYTHON_FAST_THREAD_STATE
  22506. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
  22507. #else
  22508. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
  22509. #endif
  22510. {
  22511. PyObject *local_type, *local_value, *local_tb;
  22512. #if CYTHON_FAST_THREAD_STATE
  22513. PyObject *tmp_type, *tmp_value, *tmp_tb;
  22514. local_type = tstate->curexc_type;
  22515. local_value = tstate->curexc_value;
  22516. local_tb = tstate->curexc_traceback;
  22517. tstate->curexc_type = 0;
  22518. tstate->curexc_value = 0;
  22519. tstate->curexc_traceback = 0;
  22520. #else
  22521. PyErr_Fetch(&local_type, &local_value, &local_tb);
  22522. #endif
  22523. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  22524. #if CYTHON_FAST_THREAD_STATE
  22525. if (unlikely(tstate->curexc_type))
  22526. #else
  22527. if (unlikely(PyErr_Occurred()))
  22528. #endif
  22529. goto bad;
  22530. #if PY_MAJOR_VERSION >= 3
  22531. if (local_tb) {
  22532. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  22533. goto bad;
  22534. }
  22535. #endif
  22536. Py_XINCREF(local_tb);
  22537. Py_XINCREF(local_type);
  22538. Py_XINCREF(local_value);
  22539. *type = local_type;
  22540. *value = local_value;
  22541. *tb = local_tb;
  22542. #if CYTHON_FAST_THREAD_STATE
  22543. #if CYTHON_USE_EXC_INFO_STACK
  22544. {
  22545. _PyErr_StackItem *exc_info = tstate->exc_info;
  22546. tmp_type = exc_info->exc_type;
  22547. tmp_value = exc_info->exc_value;
  22548. tmp_tb = exc_info->exc_traceback;
  22549. exc_info->exc_type = local_type;
  22550. exc_info->exc_value = local_value;
  22551. exc_info->exc_traceback = local_tb;
  22552. }
  22553. #else
  22554. tmp_type = tstate->exc_type;
  22555. tmp_value = tstate->exc_value;
  22556. tmp_tb = tstate->exc_traceback;
  22557. tstate->exc_type = local_type;
  22558. tstate->exc_value = local_value;
  22559. tstate->exc_traceback = local_tb;
  22560. #endif
  22561. Py_XDECREF(tmp_type);
  22562. Py_XDECREF(tmp_value);
  22563. Py_XDECREF(tmp_tb);
  22564. #else
  22565. PyErr_SetExcInfo(local_type, local_value, local_tb);
  22566. #endif
  22567. return 0;
  22568. bad:
  22569. *type = 0;
  22570. *value = 0;
  22571. *tb = 0;
  22572. Py_XDECREF(local_type);
  22573. Py_XDECREF(local_value);
  22574. Py_XDECREF(local_tb);
  22575. return -1;
  22576. }
  22577. /* PyObject_GenericGetAttrNoDict */
  22578. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22579. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  22580. PyErr_Format(PyExc_AttributeError,
  22581. #if PY_MAJOR_VERSION >= 3
  22582. "'%.50s' object has no attribute '%U'",
  22583. tp->tp_name, attr_name);
  22584. #else
  22585. "'%.50s' object has no attribute '%.400s'",
  22586. tp->tp_name, PyString_AS_STRING(attr_name));
  22587. #endif
  22588. return NULL;
  22589. }
  22590. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  22591. PyObject *descr;
  22592. PyTypeObject *tp = Py_TYPE(obj);
  22593. if (unlikely(!PyString_Check(attr_name))) {
  22594. return PyObject_GenericGetAttr(obj, attr_name);
  22595. }
  22596. assert(!tp->tp_dictoffset);
  22597. descr = _PyType_Lookup(tp, attr_name);
  22598. if (unlikely(!descr)) {
  22599. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  22600. }
  22601. Py_INCREF(descr);
  22602. #if PY_MAJOR_VERSION < 3
  22603. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  22604. #endif
  22605. {
  22606. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  22607. if (unlikely(f)) {
  22608. PyObject *res = f(descr, obj, (PyObject *)tp);
  22609. Py_DECREF(descr);
  22610. return res;
  22611. }
  22612. }
  22613. return descr;
  22614. }
  22615. #endif
  22616. /* PyObject_GenericGetAttr */
  22617. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22618. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  22619. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  22620. return PyObject_GenericGetAttr(obj, attr_name);
  22621. }
  22622. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  22623. }
  22624. #endif
  22625. /* SetupReduce */
  22626. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  22627. int ret;
  22628. PyObject *name_attr;
  22629. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  22630. if (likely(name_attr)) {
  22631. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  22632. } else {
  22633. ret = -1;
  22634. }
  22635. if (unlikely(ret < 0)) {
  22636. PyErr_Clear();
  22637. ret = 0;
  22638. }
  22639. Py_XDECREF(name_attr);
  22640. return ret;
  22641. }
  22642. static int __Pyx_setup_reduce(PyObject* type_obj) {
  22643. int ret = 0;
  22644. PyObject *object_reduce = NULL;
  22645. PyObject *object_reduce_ex = NULL;
  22646. PyObject *reduce = NULL;
  22647. PyObject *reduce_ex = NULL;
  22648. PyObject *reduce_cython = NULL;
  22649. PyObject *setstate = NULL;
  22650. PyObject *setstate_cython = NULL;
  22651. #if CYTHON_USE_PYTYPE_LOOKUP
  22652. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22653. #else
  22654. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22655. #endif
  22656. #if CYTHON_USE_PYTYPE_LOOKUP
  22657. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22658. #else
  22659. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22660. #endif
  22661. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
  22662. if (reduce_ex == object_reduce_ex) {
  22663. #if CYTHON_USE_PYTYPE_LOOKUP
  22664. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22665. #else
  22666. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22667. #endif
  22668. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
  22669. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  22670. reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
  22671. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22672. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22673. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  22674. if (!setstate) PyErr_Clear();
  22675. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  22676. setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
  22677. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22678. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22679. }
  22680. PyType_Modified((PyTypeObject*)type_obj);
  22681. }
  22682. }
  22683. goto __PYX_GOOD;
  22684. __PYX_BAD:
  22685. if (!PyErr_Occurred())
  22686. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  22687. ret = -1;
  22688. __PYX_GOOD:
  22689. #if !CYTHON_USE_PYTYPE_LOOKUP
  22690. Py_XDECREF(object_reduce);
  22691. Py_XDECREF(object_reduce_ex);
  22692. #endif
  22693. Py_XDECREF(reduce);
  22694. Py_XDECREF(reduce_ex);
  22695. Py_XDECREF(reduce_cython);
  22696. Py_XDECREF(setstate);
  22697. Py_XDECREF(setstate_cython);
  22698. return ret;
  22699. }
  22700. /* TypeImport */
  22701. #ifndef __PYX_HAVE_RT_ImportType
  22702. #define __PYX_HAVE_RT_ImportType
  22703. static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
  22704. size_t size, enum __Pyx_ImportType_CheckSize check_size)
  22705. {
  22706. PyObject *result = 0;
  22707. char warning[200];
  22708. Py_ssize_t basicsize;
  22709. #ifdef Py_LIMITED_API
  22710. PyObject *py_basicsize;
  22711. #endif
  22712. result = PyObject_GetAttrString(module, class_name);
  22713. if (!result)
  22714. goto bad;
  22715. if (!PyType_Check(result)) {
  22716. PyErr_Format(PyExc_TypeError,
  22717. "%.200s.%.200s is not a type object",
  22718. module_name, class_name);
  22719. goto bad;
  22720. }
  22721. #ifndef Py_LIMITED_API
  22722. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  22723. #else
  22724. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  22725. if (!py_basicsize)
  22726. goto bad;
  22727. basicsize = PyLong_AsSsize_t(py_basicsize);
  22728. Py_DECREF(py_basicsize);
  22729. py_basicsize = 0;
  22730. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  22731. goto bad;
  22732. #endif
  22733. if ((size_t)basicsize < size) {
  22734. PyErr_Format(PyExc_ValueError,
  22735. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22736. "Expected %zd from C header, got %zd from PyObject",
  22737. module_name, class_name, size, basicsize);
  22738. goto bad;
  22739. }
  22740. if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
  22741. PyErr_Format(PyExc_ValueError,
  22742. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22743. "Expected %zd from C header, got %zd from PyObject",
  22744. module_name, class_name, size, basicsize);
  22745. goto bad;
  22746. }
  22747. else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
  22748. PyOS_snprintf(warning, sizeof(warning),
  22749. "%s.%s size changed, may indicate binary incompatibility. "
  22750. "Expected %zd from C header, got %zd from PyObject",
  22751. module_name, class_name, size, basicsize);
  22752. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  22753. }
  22754. return (PyTypeObject *)result;
  22755. bad:
  22756. Py_XDECREF(result);
  22757. return NULL;
  22758. }
  22759. #endif
  22760. /* Import */
  22761. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  22762. PyObject *empty_list = 0;
  22763. PyObject *module = 0;
  22764. PyObject *global_dict = 0;
  22765. PyObject *empty_dict = 0;
  22766. PyObject *list;
  22767. #if PY_MAJOR_VERSION < 3
  22768. PyObject *py_import;
  22769. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  22770. if (!py_import)
  22771. goto bad;
  22772. #endif
  22773. if (from_list)
  22774. list = from_list;
  22775. else {
  22776. empty_list = PyList_New(0);
  22777. if (!empty_list)
  22778. goto bad;
  22779. list = empty_list;
  22780. }
  22781. global_dict = PyModule_GetDict(__pyx_m);
  22782. if (!global_dict)
  22783. goto bad;
  22784. empty_dict = PyDict_New();
  22785. if (!empty_dict)
  22786. goto bad;
  22787. {
  22788. #if PY_MAJOR_VERSION >= 3
  22789. if (level == -1) {
  22790. if (strchr(__Pyx_MODULE_NAME, '.')) {
  22791. module = PyImport_ImportModuleLevelObject(
  22792. name, global_dict, empty_dict, list, 1);
  22793. if (!module) {
  22794. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  22795. goto bad;
  22796. PyErr_Clear();
  22797. }
  22798. }
  22799. level = 0;
  22800. }
  22801. #endif
  22802. if (!module) {
  22803. #if PY_MAJOR_VERSION < 3
  22804. PyObject *py_level = PyInt_FromLong(level);
  22805. if (!py_level)
  22806. goto bad;
  22807. module = PyObject_CallFunctionObjArgs(py_import,
  22808. name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
  22809. Py_DECREF(py_level);
  22810. #else
  22811. module = PyImport_ImportModuleLevelObject(
  22812. name, global_dict, empty_dict, list, level);
  22813. #endif
  22814. }
  22815. }
  22816. bad:
  22817. #if PY_MAJOR_VERSION < 3
  22818. Py_XDECREF(py_import);
  22819. #endif
  22820. Py_XDECREF(empty_list);
  22821. Py_XDECREF(empty_dict);
  22822. return module;
  22823. }
  22824. /* ImportFrom */
  22825. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  22826. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  22827. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  22828. PyErr_Format(PyExc_ImportError,
  22829. #if PY_MAJOR_VERSION < 3
  22830. "cannot import name %.230s", PyString_AS_STRING(name));
  22831. #else
  22832. "cannot import name %S", name);
  22833. #endif
  22834. }
  22835. return value;
  22836. }
  22837. /* CalculateMetaclass */
  22838. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  22839. Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
  22840. for (i=0; i < nbases; i++) {
  22841. PyTypeObject *tmptype;
  22842. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  22843. tmptype = Py_TYPE(tmp);
  22844. #if PY_MAJOR_VERSION < 3
  22845. if (tmptype == &PyClass_Type)
  22846. continue;
  22847. #endif
  22848. if (!metaclass) {
  22849. metaclass = tmptype;
  22850. continue;
  22851. }
  22852. if (PyType_IsSubtype(metaclass, tmptype))
  22853. continue;
  22854. if (PyType_IsSubtype(tmptype, metaclass)) {
  22855. metaclass = tmptype;
  22856. continue;
  22857. }
  22858. PyErr_SetString(PyExc_TypeError,
  22859. "metaclass conflict: "
  22860. "the metaclass of a derived class "
  22861. "must be a (non-strict) subclass "
  22862. "of the metaclasses of all its bases");
  22863. return NULL;
  22864. }
  22865. if (!metaclass) {
  22866. #if PY_MAJOR_VERSION < 3
  22867. metaclass = &PyClass_Type;
  22868. #else
  22869. metaclass = &PyType_Type;
  22870. #endif
  22871. }
  22872. Py_INCREF((PyObject*) metaclass);
  22873. return (PyObject*) metaclass;
  22874. }
  22875. /* Py3ClassCreate */
  22876. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  22877. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  22878. PyObject *ns;
  22879. if (metaclass) {
  22880. PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
  22881. if (prep) {
  22882. PyObject *pargs = PyTuple_Pack(2, name, bases);
  22883. if (unlikely(!pargs)) {
  22884. Py_DECREF(prep);
  22885. return NULL;
  22886. }
  22887. ns = PyObject_Call(prep, pargs, mkw);
  22888. Py_DECREF(prep);
  22889. Py_DECREF(pargs);
  22890. } else {
  22891. if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
  22892. return NULL;
  22893. PyErr_Clear();
  22894. ns = PyDict_New();
  22895. }
  22896. } else {
  22897. ns = PyDict_New();
  22898. }
  22899. if (unlikely(!ns))
  22900. return NULL;
  22901. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  22902. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  22903. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  22904. return ns;
  22905. bad:
  22906. Py_DECREF(ns);
  22907. return NULL;
  22908. }
  22909. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  22910. PyObject *dict, PyObject *mkw,
  22911. int calculate_metaclass, int allow_py2_metaclass) {
  22912. PyObject *result, *margs;
  22913. PyObject *owned_metaclass = NULL;
  22914. if (allow_py2_metaclass) {
  22915. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  22916. if (owned_metaclass) {
  22917. metaclass = owned_metaclass;
  22918. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  22919. PyErr_Clear();
  22920. } else {
  22921. return NULL;
  22922. }
  22923. }
  22924. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  22925. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  22926. Py_XDECREF(owned_metaclass);
  22927. if (unlikely(!metaclass))
  22928. return NULL;
  22929. owned_metaclass = metaclass;
  22930. }
  22931. margs = PyTuple_Pack(3, name, bases, dict);
  22932. if (unlikely(!margs)) {
  22933. result = NULL;
  22934. } else {
  22935. result = PyObject_Call(metaclass, margs, mkw);
  22936. Py_DECREF(margs);
  22937. }
  22938. Py_XDECREF(owned_metaclass);
  22939. return result;
  22940. }
  22941. /* FetchCommonType */
  22942. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  22943. PyObject* fake_module;
  22944. PyTypeObject* cached_type = NULL;
  22945. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  22946. if (!fake_module) return NULL;
  22947. Py_INCREF(fake_module);
  22948. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  22949. if (cached_type) {
  22950. if (!PyType_Check((PyObject*)cached_type)) {
  22951. PyErr_Format(PyExc_TypeError,
  22952. "Shared Cython type %.200s is not a type object",
  22953. type->tp_name);
  22954. goto bad;
  22955. }
  22956. if (cached_type->tp_basicsize != type->tp_basicsize) {
  22957. PyErr_Format(PyExc_TypeError,
  22958. "Shared Cython type %.200s has the wrong size, try recompiling",
  22959. type->tp_name);
  22960. goto bad;
  22961. }
  22962. } else {
  22963. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  22964. PyErr_Clear();
  22965. if (PyType_Ready(type) < 0) goto bad;
  22966. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  22967. goto bad;
  22968. Py_INCREF(type);
  22969. cached_type = type;
  22970. }
  22971. done:
  22972. Py_DECREF(fake_module);
  22973. return cached_type;
  22974. bad:
  22975. Py_XDECREF(cached_type);
  22976. cached_type = NULL;
  22977. goto done;
  22978. }
  22979. /* CythonFunction */
  22980. #include <structmember.h>
  22981. static PyObject *
  22982. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  22983. {
  22984. if (unlikely(op->func_doc == NULL)) {
  22985. if (op->func.m_ml->ml_doc) {
  22986. #if PY_MAJOR_VERSION >= 3
  22987. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  22988. #else
  22989. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  22990. #endif
  22991. if (unlikely(op->func_doc == NULL))
  22992. return NULL;
  22993. } else {
  22994. Py_INCREF(Py_None);
  22995. return Py_None;
  22996. }
  22997. }
  22998. Py_INCREF(op->func_doc);
  22999. return op->func_doc;
  23000. }
  23001. static int
  23002. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23003. {
  23004. PyObject *tmp = op->func_doc;
  23005. if (value == NULL) {
  23006. value = Py_None;
  23007. }
  23008. Py_INCREF(value);
  23009. op->func_doc = value;
  23010. Py_XDECREF(tmp);
  23011. return 0;
  23012. }
  23013. static PyObject *
  23014. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23015. {
  23016. if (unlikely(op->func_name == NULL)) {
  23017. #if PY_MAJOR_VERSION >= 3
  23018. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  23019. #else
  23020. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  23021. #endif
  23022. if (unlikely(op->func_name == NULL))
  23023. return NULL;
  23024. }
  23025. Py_INCREF(op->func_name);
  23026. return op->func_name;
  23027. }
  23028. static int
  23029. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23030. {
  23031. PyObject *tmp;
  23032. #if PY_MAJOR_VERSION >= 3
  23033. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  23034. #else
  23035. if (unlikely(value == NULL || !PyString_Check(value)))
  23036. #endif
  23037. {
  23038. PyErr_SetString(PyExc_TypeError,
  23039. "__name__ must be set to a string object");
  23040. return -1;
  23041. }
  23042. tmp = op->func_name;
  23043. Py_INCREF(value);
  23044. op->func_name = value;
  23045. Py_XDECREF(tmp);
  23046. return 0;
  23047. }
  23048. static PyObject *
  23049. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23050. {
  23051. Py_INCREF(op->func_qualname);
  23052. return op->func_qualname;
  23053. }
  23054. static int
  23055. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23056. {
  23057. PyObject *tmp;
  23058. #if PY_MAJOR_VERSION >= 3
  23059. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  23060. #else
  23061. if (unlikely(value == NULL || !PyString_Check(value)))
  23062. #endif
  23063. {
  23064. PyErr_SetString(PyExc_TypeError,
  23065. "__qualname__ must be set to a string object");
  23066. return -1;
  23067. }
  23068. tmp = op->func_qualname;
  23069. Py_INCREF(value);
  23070. op->func_qualname = value;
  23071. Py_XDECREF(tmp);
  23072. return 0;
  23073. }
  23074. static PyObject *
  23075. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  23076. {
  23077. PyObject *self;
  23078. self = m->func_closure;
  23079. if (self == NULL)
  23080. self = Py_None;
  23081. Py_INCREF(self);
  23082. return self;
  23083. }
  23084. static PyObject *
  23085. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23086. {
  23087. if (unlikely(op->func_dict == NULL)) {
  23088. op->func_dict = PyDict_New();
  23089. if (unlikely(op->func_dict == NULL))
  23090. return NULL;
  23091. }
  23092. Py_INCREF(op->func_dict);
  23093. return op->func_dict;
  23094. }
  23095. static int
  23096. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23097. {
  23098. PyObject *tmp;
  23099. if (unlikely(value == NULL)) {
  23100. PyErr_SetString(PyExc_TypeError,
  23101. "function's dictionary may not be deleted");
  23102. return -1;
  23103. }
  23104. if (unlikely(!PyDict_Check(value))) {
  23105. PyErr_SetString(PyExc_TypeError,
  23106. "setting function's dictionary to a non-dict");
  23107. return -1;
  23108. }
  23109. tmp = op->func_dict;
  23110. Py_INCREF(value);
  23111. op->func_dict = value;
  23112. Py_XDECREF(tmp);
  23113. return 0;
  23114. }
  23115. static PyObject *
  23116. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23117. {
  23118. Py_INCREF(op->func_globals);
  23119. return op->func_globals;
  23120. }
  23121. static PyObject *
  23122. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23123. {
  23124. Py_INCREF(Py_None);
  23125. return Py_None;
  23126. }
  23127. static PyObject *
  23128. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23129. {
  23130. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  23131. Py_INCREF(result);
  23132. return result;
  23133. }
  23134. static int
  23135. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  23136. int result = 0;
  23137. PyObject *res = op->defaults_getter((PyObject *) op);
  23138. if (unlikely(!res))
  23139. return -1;
  23140. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  23141. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  23142. Py_INCREF(op->defaults_tuple);
  23143. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  23144. Py_INCREF(op->defaults_kwdict);
  23145. #else
  23146. op->defaults_tuple = PySequence_ITEM(res, 0);
  23147. if (unlikely(!op->defaults_tuple)) result = -1;
  23148. else {
  23149. op->defaults_kwdict = PySequence_ITEM(res, 1);
  23150. if (unlikely(!op->defaults_kwdict)) result = -1;
  23151. }
  23152. #endif
  23153. Py_DECREF(res);
  23154. return result;
  23155. }
  23156. static int
  23157. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23158. PyObject* tmp;
  23159. if (!value) {
  23160. value = Py_None;
  23161. } else if (value != Py_None && !PyTuple_Check(value)) {
  23162. PyErr_SetString(PyExc_TypeError,
  23163. "__defaults__ must be set to a tuple object");
  23164. return -1;
  23165. }
  23166. Py_INCREF(value);
  23167. tmp = op->defaults_tuple;
  23168. op->defaults_tuple = value;
  23169. Py_XDECREF(tmp);
  23170. return 0;
  23171. }
  23172. static PyObject *
  23173. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23174. PyObject* result = op->defaults_tuple;
  23175. if (unlikely(!result)) {
  23176. if (op->defaults_getter) {
  23177. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  23178. result = op->defaults_tuple;
  23179. } else {
  23180. result = Py_None;
  23181. }
  23182. }
  23183. Py_INCREF(result);
  23184. return result;
  23185. }
  23186. static int
  23187. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23188. PyObject* tmp;
  23189. if (!value) {
  23190. value = Py_None;
  23191. } else if (value != Py_None && !PyDict_Check(value)) {
  23192. PyErr_SetString(PyExc_TypeError,
  23193. "__kwdefaults__ must be set to a dict object");
  23194. return -1;
  23195. }
  23196. Py_INCREF(value);
  23197. tmp = op->defaults_kwdict;
  23198. op->defaults_kwdict = value;
  23199. Py_XDECREF(tmp);
  23200. return 0;
  23201. }
  23202. static PyObject *
  23203. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23204. PyObject* result = op->defaults_kwdict;
  23205. if (unlikely(!result)) {
  23206. if (op->defaults_getter) {
  23207. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  23208. result = op->defaults_kwdict;
  23209. } else {
  23210. result = Py_None;
  23211. }
  23212. }
  23213. Py_INCREF(result);
  23214. return result;
  23215. }
  23216. static int
  23217. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23218. PyObject* tmp;
  23219. if (!value || value == Py_None) {
  23220. value = NULL;
  23221. } else if (!PyDict_Check(value)) {
  23222. PyErr_SetString(PyExc_TypeError,
  23223. "__annotations__ must be set to a dict object");
  23224. return -1;
  23225. }
  23226. Py_XINCREF(value);
  23227. tmp = op->func_annotations;
  23228. op->func_annotations = value;
  23229. Py_XDECREF(tmp);
  23230. return 0;
  23231. }
  23232. static PyObject *
  23233. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23234. PyObject* result = op->func_annotations;
  23235. if (unlikely(!result)) {
  23236. result = PyDict_New();
  23237. if (unlikely(!result)) return NULL;
  23238. op->func_annotations = result;
  23239. }
  23240. Py_INCREF(result);
  23241. return result;
  23242. }
  23243. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  23244. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  23245. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  23246. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  23247. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  23248. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  23249. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  23250. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  23251. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  23252. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  23253. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  23254. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  23255. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  23256. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  23257. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  23258. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  23259. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  23260. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  23261. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  23262. {0, 0, 0, 0, 0}
  23263. };
  23264. static PyMemberDef __pyx_CyFunction_members[] = {
  23265. {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
  23266. {0, 0, 0, 0, 0}
  23267. };
  23268. static PyObject *
  23269. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  23270. {
  23271. #if PY_MAJOR_VERSION >= 3
  23272. return PyUnicode_FromString(m->func.m_ml->ml_name);
  23273. #else
  23274. return PyString_FromString(m->func.m_ml->ml_name);
  23275. #endif
  23276. }
  23277. static PyMethodDef __pyx_CyFunction_methods[] = {
  23278. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  23279. {0, 0, 0, 0}
  23280. };
  23281. #if PY_VERSION_HEX < 0x030500A0
  23282. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  23283. #else
  23284. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
  23285. #endif
  23286. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  23287. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  23288. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  23289. if (op == NULL)
  23290. return NULL;
  23291. op->flags = flags;
  23292. __Pyx_CyFunction_weakreflist(op) = NULL;
  23293. op->func.m_ml = ml;
  23294. op->func.m_self = (PyObject *) op;
  23295. Py_XINCREF(closure);
  23296. op->func_closure = closure;
  23297. Py_XINCREF(module);
  23298. op->func.m_module = module;
  23299. op->func_dict = NULL;
  23300. op->func_name = NULL;
  23301. Py_INCREF(qualname);
  23302. op->func_qualname = qualname;
  23303. op->func_doc = NULL;
  23304. op->func_classobj = NULL;
  23305. op->func_globals = globals;
  23306. Py_INCREF(op->func_globals);
  23307. Py_XINCREF(code);
  23308. op->func_code = code;
  23309. op->defaults_pyobjects = 0;
  23310. op->defaults_size = 0;
  23311. op->defaults = NULL;
  23312. op->defaults_tuple = NULL;
  23313. op->defaults_kwdict = NULL;
  23314. op->defaults_getter = NULL;
  23315. op->func_annotations = NULL;
  23316. PyObject_GC_Track(op);
  23317. return (PyObject *) op;
  23318. }
  23319. static int
  23320. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  23321. {
  23322. Py_CLEAR(m->func_closure);
  23323. Py_CLEAR(m->func.m_module);
  23324. Py_CLEAR(m->func_dict);
  23325. Py_CLEAR(m->func_name);
  23326. Py_CLEAR(m->func_qualname);
  23327. Py_CLEAR(m->func_doc);
  23328. Py_CLEAR(m->func_globals);
  23329. Py_CLEAR(m->func_code);
  23330. Py_CLEAR(m->func_classobj);
  23331. Py_CLEAR(m->defaults_tuple);
  23332. Py_CLEAR(m->defaults_kwdict);
  23333. Py_CLEAR(m->func_annotations);
  23334. if (m->defaults) {
  23335. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  23336. int i;
  23337. for (i = 0; i < m->defaults_pyobjects; i++)
  23338. Py_XDECREF(pydefaults[i]);
  23339. PyObject_Free(m->defaults);
  23340. m->defaults = NULL;
  23341. }
  23342. return 0;
  23343. }
  23344. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  23345. {
  23346. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  23347. PyObject_ClearWeakRefs((PyObject *) m);
  23348. __Pyx_CyFunction_clear(m);
  23349. PyObject_GC_Del(m);
  23350. }
  23351. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  23352. {
  23353. PyObject_GC_UnTrack(m);
  23354. __Pyx__CyFunction_dealloc(m);
  23355. }
  23356. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  23357. {
  23358. Py_VISIT(m->func_closure);
  23359. Py_VISIT(m->func.m_module);
  23360. Py_VISIT(m->func_dict);
  23361. Py_VISIT(m->func_name);
  23362. Py_VISIT(m->func_qualname);
  23363. Py_VISIT(m->func_doc);
  23364. Py_VISIT(m->func_globals);
  23365. Py_VISIT(m->func_code);
  23366. Py_VISIT(m->func_classobj);
  23367. Py_VISIT(m->defaults_tuple);
  23368. Py_VISIT(m->defaults_kwdict);
  23369. if (m->defaults) {
  23370. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  23371. int i;
  23372. for (i = 0; i < m->defaults_pyobjects; i++)
  23373. Py_VISIT(pydefaults[i]);
  23374. }
  23375. return 0;
  23376. }
  23377. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  23378. {
  23379. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23380. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  23381. Py_INCREF(func);
  23382. return func;
  23383. }
  23384. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  23385. if (type == NULL)
  23386. type = (PyObject *)(Py_TYPE(obj));
  23387. return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
  23388. }
  23389. if (obj == Py_None)
  23390. obj = NULL;
  23391. return __Pyx_PyMethod_New(func, obj, type);
  23392. }
  23393. static PyObject*
  23394. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  23395. {
  23396. #if PY_MAJOR_VERSION >= 3
  23397. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  23398. op->func_qualname, (void *)op);
  23399. #else
  23400. return PyString_FromFormat("<cyfunction %s at %p>",
  23401. PyString_AsString(op->func_qualname), (void *)op);
  23402. #endif
  23403. }
  23404. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  23405. PyCFunctionObject* f = (PyCFunctionObject*)func;
  23406. PyCFunction meth = f->m_ml->ml_meth;
  23407. Py_ssize_t size;
  23408. switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  23409. case METH_VARARGS:
  23410. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  23411. return (*meth)(self, arg);
  23412. break;
  23413. case METH_VARARGS | METH_KEYWORDS:
  23414. return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
  23415. case METH_NOARGS:
  23416. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  23417. size = PyTuple_GET_SIZE(arg);
  23418. if (likely(size == 0))
  23419. return (*meth)(self, NULL);
  23420. PyErr_Format(PyExc_TypeError,
  23421. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  23422. f->m_ml->ml_name, size);
  23423. return NULL;
  23424. }
  23425. break;
  23426. case METH_O:
  23427. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  23428. size = PyTuple_GET_SIZE(arg);
  23429. if (likely(size == 1)) {
  23430. PyObject *result, *arg0;
  23431. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  23432. arg0 = PyTuple_GET_ITEM(arg, 0);
  23433. #else
  23434. arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  23435. #endif
  23436. result = (*meth)(self, arg0);
  23437. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  23438. Py_DECREF(arg0);
  23439. #endif
  23440. return result;
  23441. }
  23442. PyErr_Format(PyExc_TypeError,
  23443. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  23444. f->m_ml->ml_name, size);
  23445. return NULL;
  23446. }
  23447. break;
  23448. default:
  23449. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  23450. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  23451. "longer supported!");
  23452. return NULL;
  23453. }
  23454. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  23455. f->m_ml->ml_name);
  23456. return NULL;
  23457. }
  23458. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  23459. return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
  23460. }
  23461. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  23462. PyObject *result;
  23463. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  23464. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  23465. Py_ssize_t argc;
  23466. PyObject *new_args;
  23467. PyObject *self;
  23468. argc = PyTuple_GET_SIZE(args);
  23469. new_args = PyTuple_GetSlice(args, 1, argc);
  23470. if (unlikely(!new_args))
  23471. return NULL;
  23472. self = PyTuple_GetItem(args, 0);
  23473. if (unlikely(!self)) {
  23474. Py_DECREF(new_args);
  23475. return NULL;
  23476. }
  23477. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  23478. Py_DECREF(new_args);
  23479. } else {
  23480. result = __Pyx_CyFunction_Call(func, args, kw);
  23481. }
  23482. return result;
  23483. }
  23484. static PyTypeObject __pyx_CyFunctionType_type = {
  23485. PyVarObject_HEAD_INIT(0, 0)
  23486. "cython_function_or_method",
  23487. sizeof(__pyx_CyFunctionObject),
  23488. 0,
  23489. (destructor) __Pyx_CyFunction_dealloc,
  23490. 0,
  23491. 0,
  23492. 0,
  23493. #if PY_MAJOR_VERSION < 3
  23494. 0,
  23495. #else
  23496. 0,
  23497. #endif
  23498. (reprfunc) __Pyx_CyFunction_repr,
  23499. 0,
  23500. 0,
  23501. 0,
  23502. 0,
  23503. __Pyx_CyFunction_CallAsMethod,
  23504. 0,
  23505. 0,
  23506. 0,
  23507. 0,
  23508. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
  23509. 0,
  23510. (traverseproc) __Pyx_CyFunction_traverse,
  23511. (inquiry) __Pyx_CyFunction_clear,
  23512. 0,
  23513. #if PY_VERSION_HEX < 0x030500A0
  23514. offsetof(__pyx_CyFunctionObject, func_weakreflist),
  23515. #else
  23516. offsetof(PyCFunctionObject, m_weakreflist),
  23517. #endif
  23518. 0,
  23519. 0,
  23520. __pyx_CyFunction_methods,
  23521. __pyx_CyFunction_members,
  23522. __pyx_CyFunction_getsets,
  23523. 0,
  23524. 0,
  23525. __Pyx_CyFunction_descr_get,
  23526. 0,
  23527. offsetof(__pyx_CyFunctionObject, func_dict),
  23528. 0,
  23529. 0,
  23530. 0,
  23531. 0,
  23532. 0,
  23533. 0,
  23534. 0,
  23535. 0,
  23536. 0,
  23537. 0,
  23538. 0,
  23539. 0,
  23540. #if PY_VERSION_HEX >= 0x030400a1
  23541. 0,
  23542. #endif
  23543. #if PY_VERSION_HEX >= 0x030800b1
  23544. 0,
  23545. #endif
  23546. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  23547. 0,
  23548. #endif
  23549. };
  23550. static int __pyx_CyFunction_init(void) {
  23551. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  23552. if (unlikely(__pyx_CyFunctionType == NULL)) {
  23553. return -1;
  23554. }
  23555. return 0;
  23556. }
  23557. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  23558. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23559. m->defaults = PyObject_Malloc(size);
  23560. if (unlikely(!m->defaults))
  23561. return PyErr_NoMemory();
  23562. memset(m->defaults, 0, size);
  23563. m->defaults_pyobjects = pyobjects;
  23564. m->defaults_size = size;
  23565. return m->defaults;
  23566. }
  23567. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  23568. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23569. m->defaults_tuple = tuple;
  23570. Py_INCREF(tuple);
  23571. }
  23572. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  23573. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23574. m->defaults_kwdict = dict;
  23575. Py_INCREF(dict);
  23576. }
  23577. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  23578. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23579. m->func_annotations = dict;
  23580. Py_INCREF(dict);
  23581. }
  23582. /* CLineInTraceback */
  23583. #ifndef CYTHON_CLINE_IN_TRACEBACK
  23584. static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
  23585. PyObject *use_cline;
  23586. PyObject *ptype, *pvalue, *ptraceback;
  23587. #if CYTHON_COMPILING_IN_CPYTHON
  23588. PyObject **cython_runtime_dict;
  23589. #endif
  23590. if (unlikely(!__pyx_cython_runtime)) {
  23591. return c_line;
  23592. }
  23593. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  23594. #if CYTHON_COMPILING_IN_CPYTHON
  23595. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  23596. if (likely(cython_runtime_dict)) {
  23597. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  23598. use_cline, *cython_runtime_dict,
  23599. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  23600. } else
  23601. #endif
  23602. {
  23603. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  23604. if (use_cline_obj) {
  23605. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  23606. Py_DECREF(use_cline_obj);
  23607. } else {
  23608. PyErr_Clear();
  23609. use_cline = NULL;
  23610. }
  23611. }
  23612. if (!use_cline) {
  23613. c_line = 0;
  23614. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  23615. }
  23616. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  23617. c_line = 0;
  23618. }
  23619. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  23620. return c_line;
  23621. }
  23622. #endif
  23623. /* CodeObjectCache */
  23624. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  23625. int start = 0, mid = 0, end = count - 1;
  23626. if (end >= 0 && code_line > entries[end].code_line) {
  23627. return count;
  23628. }
  23629. while (start < end) {
  23630. mid = start + (end - start) / 2;
  23631. if (code_line < entries[mid].code_line) {
  23632. end = mid;
  23633. } else if (code_line > entries[mid].code_line) {
  23634. start = mid + 1;
  23635. } else {
  23636. return mid;
  23637. }
  23638. }
  23639. if (code_line <= entries[mid].code_line) {
  23640. return mid;
  23641. } else {
  23642. return mid + 1;
  23643. }
  23644. }
  23645. static PyCodeObject *__pyx_find_code_object(int code_line) {
  23646. PyCodeObject* code_object;
  23647. int pos;
  23648. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  23649. return NULL;
  23650. }
  23651. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23652. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  23653. return NULL;
  23654. }
  23655. code_object = __pyx_code_cache.entries[pos].code_object;
  23656. Py_INCREF(code_object);
  23657. return code_object;
  23658. }
  23659. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  23660. int pos, i;
  23661. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  23662. if (unlikely(!code_line)) {
  23663. return;
  23664. }
  23665. if (unlikely(!entries)) {
  23666. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  23667. if (likely(entries)) {
  23668. __pyx_code_cache.entries = entries;
  23669. __pyx_code_cache.max_count = 64;
  23670. __pyx_code_cache.count = 1;
  23671. entries[0].code_line = code_line;
  23672. entries[0].code_object = code_object;
  23673. Py_INCREF(code_object);
  23674. }
  23675. return;
  23676. }
  23677. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23678. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  23679. PyCodeObject* tmp = entries[pos].code_object;
  23680. entries[pos].code_object = code_object;
  23681. Py_DECREF(tmp);
  23682. return;
  23683. }
  23684. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  23685. int new_max = __pyx_code_cache.max_count + 64;
  23686. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  23687. __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  23688. if (unlikely(!entries)) {
  23689. return;
  23690. }
  23691. __pyx_code_cache.entries = entries;
  23692. __pyx_code_cache.max_count = new_max;
  23693. }
  23694. for (i=__pyx_code_cache.count; i>pos; i--) {
  23695. entries[i] = entries[i-1];
  23696. }
  23697. entries[pos].code_line = code_line;
  23698. entries[pos].code_object = code_object;
  23699. __pyx_code_cache.count++;
  23700. Py_INCREF(code_object);
  23701. }
  23702. /* AddTraceback */
  23703. #include "compile.h"
  23704. #include "frameobject.h"
  23705. #include "traceback.h"
  23706. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  23707. const char *funcname, int c_line,
  23708. int py_line, const char *filename) {
  23709. PyCodeObject *py_code = 0;
  23710. PyObject *py_srcfile = 0;
  23711. PyObject *py_funcname = 0;
  23712. #if PY_MAJOR_VERSION < 3
  23713. py_srcfile = PyString_FromString(filename);
  23714. #else
  23715. py_srcfile = PyUnicode_FromString(filename);
  23716. #endif
  23717. if (!py_srcfile) goto bad;
  23718. if (c_line) {
  23719. #if PY_MAJOR_VERSION < 3
  23720. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23721. #else
  23722. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23723. #endif
  23724. }
  23725. else {
  23726. #if PY_MAJOR_VERSION < 3
  23727. py_funcname = PyString_FromString(funcname);
  23728. #else
  23729. py_funcname = PyUnicode_FromString(funcname);
  23730. #endif
  23731. }
  23732. if (!py_funcname) goto bad;
  23733. py_code = __Pyx_PyCode_New(
  23734. 0,
  23735. 0,
  23736. 0,
  23737. 0,
  23738. 0,
  23739. __pyx_empty_bytes, /*PyObject *code,*/
  23740. __pyx_empty_tuple, /*PyObject *consts,*/
  23741. __pyx_empty_tuple, /*PyObject *names,*/
  23742. __pyx_empty_tuple, /*PyObject *varnames,*/
  23743. __pyx_empty_tuple, /*PyObject *freevars,*/
  23744. __pyx_empty_tuple, /*PyObject *cellvars,*/
  23745. py_srcfile, /*PyObject *filename,*/
  23746. py_funcname, /*PyObject *name,*/
  23747. py_line,
  23748. __pyx_empty_bytes /*PyObject *lnotab*/
  23749. );
  23750. Py_DECREF(py_srcfile);
  23751. Py_DECREF(py_funcname);
  23752. return py_code;
  23753. bad:
  23754. Py_XDECREF(py_srcfile);
  23755. Py_XDECREF(py_funcname);
  23756. return NULL;
  23757. }
  23758. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  23759. int py_line, const char *filename) {
  23760. PyCodeObject *py_code = 0;
  23761. PyFrameObject *py_frame = 0;
  23762. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  23763. if (c_line) {
  23764. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  23765. }
  23766. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  23767. if (!py_code) {
  23768. py_code = __Pyx_CreateCodeObjectForTraceback(
  23769. funcname, c_line, py_line, filename);
  23770. if (!py_code) goto bad;
  23771. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  23772. }
  23773. py_frame = PyFrame_New(
  23774. tstate, /*PyThreadState *tstate,*/
  23775. py_code, /*PyCodeObject *code,*/
  23776. __pyx_d, /*PyObject *globals,*/
  23777. 0 /*PyObject *locals*/
  23778. );
  23779. if (!py_frame) goto bad;
  23780. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  23781. PyTraceBack_Here(py_frame);
  23782. bad:
  23783. Py_XDECREF(py_code);
  23784. Py_XDECREF(py_frame);
  23785. }
  23786. /* CIntFromPyVerify */
  23787. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  23788. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  23789. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  23790. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  23791. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  23792. {\
  23793. func_type value = func_value;\
  23794. if (sizeof(target_type) < sizeof(func_type)) {\
  23795. if (unlikely(value != (func_type) (target_type) value)) {\
  23796. func_type zero = 0;\
  23797. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  23798. return (target_type) -1;\
  23799. if (is_unsigned && unlikely(value < zero))\
  23800. goto raise_neg_overflow;\
  23801. else\
  23802. goto raise_overflow;\
  23803. }\
  23804. }\
  23805. return (target_type) value;\
  23806. }
  23807. /* CIntToPy */
  23808. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
  23809. const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
  23810. const int is_unsigned = neg_one > const_zero;
  23811. if (is_unsigned) {
  23812. if (sizeof(npy_uint64) < sizeof(long)) {
  23813. return PyInt_FromLong((long) value);
  23814. } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
  23815. return PyLong_FromUnsignedLong((unsigned long) value);
  23816. #ifdef HAVE_LONG_LONG
  23817. } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
  23818. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23819. #endif
  23820. }
  23821. } else {
  23822. if (sizeof(npy_uint64) <= sizeof(long)) {
  23823. return PyInt_FromLong((long) value);
  23824. #ifdef HAVE_LONG_LONG
  23825. } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
  23826. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23827. #endif
  23828. }
  23829. }
  23830. {
  23831. int one = 1; int little = (int)*(unsigned char *)&one;
  23832. unsigned char *bytes = (unsigned char *)&value;
  23833. return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
  23834. little, !is_unsigned);
  23835. }
  23836. }
  23837. /* CIntToPy */
  23838. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  23839. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  23840. const int is_unsigned = neg_one > const_zero;
  23841. if (is_unsigned) {
  23842. if (sizeof(int) < sizeof(long)) {
  23843. return PyInt_FromLong((long) value);
  23844. } else if (sizeof(int) <= sizeof(unsigned long)) {
  23845. return PyLong_FromUnsignedLong((unsigned long) value);
  23846. #ifdef HAVE_LONG_LONG
  23847. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  23848. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23849. #endif
  23850. }
  23851. } else {
  23852. if (sizeof(int) <= sizeof(long)) {
  23853. return PyInt_FromLong((long) value);
  23854. #ifdef HAVE_LONG_LONG
  23855. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  23856. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23857. #endif
  23858. }
  23859. }
  23860. {
  23861. int one = 1; int little = (int)*(unsigned char *)&one;
  23862. unsigned char *bytes = (unsigned char *)&value;
  23863. return _PyLong_FromByteArray(bytes, sizeof(int),
  23864. little, !is_unsigned);
  23865. }
  23866. }
  23867. /* CIntToPy */
  23868. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  23869. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  23870. const int is_unsigned = neg_one > const_zero;
  23871. if (is_unsigned) {
  23872. if (sizeof(long) < sizeof(long)) {
  23873. return PyInt_FromLong((long) value);
  23874. } else if (sizeof(long) <= sizeof(unsigned long)) {
  23875. return PyLong_FromUnsignedLong((unsigned long) value);
  23876. #ifdef HAVE_LONG_LONG
  23877. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  23878. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23879. #endif
  23880. }
  23881. } else {
  23882. if (sizeof(long) <= sizeof(long)) {
  23883. return PyInt_FromLong((long) value);
  23884. #ifdef HAVE_LONG_LONG
  23885. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  23886. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23887. #endif
  23888. }
  23889. }
  23890. {
  23891. int one = 1; int little = (int)*(unsigned char *)&one;
  23892. unsigned char *bytes = (unsigned char *)&value;
  23893. return _PyLong_FromByteArray(bytes, sizeof(long),
  23894. little, !is_unsigned);
  23895. }
  23896. }
  23897. /* Declarations */
  23898. #if CYTHON_CCOMPLEX
  23899. #ifdef __cplusplus
  23900. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23901. return ::std::complex< float >(x, y);
  23902. }
  23903. #else
  23904. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23905. return x + y*(__pyx_t_float_complex)_Complex_I;
  23906. }
  23907. #endif
  23908. #else
  23909. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23910. __pyx_t_float_complex z;
  23911. z.real = x;
  23912. z.imag = y;
  23913. return z;
  23914. }
  23915. #endif
  23916. /* Arithmetic */
  23917. #if CYTHON_CCOMPLEX
  23918. #else
  23919. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23920. return (a.real == b.real) && (a.imag == b.imag);
  23921. }
  23922. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23923. __pyx_t_float_complex z;
  23924. z.real = a.real + b.real;
  23925. z.imag = a.imag + b.imag;
  23926. return z;
  23927. }
  23928. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23929. __pyx_t_float_complex z;
  23930. z.real = a.real - b.real;
  23931. z.imag = a.imag - b.imag;
  23932. return z;
  23933. }
  23934. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23935. __pyx_t_float_complex z;
  23936. z.real = a.real * b.real - a.imag * b.imag;
  23937. z.imag = a.real * b.imag + a.imag * b.real;
  23938. return z;
  23939. }
  23940. #if 1
  23941. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23942. if (b.imag == 0) {
  23943. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23944. } else if (fabsf(b.real) >= fabsf(b.imag)) {
  23945. if (b.real == 0 && b.imag == 0) {
  23946. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
  23947. } else {
  23948. float r = b.imag / b.real;
  23949. float s = (float)(1.0) / (b.real + b.imag * r);
  23950. return __pyx_t_float_complex_from_parts(
  23951. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  23952. }
  23953. } else {
  23954. float r = b.real / b.imag;
  23955. float s = (float)(1.0) / (b.imag + b.real * r);
  23956. return __pyx_t_float_complex_from_parts(
  23957. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  23958. }
  23959. }
  23960. #else
  23961. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23962. if (b.imag == 0) {
  23963. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23964. } else {
  23965. float denom = b.real * b.real + b.imag * b.imag;
  23966. return __pyx_t_float_complex_from_parts(
  23967. (a.real * b.real + a.imag * b.imag) / denom,
  23968. (a.imag * b.real - a.real * b.imag) / denom);
  23969. }
  23970. }
  23971. #endif
  23972. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
  23973. __pyx_t_float_complex z;
  23974. z.real = -a.real;
  23975. z.imag = -a.imag;
  23976. return z;
  23977. }
  23978. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
  23979. return (a.real == 0) && (a.imag == 0);
  23980. }
  23981. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
  23982. __pyx_t_float_complex z;
  23983. z.real = a.real;
  23984. z.imag = -a.imag;
  23985. return z;
  23986. }
  23987. #if 1
  23988. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
  23989. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  23990. return sqrtf(z.real*z.real + z.imag*z.imag);
  23991. #else
  23992. return hypotf(z.real, z.imag);
  23993. #endif
  23994. }
  23995. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23996. __pyx_t_float_complex z;
  23997. float r, lnr, theta, z_r, z_theta;
  23998. if (b.imag == 0 && b.real == (int)b.real) {
  23999. if (b.real < 0) {
  24000. float denom = a.real * a.real + a.imag * a.imag;
  24001. a.real = a.real / denom;
  24002. a.imag = -a.imag / denom;
  24003. b.real = -b.real;
  24004. }
  24005. switch ((int)b.real) {
  24006. case 0:
  24007. z.real = 1;
  24008. z.imag = 0;
  24009. return z;
  24010. case 1:
  24011. return a;
  24012. case 2:
  24013. return __Pyx_c_prod_float(a, a);
  24014. case 3:
  24015. z = __Pyx_c_prod_float(a, a);
  24016. return __Pyx_c_prod_float(z, a);
  24017. case 4:
  24018. z = __Pyx_c_prod_float(a, a);
  24019. return __Pyx_c_prod_float(z, z);
  24020. }
  24021. }
  24022. if (a.imag == 0) {
  24023. if (a.real == 0) {
  24024. return a;
  24025. } else if (b.imag == 0) {
  24026. z.real = powf(a.real, b.real);
  24027. z.imag = 0;
  24028. return z;
  24029. } else if (a.real > 0) {
  24030. r = a.real;
  24031. theta = 0;
  24032. } else {
  24033. r = -a.real;
  24034. theta = atan2f(0.0, -1.0);
  24035. }
  24036. } else {
  24037. r = __Pyx_c_abs_float(a);
  24038. theta = atan2f(a.imag, a.real);
  24039. }
  24040. lnr = logf(r);
  24041. z_r = expf(lnr * b.real - theta * b.imag);
  24042. z_theta = theta * b.real + lnr * b.imag;
  24043. z.real = z_r * cosf(z_theta);
  24044. z.imag = z_r * sinf(z_theta);
  24045. return z;
  24046. }
  24047. #endif
  24048. #endif
  24049. /* Declarations */
  24050. #if CYTHON_CCOMPLEX
  24051. #ifdef __cplusplus
  24052. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24053. return ::std::complex< double >(x, y);
  24054. }
  24055. #else
  24056. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24057. return x + y*(__pyx_t_double_complex)_Complex_I;
  24058. }
  24059. #endif
  24060. #else
  24061. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24062. __pyx_t_double_complex z;
  24063. z.real = x;
  24064. z.imag = y;
  24065. return z;
  24066. }
  24067. #endif
  24068. /* Arithmetic */
  24069. #if CYTHON_CCOMPLEX
  24070. #else
  24071. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24072. return (a.real == b.real) && (a.imag == b.imag);
  24073. }
  24074. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24075. __pyx_t_double_complex z;
  24076. z.real = a.real + b.real;
  24077. z.imag = a.imag + b.imag;
  24078. return z;
  24079. }
  24080. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24081. __pyx_t_double_complex z;
  24082. z.real = a.real - b.real;
  24083. z.imag = a.imag - b.imag;
  24084. return z;
  24085. }
  24086. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24087. __pyx_t_double_complex z;
  24088. z.real = a.real * b.real - a.imag * b.imag;
  24089. z.imag = a.real * b.imag + a.imag * b.real;
  24090. return z;
  24091. }
  24092. #if 1
  24093. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24094. if (b.imag == 0) {
  24095. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  24096. } else if (fabs(b.real) >= fabs(b.imag)) {
  24097. if (b.real == 0 && b.imag == 0) {
  24098. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
  24099. } else {
  24100. double r = b.imag / b.real;
  24101. double s = (double)(1.0) / (b.real + b.imag * r);
  24102. return __pyx_t_double_complex_from_parts(
  24103. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  24104. }
  24105. } else {
  24106. double r = b.real / b.imag;
  24107. double s = (double)(1.0) / (b.imag + b.real * r);
  24108. return __pyx_t_double_complex_from_parts(
  24109. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  24110. }
  24111. }
  24112. #else
  24113. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24114. if (b.imag == 0) {
  24115. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  24116. } else {
  24117. double denom = b.real * b.real + b.imag * b.imag;
  24118. return __pyx_t_double_complex_from_parts(
  24119. (a.real * b.real + a.imag * b.imag) / denom,
  24120. (a.imag * b.real - a.real * b.imag) / denom);
  24121. }
  24122. }
  24123. #endif
  24124. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
  24125. __pyx_t_double_complex z;
  24126. z.real = -a.real;
  24127. z.imag = -a.imag;
  24128. return z;
  24129. }
  24130. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
  24131. return (a.real == 0) && (a.imag == 0);
  24132. }
  24133. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
  24134. __pyx_t_double_complex z;
  24135. z.real = a.real;
  24136. z.imag = -a.imag;
  24137. return z;
  24138. }
  24139. #if 1
  24140. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
  24141. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  24142. return sqrt(z.real*z.real + z.imag*z.imag);
  24143. #else
  24144. return hypot(z.real, z.imag);
  24145. #endif
  24146. }
  24147. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24148. __pyx_t_double_complex z;
  24149. double r, lnr, theta, z_r, z_theta;
  24150. if (b.imag == 0 && b.real == (int)b.real) {
  24151. if (b.real < 0) {
  24152. double denom = a.real * a.real + a.imag * a.imag;
  24153. a.real = a.real / denom;
  24154. a.imag = -a.imag / denom;
  24155. b.real = -b.real;
  24156. }
  24157. switch ((int)b.real) {
  24158. case 0:
  24159. z.real = 1;
  24160. z.imag = 0;
  24161. return z;
  24162. case 1:
  24163. return a;
  24164. case 2:
  24165. return __Pyx_c_prod_double(a, a);
  24166. case 3:
  24167. z = __Pyx_c_prod_double(a, a);
  24168. return __Pyx_c_prod_double(z, a);
  24169. case 4:
  24170. z = __Pyx_c_prod_double(a, a);
  24171. return __Pyx_c_prod_double(z, z);
  24172. }
  24173. }
  24174. if (a.imag == 0) {
  24175. if (a.real == 0) {
  24176. return a;
  24177. } else if (b.imag == 0) {
  24178. z.real = pow(a.real, b.real);
  24179. z.imag = 0;
  24180. return z;
  24181. } else if (a.real > 0) {
  24182. r = a.real;
  24183. theta = 0;
  24184. } else {
  24185. r = -a.real;
  24186. theta = atan2(0.0, -1.0);
  24187. }
  24188. } else {
  24189. r = __Pyx_c_abs_double(a);
  24190. theta = atan2(a.imag, a.real);
  24191. }
  24192. lnr = log(r);
  24193. z_r = exp(lnr * b.real - theta * b.imag);
  24194. z_theta = theta * b.real + lnr * b.imag;
  24195. z.real = z_r * cos(z_theta);
  24196. z.imag = z_r * sin(z_theta);
  24197. return z;
  24198. }
  24199. #endif
  24200. #endif
  24201. /* CIntToPy */
  24202. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
  24203. const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
  24204. const int is_unsigned = neg_one > const_zero;
  24205. if (is_unsigned) {
  24206. if (sizeof(enum NPY_TYPES) < sizeof(long)) {
  24207. return PyInt_FromLong((long) value);
  24208. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
  24209. return PyLong_FromUnsignedLong((unsigned long) value);
  24210. #ifdef HAVE_LONG_LONG
  24211. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
  24212. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  24213. #endif
  24214. }
  24215. } else {
  24216. if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
  24217. return PyInt_FromLong((long) value);
  24218. #ifdef HAVE_LONG_LONG
  24219. } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
  24220. return PyLong_FromLongLong((PY_LONG_LONG) value);
  24221. #endif
  24222. }
  24223. }
  24224. {
  24225. int one = 1; int little = (int)*(unsigned char *)&one;
  24226. unsigned char *bytes = (unsigned char *)&value;
  24227. return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
  24228. little, !is_unsigned);
  24229. }
  24230. }
  24231. /* CIntFromPy */
  24232. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
  24233. const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
  24234. const int is_unsigned = neg_one > const_zero;
  24235. #if PY_MAJOR_VERSION < 3
  24236. if (likely(PyInt_Check(x))) {
  24237. if (sizeof(size_t) < sizeof(long)) {
  24238. __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
  24239. } else {
  24240. long val = PyInt_AS_LONG(x);
  24241. if (is_unsigned && unlikely(val < 0)) {
  24242. goto raise_neg_overflow;
  24243. }
  24244. return (size_t) val;
  24245. }
  24246. } else
  24247. #endif
  24248. if (likely(PyLong_Check(x))) {
  24249. if (is_unsigned) {
  24250. #if CYTHON_USE_PYLONG_INTERNALS
  24251. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24252. switch (Py_SIZE(x)) {
  24253. case 0: return (size_t) 0;
  24254. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
  24255. case 2:
  24256. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  24257. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24258. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24259. } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
  24260. return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24261. }
  24262. }
  24263. break;
  24264. case 3:
  24265. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  24266. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24267. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24268. } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
  24269. return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24270. }
  24271. }
  24272. break;
  24273. case 4:
  24274. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  24275. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24276. __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])))
  24277. } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
  24278. 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]));
  24279. }
  24280. }
  24281. break;
  24282. }
  24283. #endif
  24284. #if CYTHON_COMPILING_IN_CPYTHON
  24285. if (unlikely(Py_SIZE(x) < 0)) {
  24286. goto raise_neg_overflow;
  24287. }
  24288. #else
  24289. {
  24290. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24291. if (unlikely(result < 0))
  24292. return (size_t) -1;
  24293. if (unlikely(result == 1))
  24294. goto raise_neg_overflow;
  24295. }
  24296. #endif
  24297. if (sizeof(size_t) <= sizeof(unsigned long)) {
  24298. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
  24299. #ifdef HAVE_LONG_LONG
  24300. } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
  24301. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24302. #endif
  24303. }
  24304. } else {
  24305. #if CYTHON_USE_PYLONG_INTERNALS
  24306. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24307. switch (Py_SIZE(x)) {
  24308. case 0: return (size_t) 0;
  24309. case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
  24310. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
  24311. case -2:
  24312. if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
  24313. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24314. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24315. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24316. return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24317. }
  24318. }
  24319. break;
  24320. case 2:
  24321. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  24322. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24323. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24324. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24325. return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24326. }
  24327. }
  24328. break;
  24329. case -3:
  24330. if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24331. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24332. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24333. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24334. return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24335. }
  24336. }
  24337. break;
  24338. case 3:
  24339. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  24340. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24341. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24342. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24343. return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24344. }
  24345. }
  24346. break;
  24347. case -4:
  24348. if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24349. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24350. __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])))
  24351. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  24352. 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])));
  24353. }
  24354. }
  24355. break;
  24356. case 4:
  24357. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  24358. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24359. __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])))
  24360. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  24361. 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])));
  24362. }
  24363. }
  24364. break;
  24365. }
  24366. #endif
  24367. if (sizeof(size_t) <= sizeof(long)) {
  24368. __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
  24369. #ifdef HAVE_LONG_LONG
  24370. } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
  24371. __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
  24372. #endif
  24373. }
  24374. }
  24375. {
  24376. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24377. PyErr_SetString(PyExc_RuntimeError,
  24378. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24379. #else
  24380. size_t val;
  24381. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24382. #if PY_MAJOR_VERSION < 3
  24383. if (likely(v) && !PyLong_Check(v)) {
  24384. PyObject *tmp = v;
  24385. v = PyNumber_Long(tmp);
  24386. Py_DECREF(tmp);
  24387. }
  24388. #endif
  24389. if (likely(v)) {
  24390. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24391. unsigned char *bytes = (unsigned char *)&val;
  24392. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24393. bytes, sizeof(val),
  24394. is_little, !is_unsigned);
  24395. Py_DECREF(v);
  24396. if (likely(!ret))
  24397. return val;
  24398. }
  24399. #endif
  24400. return (size_t) -1;
  24401. }
  24402. } else {
  24403. size_t val;
  24404. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24405. if (!tmp) return (size_t) -1;
  24406. val = __Pyx_PyInt_As_size_t(tmp);
  24407. Py_DECREF(tmp);
  24408. return val;
  24409. }
  24410. raise_overflow:
  24411. PyErr_SetString(PyExc_OverflowError,
  24412. "value too large to convert to size_t");
  24413. return (size_t) -1;
  24414. raise_neg_overflow:
  24415. PyErr_SetString(PyExc_OverflowError,
  24416. "can't convert negative value to size_t");
  24417. return (size_t) -1;
  24418. }
  24419. /* CIntFromPy */
  24420. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  24421. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  24422. const int is_unsigned = neg_one > const_zero;
  24423. #if PY_MAJOR_VERSION < 3
  24424. if (likely(PyInt_Check(x))) {
  24425. if (sizeof(int) < sizeof(long)) {
  24426. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  24427. } else {
  24428. long val = PyInt_AS_LONG(x);
  24429. if (is_unsigned && unlikely(val < 0)) {
  24430. goto raise_neg_overflow;
  24431. }
  24432. return (int) val;
  24433. }
  24434. } else
  24435. #endif
  24436. if (likely(PyLong_Check(x))) {
  24437. if (is_unsigned) {
  24438. #if CYTHON_USE_PYLONG_INTERNALS
  24439. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24440. switch (Py_SIZE(x)) {
  24441. case 0: return (int) 0;
  24442. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  24443. case 2:
  24444. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  24445. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24446. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24447. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  24448. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24449. }
  24450. }
  24451. break;
  24452. case 3:
  24453. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  24454. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24455. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24456. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  24457. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24458. }
  24459. }
  24460. break;
  24461. case 4:
  24462. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  24463. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24464. __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])))
  24465. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  24466. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24467. }
  24468. }
  24469. break;
  24470. }
  24471. #endif
  24472. #if CYTHON_COMPILING_IN_CPYTHON
  24473. if (unlikely(Py_SIZE(x) < 0)) {
  24474. goto raise_neg_overflow;
  24475. }
  24476. #else
  24477. {
  24478. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24479. if (unlikely(result < 0))
  24480. return (int) -1;
  24481. if (unlikely(result == 1))
  24482. goto raise_neg_overflow;
  24483. }
  24484. #endif
  24485. if (sizeof(int) <= sizeof(unsigned long)) {
  24486. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  24487. #ifdef HAVE_LONG_LONG
  24488. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  24489. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24490. #endif
  24491. }
  24492. } else {
  24493. #if CYTHON_USE_PYLONG_INTERNALS
  24494. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24495. switch (Py_SIZE(x)) {
  24496. case 0: return (int) 0;
  24497. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  24498. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  24499. case -2:
  24500. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  24501. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24502. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24503. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24504. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24505. }
  24506. }
  24507. break;
  24508. case 2:
  24509. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  24510. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24511. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24512. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24513. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24514. }
  24515. }
  24516. break;
  24517. case -3:
  24518. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24519. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24520. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24521. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24522. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24523. }
  24524. }
  24525. break;
  24526. case 3:
  24527. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  24528. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24529. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24530. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24531. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24532. }
  24533. }
  24534. break;
  24535. case -4:
  24536. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24537. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24538. __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])))
  24539. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  24540. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24541. }
  24542. }
  24543. break;
  24544. case 4:
  24545. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  24546. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24547. __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])))
  24548. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  24549. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24550. }
  24551. }
  24552. break;
  24553. }
  24554. #endif
  24555. if (sizeof(int) <= sizeof(long)) {
  24556. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  24557. #ifdef HAVE_LONG_LONG
  24558. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  24559. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  24560. #endif
  24561. }
  24562. }
  24563. {
  24564. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24565. PyErr_SetString(PyExc_RuntimeError,
  24566. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24567. #else
  24568. int val;
  24569. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24570. #if PY_MAJOR_VERSION < 3
  24571. if (likely(v) && !PyLong_Check(v)) {
  24572. PyObject *tmp = v;
  24573. v = PyNumber_Long(tmp);
  24574. Py_DECREF(tmp);
  24575. }
  24576. #endif
  24577. if (likely(v)) {
  24578. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24579. unsigned char *bytes = (unsigned char *)&val;
  24580. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24581. bytes, sizeof(val),
  24582. is_little, !is_unsigned);
  24583. Py_DECREF(v);
  24584. if (likely(!ret))
  24585. return val;
  24586. }
  24587. #endif
  24588. return (int) -1;
  24589. }
  24590. } else {
  24591. int val;
  24592. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24593. if (!tmp) return (int) -1;
  24594. val = __Pyx_PyInt_As_int(tmp);
  24595. Py_DECREF(tmp);
  24596. return val;
  24597. }
  24598. raise_overflow:
  24599. PyErr_SetString(PyExc_OverflowError,
  24600. "value too large to convert to int");
  24601. return (int) -1;
  24602. raise_neg_overflow:
  24603. PyErr_SetString(PyExc_OverflowError,
  24604. "can't convert negative value to int");
  24605. return (int) -1;
  24606. }
  24607. /* CIntFromPy */
  24608. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  24609. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  24610. const int is_unsigned = neg_one > const_zero;
  24611. #if PY_MAJOR_VERSION < 3
  24612. if (likely(PyInt_Check(x))) {
  24613. if (sizeof(long) < sizeof(long)) {
  24614. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  24615. } else {
  24616. long val = PyInt_AS_LONG(x);
  24617. if (is_unsigned && unlikely(val < 0)) {
  24618. goto raise_neg_overflow;
  24619. }
  24620. return (long) val;
  24621. }
  24622. } else
  24623. #endif
  24624. if (likely(PyLong_Check(x))) {
  24625. if (is_unsigned) {
  24626. #if CYTHON_USE_PYLONG_INTERNALS
  24627. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24628. switch (Py_SIZE(x)) {
  24629. case 0: return (long) 0;
  24630. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  24631. case 2:
  24632. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24633. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24634. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24635. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  24636. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24637. }
  24638. }
  24639. break;
  24640. case 3:
  24641. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24642. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24643. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24644. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  24645. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24646. }
  24647. }
  24648. break;
  24649. case 4:
  24650. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24651. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24652. __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])))
  24653. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  24654. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24655. }
  24656. }
  24657. break;
  24658. }
  24659. #endif
  24660. #if CYTHON_COMPILING_IN_CPYTHON
  24661. if (unlikely(Py_SIZE(x) < 0)) {
  24662. goto raise_neg_overflow;
  24663. }
  24664. #else
  24665. {
  24666. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24667. if (unlikely(result < 0))
  24668. return (long) -1;
  24669. if (unlikely(result == 1))
  24670. goto raise_neg_overflow;
  24671. }
  24672. #endif
  24673. if (sizeof(long) <= sizeof(unsigned long)) {
  24674. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  24675. #ifdef HAVE_LONG_LONG
  24676. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  24677. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24678. #endif
  24679. }
  24680. } else {
  24681. #if CYTHON_USE_PYLONG_INTERNALS
  24682. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24683. switch (Py_SIZE(x)) {
  24684. case 0: return (long) 0;
  24685. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  24686. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  24687. case -2:
  24688. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  24689. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24690. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24691. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24692. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24693. }
  24694. }
  24695. break;
  24696. case 2:
  24697. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24698. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24699. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24700. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24701. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24702. }
  24703. }
  24704. break;
  24705. case -3:
  24706. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24707. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24708. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24709. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24710. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24711. }
  24712. }
  24713. break;
  24714. case 3:
  24715. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24716. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24717. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24718. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24719. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24720. }
  24721. }
  24722. break;
  24723. case -4:
  24724. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24725. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24726. __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])))
  24727. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24728. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24729. }
  24730. }
  24731. break;
  24732. case 4:
  24733. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24734. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24735. __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])))
  24736. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24737. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24738. }
  24739. }
  24740. break;
  24741. }
  24742. #endif
  24743. if (sizeof(long) <= sizeof(long)) {
  24744. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  24745. #ifdef HAVE_LONG_LONG
  24746. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  24747. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  24748. #endif
  24749. }
  24750. }
  24751. {
  24752. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24753. PyErr_SetString(PyExc_RuntimeError,
  24754. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24755. #else
  24756. long val;
  24757. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24758. #if PY_MAJOR_VERSION < 3
  24759. if (likely(v) && !PyLong_Check(v)) {
  24760. PyObject *tmp = v;
  24761. v = PyNumber_Long(tmp);
  24762. Py_DECREF(tmp);
  24763. }
  24764. #endif
  24765. if (likely(v)) {
  24766. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24767. unsigned char *bytes = (unsigned char *)&val;
  24768. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24769. bytes, sizeof(val),
  24770. is_little, !is_unsigned);
  24771. Py_DECREF(v);
  24772. if (likely(!ret))
  24773. return val;
  24774. }
  24775. #endif
  24776. return (long) -1;
  24777. }
  24778. } else {
  24779. long val;
  24780. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24781. if (!tmp) return (long) -1;
  24782. val = __Pyx_PyInt_As_long(tmp);
  24783. Py_DECREF(tmp);
  24784. return val;
  24785. }
  24786. raise_overflow:
  24787. PyErr_SetString(PyExc_OverflowError,
  24788. "value too large to convert to long");
  24789. return (long) -1;
  24790. raise_neg_overflow:
  24791. PyErr_SetString(PyExc_OverflowError,
  24792. "can't convert negative value to long");
  24793. return (long) -1;
  24794. }
  24795. /* FastTypeChecks */
  24796. #if CYTHON_COMPILING_IN_CPYTHON
  24797. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  24798. while (a) {
  24799. a = a->tp_base;
  24800. if (a == b)
  24801. return 1;
  24802. }
  24803. return b == &PyBaseObject_Type;
  24804. }
  24805. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  24806. PyObject *mro;
  24807. if (a == b) return 1;
  24808. mro = a->tp_mro;
  24809. if (likely(mro)) {
  24810. Py_ssize_t i, n;
  24811. n = PyTuple_GET_SIZE(mro);
  24812. for (i = 0; i < n; i++) {
  24813. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  24814. return 1;
  24815. }
  24816. return 0;
  24817. }
  24818. return __Pyx_InBases(a, b);
  24819. }
  24820. #if PY_MAJOR_VERSION == 2
  24821. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  24822. PyObject *exception, *value, *tb;
  24823. int res;
  24824. __Pyx_PyThreadState_declare
  24825. __Pyx_PyThreadState_assign
  24826. __Pyx_ErrFetch(&exception, &value, &tb);
  24827. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  24828. if (unlikely(res == -1)) {
  24829. PyErr_WriteUnraisable(err);
  24830. res = 0;
  24831. }
  24832. if (!res) {
  24833. res = PyObject_IsSubclass(err, exc_type2);
  24834. if (unlikely(res == -1)) {
  24835. PyErr_WriteUnraisable(err);
  24836. res = 0;
  24837. }
  24838. }
  24839. __Pyx_ErrRestore(exception, value, tb);
  24840. return res;
  24841. }
  24842. #else
  24843. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  24844. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  24845. if (!res) {
  24846. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  24847. }
  24848. return res;
  24849. }
  24850. #endif
  24851. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  24852. Py_ssize_t i, n;
  24853. assert(PyExceptionClass_Check(exc_type));
  24854. n = PyTuple_GET_SIZE(tuple);
  24855. #if PY_MAJOR_VERSION >= 3
  24856. for (i=0; i<n; i++) {
  24857. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  24858. }
  24859. #endif
  24860. for (i=0; i<n; i++) {
  24861. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  24862. #if PY_MAJOR_VERSION < 3
  24863. if (likely(exc_type == t)) return 1;
  24864. #endif
  24865. if (likely(PyExceptionClass_Check(t))) {
  24866. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  24867. } else {
  24868. }
  24869. }
  24870. return 0;
  24871. }
  24872. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  24873. if (likely(err == exc_type)) return 1;
  24874. if (likely(PyExceptionClass_Check(err))) {
  24875. if (likely(PyExceptionClass_Check(exc_type))) {
  24876. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  24877. } else if (likely(PyTuple_Check(exc_type))) {
  24878. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  24879. } else {
  24880. }
  24881. }
  24882. return PyErr_GivenExceptionMatches(err, exc_type);
  24883. }
  24884. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  24885. assert(PyExceptionClass_Check(exc_type1));
  24886. assert(PyExceptionClass_Check(exc_type2));
  24887. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  24888. if (likely(PyExceptionClass_Check(err))) {
  24889. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  24890. }
  24891. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  24892. }
  24893. #endif
  24894. /* CStringEquals */
  24895. static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
  24896. while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
  24897. return *s1 == *s2;
  24898. }
  24899. /* CheckBinaryVersion */
  24900. static int __Pyx_check_binary_version(void) {
  24901. char ctversion[4], rtversion[4];
  24902. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  24903. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  24904. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  24905. char message[200];
  24906. PyOS_snprintf(message, sizeof(message),
  24907. "compiletime version %s of module '%.100s' "
  24908. "does not match runtime version %s",
  24909. ctversion, __Pyx_MODULE_NAME, rtversion);
  24910. return PyErr_WarnEx(NULL, message, 1);
  24911. }
  24912. return 0;
  24913. }
  24914. /* InitStrings */
  24915. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  24916. while (t->p) {
  24917. #if PY_MAJOR_VERSION < 3
  24918. if (t->is_unicode) {
  24919. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  24920. } else if (t->intern) {
  24921. *t->p = PyString_InternFromString(t->s);
  24922. } else {
  24923. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  24924. }
  24925. #else
  24926. if (t->is_unicode | t->is_str) {
  24927. if (t->intern) {
  24928. *t->p = PyUnicode_InternFromString(t->s);
  24929. } else if (t->encoding) {
  24930. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  24931. } else {
  24932. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  24933. }
  24934. } else {
  24935. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  24936. }
  24937. #endif
  24938. if (!*t->p)
  24939. return -1;
  24940. if (PyObject_Hash(*t->p) == -1)
  24941. return -1;
  24942. ++t;
  24943. }
  24944. return 0;
  24945. }
  24946. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  24947. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  24948. }
  24949. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  24950. Py_ssize_t ignore;
  24951. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  24952. }
  24953. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24954. #if !CYTHON_PEP393_ENABLED
  24955. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24956. char* defenc_c;
  24957. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  24958. if (!defenc) return NULL;
  24959. defenc_c = PyBytes_AS_STRING(defenc);
  24960. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24961. {
  24962. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  24963. char* c;
  24964. for (c = defenc_c; c < end; c++) {
  24965. if ((unsigned char) (*c) >= 128) {
  24966. PyUnicode_AsASCIIString(o);
  24967. return NULL;
  24968. }
  24969. }
  24970. }
  24971. #endif
  24972. *length = PyBytes_GET_SIZE(defenc);
  24973. return defenc_c;
  24974. }
  24975. #else
  24976. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24977. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  24978. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24979. if (likely(PyUnicode_IS_ASCII(o))) {
  24980. *length = PyUnicode_GET_LENGTH(o);
  24981. return PyUnicode_AsUTF8(o);
  24982. } else {
  24983. PyUnicode_AsASCIIString(o);
  24984. return NULL;
  24985. }
  24986. #else
  24987. return PyUnicode_AsUTF8AndSize(o, length);
  24988. #endif
  24989. }
  24990. #endif
  24991. #endif
  24992. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24993. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24994. if (
  24995. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24996. __Pyx_sys_getdefaultencoding_not_ascii &&
  24997. #endif
  24998. PyUnicode_Check(o)) {
  24999. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  25000. } else
  25001. #endif
  25002. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  25003. if (PyByteArray_Check(o)) {
  25004. *length = PyByteArray_GET_SIZE(o);
  25005. return PyByteArray_AS_STRING(o);
  25006. } else
  25007. #endif
  25008. {
  25009. char* result;
  25010. int r = PyBytes_AsStringAndSize(o, &result, length);
  25011. if (unlikely(r < 0)) {
  25012. return NULL;
  25013. } else {
  25014. return result;
  25015. }
  25016. }
  25017. }
  25018. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  25019. int is_true = x == Py_True;
  25020. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  25021. else return PyObject_IsTrue(x);
  25022. }
  25023. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  25024. int retval;
  25025. if (unlikely(!x)) return -1;
  25026. retval = __Pyx_PyObject_IsTrue(x);
  25027. Py_DECREF(x);
  25028. return retval;
  25029. }
  25030. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  25031. #if PY_MAJOR_VERSION >= 3
  25032. if (PyLong_Check(result)) {
  25033. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  25034. "__int__ returned non-int (type %.200s). "
  25035. "The ability to return an instance of a strict subclass of int "
  25036. "is deprecated, and may be removed in a future version of Python.",
  25037. Py_TYPE(result)->tp_name)) {
  25038. Py_DECREF(result);
  25039. return NULL;
  25040. }
  25041. return result;
  25042. }
  25043. #endif
  25044. PyErr_Format(PyExc_TypeError,
  25045. "__%.4s__ returned non-%.4s (type %.200s)",
  25046. type_name, type_name, Py_TYPE(result)->tp_name);
  25047. Py_DECREF(result);
  25048. return NULL;
  25049. }
  25050. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  25051. #if CYTHON_USE_TYPE_SLOTS
  25052. PyNumberMethods *m;
  25053. #endif
  25054. const char *name = NULL;
  25055. PyObject *res = NULL;
  25056. #if PY_MAJOR_VERSION < 3
  25057. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  25058. #else
  25059. if (likely(PyLong_Check(x)))
  25060. #endif
  25061. return __Pyx_NewRef(x);
  25062. #if CYTHON_USE_TYPE_SLOTS
  25063. m = Py_TYPE(x)->tp_as_number;
  25064. #if PY_MAJOR_VERSION < 3
  25065. if (m && m->nb_int) {
  25066. name = "int";
  25067. res = m->nb_int(x);
  25068. }
  25069. else if (m && m->nb_long) {
  25070. name = "long";
  25071. res = m->nb_long(x);
  25072. }
  25073. #else
  25074. if (likely(m && m->nb_int)) {
  25075. name = "int";
  25076. res = m->nb_int(x);
  25077. }
  25078. #endif
  25079. #else
  25080. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  25081. res = PyNumber_Int(x);
  25082. }
  25083. #endif
  25084. if (likely(res)) {
  25085. #if PY_MAJOR_VERSION < 3
  25086. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  25087. #else
  25088. if (unlikely(!PyLong_CheckExact(res))) {
  25089. #endif
  25090. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  25091. }
  25092. }
  25093. else if (!PyErr_Occurred()) {
  25094. PyErr_SetString(PyExc_TypeError,
  25095. "an integer is required");
  25096. }
  25097. return res;
  25098. }
  25099. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  25100. Py_ssize_t ival;
  25101. PyObject *x;
  25102. #if PY_MAJOR_VERSION < 3
  25103. if (likely(PyInt_CheckExact(b))) {
  25104. if (sizeof(Py_ssize_t) >= sizeof(long))
  25105. return PyInt_AS_LONG(b);
  25106. else
  25107. return PyInt_AsSsize_t(b);
  25108. }
  25109. #endif
  25110. if (likely(PyLong_CheckExact(b))) {
  25111. #if CYTHON_USE_PYLONG_INTERNALS
  25112. const digit* digits = ((PyLongObject*)b)->ob_digit;
  25113. const Py_ssize_t size = Py_SIZE(b);
  25114. if (likely(__Pyx_sst_abs(size) <= 1)) {
  25115. ival = likely(size) ? digits[0] : 0;
  25116. if (size == -1) ival = -ival;
  25117. return ival;
  25118. } else {
  25119. switch (size) {
  25120. case 2:
  25121. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  25122. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25123. }
  25124. break;
  25125. case -2:
  25126. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  25127. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25128. }
  25129. break;
  25130. case 3:
  25131. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  25132. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25133. }
  25134. break;
  25135. case -3:
  25136. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  25137. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25138. }
  25139. break;
  25140. case 4:
  25141. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  25142. 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]));
  25143. }
  25144. break;
  25145. case -4:
  25146. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  25147. 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]));
  25148. }
  25149. break;
  25150. }
  25151. }
  25152. #endif
  25153. return PyLong_AsSsize_t(b);
  25154. }
  25155. x = PyNumber_Index(b);
  25156. if (!x) return -1;
  25157. ival = PyInt_AsSsize_t(x);
  25158. Py_DECREF(x);
  25159. return ival;
  25160. }
  25161. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  25162. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  25163. }
  25164. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  25165. return PyInt_FromSize_t(ival);
  25166. }
  25167. #endif /* Py_PYTHON_H */

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