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

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618
  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":180
  1129. *
  1130. *
  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 'gedlibpy' */
  1982. static PyTypeObject *__pyx_ptype_8gedlibpy_GEDEnv = 0;
  1983. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &); /*proto*/
  1984. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &); /*proto*/
  1985. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &); /*proto*/
  1986. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &); /*proto*/
  1987. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &); /*proto*/
  1988. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
  1989. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &); /*proto*/
  1990. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &); /*proto*/
  1991. static std::map<std::string,std::string> __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(PyObject *); /*proto*/
  1992. static PyObject *__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(std::map<std::string,std::string> const &); /*proto*/
  1993. 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*/
  1994. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(const std::vector<std::vector<size_t> > &); /*proto*/
  1995. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *); /*proto*/
  1996. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &); /*proto*/
  1997. 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*/
  1998. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &); /*proto*/
  1999. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &); /*proto*/
  2000. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(const std::vector<std::vector<npy_uint64> > &); /*proto*/
  2001. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *); /*proto*/
  2002. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *); /*proto*/
  2003. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *); /*proto*/
  2004. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &); /*proto*/
  2005. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &); /*proto*/
  2006. 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*/
  2007. static std::pair<size_t,size_t> __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *); /*proto*/
  2008. 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*/
  2009. #define __Pyx_MODULE_NAME "gedlibpy"
  2010. extern int __pyx_module_is_main_gedlibpy;
  2011. int __pyx_module_is_main_gedlibpy = 0;
  2012. /* Implementation of 'gedlibpy' */
  2013. static PyObject *__pyx_builtin_range;
  2014. static PyObject *__pyx_builtin_print;
  2015. static PyObject *__pyx_builtin_enumerate;
  2016. static PyObject *__pyx_builtin_TypeError;
  2017. static PyObject *__pyx_builtin_ValueError;
  2018. static PyObject *__pyx_builtin_RuntimeError;
  2019. static PyObject *__pyx_builtin_ImportError;
  2020. static PyObject *__pyx_builtin_MemoryError;
  2021. static const char __pyx_k_[] = "";
  2022. static const char __pyx_k_g[] = "g";
  2023. static const char __pyx_k_h[] = "h";
  2024. static const char __pyx_k_g1[] = "g1";
  2025. static const char __pyx_k_g2[] = "g2";
  2026. static const char __pyx_k_id[] = "id";
  2027. static const char __pyx_k_np[] = "np";
  2028. static const char __pyx_k_nx[] = "nx";
  2029. static const char __pyx_k_os[] = "os";
  2030. static const char __pyx_k__20[] = "*";
  2031. static const char __pyx_k_doc[] = "__doc__";
  2032. static const char __pyx_k_inf[] = "inf";
  2033. static const char __pyx_k_key[] = "key";
  2034. static const char __pyx_k_res[] = "res";
  2035. static const char __pyx_k_cdll[] = "cdll";
  2036. static const char __pyx_k_file[] = "__file__";
  2037. static const char __pyx_k_g_id[] = "g_id";
  2038. static const char __pyx_k_h_id[] = "h_id";
  2039. static const char __pyx_k_head[] = "head";
  2040. static const char __pyx_k_init[] = "init";
  2041. static const char __pyx_k_lib1[] = "lib1";
  2042. static const char __pyx_k_lib2[] = "lib2";
  2043. static const char __pyx_k_lib3[] = "lib3";
  2044. static const char __pyx_k_lib4[] = "lib4";
  2045. static const char __pyx_k_main[] = "__main__";
  2046. static const char __pyx_k_name[] = "name";
  2047. static const char __pyx_k_path[] = "path";
  2048. static const char __pyx_k_self[] = "self";
  2049. static const char __pyx_k_tail[] = "tail";
  2050. static const char __pyx_k_test[] = "__test__";
  2051. static const char __pyx_k_Error[] = "Error";
  2052. static const char __pyx_k_Graph[] = "Graph";
  2053. static const char __pyx_k_edges[] = "edges";
  2054. static const char __pyx_k_graph[] = "graph";
  2055. static const char __pyx_k_items[] = "items";
  2056. static const char __pyx_k_map_b[] = "map_b";
  2057. static const char __pyx_k_map_u[] = "map_u";
  2058. static const char __pyx_k_nodes[] = "nodes";
  2059. static const char __pyx_k_numpy[] = "numpy";
  2060. static const char __pyx_k_print[] = "print";
  2061. static const char __pyx_k_range[] = "range";
  2062. static const char __pyx_k_utf_8[] = "utf-8";
  2063. static const char __pyx_k_value[] = "value";
  2064. static const char __pyx_k_GEDEnv[] = "GEDEnv";
  2065. static const char __pyx_k_classe[] = "classe";
  2066. static const char __pyx_k_ctypes[] = "ctypes";
  2067. static const char __pyx_k_decode[] = "decode";
  2068. static const char __pyx_k_encode[] = "encode";
  2069. static const char __pyx_k_import[] = "__import__";
  2070. static const char __pyx_k_init_2[] = "__init__";
  2071. static const char __pyx_k_method[] = "method";
  2072. static const char __pyx_k_module[] = "__module__";
  2073. static const char __pyx_k_name_2[] = "__name__";
  2074. static const char __pyx_k_option[] = "option";
  2075. static const char __pyx_k_reduce[] = "__reduce__";
  2076. static const char __pyx_k_NodeMap[] = "NodeMap";
  2077. static const char __pyx_k_classes[] = "classes";
  2078. static const char __pyx_k_dataset[] = "dataset";
  2079. static const char __pyx_k_dirname[] = "dirname";
  2080. static const char __pyx_k_message[] = "message";
  2081. static const char __pyx_k_node_id[] = "node_id";
  2082. static const char __pyx_k_options[] = "options";
  2083. static const char __pyx_k_prepare[] = "__prepare__";
  2084. static const char __pyx_k_add_edge[] = "add_edge";
  2085. static const char __pyx_k_add_node[] = "add_node";
  2086. static const char __pyx_k_gedlibpy[] = "gedlibpy";
  2087. static const char __pyx_k_getstate[] = "__getstate__";
  2088. static const char __pyx_k_graph_id[] = "graph_id";
  2089. static const char __pyx_k_networkx[] = "networkx";
  2090. static const char __pyx_k_node_map[] = "node_map";
  2091. static const char __pyx_k_nx_graph[] = "nx_graph";
  2092. static const char __pyx_k_path_XML[] = "path_XML";
  2093. static const char __pyx_k_qualname[] = "__qualname__";
  2094. static const char __pyx_k_realpath[] = "realpath";
  2095. static const char __pyx_k_setstate[] = "__setstate__";
  2096. static const char __pyx_k_InitError[] = "InitError";
  2097. static const char __pyx_k_TypeError[] = "TypeError";
  2098. static const char __pyx_k_add_graph[] = "add_graph";
  2099. static const char __pyx_k_adj_lists[] = "adj_lists";
  2100. static const char __pyx_k_edge_list[] = "edge_list";
  2101. static const char __pyx_k_edge_type[] = "edge_type";
  2102. static const char __pyx_k_edit_cost[] = "edit_cost";
  2103. static const char __pyx_k_enumerate[] = "enumerate";
  2104. static const char __pyx_k_graph_ids[] = "graph_ids";
  2105. static const char __pyx_k_iteritems[] = "iteritems";
  2106. static const char __pyx_k_map_edges[] = "map_edges";
  2107. static const char __pyx_k_metaclass[] = "__metaclass__";
  2108. static const char __pyx_k_node_type[] = "node_type";
  2109. static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
  2110. static const char __pyx_k_ValueError[] = "ValueError";
  2111. static const char __pyx_k_adj_matrix[] = "adj_matrix";
  2112. static const char __pyx_k_edge_label[] = "edge_label";
  2113. static const char __pyx_k_graph_name[] = "graph_name";
  2114. static const char __pyx_k_map_edge_b[] = "map_edge_b";
  2115. static const char __pyx_k_node_label[] = "node_label";
  2116. static const char __pyx_k_run_method[] = "run_method";
  2117. static const char __pyx_k_set_method[] = "set_method";
  2118. static const char __pyx_k_ImportError[] = "ImportError";
  2119. static const char __pyx_k_LoadLibrary[] = "LoadLibrary";
  2120. static const char __pyx_k_MemoryError[] = "MemoryError";
  2121. static const char __pyx_k_MethodError[] = "MethodError";
  2122. static const char __pyx_k_as_relation[] = "as_relation";
  2123. static const char __pyx_k_clear_graph[] = "clear_graph";
  2124. static const char __pyx_k_graph_class[] = "graph_class";
  2125. static const char __pyx_k_init_method[] = "init_method";
  2126. static const char __pyx_k_init_option[] = "init_option";
  2127. static const char __pyx_k_path_folder[] = "path_folder";
  2128. static const char __pyx_k_restart_env[] = "restart_env";
  2129. static const char __pyx_k_RuntimeError[] = "RuntimeError";
  2130. static const char __pyx_k_add_nx_graph[] = "add_nx_graph";
  2131. static const char __pyx_k_edge_label_1[] = "edge_label_1";
  2132. static const char __pyx_k_edge_label_2[] = "edge_label_2";
  2133. static const char __pyx_k_edge_label_b[] = "edge_label_b";
  2134. static const char __pyx_k_gedlibpy_pyx[] = "gedlibpy.pyx";
  2135. static const char __pyx_k_get_node_map[] = "get_node_map";
  2136. static const char __pyx_k_node_label_1[] = "node_label_1";
  2137. static const char __pyx_k_node_label_2[] = "node_label_2";
  2138. static const char __pyx_k_EditCostError[] = "EditCostError";
  2139. static const char __pyx_k_Graphs_loaded[] = "Graphs loaded ! ";
  2140. static const char __pyx_k_get_edge_data[] = "get_edge_data";
  2141. static const char __pyx_k_list_of_edges[] = "list_of_edges";
  2142. static const char __pyx_k_list_of_nodes[] = "list_of_nodes";
  2143. static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
  2144. static const char __pyx_k_set_edit_cost[] = "set_edit_cost";
  2145. static const char __pyx_k_add_assignment[] = "add_assignment";
  2146. static const char __pyx_k_get_dummy_node[] = "get_dummy_node";
  2147. static const char __pyx_k_is_initialized[] = "is_initialized";
  2148. static const char __pyx_k_decode_your_map[] = "decode_your_map";
  2149. static const char __pyx_k_encode_your_map[] = "encode_your_map";
  2150. static const char __pyx_k_get_graph_edges[] = "get_graph_edges";
  2151. static const char __pyx_k_get_upper_bound[] = "get_upper_bound";
  2152. static const char __pyx_k_gklearn_ged_env[] = "gklearn.ged.env";
  2153. static const char __pyx_k_load_GXL_graphs[] = "load_GXL_graphs";
  2154. static const char __pyx_k_print_to_stdout[] = "print_to_stdout";
  2155. static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
  2156. static const char __pyx_k_InitError___init[] = "InitError.__init__";
  2157. static const char __pyx_k_Number_of_graphs[] = "Number of graphs = ";
  2158. static const char __pyx_k_get_init_options[] = "get_init_options";
  2159. static const char __pyx_k_set_induced_cost[] = "set_induced_cost";
  2160. static const char __pyx_k_ignore_duplicates[] = "ignore_duplicates";
  2161. static const char __pyx_k_original_node_ids[] = "original_node_ids";
  2162. static const char __pyx_k_MethodError___init[] = "MethodError.__init__";
  2163. static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
  2164. static const char __pyx_k_decode_graph_edges[] = "decode_graph_edges";
  2165. static const char __pyx_k_edit_cost_constant[] = "edit_cost_constant";
  2166. static const char __pyx_k_get_method_options[] = "get_method_options";
  2167. static const char __pyx_k_get_graph_num_nodes[] = "get_graph_num_nodes";
  2168. static const char __pyx_k_EditCostError___init[] = "EditCostError.__init__";
  2169. static const char __pyx_k_list_of_init_options[] = "list_of_init_options";
  2170. static const char __pyx_k_get_edit_cost_options[] = "get_edit_cost_options";
  2171. static const char __pyx_k_get_graph_node_labels[] = "get_graph_node_labels";
  2172. static const char __pyx_k_get_original_node_ids[] = "get_original_node_ids";
  2173. static const char __pyx_k_lib_nomad_libnomad_so[] = "/lib/nomad/libnomad.so";
  2174. static const char __pyx_k_list_of_method_options[] = "list_of_method_options";
  2175. static const char __pyx_k_lib_nomad_libsgtelib_so[] = "/lib/nomad/libsgtelib.so";
  2176. static const char __pyx_k_Computation_between_graph[] = "Computation between graph ";
  2177. static const char __pyx_k_Initialization_terminated[] = "Initialization terminated !";
  2178. static const char __pyx_k_lib_fann_libdoublefann_so[] = "/lib/fann/libdoublefann.so";
  2179. static const char __pyx_k_lib_libsvm_3_22_libsvm_so[] = "/lib/libsvm.3.22/libsvm.so";
  2180. static const char __pyx_k_list_of_edit_cost_options[] = "list_of_edit_cost_options";
  2181. static const char __pyx_k_Initialization_in_progress[] = "Initialization in progress...";
  2182. static const char __pyx_k_Loading_graphs_in_progress[] = "Loading graphs in progress...";
  2183. static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
  2184. static const char __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES[] = "EAGER_WITHOUT_SHUFFLED_COPIES";
  2185. 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";
  2186. 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";
  2187. 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";
  2188. static const char __pyx_k_Class_for_error_s_management_Th[] = "\n\t\tClass for error's management. This one is general. \n\t";
  2189. 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";
  2190. 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";
  2191. 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";
  2192. 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";
  2193. static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
  2194. static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
  2195. static const char __pyx_k_with_all_the_others_including_h[] = " with all the others including himself.";
  2196. static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
  2197. static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
  2198. 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 !";
  2199. 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.";
  2200. 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";
  2201. static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
  2202. static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
  2203. static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
  2204. static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
  2205. static PyObject *__pyx_kp_u_;
  2206. static PyObject *__pyx_kp_s_Class_for_Edit_Cost_Error_Raise;
  2207. static PyObject *__pyx_kp_s_Class_for_Init_Error_Raise_an_e;
  2208. static PyObject *__pyx_kp_s_Class_for_Method_Error_Raise_an;
  2209. static PyObject *__pyx_kp_s_Class_for_error_s_management_Th;
  2210. static PyObject *__pyx_kp_u_Computation_between_graph;
  2211. static PyObject *__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES;
  2212. static PyObject *__pyx_n_s_EditCostError;
  2213. static PyObject *__pyx_n_s_EditCostError___init;
  2214. static PyObject *__pyx_n_s_Error;
  2215. static PyObject *__pyx_kp_u_Finish_The_return_contains_edit;
  2216. static PyObject *__pyx_kp_u_Finish_You_can_check_the_result;
  2217. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
  2218. static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
  2219. static PyObject *__pyx_n_s_GEDEnv;
  2220. static PyObject *__pyx_n_s_Graph;
  2221. static PyObject *__pyx_kp_u_Graphs_loaded;
  2222. static PyObject *__pyx_n_s_ImportError;
  2223. static PyObject *__pyx_n_s_InitError;
  2224. static PyObject *__pyx_n_s_InitError___init;
  2225. static PyObject *__pyx_kp_u_Initialization_in_progress;
  2226. static PyObject *__pyx_kp_u_Initialization_terminated;
  2227. static PyObject *__pyx_n_s_LoadLibrary;
  2228. static PyObject *__pyx_kp_u_Loading_graphs_in_progress;
  2229. static PyObject *__pyx_n_s_MemoryError;
  2230. static PyObject *__pyx_n_s_MethodError;
  2231. static PyObject *__pyx_n_s_MethodError___init;
  2232. static PyObject *__pyx_n_s_NodeMap;
  2233. static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
  2234. static PyObject *__pyx_kp_u_Number_of_graphs;
  2235. static PyObject *__pyx_kp_u_Please_don_t_restart_the_environ;
  2236. static PyObject *__pyx_n_s_RuntimeError;
  2237. static PyObject *__pyx_kp_u_This_edit_cost_function_doesn_t;
  2238. static PyObject *__pyx_kp_u_This_init_option_doesn_t_exist_p;
  2239. static PyObject *__pyx_kp_u_This_method_doesn_t_exist_please;
  2240. static PyObject *__pyx_n_s_TypeError;
  2241. static PyObject *__pyx_n_s_ValueError;
  2242. static PyObject *__pyx_n_s__20;
  2243. static PyObject *__pyx_n_s_add_assignment;
  2244. static PyObject *__pyx_n_s_add_edge;
  2245. static PyObject *__pyx_n_s_add_graph;
  2246. static PyObject *__pyx_n_s_add_node;
  2247. static PyObject *__pyx_n_s_add_nx_graph;
  2248. static PyObject *__pyx_n_s_adj_lists;
  2249. static PyObject *__pyx_n_s_adj_matrix;
  2250. static PyObject *__pyx_n_s_as_relation;
  2251. static PyObject *__pyx_n_s_cdll;
  2252. static PyObject *__pyx_n_s_classe;
  2253. static PyObject *__pyx_n_s_classes;
  2254. static PyObject *__pyx_n_s_clear_graph;
  2255. static PyObject *__pyx_n_s_cline_in_traceback;
  2256. static PyObject *__pyx_n_s_ctypes;
  2257. static PyObject *__pyx_n_s_dataset;
  2258. static PyObject *__pyx_n_s_decode;
  2259. static PyObject *__pyx_n_s_decode_graph_edges;
  2260. static PyObject *__pyx_n_s_decode_your_map;
  2261. static PyObject *__pyx_n_s_dirname;
  2262. static PyObject *__pyx_n_s_doc;
  2263. static PyObject *__pyx_n_s_edge_label;
  2264. static PyObject *__pyx_n_s_edge_label_1;
  2265. static PyObject *__pyx_n_s_edge_label_2;
  2266. static PyObject *__pyx_n_s_edge_label_b;
  2267. static PyObject *__pyx_n_s_edge_list;
  2268. static PyObject *__pyx_n_s_edge_type;
  2269. static PyObject *__pyx_n_s_edges;
  2270. static PyObject *__pyx_n_s_edit_cost;
  2271. static PyObject *__pyx_n_s_edit_cost_constant;
  2272. static PyObject *__pyx_n_s_encode;
  2273. static PyObject *__pyx_n_s_encode_your_map;
  2274. static PyObject *__pyx_n_s_enumerate;
  2275. static PyObject *__pyx_n_s_file;
  2276. static PyObject *__pyx_n_s_g;
  2277. static PyObject *__pyx_n_s_g1;
  2278. static PyObject *__pyx_n_s_g2;
  2279. static PyObject *__pyx_n_s_g_id;
  2280. static PyObject *__pyx_n_s_gedlibpy;
  2281. static PyObject *__pyx_kp_s_gedlibpy_pyx;
  2282. static PyObject *__pyx_n_s_get_dummy_node;
  2283. static PyObject *__pyx_n_s_get_edge_data;
  2284. static PyObject *__pyx_n_s_get_edit_cost_options;
  2285. static PyObject *__pyx_n_s_get_graph_edges;
  2286. static PyObject *__pyx_n_s_get_graph_node_labels;
  2287. static PyObject *__pyx_n_s_get_graph_num_nodes;
  2288. static PyObject *__pyx_n_s_get_init_options;
  2289. static PyObject *__pyx_n_s_get_method_options;
  2290. static PyObject *__pyx_n_s_get_node_map;
  2291. static PyObject *__pyx_n_s_get_original_node_ids;
  2292. static PyObject *__pyx_n_s_get_upper_bound;
  2293. static PyObject *__pyx_n_s_getstate;
  2294. static PyObject *__pyx_n_s_gklearn_ged_env;
  2295. static PyObject *__pyx_n_s_graph;
  2296. static PyObject *__pyx_n_s_graph_class;
  2297. static PyObject *__pyx_n_s_graph_id;
  2298. static PyObject *__pyx_n_s_graph_ids;
  2299. static PyObject *__pyx_n_s_graph_name;
  2300. static PyObject *__pyx_n_s_h;
  2301. static PyObject *__pyx_n_s_h_id;
  2302. static PyObject *__pyx_n_s_head;
  2303. static PyObject *__pyx_n_u_id;
  2304. static PyObject *__pyx_n_s_ignore_duplicates;
  2305. static PyObject *__pyx_n_s_import;
  2306. static PyObject *__pyx_n_s_inf;
  2307. static PyObject *__pyx_n_s_init;
  2308. static PyObject *__pyx_n_s_init_2;
  2309. static PyObject *__pyx_n_s_init_method;
  2310. static PyObject *__pyx_n_s_init_option;
  2311. static PyObject *__pyx_n_s_is_initialized;
  2312. static PyObject *__pyx_n_s_items;
  2313. static PyObject *__pyx_n_s_iteritems;
  2314. static PyObject *__pyx_n_s_key;
  2315. static PyObject *__pyx_n_s_lib1;
  2316. static PyObject *__pyx_n_s_lib2;
  2317. static PyObject *__pyx_n_s_lib3;
  2318. static PyObject *__pyx_n_s_lib4;
  2319. static PyObject *__pyx_kp_u_lib_fann_libdoublefann_so;
  2320. static PyObject *__pyx_kp_u_lib_libsvm_3_22_libsvm_so;
  2321. static PyObject *__pyx_kp_u_lib_nomad_libnomad_so;
  2322. static PyObject *__pyx_kp_u_lib_nomad_libsgtelib_so;
  2323. static PyObject *__pyx_n_s_list_of_edges;
  2324. static PyObject *__pyx_n_s_list_of_edit_cost_options;
  2325. static PyObject *__pyx_n_s_list_of_init_options;
  2326. static PyObject *__pyx_n_s_list_of_method_options;
  2327. static PyObject *__pyx_n_s_list_of_nodes;
  2328. static PyObject *__pyx_n_s_load_GXL_graphs;
  2329. static PyObject *__pyx_n_s_main;
  2330. static PyObject *__pyx_n_s_map_b;
  2331. static PyObject *__pyx_n_s_map_edge_b;
  2332. static PyObject *__pyx_n_s_map_edges;
  2333. static PyObject *__pyx_n_s_map_u;
  2334. static PyObject *__pyx_n_s_message;
  2335. static PyObject *__pyx_n_s_metaclass;
  2336. static PyObject *__pyx_n_s_method;
  2337. static PyObject *__pyx_n_s_module;
  2338. static PyObject *__pyx_n_s_name;
  2339. static PyObject *__pyx_n_s_name_2;
  2340. static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
  2341. static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
  2342. static PyObject *__pyx_n_s_networkx;
  2343. static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
  2344. static PyObject *__pyx_n_s_node_id;
  2345. static PyObject *__pyx_n_s_node_label;
  2346. static PyObject *__pyx_n_s_node_label_1;
  2347. static PyObject *__pyx_n_s_node_label_2;
  2348. static PyObject *__pyx_n_s_node_map;
  2349. static PyObject *__pyx_n_s_node_type;
  2350. static PyObject *__pyx_n_s_nodes;
  2351. static PyObject *__pyx_n_s_np;
  2352. static PyObject *__pyx_n_s_numpy;
  2353. static PyObject *__pyx_kp_u_numpy_core_multiarray_failed_to;
  2354. static PyObject *__pyx_kp_u_numpy_core_umath_failed_to_impor;
  2355. static PyObject *__pyx_n_s_nx;
  2356. static PyObject *__pyx_n_s_nx_graph;
  2357. static PyObject *__pyx_n_s_option;
  2358. static PyObject *__pyx_n_s_options;
  2359. static PyObject *__pyx_n_u_original_node_ids;
  2360. static PyObject *__pyx_n_s_os;
  2361. static PyObject *__pyx_n_s_path;
  2362. static PyObject *__pyx_n_s_path_XML;
  2363. static PyObject *__pyx_n_s_path_folder;
  2364. static PyObject *__pyx_n_s_prepare;
  2365. static PyObject *__pyx_n_s_print;
  2366. static PyObject *__pyx_n_s_print_to_stdout;
  2367. static PyObject *__pyx_n_s_qualname;
  2368. static PyObject *__pyx_n_s_range;
  2369. static PyObject *__pyx_n_s_realpath;
  2370. static PyObject *__pyx_n_s_reduce;
  2371. static PyObject *__pyx_n_s_reduce_cython;
  2372. static PyObject *__pyx_n_s_reduce_ex;
  2373. static PyObject *__pyx_n_s_res;
  2374. static PyObject *__pyx_n_s_restart_env;
  2375. static PyObject *__pyx_n_s_run_method;
  2376. static PyObject *__pyx_n_s_self;
  2377. static PyObject *__pyx_n_s_set_edit_cost;
  2378. static PyObject *__pyx_n_s_set_induced_cost;
  2379. static PyObject *__pyx_n_s_set_method;
  2380. static PyObject *__pyx_n_s_setstate;
  2381. static PyObject *__pyx_n_s_setstate_cython;
  2382. static PyObject *__pyx_n_s_tail;
  2383. static PyObject *__pyx_n_s_test;
  2384. static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
  2385. static PyObject *__pyx_kp_u_utf_8;
  2386. static PyObject *__pyx_n_s_value;
  2387. static PyObject *__pyx_kp_u_with_all_the_others_including_h;
  2388. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2389. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2390. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2391. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
  2392. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2393. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2394. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2395. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2396. 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 */
  2397. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2398. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2399. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2400. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id); /* proto */
  2401. 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 */
  2402. 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 */
  2403. 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 */
  2404. 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 */
  2405. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2406. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2407. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2408. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2409. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2410. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2411. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2412. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id); /* proto */
  2413. 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 */
  2414. 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 */
  2415. 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 */
  2416. 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 */
  2417. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2418. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2419. 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 */
  2420. 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 */
  2421. 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 */
  2422. 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 */
  2423. 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 */
  2424. 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 */
  2425. 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 */
  2426. 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 */
  2427. 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 */
  2428. 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 */
  2429. 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 */
  2430. 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 */
  2431. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2432. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2433. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /* proto */
  2434. 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 */
  2435. 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 */
  2436. 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 */
  2437. 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 */
  2438. 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 */
  2439. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2440. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2441. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2442. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id); /* proto */
  2443. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2444. 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 */
  2445. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2446. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label); /* proto */
  2447. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels); /* proto */
  2448. 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 */
  2449. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2450. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label); /* proto */
  2451. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels); /* proto */
  2452. 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 */
  2453. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2454. 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 */
  2455. 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 */
  2456. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self); /* proto */
  2457. 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 */
  2458. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2459. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2460. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message); /* proto */
  2461. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u); /* proto */
  2462. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b); /* proto */
  2463. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /* proto */
  2464. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
  2465. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2466. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags); /* proto */
  2467. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
  2468. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
  2469. static PyObject *__pyx_int_0;
  2470. static PyObject *__pyx_int_1;
  2471. static PyObject *__pyx_k__2;
  2472. static PyObject *__pyx_k__3;
  2473. static PyObject *__pyx_tuple__4;
  2474. static PyObject *__pyx_tuple__5;
  2475. static PyObject *__pyx_tuple__6;
  2476. static PyObject *__pyx_tuple__7;
  2477. static PyObject *__pyx_tuple__8;
  2478. static PyObject *__pyx_tuple__9;
  2479. static PyObject *__pyx_tuple__10;
  2480. static PyObject *__pyx_tuple__11;
  2481. static PyObject *__pyx_tuple__12;
  2482. static PyObject *__pyx_tuple__13;
  2483. static PyObject *__pyx_tuple__14;
  2484. static PyObject *__pyx_tuple__15;
  2485. static PyObject *__pyx_tuple__16;
  2486. static PyObject *__pyx_tuple__17;
  2487. static PyObject *__pyx_tuple__18;
  2488. static PyObject *__pyx_tuple__19;
  2489. static PyObject *__pyx_tuple__21;
  2490. static PyObject *__pyx_tuple__23;
  2491. static PyObject *__pyx_tuple__25;
  2492. static PyObject *__pyx_tuple__28;
  2493. static PyObject *__pyx_tuple__30;
  2494. static PyObject *__pyx_tuple__32;
  2495. static PyObject *__pyx_tuple__34;
  2496. static PyObject *__pyx_tuple__36;
  2497. static PyObject *__pyx_tuple__38;
  2498. static PyObject *__pyx_codeobj__22;
  2499. static PyObject *__pyx_codeobj__24;
  2500. static PyObject *__pyx_codeobj__26;
  2501. static PyObject *__pyx_codeobj__27;
  2502. static PyObject *__pyx_codeobj__29;
  2503. static PyObject *__pyx_codeobj__31;
  2504. static PyObject *__pyx_codeobj__33;
  2505. static PyObject *__pyx_codeobj__35;
  2506. static PyObject *__pyx_codeobj__37;
  2507. static PyObject *__pyx_codeobj__39;
  2508. /* Late includes */
  2509. /* "gedlibpy.pyx":128
  2510. *
  2511. *
  2512. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2513. * """
  2514. * Searchs the differents edit cost functions and returns the result.
  2515. */
  2516. /* Python wrapper */
  2517. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2518. 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";
  2519. 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};
  2520. static PyObject *__pyx_pw_8gedlibpy_1get_edit_cost_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2521. PyObject *__pyx_r = 0;
  2522. __Pyx_RefNannyDeclarations
  2523. __Pyx_RefNannySetupContext("get_edit_cost_options (wrapper)", 0);
  2524. __pyx_r = __pyx_pf_8gedlibpy_get_edit_cost_options(__pyx_self);
  2525. /* function exit code */
  2526. __Pyx_RefNannyFinishContext();
  2527. return __pyx_r;
  2528. }
  2529. static PyObject *__pyx_pf_8gedlibpy_get_edit_cost_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2530. std::string __pyx_7genexpr__pyx_v_option;
  2531. PyObject *__pyx_r = NULL;
  2532. __Pyx_RefNannyDeclarations
  2533. PyObject *__pyx_t_1 = NULL;
  2534. std::vector<std::string> __pyx_t_2;
  2535. std::vector<std::string> ::iterator __pyx_t_3;
  2536. std::vector<std::string> *__pyx_t_4;
  2537. std::string __pyx_t_5;
  2538. PyObject *__pyx_t_6 = NULL;
  2539. __Pyx_RefNannySetupContext("get_edit_cost_options", 0);
  2540. /* "gedlibpy.pyx":139
  2541. * """
  2542. *
  2543. * return [option.decode('utf-8') for option in getEditCostStringOptions()] # <<<<<<<<<<<<<<
  2544. *
  2545. *
  2546. */
  2547. __Pyx_XDECREF(__pyx_r);
  2548. { /* enter inner scope */
  2549. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 139, __pyx_L1_error)
  2550. __Pyx_GOTREF(__pyx_t_1);
  2551. try {
  2552. __pyx_t_2 = pyged::getEditCostStringOptions();
  2553. } catch(...) {
  2554. __Pyx_CppExn2PyErr();
  2555. __PYX_ERR(0, 139, __pyx_L1_error)
  2556. }
  2557. __pyx_t_4 = &__pyx_t_2;
  2558. __pyx_t_3 = __pyx_t_4->begin();
  2559. for (;;) {
  2560. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2561. __pyx_t_5 = *__pyx_t_3;
  2562. ++__pyx_t_3;
  2563. __pyx_7genexpr__pyx_v_option = __pyx_t_5;
  2564. __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, 139, __pyx_L1_error)
  2565. __Pyx_GOTREF(__pyx_t_6);
  2566. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 139, __pyx_L1_error)
  2567. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2568. }
  2569. } /* exit inner scope */
  2570. __pyx_r = __pyx_t_1;
  2571. __pyx_t_1 = 0;
  2572. goto __pyx_L0;
  2573. /* "gedlibpy.pyx":128
  2574. *
  2575. *
  2576. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  2577. * """
  2578. * Searchs the differents edit cost functions and returns the result.
  2579. */
  2580. /* function exit code */
  2581. __pyx_L1_error:;
  2582. __Pyx_XDECREF(__pyx_t_1);
  2583. __Pyx_XDECREF(__pyx_t_6);
  2584. __Pyx_AddTraceback("gedlibpy.get_edit_cost_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2585. __pyx_r = NULL;
  2586. __pyx_L0:;
  2587. __Pyx_XGIVEREF(__pyx_r);
  2588. __Pyx_RefNannyFinishContext();
  2589. return __pyx_r;
  2590. }
  2591. /* "gedlibpy.pyx":142
  2592. *
  2593. *
  2594. * def get_method_options() : # <<<<<<<<<<<<<<
  2595. * """
  2596. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2597. */
  2598. /* Python wrapper */
  2599. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2600. 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";
  2601. 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};
  2602. static PyObject *__pyx_pw_8gedlibpy_3get_method_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2603. PyObject *__pyx_r = 0;
  2604. __Pyx_RefNannyDeclarations
  2605. __Pyx_RefNannySetupContext("get_method_options (wrapper)", 0);
  2606. __pyx_r = __pyx_pf_8gedlibpy_2get_method_options(__pyx_self);
  2607. /* function exit code */
  2608. __Pyx_RefNannyFinishContext();
  2609. return __pyx_r;
  2610. }
  2611. static PyObject *__pyx_pf_8gedlibpy_2get_method_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2612. std::string __pyx_8genexpr1__pyx_v_option;
  2613. PyObject *__pyx_r = NULL;
  2614. __Pyx_RefNannyDeclarations
  2615. PyObject *__pyx_t_1 = NULL;
  2616. std::vector<std::string> __pyx_t_2;
  2617. std::vector<std::string> ::iterator __pyx_t_3;
  2618. std::vector<std::string> *__pyx_t_4;
  2619. std::string __pyx_t_5;
  2620. PyObject *__pyx_t_6 = NULL;
  2621. __Pyx_RefNannySetupContext("get_method_options", 0);
  2622. /* "gedlibpy.pyx":152
  2623. * .. note:: Prefer the list_of_method_options attribute of this module.
  2624. * """
  2625. * return [option.decode('utf-8') for option in getMethodStringOptions()] # <<<<<<<<<<<<<<
  2626. *
  2627. *
  2628. */
  2629. __Pyx_XDECREF(__pyx_r);
  2630. { /* enter inner scope */
  2631. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
  2632. __Pyx_GOTREF(__pyx_t_1);
  2633. try {
  2634. __pyx_t_2 = pyged::getMethodStringOptions();
  2635. } catch(...) {
  2636. __Pyx_CppExn2PyErr();
  2637. __PYX_ERR(0, 152, __pyx_L1_error)
  2638. }
  2639. __pyx_t_4 = &__pyx_t_2;
  2640. __pyx_t_3 = __pyx_t_4->begin();
  2641. for (;;) {
  2642. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2643. __pyx_t_5 = *__pyx_t_3;
  2644. ++__pyx_t_3;
  2645. __pyx_8genexpr1__pyx_v_option = __pyx_t_5;
  2646. __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, 152, __pyx_L1_error)
  2647. __Pyx_GOTREF(__pyx_t_6);
  2648. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 152, __pyx_L1_error)
  2649. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2650. }
  2651. } /* exit inner scope */
  2652. __pyx_r = __pyx_t_1;
  2653. __pyx_t_1 = 0;
  2654. goto __pyx_L0;
  2655. /* "gedlibpy.pyx":142
  2656. *
  2657. *
  2658. * def get_method_options() : # <<<<<<<<<<<<<<
  2659. * """
  2660. * Searchs the differents method for edit distance computation between graphs and returns the result.
  2661. */
  2662. /* function exit code */
  2663. __pyx_L1_error:;
  2664. __Pyx_XDECREF(__pyx_t_1);
  2665. __Pyx_XDECREF(__pyx_t_6);
  2666. __Pyx_AddTraceback("gedlibpy.get_method_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2667. __pyx_r = NULL;
  2668. __pyx_L0:;
  2669. __Pyx_XGIVEREF(__pyx_r);
  2670. __Pyx_RefNannyFinishContext();
  2671. return __pyx_r;
  2672. }
  2673. /* "gedlibpy.pyx":155
  2674. *
  2675. *
  2676. * def get_init_options() : # <<<<<<<<<<<<<<
  2677. * """
  2678. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2679. */
  2680. /* Python wrapper */
  2681. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2682. 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";
  2683. 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};
  2684. static PyObject *__pyx_pw_8gedlibpy_5get_init_options(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2685. PyObject *__pyx_r = 0;
  2686. __Pyx_RefNannyDeclarations
  2687. __Pyx_RefNannySetupContext("get_init_options (wrapper)", 0);
  2688. __pyx_r = __pyx_pf_8gedlibpy_4get_init_options(__pyx_self);
  2689. /* function exit code */
  2690. __Pyx_RefNannyFinishContext();
  2691. return __pyx_r;
  2692. }
  2693. static PyObject *__pyx_pf_8gedlibpy_4get_init_options(CYTHON_UNUSED PyObject *__pyx_self) {
  2694. std::string __pyx_8genexpr2__pyx_v_option;
  2695. PyObject *__pyx_r = NULL;
  2696. __Pyx_RefNannyDeclarations
  2697. PyObject *__pyx_t_1 = NULL;
  2698. std::vector<std::string> __pyx_t_2;
  2699. std::vector<std::string> ::iterator __pyx_t_3;
  2700. std::vector<std::string> *__pyx_t_4;
  2701. std::string __pyx_t_5;
  2702. PyObject *__pyx_t_6 = NULL;
  2703. __Pyx_RefNannySetupContext("get_init_options", 0);
  2704. /* "gedlibpy.pyx":165
  2705. * .. note:: Prefer the list_of_init_options attribute of this module.
  2706. * """
  2707. * return [option.decode('utf-8') for option in getInitStringOptions()] # <<<<<<<<<<<<<<
  2708. *
  2709. *
  2710. */
  2711. __Pyx_XDECREF(__pyx_r);
  2712. { /* enter inner scope */
  2713. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
  2714. __Pyx_GOTREF(__pyx_t_1);
  2715. try {
  2716. __pyx_t_2 = pyged::getInitStringOptions();
  2717. } catch(...) {
  2718. __Pyx_CppExn2PyErr();
  2719. __PYX_ERR(0, 165, __pyx_L1_error)
  2720. }
  2721. __pyx_t_4 = &__pyx_t_2;
  2722. __pyx_t_3 = __pyx_t_4->begin();
  2723. for (;;) {
  2724. if (!(__pyx_t_3 != __pyx_t_4->end())) break;
  2725. __pyx_t_5 = *__pyx_t_3;
  2726. ++__pyx_t_3;
  2727. __pyx_8genexpr2__pyx_v_option = __pyx_t_5;
  2728. __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, 165, __pyx_L1_error)
  2729. __Pyx_GOTREF(__pyx_t_6);
  2730. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 165, __pyx_L1_error)
  2731. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  2732. }
  2733. } /* exit inner scope */
  2734. __pyx_r = __pyx_t_1;
  2735. __pyx_t_1 = 0;
  2736. goto __pyx_L0;
  2737. /* "gedlibpy.pyx":155
  2738. *
  2739. *
  2740. * def get_init_options() : # <<<<<<<<<<<<<<
  2741. * """
  2742. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  2743. */
  2744. /* function exit code */
  2745. __pyx_L1_error:;
  2746. __Pyx_XDECREF(__pyx_t_1);
  2747. __Pyx_XDECREF(__pyx_t_6);
  2748. __Pyx_AddTraceback("gedlibpy.get_init_options", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2749. __pyx_r = NULL;
  2750. __pyx_L0:;
  2751. __Pyx_XGIVEREF(__pyx_r);
  2752. __Pyx_RefNannyFinishContext();
  2753. return __pyx_r;
  2754. }
  2755. /* "gedlibpy.pyx":168
  2756. *
  2757. *
  2758. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2759. * """
  2760. * Returns the ID of a dummy node.
  2761. */
  2762. /* Python wrapper */
  2763. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2764. 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";
  2765. 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};
  2766. static PyObject *__pyx_pw_8gedlibpy_7get_dummy_node(PyObject *__pyx_self, CYTHON_UNUSED PyObject *unused) {
  2767. PyObject *__pyx_r = 0;
  2768. __Pyx_RefNannyDeclarations
  2769. __Pyx_RefNannySetupContext("get_dummy_node (wrapper)", 0);
  2770. __pyx_r = __pyx_pf_8gedlibpy_6get_dummy_node(__pyx_self);
  2771. /* function exit code */
  2772. __Pyx_RefNannyFinishContext();
  2773. return __pyx_r;
  2774. }
  2775. static PyObject *__pyx_pf_8gedlibpy_6get_dummy_node(CYTHON_UNUSED PyObject *__pyx_self) {
  2776. PyObject *__pyx_r = NULL;
  2777. __Pyx_RefNannyDeclarations
  2778. size_t __pyx_t_1;
  2779. PyObject *__pyx_t_2 = NULL;
  2780. __Pyx_RefNannySetupContext("get_dummy_node", 0);
  2781. /* "gedlibpy.pyx":177
  2782. * .. note:: A dummy node is used when a node isn't associated to an other node.
  2783. * """
  2784. * return getDummyNode() # <<<<<<<<<<<<<<
  2785. *
  2786. *
  2787. */
  2788. __Pyx_XDECREF(__pyx_r);
  2789. try {
  2790. __pyx_t_1 = pyged::getDummyNode();
  2791. } catch(...) {
  2792. __Pyx_CppExn2PyErr();
  2793. __PYX_ERR(0, 177, __pyx_L1_error)
  2794. }
  2795. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 177, __pyx_L1_error)
  2796. __Pyx_GOTREF(__pyx_t_2);
  2797. __pyx_r = __pyx_t_2;
  2798. __pyx_t_2 = 0;
  2799. goto __pyx_L0;
  2800. /* "gedlibpy.pyx":168
  2801. *
  2802. *
  2803. * def get_dummy_node() : # <<<<<<<<<<<<<<
  2804. * """
  2805. * Returns the ID of a dummy node.
  2806. */
  2807. /* function exit code */
  2808. __pyx_L1_error:;
  2809. __Pyx_XDECREF(__pyx_t_2);
  2810. __Pyx_AddTraceback("gedlibpy.get_dummy_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2811. __pyx_r = NULL;
  2812. __pyx_L0:;
  2813. __Pyx_XGIVEREF(__pyx_r);
  2814. __Pyx_RefNannyFinishContext();
  2815. return __pyx_r;
  2816. }
  2817. /* "gedlibpy.pyx":187
  2818. *
  2819. *
  2820. * def __cinit__(self): # <<<<<<<<<<<<<<
  2821. * self.c_env = new PyGEDEnv()
  2822. *
  2823. */
  2824. /* Python wrapper */
  2825. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  2826. static int __pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  2827. int __pyx_r;
  2828. __Pyx_RefNannyDeclarations
  2829. __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  2830. if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
  2831. __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  2832. if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  2833. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv___cinit__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2834. /* function exit code */
  2835. __Pyx_RefNannyFinishContext();
  2836. return __pyx_r;
  2837. }
  2838. static int __pyx_pf_8gedlibpy_6GEDEnv___cinit__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2839. int __pyx_r;
  2840. __Pyx_RefNannyDeclarations
  2841. pyged::PyGEDEnv *__pyx_t_1;
  2842. __Pyx_RefNannySetupContext("__cinit__", 0);
  2843. /* "gedlibpy.pyx":188
  2844. *
  2845. * def __cinit__(self):
  2846. * self.c_env = new PyGEDEnv() # <<<<<<<<<<<<<<
  2847. *
  2848. *
  2849. */
  2850. try {
  2851. __pyx_t_1 = new pyged::PyGEDEnv();
  2852. } catch(...) {
  2853. __Pyx_CppExn2PyErr();
  2854. __PYX_ERR(0, 188, __pyx_L1_error)
  2855. }
  2856. __pyx_v_self->c_env = __pyx_t_1;
  2857. /* "gedlibpy.pyx":187
  2858. *
  2859. *
  2860. * def __cinit__(self): # <<<<<<<<<<<<<<
  2861. * self.c_env = new PyGEDEnv()
  2862. *
  2863. */
  2864. /* function exit code */
  2865. __pyx_r = 0;
  2866. goto __pyx_L0;
  2867. __pyx_L1_error:;
  2868. __Pyx_AddTraceback("gedlibpy.GEDEnv.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2869. __pyx_r = -1;
  2870. __pyx_L0:;
  2871. __Pyx_RefNannyFinishContext();
  2872. return __pyx_r;
  2873. }
  2874. /* "gedlibpy.pyx":191
  2875. *
  2876. *
  2877. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2878. * del self.c_env
  2879. *
  2880. */
  2881. /* Python wrapper */
  2882. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
  2883. static void __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(PyObject *__pyx_v_self) {
  2884. __Pyx_RefNannyDeclarations
  2885. __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  2886. __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2887. /* function exit code */
  2888. __Pyx_RefNannyFinishContext();
  2889. }
  2890. static void __pyx_pf_8gedlibpy_6GEDEnv_2__dealloc__(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2891. __Pyx_RefNannyDeclarations
  2892. __Pyx_RefNannySetupContext("__dealloc__", 0);
  2893. /* "gedlibpy.pyx":192
  2894. *
  2895. * def __dealloc__(self):
  2896. * del self.c_env # <<<<<<<<<<<<<<
  2897. *
  2898. *
  2899. */
  2900. delete __pyx_v_self->c_env;
  2901. /* "gedlibpy.pyx":191
  2902. *
  2903. *
  2904. * def __dealloc__(self): # <<<<<<<<<<<<<<
  2905. * del self.c_env
  2906. *
  2907. */
  2908. /* function exit code */
  2909. __Pyx_RefNannyFinishContext();
  2910. }
  2911. /* "gedlibpy.pyx":195
  2912. *
  2913. *
  2914. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2915. * """
  2916. * Checks and returns if the computation environment is initialized or not.
  2917. */
  2918. /* Python wrapper */
  2919. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2920. 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";
  2921. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2922. PyObject *__pyx_r = 0;
  2923. __Pyx_RefNannyDeclarations
  2924. __Pyx_RefNannySetupContext("is_initialized (wrapper)", 0);
  2925. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2926. /* function exit code */
  2927. __Pyx_RefNannyFinishContext();
  2928. return __pyx_r;
  2929. }
  2930. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_4is_initialized(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2931. PyObject *__pyx_r = NULL;
  2932. __Pyx_RefNannyDeclarations
  2933. bool __pyx_t_1;
  2934. PyObject *__pyx_t_2 = NULL;
  2935. __Pyx_RefNannySetupContext("is_initialized", 0);
  2936. /* "gedlibpy.pyx":204
  2937. * .. note:: This function exists for internals verifications but you can use it for your code.
  2938. * """
  2939. * return self.c_env.isInitialized() # <<<<<<<<<<<<<<
  2940. *
  2941. *
  2942. */
  2943. __Pyx_XDECREF(__pyx_r);
  2944. try {
  2945. __pyx_t_1 = __pyx_v_self->c_env->isInitialized();
  2946. } catch(...) {
  2947. __Pyx_CppExn2PyErr();
  2948. __PYX_ERR(0, 204, __pyx_L1_error)
  2949. }
  2950. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 204, __pyx_L1_error)
  2951. __Pyx_GOTREF(__pyx_t_2);
  2952. __pyx_r = __pyx_t_2;
  2953. __pyx_t_2 = 0;
  2954. goto __pyx_L0;
  2955. /* "gedlibpy.pyx":195
  2956. *
  2957. *
  2958. * def is_initialized(self) : # <<<<<<<<<<<<<<
  2959. * """
  2960. * Checks and returns if the computation environment is initialized or not.
  2961. */
  2962. /* function exit code */
  2963. __pyx_L1_error:;
  2964. __Pyx_XDECREF(__pyx_t_2);
  2965. __Pyx_AddTraceback("gedlibpy.GEDEnv.is_initialized", __pyx_clineno, __pyx_lineno, __pyx_filename);
  2966. __pyx_r = NULL;
  2967. __pyx_L0:;
  2968. __Pyx_XGIVEREF(__pyx_r);
  2969. __Pyx_RefNannyFinishContext();
  2970. return __pyx_r;
  2971. }
  2972. /* "gedlibpy.pyx":207
  2973. *
  2974. *
  2975. * def restart_env(self) : # <<<<<<<<<<<<<<
  2976. * """
  2977. * Restarts the environment variable. All data related to it will be delete.
  2978. */
  2979. /* Python wrapper */
  2980. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  2981. 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";
  2982. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_7restart_env(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  2983. PyObject *__pyx_r = 0;
  2984. __Pyx_RefNannyDeclarations
  2985. __Pyx_RefNannySetupContext("restart_env (wrapper)", 0);
  2986. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_6restart_env(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  2987. /* function exit code */
  2988. __Pyx_RefNannyFinishContext();
  2989. return __pyx_r;
  2990. }
  2991. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_6restart_env(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  2992. PyObject *__pyx_r = NULL;
  2993. __Pyx_RefNannyDeclarations
  2994. __Pyx_RefNannySetupContext("restart_env", 0);
  2995. /* "gedlibpy.pyx":214
  2996. * .. note:: You can now delete and add somes graphs after initialization so you can avoid this function.
  2997. * """
  2998. * self.c_env.restartEnv() # <<<<<<<<<<<<<<
  2999. *
  3000. *
  3001. */
  3002. try {
  3003. __pyx_v_self->c_env->restartEnv();
  3004. } catch(...) {
  3005. __Pyx_CppExn2PyErr();
  3006. __PYX_ERR(0, 214, __pyx_L1_error)
  3007. }
  3008. /* "gedlibpy.pyx":207
  3009. *
  3010. *
  3011. * def restart_env(self) : # <<<<<<<<<<<<<<
  3012. * """
  3013. * Restarts the environment variable. All data related to it will be delete.
  3014. */
  3015. /* function exit code */
  3016. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3017. goto __pyx_L0;
  3018. __pyx_L1_error:;
  3019. __Pyx_AddTraceback("gedlibpy.GEDEnv.restart_env", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3020. __pyx_r = NULL;
  3021. __pyx_L0:;
  3022. __Pyx_XGIVEREF(__pyx_r);
  3023. __Pyx_RefNannyFinishContext();
  3024. return __pyx_r;
  3025. }
  3026. /* "gedlibpy.pyx":217
  3027. *
  3028. *
  3029. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3030. * """
  3031. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3032. */
  3033. /* Python wrapper */
  3034. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3035. 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";
  3036. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3037. PyObject *__pyx_v_path_folder = 0;
  3038. PyObject *__pyx_v_path_XML = 0;
  3039. PyObject *__pyx_v_node_type = 0;
  3040. PyObject *__pyx_v_edge_type = 0;
  3041. PyObject *__pyx_r = 0;
  3042. __Pyx_RefNannyDeclarations
  3043. __Pyx_RefNannySetupContext("load_GXL_graphs (wrapper)", 0);
  3044. {
  3045. 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};
  3046. PyObject* values[4] = {0,0,0,0};
  3047. if (unlikely(__pyx_kwds)) {
  3048. Py_ssize_t kw_args;
  3049. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3050. switch (pos_args) {
  3051. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3052. CYTHON_FALLTHROUGH;
  3053. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3054. CYTHON_FALLTHROUGH;
  3055. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3056. CYTHON_FALLTHROUGH;
  3057. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3058. CYTHON_FALLTHROUGH;
  3059. case 0: break;
  3060. default: goto __pyx_L5_argtuple_error;
  3061. }
  3062. kw_args = PyDict_Size(__pyx_kwds);
  3063. switch (pos_args) {
  3064. case 0:
  3065. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  3066. else goto __pyx_L5_argtuple_error;
  3067. CYTHON_FALLTHROUGH;
  3068. case 1:
  3069. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  3070. else {
  3071. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 1); __PYX_ERR(0, 217, __pyx_L3_error)
  3072. }
  3073. CYTHON_FALLTHROUGH;
  3074. case 2:
  3075. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_type)) != 0)) kw_args--;
  3076. else {
  3077. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 2); __PYX_ERR(0, 217, __pyx_L3_error)
  3078. }
  3079. CYTHON_FALLTHROUGH;
  3080. case 3:
  3081. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_type)) != 0)) kw_args--;
  3082. else {
  3083. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, 3); __PYX_ERR(0, 217, __pyx_L3_error)
  3084. }
  3085. }
  3086. if (unlikely(kw_args > 0)) {
  3087. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_GXL_graphs") < 0)) __PYX_ERR(0, 217, __pyx_L3_error)
  3088. }
  3089. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  3090. goto __pyx_L5_argtuple_error;
  3091. } else {
  3092. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3093. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3094. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3095. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3096. }
  3097. __pyx_v_path_folder = values[0];
  3098. __pyx_v_path_XML = values[1];
  3099. __pyx_v_node_type = values[2];
  3100. __pyx_v_edge_type = values[3];
  3101. }
  3102. goto __pyx_L4_argument_unpacking_done;
  3103. __pyx_L5_argtuple_error:;
  3104. __Pyx_RaiseArgtupleInvalid("load_GXL_graphs", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 217, __pyx_L3_error)
  3105. __pyx_L3_error:;
  3106. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3107. __Pyx_RefNannyFinishContext();
  3108. return NULL;
  3109. __pyx_L4_argument_unpacking_done:;
  3110. __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);
  3111. /* function exit code */
  3112. __Pyx_RefNannyFinishContext();
  3113. return __pyx_r;
  3114. }
  3115. 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) {
  3116. PyObject *__pyx_r = NULL;
  3117. __Pyx_RefNannyDeclarations
  3118. PyObject *__pyx_t_1 = NULL;
  3119. PyObject *__pyx_t_2 = NULL;
  3120. PyObject *__pyx_t_3 = NULL;
  3121. std::string __pyx_t_4;
  3122. std::string __pyx_t_5;
  3123. bool __pyx_t_6;
  3124. bool __pyx_t_7;
  3125. __Pyx_RefNannySetupContext("load_GXL_graphs", 0);
  3126. /* "gedlibpy.pyx":233
  3127. * .. note:: You can call this function multiple times if you want, but not after an init call.
  3128. * """
  3129. * self.c_env.loadGXLGraph(path_folder.encode('utf-8'), path_XML.encode('utf-8'), node_type, edge_type) # <<<<<<<<<<<<<<
  3130. *
  3131. *
  3132. */
  3133. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_folder, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
  3134. __Pyx_GOTREF(__pyx_t_2);
  3135. __pyx_t_3 = NULL;
  3136. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3137. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3138. if (likely(__pyx_t_3)) {
  3139. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3140. __Pyx_INCREF(__pyx_t_3);
  3141. __Pyx_INCREF(function);
  3142. __Pyx_DECREF_SET(__pyx_t_2, function);
  3143. }
  3144. }
  3145. __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);
  3146. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3147. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  3148. __Pyx_GOTREF(__pyx_t_1);
  3149. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3150. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
  3151. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3152. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_path_XML, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
  3153. __Pyx_GOTREF(__pyx_t_2);
  3154. __pyx_t_3 = NULL;
  3155. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3156. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3157. if (likely(__pyx_t_3)) {
  3158. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3159. __Pyx_INCREF(__pyx_t_3);
  3160. __Pyx_INCREF(function);
  3161. __Pyx_DECREF_SET(__pyx_t_2, function);
  3162. }
  3163. }
  3164. __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);
  3165. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3166. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
  3167. __Pyx_GOTREF(__pyx_t_1);
  3168. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3169. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
  3170. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3171. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_node_type); if (unlikely((__pyx_t_6 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
  3172. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_edge_type); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
  3173. try {
  3174. __pyx_v_self->c_env->loadGXLGraph(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7);
  3175. } catch(...) {
  3176. __Pyx_CppExn2PyErr();
  3177. __PYX_ERR(0, 233, __pyx_L1_error)
  3178. }
  3179. /* "gedlibpy.pyx":217
  3180. *
  3181. *
  3182. * def load_GXL_graphs(self, path_folder, path_XML, node_type, edge_type) : # <<<<<<<<<<<<<<
  3183. * """
  3184. * Loads some GXL graphes on the environment which is in a same folder, and present in the XMLfile.
  3185. */
  3186. /* function exit code */
  3187. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3188. goto __pyx_L0;
  3189. __pyx_L1_error:;
  3190. __Pyx_XDECREF(__pyx_t_1);
  3191. __Pyx_XDECREF(__pyx_t_2);
  3192. __Pyx_XDECREF(__pyx_t_3);
  3193. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_GXL_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3194. __pyx_r = NULL;
  3195. __pyx_L0:;
  3196. __Pyx_XGIVEREF(__pyx_r);
  3197. __Pyx_RefNannyFinishContext();
  3198. return __pyx_r;
  3199. }
  3200. /* "gedlibpy.pyx":236
  3201. *
  3202. *
  3203. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3204. * """
  3205. * Searchs the first and last IDs of the loaded graphs in the environment.
  3206. */
  3207. /* Python wrapper */
  3208. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3209. 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";
  3210. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3211. PyObject *__pyx_r = 0;
  3212. __Pyx_RefNannyDeclarations
  3213. __Pyx_RefNannySetupContext("graph_ids (wrapper)", 0);
  3214. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3215. /* function exit code */
  3216. __Pyx_RefNannyFinishContext();
  3217. return __pyx_r;
  3218. }
  3219. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_10graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3220. PyObject *__pyx_r = NULL;
  3221. __Pyx_RefNannyDeclarations
  3222. std::pair<size_t,size_t> __pyx_t_1;
  3223. PyObject *__pyx_t_2 = NULL;
  3224. __Pyx_RefNannySetupContext("graph_ids", 0);
  3225. /* "gedlibpy.pyx":245
  3226. * .. note:: Prefer this function if you have huges structures with lots of graphs.
  3227. * """
  3228. * return self.c_env.getGraphIds() # <<<<<<<<<<<<<<
  3229. *
  3230. *
  3231. */
  3232. __Pyx_XDECREF(__pyx_r);
  3233. try {
  3234. __pyx_t_1 = __pyx_v_self->c_env->getGraphIds();
  3235. } catch(...) {
  3236. __Pyx_CppExn2PyErr();
  3237. __PYX_ERR(0, 245, __pyx_L1_error)
  3238. }
  3239. __pyx_t_2 = __pyx_convert_pair_to_py_size_t____size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 245, __pyx_L1_error)
  3240. __Pyx_GOTREF(__pyx_t_2);
  3241. __pyx_r = __pyx_t_2;
  3242. __pyx_t_2 = 0;
  3243. goto __pyx_L0;
  3244. /* "gedlibpy.pyx":236
  3245. *
  3246. *
  3247. * def graph_ids(self) : # <<<<<<<<<<<<<<
  3248. * """
  3249. * Searchs the first and last IDs of the loaded graphs in the environment.
  3250. */
  3251. /* function exit code */
  3252. __pyx_L1_error:;
  3253. __Pyx_XDECREF(__pyx_t_2);
  3254. __Pyx_AddTraceback("gedlibpy.GEDEnv.graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3255. __pyx_r = NULL;
  3256. __pyx_L0:;
  3257. __Pyx_XGIVEREF(__pyx_r);
  3258. __Pyx_RefNannyFinishContext();
  3259. return __pyx_r;
  3260. }
  3261. /* "gedlibpy.pyx":248
  3262. *
  3263. *
  3264. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3265. * """
  3266. * Searchs all the IDs of the loaded graphs in the environment.
  3267. */
  3268. /* Python wrapper */
  3269. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  3270. 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";
  3271. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  3272. PyObject *__pyx_r = 0;
  3273. __Pyx_RefNannyDeclarations
  3274. __Pyx_RefNannySetupContext("get_all_graph_ids (wrapper)", 0);
  3275. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  3276. /* function exit code */
  3277. __Pyx_RefNannyFinishContext();
  3278. return __pyx_r;
  3279. }
  3280. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_12get_all_graph_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  3281. PyObject *__pyx_r = NULL;
  3282. __Pyx_RefNannyDeclarations
  3283. std::vector<size_t> __pyx_t_1;
  3284. PyObject *__pyx_t_2 = NULL;
  3285. __Pyx_RefNannySetupContext("get_all_graph_ids", 0);
  3286. /* "gedlibpy.pyx":257
  3287. * .. note:: The last ID is equal to (number of graphs - 1). The order correspond to the loading order.
  3288. * """
  3289. * return self.c_env.getAllGraphIds() # <<<<<<<<<<<<<<
  3290. *
  3291. *
  3292. */
  3293. __Pyx_XDECREF(__pyx_r);
  3294. try {
  3295. __pyx_t_1 = __pyx_v_self->c_env->getAllGraphIds();
  3296. } catch(...) {
  3297. __Pyx_CppExn2PyErr();
  3298. __PYX_ERR(0, 257, __pyx_L1_error)
  3299. }
  3300. __pyx_t_2 = __pyx_convert_vector_to_py_size_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 257, __pyx_L1_error)
  3301. __Pyx_GOTREF(__pyx_t_2);
  3302. __pyx_r = __pyx_t_2;
  3303. __pyx_t_2 = 0;
  3304. goto __pyx_L0;
  3305. /* "gedlibpy.pyx":248
  3306. *
  3307. *
  3308. * def get_all_graph_ids(self) : # <<<<<<<<<<<<<<
  3309. * """
  3310. * Searchs all the IDs of the loaded graphs in the environment.
  3311. */
  3312. /* function exit code */
  3313. __pyx_L1_error:;
  3314. __Pyx_XDECREF(__pyx_t_2);
  3315. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_graph_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3316. __pyx_r = NULL;
  3317. __pyx_L0:;
  3318. __Pyx_XGIVEREF(__pyx_r);
  3319. __Pyx_RefNannyFinishContext();
  3320. return __pyx_r;
  3321. }
  3322. /* "gedlibpy.pyx":260
  3323. *
  3324. *
  3325. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3326. * """
  3327. * Returns the class of a graph with its ID.
  3328. */
  3329. /* Python wrapper */
  3330. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3331. 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";
  3332. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3333. PyObject *__pyx_r = 0;
  3334. __Pyx_RefNannyDeclarations
  3335. __Pyx_RefNannySetupContext("get_graph_class (wrapper)", 0);
  3336. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3337. /* function exit code */
  3338. __Pyx_RefNannyFinishContext();
  3339. return __pyx_r;
  3340. }
  3341. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_14get_graph_class(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3342. PyObject *__pyx_r = NULL;
  3343. __Pyx_RefNannyDeclarations
  3344. size_t __pyx_t_1;
  3345. std::string __pyx_t_2;
  3346. PyObject *__pyx_t_3 = NULL;
  3347. __Pyx_RefNannySetupContext("get_graph_class", 0);
  3348. /* "gedlibpy.pyx":272
  3349. * .. note:: An empty string can be a class.
  3350. * """
  3351. * return self.c_env.getGraphClass(id) # <<<<<<<<<<<<<<
  3352. *
  3353. *
  3354. */
  3355. __Pyx_XDECREF(__pyx_r);
  3356. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 272, __pyx_L1_error)
  3357. try {
  3358. __pyx_t_2 = __pyx_v_self->c_env->getGraphClass(__pyx_t_1);
  3359. } catch(...) {
  3360. __Pyx_CppExn2PyErr();
  3361. __PYX_ERR(0, 272, __pyx_L1_error)
  3362. }
  3363. __pyx_t_3 = __pyx_convert_PyBytes_string_to_py_std__in_string(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 272, __pyx_L1_error)
  3364. __Pyx_GOTREF(__pyx_t_3);
  3365. __pyx_r = __pyx_t_3;
  3366. __pyx_t_3 = 0;
  3367. goto __pyx_L0;
  3368. /* "gedlibpy.pyx":260
  3369. *
  3370. *
  3371. * def get_graph_class(self, id) : # <<<<<<<<<<<<<<
  3372. * """
  3373. * Returns the class of a graph with its ID.
  3374. */
  3375. /* function exit code */
  3376. __pyx_L1_error:;
  3377. __Pyx_XDECREF(__pyx_t_3);
  3378. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_class", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3379. __pyx_r = NULL;
  3380. __pyx_L0:;
  3381. __Pyx_XGIVEREF(__pyx_r);
  3382. __Pyx_RefNannyFinishContext();
  3383. return __pyx_r;
  3384. }
  3385. /* "gedlibpy.pyx":275
  3386. *
  3387. *
  3388. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3389. * """
  3390. * Returns the name of a graph with its ID.
  3391. */
  3392. /* Python wrapper */
  3393. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id); /*proto*/
  3394. 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";
  3395. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name(PyObject *__pyx_v_self, PyObject *__pyx_v_id) {
  3396. PyObject *__pyx_r = 0;
  3397. __Pyx_RefNannyDeclarations
  3398. __Pyx_RefNannySetupContext("get_graph_name (wrapper)", 0);
  3399. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_id));
  3400. /* function exit code */
  3401. __Pyx_RefNannyFinishContext();
  3402. return __pyx_r;
  3403. }
  3404. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_16get_graph_name(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_id) {
  3405. PyObject *__pyx_r = NULL;
  3406. __Pyx_RefNannyDeclarations
  3407. size_t __pyx_t_1;
  3408. std::string __pyx_t_2;
  3409. PyObject *__pyx_t_3 = NULL;
  3410. __Pyx_RefNannySetupContext("get_graph_name", 0);
  3411. /* "gedlibpy.pyx":287
  3412. * .. note:: An empty string can be a name.
  3413. * """
  3414. * return self.c_env.getGraphName(id).decode('utf-8') # <<<<<<<<<<<<<<
  3415. *
  3416. *
  3417. */
  3418. __Pyx_XDECREF(__pyx_r);
  3419. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_id); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 287, __pyx_L1_error)
  3420. try {
  3421. __pyx_t_2 = __pyx_v_self->c_env->getGraphName(__pyx_t_1);
  3422. } catch(...) {
  3423. __Pyx_CppExn2PyErr();
  3424. __PYX_ERR(0, 287, __pyx_L1_error)
  3425. }
  3426. __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, 287, __pyx_L1_error)
  3427. __Pyx_GOTREF(__pyx_t_3);
  3428. __pyx_r = __pyx_t_3;
  3429. __pyx_t_3 = 0;
  3430. goto __pyx_L0;
  3431. /* "gedlibpy.pyx":275
  3432. *
  3433. *
  3434. * def get_graph_name(self, id) : # <<<<<<<<<<<<<<
  3435. * """
  3436. * Returns the name of a graph with its ID.
  3437. */
  3438. /* function exit code */
  3439. __pyx_L1_error:;
  3440. __Pyx_XDECREF(__pyx_t_3);
  3441. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_name", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3442. __pyx_r = NULL;
  3443. __pyx_L0:;
  3444. __Pyx_XGIVEREF(__pyx_r);
  3445. __Pyx_RefNannyFinishContext();
  3446. return __pyx_r;
  3447. }
  3448. /* "gedlibpy.pyx":290
  3449. *
  3450. *
  3451. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3452. * """
  3453. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3454. */
  3455. /* Python wrapper */
  3456. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3457. 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";
  3458. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_19add_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3459. PyObject *__pyx_v_name = 0;
  3460. PyObject *__pyx_v_classe = 0;
  3461. PyObject *__pyx_r = 0;
  3462. __Pyx_RefNannyDeclarations
  3463. __Pyx_RefNannySetupContext("add_graph (wrapper)", 0);
  3464. {
  3465. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,&__pyx_n_s_classe,0};
  3466. PyObject* values[2] = {0,0};
  3467. values[0] = ((PyObject *)__pyx_kp_u_);
  3468. values[1] = ((PyObject *)__pyx_kp_u_);
  3469. if (unlikely(__pyx_kwds)) {
  3470. Py_ssize_t kw_args;
  3471. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3472. switch (pos_args) {
  3473. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3474. CYTHON_FALLTHROUGH;
  3475. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3476. CYTHON_FALLTHROUGH;
  3477. case 0: break;
  3478. default: goto __pyx_L5_argtuple_error;
  3479. }
  3480. kw_args = PyDict_Size(__pyx_kwds);
  3481. switch (pos_args) {
  3482. case 0:
  3483. if (kw_args > 0) {
  3484. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
  3485. if (value) { values[0] = value; kw_args--; }
  3486. }
  3487. CYTHON_FALLTHROUGH;
  3488. case 1:
  3489. if (kw_args > 0) {
  3490. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe);
  3491. if (value) { values[1] = value; kw_args--; }
  3492. }
  3493. }
  3494. if (unlikely(kw_args > 0)) {
  3495. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_graph") < 0)) __PYX_ERR(0, 290, __pyx_L3_error)
  3496. }
  3497. } else {
  3498. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3499. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3500. CYTHON_FALLTHROUGH;
  3501. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3502. CYTHON_FALLTHROUGH;
  3503. case 0: break;
  3504. default: goto __pyx_L5_argtuple_error;
  3505. }
  3506. }
  3507. __pyx_v_name = values[0];
  3508. __pyx_v_classe = values[1];
  3509. }
  3510. goto __pyx_L4_argument_unpacking_done;
  3511. __pyx_L5_argtuple_error:;
  3512. __Pyx_RaiseArgtupleInvalid("add_graph", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 290, __pyx_L3_error)
  3513. __pyx_L3_error:;
  3514. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3515. __Pyx_RefNannyFinishContext();
  3516. return NULL;
  3517. __pyx_L4_argument_unpacking_done:;
  3518. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_18add_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_name, __pyx_v_classe);
  3519. /* function exit code */
  3520. __Pyx_RefNannyFinishContext();
  3521. return __pyx_r;
  3522. }
  3523. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_18add_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_classe) {
  3524. PyObject *__pyx_r = NULL;
  3525. __Pyx_RefNannyDeclarations
  3526. PyObject *__pyx_t_1 = NULL;
  3527. PyObject *__pyx_t_2 = NULL;
  3528. PyObject *__pyx_t_3 = NULL;
  3529. std::string __pyx_t_4;
  3530. std::string __pyx_t_5;
  3531. size_t __pyx_t_6;
  3532. __Pyx_RefNannySetupContext("add_graph", 0);
  3533. /* "gedlibpy.pyx":304
  3534. * .. note:: You can call this function without parameters. You can also use this function after initialization, call init() after you're finished your modifications.
  3535. * """
  3536. * return self.c_env.addGraph(name.encode('utf-8'), classe.encode('utf-8')) # <<<<<<<<<<<<<<
  3537. *
  3538. *
  3539. */
  3540. __Pyx_XDECREF(__pyx_r);
  3541. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_name, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
  3542. __Pyx_GOTREF(__pyx_t_2);
  3543. __pyx_t_3 = NULL;
  3544. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3545. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3546. if (likely(__pyx_t_3)) {
  3547. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3548. __Pyx_INCREF(__pyx_t_3);
  3549. __Pyx_INCREF(function);
  3550. __Pyx_DECREF_SET(__pyx_t_2, function);
  3551. }
  3552. }
  3553. __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);
  3554. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3555. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3556. __Pyx_GOTREF(__pyx_t_1);
  3557. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3558. __pyx_t_4 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error)
  3559. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3560. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_classe, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 304, __pyx_L1_error)
  3561. __Pyx_GOTREF(__pyx_t_2);
  3562. __pyx_t_3 = NULL;
  3563. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  3564. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  3565. if (likely(__pyx_t_3)) {
  3566. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  3567. __Pyx_INCREF(__pyx_t_3);
  3568. __Pyx_INCREF(function);
  3569. __Pyx_DECREF_SET(__pyx_t_2, function);
  3570. }
  3571. }
  3572. __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);
  3573. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  3574. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3575. __Pyx_GOTREF(__pyx_t_1);
  3576. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3577. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 304, __pyx_L1_error)
  3578. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  3579. try {
  3580. __pyx_t_6 = __pyx_v_self->c_env->addGraph(__pyx_t_4, __pyx_t_5);
  3581. } catch(...) {
  3582. __Pyx_CppExn2PyErr();
  3583. __PYX_ERR(0, 304, __pyx_L1_error)
  3584. }
  3585. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 304, __pyx_L1_error)
  3586. __Pyx_GOTREF(__pyx_t_1);
  3587. __pyx_r = __pyx_t_1;
  3588. __pyx_t_1 = 0;
  3589. goto __pyx_L0;
  3590. /* "gedlibpy.pyx":290
  3591. *
  3592. *
  3593. * def add_graph(self, name="", classe="") : # <<<<<<<<<<<<<<
  3594. * """
  3595. * Adds a empty graph on the environment, with its name and its class. Nodes and edges will be add in a second time.
  3596. */
  3597. /* function exit code */
  3598. __pyx_L1_error:;
  3599. __Pyx_XDECREF(__pyx_t_1);
  3600. __Pyx_XDECREF(__pyx_t_2);
  3601. __Pyx_XDECREF(__pyx_t_3);
  3602. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3603. __pyx_r = NULL;
  3604. __pyx_L0:;
  3605. __Pyx_XGIVEREF(__pyx_r);
  3606. __Pyx_RefNannyFinishContext();
  3607. return __pyx_r;
  3608. }
  3609. /* "gedlibpy.pyx":307
  3610. *
  3611. *
  3612. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3613. * """
  3614. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3615. */
  3616. /* Python wrapper */
  3617. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3618. 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";
  3619. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_21add_node(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3620. PyObject *__pyx_v_graph_id = 0;
  3621. PyObject *__pyx_v_node_id = 0;
  3622. PyObject *__pyx_v_node_label = 0;
  3623. PyObject *__pyx_r = 0;
  3624. __Pyx_RefNannyDeclarations
  3625. __Pyx_RefNannySetupContext("add_node (wrapper)", 0);
  3626. {
  3627. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_node_id,&__pyx_n_s_node_label,0};
  3628. PyObject* values[3] = {0,0,0};
  3629. if (unlikely(__pyx_kwds)) {
  3630. Py_ssize_t kw_args;
  3631. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3632. switch (pos_args) {
  3633. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3634. CYTHON_FALLTHROUGH;
  3635. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3636. CYTHON_FALLTHROUGH;
  3637. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3638. CYTHON_FALLTHROUGH;
  3639. case 0: break;
  3640. default: goto __pyx_L5_argtuple_error;
  3641. }
  3642. kw_args = PyDict_Size(__pyx_kwds);
  3643. switch (pos_args) {
  3644. case 0:
  3645. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3646. else goto __pyx_L5_argtuple_error;
  3647. CYTHON_FALLTHROUGH;
  3648. case 1:
  3649. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  3650. else {
  3651. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 1); __PYX_ERR(0, 307, __pyx_L3_error)
  3652. }
  3653. CYTHON_FALLTHROUGH;
  3654. case 2:
  3655. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label)) != 0)) kw_args--;
  3656. else {
  3657. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, 2); __PYX_ERR(0, 307, __pyx_L3_error)
  3658. }
  3659. }
  3660. if (unlikely(kw_args > 0)) {
  3661. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_node") < 0)) __PYX_ERR(0, 307, __pyx_L3_error)
  3662. }
  3663. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  3664. goto __pyx_L5_argtuple_error;
  3665. } else {
  3666. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3667. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3668. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3669. }
  3670. __pyx_v_graph_id = values[0];
  3671. __pyx_v_node_id = values[1];
  3672. __pyx_v_node_label = values[2];
  3673. }
  3674. goto __pyx_L4_argument_unpacking_done;
  3675. __pyx_L5_argtuple_error:;
  3676. __Pyx_RaiseArgtupleInvalid("add_node", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 307, __pyx_L3_error)
  3677. __pyx_L3_error:;
  3678. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3679. __Pyx_RefNannyFinishContext();
  3680. return NULL;
  3681. __pyx_L4_argument_unpacking_done:;
  3682. __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);
  3683. /* function exit code */
  3684. __Pyx_RefNannyFinishContext();
  3685. return __pyx_r;
  3686. }
  3687. 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) {
  3688. PyObject *__pyx_r = NULL;
  3689. __Pyx_RefNannyDeclarations
  3690. size_t __pyx_t_1;
  3691. PyObject *__pyx_t_2 = NULL;
  3692. PyObject *__pyx_t_3 = NULL;
  3693. PyObject *__pyx_t_4 = NULL;
  3694. std::string __pyx_t_5;
  3695. std::map<std::string,std::string> __pyx_t_6;
  3696. __Pyx_RefNannySetupContext("add_node", 0);
  3697. /* "gedlibpy.pyx":321
  3698. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3699. * """
  3700. * self.c_env.addNode(graph_id, node_id.encode('utf-8'), encode_your_map(node_label)) # <<<<<<<<<<<<<<
  3701. *
  3702. *
  3703. */
  3704. __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, 321, __pyx_L1_error)
  3705. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_id, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
  3706. __Pyx_GOTREF(__pyx_t_3);
  3707. __pyx_t_4 = NULL;
  3708. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3709. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3710. if (likely(__pyx_t_4)) {
  3711. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3712. __Pyx_INCREF(__pyx_t_4);
  3713. __Pyx_INCREF(function);
  3714. __Pyx_DECREF_SET(__pyx_t_3, function);
  3715. }
  3716. }
  3717. __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);
  3718. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3719. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
  3720. __Pyx_GOTREF(__pyx_t_2);
  3721. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3722. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 321, __pyx_L1_error)
  3723. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3724. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
  3725. __Pyx_GOTREF(__pyx_t_3);
  3726. __pyx_t_4 = NULL;
  3727. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3728. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3729. if (likely(__pyx_t_4)) {
  3730. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3731. __Pyx_INCREF(__pyx_t_4);
  3732. __Pyx_INCREF(function);
  3733. __Pyx_DECREF_SET(__pyx_t_3, function);
  3734. }
  3735. }
  3736. __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);
  3737. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3738. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
  3739. __Pyx_GOTREF(__pyx_t_2);
  3740. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3741. __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, 321, __pyx_L1_error)
  3742. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3743. try {
  3744. __pyx_v_self->c_env->addNode(__pyx_t_1, __pyx_t_5, __pyx_t_6);
  3745. } catch(...) {
  3746. __Pyx_CppExn2PyErr();
  3747. __PYX_ERR(0, 321, __pyx_L1_error)
  3748. }
  3749. /* "gedlibpy.pyx":307
  3750. *
  3751. *
  3752. * def add_node(self, graph_id, node_id, node_label): # <<<<<<<<<<<<<<
  3753. * """
  3754. * Adds a node on a graph selected by its ID. A ID and a label for the node is required.
  3755. */
  3756. /* function exit code */
  3757. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3758. goto __pyx_L0;
  3759. __pyx_L1_error:;
  3760. __Pyx_XDECREF(__pyx_t_2);
  3761. __Pyx_XDECREF(__pyx_t_3);
  3762. __Pyx_XDECREF(__pyx_t_4);
  3763. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_node", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3764. __pyx_r = NULL;
  3765. __pyx_L0:;
  3766. __Pyx_XGIVEREF(__pyx_r);
  3767. __Pyx_RefNannyFinishContext();
  3768. return __pyx_r;
  3769. }
  3770. /* "gedlibpy.pyx":324
  3771. *
  3772. *
  3773. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3774. * """
  3775. * Adds an edge on a graph selected by its ID.
  3776. */
  3777. /* Python wrapper */
  3778. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3779. 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";
  3780. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_23add_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3781. PyObject *__pyx_v_graph_id = 0;
  3782. PyObject *__pyx_v_tail = 0;
  3783. PyObject *__pyx_v_head = 0;
  3784. PyObject *__pyx_v_edge_label = 0;
  3785. PyObject *__pyx_v_ignore_duplicates = 0;
  3786. PyObject *__pyx_r = 0;
  3787. __Pyx_RefNannyDeclarations
  3788. __Pyx_RefNannySetupContext("add_edge (wrapper)", 0);
  3789. {
  3790. 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};
  3791. PyObject* values[5] = {0,0,0,0,0};
  3792. values[4] = ((PyObject *)Py_True);
  3793. if (unlikely(__pyx_kwds)) {
  3794. Py_ssize_t kw_args;
  3795. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  3796. switch (pos_args) {
  3797. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3798. CYTHON_FALLTHROUGH;
  3799. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3800. CYTHON_FALLTHROUGH;
  3801. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3802. CYTHON_FALLTHROUGH;
  3803. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3804. CYTHON_FALLTHROUGH;
  3805. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3806. CYTHON_FALLTHROUGH;
  3807. case 0: break;
  3808. default: goto __pyx_L5_argtuple_error;
  3809. }
  3810. kw_args = PyDict_Size(__pyx_kwds);
  3811. switch (pos_args) {
  3812. case 0:
  3813. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  3814. else goto __pyx_L5_argtuple_error;
  3815. CYTHON_FALLTHROUGH;
  3816. case 1:
  3817. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  3818. else {
  3819. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 1); __PYX_ERR(0, 324, __pyx_L3_error)
  3820. }
  3821. CYTHON_FALLTHROUGH;
  3822. case 2:
  3823. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  3824. else {
  3825. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 2); __PYX_ERR(0, 324, __pyx_L3_error)
  3826. }
  3827. CYTHON_FALLTHROUGH;
  3828. case 3:
  3829. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  3830. else {
  3831. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, 3); __PYX_ERR(0, 324, __pyx_L3_error)
  3832. }
  3833. CYTHON_FALLTHROUGH;
  3834. case 4:
  3835. if (kw_args > 0) {
  3836. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  3837. if (value) { values[4] = value; kw_args--; }
  3838. }
  3839. }
  3840. if (unlikely(kw_args > 0)) {
  3841. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_edge") < 0)) __PYX_ERR(0, 324, __pyx_L3_error)
  3842. }
  3843. } else {
  3844. switch (PyTuple_GET_SIZE(__pyx_args)) {
  3845. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  3846. CYTHON_FALLTHROUGH;
  3847. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  3848. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  3849. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  3850. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  3851. break;
  3852. default: goto __pyx_L5_argtuple_error;
  3853. }
  3854. }
  3855. __pyx_v_graph_id = values[0];
  3856. __pyx_v_tail = values[1];
  3857. __pyx_v_head = values[2];
  3858. __pyx_v_edge_label = values[3];
  3859. __pyx_v_ignore_duplicates = values[4];
  3860. }
  3861. goto __pyx_L4_argument_unpacking_done;
  3862. __pyx_L5_argtuple_error:;
  3863. __Pyx_RaiseArgtupleInvalid("add_edge", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 324, __pyx_L3_error)
  3864. __pyx_L3_error:;
  3865. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3866. __Pyx_RefNannyFinishContext();
  3867. return NULL;
  3868. __pyx_L4_argument_unpacking_done:;
  3869. __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);
  3870. /* function exit code */
  3871. __Pyx_RefNannyFinishContext();
  3872. return __pyx_r;
  3873. }
  3874. 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) {
  3875. PyObject *__pyx_r = NULL;
  3876. __Pyx_RefNannyDeclarations
  3877. size_t __pyx_t_1;
  3878. PyObject *__pyx_t_2 = NULL;
  3879. PyObject *__pyx_t_3 = NULL;
  3880. PyObject *__pyx_t_4 = NULL;
  3881. std::string __pyx_t_5;
  3882. std::string __pyx_t_6;
  3883. std::map<std::string,std::string> __pyx_t_7;
  3884. bool __pyx_t_8;
  3885. __Pyx_RefNannySetupContext("add_edge", 0);
  3886. /* "gedlibpy.pyx":342
  3887. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  3888. * """
  3889. * self.c_env.addEdge(graph_id, tail.encode('utf-8'), head.encode('utf-8'), encode_your_map(edge_label), ignore_duplicates) # <<<<<<<<<<<<<<
  3890. *
  3891. *
  3892. */
  3893. __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, 342, __pyx_L1_error)
  3894. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
  3895. __Pyx_GOTREF(__pyx_t_3);
  3896. __pyx_t_4 = NULL;
  3897. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3898. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3899. if (likely(__pyx_t_4)) {
  3900. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3901. __Pyx_INCREF(__pyx_t_4);
  3902. __Pyx_INCREF(function);
  3903. __Pyx_DECREF_SET(__pyx_t_3, function);
  3904. }
  3905. }
  3906. __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);
  3907. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3908. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3909. __Pyx_GOTREF(__pyx_t_2);
  3910. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3911. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
  3912. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3913. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
  3914. __Pyx_GOTREF(__pyx_t_3);
  3915. __pyx_t_4 = NULL;
  3916. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  3917. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3918. if (likely(__pyx_t_4)) {
  3919. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3920. __Pyx_INCREF(__pyx_t_4);
  3921. __Pyx_INCREF(function);
  3922. __Pyx_DECREF_SET(__pyx_t_3, function);
  3923. }
  3924. }
  3925. __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);
  3926. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3927. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3928. __Pyx_GOTREF(__pyx_t_2);
  3929. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3930. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
  3931. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3932. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
  3933. __Pyx_GOTREF(__pyx_t_3);
  3934. __pyx_t_4 = NULL;
  3935. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  3936. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
  3937. if (likely(__pyx_t_4)) {
  3938. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  3939. __Pyx_INCREF(__pyx_t_4);
  3940. __Pyx_INCREF(function);
  3941. __Pyx_DECREF_SET(__pyx_t_3, function);
  3942. }
  3943. }
  3944. __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);
  3945. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  3946. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
  3947. __Pyx_GOTREF(__pyx_t_2);
  3948. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  3949. __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, 342, __pyx_L1_error)
  3950. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  3951. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_duplicates); if (unlikely((__pyx_t_8 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 342, __pyx_L1_error)
  3952. try {
  3953. __pyx_v_self->c_env->addEdge(__pyx_t_1, __pyx_t_5, __pyx_t_6, __pyx_t_7, __pyx_t_8);
  3954. } catch(...) {
  3955. __Pyx_CppExn2PyErr();
  3956. __PYX_ERR(0, 342, __pyx_L1_error)
  3957. }
  3958. /* "gedlibpy.pyx":324
  3959. *
  3960. *
  3961. * def add_edge(self, graph_id, tail, head, edge_label, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  3962. * """
  3963. * Adds an edge on a graph selected by its ID.
  3964. */
  3965. /* function exit code */
  3966. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  3967. goto __pyx_L0;
  3968. __pyx_L1_error:;
  3969. __Pyx_XDECREF(__pyx_t_2);
  3970. __Pyx_XDECREF(__pyx_t_3);
  3971. __Pyx_XDECREF(__pyx_t_4);
  3972. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  3973. __pyx_r = NULL;
  3974. __pyx_L0:;
  3975. __Pyx_XGIVEREF(__pyx_r);
  3976. __Pyx_RefNannyFinishContext();
  3977. return __pyx_r;
  3978. }
  3979. /* "gedlibpy.pyx":345
  3980. *
  3981. *
  3982. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  3983. * """
  3984. * Adds a symmetrical edge on a graph selected by its ID.
  3985. */
  3986. /* Python wrapper */
  3987. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  3988. 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";
  3989. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  3990. PyObject *__pyx_v_graph_id = 0;
  3991. PyObject *__pyx_v_tail = 0;
  3992. PyObject *__pyx_v_head = 0;
  3993. PyObject *__pyx_v_edge_label = 0;
  3994. PyObject *__pyx_r = 0;
  3995. __Pyx_RefNannyDeclarations
  3996. __Pyx_RefNannySetupContext("add_symmetrical_edge (wrapper)", 0);
  3997. {
  3998. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_graph_id,&__pyx_n_s_tail,&__pyx_n_s_head,&__pyx_n_s_edge_label,0};
  3999. PyObject* values[4] = {0,0,0,0};
  4000. if (unlikely(__pyx_kwds)) {
  4001. Py_ssize_t kw_args;
  4002. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4003. switch (pos_args) {
  4004. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4005. CYTHON_FALLTHROUGH;
  4006. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4007. CYTHON_FALLTHROUGH;
  4008. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4009. CYTHON_FALLTHROUGH;
  4010. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4011. CYTHON_FALLTHROUGH;
  4012. case 0: break;
  4013. default: goto __pyx_L5_argtuple_error;
  4014. }
  4015. kw_args = PyDict_Size(__pyx_kwds);
  4016. switch (pos_args) {
  4017. case 0:
  4018. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  4019. else goto __pyx_L5_argtuple_error;
  4020. CYTHON_FALLTHROUGH;
  4021. case 1:
  4022. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tail)) != 0)) kw_args--;
  4023. else {
  4024. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 1); __PYX_ERR(0, 345, __pyx_L3_error)
  4025. }
  4026. CYTHON_FALLTHROUGH;
  4027. case 2:
  4028. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_head)) != 0)) kw_args--;
  4029. else {
  4030. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 2); __PYX_ERR(0, 345, __pyx_L3_error)
  4031. }
  4032. CYTHON_FALLTHROUGH;
  4033. case 3:
  4034. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label)) != 0)) kw_args--;
  4035. else {
  4036. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, 3); __PYX_ERR(0, 345, __pyx_L3_error)
  4037. }
  4038. }
  4039. if (unlikely(kw_args > 0)) {
  4040. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_symmetrical_edge") < 0)) __PYX_ERR(0, 345, __pyx_L3_error)
  4041. }
  4042. } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
  4043. goto __pyx_L5_argtuple_error;
  4044. } else {
  4045. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4046. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4047. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  4048. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  4049. }
  4050. __pyx_v_graph_id = values[0];
  4051. __pyx_v_tail = values[1];
  4052. __pyx_v_head = values[2];
  4053. __pyx_v_edge_label = values[3];
  4054. }
  4055. goto __pyx_L4_argument_unpacking_done;
  4056. __pyx_L5_argtuple_error:;
  4057. __Pyx_RaiseArgtupleInvalid("add_symmetrical_edge", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 345, __pyx_L3_error)
  4058. __pyx_L3_error:;
  4059. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4060. __Pyx_RefNannyFinishContext();
  4061. return NULL;
  4062. __pyx_L4_argument_unpacking_done:;
  4063. __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);
  4064. /* function exit code */
  4065. __Pyx_RefNannyFinishContext();
  4066. return __pyx_r;
  4067. }
  4068. 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) {
  4069. PyObject *__pyx_v_tailB = NULL;
  4070. PyObject *__pyx_v_headB = NULL;
  4071. PyObject *__pyx_v_edgeLabelB = NULL;
  4072. PyObject *__pyx_r = NULL;
  4073. __Pyx_RefNannyDeclarations
  4074. PyObject *__pyx_t_1 = NULL;
  4075. PyObject *__pyx_t_2 = NULL;
  4076. PyObject *__pyx_t_3 = NULL;
  4077. size_t __pyx_t_4;
  4078. std::string __pyx_t_5;
  4079. std::string __pyx_t_6;
  4080. std::map<std::string,std::string> __pyx_t_7;
  4081. __Pyx_RefNannySetupContext("add_symmetrical_edge", 0);
  4082. /* "gedlibpy.pyx":361
  4083. * .. note:: You can also use this function after initialization, but only on a newly added graph. Call init() after you're finished your modifications.
  4084. * """
  4085. * tailB = tail.encode('utf-8') # <<<<<<<<<<<<<<
  4086. * headB = head.encode('utf-8')
  4087. * edgeLabelB = encode_your_map(edge_label)
  4088. */
  4089. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_tail, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 361, __pyx_L1_error)
  4090. __Pyx_GOTREF(__pyx_t_2);
  4091. __pyx_t_3 = NULL;
  4092. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4093. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4094. if (likely(__pyx_t_3)) {
  4095. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4096. __Pyx_INCREF(__pyx_t_3);
  4097. __Pyx_INCREF(function);
  4098. __Pyx_DECREF_SET(__pyx_t_2, function);
  4099. }
  4100. }
  4101. __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);
  4102. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4103. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 361, __pyx_L1_error)
  4104. __Pyx_GOTREF(__pyx_t_1);
  4105. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4106. __pyx_v_tailB = __pyx_t_1;
  4107. __pyx_t_1 = 0;
  4108. /* "gedlibpy.pyx":362
  4109. * """
  4110. * tailB = tail.encode('utf-8')
  4111. * headB = head.encode('utf-8') # <<<<<<<<<<<<<<
  4112. * edgeLabelB = encode_your_map(edge_label)
  4113. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4114. */
  4115. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_head, __pyx_n_s_encode); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 362, __pyx_L1_error)
  4116. __Pyx_GOTREF(__pyx_t_2);
  4117. __pyx_t_3 = NULL;
  4118. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  4119. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4120. if (likely(__pyx_t_3)) {
  4121. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4122. __Pyx_INCREF(__pyx_t_3);
  4123. __Pyx_INCREF(function);
  4124. __Pyx_DECREF_SET(__pyx_t_2, function);
  4125. }
  4126. }
  4127. __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);
  4128. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4129. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 362, __pyx_L1_error)
  4130. __Pyx_GOTREF(__pyx_t_1);
  4131. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4132. __pyx_v_headB = __pyx_t_1;
  4133. __pyx_t_1 = 0;
  4134. /* "gedlibpy.pyx":363
  4135. * tailB = tail.encode('utf-8')
  4136. * headB = head.encode('utf-8')
  4137. * edgeLabelB = encode_your_map(edge_label) # <<<<<<<<<<<<<<
  4138. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4139. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4140. */
  4141. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 363, __pyx_L1_error)
  4142. __Pyx_GOTREF(__pyx_t_2);
  4143. __pyx_t_3 = NULL;
  4144. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4145. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  4146. if (likely(__pyx_t_3)) {
  4147. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4148. __Pyx_INCREF(__pyx_t_3);
  4149. __Pyx_INCREF(function);
  4150. __Pyx_DECREF_SET(__pyx_t_2, function);
  4151. }
  4152. }
  4153. __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);
  4154. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  4155. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
  4156. __Pyx_GOTREF(__pyx_t_1);
  4157. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4158. __pyx_v_edgeLabelB = __pyx_t_1;
  4159. __pyx_t_1 = 0;
  4160. /* "gedlibpy.pyx":364
  4161. * headB = head.encode('utf-8')
  4162. * edgeLabelB = encode_your_map(edge_label)
  4163. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4164. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True)
  4165. *
  4166. */
  4167. __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, 364, __pyx_L1_error)
  4168. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error)
  4169. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 364, __pyx_L1_error)
  4170. __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, 364, __pyx_L1_error)
  4171. try {
  4172. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_5, __pyx_t_6, __pyx_t_7, 1);
  4173. } catch(...) {
  4174. __Pyx_CppExn2PyErr();
  4175. __PYX_ERR(0, 364, __pyx_L1_error)
  4176. }
  4177. /* "gedlibpy.pyx":365
  4178. * edgeLabelB = encode_your_map(edge_label)
  4179. * self.c_env.addEdge(graph_id, tailB, headB, edgeLabelB, True)
  4180. * self.c_env.addEdge(graph_id, headB, tailB, edgeLabelB, True) # <<<<<<<<<<<<<<
  4181. *
  4182. *
  4183. */
  4184. __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, 365, __pyx_L1_error)
  4185. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_headB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
  4186. __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_v_tailB); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 365, __pyx_L1_error)
  4187. __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, 365, __pyx_L1_error)
  4188. try {
  4189. __pyx_v_self->c_env->addEdge(__pyx_t_4, __pyx_t_6, __pyx_t_5, __pyx_t_7, 1);
  4190. } catch(...) {
  4191. __Pyx_CppExn2PyErr();
  4192. __PYX_ERR(0, 365, __pyx_L1_error)
  4193. }
  4194. /* "gedlibpy.pyx":345
  4195. *
  4196. *
  4197. * def add_symmetrical_edge(self, graph_id, tail, head, edge_label) : # <<<<<<<<<<<<<<
  4198. * """
  4199. * Adds a symmetrical edge on a graph selected by its ID.
  4200. */
  4201. /* function exit code */
  4202. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4203. goto __pyx_L0;
  4204. __pyx_L1_error:;
  4205. __Pyx_XDECREF(__pyx_t_1);
  4206. __Pyx_XDECREF(__pyx_t_2);
  4207. __Pyx_XDECREF(__pyx_t_3);
  4208. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_symmetrical_edge", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4209. __pyx_r = NULL;
  4210. __pyx_L0:;
  4211. __Pyx_XDECREF(__pyx_v_tailB);
  4212. __Pyx_XDECREF(__pyx_v_headB);
  4213. __Pyx_XDECREF(__pyx_v_edgeLabelB);
  4214. __Pyx_XGIVEREF(__pyx_r);
  4215. __Pyx_RefNannyFinishContext();
  4216. return __pyx_r;
  4217. }
  4218. /* "gedlibpy.pyx":368
  4219. *
  4220. *
  4221. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4222. * """
  4223. * Deletes a graph, selected by its ID, to the environment.
  4224. */
  4225. /* Python wrapper */
  4226. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4227. 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";
  4228. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4229. PyObject *__pyx_r = 0;
  4230. __Pyx_RefNannyDeclarations
  4231. __Pyx_RefNannySetupContext("clear_graph (wrapper)", 0);
  4232. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4233. /* function exit code */
  4234. __Pyx_RefNannyFinishContext();
  4235. return __pyx_r;
  4236. }
  4237. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_26clear_graph(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4238. PyObject *__pyx_r = NULL;
  4239. __Pyx_RefNannyDeclarations
  4240. size_t __pyx_t_1;
  4241. __Pyx_RefNannySetupContext("clear_graph", 0);
  4242. /* "gedlibpy.pyx":377
  4243. * .. note:: Call init() after you're finished your modifications.
  4244. * """
  4245. * self.c_env.clearGraph(graph_id) # <<<<<<<<<<<<<<
  4246. *
  4247. *
  4248. */
  4249. __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, 377, __pyx_L1_error)
  4250. try {
  4251. __pyx_v_self->c_env->clearGraph(__pyx_t_1);
  4252. } catch(...) {
  4253. __Pyx_CppExn2PyErr();
  4254. __PYX_ERR(0, 377, __pyx_L1_error)
  4255. }
  4256. /* "gedlibpy.pyx":368
  4257. *
  4258. *
  4259. * def clear_graph(self, graph_id) : # <<<<<<<<<<<<<<
  4260. * """
  4261. * Deletes a graph, selected by its ID, to the environment.
  4262. */
  4263. /* function exit code */
  4264. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4265. goto __pyx_L0;
  4266. __pyx_L1_error:;
  4267. __Pyx_AddTraceback("gedlibpy.GEDEnv.clear_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4268. __pyx_r = NULL;
  4269. __pyx_L0:;
  4270. __Pyx_XGIVEREF(__pyx_r);
  4271. __Pyx_RefNannyFinishContext();
  4272. return __pyx_r;
  4273. }
  4274. /* "gedlibpy.pyx":380
  4275. *
  4276. *
  4277. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4278. * """
  4279. * Searchs and returns the internal Id of a graph, selected by its ID.
  4280. */
  4281. /* Python wrapper */
  4282. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4283. 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";
  4284. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4285. PyObject *__pyx_r = 0;
  4286. __Pyx_RefNannyDeclarations
  4287. __Pyx_RefNannySetupContext("get_graph_internal_id (wrapper)", 0);
  4288. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4289. /* function exit code */
  4290. __Pyx_RefNannyFinishContext();
  4291. return __pyx_r;
  4292. }
  4293. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_28get_graph_internal_id(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4294. PyObject *__pyx_r = NULL;
  4295. __Pyx_RefNannyDeclarations
  4296. size_t __pyx_t_1;
  4297. size_t __pyx_t_2;
  4298. PyObject *__pyx_t_3 = NULL;
  4299. __Pyx_RefNannySetupContext("get_graph_internal_id", 0);
  4300. /* "gedlibpy.pyx":392
  4301. * .. note:: These functions allow to collect all the graph's informations.
  4302. * """
  4303. * return self.c_env.getGraphInternalId(graph_id) # <<<<<<<<<<<<<<
  4304. *
  4305. *
  4306. */
  4307. __Pyx_XDECREF(__pyx_r);
  4308. __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, 392, __pyx_L1_error)
  4309. try {
  4310. __pyx_t_2 = __pyx_v_self->c_env->getGraphInternalId(__pyx_t_1);
  4311. } catch(...) {
  4312. __Pyx_CppExn2PyErr();
  4313. __PYX_ERR(0, 392, __pyx_L1_error)
  4314. }
  4315. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 392, __pyx_L1_error)
  4316. __Pyx_GOTREF(__pyx_t_3);
  4317. __pyx_r = __pyx_t_3;
  4318. __pyx_t_3 = 0;
  4319. goto __pyx_L0;
  4320. /* "gedlibpy.pyx":380
  4321. *
  4322. *
  4323. * def get_graph_internal_id(self, graph_id) : # <<<<<<<<<<<<<<
  4324. * """
  4325. * Searchs and returns the internal Id of a graph, selected by its ID.
  4326. */
  4327. /* function exit code */
  4328. __pyx_L1_error:;
  4329. __Pyx_XDECREF(__pyx_t_3);
  4330. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_internal_id", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4331. __pyx_r = NULL;
  4332. __pyx_L0:;
  4333. __Pyx_XGIVEREF(__pyx_r);
  4334. __Pyx_RefNannyFinishContext();
  4335. return __pyx_r;
  4336. }
  4337. /* "gedlibpy.pyx":395
  4338. *
  4339. *
  4340. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4341. * """
  4342. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4343. */
  4344. /* Python wrapper */
  4345. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4346. 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";
  4347. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4348. PyObject *__pyx_r = 0;
  4349. __Pyx_RefNannyDeclarations
  4350. __Pyx_RefNannySetupContext("get_graph_num_nodes (wrapper)", 0);
  4351. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4352. /* function exit code */
  4353. __Pyx_RefNannyFinishContext();
  4354. return __pyx_r;
  4355. }
  4356. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_30get_graph_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4357. PyObject *__pyx_r = NULL;
  4358. __Pyx_RefNannyDeclarations
  4359. size_t __pyx_t_1;
  4360. size_t __pyx_t_2;
  4361. PyObject *__pyx_t_3 = NULL;
  4362. __Pyx_RefNannySetupContext("get_graph_num_nodes", 0);
  4363. /* "gedlibpy.pyx":407
  4364. * .. note:: These functions allow to collect all the graph's informations.
  4365. * """
  4366. * return self.c_env.getGraphNumNodes(graph_id) # <<<<<<<<<<<<<<
  4367. *
  4368. *
  4369. */
  4370. __Pyx_XDECREF(__pyx_r);
  4371. __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, 407, __pyx_L1_error)
  4372. try {
  4373. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumNodes(__pyx_t_1);
  4374. } catch(...) {
  4375. __Pyx_CppExn2PyErr();
  4376. __PYX_ERR(0, 407, __pyx_L1_error)
  4377. }
  4378. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 407, __pyx_L1_error)
  4379. __Pyx_GOTREF(__pyx_t_3);
  4380. __pyx_r = __pyx_t_3;
  4381. __pyx_t_3 = 0;
  4382. goto __pyx_L0;
  4383. /* "gedlibpy.pyx":395
  4384. *
  4385. *
  4386. * def get_graph_num_nodes(self, graph_id) : # <<<<<<<<<<<<<<
  4387. * """
  4388. * Searchs and returns the number of nodes on a graph, selected by its ID.
  4389. */
  4390. /* function exit code */
  4391. __pyx_L1_error:;
  4392. __Pyx_XDECREF(__pyx_t_3);
  4393. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4394. __pyx_r = NULL;
  4395. __pyx_L0:;
  4396. __Pyx_XGIVEREF(__pyx_r);
  4397. __Pyx_RefNannyFinishContext();
  4398. return __pyx_r;
  4399. }
  4400. /* "gedlibpy.pyx":410
  4401. *
  4402. *
  4403. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4404. * """
  4405. * Searchs and returns the number of edges on a graph, selected by its ID.
  4406. */
  4407. /* Python wrapper */
  4408. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4409. 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";
  4410. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4411. PyObject *__pyx_r = 0;
  4412. __Pyx_RefNannyDeclarations
  4413. __Pyx_RefNannySetupContext("get_graph_num_edges (wrapper)", 0);
  4414. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4415. /* function exit code */
  4416. __Pyx_RefNannyFinishContext();
  4417. return __pyx_r;
  4418. }
  4419. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_32get_graph_num_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4420. PyObject *__pyx_r = NULL;
  4421. __Pyx_RefNannyDeclarations
  4422. size_t __pyx_t_1;
  4423. size_t __pyx_t_2;
  4424. PyObject *__pyx_t_3 = NULL;
  4425. __Pyx_RefNannySetupContext("get_graph_num_edges", 0);
  4426. /* "gedlibpy.pyx":422
  4427. * .. note:: These functions allow to collect all the graph's informations.
  4428. * """
  4429. * return self.c_env.getGraphNumEdges(graph_id) # <<<<<<<<<<<<<<
  4430. *
  4431. *
  4432. */
  4433. __Pyx_XDECREF(__pyx_r);
  4434. __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, 422, __pyx_L1_error)
  4435. try {
  4436. __pyx_t_2 = __pyx_v_self->c_env->getGraphNumEdges(__pyx_t_1);
  4437. } catch(...) {
  4438. __Pyx_CppExn2PyErr();
  4439. __PYX_ERR(0, 422, __pyx_L1_error)
  4440. }
  4441. __pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 422, __pyx_L1_error)
  4442. __Pyx_GOTREF(__pyx_t_3);
  4443. __pyx_r = __pyx_t_3;
  4444. __pyx_t_3 = 0;
  4445. goto __pyx_L0;
  4446. /* "gedlibpy.pyx":410
  4447. *
  4448. *
  4449. * def get_graph_num_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4450. * """
  4451. * Searchs and returns the number of edges on a graph, selected by its ID.
  4452. */
  4453. /* function exit code */
  4454. __pyx_L1_error:;
  4455. __Pyx_XDECREF(__pyx_t_3);
  4456. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_num_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4457. __pyx_r = NULL;
  4458. __pyx_L0:;
  4459. __Pyx_XGIVEREF(__pyx_r);
  4460. __Pyx_RefNannyFinishContext();
  4461. return __pyx_r;
  4462. }
  4463. /* "gedlibpy.pyx":425
  4464. *
  4465. *
  4466. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4467. * """
  4468. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4469. */
  4470. /* Python wrapper */
  4471. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4472. 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";
  4473. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4474. PyObject *__pyx_r = 0;
  4475. __Pyx_RefNannyDeclarations
  4476. __Pyx_RefNannySetupContext("get_original_node_ids (wrapper)", 0);
  4477. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4478. /* function exit code */
  4479. __Pyx_RefNannyFinishContext();
  4480. return __pyx_r;
  4481. }
  4482. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_34get_original_node_ids(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4483. std::string __pyx_8genexpr3__pyx_v_gid;
  4484. PyObject *__pyx_r = NULL;
  4485. __Pyx_RefNannyDeclarations
  4486. PyObject *__pyx_t_1 = NULL;
  4487. size_t __pyx_t_2;
  4488. std::vector<std::string> __pyx_t_3;
  4489. std::vector<std::string> ::iterator __pyx_t_4;
  4490. std::vector<std::string> *__pyx_t_5;
  4491. std::string __pyx_t_6;
  4492. PyObject *__pyx_t_7 = NULL;
  4493. __Pyx_RefNannySetupContext("get_original_node_ids", 0);
  4494. /* "gedlibpy.pyx":437
  4495. * .. note:: These functions allow to collect all the graph's informations.
  4496. * """
  4497. * return [gid.decode('utf-8') for gid in self.c_env.getGraphOriginalNodeIds(graph_id)] # <<<<<<<<<<<<<<
  4498. *
  4499. *
  4500. */
  4501. __Pyx_XDECREF(__pyx_r);
  4502. { /* enter inner scope */
  4503. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
  4504. __Pyx_GOTREF(__pyx_t_1);
  4505. __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, 437, __pyx_L1_error)
  4506. try {
  4507. __pyx_t_3 = __pyx_v_self->c_env->getGraphOriginalNodeIds(__pyx_t_2);
  4508. } catch(...) {
  4509. __Pyx_CppExn2PyErr();
  4510. __PYX_ERR(0, 437, __pyx_L1_error)
  4511. }
  4512. __pyx_t_5 = &__pyx_t_3;
  4513. __pyx_t_4 = __pyx_t_5->begin();
  4514. for (;;) {
  4515. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4516. __pyx_t_6 = *__pyx_t_4;
  4517. ++__pyx_t_4;
  4518. __pyx_8genexpr3__pyx_v_gid = __pyx_t_6;
  4519. __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, 437, __pyx_L1_error)
  4520. __Pyx_GOTREF(__pyx_t_7);
  4521. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 437, __pyx_L1_error)
  4522. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4523. }
  4524. } /* exit inner scope */
  4525. __pyx_r = __pyx_t_1;
  4526. __pyx_t_1 = 0;
  4527. goto __pyx_L0;
  4528. /* "gedlibpy.pyx":425
  4529. *
  4530. *
  4531. * def get_original_node_ids(self, graph_id) : # <<<<<<<<<<<<<<
  4532. * """
  4533. * Searchs and returns all th Ids of nodes on a graph, selected by its ID.
  4534. */
  4535. /* function exit code */
  4536. __pyx_L1_error:;
  4537. __Pyx_XDECREF(__pyx_t_1);
  4538. __Pyx_XDECREF(__pyx_t_7);
  4539. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_original_node_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4540. __pyx_r = NULL;
  4541. __pyx_L0:;
  4542. __Pyx_XGIVEREF(__pyx_r);
  4543. __Pyx_RefNannyFinishContext();
  4544. return __pyx_r;
  4545. }
  4546. /* "gedlibpy.pyx":440
  4547. *
  4548. *
  4549. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4550. * """
  4551. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4552. */
  4553. /* Python wrapper */
  4554. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4555. 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";
  4556. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4557. PyObject *__pyx_r = 0;
  4558. __Pyx_RefNannyDeclarations
  4559. __Pyx_RefNannySetupContext("get_graph_node_labels (wrapper)", 0);
  4560. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4561. /* function exit code */
  4562. __Pyx_RefNannyFinishContext();
  4563. return __pyx_r;
  4564. }
  4565. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_36get_graph_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4566. std::map<std::string,std::string> __pyx_8genexpr4__pyx_v_node_label;
  4567. PyObject *__pyx_r = NULL;
  4568. __Pyx_RefNannyDeclarations
  4569. PyObject *__pyx_t_1 = NULL;
  4570. size_t __pyx_t_2;
  4571. std::vector<std::map<std::string,std::string> > __pyx_t_3;
  4572. std::vector<std::map<std::string,std::string> > ::iterator __pyx_t_4;
  4573. std::vector<std::map<std::string,std::string> > *__pyx_t_5;
  4574. std::map<std::string,std::string> __pyx_t_6;
  4575. PyObject *__pyx_t_7 = NULL;
  4576. PyObject *__pyx_t_8 = NULL;
  4577. PyObject *__pyx_t_9 = NULL;
  4578. PyObject *__pyx_t_10 = NULL;
  4579. __Pyx_RefNannySetupContext("get_graph_node_labels", 0);
  4580. /* "gedlibpy.pyx":452
  4581. * .. note:: These functions allow to collect all the graph's informations.
  4582. * """
  4583. * return [decode_your_map(node_label) for node_label in self.c_env.getGraphNodeLabels(graph_id)] # <<<<<<<<<<<<<<
  4584. *
  4585. *
  4586. */
  4587. __Pyx_XDECREF(__pyx_r);
  4588. { /* enter inner scope */
  4589. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  4590. __Pyx_GOTREF(__pyx_t_1);
  4591. __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, 452, __pyx_L1_error)
  4592. try {
  4593. __pyx_t_3 = __pyx_v_self->c_env->getGraphNodeLabels(__pyx_t_2);
  4594. } catch(...) {
  4595. __Pyx_CppExn2PyErr();
  4596. __PYX_ERR(0, 452, __pyx_L1_error)
  4597. }
  4598. __pyx_t_5 = &__pyx_t_3;
  4599. __pyx_t_4 = __pyx_t_5->begin();
  4600. for (;;) {
  4601. if (!(__pyx_t_4 != __pyx_t_5->end())) break;
  4602. __pyx_t_6 = *__pyx_t_4;
  4603. ++__pyx_t_4;
  4604. __pyx_8genexpr4__pyx_v_node_label = __pyx_t_6;
  4605. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 452, __pyx_L1_error)
  4606. __Pyx_GOTREF(__pyx_t_8);
  4607. __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, 452, __pyx_L1_error)
  4608. __Pyx_GOTREF(__pyx_t_9);
  4609. __pyx_t_10 = NULL;
  4610. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  4611. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_8);
  4612. if (likely(__pyx_t_10)) {
  4613. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  4614. __Pyx_INCREF(__pyx_t_10);
  4615. __Pyx_INCREF(function);
  4616. __Pyx_DECREF_SET(__pyx_t_8, function);
  4617. }
  4618. }
  4619. __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);
  4620. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  4621. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  4622. if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 452, __pyx_L1_error)
  4623. __Pyx_GOTREF(__pyx_t_7);
  4624. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  4625. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 452, __pyx_L1_error)
  4626. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  4627. }
  4628. } /* exit inner scope */
  4629. __pyx_r = __pyx_t_1;
  4630. __pyx_t_1 = 0;
  4631. goto __pyx_L0;
  4632. /* "gedlibpy.pyx":440
  4633. *
  4634. *
  4635. * def get_graph_node_labels(self, graph_id) : # <<<<<<<<<<<<<<
  4636. * """
  4637. * Searchs and returns all the labels of nodes on a graph, selected by its ID.
  4638. */
  4639. /* function exit code */
  4640. __pyx_L1_error:;
  4641. __Pyx_XDECREF(__pyx_t_1);
  4642. __Pyx_XDECREF(__pyx_t_7);
  4643. __Pyx_XDECREF(__pyx_t_8);
  4644. __Pyx_XDECREF(__pyx_t_9);
  4645. __Pyx_XDECREF(__pyx_t_10);
  4646. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4647. __pyx_r = NULL;
  4648. __pyx_L0:;
  4649. __Pyx_XGIVEREF(__pyx_r);
  4650. __Pyx_RefNannyFinishContext();
  4651. return __pyx_r;
  4652. }
  4653. /* "gedlibpy.pyx":455
  4654. *
  4655. *
  4656. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4657. * """
  4658. * Searchs and returns all the edges on a graph, selected by its ID.
  4659. */
  4660. /* Python wrapper */
  4661. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4662. 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";
  4663. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4664. PyObject *__pyx_r = 0;
  4665. __Pyx_RefNannyDeclarations
  4666. __Pyx_RefNannySetupContext("get_graph_edges (wrapper)", 0);
  4667. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4668. /* function exit code */
  4669. __Pyx_RefNannyFinishContext();
  4670. return __pyx_r;
  4671. }
  4672. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_38get_graph_edges(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4673. PyObject *__pyx_r = NULL;
  4674. __Pyx_RefNannyDeclarations
  4675. PyObject *__pyx_t_1 = NULL;
  4676. PyObject *__pyx_t_2 = NULL;
  4677. size_t __pyx_t_3;
  4678. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > __pyx_t_4;
  4679. PyObject *__pyx_t_5 = NULL;
  4680. PyObject *__pyx_t_6 = NULL;
  4681. __Pyx_RefNannySetupContext("get_graph_edges", 0);
  4682. /* "gedlibpy.pyx":467
  4683. * .. note:: These functions allow to collect all the graph's informations.
  4684. * """
  4685. * return decode_graph_edges(self.c_env.getGraphEdges(graph_id)) # <<<<<<<<<<<<<<
  4686. *
  4687. *
  4688. */
  4689. __Pyx_XDECREF(__pyx_r);
  4690. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_graph_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
  4691. __Pyx_GOTREF(__pyx_t_2);
  4692. __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, 467, __pyx_L1_error)
  4693. try {
  4694. __pyx_t_4 = __pyx_v_self->c_env->getGraphEdges(__pyx_t_3);
  4695. } catch(...) {
  4696. __Pyx_CppExn2PyErr();
  4697. __PYX_ERR(0, 467, __pyx_L1_error)
  4698. }
  4699. __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, 467, __pyx_L1_error)
  4700. __Pyx_GOTREF(__pyx_t_5);
  4701. __pyx_t_6 = NULL;
  4702. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  4703. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  4704. if (likely(__pyx_t_6)) {
  4705. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  4706. __Pyx_INCREF(__pyx_t_6);
  4707. __Pyx_INCREF(function);
  4708. __Pyx_DECREF_SET(__pyx_t_2, function);
  4709. }
  4710. }
  4711. __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);
  4712. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  4713. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  4714. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 467, __pyx_L1_error)
  4715. __Pyx_GOTREF(__pyx_t_1);
  4716. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  4717. __pyx_r = __pyx_t_1;
  4718. __pyx_t_1 = 0;
  4719. goto __pyx_L0;
  4720. /* "gedlibpy.pyx":455
  4721. *
  4722. *
  4723. * def get_graph_edges(self, graph_id) : # <<<<<<<<<<<<<<
  4724. * """
  4725. * Searchs and returns all the edges on a graph, selected by its ID.
  4726. */
  4727. /* function exit code */
  4728. __pyx_L1_error:;
  4729. __Pyx_XDECREF(__pyx_t_1);
  4730. __Pyx_XDECREF(__pyx_t_2);
  4731. __Pyx_XDECREF(__pyx_t_5);
  4732. __Pyx_XDECREF(__pyx_t_6);
  4733. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4734. __pyx_r = NULL;
  4735. __pyx_L0:;
  4736. __Pyx_XGIVEREF(__pyx_r);
  4737. __Pyx_RefNannyFinishContext();
  4738. return __pyx_r;
  4739. }
  4740. /* "gedlibpy.pyx":470
  4741. *
  4742. *
  4743. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4744. * """
  4745. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4746. */
  4747. /* Python wrapper */
  4748. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id); /*proto*/
  4749. 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";
  4750. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix(PyObject *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4751. PyObject *__pyx_r = 0;
  4752. __Pyx_RefNannyDeclarations
  4753. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix (wrapper)", 0);
  4754. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_graph_id));
  4755. /* function exit code */
  4756. __Pyx_RefNannyFinishContext();
  4757. return __pyx_r;
  4758. }
  4759. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_graph_id) {
  4760. PyObject *__pyx_r = NULL;
  4761. __Pyx_RefNannyDeclarations
  4762. size_t __pyx_t_1;
  4763. std::vector<std::vector<size_t> > __pyx_t_2;
  4764. PyObject *__pyx_t_3 = NULL;
  4765. __Pyx_RefNannySetupContext("get_graph_adjacence_matrix", 0);
  4766. /* "gedlibpy.pyx":482
  4767. * .. note:: These functions allow to collect all the graph's informations.
  4768. * """
  4769. * return self.c_env.getGraphAdjacenceMatrix(graph_id) # <<<<<<<<<<<<<<
  4770. *
  4771. *
  4772. */
  4773. __Pyx_XDECREF(__pyx_r);
  4774. __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, 482, __pyx_L1_error)
  4775. try {
  4776. __pyx_t_2 = __pyx_v_self->c_env->getGraphAdjacenceMatrix(__pyx_t_1);
  4777. } catch(...) {
  4778. __Pyx_CppExn2PyErr();
  4779. __PYX_ERR(0, 482, __pyx_L1_error)
  4780. }
  4781. __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, 482, __pyx_L1_error)
  4782. __Pyx_GOTREF(__pyx_t_3);
  4783. __pyx_r = __pyx_t_3;
  4784. __pyx_t_3 = 0;
  4785. goto __pyx_L0;
  4786. /* "gedlibpy.pyx":470
  4787. *
  4788. *
  4789. * def get_graph_adjacence_matrix(self, graph_id) : # <<<<<<<<<<<<<<
  4790. * """
  4791. * Searchs and returns the adjacence list of a graph, selected by its ID.
  4792. */
  4793. /* function exit code */
  4794. __pyx_L1_error:;
  4795. __Pyx_XDECREF(__pyx_t_3);
  4796. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_graph_adjacence_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4797. __pyx_r = NULL;
  4798. __pyx_L0:;
  4799. __Pyx_XGIVEREF(__pyx_r);
  4800. __Pyx_RefNannyFinishContext();
  4801. return __pyx_r;
  4802. }
  4803. /* "gedlibpy.pyx":485
  4804. *
  4805. *
  4806. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4807. * """
  4808. * Sets an edit cost function to the environment, if it exists.
  4809. */
  4810. /* Python wrapper */
  4811. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  4812. 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";
  4813. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  4814. PyObject *__pyx_v_edit_cost = 0;
  4815. PyObject *__pyx_v_edit_cost_constant = 0;
  4816. PyObject *__pyx_r = 0;
  4817. __Pyx_RefNannyDeclarations
  4818. __Pyx_RefNannySetupContext("set_edit_cost (wrapper)", 0);
  4819. {
  4820. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost,&__pyx_n_s_edit_cost_constant,0};
  4821. PyObject* values[2] = {0,0};
  4822. values[1] = __pyx_k__2;
  4823. if (unlikely(__pyx_kwds)) {
  4824. Py_ssize_t kw_args;
  4825. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  4826. switch (pos_args) {
  4827. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4828. CYTHON_FALLTHROUGH;
  4829. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4830. CYTHON_FALLTHROUGH;
  4831. case 0: break;
  4832. default: goto __pyx_L5_argtuple_error;
  4833. }
  4834. kw_args = PyDict_Size(__pyx_kwds);
  4835. switch (pos_args) {
  4836. case 0:
  4837. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  4838. else goto __pyx_L5_argtuple_error;
  4839. CYTHON_FALLTHROUGH;
  4840. case 1:
  4841. if (kw_args > 0) {
  4842. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  4843. if (value) { values[1] = value; kw_args--; }
  4844. }
  4845. }
  4846. if (unlikely(kw_args > 0)) {
  4847. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_edit_cost") < 0)) __PYX_ERR(0, 485, __pyx_L3_error)
  4848. }
  4849. } else {
  4850. switch (PyTuple_GET_SIZE(__pyx_args)) {
  4851. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  4852. CYTHON_FALLTHROUGH;
  4853. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  4854. break;
  4855. default: goto __pyx_L5_argtuple_error;
  4856. }
  4857. }
  4858. __pyx_v_edit_cost = values[0];
  4859. __pyx_v_edit_cost_constant = values[1];
  4860. }
  4861. goto __pyx_L4_argument_unpacking_done;
  4862. __pyx_L5_argtuple_error:;
  4863. __Pyx_RaiseArgtupleInvalid("set_edit_cost", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 485, __pyx_L3_error)
  4864. __pyx_L3_error:;
  4865. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4866. __Pyx_RefNannyFinishContext();
  4867. return NULL;
  4868. __pyx_L4_argument_unpacking_done:;
  4869. __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);
  4870. /* function exit code */
  4871. __Pyx_RefNannyFinishContext();
  4872. return __pyx_r;
  4873. }
  4874. 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) {
  4875. PyObject *__pyx_v_edit_cost_b = NULL;
  4876. PyObject *__pyx_r = NULL;
  4877. __Pyx_RefNannyDeclarations
  4878. PyObject *__pyx_t_1 = NULL;
  4879. int __pyx_t_2;
  4880. int __pyx_t_3;
  4881. PyObject *__pyx_t_4 = NULL;
  4882. PyObject *__pyx_t_5 = NULL;
  4883. std::string __pyx_t_6;
  4884. std::vector<double> __pyx_t_7;
  4885. __Pyx_RefNannySetupContext("set_edit_cost", 0);
  4886. /* "gedlibpy.pyx":497
  4887. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4888. * """
  4889. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4890. * edit_cost_b = edit_cost.encode('utf-8')
  4891. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4892. */
  4893. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 497, __pyx_L1_error)
  4894. __Pyx_GOTREF(__pyx_t_1);
  4895. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_edit_cost, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 497, __pyx_L1_error)
  4896. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4897. __pyx_t_3 = (__pyx_t_2 != 0);
  4898. if (likely(__pyx_t_3)) {
  4899. /* "gedlibpy.pyx":498
  4900. * """
  4901. * if edit_cost in list_of_edit_cost_options:
  4902. * edit_cost_b = edit_cost.encode('utf-8') # <<<<<<<<<<<<<<
  4903. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4904. * else:
  4905. */
  4906. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_edit_cost, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 498, __pyx_L1_error)
  4907. __Pyx_GOTREF(__pyx_t_4);
  4908. __pyx_t_5 = NULL;
  4909. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  4910. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4911. if (likely(__pyx_t_5)) {
  4912. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4913. __Pyx_INCREF(__pyx_t_5);
  4914. __Pyx_INCREF(function);
  4915. __Pyx_DECREF_SET(__pyx_t_4, function);
  4916. }
  4917. }
  4918. __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);
  4919. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4920. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 498, __pyx_L1_error)
  4921. __Pyx_GOTREF(__pyx_t_1);
  4922. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4923. __pyx_v_edit_cost_b = __pyx_t_1;
  4924. __pyx_t_1 = 0;
  4925. /* "gedlibpy.pyx":499
  4926. * if edit_cost in list_of_edit_cost_options:
  4927. * edit_cost_b = edit_cost.encode('utf-8')
  4928. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant) # <<<<<<<<<<<<<<
  4929. * else:
  4930. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function")
  4931. */
  4932. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_edit_cost_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error)
  4933. __pyx_t_7 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error)
  4934. try {
  4935. __pyx_v_self->c_env->setEditCost(__pyx_t_6, __pyx_t_7);
  4936. } catch(...) {
  4937. __Pyx_CppExn2PyErr();
  4938. __PYX_ERR(0, 499, __pyx_L1_error)
  4939. }
  4940. /* "gedlibpy.pyx":497
  4941. * .. note:: Try to make sure the edit cost function exists with list_of_edit_cost_options, raise an error otherwise.
  4942. * """
  4943. * if edit_cost in list_of_edit_cost_options: # <<<<<<<<<<<<<<
  4944. * edit_cost_b = edit_cost.encode('utf-8')
  4945. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4946. */
  4947. goto __pyx_L3;
  4948. }
  4949. /* "gedlibpy.pyx":501
  4950. * self.c_env.setEditCost(edit_cost_b, edit_cost_constant)
  4951. * else:
  4952. * raise EditCostError("This edit cost function doesn't exist, please see list_of_edit_cost_options for selecting a edit cost function") # <<<<<<<<<<<<<<
  4953. *
  4954. *
  4955. */
  4956. /*else*/ {
  4957. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_EditCostError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
  4958. __Pyx_GOTREF(__pyx_t_4);
  4959. __pyx_t_5 = NULL;
  4960. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  4961. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  4962. if (likely(__pyx_t_5)) {
  4963. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  4964. __Pyx_INCREF(__pyx_t_5);
  4965. __Pyx_INCREF(function);
  4966. __Pyx_DECREF_SET(__pyx_t_4, function);
  4967. }
  4968. }
  4969. __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);
  4970. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  4971. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
  4972. __Pyx_GOTREF(__pyx_t_1);
  4973. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  4974. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  4975. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  4976. __PYX_ERR(0, 501, __pyx_L1_error)
  4977. }
  4978. __pyx_L3:;
  4979. /* "gedlibpy.pyx":485
  4980. *
  4981. *
  4982. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  4983. * """
  4984. * Sets an edit cost function to the environment, if it exists.
  4985. */
  4986. /* function exit code */
  4987. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  4988. goto __pyx_L0;
  4989. __pyx_L1_error:;
  4990. __Pyx_XDECREF(__pyx_t_1);
  4991. __Pyx_XDECREF(__pyx_t_4);
  4992. __Pyx_XDECREF(__pyx_t_5);
  4993. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  4994. __pyx_r = NULL;
  4995. __pyx_L0:;
  4996. __Pyx_XDECREF(__pyx_v_edit_cost_b);
  4997. __Pyx_XGIVEREF(__pyx_r);
  4998. __Pyx_RefNannyFinishContext();
  4999. return __pyx_r;
  5000. }
  5001. /* "gedlibpy.pyx":504
  5002. *
  5003. *
  5004. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5005. * """
  5006. * Sets an personal edit cost function to the environment.
  5007. */
  5008. /* Python wrapper */
  5009. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5010. 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";
  5011. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_45set_personal_edit_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5012. PyObject *__pyx_v_edit_cost_constant = 0;
  5013. PyObject *__pyx_r = 0;
  5014. __Pyx_RefNannyDeclarations
  5015. __Pyx_RefNannySetupContext("set_personal_edit_cost (wrapper)", 0);
  5016. {
  5017. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edit_cost_constant,0};
  5018. PyObject* values[1] = {0};
  5019. values[0] = __pyx_k__3;
  5020. if (unlikely(__pyx_kwds)) {
  5021. Py_ssize_t kw_args;
  5022. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5023. switch (pos_args) {
  5024. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5025. CYTHON_FALLTHROUGH;
  5026. case 0: break;
  5027. default: goto __pyx_L5_argtuple_error;
  5028. }
  5029. kw_args = PyDict_Size(__pyx_kwds);
  5030. switch (pos_args) {
  5031. case 0:
  5032. if (kw_args > 0) {
  5033. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost_constant);
  5034. if (value) { values[0] = value; kw_args--; }
  5035. }
  5036. }
  5037. if (unlikely(kw_args > 0)) {
  5038. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_personal_edit_cost") < 0)) __PYX_ERR(0, 504, __pyx_L3_error)
  5039. }
  5040. } else {
  5041. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5042. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5043. CYTHON_FALLTHROUGH;
  5044. case 0: break;
  5045. default: goto __pyx_L5_argtuple_error;
  5046. }
  5047. }
  5048. __pyx_v_edit_cost_constant = values[0];
  5049. }
  5050. goto __pyx_L4_argument_unpacking_done;
  5051. __pyx_L5_argtuple_error:;
  5052. __Pyx_RaiseArgtupleInvalid("set_personal_edit_cost", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 504, __pyx_L3_error)
  5053. __pyx_L3_error:;
  5054. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5055. __Pyx_RefNannyFinishContext();
  5056. return NULL;
  5057. __pyx_L4_argument_unpacking_done:;
  5058. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_edit_cost_constant);
  5059. /* function exit code */
  5060. __Pyx_RefNannyFinishContext();
  5061. return __pyx_r;
  5062. }
  5063. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_44set_personal_edit_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edit_cost_constant) {
  5064. PyObject *__pyx_r = NULL;
  5065. __Pyx_RefNannyDeclarations
  5066. std::vector<double> __pyx_t_1;
  5067. __Pyx_RefNannySetupContext("set_personal_edit_cost", 0);
  5068. /* "gedlibpy.pyx":514
  5069. * .. note::You have to modify the C++ function to use it. Please see the documentation to add your Edit Cost function.
  5070. * """
  5071. * self.c_env.setPersonalEditCost(edit_cost_constant) # <<<<<<<<<<<<<<
  5072. *
  5073. *
  5074. */
  5075. __pyx_t_1 = __pyx_convert_vector_from_py_double(__pyx_v_edit_cost_constant); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 514, __pyx_L1_error)
  5076. try {
  5077. __pyx_v_self->c_env->setPersonalEditCost(__pyx_t_1);
  5078. } catch(...) {
  5079. __Pyx_CppExn2PyErr();
  5080. __PYX_ERR(0, 514, __pyx_L1_error)
  5081. }
  5082. /* "gedlibpy.pyx":504
  5083. *
  5084. *
  5085. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  5086. * """
  5087. * Sets an personal edit cost function to the environment.
  5088. */
  5089. /* function exit code */
  5090. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5091. goto __pyx_L0;
  5092. __pyx_L1_error:;
  5093. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_personal_edit_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5094. __pyx_r = NULL;
  5095. __pyx_L0:;
  5096. __Pyx_XGIVEREF(__pyx_r);
  5097. __Pyx_RefNannyFinishContext();
  5098. return __pyx_r;
  5099. }
  5100. /* "gedlibpy.pyx":517
  5101. *
  5102. *
  5103. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5104. * """
  5105. * Initializes the environment with the chosen edit cost function and graphs.
  5106. */
  5107. /* Python wrapper */
  5108. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5109. 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";
  5110. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_47init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5111. PyObject *__pyx_v_init_option = 0;
  5112. PyObject *__pyx_v_print_to_stdout = 0;
  5113. PyObject *__pyx_r = 0;
  5114. __Pyx_RefNannyDeclarations
  5115. __Pyx_RefNannySetupContext("init (wrapper)", 0);
  5116. {
  5117. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_init_option,&__pyx_n_s_print_to_stdout,0};
  5118. PyObject* values[2] = {0,0};
  5119. values[0] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  5120. values[1] = ((PyObject *)Py_False);
  5121. if (unlikely(__pyx_kwds)) {
  5122. Py_ssize_t kw_args;
  5123. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5124. switch (pos_args) {
  5125. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5126. CYTHON_FALLTHROUGH;
  5127. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5128. CYTHON_FALLTHROUGH;
  5129. case 0: break;
  5130. default: goto __pyx_L5_argtuple_error;
  5131. }
  5132. kw_args = PyDict_Size(__pyx_kwds);
  5133. switch (pos_args) {
  5134. case 0:
  5135. if (kw_args > 0) {
  5136. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  5137. if (value) { values[0] = value; kw_args--; }
  5138. }
  5139. CYTHON_FALLTHROUGH;
  5140. case 1:
  5141. if (kw_args > 0) {
  5142. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_print_to_stdout);
  5143. if (value) { values[1] = value; kw_args--; }
  5144. }
  5145. }
  5146. if (unlikely(kw_args > 0)) {
  5147. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "init") < 0)) __PYX_ERR(0, 517, __pyx_L3_error)
  5148. }
  5149. } else {
  5150. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5151. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5152. CYTHON_FALLTHROUGH;
  5153. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5154. CYTHON_FALLTHROUGH;
  5155. case 0: break;
  5156. default: goto __pyx_L5_argtuple_error;
  5157. }
  5158. }
  5159. __pyx_v_init_option = values[0];
  5160. __pyx_v_print_to_stdout = values[1];
  5161. }
  5162. goto __pyx_L4_argument_unpacking_done;
  5163. __pyx_L5_argtuple_error:;
  5164. __Pyx_RaiseArgtupleInvalid("init", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 517, __pyx_L3_error)
  5165. __pyx_L3_error:;
  5166. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5167. __Pyx_RefNannyFinishContext();
  5168. return NULL;
  5169. __pyx_L4_argument_unpacking_done:;
  5170. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_46init(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_init_option, __pyx_v_print_to_stdout);
  5171. /* function exit code */
  5172. __Pyx_RefNannyFinishContext();
  5173. return __pyx_r;
  5174. }
  5175. 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) {
  5176. PyObject *__pyx_v_init_option_b = NULL;
  5177. PyObject *__pyx_r = NULL;
  5178. __Pyx_RefNannyDeclarations
  5179. PyObject *__pyx_t_1 = NULL;
  5180. int __pyx_t_2;
  5181. int __pyx_t_3;
  5182. PyObject *__pyx_t_4 = NULL;
  5183. PyObject *__pyx_t_5 = NULL;
  5184. std::string __pyx_t_6;
  5185. bool __pyx_t_7;
  5186. __Pyx_RefNannySetupContext("init", 0);
  5187. /* "gedlibpy.pyx":528
  5188. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5189. * """
  5190. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5191. * init_option_b = init_option.encode('utf-8')
  5192. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5193. */
  5194. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 528, __pyx_L1_error)
  5195. __Pyx_GOTREF(__pyx_t_1);
  5196. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_init_option, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 528, __pyx_L1_error)
  5197. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5198. __pyx_t_3 = (__pyx_t_2 != 0);
  5199. if (likely(__pyx_t_3)) {
  5200. /* "gedlibpy.pyx":529
  5201. * """
  5202. * if init_option in list_of_init_options:
  5203. * init_option_b = init_option.encode('utf-8') # <<<<<<<<<<<<<<
  5204. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5205. * else:
  5206. */
  5207. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_init_option, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 529, __pyx_L1_error)
  5208. __Pyx_GOTREF(__pyx_t_4);
  5209. __pyx_t_5 = NULL;
  5210. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5211. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5212. if (likely(__pyx_t_5)) {
  5213. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5214. __Pyx_INCREF(__pyx_t_5);
  5215. __Pyx_INCREF(function);
  5216. __Pyx_DECREF_SET(__pyx_t_4, function);
  5217. }
  5218. }
  5219. __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);
  5220. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5221. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 529, __pyx_L1_error)
  5222. __Pyx_GOTREF(__pyx_t_1);
  5223. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5224. __pyx_v_init_option_b = __pyx_t_1;
  5225. __pyx_t_1 = 0;
  5226. /* "gedlibpy.pyx":530
  5227. * if init_option in list_of_init_options:
  5228. * init_option_b = init_option.encode('utf-8')
  5229. * self.c_env.initEnv(init_option_b, print_to_stdout) # <<<<<<<<<<<<<<
  5230. * else:
  5231. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.")
  5232. */
  5233. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_init_option_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
  5234. __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_print_to_stdout); if (unlikely((__pyx_t_7 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
  5235. try {
  5236. __pyx_v_self->c_env->initEnv(__pyx_t_6, __pyx_t_7);
  5237. } catch(...) {
  5238. __Pyx_CppExn2PyErr();
  5239. __PYX_ERR(0, 530, __pyx_L1_error)
  5240. }
  5241. /* "gedlibpy.pyx":528
  5242. * .. note:: Try to make sure the option exists with list_of_init_options or choose no options, raise an error otherwise.
  5243. * """
  5244. * if init_option in list_of_init_options: # <<<<<<<<<<<<<<
  5245. * init_option_b = init_option.encode('utf-8')
  5246. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5247. */
  5248. goto __pyx_L3;
  5249. }
  5250. /* "gedlibpy.pyx":532
  5251. * self.c_env.initEnv(init_option_b, print_to_stdout)
  5252. * else:
  5253. * raise InitError("This init option doesn't exist, please see list_of_init_options for selecting an option. You can choose any options.") # <<<<<<<<<<<<<<
  5254. *
  5255. *
  5256. */
  5257. /*else*/ {
  5258. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_InitError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 532, __pyx_L1_error)
  5259. __Pyx_GOTREF(__pyx_t_4);
  5260. __pyx_t_5 = NULL;
  5261. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5262. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5263. if (likely(__pyx_t_5)) {
  5264. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5265. __Pyx_INCREF(__pyx_t_5);
  5266. __Pyx_INCREF(function);
  5267. __Pyx_DECREF_SET(__pyx_t_4, function);
  5268. }
  5269. }
  5270. __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);
  5271. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5272. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 532, __pyx_L1_error)
  5273. __Pyx_GOTREF(__pyx_t_1);
  5274. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5275. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5276. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5277. __PYX_ERR(0, 532, __pyx_L1_error)
  5278. }
  5279. __pyx_L3:;
  5280. /* "gedlibpy.pyx":517
  5281. *
  5282. *
  5283. * def init(self, init_option='EAGER_WITHOUT_SHUFFLED_COPIES', print_to_stdout=False) : # <<<<<<<<<<<<<<
  5284. * """
  5285. * Initializes the environment with the chosen edit cost function and graphs.
  5286. */
  5287. /* function exit code */
  5288. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5289. goto __pyx_L0;
  5290. __pyx_L1_error:;
  5291. __Pyx_XDECREF(__pyx_t_1);
  5292. __Pyx_XDECREF(__pyx_t_4);
  5293. __Pyx_XDECREF(__pyx_t_5);
  5294. __Pyx_AddTraceback("gedlibpy.GEDEnv.init", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5295. __pyx_r = NULL;
  5296. __pyx_L0:;
  5297. __Pyx_XDECREF(__pyx_v_init_option_b);
  5298. __Pyx_XGIVEREF(__pyx_r);
  5299. __Pyx_RefNannyFinishContext();
  5300. return __pyx_r;
  5301. }
  5302. /* "gedlibpy.pyx":535
  5303. *
  5304. *
  5305. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5306. * """
  5307. * Sets a computation method to the environment, if its exists.
  5308. */
  5309. /* Python wrapper */
  5310. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5311. 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";
  5312. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_49set_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5313. PyObject *__pyx_v_method = 0;
  5314. PyObject *__pyx_v_options = 0;
  5315. PyObject *__pyx_r = 0;
  5316. __Pyx_RefNannyDeclarations
  5317. __Pyx_RefNannySetupContext("set_method (wrapper)", 0);
  5318. {
  5319. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_options,0};
  5320. PyObject* values[2] = {0,0};
  5321. values[1] = ((PyObject *)__pyx_kp_u_);
  5322. if (unlikely(__pyx_kwds)) {
  5323. Py_ssize_t kw_args;
  5324. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5325. switch (pos_args) {
  5326. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5327. CYTHON_FALLTHROUGH;
  5328. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5329. CYTHON_FALLTHROUGH;
  5330. case 0: break;
  5331. default: goto __pyx_L5_argtuple_error;
  5332. }
  5333. kw_args = PyDict_Size(__pyx_kwds);
  5334. switch (pos_args) {
  5335. case 0:
  5336. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  5337. else goto __pyx_L5_argtuple_error;
  5338. CYTHON_FALLTHROUGH;
  5339. case 1:
  5340. if (kw_args > 0) {
  5341. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  5342. if (value) { values[1] = value; kw_args--; }
  5343. }
  5344. }
  5345. if (unlikely(kw_args > 0)) {
  5346. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_method") < 0)) __PYX_ERR(0, 535, __pyx_L3_error)
  5347. }
  5348. } else {
  5349. switch (PyTuple_GET_SIZE(__pyx_args)) {
  5350. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5351. CYTHON_FALLTHROUGH;
  5352. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5353. break;
  5354. default: goto __pyx_L5_argtuple_error;
  5355. }
  5356. }
  5357. __pyx_v_method = values[0];
  5358. __pyx_v_options = values[1];
  5359. }
  5360. goto __pyx_L4_argument_unpacking_done;
  5361. __pyx_L5_argtuple_error:;
  5362. __Pyx_RaiseArgtupleInvalid("set_method", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 535, __pyx_L3_error)
  5363. __pyx_L3_error:;
  5364. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5365. __Pyx_RefNannyFinishContext();
  5366. return NULL;
  5367. __pyx_L4_argument_unpacking_done:;
  5368. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_48set_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_method, __pyx_v_options);
  5369. /* function exit code */
  5370. __Pyx_RefNannyFinishContext();
  5371. return __pyx_r;
  5372. }
  5373. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_48set_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_options) {
  5374. PyObject *__pyx_v_method_b = NULL;
  5375. PyObject *__pyx_r = NULL;
  5376. __Pyx_RefNannyDeclarations
  5377. PyObject *__pyx_t_1 = NULL;
  5378. int __pyx_t_2;
  5379. int __pyx_t_3;
  5380. PyObject *__pyx_t_4 = NULL;
  5381. PyObject *__pyx_t_5 = NULL;
  5382. std::string __pyx_t_6;
  5383. std::string __pyx_t_7;
  5384. __Pyx_RefNannySetupContext("set_method", 0);
  5385. /* "gedlibpy.pyx":547
  5386. * .. 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.
  5387. * """
  5388. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5389. * method_b = method.encode('utf-8')
  5390. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5391. */
  5392. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_list_of_method_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 547, __pyx_L1_error)
  5393. __Pyx_GOTREF(__pyx_t_1);
  5394. __pyx_t_2 = (__Pyx_PySequence_ContainsTF(__pyx_v_method, __pyx_t_1, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 547, __pyx_L1_error)
  5395. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5396. __pyx_t_3 = (__pyx_t_2 != 0);
  5397. if (likely(__pyx_t_3)) {
  5398. /* "gedlibpy.pyx":548
  5399. * """
  5400. * if method in list_of_method_options:
  5401. * method_b = method.encode('utf-8') # <<<<<<<<<<<<<<
  5402. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5403. * else:
  5404. */
  5405. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_method, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
  5406. __Pyx_GOTREF(__pyx_t_4);
  5407. __pyx_t_5 = NULL;
  5408. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5409. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5410. if (likely(__pyx_t_5)) {
  5411. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5412. __Pyx_INCREF(__pyx_t_5);
  5413. __Pyx_INCREF(function);
  5414. __Pyx_DECREF_SET(__pyx_t_4, function);
  5415. }
  5416. }
  5417. __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);
  5418. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5419. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 548, __pyx_L1_error)
  5420. __Pyx_GOTREF(__pyx_t_1);
  5421. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5422. __pyx_v_method_b = __pyx_t_1;
  5423. __pyx_t_1 = 0;
  5424. /* "gedlibpy.pyx":549
  5425. * if method in list_of_method_options:
  5426. * method_b = method.encode('utf-8')
  5427. * self.c_env.setMethod(method_b, options.encode('utf-8')) # <<<<<<<<<<<<<<
  5428. * else:
  5429. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method")
  5430. */
  5431. __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_v_method_b); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error)
  5432. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_options, __pyx_n_s_encode); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 549, __pyx_L1_error)
  5433. __Pyx_GOTREF(__pyx_t_4);
  5434. __pyx_t_5 = NULL;
  5435. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  5436. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5437. if (likely(__pyx_t_5)) {
  5438. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5439. __Pyx_INCREF(__pyx_t_5);
  5440. __Pyx_INCREF(function);
  5441. __Pyx_DECREF_SET(__pyx_t_4, function);
  5442. }
  5443. }
  5444. __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);
  5445. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5446. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
  5447. __Pyx_GOTREF(__pyx_t_1);
  5448. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5449. __pyx_t_7 = __pyx_convert_string_from_py_std__in_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 549, __pyx_L1_error)
  5450. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5451. try {
  5452. __pyx_v_self->c_env->setMethod(__pyx_t_6, __pyx_t_7);
  5453. } catch(...) {
  5454. __Pyx_CppExn2PyErr();
  5455. __PYX_ERR(0, 549, __pyx_L1_error)
  5456. }
  5457. /* "gedlibpy.pyx":547
  5458. * .. 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.
  5459. * """
  5460. * if method in list_of_method_options: # <<<<<<<<<<<<<<
  5461. * method_b = method.encode('utf-8')
  5462. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5463. */
  5464. goto __pyx_L3;
  5465. }
  5466. /* "gedlibpy.pyx":551
  5467. * self.c_env.setMethod(method_b, options.encode('utf-8'))
  5468. * else:
  5469. * raise MethodError("This method doesn't exist, please see list_of_method_options for selecting a method") # <<<<<<<<<<<<<<
  5470. *
  5471. *
  5472. */
  5473. /*else*/ {
  5474. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_MethodError); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 551, __pyx_L1_error)
  5475. __Pyx_GOTREF(__pyx_t_4);
  5476. __pyx_t_5 = NULL;
  5477. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
  5478. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  5479. if (likely(__pyx_t_5)) {
  5480. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  5481. __Pyx_INCREF(__pyx_t_5);
  5482. __Pyx_INCREF(function);
  5483. __Pyx_DECREF_SET(__pyx_t_4, function);
  5484. }
  5485. }
  5486. __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);
  5487. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  5488. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 551, __pyx_L1_error)
  5489. __Pyx_GOTREF(__pyx_t_1);
  5490. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  5491. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  5492. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  5493. __PYX_ERR(0, 551, __pyx_L1_error)
  5494. }
  5495. __pyx_L3:;
  5496. /* "gedlibpy.pyx":535
  5497. *
  5498. *
  5499. * def set_method(self, method, options="") : # <<<<<<<<<<<<<<
  5500. * """
  5501. * Sets a computation method to the environment, if its exists.
  5502. */
  5503. /* function exit code */
  5504. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5505. goto __pyx_L0;
  5506. __pyx_L1_error:;
  5507. __Pyx_XDECREF(__pyx_t_1);
  5508. __Pyx_XDECREF(__pyx_t_4);
  5509. __Pyx_XDECREF(__pyx_t_5);
  5510. __Pyx_AddTraceback("gedlibpy.GEDEnv.set_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5511. __pyx_r = NULL;
  5512. __pyx_L0:;
  5513. __Pyx_XDECREF(__pyx_v_method_b);
  5514. __Pyx_XGIVEREF(__pyx_r);
  5515. __Pyx_RefNannyFinishContext();
  5516. return __pyx_r;
  5517. }
  5518. /* "gedlibpy.pyx":554
  5519. *
  5520. *
  5521. * def init_method(self) : # <<<<<<<<<<<<<<
  5522. * """
  5523. * Inits the environment with the set method.
  5524. */
  5525. /* Python wrapper */
  5526. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5527. 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";
  5528. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_51init_method(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5529. PyObject *__pyx_r = 0;
  5530. __Pyx_RefNannyDeclarations
  5531. __Pyx_RefNannySetupContext("init_method (wrapper)", 0);
  5532. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_50init_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5533. /* function exit code */
  5534. __Pyx_RefNannyFinishContext();
  5535. return __pyx_r;
  5536. }
  5537. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_50init_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5538. PyObject *__pyx_r = NULL;
  5539. __Pyx_RefNannyDeclarations
  5540. __Pyx_RefNannySetupContext("init_method", 0);
  5541. /* "gedlibpy.pyx":561
  5542. * .. note:: Call this function after set the method. You can't launch computation or change the method after that.
  5543. * """
  5544. * self.c_env.initMethod() # <<<<<<<<<<<<<<
  5545. *
  5546. *
  5547. */
  5548. try {
  5549. __pyx_v_self->c_env->initMethod();
  5550. } catch(...) {
  5551. __Pyx_CppExn2PyErr();
  5552. __PYX_ERR(0, 561, __pyx_L1_error)
  5553. }
  5554. /* "gedlibpy.pyx":554
  5555. *
  5556. *
  5557. * def init_method(self) : # <<<<<<<<<<<<<<
  5558. * """
  5559. * Inits the environment with the set method.
  5560. */
  5561. /* function exit code */
  5562. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5563. goto __pyx_L0;
  5564. __pyx_L1_error:;
  5565. __Pyx_AddTraceback("gedlibpy.GEDEnv.init_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5566. __pyx_r = NULL;
  5567. __pyx_L0:;
  5568. __Pyx_XGIVEREF(__pyx_r);
  5569. __Pyx_RefNannyFinishContext();
  5570. return __pyx_r;
  5571. }
  5572. /* "gedlibpy.pyx":564
  5573. *
  5574. *
  5575. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5576. * """
  5577. * Returns the initialization time.
  5578. */
  5579. /* Python wrapper */
  5580. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  5581. 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";
  5582. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  5583. PyObject *__pyx_r = 0;
  5584. __Pyx_RefNannyDeclarations
  5585. __Pyx_RefNannySetupContext("get_init_time (wrapper)", 0);
  5586. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  5587. /* function exit code */
  5588. __Pyx_RefNannyFinishContext();
  5589. return __pyx_r;
  5590. }
  5591. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_52get_init_time(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  5592. PyObject *__pyx_r = NULL;
  5593. __Pyx_RefNannyDeclarations
  5594. double __pyx_t_1;
  5595. PyObject *__pyx_t_2 = NULL;
  5596. __Pyx_RefNannySetupContext("get_init_time", 0);
  5597. /* "gedlibpy.pyx":571
  5598. * :rtype: double
  5599. * """
  5600. * return self.c_env.getInitime() # <<<<<<<<<<<<<<
  5601. *
  5602. *
  5603. */
  5604. __Pyx_XDECREF(__pyx_r);
  5605. try {
  5606. __pyx_t_1 = __pyx_v_self->c_env->getInitime();
  5607. } catch(...) {
  5608. __Pyx_CppExn2PyErr();
  5609. __PYX_ERR(0, 571, __pyx_L1_error)
  5610. }
  5611. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
  5612. __Pyx_GOTREF(__pyx_t_2);
  5613. __pyx_r = __pyx_t_2;
  5614. __pyx_t_2 = 0;
  5615. goto __pyx_L0;
  5616. /* "gedlibpy.pyx":564
  5617. *
  5618. *
  5619. * def get_init_time(self) : # <<<<<<<<<<<<<<
  5620. * """
  5621. * Returns the initialization time.
  5622. */
  5623. /* function exit code */
  5624. __pyx_L1_error:;
  5625. __Pyx_XDECREF(__pyx_t_2);
  5626. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_time", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5627. __pyx_r = NULL;
  5628. __pyx_L0:;
  5629. __Pyx_XGIVEREF(__pyx_r);
  5630. __Pyx_RefNannyFinishContext();
  5631. return __pyx_r;
  5632. }
  5633. /* "gedlibpy.pyx":574
  5634. *
  5635. *
  5636. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5637. * """
  5638. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5639. */
  5640. /* Python wrapper */
  5641. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5642. 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";
  5643. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_55run_method(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5644. PyObject *__pyx_v_g = 0;
  5645. PyObject *__pyx_v_h = 0;
  5646. PyObject *__pyx_r = 0;
  5647. __Pyx_RefNannyDeclarations
  5648. __Pyx_RefNannySetupContext("run_method (wrapper)", 0);
  5649. {
  5650. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5651. PyObject* values[2] = {0,0};
  5652. if (unlikely(__pyx_kwds)) {
  5653. Py_ssize_t kw_args;
  5654. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5655. switch (pos_args) {
  5656. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5657. CYTHON_FALLTHROUGH;
  5658. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5659. CYTHON_FALLTHROUGH;
  5660. case 0: break;
  5661. default: goto __pyx_L5_argtuple_error;
  5662. }
  5663. kw_args = PyDict_Size(__pyx_kwds);
  5664. switch (pos_args) {
  5665. case 0:
  5666. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5667. else goto __pyx_L5_argtuple_error;
  5668. CYTHON_FALLTHROUGH;
  5669. case 1:
  5670. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5671. else {
  5672. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, 1); __PYX_ERR(0, 574, __pyx_L3_error)
  5673. }
  5674. }
  5675. if (unlikely(kw_args > 0)) {
  5676. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "run_method") < 0)) __PYX_ERR(0, 574, __pyx_L3_error)
  5677. }
  5678. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5679. goto __pyx_L5_argtuple_error;
  5680. } else {
  5681. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5682. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5683. }
  5684. __pyx_v_g = values[0];
  5685. __pyx_v_h = values[1];
  5686. }
  5687. goto __pyx_L4_argument_unpacking_done;
  5688. __pyx_L5_argtuple_error:;
  5689. __Pyx_RaiseArgtupleInvalid("run_method", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 574, __pyx_L3_error)
  5690. __pyx_L3_error:;
  5691. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5692. __Pyx_RefNannyFinishContext();
  5693. return NULL;
  5694. __pyx_L4_argument_unpacking_done:;
  5695. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_54run_method(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5696. /* function exit code */
  5697. __Pyx_RefNannyFinishContext();
  5698. return __pyx_r;
  5699. }
  5700. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_54run_method(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  5701. PyObject *__pyx_r = NULL;
  5702. __Pyx_RefNannyDeclarations
  5703. size_t __pyx_t_1;
  5704. size_t __pyx_t_2;
  5705. __Pyx_RefNannySetupContext("run_method", 0);
  5706. /* "gedlibpy.pyx":586
  5707. * .. 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.
  5708. * """
  5709. * self.c_env.runMethod(g, h) # <<<<<<<<<<<<<<
  5710. *
  5711. *
  5712. */
  5713. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
  5714. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 586, __pyx_L1_error)
  5715. try {
  5716. __pyx_v_self->c_env->runMethod(__pyx_t_1, __pyx_t_2);
  5717. } catch(...) {
  5718. __Pyx_CppExn2PyErr();
  5719. __PYX_ERR(0, 586, __pyx_L1_error)
  5720. }
  5721. /* "gedlibpy.pyx":574
  5722. *
  5723. *
  5724. * def run_method(self, g, h) : # <<<<<<<<<<<<<<
  5725. * """
  5726. * Computes the edit distance between two graphs g and h, with the edit cost function and method computation selected.
  5727. */
  5728. /* function exit code */
  5729. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  5730. goto __pyx_L0;
  5731. __pyx_L1_error:;
  5732. __Pyx_AddTraceback("gedlibpy.GEDEnv.run_method", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5733. __pyx_r = NULL;
  5734. __pyx_L0:;
  5735. __Pyx_XGIVEREF(__pyx_r);
  5736. __Pyx_RefNannyFinishContext();
  5737. return __pyx_r;
  5738. }
  5739. /* "gedlibpy.pyx":589
  5740. *
  5741. *
  5742. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5743. * """
  5744. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5745. */
  5746. /* Python wrapper */
  5747. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5748. 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";
  5749. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5750. PyObject *__pyx_v_g = 0;
  5751. PyObject *__pyx_v_h = 0;
  5752. PyObject *__pyx_r = 0;
  5753. __Pyx_RefNannyDeclarations
  5754. __Pyx_RefNannySetupContext("get_upper_bound (wrapper)", 0);
  5755. {
  5756. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5757. PyObject* values[2] = {0,0};
  5758. if (unlikely(__pyx_kwds)) {
  5759. Py_ssize_t kw_args;
  5760. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5761. switch (pos_args) {
  5762. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5763. CYTHON_FALLTHROUGH;
  5764. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5765. CYTHON_FALLTHROUGH;
  5766. case 0: break;
  5767. default: goto __pyx_L5_argtuple_error;
  5768. }
  5769. kw_args = PyDict_Size(__pyx_kwds);
  5770. switch (pos_args) {
  5771. case 0:
  5772. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5773. else goto __pyx_L5_argtuple_error;
  5774. CYTHON_FALLTHROUGH;
  5775. case 1:
  5776. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5777. else {
  5778. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, 1); __PYX_ERR(0, 589, __pyx_L3_error)
  5779. }
  5780. }
  5781. if (unlikely(kw_args > 0)) {
  5782. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_upper_bound") < 0)) __PYX_ERR(0, 589, __pyx_L3_error)
  5783. }
  5784. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5785. goto __pyx_L5_argtuple_error;
  5786. } else {
  5787. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5788. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5789. }
  5790. __pyx_v_g = values[0];
  5791. __pyx_v_h = values[1];
  5792. }
  5793. goto __pyx_L4_argument_unpacking_done;
  5794. __pyx_L5_argtuple_error:;
  5795. __Pyx_RaiseArgtupleInvalid("get_upper_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 589, __pyx_L3_error)
  5796. __pyx_L3_error:;
  5797. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5798. __Pyx_RefNannyFinishContext();
  5799. return NULL;
  5800. __pyx_L4_argument_unpacking_done:;
  5801. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_56get_upper_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5802. /* function exit code */
  5803. __Pyx_RefNannyFinishContext();
  5804. return __pyx_r;
  5805. }
  5806. 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) {
  5807. PyObject *__pyx_r = NULL;
  5808. __Pyx_RefNannyDeclarations
  5809. size_t __pyx_t_1;
  5810. size_t __pyx_t_2;
  5811. double __pyx_t_3;
  5812. PyObject *__pyx_t_4 = NULL;
  5813. __Pyx_RefNannySetupContext("get_upper_bound", 0);
  5814. /* "gedlibpy.pyx":604
  5815. * .. 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.
  5816. * """
  5817. * return self.c_env.getUpperBound(g, h) # <<<<<<<<<<<<<<
  5818. *
  5819. *
  5820. */
  5821. __Pyx_XDECREF(__pyx_r);
  5822. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error)
  5823. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 604, __pyx_L1_error)
  5824. try {
  5825. __pyx_t_3 = __pyx_v_self->c_env->getUpperBound(__pyx_t_1, __pyx_t_2);
  5826. } catch(...) {
  5827. __Pyx_CppExn2PyErr();
  5828. __PYX_ERR(0, 604, __pyx_L1_error)
  5829. }
  5830. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 604, __pyx_L1_error)
  5831. __Pyx_GOTREF(__pyx_t_4);
  5832. __pyx_r = __pyx_t_4;
  5833. __pyx_t_4 = 0;
  5834. goto __pyx_L0;
  5835. /* "gedlibpy.pyx":589
  5836. *
  5837. *
  5838. * def get_upper_bound(self, g, h) : # <<<<<<<<<<<<<<
  5839. * """
  5840. * Returns the upper bound of the edit distance cost between two graphs g and h.
  5841. */
  5842. /* function exit code */
  5843. __pyx_L1_error:;
  5844. __Pyx_XDECREF(__pyx_t_4);
  5845. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_upper_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5846. __pyx_r = NULL;
  5847. __pyx_L0:;
  5848. __Pyx_XGIVEREF(__pyx_r);
  5849. __Pyx_RefNannyFinishContext();
  5850. return __pyx_r;
  5851. }
  5852. /* "gedlibpy.pyx":607
  5853. *
  5854. *
  5855. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5856. * """
  5857. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5858. */
  5859. /* Python wrapper */
  5860. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5861. 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";
  5862. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5863. PyObject *__pyx_v_g = 0;
  5864. PyObject *__pyx_v_h = 0;
  5865. PyObject *__pyx_r = 0;
  5866. __Pyx_RefNannyDeclarations
  5867. __Pyx_RefNannySetupContext("get_lower_bound (wrapper)", 0);
  5868. {
  5869. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5870. PyObject* values[2] = {0,0};
  5871. if (unlikely(__pyx_kwds)) {
  5872. Py_ssize_t kw_args;
  5873. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5874. switch (pos_args) {
  5875. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5876. CYTHON_FALLTHROUGH;
  5877. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5878. CYTHON_FALLTHROUGH;
  5879. case 0: break;
  5880. default: goto __pyx_L5_argtuple_error;
  5881. }
  5882. kw_args = PyDict_Size(__pyx_kwds);
  5883. switch (pos_args) {
  5884. case 0:
  5885. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5886. else goto __pyx_L5_argtuple_error;
  5887. CYTHON_FALLTHROUGH;
  5888. case 1:
  5889. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  5890. else {
  5891. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, 1); __PYX_ERR(0, 607, __pyx_L3_error)
  5892. }
  5893. }
  5894. if (unlikely(kw_args > 0)) {
  5895. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_lower_bound") < 0)) __PYX_ERR(0, 607, __pyx_L3_error)
  5896. }
  5897. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  5898. goto __pyx_L5_argtuple_error;
  5899. } else {
  5900. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5901. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5902. }
  5903. __pyx_v_g = values[0];
  5904. __pyx_v_h = values[1];
  5905. }
  5906. goto __pyx_L4_argument_unpacking_done;
  5907. __pyx_L5_argtuple_error:;
  5908. __Pyx_RaiseArgtupleInvalid("get_lower_bound", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 607, __pyx_L3_error)
  5909. __pyx_L3_error:;
  5910. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5911. __Pyx_RefNannyFinishContext();
  5912. return NULL;
  5913. __pyx_L4_argument_unpacking_done:;
  5914. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_58get_lower_bound(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  5915. /* function exit code */
  5916. __Pyx_RefNannyFinishContext();
  5917. return __pyx_r;
  5918. }
  5919. 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) {
  5920. PyObject *__pyx_r = NULL;
  5921. __Pyx_RefNannyDeclarations
  5922. size_t __pyx_t_1;
  5923. size_t __pyx_t_2;
  5924. double __pyx_t_3;
  5925. PyObject *__pyx_t_4 = NULL;
  5926. __Pyx_RefNannySetupContext("get_lower_bound", 0);
  5927. /* "gedlibpy.pyx":622
  5928. * .. note:: This function can be ignored, because lower bound doesn't have a crucial utility.
  5929. * """
  5930. * return self.c_env.getLowerBound(g, h) # <<<<<<<<<<<<<<
  5931. *
  5932. *
  5933. */
  5934. __Pyx_XDECREF(__pyx_r);
  5935. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
  5936. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
  5937. try {
  5938. __pyx_t_3 = __pyx_v_self->c_env->getLowerBound(__pyx_t_1, __pyx_t_2);
  5939. } catch(...) {
  5940. __Pyx_CppExn2PyErr();
  5941. __PYX_ERR(0, 622, __pyx_L1_error)
  5942. }
  5943. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 622, __pyx_L1_error)
  5944. __Pyx_GOTREF(__pyx_t_4);
  5945. __pyx_r = __pyx_t_4;
  5946. __pyx_t_4 = 0;
  5947. goto __pyx_L0;
  5948. /* "gedlibpy.pyx":607
  5949. *
  5950. *
  5951. * def get_lower_bound(self, g, h) : # <<<<<<<<<<<<<<
  5952. * """
  5953. * Returns the lower bound of the edit distance cost between two graphs g and h.
  5954. */
  5955. /* function exit code */
  5956. __pyx_L1_error:;
  5957. __Pyx_XDECREF(__pyx_t_4);
  5958. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_lower_bound", __pyx_clineno, __pyx_lineno, __pyx_filename);
  5959. __pyx_r = NULL;
  5960. __pyx_L0:;
  5961. __Pyx_XGIVEREF(__pyx_r);
  5962. __Pyx_RefNannyFinishContext();
  5963. return __pyx_r;
  5964. }
  5965. /* "gedlibpy.pyx":625
  5966. *
  5967. *
  5968. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  5969. * """
  5970. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  5971. */
  5972. /* Python wrapper */
  5973. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  5974. 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";
  5975. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  5976. PyObject *__pyx_v_g = 0;
  5977. PyObject *__pyx_v_h = 0;
  5978. PyObject *__pyx_r = 0;
  5979. __Pyx_RefNannyDeclarations
  5980. __Pyx_RefNannySetupContext("get_forward_map (wrapper)", 0);
  5981. {
  5982. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  5983. PyObject* values[2] = {0,0};
  5984. if (unlikely(__pyx_kwds)) {
  5985. Py_ssize_t kw_args;
  5986. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  5987. switch (pos_args) {
  5988. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  5989. CYTHON_FALLTHROUGH;
  5990. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  5991. CYTHON_FALLTHROUGH;
  5992. case 0: break;
  5993. default: goto __pyx_L5_argtuple_error;
  5994. }
  5995. kw_args = PyDict_Size(__pyx_kwds);
  5996. switch (pos_args) {
  5997. case 0:
  5998. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  5999. else goto __pyx_L5_argtuple_error;
  6000. CYTHON_FALLTHROUGH;
  6001. case 1:
  6002. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6003. else {
  6004. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, 1); __PYX_ERR(0, 625, __pyx_L3_error)
  6005. }
  6006. }
  6007. if (unlikely(kw_args > 0)) {
  6008. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_forward_map") < 0)) __PYX_ERR(0, 625, __pyx_L3_error)
  6009. }
  6010. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6011. goto __pyx_L5_argtuple_error;
  6012. } else {
  6013. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6014. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6015. }
  6016. __pyx_v_g = values[0];
  6017. __pyx_v_h = values[1];
  6018. }
  6019. goto __pyx_L4_argument_unpacking_done;
  6020. __pyx_L5_argtuple_error:;
  6021. __Pyx_RaiseArgtupleInvalid("get_forward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 625, __pyx_L3_error)
  6022. __pyx_L3_error:;
  6023. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6024. __Pyx_RefNannyFinishContext();
  6025. return NULL;
  6026. __pyx_L4_argument_unpacking_done:;
  6027. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_60get_forward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6028. /* function exit code */
  6029. __Pyx_RefNannyFinishContext();
  6030. return __pyx_r;
  6031. }
  6032. 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) {
  6033. PyObject *__pyx_r = NULL;
  6034. __Pyx_RefNannyDeclarations
  6035. size_t __pyx_t_1;
  6036. size_t __pyx_t_2;
  6037. std::vector<npy_uint64> __pyx_t_3;
  6038. PyObject *__pyx_t_4 = NULL;
  6039. __Pyx_RefNannySetupContext("get_forward_map", 0);
  6040. /* "gedlibpy.pyx":640
  6041. * .. 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 !
  6042. * """
  6043. * return self.c_env.getForwardMap(g, h) # <<<<<<<<<<<<<<
  6044. *
  6045. *
  6046. */
  6047. __Pyx_XDECREF(__pyx_r);
  6048. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error)
  6049. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 640, __pyx_L1_error)
  6050. try {
  6051. __pyx_t_3 = __pyx_v_self->c_env->getForwardMap(__pyx_t_1, __pyx_t_2);
  6052. } catch(...) {
  6053. __Pyx_CppExn2PyErr();
  6054. __PYX_ERR(0, 640, __pyx_L1_error)
  6055. }
  6056. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 640, __pyx_L1_error)
  6057. __Pyx_GOTREF(__pyx_t_4);
  6058. __pyx_r = __pyx_t_4;
  6059. __pyx_t_4 = 0;
  6060. goto __pyx_L0;
  6061. /* "gedlibpy.pyx":625
  6062. *
  6063. *
  6064. * def get_forward_map(self, g, h) : # <<<<<<<<<<<<<<
  6065. * """
  6066. * Returns the forward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6067. */
  6068. /* function exit code */
  6069. __pyx_L1_error:;
  6070. __Pyx_XDECREF(__pyx_t_4);
  6071. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_forward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6072. __pyx_r = NULL;
  6073. __pyx_L0:;
  6074. __Pyx_XGIVEREF(__pyx_r);
  6075. __Pyx_RefNannyFinishContext();
  6076. return __pyx_r;
  6077. }
  6078. /* "gedlibpy.pyx":643
  6079. *
  6080. *
  6081. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6082. * """
  6083. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6084. */
  6085. /* Python wrapper */
  6086. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6087. 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";
  6088. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6089. PyObject *__pyx_v_g = 0;
  6090. PyObject *__pyx_v_h = 0;
  6091. PyObject *__pyx_r = 0;
  6092. __Pyx_RefNannyDeclarations
  6093. __Pyx_RefNannySetupContext("get_backward_map (wrapper)", 0);
  6094. {
  6095. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6096. PyObject* values[2] = {0,0};
  6097. if (unlikely(__pyx_kwds)) {
  6098. Py_ssize_t kw_args;
  6099. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6100. switch (pos_args) {
  6101. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6102. CYTHON_FALLTHROUGH;
  6103. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6104. CYTHON_FALLTHROUGH;
  6105. case 0: break;
  6106. default: goto __pyx_L5_argtuple_error;
  6107. }
  6108. kw_args = PyDict_Size(__pyx_kwds);
  6109. switch (pos_args) {
  6110. case 0:
  6111. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6112. else goto __pyx_L5_argtuple_error;
  6113. CYTHON_FALLTHROUGH;
  6114. case 1:
  6115. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6116. else {
  6117. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, 1); __PYX_ERR(0, 643, __pyx_L3_error)
  6118. }
  6119. }
  6120. if (unlikely(kw_args > 0)) {
  6121. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_backward_map") < 0)) __PYX_ERR(0, 643, __pyx_L3_error)
  6122. }
  6123. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6124. goto __pyx_L5_argtuple_error;
  6125. } else {
  6126. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6127. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6128. }
  6129. __pyx_v_g = values[0];
  6130. __pyx_v_h = values[1];
  6131. }
  6132. goto __pyx_L4_argument_unpacking_done;
  6133. __pyx_L5_argtuple_error:;
  6134. __Pyx_RaiseArgtupleInvalid("get_backward_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 643, __pyx_L3_error)
  6135. __pyx_L3_error:;
  6136. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6137. __Pyx_RefNannyFinishContext();
  6138. return NULL;
  6139. __pyx_L4_argument_unpacking_done:;
  6140. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_62get_backward_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6141. /* function exit code */
  6142. __Pyx_RefNannyFinishContext();
  6143. return __pyx_r;
  6144. }
  6145. 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) {
  6146. PyObject *__pyx_r = NULL;
  6147. __Pyx_RefNannyDeclarations
  6148. size_t __pyx_t_1;
  6149. size_t __pyx_t_2;
  6150. std::vector<npy_uint64> __pyx_t_3;
  6151. PyObject *__pyx_t_4 = NULL;
  6152. __Pyx_RefNannySetupContext("get_backward_map", 0);
  6153. /* "gedlibpy.pyx":658
  6154. * .. 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 !
  6155. * """
  6156. * return self.c_env.getBackwardMap(g, h) # <<<<<<<<<<<<<<
  6157. *
  6158. *
  6159. */
  6160. __Pyx_XDECREF(__pyx_r);
  6161. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
  6162. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 658, __pyx_L1_error)
  6163. try {
  6164. __pyx_t_3 = __pyx_v_self->c_env->getBackwardMap(__pyx_t_1, __pyx_t_2);
  6165. } catch(...) {
  6166. __Pyx_CppExn2PyErr();
  6167. __PYX_ERR(0, 658, __pyx_L1_error)
  6168. }
  6169. __pyx_t_4 = __pyx_convert_vector_to_py_npy_uint64(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
  6170. __Pyx_GOTREF(__pyx_t_4);
  6171. __pyx_r = __pyx_t_4;
  6172. __pyx_t_4 = 0;
  6173. goto __pyx_L0;
  6174. /* "gedlibpy.pyx":643
  6175. *
  6176. *
  6177. * def get_backward_map(self, g, h) : # <<<<<<<<<<<<<<
  6178. * """
  6179. * Returns the backward map (or the half of the adjacence matrix) between nodes of the two indicated graphs.
  6180. */
  6181. /* function exit code */
  6182. __pyx_L1_error:;
  6183. __Pyx_XDECREF(__pyx_t_4);
  6184. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_backward_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6185. __pyx_r = NULL;
  6186. __pyx_L0:;
  6187. __Pyx_XGIVEREF(__pyx_r);
  6188. __Pyx_RefNannyFinishContext();
  6189. return __pyx_r;
  6190. }
  6191. /* "gedlibpy.pyx":661
  6192. *
  6193. *
  6194. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6195. * """
  6196. * Returns the node's image in the adjacence matrix, if it exists.
  6197. */
  6198. /* Python wrapper */
  6199. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6200. 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";
  6201. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6202. PyObject *__pyx_v_g = 0;
  6203. PyObject *__pyx_v_h = 0;
  6204. PyObject *__pyx_v_node_id = 0;
  6205. PyObject *__pyx_r = 0;
  6206. __Pyx_RefNannyDeclarations
  6207. __Pyx_RefNannySetupContext("get_node_image (wrapper)", 0);
  6208. {
  6209. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6210. PyObject* values[3] = {0,0,0};
  6211. if (unlikely(__pyx_kwds)) {
  6212. Py_ssize_t kw_args;
  6213. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6214. switch (pos_args) {
  6215. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6216. CYTHON_FALLTHROUGH;
  6217. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6218. CYTHON_FALLTHROUGH;
  6219. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6220. CYTHON_FALLTHROUGH;
  6221. case 0: break;
  6222. default: goto __pyx_L5_argtuple_error;
  6223. }
  6224. kw_args = PyDict_Size(__pyx_kwds);
  6225. switch (pos_args) {
  6226. case 0:
  6227. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6228. else goto __pyx_L5_argtuple_error;
  6229. CYTHON_FALLTHROUGH;
  6230. case 1:
  6231. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6232. else {
  6233. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 1); __PYX_ERR(0, 661, __pyx_L3_error)
  6234. }
  6235. CYTHON_FALLTHROUGH;
  6236. case 2:
  6237. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6238. else {
  6239. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, 2); __PYX_ERR(0, 661, __pyx_L3_error)
  6240. }
  6241. }
  6242. if (unlikely(kw_args > 0)) {
  6243. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_image") < 0)) __PYX_ERR(0, 661, __pyx_L3_error)
  6244. }
  6245. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6246. goto __pyx_L5_argtuple_error;
  6247. } else {
  6248. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6249. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6250. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6251. }
  6252. __pyx_v_g = values[0];
  6253. __pyx_v_h = values[1];
  6254. __pyx_v_node_id = values[2];
  6255. }
  6256. goto __pyx_L4_argument_unpacking_done;
  6257. __pyx_L5_argtuple_error:;
  6258. __Pyx_RaiseArgtupleInvalid("get_node_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 661, __pyx_L3_error)
  6259. __pyx_L3_error:;
  6260. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6261. __Pyx_RefNannyFinishContext();
  6262. return NULL;
  6263. __pyx_L4_argument_unpacking_done:;
  6264. __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);
  6265. /* function exit code */
  6266. __Pyx_RefNannyFinishContext();
  6267. return __pyx_r;
  6268. }
  6269. 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) {
  6270. PyObject *__pyx_r = NULL;
  6271. __Pyx_RefNannyDeclarations
  6272. size_t __pyx_t_1;
  6273. size_t __pyx_t_2;
  6274. size_t __pyx_t_3;
  6275. size_t __pyx_t_4;
  6276. PyObject *__pyx_t_5 = NULL;
  6277. __Pyx_RefNannySetupContext("get_node_image", 0);
  6278. /* "gedlibpy.pyx":679
  6279. *
  6280. * """
  6281. * return self.c_env.getNodeImage(g, h, node_id) # <<<<<<<<<<<<<<
  6282. *
  6283. *
  6284. */
  6285. __Pyx_XDECREF(__pyx_r);
  6286. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
  6287. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 679, __pyx_L1_error)
  6288. __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, 679, __pyx_L1_error)
  6289. try {
  6290. __pyx_t_4 = __pyx_v_self->c_env->getNodeImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6291. } catch(...) {
  6292. __Pyx_CppExn2PyErr();
  6293. __PYX_ERR(0, 679, __pyx_L1_error)
  6294. }
  6295. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
  6296. __Pyx_GOTREF(__pyx_t_5);
  6297. __pyx_r = __pyx_t_5;
  6298. __pyx_t_5 = 0;
  6299. goto __pyx_L0;
  6300. /* "gedlibpy.pyx":661
  6301. *
  6302. *
  6303. * def get_node_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6304. * """
  6305. * Returns the node's image in the adjacence matrix, if it exists.
  6306. */
  6307. /* function exit code */
  6308. __pyx_L1_error:;
  6309. __Pyx_XDECREF(__pyx_t_5);
  6310. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6311. __pyx_r = NULL;
  6312. __pyx_L0:;
  6313. __Pyx_XGIVEREF(__pyx_r);
  6314. __Pyx_RefNannyFinishContext();
  6315. return __pyx_r;
  6316. }
  6317. /* "gedlibpy.pyx":682
  6318. *
  6319. *
  6320. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6321. * """
  6322. * Returns the node's preimage in the adjacence matrix, if it exists.
  6323. */
  6324. /* Python wrapper */
  6325. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6326. 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";
  6327. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_67get_node_pre_image(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6328. PyObject *__pyx_v_g = 0;
  6329. PyObject *__pyx_v_h = 0;
  6330. PyObject *__pyx_v_node_id = 0;
  6331. PyObject *__pyx_r = 0;
  6332. __Pyx_RefNannyDeclarations
  6333. __Pyx_RefNannySetupContext("get_node_pre_image (wrapper)", 0);
  6334. {
  6335. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,&__pyx_n_s_node_id,0};
  6336. PyObject* values[3] = {0,0,0};
  6337. if (unlikely(__pyx_kwds)) {
  6338. Py_ssize_t kw_args;
  6339. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6340. switch (pos_args) {
  6341. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6342. CYTHON_FALLTHROUGH;
  6343. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6344. CYTHON_FALLTHROUGH;
  6345. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6346. CYTHON_FALLTHROUGH;
  6347. case 0: break;
  6348. default: goto __pyx_L5_argtuple_error;
  6349. }
  6350. kw_args = PyDict_Size(__pyx_kwds);
  6351. switch (pos_args) {
  6352. case 0:
  6353. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6354. else goto __pyx_L5_argtuple_error;
  6355. CYTHON_FALLTHROUGH;
  6356. case 1:
  6357. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6358. else {
  6359. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 1); __PYX_ERR(0, 682, __pyx_L3_error)
  6360. }
  6361. CYTHON_FALLTHROUGH;
  6362. case 2:
  6363. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_id)) != 0)) kw_args--;
  6364. else {
  6365. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, 2); __PYX_ERR(0, 682, __pyx_L3_error)
  6366. }
  6367. }
  6368. if (unlikely(kw_args > 0)) {
  6369. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_pre_image") < 0)) __PYX_ERR(0, 682, __pyx_L3_error)
  6370. }
  6371. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  6372. goto __pyx_L5_argtuple_error;
  6373. } else {
  6374. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6375. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6376. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  6377. }
  6378. __pyx_v_g = values[0];
  6379. __pyx_v_h = values[1];
  6380. __pyx_v_node_id = values[2];
  6381. }
  6382. goto __pyx_L4_argument_unpacking_done;
  6383. __pyx_L5_argtuple_error:;
  6384. __Pyx_RaiseArgtupleInvalid("get_node_pre_image", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 682, __pyx_L3_error)
  6385. __pyx_L3_error:;
  6386. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6387. __Pyx_RefNannyFinishContext();
  6388. return NULL;
  6389. __pyx_L4_argument_unpacking_done:;
  6390. __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);
  6391. /* function exit code */
  6392. __Pyx_RefNannyFinishContext();
  6393. return __pyx_r;
  6394. }
  6395. 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) {
  6396. PyObject *__pyx_r = NULL;
  6397. __Pyx_RefNannyDeclarations
  6398. size_t __pyx_t_1;
  6399. size_t __pyx_t_2;
  6400. size_t __pyx_t_3;
  6401. size_t __pyx_t_4;
  6402. PyObject *__pyx_t_5 = NULL;
  6403. __Pyx_RefNannySetupContext("get_node_pre_image", 0);
  6404. /* "gedlibpy.pyx":700
  6405. *
  6406. * """
  6407. * return self.c_env.getNodePreImage(g, h, node_id) # <<<<<<<<<<<<<<
  6408. *
  6409. *
  6410. */
  6411. __Pyx_XDECREF(__pyx_r);
  6412. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error)
  6413. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 700, __pyx_L1_error)
  6414. __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, 700, __pyx_L1_error)
  6415. try {
  6416. __pyx_t_4 = __pyx_v_self->c_env->getNodePreImage(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  6417. } catch(...) {
  6418. __Pyx_CppExn2PyErr();
  6419. __PYX_ERR(0, 700, __pyx_L1_error)
  6420. }
  6421. __pyx_t_5 = __Pyx_PyInt_FromSize_t(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 700, __pyx_L1_error)
  6422. __Pyx_GOTREF(__pyx_t_5);
  6423. __pyx_r = __pyx_t_5;
  6424. __pyx_t_5 = 0;
  6425. goto __pyx_L0;
  6426. /* "gedlibpy.pyx":682
  6427. *
  6428. *
  6429. * def get_node_pre_image(self, g, h, node_id) : # <<<<<<<<<<<<<<
  6430. * """
  6431. * Returns the node's preimage in the adjacence matrix, if it exists.
  6432. */
  6433. /* function exit code */
  6434. __pyx_L1_error:;
  6435. __Pyx_XDECREF(__pyx_t_5);
  6436. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_pre_image", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6437. __pyx_r = NULL;
  6438. __pyx_L0:;
  6439. __Pyx_XGIVEREF(__pyx_r);
  6440. __Pyx_RefNannyFinishContext();
  6441. return __pyx_r;
  6442. }
  6443. /* "gedlibpy.pyx":703
  6444. *
  6445. *
  6446. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6447. * """
  6448. * Returns the induced cost between the two indicated graphs.
  6449. */
  6450. /* Python wrapper */
  6451. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6452. 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";
  6453. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6454. PyObject *__pyx_v_g = 0;
  6455. PyObject *__pyx_v_h = 0;
  6456. PyObject *__pyx_r = 0;
  6457. __Pyx_RefNannyDeclarations
  6458. __Pyx_RefNannySetupContext("get_induced_cost (wrapper)", 0);
  6459. {
  6460. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6461. PyObject* values[2] = {0,0};
  6462. if (unlikely(__pyx_kwds)) {
  6463. Py_ssize_t kw_args;
  6464. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6465. switch (pos_args) {
  6466. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6467. CYTHON_FALLTHROUGH;
  6468. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6469. CYTHON_FALLTHROUGH;
  6470. case 0: break;
  6471. default: goto __pyx_L5_argtuple_error;
  6472. }
  6473. kw_args = PyDict_Size(__pyx_kwds);
  6474. switch (pos_args) {
  6475. case 0:
  6476. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6477. else goto __pyx_L5_argtuple_error;
  6478. CYTHON_FALLTHROUGH;
  6479. case 1:
  6480. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6481. else {
  6482. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, 1); __PYX_ERR(0, 703, __pyx_L3_error)
  6483. }
  6484. }
  6485. if (unlikely(kw_args > 0)) {
  6486. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_induced_cost") < 0)) __PYX_ERR(0, 703, __pyx_L3_error)
  6487. }
  6488. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6489. goto __pyx_L5_argtuple_error;
  6490. } else {
  6491. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6492. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6493. }
  6494. __pyx_v_g = values[0];
  6495. __pyx_v_h = values[1];
  6496. }
  6497. goto __pyx_L4_argument_unpacking_done;
  6498. __pyx_L5_argtuple_error:;
  6499. __Pyx_RaiseArgtupleInvalid("get_induced_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 703, __pyx_L3_error)
  6500. __pyx_L3_error:;
  6501. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6502. __Pyx_RefNannyFinishContext();
  6503. return NULL;
  6504. __pyx_L4_argument_unpacking_done:;
  6505. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_68get_induced_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6506. /* function exit code */
  6507. __Pyx_RefNannyFinishContext();
  6508. return __pyx_r;
  6509. }
  6510. 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) {
  6511. PyObject *__pyx_r = NULL;
  6512. __Pyx_RefNannyDeclarations
  6513. size_t __pyx_t_1;
  6514. size_t __pyx_t_2;
  6515. double __pyx_t_3;
  6516. PyObject *__pyx_t_4 = NULL;
  6517. __Pyx_RefNannySetupContext("get_induced_cost", 0);
  6518. /* "gedlibpy.pyx":719
  6519. *
  6520. * """
  6521. * return self.c_env.getInducedCost(g, h) # <<<<<<<<<<<<<<
  6522. *
  6523. *
  6524. */
  6525. __Pyx_XDECREF(__pyx_r);
  6526. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 719, __pyx_L1_error)
  6527. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 719, __pyx_L1_error)
  6528. try {
  6529. __pyx_t_3 = __pyx_v_self->c_env->getInducedCost(__pyx_t_1, __pyx_t_2);
  6530. } catch(...) {
  6531. __Pyx_CppExn2PyErr();
  6532. __PYX_ERR(0, 719, __pyx_L1_error)
  6533. }
  6534. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 719, __pyx_L1_error)
  6535. __Pyx_GOTREF(__pyx_t_4);
  6536. __pyx_r = __pyx_t_4;
  6537. __pyx_t_4 = 0;
  6538. goto __pyx_L0;
  6539. /* "gedlibpy.pyx":703
  6540. *
  6541. *
  6542. * def get_induced_cost(self, g, h) : # <<<<<<<<<<<<<<
  6543. * """
  6544. * Returns the induced cost between the two indicated graphs.
  6545. */
  6546. /* function exit code */
  6547. __pyx_L1_error:;
  6548. __Pyx_XDECREF(__pyx_t_4);
  6549. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6550. __pyx_r = NULL;
  6551. __pyx_L0:;
  6552. __Pyx_XGIVEREF(__pyx_r);
  6553. __Pyx_RefNannyFinishContext();
  6554. return __pyx_r;
  6555. }
  6556. /* "gedlibpy.pyx":722
  6557. *
  6558. *
  6559. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  6560. * """
  6561. * Returns the Node Map, like C++ NodeMap.
  6562. */
  6563. /* Python wrapper */
  6564. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  6565. 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";
  6566. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  6567. PyObject *__pyx_v_g = 0;
  6568. PyObject *__pyx_v_h = 0;
  6569. PyObject *__pyx_r = 0;
  6570. __Pyx_RefNannyDeclarations
  6571. __Pyx_RefNannySetupContext("get_node_map (wrapper)", 0);
  6572. {
  6573. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  6574. PyObject* values[2] = {0,0};
  6575. if (unlikely(__pyx_kwds)) {
  6576. Py_ssize_t kw_args;
  6577. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  6578. switch (pos_args) {
  6579. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6580. CYTHON_FALLTHROUGH;
  6581. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6582. CYTHON_FALLTHROUGH;
  6583. case 0: break;
  6584. default: goto __pyx_L5_argtuple_error;
  6585. }
  6586. kw_args = PyDict_Size(__pyx_kwds);
  6587. switch (pos_args) {
  6588. case 0:
  6589. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  6590. else goto __pyx_L5_argtuple_error;
  6591. CYTHON_FALLTHROUGH;
  6592. case 1:
  6593. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  6594. else {
  6595. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, 1); __PYX_ERR(0, 722, __pyx_L3_error)
  6596. }
  6597. }
  6598. if (unlikely(kw_args > 0)) {
  6599. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_map") < 0)) __PYX_ERR(0, 722, __pyx_L3_error)
  6600. }
  6601. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  6602. goto __pyx_L5_argtuple_error;
  6603. } else {
  6604. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  6605. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  6606. }
  6607. __pyx_v_g = values[0];
  6608. __pyx_v_h = values[1];
  6609. }
  6610. goto __pyx_L4_argument_unpacking_done;
  6611. __pyx_L5_argtuple_error:;
  6612. __Pyx_RaiseArgtupleInvalid("get_node_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 722, __pyx_L3_error)
  6613. __pyx_L3_error:;
  6614. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  6615. __Pyx_RefNannyFinishContext();
  6616. return NULL;
  6617. __pyx_L4_argument_unpacking_done:;
  6618. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_70get_node_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  6619. /* function exit code */
  6620. __Pyx_RefNannyFinishContext();
  6621. return __pyx_r;
  6622. }
  6623. 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) {
  6624. std::vector<std::pair<size_t,size_t> > __pyx_v_map_as_relation;
  6625. double __pyx_v_induced_cost;
  6626. PyObject *__pyx_v_source_map = NULL;
  6627. PyObject *__pyx_v_target_map = NULL;
  6628. Py_ssize_t __pyx_v_num_node_source;
  6629. Py_ssize_t __pyx_v_num_node_target;
  6630. PyObject *__pyx_v_node_map = NULL;
  6631. Py_ssize_t __pyx_v_i;
  6632. std::pair<size_t,size_t> __pyx_8genexpr5__pyx_v_item;
  6633. std::pair<size_t,size_t> __pyx_8genexpr6__pyx_v_item;
  6634. PyObject *__pyx_8genexpr7__pyx_v_item = NULL;
  6635. PyObject *__pyx_8genexpr8__pyx_v_item = NULL;
  6636. PyObject *__pyx_r = NULL;
  6637. __Pyx_RefNannyDeclarations
  6638. size_t __pyx_t_1;
  6639. size_t __pyx_t_2;
  6640. std::vector<std::pair<size_t,size_t> > __pyx_t_3;
  6641. double __pyx_t_4;
  6642. PyObject *__pyx_t_5 = NULL;
  6643. std::vector<std::pair<size_t,size_t> > ::iterator __pyx_t_6;
  6644. std::pair<size_t,size_t> __pyx_t_7;
  6645. PyObject *__pyx_t_8 = NULL;
  6646. PyObject *__pyx_t_9 = NULL;
  6647. Py_ssize_t __pyx_t_10;
  6648. PyObject *__pyx_t_11 = NULL;
  6649. int __pyx_t_12;
  6650. PyObject *__pyx_t_13 = NULL;
  6651. int __pyx_t_14;
  6652. PyObject *__pyx_t_15 = NULL;
  6653. Py_ssize_t __pyx_t_16;
  6654. Py_ssize_t __pyx_t_17;
  6655. __Pyx_RefNannySetupContext("get_node_map", 0);
  6656. /* "gedlibpy.pyx":737
  6657. * .. note:: This function creates datas so use it if necessary, however you can understand how assignement works with this example.
  6658. * """
  6659. * map_as_relation = self.c_env.getNodeMap(g, h) # <<<<<<<<<<<<<<
  6660. * 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.
  6661. * 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.
  6662. */
  6663. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error)
  6664. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 737, __pyx_L1_error)
  6665. try {
  6666. __pyx_t_3 = __pyx_v_self->c_env->getNodeMap(__pyx_t_1, __pyx_t_2);
  6667. } catch(...) {
  6668. __Pyx_CppExn2PyErr();
  6669. __PYX_ERR(0, 737, __pyx_L1_error)
  6670. }
  6671. __pyx_v_map_as_relation = __pyx_t_3;
  6672. /* "gedlibpy.pyx":738
  6673. * """
  6674. * map_as_relation = self.c_env.getNodeMap(g, h)
  6675. * 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. # <<<<<<<<<<<<<<
  6676. * 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.
  6677. * # print(source_map)
  6678. */
  6679. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error)
  6680. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 738, __pyx_L1_error)
  6681. try {
  6682. __pyx_t_4 = __pyx_v_self->c_env->getInducedCost(__pyx_t_2, __pyx_t_1);
  6683. } catch(...) {
  6684. __Pyx_CppExn2PyErr();
  6685. __PYX_ERR(0, 738, __pyx_L1_error)
  6686. }
  6687. __pyx_v_induced_cost = __pyx_t_4;
  6688. /* "gedlibpy.pyx":739
  6689. * map_as_relation = self.c_env.getNodeMap(g, h)
  6690. * 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.
  6691. * 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. # <<<<<<<<<<<<<<
  6692. * # print(source_map)
  6693. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6694. */
  6695. { /* enter inner scope */
  6696. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 739, __pyx_L1_error)
  6697. __Pyx_GOTREF(__pyx_t_5);
  6698. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6699. for (;;) {
  6700. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6701. __pyx_t_7 = *__pyx_t_6;
  6702. ++__pyx_t_6;
  6703. __pyx_8genexpr5__pyx_v_item = __pyx_t_7;
  6704. __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, 739, __pyx_L1_error)
  6705. __Pyx_GOTREF(__pyx_t_9);
  6706. __pyx_t_10 = PyObject_Length(__pyx_t_9); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 739, __pyx_L1_error)
  6707. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6708. if (((__pyx_8genexpr5__pyx_v_item.first < __pyx_t_10) != 0)) {
  6709. __pyx_t_9 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr5__pyx_v_item.first); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error)
  6710. __Pyx_GOTREF(__pyx_t_9);
  6711. __pyx_t_8 = __pyx_t_9;
  6712. __pyx_t_9 = 0;
  6713. } else {
  6714. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 739, __pyx_L1_error)
  6715. __Pyx_GOTREF(__pyx_t_9);
  6716. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 739, __pyx_L1_error)
  6717. __Pyx_GOTREF(__pyx_t_11);
  6718. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6719. __pyx_t_8 = __pyx_t_11;
  6720. __pyx_t_11 = 0;
  6721. }
  6722. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 739, __pyx_L1_error)
  6723. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6724. }
  6725. } /* exit inner scope */
  6726. __pyx_v_source_map = ((PyObject*)__pyx_t_5);
  6727. __pyx_t_5 = 0;
  6728. /* "gedlibpy.pyx":741
  6729. * 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.
  6730. * # print(source_map)
  6731. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation] # <<<<<<<<<<<<<<
  6732. * # print(target_map)
  6733. * num_node_source = len([item for item in source_map if item != np.inf])
  6734. */
  6735. { /* enter inner scope */
  6736. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 741, __pyx_L1_error)
  6737. __Pyx_GOTREF(__pyx_t_5);
  6738. __pyx_t_6 = __pyx_v_map_as_relation.begin();
  6739. for (;;) {
  6740. if (!(__pyx_t_6 != __pyx_v_map_as_relation.end())) break;
  6741. __pyx_t_7 = *__pyx_t_6;
  6742. ++__pyx_t_6;
  6743. __pyx_8genexpr6__pyx_v_item = __pyx_t_7;
  6744. __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, 741, __pyx_L1_error)
  6745. __Pyx_GOTREF(__pyx_t_11);
  6746. __pyx_t_10 = PyObject_Length(__pyx_t_11); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 741, __pyx_L1_error)
  6747. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6748. if (((__pyx_8genexpr6__pyx_v_item.second < __pyx_t_10) != 0)) {
  6749. __pyx_t_11 = __Pyx_PyInt_FromSize_t(__pyx_8genexpr6__pyx_v_item.second); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error)
  6750. __Pyx_GOTREF(__pyx_t_11);
  6751. __pyx_t_8 = __pyx_t_11;
  6752. __pyx_t_11 = 0;
  6753. } else {
  6754. __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_np); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 741, __pyx_L1_error)
  6755. __Pyx_GOTREF(__pyx_t_11);
  6756. __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_11, __pyx_n_s_inf); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
  6757. __Pyx_GOTREF(__pyx_t_9);
  6758. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6759. __pyx_t_8 = __pyx_t_9;
  6760. __pyx_t_9 = 0;
  6761. }
  6762. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_t_8))) __PYX_ERR(0, 741, __pyx_L1_error)
  6763. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6764. }
  6765. } /* exit inner scope */
  6766. __pyx_v_target_map = ((PyObject*)__pyx_t_5);
  6767. __pyx_t_5 = 0;
  6768. /* "gedlibpy.pyx":743
  6769. * target_map = [item.second if item.second < len(map_as_relation) else np.inf for item in map_as_relation]
  6770. * # print(target_map)
  6771. * num_node_source = len([item for item in source_map if item != np.inf]) # <<<<<<<<<<<<<<
  6772. * # print(num_node_source)
  6773. * num_node_target = len([item for item in target_map if item != np.inf])
  6774. */
  6775. { /* enter inner scope */
  6776. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 743, __pyx_L9_error)
  6777. __Pyx_GOTREF(__pyx_t_5);
  6778. __pyx_t_8 = __pyx_v_source_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6779. for (;;) {
  6780. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6781. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6782. __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, 743, __pyx_L9_error)
  6783. #else
  6784. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error)
  6785. __Pyx_GOTREF(__pyx_t_9);
  6786. #endif
  6787. __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_item, __pyx_t_9);
  6788. __pyx_t_9 = 0;
  6789. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 743, __pyx_L9_error)
  6790. __Pyx_GOTREF(__pyx_t_9);
  6791. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 743, __pyx_L9_error)
  6792. __Pyx_GOTREF(__pyx_t_11);
  6793. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6794. __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, 743, __pyx_L9_error)
  6795. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6796. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 743, __pyx_L9_error)
  6797. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6798. if (__pyx_t_12) {
  6799. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr7__pyx_v_item))) __PYX_ERR(0, 743, __pyx_L9_error)
  6800. }
  6801. }
  6802. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6803. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6804. goto __pyx_L13_exit_scope;
  6805. __pyx_L9_error:;
  6806. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item); __pyx_8genexpr7__pyx_v_item = 0;
  6807. goto __pyx_L1_error;
  6808. __pyx_L13_exit_scope:;
  6809. } /* exit inner scope */
  6810. __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
  6811. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6812. __pyx_v_num_node_source = __pyx_t_10;
  6813. /* "gedlibpy.pyx":745
  6814. * num_node_source = len([item for item in source_map if item != np.inf])
  6815. * # print(num_node_source)
  6816. * num_node_target = len([item for item in target_map if item != np.inf]) # <<<<<<<<<<<<<<
  6817. * # print(num_node_target)
  6818. *
  6819. */
  6820. { /* enter inner scope */
  6821. __pyx_t_5 = PyList_New(0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 745, __pyx_L16_error)
  6822. __Pyx_GOTREF(__pyx_t_5);
  6823. __pyx_t_8 = __pyx_v_target_map; __Pyx_INCREF(__pyx_t_8); __pyx_t_10 = 0;
  6824. for (;;) {
  6825. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_8)) break;
  6826. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  6827. __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, 745, __pyx_L16_error)
  6828. #else
  6829. __pyx_t_9 = PySequence_ITEM(__pyx_t_8, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error)
  6830. __Pyx_GOTREF(__pyx_t_9);
  6831. #endif
  6832. __Pyx_XDECREF_SET(__pyx_8genexpr8__pyx_v_item, __pyx_t_9);
  6833. __pyx_t_9 = 0;
  6834. __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_np); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 745, __pyx_L16_error)
  6835. __Pyx_GOTREF(__pyx_t_9);
  6836. __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_inf); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 745, __pyx_L16_error)
  6837. __Pyx_GOTREF(__pyx_t_11);
  6838. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6839. __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, 745, __pyx_L16_error)
  6840. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6841. __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 745, __pyx_L16_error)
  6842. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6843. if (__pyx_t_12) {
  6844. if (unlikely(__Pyx_ListComp_Append(__pyx_t_5, (PyObject*)__pyx_8genexpr8__pyx_v_item))) __PYX_ERR(0, 745, __pyx_L16_error)
  6845. }
  6846. }
  6847. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6848. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6849. goto __pyx_L20_exit_scope;
  6850. __pyx_L16_error:;
  6851. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item); __pyx_8genexpr8__pyx_v_item = 0;
  6852. goto __pyx_L1_error;
  6853. __pyx_L20_exit_scope:;
  6854. } /* exit inner scope */
  6855. __pyx_t_10 = PyList_GET_SIZE(__pyx_t_5); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 745, __pyx_L1_error)
  6856. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6857. __pyx_v_num_node_target = __pyx_t_10;
  6858. /* "gedlibpy.pyx":748
  6859. * # print(num_node_target)
  6860. *
  6861. * node_map = NodeMap(num_node_source, num_node_target) # <<<<<<<<<<<<<<
  6862. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6863. * for i in range(len(source_map)):
  6864. */
  6865. __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 748, __pyx_L1_error)
  6866. __Pyx_GOTREF(__pyx_t_8);
  6867. __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_num_node_source); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 748, __pyx_L1_error)
  6868. __Pyx_GOTREF(__pyx_t_9);
  6869. __pyx_t_11 = PyInt_FromSsize_t(__pyx_v_num_node_target); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 748, __pyx_L1_error)
  6870. __Pyx_GOTREF(__pyx_t_11);
  6871. __pyx_t_13 = NULL;
  6872. __pyx_t_14 = 0;
  6873. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
  6874. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
  6875. if (likely(__pyx_t_13)) {
  6876. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6877. __Pyx_INCREF(__pyx_t_13);
  6878. __Pyx_INCREF(function);
  6879. __Pyx_DECREF_SET(__pyx_t_8, function);
  6880. __pyx_t_14 = 1;
  6881. }
  6882. }
  6883. #if CYTHON_FAST_PYCALL
  6884. if (PyFunction_Check(__pyx_t_8)) {
  6885. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6886. __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, 748, __pyx_L1_error)
  6887. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6888. __Pyx_GOTREF(__pyx_t_5);
  6889. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6890. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6891. } else
  6892. #endif
  6893. #if CYTHON_FAST_PYCCALL
  6894. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6895. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_9, __pyx_t_11};
  6896. __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, 748, __pyx_L1_error)
  6897. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  6898. __Pyx_GOTREF(__pyx_t_5);
  6899. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  6900. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6901. } else
  6902. #endif
  6903. {
  6904. __pyx_t_15 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 748, __pyx_L1_error)
  6905. __Pyx_GOTREF(__pyx_t_15);
  6906. if (__pyx_t_13) {
  6907. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_13); __pyx_t_13 = NULL;
  6908. }
  6909. __Pyx_GIVEREF(__pyx_t_9);
  6910. PyTuple_SET_ITEM(__pyx_t_15, 0+__pyx_t_14, __pyx_t_9);
  6911. __Pyx_GIVEREF(__pyx_t_11);
  6912. PyTuple_SET_ITEM(__pyx_t_15, 1+__pyx_t_14, __pyx_t_11);
  6913. __pyx_t_9 = 0;
  6914. __pyx_t_11 = 0;
  6915. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
  6916. __Pyx_GOTREF(__pyx_t_5);
  6917. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6918. }
  6919. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6920. __pyx_v_node_map = __pyx_t_5;
  6921. __pyx_t_5 = 0;
  6922. /* "gedlibpy.pyx":750
  6923. * node_map = NodeMap(num_node_source, num_node_target)
  6924. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6925. * for i in range(len(source_map)): # <<<<<<<<<<<<<<
  6926. * node_map.add_assignment(source_map[i], target_map[i])
  6927. * node_map.set_induced_cost(induced_cost)
  6928. */
  6929. __pyx_t_10 = PyList_GET_SIZE(__pyx_v_source_map); if (unlikely(__pyx_t_10 == ((Py_ssize_t)-1))) __PYX_ERR(0, 750, __pyx_L1_error)
  6930. __pyx_t_16 = __pyx_t_10;
  6931. for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
  6932. __pyx_v_i = __pyx_t_17;
  6933. /* "gedlibpy.pyx":751
  6934. * # print(node_map.get_forward_map(), node_map.get_backward_map())
  6935. * for i in range(len(source_map)):
  6936. * node_map.add_assignment(source_map[i], target_map[i]) # <<<<<<<<<<<<<<
  6937. * node_map.set_induced_cost(induced_cost)
  6938. *
  6939. */
  6940. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_add_assignment); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 751, __pyx_L1_error)
  6941. __Pyx_GOTREF(__pyx_t_8);
  6942. __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, 751, __pyx_L1_error)
  6943. __Pyx_GOTREF(__pyx_t_15);
  6944. __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, 751, __pyx_L1_error)
  6945. __Pyx_GOTREF(__pyx_t_11);
  6946. __pyx_t_9 = NULL;
  6947. __pyx_t_14 = 0;
  6948. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  6949. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  6950. if (likely(__pyx_t_9)) {
  6951. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  6952. __Pyx_INCREF(__pyx_t_9);
  6953. __Pyx_INCREF(function);
  6954. __Pyx_DECREF_SET(__pyx_t_8, function);
  6955. __pyx_t_14 = 1;
  6956. }
  6957. }
  6958. #if CYTHON_FAST_PYCALL
  6959. if (PyFunction_Check(__pyx_t_8)) {
  6960. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6961. __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, 751, __pyx_L1_error)
  6962. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6963. __Pyx_GOTREF(__pyx_t_5);
  6964. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6965. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6966. } else
  6967. #endif
  6968. #if CYTHON_FAST_PYCCALL
  6969. if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
  6970. PyObject *__pyx_temp[3] = {__pyx_t_9, __pyx_t_15, __pyx_t_11};
  6971. __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, 751, __pyx_L1_error)
  6972. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  6973. __Pyx_GOTREF(__pyx_t_5);
  6974. __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
  6975. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  6976. } else
  6977. #endif
  6978. {
  6979. __pyx_t_13 = PyTuple_New(2+__pyx_t_14); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 751, __pyx_L1_error)
  6980. __Pyx_GOTREF(__pyx_t_13);
  6981. if (__pyx_t_9) {
  6982. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_9); __pyx_t_9 = NULL;
  6983. }
  6984. __Pyx_GIVEREF(__pyx_t_15);
  6985. PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_14, __pyx_t_15);
  6986. __Pyx_GIVEREF(__pyx_t_11);
  6987. PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_14, __pyx_t_11);
  6988. __pyx_t_15 = 0;
  6989. __pyx_t_11 = 0;
  6990. __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_13, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
  6991. __Pyx_GOTREF(__pyx_t_5);
  6992. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  6993. }
  6994. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  6995. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  6996. }
  6997. /* "gedlibpy.pyx":752
  6998. * for i in range(len(source_map)):
  6999. * node_map.add_assignment(source_map[i], target_map[i])
  7000. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  7001. *
  7002. * return node_map
  7003. */
  7004. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 752, __pyx_L1_error)
  7005. __Pyx_GOTREF(__pyx_t_8);
  7006. __pyx_t_13 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 752, __pyx_L1_error)
  7007. __Pyx_GOTREF(__pyx_t_13);
  7008. __pyx_t_11 = NULL;
  7009. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  7010. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_8);
  7011. if (likely(__pyx_t_11)) {
  7012. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  7013. __Pyx_INCREF(__pyx_t_11);
  7014. __Pyx_INCREF(function);
  7015. __Pyx_DECREF_SET(__pyx_t_8, function);
  7016. }
  7017. }
  7018. __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);
  7019. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  7020. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  7021. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 752, __pyx_L1_error)
  7022. __Pyx_GOTREF(__pyx_t_5);
  7023. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7024. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7025. /* "gedlibpy.pyx":754
  7026. * node_map.set_induced_cost(induced_cost)
  7027. *
  7028. * return node_map # <<<<<<<<<<<<<<
  7029. *
  7030. *
  7031. */
  7032. __Pyx_XDECREF(__pyx_r);
  7033. __Pyx_INCREF(__pyx_v_node_map);
  7034. __pyx_r = __pyx_v_node_map;
  7035. goto __pyx_L0;
  7036. /* "gedlibpy.pyx":722
  7037. *
  7038. *
  7039. * def get_node_map(self, g, h) : # <<<<<<<<<<<<<<
  7040. * """
  7041. * Returns the Node Map, like C++ NodeMap.
  7042. */
  7043. /* function exit code */
  7044. __pyx_L1_error:;
  7045. __Pyx_XDECREF(__pyx_t_5);
  7046. __Pyx_XDECREF(__pyx_t_8);
  7047. __Pyx_XDECREF(__pyx_t_9);
  7048. __Pyx_XDECREF(__pyx_t_11);
  7049. __Pyx_XDECREF(__pyx_t_13);
  7050. __Pyx_XDECREF(__pyx_t_15);
  7051. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7052. __pyx_r = NULL;
  7053. __pyx_L0:;
  7054. __Pyx_XDECREF(__pyx_v_source_map);
  7055. __Pyx_XDECREF(__pyx_v_target_map);
  7056. __Pyx_XDECREF(__pyx_v_node_map);
  7057. __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_item);
  7058. __Pyx_XDECREF(__pyx_8genexpr8__pyx_v_item);
  7059. __Pyx_XGIVEREF(__pyx_r);
  7060. __Pyx_RefNannyFinishContext();
  7061. return __pyx_r;
  7062. }
  7063. /* "gedlibpy.pyx":757
  7064. *
  7065. *
  7066. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7067. * """
  7068. * Returns the Assignment Matrix between two selected graphs g and h.
  7069. */
  7070. /* Python wrapper */
  7071. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7072. 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";
  7073. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7074. PyObject *__pyx_v_g = 0;
  7075. PyObject *__pyx_v_h = 0;
  7076. PyObject *__pyx_r = 0;
  7077. __Pyx_RefNannyDeclarations
  7078. __Pyx_RefNannySetupContext("get_assignment_matrix (wrapper)", 0);
  7079. {
  7080. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7081. PyObject* values[2] = {0,0};
  7082. if (unlikely(__pyx_kwds)) {
  7083. Py_ssize_t kw_args;
  7084. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7085. switch (pos_args) {
  7086. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7087. CYTHON_FALLTHROUGH;
  7088. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7089. CYTHON_FALLTHROUGH;
  7090. case 0: break;
  7091. default: goto __pyx_L5_argtuple_error;
  7092. }
  7093. kw_args = PyDict_Size(__pyx_kwds);
  7094. switch (pos_args) {
  7095. case 0:
  7096. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7097. else goto __pyx_L5_argtuple_error;
  7098. CYTHON_FALLTHROUGH;
  7099. case 1:
  7100. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7101. else {
  7102. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, 1); __PYX_ERR(0, 757, __pyx_L3_error)
  7103. }
  7104. }
  7105. if (unlikely(kw_args > 0)) {
  7106. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_assignment_matrix") < 0)) __PYX_ERR(0, 757, __pyx_L3_error)
  7107. }
  7108. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7109. goto __pyx_L5_argtuple_error;
  7110. } else {
  7111. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7112. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7113. }
  7114. __pyx_v_g = values[0];
  7115. __pyx_v_h = values[1];
  7116. }
  7117. goto __pyx_L4_argument_unpacking_done;
  7118. __pyx_L5_argtuple_error:;
  7119. __Pyx_RaiseArgtupleInvalid("get_assignment_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 757, __pyx_L3_error)
  7120. __pyx_L3_error:;
  7121. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7122. __Pyx_RefNannyFinishContext();
  7123. return NULL;
  7124. __pyx_L4_argument_unpacking_done:;
  7125. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_72get_assignment_matrix(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7126. /* function exit code */
  7127. __Pyx_RefNannyFinishContext();
  7128. return __pyx_r;
  7129. }
  7130. 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) {
  7131. PyObject *__pyx_r = NULL;
  7132. __Pyx_RefNannyDeclarations
  7133. size_t __pyx_t_1;
  7134. size_t __pyx_t_2;
  7135. std::vector<std::vector<int> > __pyx_t_3;
  7136. PyObject *__pyx_t_4 = NULL;
  7137. __Pyx_RefNannySetupContext("get_assignment_matrix", 0);
  7138. /* "gedlibpy.pyx":772
  7139. * .. note:: This function creates datas so use it if necessary.
  7140. * """
  7141. * return self.c_env.getAssignmentMatrix(g, h) # <<<<<<<<<<<<<<
  7142. *
  7143. *
  7144. */
  7145. __Pyx_XDECREF(__pyx_r);
  7146. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
  7147. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 772, __pyx_L1_error)
  7148. try {
  7149. __pyx_t_3 = __pyx_v_self->c_env->getAssignmentMatrix(__pyx_t_1, __pyx_t_2);
  7150. } catch(...) {
  7151. __Pyx_CppExn2PyErr();
  7152. __PYX_ERR(0, 772, __pyx_L1_error)
  7153. }
  7154. __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, 772, __pyx_L1_error)
  7155. __Pyx_GOTREF(__pyx_t_4);
  7156. __pyx_r = __pyx_t_4;
  7157. __pyx_t_4 = 0;
  7158. goto __pyx_L0;
  7159. /* "gedlibpy.pyx":757
  7160. *
  7161. *
  7162. * def get_assignment_matrix(self, g, h) : # <<<<<<<<<<<<<<
  7163. * """
  7164. * Returns the Assignment Matrix between two selected graphs g and h.
  7165. */
  7166. /* function exit code */
  7167. __pyx_L1_error:;
  7168. __Pyx_XDECREF(__pyx_t_4);
  7169. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_assignment_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7170. __pyx_r = NULL;
  7171. __pyx_L0:;
  7172. __Pyx_XGIVEREF(__pyx_r);
  7173. __Pyx_RefNannyFinishContext();
  7174. return __pyx_r;
  7175. }
  7176. /* "gedlibpy.pyx":775
  7177. *
  7178. *
  7179. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7180. * """
  7181. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7182. */
  7183. /* Python wrapper */
  7184. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7185. 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";
  7186. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7187. PyObject *__pyx_v_g = 0;
  7188. PyObject *__pyx_v_h = 0;
  7189. PyObject *__pyx_r = 0;
  7190. __Pyx_RefNannyDeclarations
  7191. __Pyx_RefNannySetupContext("get_all_map (wrapper)", 0);
  7192. {
  7193. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7194. PyObject* values[2] = {0,0};
  7195. if (unlikely(__pyx_kwds)) {
  7196. Py_ssize_t kw_args;
  7197. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7198. switch (pos_args) {
  7199. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7200. CYTHON_FALLTHROUGH;
  7201. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7202. CYTHON_FALLTHROUGH;
  7203. case 0: break;
  7204. default: goto __pyx_L5_argtuple_error;
  7205. }
  7206. kw_args = PyDict_Size(__pyx_kwds);
  7207. switch (pos_args) {
  7208. case 0:
  7209. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7210. else goto __pyx_L5_argtuple_error;
  7211. CYTHON_FALLTHROUGH;
  7212. case 1:
  7213. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7214. else {
  7215. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, 1); __PYX_ERR(0, 775, __pyx_L3_error)
  7216. }
  7217. }
  7218. if (unlikely(kw_args > 0)) {
  7219. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_all_map") < 0)) __PYX_ERR(0, 775, __pyx_L3_error)
  7220. }
  7221. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7222. goto __pyx_L5_argtuple_error;
  7223. } else {
  7224. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7225. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7226. }
  7227. __pyx_v_g = values[0];
  7228. __pyx_v_h = values[1];
  7229. }
  7230. goto __pyx_L4_argument_unpacking_done;
  7231. __pyx_L5_argtuple_error:;
  7232. __Pyx_RaiseArgtupleInvalid("get_all_map", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 775, __pyx_L3_error)
  7233. __pyx_L3_error:;
  7234. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7235. __Pyx_RefNannyFinishContext();
  7236. return NULL;
  7237. __pyx_L4_argument_unpacking_done:;
  7238. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_74get_all_map(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7239. /* function exit code */
  7240. __Pyx_RefNannyFinishContext();
  7241. return __pyx_r;
  7242. }
  7243. 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) {
  7244. PyObject *__pyx_r = NULL;
  7245. __Pyx_RefNannyDeclarations
  7246. size_t __pyx_t_1;
  7247. size_t __pyx_t_2;
  7248. std::vector<std::vector<npy_uint64> > __pyx_t_3;
  7249. PyObject *__pyx_t_4 = NULL;
  7250. __Pyx_RefNannySetupContext("get_all_map", 0);
  7251. /* "gedlibpy.pyx":790
  7252. * .. 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 !
  7253. * """
  7254. * return self.c_env.getAllMap(g, h) # <<<<<<<<<<<<<<
  7255. *
  7256. *
  7257. */
  7258. __Pyx_XDECREF(__pyx_r);
  7259. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
  7260. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 790, __pyx_L1_error)
  7261. try {
  7262. __pyx_t_3 = __pyx_v_self->c_env->getAllMap(__pyx_t_1, __pyx_t_2);
  7263. } catch(...) {
  7264. __Pyx_CppExn2PyErr();
  7265. __PYX_ERR(0, 790, __pyx_L1_error)
  7266. }
  7267. __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, 790, __pyx_L1_error)
  7268. __Pyx_GOTREF(__pyx_t_4);
  7269. __pyx_r = __pyx_t_4;
  7270. __pyx_t_4 = 0;
  7271. goto __pyx_L0;
  7272. /* "gedlibpy.pyx":775
  7273. *
  7274. *
  7275. * def get_all_map(self, g, h) : # <<<<<<<<<<<<<<
  7276. * """
  7277. * Returns a vector which contains the forward and the backward maps between nodes of the two indicated graphs.
  7278. */
  7279. /* function exit code */
  7280. __pyx_L1_error:;
  7281. __Pyx_XDECREF(__pyx_t_4);
  7282. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_all_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7283. __pyx_r = NULL;
  7284. __pyx_L0:;
  7285. __Pyx_XGIVEREF(__pyx_r);
  7286. __Pyx_RefNannyFinishContext();
  7287. return __pyx_r;
  7288. }
  7289. /* "gedlibpy.pyx":793
  7290. *
  7291. *
  7292. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7293. * """
  7294. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7295. */
  7296. /* Python wrapper */
  7297. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7298. 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";
  7299. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7300. PyObject *__pyx_v_g = 0;
  7301. PyObject *__pyx_v_h = 0;
  7302. PyObject *__pyx_r = 0;
  7303. __Pyx_RefNannyDeclarations
  7304. __Pyx_RefNannySetupContext("get_runtime (wrapper)", 0);
  7305. {
  7306. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_h,0};
  7307. PyObject* values[2] = {0,0};
  7308. if (unlikely(__pyx_kwds)) {
  7309. Py_ssize_t kw_args;
  7310. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7311. switch (pos_args) {
  7312. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7313. CYTHON_FALLTHROUGH;
  7314. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7315. CYTHON_FALLTHROUGH;
  7316. case 0: break;
  7317. default: goto __pyx_L5_argtuple_error;
  7318. }
  7319. kw_args = PyDict_Size(__pyx_kwds);
  7320. switch (pos_args) {
  7321. case 0:
  7322. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  7323. else goto __pyx_L5_argtuple_error;
  7324. CYTHON_FALLTHROUGH;
  7325. case 1:
  7326. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h)) != 0)) kw_args--;
  7327. else {
  7328. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, 1); __PYX_ERR(0, 793, __pyx_L3_error)
  7329. }
  7330. }
  7331. if (unlikely(kw_args > 0)) {
  7332. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_runtime") < 0)) __PYX_ERR(0, 793, __pyx_L3_error)
  7333. }
  7334. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  7335. goto __pyx_L5_argtuple_error;
  7336. } else {
  7337. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7338. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7339. }
  7340. __pyx_v_g = values[0];
  7341. __pyx_v_h = values[1];
  7342. }
  7343. goto __pyx_L4_argument_unpacking_done;
  7344. __pyx_L5_argtuple_error:;
  7345. __Pyx_RaiseArgtupleInvalid("get_runtime", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 793, __pyx_L3_error)
  7346. __pyx_L3_error:;
  7347. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7348. __Pyx_RefNannyFinishContext();
  7349. return NULL;
  7350. __pyx_L4_argument_unpacking_done:;
  7351. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), __pyx_v_g, __pyx_v_h);
  7352. /* function exit code */
  7353. __Pyx_RefNannyFinishContext();
  7354. return __pyx_r;
  7355. }
  7356. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_76get_runtime(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_g, PyObject *__pyx_v_h) {
  7357. PyObject *__pyx_r = NULL;
  7358. __Pyx_RefNannyDeclarations
  7359. size_t __pyx_t_1;
  7360. size_t __pyx_t_2;
  7361. double __pyx_t_3;
  7362. PyObject *__pyx_t_4 = NULL;
  7363. __Pyx_RefNannySetupContext("get_runtime", 0);
  7364. /* "gedlibpy.pyx":808
  7365. * .. note:: Python is a bit longer than C++ due to the functions's encapsulate.
  7366. * """
  7367. * return self.c_env.getRuntime(g,h) # <<<<<<<<<<<<<<
  7368. *
  7369. *
  7370. */
  7371. __Pyx_XDECREF(__pyx_r);
  7372. __pyx_t_1 = __Pyx_PyInt_As_size_t(__pyx_v_g); if (unlikely((__pyx_t_1 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error)
  7373. __pyx_t_2 = __Pyx_PyInt_As_size_t(__pyx_v_h); if (unlikely((__pyx_t_2 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 808, __pyx_L1_error)
  7374. try {
  7375. __pyx_t_3 = __pyx_v_self->c_env->getRuntime(__pyx_t_1, __pyx_t_2);
  7376. } catch(...) {
  7377. __Pyx_CppExn2PyErr();
  7378. __PYX_ERR(0, 808, __pyx_L1_error)
  7379. }
  7380. __pyx_t_4 = PyFloat_FromDouble(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 808, __pyx_L1_error)
  7381. __Pyx_GOTREF(__pyx_t_4);
  7382. __pyx_r = __pyx_t_4;
  7383. __pyx_t_4 = 0;
  7384. goto __pyx_L0;
  7385. /* "gedlibpy.pyx":793
  7386. *
  7387. *
  7388. * def get_runtime(self, g, h) : # <<<<<<<<<<<<<<
  7389. * """
  7390. * Returns the runtime to compute the edit distance cost between two graphs g and h
  7391. */
  7392. /* function exit code */
  7393. __pyx_L1_error:;
  7394. __Pyx_XDECREF(__pyx_t_4);
  7395. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_runtime", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7396. __pyx_r = NULL;
  7397. __pyx_L0:;
  7398. __Pyx_XGIVEREF(__pyx_r);
  7399. __Pyx_RefNannyFinishContext();
  7400. return __pyx_r;
  7401. }
  7402. /* "gedlibpy.pyx":811
  7403. *
  7404. *
  7405. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7406. * """
  7407. * Checks and returns if the edit costs are quasimetric.
  7408. */
  7409. /* Python wrapper */
  7410. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  7411. 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";
  7412. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  7413. PyObject *__pyx_r = 0;
  7414. __Pyx_RefNannyDeclarations
  7415. __Pyx_RefNannySetupContext("quasimetric_cost (wrapper)", 0);
  7416. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  7417. /* function exit code */
  7418. __Pyx_RefNannyFinishContext();
  7419. return __pyx_r;
  7420. }
  7421. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_78quasimetric_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  7422. PyObject *__pyx_r = NULL;
  7423. __Pyx_RefNannyDeclarations
  7424. bool __pyx_t_1;
  7425. PyObject *__pyx_t_2 = NULL;
  7426. __Pyx_RefNannySetupContext("quasimetric_cost", 0);
  7427. /* "gedlibpy.pyx":825
  7428. * .. warning:: run_method() between the same two graph must be called before this function.
  7429. * """
  7430. * return self.c_env.quasimetricCosts() # <<<<<<<<<<<<<<
  7431. *
  7432. *
  7433. */
  7434. __Pyx_XDECREF(__pyx_r);
  7435. try {
  7436. __pyx_t_1 = __pyx_v_self->c_env->quasimetricCosts();
  7437. } catch(...) {
  7438. __Pyx_CppExn2PyErr();
  7439. __PYX_ERR(0, 825, __pyx_L1_error)
  7440. }
  7441. __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 825, __pyx_L1_error)
  7442. __Pyx_GOTREF(__pyx_t_2);
  7443. __pyx_r = __pyx_t_2;
  7444. __pyx_t_2 = 0;
  7445. goto __pyx_L0;
  7446. /* "gedlibpy.pyx":811
  7447. *
  7448. *
  7449. * def quasimetric_cost(self) : # <<<<<<<<<<<<<<
  7450. * """
  7451. * Checks and returns if the edit costs are quasimetric.
  7452. */
  7453. /* function exit code */
  7454. __pyx_L1_error:;
  7455. __Pyx_XDECREF(__pyx_t_2);
  7456. __Pyx_AddTraceback("gedlibpy.GEDEnv.quasimetric_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7457. __pyx_r = NULL;
  7458. __pyx_L0:;
  7459. __Pyx_XGIVEREF(__pyx_r);
  7460. __Pyx_RefNannyFinishContext();
  7461. return __pyx_r;
  7462. }
  7463. /* "gedlibpy.pyx":828
  7464. *
  7465. *
  7466. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7467. * """
  7468. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7469. */
  7470. /* Python wrapper */
  7471. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7472. 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";
  7473. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7474. PyObject *__pyx_r = 0;
  7475. __Pyx_RefNannyDeclarations
  7476. __Pyx_RefNannySetupContext("hungarian_LSAP (wrapper)", 0);
  7477. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7478. /* function exit code */
  7479. __Pyx_RefNannyFinishContext();
  7480. return __pyx_r;
  7481. }
  7482. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_80hungarian_LSAP(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7483. PyObject *__pyx_r = NULL;
  7484. __Pyx_RefNannyDeclarations
  7485. std::vector<std::vector<size_t> > __pyx_t_1;
  7486. std::vector<std::vector<size_t> > __pyx_t_2;
  7487. PyObject *__pyx_t_3 = NULL;
  7488. __Pyx_RefNannySetupContext("hungarian_LSAP", 0);
  7489. /* "gedlibpy.pyx":839
  7490. * .. seealso:: hungarian_LSAPE()
  7491. * """
  7492. * return self.c_env.hungarianLSAP(matrix_cost) # <<<<<<<<<<<<<<
  7493. *
  7494. *
  7495. */
  7496. __Pyx_XDECREF(__pyx_r);
  7497. __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, 839, __pyx_L1_error)
  7498. try {
  7499. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAP(__pyx_t_1);
  7500. } catch(...) {
  7501. __Pyx_CppExn2PyErr();
  7502. __PYX_ERR(0, 839, __pyx_L1_error)
  7503. }
  7504. __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, 839, __pyx_L1_error)
  7505. __Pyx_GOTREF(__pyx_t_3);
  7506. __pyx_r = __pyx_t_3;
  7507. __pyx_t_3 = 0;
  7508. goto __pyx_L0;
  7509. /* "gedlibpy.pyx":828
  7510. *
  7511. *
  7512. * def hungarian_LSAP(self, matrix_cost) : # <<<<<<<<<<<<<<
  7513. * """
  7514. * Applies the hungarian algorithm (LSAP) on a matrix Cost.
  7515. */
  7516. /* function exit code */
  7517. __pyx_L1_error:;
  7518. __Pyx_XDECREF(__pyx_t_3);
  7519. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAP", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7520. __pyx_r = NULL;
  7521. __pyx_L0:;
  7522. __Pyx_XGIVEREF(__pyx_r);
  7523. __Pyx_RefNannyFinishContext();
  7524. return __pyx_r;
  7525. }
  7526. /* "gedlibpy.pyx":842
  7527. *
  7528. *
  7529. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7530. * """
  7531. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7532. */
  7533. /* Python wrapper */
  7534. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost); /*proto*/
  7535. 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";
  7536. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE(PyObject *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7537. PyObject *__pyx_r = 0;
  7538. __Pyx_RefNannyDeclarations
  7539. __Pyx_RefNannySetupContext("hungarian_LSAPE (wrapper)", 0);
  7540. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_matrix_cost));
  7541. /* function exit code */
  7542. __Pyx_RefNannyFinishContext();
  7543. return __pyx_r;
  7544. }
  7545. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_82hungarian_LSAPE(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_matrix_cost) {
  7546. PyObject *__pyx_r = NULL;
  7547. __Pyx_RefNannyDeclarations
  7548. std::vector<std::vector<double> > __pyx_t_1;
  7549. std::vector<std::vector<double> > __pyx_t_2;
  7550. PyObject *__pyx_t_3 = NULL;
  7551. __Pyx_RefNannySetupContext("hungarian_LSAPE", 0);
  7552. /* "gedlibpy.pyx":853
  7553. * .. seealso:: hungarian_LSAP()
  7554. * """
  7555. * return self.c_env.hungarianLSAPE(matrix_cost) # <<<<<<<<<<<<<<
  7556. *
  7557. *
  7558. */
  7559. __Pyx_XDECREF(__pyx_r);
  7560. __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, 853, __pyx_L1_error)
  7561. try {
  7562. __pyx_t_2 = __pyx_v_self->c_env->hungarianLSAPE(__pyx_t_1);
  7563. } catch(...) {
  7564. __Pyx_CppExn2PyErr();
  7565. __PYX_ERR(0, 853, __pyx_L1_error)
  7566. }
  7567. __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, 853, __pyx_L1_error)
  7568. __Pyx_GOTREF(__pyx_t_3);
  7569. __pyx_r = __pyx_t_3;
  7570. __pyx_t_3 = 0;
  7571. goto __pyx_L0;
  7572. /* "gedlibpy.pyx":842
  7573. *
  7574. *
  7575. * def hungarian_LSAPE(self, matrix_cost) : # <<<<<<<<<<<<<<
  7576. * """
  7577. * Applies the hungarian algorithm (LSAPE) on a matrix Cost.
  7578. */
  7579. /* function exit code */
  7580. __pyx_L1_error:;
  7581. __Pyx_XDECREF(__pyx_t_3);
  7582. __Pyx_AddTraceback("gedlibpy.GEDEnv.hungarian_LSAPE", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7583. __pyx_r = NULL;
  7584. __pyx_L0:;
  7585. __Pyx_XGIVEREF(__pyx_r);
  7586. __Pyx_RefNannyFinishContext();
  7587. return __pyx_r;
  7588. }
  7589. /* "gedlibpy.pyx":856
  7590. *
  7591. *
  7592. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  7593. * """
  7594. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  7595. */
  7596. /* Python wrapper */
  7597. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  7598. 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";
  7599. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  7600. PyObject *__pyx_v_name = 0;
  7601. PyObject *__pyx_v_classe = 0;
  7602. PyObject *__pyx_v_list_of_nodes = 0;
  7603. PyObject *__pyx_v_list_of_edges = 0;
  7604. PyObject *__pyx_v_ignore_duplicates = 0;
  7605. PyObject *__pyx_r = 0;
  7606. __Pyx_RefNannyDeclarations
  7607. __Pyx_RefNannySetupContext("add_random_graph (wrapper)", 0);
  7608. {
  7609. 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};
  7610. PyObject* values[5] = {0,0,0,0,0};
  7611. values[4] = ((PyObject *)Py_True);
  7612. if (unlikely(__pyx_kwds)) {
  7613. Py_ssize_t kw_args;
  7614. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  7615. switch (pos_args) {
  7616. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7617. CYTHON_FALLTHROUGH;
  7618. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7619. CYTHON_FALLTHROUGH;
  7620. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7621. CYTHON_FALLTHROUGH;
  7622. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7623. CYTHON_FALLTHROUGH;
  7624. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7625. CYTHON_FALLTHROUGH;
  7626. case 0: break;
  7627. default: goto __pyx_L5_argtuple_error;
  7628. }
  7629. kw_args = PyDict_Size(__pyx_kwds);
  7630. switch (pos_args) {
  7631. case 0:
  7632. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
  7633. else goto __pyx_L5_argtuple_error;
  7634. CYTHON_FALLTHROUGH;
  7635. case 1:
  7636. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  7637. else {
  7638. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 1); __PYX_ERR(0, 856, __pyx_L3_error)
  7639. }
  7640. CYTHON_FALLTHROUGH;
  7641. case 2:
  7642. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_nodes)) != 0)) kw_args--;
  7643. else {
  7644. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 2); __PYX_ERR(0, 856, __pyx_L3_error)
  7645. }
  7646. CYTHON_FALLTHROUGH;
  7647. case 3:
  7648. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_of_edges)) != 0)) kw_args--;
  7649. else {
  7650. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, 3); __PYX_ERR(0, 856, __pyx_L3_error)
  7651. }
  7652. CYTHON_FALLTHROUGH;
  7653. case 4:
  7654. if (kw_args > 0) {
  7655. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  7656. if (value) { values[4] = value; kw_args--; }
  7657. }
  7658. }
  7659. if (unlikely(kw_args > 0)) {
  7660. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_random_graph") < 0)) __PYX_ERR(0, 856, __pyx_L3_error)
  7661. }
  7662. } else {
  7663. switch (PyTuple_GET_SIZE(__pyx_args)) {
  7664. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  7665. CYTHON_FALLTHROUGH;
  7666. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  7667. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  7668. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  7669. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  7670. break;
  7671. default: goto __pyx_L5_argtuple_error;
  7672. }
  7673. }
  7674. __pyx_v_name = values[0];
  7675. __pyx_v_classe = values[1];
  7676. __pyx_v_list_of_nodes = values[2];
  7677. __pyx_v_list_of_edges = values[3];
  7678. __pyx_v_ignore_duplicates = values[4];
  7679. }
  7680. goto __pyx_L4_argument_unpacking_done;
  7681. __pyx_L5_argtuple_error:;
  7682. __Pyx_RaiseArgtupleInvalid("add_random_graph", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 856, __pyx_L3_error)
  7683. __pyx_L3_error:;
  7684. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  7685. __Pyx_RefNannyFinishContext();
  7686. return NULL;
  7687. __pyx_L4_argument_unpacking_done:;
  7688. __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);
  7689. /* function exit code */
  7690. __Pyx_RefNannyFinishContext();
  7691. return __pyx_r;
  7692. }
  7693. 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) {
  7694. PyObject *__pyx_v_id = NULL;
  7695. PyObject *__pyx_v_node = NULL;
  7696. PyObject *__pyx_v_edge = NULL;
  7697. PyObject *__pyx_r = NULL;
  7698. __Pyx_RefNannyDeclarations
  7699. PyObject *__pyx_t_1 = NULL;
  7700. PyObject *__pyx_t_2 = NULL;
  7701. PyObject *__pyx_t_3 = NULL;
  7702. int __pyx_t_4;
  7703. PyObject *__pyx_t_5 = NULL;
  7704. Py_ssize_t __pyx_t_6;
  7705. PyObject *(*__pyx_t_7)(PyObject *);
  7706. PyObject *__pyx_t_8 = NULL;
  7707. PyObject *__pyx_t_9 = NULL;
  7708. PyObject *__pyx_t_10 = NULL;
  7709. PyObject *__pyx_t_11 = NULL;
  7710. __Pyx_RefNannySetupContext("add_random_graph", 0);
  7711. /* "gedlibpy.pyx":876
  7712. *
  7713. * """
  7714. * id = self.add_graph(name, classe) # <<<<<<<<<<<<<<
  7715. * for node in list_of_nodes:
  7716. * self.add_node(id, node[0], node[1])
  7717. */
  7718. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
  7719. __Pyx_GOTREF(__pyx_t_2);
  7720. __pyx_t_3 = NULL;
  7721. __pyx_t_4 = 0;
  7722. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  7723. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  7724. if (likely(__pyx_t_3)) {
  7725. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  7726. __Pyx_INCREF(__pyx_t_3);
  7727. __Pyx_INCREF(function);
  7728. __Pyx_DECREF_SET(__pyx_t_2, function);
  7729. __pyx_t_4 = 1;
  7730. }
  7731. }
  7732. #if CYTHON_FAST_PYCALL
  7733. if (PyFunction_Check(__pyx_t_2)) {
  7734. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7735. __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, 876, __pyx_L1_error)
  7736. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7737. __Pyx_GOTREF(__pyx_t_1);
  7738. } else
  7739. #endif
  7740. #if CYTHON_FAST_PYCCALL
  7741. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  7742. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_name, __pyx_v_classe};
  7743. __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, 876, __pyx_L1_error)
  7744. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  7745. __Pyx_GOTREF(__pyx_t_1);
  7746. } else
  7747. #endif
  7748. {
  7749. __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 876, __pyx_L1_error)
  7750. __Pyx_GOTREF(__pyx_t_5);
  7751. if (__pyx_t_3) {
  7752. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
  7753. }
  7754. __Pyx_INCREF(__pyx_v_name);
  7755. __Pyx_GIVEREF(__pyx_v_name);
  7756. PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_name);
  7757. __Pyx_INCREF(__pyx_v_classe);
  7758. __Pyx_GIVEREF(__pyx_v_classe);
  7759. PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_classe);
  7760. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
  7761. __Pyx_GOTREF(__pyx_t_1);
  7762. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7763. }
  7764. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7765. __pyx_v_id = __pyx_t_1;
  7766. __pyx_t_1 = 0;
  7767. /* "gedlibpy.pyx":877
  7768. * """
  7769. * id = self.add_graph(name, classe)
  7770. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7771. * self.add_node(id, node[0], node[1])
  7772. * for edge in list_of_edges:
  7773. */
  7774. if (likely(PyList_CheckExact(__pyx_v_list_of_nodes)) || PyTuple_CheckExact(__pyx_v_list_of_nodes)) {
  7775. __pyx_t_1 = __pyx_v_list_of_nodes; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7776. __pyx_t_7 = NULL;
  7777. } else {
  7778. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 877, __pyx_L1_error)
  7779. __Pyx_GOTREF(__pyx_t_1);
  7780. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 877, __pyx_L1_error)
  7781. }
  7782. for (;;) {
  7783. if (likely(!__pyx_t_7)) {
  7784. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7785. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7786. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7787. __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, 877, __pyx_L1_error)
  7788. #else
  7789. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error)
  7790. __Pyx_GOTREF(__pyx_t_2);
  7791. #endif
  7792. } else {
  7793. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7794. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7795. __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, 877, __pyx_L1_error)
  7796. #else
  7797. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error)
  7798. __Pyx_GOTREF(__pyx_t_2);
  7799. #endif
  7800. }
  7801. } else {
  7802. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7803. if (unlikely(!__pyx_t_2)) {
  7804. PyObject* exc_type = PyErr_Occurred();
  7805. if (exc_type) {
  7806. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7807. else __PYX_ERR(0, 877, __pyx_L1_error)
  7808. }
  7809. break;
  7810. }
  7811. __Pyx_GOTREF(__pyx_t_2);
  7812. }
  7813. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_2);
  7814. __pyx_t_2 = 0;
  7815. /* "gedlibpy.pyx":878
  7816. * id = self.add_graph(name, classe)
  7817. * for node in list_of_nodes:
  7818. * self.add_node(id, node[0], node[1]) # <<<<<<<<<<<<<<
  7819. * for edge in list_of_edges:
  7820. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7821. */
  7822. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 878, __pyx_L1_error)
  7823. __Pyx_GOTREF(__pyx_t_5);
  7824. __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, 878, __pyx_L1_error)
  7825. __Pyx_GOTREF(__pyx_t_3);
  7826. __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, 878, __pyx_L1_error)
  7827. __Pyx_GOTREF(__pyx_t_8);
  7828. __pyx_t_9 = NULL;
  7829. __pyx_t_4 = 0;
  7830. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7831. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7832. if (likely(__pyx_t_9)) {
  7833. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7834. __Pyx_INCREF(__pyx_t_9);
  7835. __Pyx_INCREF(function);
  7836. __Pyx_DECREF_SET(__pyx_t_5, function);
  7837. __pyx_t_4 = 1;
  7838. }
  7839. }
  7840. #if CYTHON_FAST_PYCALL
  7841. if (PyFunction_Check(__pyx_t_5)) {
  7842. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7843. __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, 878, __pyx_L1_error)
  7844. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7845. __Pyx_GOTREF(__pyx_t_2);
  7846. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7847. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7848. } else
  7849. #endif
  7850. #if CYTHON_FAST_PYCCALL
  7851. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7852. PyObject *__pyx_temp[4] = {__pyx_t_9, __pyx_v_id, __pyx_t_3, __pyx_t_8};
  7853. __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, 878, __pyx_L1_error)
  7854. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7855. __Pyx_GOTREF(__pyx_t_2);
  7856. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7857. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7858. } else
  7859. #endif
  7860. {
  7861. __pyx_t_10 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 878, __pyx_L1_error)
  7862. __Pyx_GOTREF(__pyx_t_10);
  7863. if (__pyx_t_9) {
  7864. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7865. }
  7866. __Pyx_INCREF(__pyx_v_id);
  7867. __Pyx_GIVEREF(__pyx_v_id);
  7868. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_4, __pyx_v_id);
  7869. __Pyx_GIVEREF(__pyx_t_3);
  7870. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_4, __pyx_t_3);
  7871. __Pyx_GIVEREF(__pyx_t_8);
  7872. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_4, __pyx_t_8);
  7873. __pyx_t_3 = 0;
  7874. __pyx_t_8 = 0;
  7875. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_10, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
  7876. __Pyx_GOTREF(__pyx_t_2);
  7877. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7878. }
  7879. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  7880. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  7881. /* "gedlibpy.pyx":877
  7882. * """
  7883. * id = self.add_graph(name, classe)
  7884. * for node in list_of_nodes: # <<<<<<<<<<<<<<
  7885. * self.add_node(id, node[0], node[1])
  7886. * for edge in list_of_edges:
  7887. */
  7888. }
  7889. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  7890. /* "gedlibpy.pyx":879
  7891. * for node in list_of_nodes:
  7892. * self.add_node(id, node[0], node[1])
  7893. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  7894. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  7895. * return id
  7896. */
  7897. if (likely(PyList_CheckExact(__pyx_v_list_of_edges)) || PyTuple_CheckExact(__pyx_v_list_of_edges)) {
  7898. __pyx_t_1 = __pyx_v_list_of_edges; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  7899. __pyx_t_7 = NULL;
  7900. } else {
  7901. __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_list_of_edges); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 879, __pyx_L1_error)
  7902. __Pyx_GOTREF(__pyx_t_1);
  7903. __pyx_t_7 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 879, __pyx_L1_error)
  7904. }
  7905. for (;;) {
  7906. if (likely(!__pyx_t_7)) {
  7907. if (likely(PyList_CheckExact(__pyx_t_1))) {
  7908. if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
  7909. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7910. __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, 879, __pyx_L1_error)
  7911. #else
  7912. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
  7913. __Pyx_GOTREF(__pyx_t_2);
  7914. #endif
  7915. } else {
  7916. if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  7917. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  7918. __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, 879, __pyx_L1_error)
  7919. #else
  7920. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
  7921. __Pyx_GOTREF(__pyx_t_2);
  7922. #endif
  7923. }
  7924. } else {
  7925. __pyx_t_2 = __pyx_t_7(__pyx_t_1);
  7926. if (unlikely(!__pyx_t_2)) {
  7927. PyObject* exc_type = PyErr_Occurred();
  7928. if (exc_type) {
  7929. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  7930. else __PYX_ERR(0, 879, __pyx_L1_error)
  7931. }
  7932. break;
  7933. }
  7934. __Pyx_GOTREF(__pyx_t_2);
  7935. }
  7936. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  7937. __pyx_t_2 = 0;
  7938. /* "gedlibpy.pyx":880
  7939. * self.add_node(id, node[0], node[1])
  7940. * for edge in list_of_edges:
  7941. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates) # <<<<<<<<<<<<<<
  7942. * return id
  7943. *
  7944. */
  7945. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 880, __pyx_L1_error)
  7946. __Pyx_GOTREF(__pyx_t_5);
  7947. __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, 880, __pyx_L1_error)
  7948. __Pyx_GOTREF(__pyx_t_10);
  7949. __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, 880, __pyx_L1_error)
  7950. __Pyx_GOTREF(__pyx_t_8);
  7951. __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, 880, __pyx_L1_error)
  7952. __Pyx_GOTREF(__pyx_t_3);
  7953. __pyx_t_9 = NULL;
  7954. __pyx_t_4 = 0;
  7955. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  7956. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_5);
  7957. if (likely(__pyx_t_9)) {
  7958. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  7959. __Pyx_INCREF(__pyx_t_9);
  7960. __Pyx_INCREF(function);
  7961. __Pyx_DECREF_SET(__pyx_t_5, function);
  7962. __pyx_t_4 = 1;
  7963. }
  7964. }
  7965. #if CYTHON_FAST_PYCALL
  7966. if (PyFunction_Check(__pyx_t_5)) {
  7967. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7968. __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, 880, __pyx_L1_error)
  7969. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7970. __Pyx_GOTREF(__pyx_t_2);
  7971. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7972. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7973. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7974. } else
  7975. #endif
  7976. #if CYTHON_FAST_PYCCALL
  7977. if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
  7978. PyObject *__pyx_temp[6] = {__pyx_t_9, __pyx_v_id, __pyx_t_10, __pyx_t_8, __pyx_t_3, __pyx_v_ignore_duplicates};
  7979. __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, 880, __pyx_L1_error)
  7980. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  7981. __Pyx_GOTREF(__pyx_t_2);
  7982. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  7983. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  7984. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  7985. } else
  7986. #endif
  7987. {
  7988. __pyx_t_11 = PyTuple_New(5+__pyx_t_4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 880, __pyx_L1_error)
  7989. __Pyx_GOTREF(__pyx_t_11);
  7990. if (__pyx_t_9) {
  7991. __Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_9); __pyx_t_9 = NULL;
  7992. }
  7993. __Pyx_INCREF(__pyx_v_id);
  7994. __Pyx_GIVEREF(__pyx_v_id);
  7995. PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_4, __pyx_v_id);
  7996. __Pyx_GIVEREF(__pyx_t_10);
  7997. PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_4, __pyx_t_10);
  7998. __Pyx_GIVEREF(__pyx_t_8);
  7999. PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_4, __pyx_t_8);
  8000. __Pyx_GIVEREF(__pyx_t_3);
  8001. PyTuple_SET_ITEM(__pyx_t_11, 3+__pyx_t_4, __pyx_t_3);
  8002. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8003. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8004. PyTuple_SET_ITEM(__pyx_t_11, 4+__pyx_t_4, __pyx_v_ignore_duplicates);
  8005. __pyx_t_10 = 0;
  8006. __pyx_t_8 = 0;
  8007. __pyx_t_3 = 0;
  8008. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_11, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error)
  8009. __Pyx_GOTREF(__pyx_t_2);
  8010. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8011. }
  8012. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  8013. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8014. /* "gedlibpy.pyx":879
  8015. * for node in list_of_nodes:
  8016. * self.add_node(id, node[0], node[1])
  8017. * for edge in list_of_edges: # <<<<<<<<<<<<<<
  8018. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8019. * return id
  8020. */
  8021. }
  8022. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8023. /* "gedlibpy.pyx":881
  8024. * for edge in list_of_edges:
  8025. * self.add_edge(id, edge[0], edge[1], edge[2], ignore_duplicates)
  8026. * return id # <<<<<<<<<<<<<<
  8027. *
  8028. *
  8029. */
  8030. __Pyx_XDECREF(__pyx_r);
  8031. __Pyx_INCREF(__pyx_v_id);
  8032. __pyx_r = __pyx_v_id;
  8033. goto __pyx_L0;
  8034. /* "gedlibpy.pyx":856
  8035. *
  8036. *
  8037. * def add_random_graph(self, name, classe, list_of_nodes, list_of_edges, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8038. * """
  8039. * Add a Graph (not GXL) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8040. */
  8041. /* function exit code */
  8042. __pyx_L1_error:;
  8043. __Pyx_XDECREF(__pyx_t_1);
  8044. __Pyx_XDECREF(__pyx_t_2);
  8045. __Pyx_XDECREF(__pyx_t_3);
  8046. __Pyx_XDECREF(__pyx_t_5);
  8047. __Pyx_XDECREF(__pyx_t_8);
  8048. __Pyx_XDECREF(__pyx_t_9);
  8049. __Pyx_XDECREF(__pyx_t_10);
  8050. __Pyx_XDECREF(__pyx_t_11);
  8051. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_random_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8052. __pyx_r = NULL;
  8053. __pyx_L0:;
  8054. __Pyx_XDECREF(__pyx_v_id);
  8055. __Pyx_XDECREF(__pyx_v_node);
  8056. __Pyx_XDECREF(__pyx_v_edge);
  8057. __Pyx_XGIVEREF(__pyx_r);
  8058. __Pyx_RefNannyFinishContext();
  8059. return __pyx_r;
  8060. }
  8061. /* "gedlibpy.pyx":884
  8062. *
  8063. *
  8064. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8065. * """
  8066. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8067. */
  8068. /* Python wrapper */
  8069. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8070. 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";
  8071. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8072. PyObject *__pyx_v_g = 0;
  8073. PyObject *__pyx_v_classe = 0;
  8074. PyObject *__pyx_v_ignore_duplicates = 0;
  8075. PyObject *__pyx_r = 0;
  8076. __Pyx_RefNannyDeclarations
  8077. __Pyx_RefNannySetupContext("add_nx_graph (wrapper)", 0);
  8078. {
  8079. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g,&__pyx_n_s_classe,&__pyx_n_s_ignore_duplicates,0};
  8080. PyObject* values[3] = {0,0,0};
  8081. values[2] = ((PyObject *)Py_True);
  8082. if (unlikely(__pyx_kwds)) {
  8083. Py_ssize_t kw_args;
  8084. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8085. switch (pos_args) {
  8086. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8087. CYTHON_FALLTHROUGH;
  8088. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8089. CYTHON_FALLTHROUGH;
  8090. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8091. CYTHON_FALLTHROUGH;
  8092. case 0: break;
  8093. default: goto __pyx_L5_argtuple_error;
  8094. }
  8095. kw_args = PyDict_Size(__pyx_kwds);
  8096. switch (pos_args) {
  8097. case 0:
  8098. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
  8099. else goto __pyx_L5_argtuple_error;
  8100. CYTHON_FALLTHROUGH;
  8101. case 1:
  8102. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classe)) != 0)) kw_args--;
  8103. else {
  8104. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, 1); __PYX_ERR(0, 884, __pyx_L3_error)
  8105. }
  8106. CYTHON_FALLTHROUGH;
  8107. case 2:
  8108. if (kw_args > 0) {
  8109. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_ignore_duplicates);
  8110. if (value) { values[2] = value; kw_args--; }
  8111. }
  8112. }
  8113. if (unlikely(kw_args > 0)) {
  8114. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "add_nx_graph") < 0)) __PYX_ERR(0, 884, __pyx_L3_error)
  8115. }
  8116. } else {
  8117. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8118. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8119. CYTHON_FALLTHROUGH;
  8120. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8121. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8122. break;
  8123. default: goto __pyx_L5_argtuple_error;
  8124. }
  8125. }
  8126. __pyx_v_g = values[0];
  8127. __pyx_v_classe = values[1];
  8128. __pyx_v_ignore_duplicates = values[2];
  8129. }
  8130. goto __pyx_L4_argument_unpacking_done;
  8131. __pyx_L5_argtuple_error:;
  8132. __Pyx_RaiseArgtupleInvalid("add_nx_graph", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 884, __pyx_L3_error)
  8133. __pyx_L3_error:;
  8134. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8135. __Pyx_RefNannyFinishContext();
  8136. return NULL;
  8137. __pyx_L4_argument_unpacking_done:;
  8138. __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);
  8139. /* function exit code */
  8140. __Pyx_RefNannyFinishContext();
  8141. return __pyx_r;
  8142. }
  8143. 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) {
  8144. PyObject *__pyx_v_id = NULL;
  8145. PyObject *__pyx_v_node = NULL;
  8146. PyObject *__pyx_v_edge = NULL;
  8147. PyObject *__pyx_r = NULL;
  8148. __Pyx_RefNannyDeclarations
  8149. PyObject *__pyx_t_1 = NULL;
  8150. PyObject *__pyx_t_2 = NULL;
  8151. PyObject *__pyx_t_3 = NULL;
  8152. PyObject *__pyx_t_4 = NULL;
  8153. int __pyx_t_5;
  8154. PyObject *__pyx_t_6 = NULL;
  8155. Py_ssize_t __pyx_t_7;
  8156. PyObject *(*__pyx_t_8)(PyObject *);
  8157. PyObject *__pyx_t_9 = NULL;
  8158. PyObject *__pyx_t_10 = NULL;
  8159. PyObject *__pyx_t_11 = NULL;
  8160. PyObject *__pyx_t_12 = NULL;
  8161. PyObject *__pyx_t_13 = NULL;
  8162. PyObject *__pyx_t_14 = NULL;
  8163. __Pyx_RefNannySetupContext("add_nx_graph", 0);
  8164. /* "gedlibpy.pyx":898
  8165. *
  8166. * """
  8167. * id = self.add_graph(g.name, classe) # <<<<<<<<<<<<<<
  8168. * for node in g.nodes:
  8169. * self.add_node(id, str(node), g.nodes[node])
  8170. */
  8171. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 898, __pyx_L1_error)
  8172. __Pyx_GOTREF(__pyx_t_2);
  8173. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_name); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 898, __pyx_L1_error)
  8174. __Pyx_GOTREF(__pyx_t_3);
  8175. __pyx_t_4 = NULL;
  8176. __pyx_t_5 = 0;
  8177. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8178. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
  8179. if (likely(__pyx_t_4)) {
  8180. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8181. __Pyx_INCREF(__pyx_t_4);
  8182. __Pyx_INCREF(function);
  8183. __Pyx_DECREF_SET(__pyx_t_2, function);
  8184. __pyx_t_5 = 1;
  8185. }
  8186. }
  8187. #if CYTHON_FAST_PYCALL
  8188. if (PyFunction_Check(__pyx_t_2)) {
  8189. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8190. __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, 898, __pyx_L1_error)
  8191. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8192. __Pyx_GOTREF(__pyx_t_1);
  8193. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8194. } else
  8195. #endif
  8196. #if CYTHON_FAST_PYCCALL
  8197. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8198. PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_3, __pyx_v_classe};
  8199. __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, 898, __pyx_L1_error)
  8200. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8201. __Pyx_GOTREF(__pyx_t_1);
  8202. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8203. } else
  8204. #endif
  8205. {
  8206. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 898, __pyx_L1_error)
  8207. __Pyx_GOTREF(__pyx_t_6);
  8208. if (__pyx_t_4) {
  8209. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8210. }
  8211. __Pyx_GIVEREF(__pyx_t_3);
  8212. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
  8213. __Pyx_INCREF(__pyx_v_classe);
  8214. __Pyx_GIVEREF(__pyx_v_classe);
  8215. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_classe);
  8216. __pyx_t_3 = 0;
  8217. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 898, __pyx_L1_error)
  8218. __Pyx_GOTREF(__pyx_t_1);
  8219. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8220. }
  8221. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8222. __pyx_v_id = __pyx_t_1;
  8223. __pyx_t_1 = 0;
  8224. /* "gedlibpy.pyx":899
  8225. * """
  8226. * id = self.add_graph(g.name, classe)
  8227. * for node in g.nodes: # <<<<<<<<<<<<<<
  8228. * self.add_node(id, str(node), g.nodes[node])
  8229. * for edge in g.edges:
  8230. */
  8231. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
  8232. __Pyx_GOTREF(__pyx_t_1);
  8233. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  8234. __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
  8235. __pyx_t_8 = NULL;
  8236. } else {
  8237. __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 899, __pyx_L1_error)
  8238. __Pyx_GOTREF(__pyx_t_2);
  8239. __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 899, __pyx_L1_error)
  8240. }
  8241. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8242. for (;;) {
  8243. if (likely(!__pyx_t_8)) {
  8244. if (likely(PyList_CheckExact(__pyx_t_2))) {
  8245. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
  8246. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8247. __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, 899, __pyx_L1_error)
  8248. #else
  8249. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
  8250. __Pyx_GOTREF(__pyx_t_1);
  8251. #endif
  8252. } else {
  8253. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  8254. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8255. __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, 899, __pyx_L1_error)
  8256. #else
  8257. __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 899, __pyx_L1_error)
  8258. __Pyx_GOTREF(__pyx_t_1);
  8259. #endif
  8260. }
  8261. } else {
  8262. __pyx_t_1 = __pyx_t_8(__pyx_t_2);
  8263. if (unlikely(!__pyx_t_1)) {
  8264. PyObject* exc_type = PyErr_Occurred();
  8265. if (exc_type) {
  8266. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8267. else __PYX_ERR(0, 899, __pyx_L1_error)
  8268. }
  8269. break;
  8270. }
  8271. __Pyx_GOTREF(__pyx_t_1);
  8272. }
  8273. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_1);
  8274. __pyx_t_1 = 0;
  8275. /* "gedlibpy.pyx":900
  8276. * id = self.add_graph(g.name, classe)
  8277. * for node in g.nodes:
  8278. * self.add_node(id, str(node), g.nodes[node]) # <<<<<<<<<<<<<<
  8279. * for edge in g.edges:
  8280. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8281. */
  8282. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 900, __pyx_L1_error)
  8283. __Pyx_GOTREF(__pyx_t_6);
  8284. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 900, __pyx_L1_error)
  8285. __Pyx_GOTREF(__pyx_t_3);
  8286. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_nodes); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 900, __pyx_L1_error)
  8287. __Pyx_GOTREF(__pyx_t_4);
  8288. __pyx_t_9 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_v_node); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 900, __pyx_L1_error)
  8289. __Pyx_GOTREF(__pyx_t_9);
  8290. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8291. __pyx_t_4 = NULL;
  8292. __pyx_t_5 = 0;
  8293. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8294. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8295. if (likely(__pyx_t_4)) {
  8296. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8297. __Pyx_INCREF(__pyx_t_4);
  8298. __Pyx_INCREF(function);
  8299. __Pyx_DECREF_SET(__pyx_t_6, function);
  8300. __pyx_t_5 = 1;
  8301. }
  8302. }
  8303. #if CYTHON_FAST_PYCALL
  8304. if (PyFunction_Check(__pyx_t_6)) {
  8305. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8306. __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, 900, __pyx_L1_error)
  8307. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8308. __Pyx_GOTREF(__pyx_t_1);
  8309. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8310. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8311. } else
  8312. #endif
  8313. #if CYTHON_FAST_PYCCALL
  8314. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8315. PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_id, __pyx_t_3, __pyx_t_9};
  8316. __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, 900, __pyx_L1_error)
  8317. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8318. __Pyx_GOTREF(__pyx_t_1);
  8319. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8320. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8321. } else
  8322. #endif
  8323. {
  8324. __pyx_t_10 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 900, __pyx_L1_error)
  8325. __Pyx_GOTREF(__pyx_t_10);
  8326. if (__pyx_t_4) {
  8327. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8328. }
  8329. __Pyx_INCREF(__pyx_v_id);
  8330. __Pyx_GIVEREF(__pyx_v_id);
  8331. PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_5, __pyx_v_id);
  8332. __Pyx_GIVEREF(__pyx_t_3);
  8333. PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_5, __pyx_t_3);
  8334. __Pyx_GIVEREF(__pyx_t_9);
  8335. PyTuple_SET_ITEM(__pyx_t_10, 2+__pyx_t_5, __pyx_t_9);
  8336. __pyx_t_3 = 0;
  8337. __pyx_t_9 = 0;
  8338. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 900, __pyx_L1_error)
  8339. __Pyx_GOTREF(__pyx_t_1);
  8340. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8341. }
  8342. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8343. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8344. /* "gedlibpy.pyx":899
  8345. * """
  8346. * id = self.add_graph(g.name, classe)
  8347. * for node in g.nodes: # <<<<<<<<<<<<<<
  8348. * self.add_node(id, str(node), g.nodes[node])
  8349. * for edge in g.edges:
  8350. */
  8351. }
  8352. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8353. /* "gedlibpy.pyx":901
  8354. * for node in g.nodes:
  8355. * self.add_node(id, str(node), g.nodes[node])
  8356. * for edge in g.edges: # <<<<<<<<<<<<<<
  8357. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8358. * return id
  8359. */
  8360. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_edges); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
  8361. __Pyx_GOTREF(__pyx_t_2);
  8362. if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
  8363. __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_7 = 0;
  8364. __pyx_t_8 = NULL;
  8365. } else {
  8366. __pyx_t_7 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 901, __pyx_L1_error)
  8367. __Pyx_GOTREF(__pyx_t_1);
  8368. __pyx_t_8 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 901, __pyx_L1_error)
  8369. }
  8370. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8371. for (;;) {
  8372. if (likely(!__pyx_t_8)) {
  8373. if (likely(PyList_CheckExact(__pyx_t_1))) {
  8374. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_1)) break;
  8375. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8376. __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, 901, __pyx_L1_error)
  8377. #else
  8378. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
  8379. __Pyx_GOTREF(__pyx_t_2);
  8380. #endif
  8381. } else {
  8382. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  8383. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  8384. __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, 901, __pyx_L1_error)
  8385. #else
  8386. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
  8387. __Pyx_GOTREF(__pyx_t_2);
  8388. #endif
  8389. }
  8390. } else {
  8391. __pyx_t_2 = __pyx_t_8(__pyx_t_1);
  8392. if (unlikely(!__pyx_t_2)) {
  8393. PyObject* exc_type = PyErr_Occurred();
  8394. if (exc_type) {
  8395. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  8396. else __PYX_ERR(0, 901, __pyx_L1_error)
  8397. }
  8398. break;
  8399. }
  8400. __Pyx_GOTREF(__pyx_t_2);
  8401. }
  8402. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_2);
  8403. __pyx_t_2 = 0;
  8404. /* "gedlibpy.pyx":902
  8405. * self.add_node(id, str(node), g.nodes[node])
  8406. * for edge in g.edges:
  8407. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates) # <<<<<<<<<<<<<<
  8408. * return id
  8409. *
  8410. */
  8411. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 902, __pyx_L1_error)
  8412. __Pyx_GOTREF(__pyx_t_6);
  8413. __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, 902, __pyx_L1_error)
  8414. __Pyx_GOTREF(__pyx_t_10);
  8415. __pyx_t_9 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 902, __pyx_L1_error)
  8416. __Pyx_GOTREF(__pyx_t_9);
  8417. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8418. __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, 902, __pyx_L1_error)
  8419. __Pyx_GOTREF(__pyx_t_10);
  8420. __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_10); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
  8421. __Pyx_GOTREF(__pyx_t_3);
  8422. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8423. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_g, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 902, __pyx_L1_error)
  8424. __Pyx_GOTREF(__pyx_t_4);
  8425. __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, 902, __pyx_L1_error)
  8426. __Pyx_GOTREF(__pyx_t_11);
  8427. __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, 902, __pyx_L1_error)
  8428. __Pyx_GOTREF(__pyx_t_12);
  8429. __pyx_t_13 = NULL;
  8430. __pyx_t_5 = 0;
  8431. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  8432. __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_4);
  8433. if (likely(__pyx_t_13)) {
  8434. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  8435. __Pyx_INCREF(__pyx_t_13);
  8436. __Pyx_INCREF(function);
  8437. __Pyx_DECREF_SET(__pyx_t_4, function);
  8438. __pyx_t_5 = 1;
  8439. }
  8440. }
  8441. #if CYTHON_FAST_PYCALL
  8442. if (PyFunction_Check(__pyx_t_4)) {
  8443. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8444. __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, 902, __pyx_L1_error)
  8445. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8446. __Pyx_GOTREF(__pyx_t_10);
  8447. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8448. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8449. } else
  8450. #endif
  8451. #if CYTHON_FAST_PYCCALL
  8452. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  8453. PyObject *__pyx_temp[3] = {__pyx_t_13, __pyx_t_11, __pyx_t_12};
  8454. __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, 902, __pyx_L1_error)
  8455. __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
  8456. __Pyx_GOTREF(__pyx_t_10);
  8457. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  8458. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  8459. } else
  8460. #endif
  8461. {
  8462. __pyx_t_14 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error)
  8463. __Pyx_GOTREF(__pyx_t_14);
  8464. if (__pyx_t_13) {
  8465. __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13); __pyx_t_13 = NULL;
  8466. }
  8467. __Pyx_GIVEREF(__pyx_t_11);
  8468. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_t_11);
  8469. __Pyx_GIVEREF(__pyx_t_12);
  8470. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_12);
  8471. __pyx_t_11 = 0;
  8472. __pyx_t_12 = 0;
  8473. __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_14, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 902, __pyx_L1_error)
  8474. __Pyx_GOTREF(__pyx_t_10);
  8475. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8476. }
  8477. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  8478. __pyx_t_4 = NULL;
  8479. __pyx_t_5 = 0;
  8480. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
  8481. __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
  8482. if (likely(__pyx_t_4)) {
  8483. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  8484. __Pyx_INCREF(__pyx_t_4);
  8485. __Pyx_INCREF(function);
  8486. __Pyx_DECREF_SET(__pyx_t_6, function);
  8487. __pyx_t_5 = 1;
  8488. }
  8489. }
  8490. #if CYTHON_FAST_PYCALL
  8491. if (PyFunction_Check(__pyx_t_6)) {
  8492. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8493. __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, 902, __pyx_L1_error)
  8494. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8495. __Pyx_GOTREF(__pyx_t_2);
  8496. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8497. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8498. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8499. } else
  8500. #endif
  8501. #if CYTHON_FAST_PYCCALL
  8502. if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
  8503. PyObject *__pyx_temp[6] = {__pyx_t_4, __pyx_v_id, __pyx_t_9, __pyx_t_3, __pyx_t_10, __pyx_v_ignore_duplicates};
  8504. __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, 902, __pyx_L1_error)
  8505. __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  8506. __Pyx_GOTREF(__pyx_t_2);
  8507. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  8508. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8509. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  8510. } else
  8511. #endif
  8512. {
  8513. __pyx_t_14 = PyTuple_New(5+__pyx_t_5); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 902, __pyx_L1_error)
  8514. __Pyx_GOTREF(__pyx_t_14);
  8515. if (__pyx_t_4) {
  8516. __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_4); __pyx_t_4 = NULL;
  8517. }
  8518. __Pyx_INCREF(__pyx_v_id);
  8519. __Pyx_GIVEREF(__pyx_v_id);
  8520. PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_5, __pyx_v_id);
  8521. __Pyx_GIVEREF(__pyx_t_9);
  8522. PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_5, __pyx_t_9);
  8523. __Pyx_GIVEREF(__pyx_t_3);
  8524. PyTuple_SET_ITEM(__pyx_t_14, 2+__pyx_t_5, __pyx_t_3);
  8525. __Pyx_GIVEREF(__pyx_t_10);
  8526. PyTuple_SET_ITEM(__pyx_t_14, 3+__pyx_t_5, __pyx_t_10);
  8527. __Pyx_INCREF(__pyx_v_ignore_duplicates);
  8528. __Pyx_GIVEREF(__pyx_v_ignore_duplicates);
  8529. PyTuple_SET_ITEM(__pyx_t_14, 4+__pyx_t_5, __pyx_v_ignore_duplicates);
  8530. __pyx_t_9 = 0;
  8531. __pyx_t_3 = 0;
  8532. __pyx_t_10 = 0;
  8533. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 902, __pyx_L1_error)
  8534. __Pyx_GOTREF(__pyx_t_2);
  8535. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  8536. }
  8537. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8538. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8539. /* "gedlibpy.pyx":901
  8540. * for node in g.nodes:
  8541. * self.add_node(id, str(node), g.nodes[node])
  8542. * for edge in g.edges: # <<<<<<<<<<<<<<
  8543. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8544. * return id
  8545. */
  8546. }
  8547. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8548. /* "gedlibpy.pyx":903
  8549. * for edge in g.edges:
  8550. * self.add_edge(id, str(edge[0]), str(edge[1]), g.get_edge_data(edge[0], edge[1]), ignore_duplicates)
  8551. * return id # <<<<<<<<<<<<<<
  8552. *
  8553. *
  8554. */
  8555. __Pyx_XDECREF(__pyx_r);
  8556. __Pyx_INCREF(__pyx_v_id);
  8557. __pyx_r = __pyx_v_id;
  8558. goto __pyx_L0;
  8559. /* "gedlibpy.pyx":884
  8560. *
  8561. *
  8562. * def add_nx_graph(self, g, classe, ignore_duplicates=True) : # <<<<<<<<<<<<<<
  8563. * """
  8564. * Add a Graph (made by networkx) on the environment. Be careful to respect the same format as GXL graphs for labelling nodes and edges.
  8565. */
  8566. /* function exit code */
  8567. __pyx_L1_error:;
  8568. __Pyx_XDECREF(__pyx_t_1);
  8569. __Pyx_XDECREF(__pyx_t_2);
  8570. __Pyx_XDECREF(__pyx_t_3);
  8571. __Pyx_XDECREF(__pyx_t_4);
  8572. __Pyx_XDECREF(__pyx_t_6);
  8573. __Pyx_XDECREF(__pyx_t_9);
  8574. __Pyx_XDECREF(__pyx_t_10);
  8575. __Pyx_XDECREF(__pyx_t_11);
  8576. __Pyx_XDECREF(__pyx_t_12);
  8577. __Pyx_XDECREF(__pyx_t_13);
  8578. __Pyx_XDECREF(__pyx_t_14);
  8579. __Pyx_AddTraceback("gedlibpy.GEDEnv.add_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8580. __pyx_r = NULL;
  8581. __pyx_L0:;
  8582. __Pyx_XDECREF(__pyx_v_id);
  8583. __Pyx_XDECREF(__pyx_v_node);
  8584. __Pyx_XDECREF(__pyx_v_edge);
  8585. __Pyx_XGIVEREF(__pyx_r);
  8586. __Pyx_RefNannyFinishContext();
  8587. return __pyx_r;
  8588. }
  8589. /* "gedlibpy.pyx":906
  8590. *
  8591. *
  8592. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  8593. * """
  8594. * Computes the edit distance between two NX graphs.
  8595. */
  8596. /* Python wrapper */
  8597. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  8598. 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";
  8599. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_89compute_ged_on_two_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  8600. PyObject *__pyx_v_g1 = 0;
  8601. PyObject *__pyx_v_g2 = 0;
  8602. PyObject *__pyx_v_edit_cost = 0;
  8603. PyObject *__pyx_v_method = 0;
  8604. PyObject *__pyx_v_options = 0;
  8605. PyObject *__pyx_v_init_option = 0;
  8606. PyObject *__pyx_r = 0;
  8607. __Pyx_RefNannyDeclarations
  8608. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs (wrapper)", 0);
  8609. {
  8610. 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};
  8611. PyObject* values[6] = {0,0,0,0,0,0};
  8612. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  8613. if (unlikely(__pyx_kwds)) {
  8614. Py_ssize_t kw_args;
  8615. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  8616. switch (pos_args) {
  8617. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8618. CYTHON_FALLTHROUGH;
  8619. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8620. CYTHON_FALLTHROUGH;
  8621. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8622. CYTHON_FALLTHROUGH;
  8623. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8624. CYTHON_FALLTHROUGH;
  8625. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8626. CYTHON_FALLTHROUGH;
  8627. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8628. CYTHON_FALLTHROUGH;
  8629. case 0: break;
  8630. default: goto __pyx_L5_argtuple_error;
  8631. }
  8632. kw_args = PyDict_Size(__pyx_kwds);
  8633. switch (pos_args) {
  8634. case 0:
  8635. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g1)) != 0)) kw_args--;
  8636. else goto __pyx_L5_argtuple_error;
  8637. CYTHON_FALLTHROUGH;
  8638. case 1:
  8639. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g2)) != 0)) kw_args--;
  8640. else {
  8641. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 1); __PYX_ERR(0, 906, __pyx_L3_error)
  8642. }
  8643. CYTHON_FALLTHROUGH;
  8644. case 2:
  8645. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  8646. else {
  8647. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 2); __PYX_ERR(0, 906, __pyx_L3_error)
  8648. }
  8649. CYTHON_FALLTHROUGH;
  8650. case 3:
  8651. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  8652. else {
  8653. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 3); __PYX_ERR(0, 906, __pyx_L3_error)
  8654. }
  8655. CYTHON_FALLTHROUGH;
  8656. case 4:
  8657. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  8658. else {
  8659. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, 4); __PYX_ERR(0, 906, __pyx_L3_error)
  8660. }
  8661. CYTHON_FALLTHROUGH;
  8662. case 5:
  8663. if (kw_args > 0) {
  8664. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  8665. if (value) { values[5] = value; kw_args--; }
  8666. }
  8667. }
  8668. if (unlikely(kw_args > 0)) {
  8669. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_ged_on_two_graphs") < 0)) __PYX_ERR(0, 906, __pyx_L3_error)
  8670. }
  8671. } else {
  8672. switch (PyTuple_GET_SIZE(__pyx_args)) {
  8673. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  8674. CYTHON_FALLTHROUGH;
  8675. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  8676. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  8677. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  8678. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  8679. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  8680. break;
  8681. default: goto __pyx_L5_argtuple_error;
  8682. }
  8683. }
  8684. __pyx_v_g1 = values[0];
  8685. __pyx_v_g2 = values[1];
  8686. __pyx_v_edit_cost = values[2];
  8687. __pyx_v_method = values[3];
  8688. __pyx_v_options = values[4];
  8689. __pyx_v_init_option = values[5];
  8690. }
  8691. goto __pyx_L4_argument_unpacking_done;
  8692. __pyx_L5_argtuple_error:;
  8693. __Pyx_RaiseArgtupleInvalid("compute_ged_on_two_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 906, __pyx_L3_error)
  8694. __pyx_L3_error:;
  8695. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  8696. __Pyx_RefNannyFinishContext();
  8697. return NULL;
  8698. __pyx_L4_argument_unpacking_done:;
  8699. __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);
  8700. /* function exit code */
  8701. __Pyx_RefNannyFinishContext();
  8702. return __pyx_r;
  8703. }
  8704. 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) {
  8705. PyObject *__pyx_v_g = NULL;
  8706. PyObject *__pyx_v_h = NULL;
  8707. PyObject *__pyx_v_resDistance = NULL;
  8708. PyObject *__pyx_v_resMapping = NULL;
  8709. PyObject *__pyx_r = NULL;
  8710. __Pyx_RefNannyDeclarations
  8711. PyObject *__pyx_t_1 = NULL;
  8712. PyObject *__pyx_t_2 = NULL;
  8713. PyObject *__pyx_t_3 = NULL;
  8714. int __pyx_t_4;
  8715. int __pyx_t_5;
  8716. PyObject *__pyx_t_6 = NULL;
  8717. __Pyx_RefNannySetupContext("compute_ged_on_two_graphs", 0);
  8718. /* "gedlibpy.pyx":929
  8719. *
  8720. * """
  8721. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8722. * self.restart_env()
  8723. *
  8724. */
  8725. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 929, __pyx_L1_error)
  8726. __Pyx_GOTREF(__pyx_t_2);
  8727. __pyx_t_3 = NULL;
  8728. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8729. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8730. if (likely(__pyx_t_3)) {
  8731. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8732. __Pyx_INCREF(__pyx_t_3);
  8733. __Pyx_INCREF(function);
  8734. __Pyx_DECREF_SET(__pyx_t_2, function);
  8735. }
  8736. }
  8737. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8738. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8739. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
  8740. __Pyx_GOTREF(__pyx_t_1);
  8741. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8742. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 929, __pyx_L1_error)
  8743. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8744. if (__pyx_t_4) {
  8745. /* "gedlibpy.pyx":930
  8746. * """
  8747. * if self.is_initialized() :
  8748. * self.restart_env() # <<<<<<<<<<<<<<
  8749. *
  8750. * g = self.add_nx_graph(g1, "")
  8751. */
  8752. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 930, __pyx_L1_error)
  8753. __Pyx_GOTREF(__pyx_t_2);
  8754. __pyx_t_3 = NULL;
  8755. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8756. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8757. if (likely(__pyx_t_3)) {
  8758. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8759. __Pyx_INCREF(__pyx_t_3);
  8760. __Pyx_INCREF(function);
  8761. __Pyx_DECREF_SET(__pyx_t_2, function);
  8762. }
  8763. }
  8764. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  8765. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8766. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
  8767. __Pyx_GOTREF(__pyx_t_1);
  8768. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8769. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8770. /* "gedlibpy.pyx":929
  8771. *
  8772. * """
  8773. * if self.is_initialized() : # <<<<<<<<<<<<<<
  8774. * self.restart_env()
  8775. *
  8776. */
  8777. }
  8778. /* "gedlibpy.pyx":932
  8779. * self.restart_env()
  8780. *
  8781. * g = self.add_nx_graph(g1, "") # <<<<<<<<<<<<<<
  8782. * h = self.add_nx_graph(g2, "")
  8783. *
  8784. */
  8785. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 932, __pyx_L1_error)
  8786. __Pyx_GOTREF(__pyx_t_2);
  8787. __pyx_t_3 = NULL;
  8788. __pyx_t_5 = 0;
  8789. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8790. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8791. if (likely(__pyx_t_3)) {
  8792. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8793. __Pyx_INCREF(__pyx_t_3);
  8794. __Pyx_INCREF(function);
  8795. __Pyx_DECREF_SET(__pyx_t_2, function);
  8796. __pyx_t_5 = 1;
  8797. }
  8798. }
  8799. #if CYTHON_FAST_PYCALL
  8800. if (PyFunction_Check(__pyx_t_2)) {
  8801. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8802. __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, 932, __pyx_L1_error)
  8803. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8804. __Pyx_GOTREF(__pyx_t_1);
  8805. } else
  8806. #endif
  8807. #if CYTHON_FAST_PYCCALL
  8808. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8809. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g1, __pyx_kp_u_};
  8810. __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, 932, __pyx_L1_error)
  8811. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8812. __Pyx_GOTREF(__pyx_t_1);
  8813. } else
  8814. #endif
  8815. {
  8816. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 932, __pyx_L1_error)
  8817. __Pyx_GOTREF(__pyx_t_6);
  8818. if (__pyx_t_3) {
  8819. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8820. }
  8821. __Pyx_INCREF(__pyx_v_g1);
  8822. __Pyx_GIVEREF(__pyx_v_g1);
  8823. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g1);
  8824. __Pyx_INCREF(__pyx_kp_u_);
  8825. __Pyx_GIVEREF(__pyx_kp_u_);
  8826. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_u_);
  8827. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
  8828. __Pyx_GOTREF(__pyx_t_1);
  8829. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8830. }
  8831. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8832. __pyx_v_g = __pyx_t_1;
  8833. __pyx_t_1 = 0;
  8834. /* "gedlibpy.pyx":933
  8835. *
  8836. * g = self.add_nx_graph(g1, "")
  8837. * h = self.add_nx_graph(g2, "") # <<<<<<<<<<<<<<
  8838. *
  8839. * self.set_edit_cost(edit_cost)
  8840. */
  8841. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 933, __pyx_L1_error)
  8842. __Pyx_GOTREF(__pyx_t_2);
  8843. __pyx_t_6 = NULL;
  8844. __pyx_t_5 = 0;
  8845. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8846. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  8847. if (likely(__pyx_t_6)) {
  8848. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8849. __Pyx_INCREF(__pyx_t_6);
  8850. __Pyx_INCREF(function);
  8851. __Pyx_DECREF_SET(__pyx_t_2, function);
  8852. __pyx_t_5 = 1;
  8853. }
  8854. }
  8855. #if CYTHON_FAST_PYCALL
  8856. if (PyFunction_Check(__pyx_t_2)) {
  8857. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8858. __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, 933, __pyx_L1_error)
  8859. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8860. __Pyx_GOTREF(__pyx_t_1);
  8861. } else
  8862. #endif
  8863. #if CYTHON_FAST_PYCCALL
  8864. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8865. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g2, __pyx_kp_u_};
  8866. __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, 933, __pyx_L1_error)
  8867. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  8868. __Pyx_GOTREF(__pyx_t_1);
  8869. } else
  8870. #endif
  8871. {
  8872. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 933, __pyx_L1_error)
  8873. __Pyx_GOTREF(__pyx_t_3);
  8874. if (__pyx_t_6) {
  8875. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  8876. }
  8877. __Pyx_INCREF(__pyx_v_g2);
  8878. __Pyx_GIVEREF(__pyx_v_g2);
  8879. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g2);
  8880. __Pyx_INCREF(__pyx_kp_u_);
  8881. __Pyx_GIVEREF(__pyx_kp_u_);
  8882. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_kp_u_);
  8883. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 933, __pyx_L1_error)
  8884. __Pyx_GOTREF(__pyx_t_1);
  8885. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  8886. }
  8887. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8888. __pyx_v_h = __pyx_t_1;
  8889. __pyx_t_1 = 0;
  8890. /* "gedlibpy.pyx":935
  8891. * h = self.add_nx_graph(g2, "")
  8892. *
  8893. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  8894. * self.init(init_option)
  8895. *
  8896. */
  8897. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 935, __pyx_L1_error)
  8898. __Pyx_GOTREF(__pyx_t_2);
  8899. __pyx_t_3 = NULL;
  8900. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8901. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8902. if (likely(__pyx_t_3)) {
  8903. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8904. __Pyx_INCREF(__pyx_t_3);
  8905. __Pyx_INCREF(function);
  8906. __Pyx_DECREF_SET(__pyx_t_2, function);
  8907. }
  8908. }
  8909. __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);
  8910. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8911. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 935, __pyx_L1_error)
  8912. __Pyx_GOTREF(__pyx_t_1);
  8913. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8914. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8915. /* "gedlibpy.pyx":936
  8916. *
  8917. * self.set_edit_cost(edit_cost)
  8918. * self.init(init_option) # <<<<<<<<<<<<<<
  8919. *
  8920. * self.set_method(method, options)
  8921. */
  8922. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 936, __pyx_L1_error)
  8923. __Pyx_GOTREF(__pyx_t_2);
  8924. __pyx_t_3 = NULL;
  8925. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8926. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8927. if (likely(__pyx_t_3)) {
  8928. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8929. __Pyx_INCREF(__pyx_t_3);
  8930. __Pyx_INCREF(function);
  8931. __Pyx_DECREF_SET(__pyx_t_2, function);
  8932. }
  8933. }
  8934. __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);
  8935. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8936. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 936, __pyx_L1_error)
  8937. __Pyx_GOTREF(__pyx_t_1);
  8938. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8939. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8940. /* "gedlibpy.pyx":938
  8941. * self.init(init_option)
  8942. *
  8943. * self.set_method(method, options) # <<<<<<<<<<<<<<
  8944. * self.init_method()
  8945. *
  8946. */
  8947. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 938, __pyx_L1_error)
  8948. __Pyx_GOTREF(__pyx_t_2);
  8949. __pyx_t_3 = NULL;
  8950. __pyx_t_5 = 0;
  8951. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  8952. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  8953. if (likely(__pyx_t_3)) {
  8954. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  8955. __Pyx_INCREF(__pyx_t_3);
  8956. __Pyx_INCREF(function);
  8957. __Pyx_DECREF_SET(__pyx_t_2, function);
  8958. __pyx_t_5 = 1;
  8959. }
  8960. }
  8961. #if CYTHON_FAST_PYCALL
  8962. if (PyFunction_Check(__pyx_t_2)) {
  8963. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8964. __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, 938, __pyx_L1_error)
  8965. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8966. __Pyx_GOTREF(__pyx_t_1);
  8967. } else
  8968. #endif
  8969. #if CYTHON_FAST_PYCCALL
  8970. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  8971. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  8972. __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, 938, __pyx_L1_error)
  8973. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  8974. __Pyx_GOTREF(__pyx_t_1);
  8975. } else
  8976. #endif
  8977. {
  8978. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 938, __pyx_L1_error)
  8979. __Pyx_GOTREF(__pyx_t_6);
  8980. if (__pyx_t_3) {
  8981. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  8982. }
  8983. __Pyx_INCREF(__pyx_v_method);
  8984. __Pyx_GIVEREF(__pyx_v_method);
  8985. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
  8986. __Pyx_INCREF(__pyx_v_options);
  8987. __Pyx_GIVEREF(__pyx_v_options);
  8988. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_options);
  8989. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 938, __pyx_L1_error)
  8990. __Pyx_GOTREF(__pyx_t_1);
  8991. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  8992. }
  8993. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  8994. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  8995. /* "gedlibpy.pyx":939
  8996. *
  8997. * self.set_method(method, options)
  8998. * self.init_method() # <<<<<<<<<<<<<<
  8999. *
  9000. * resDistance = 0
  9001. */
  9002. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 939, __pyx_L1_error)
  9003. __Pyx_GOTREF(__pyx_t_2);
  9004. __pyx_t_6 = NULL;
  9005. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9006. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9007. if (likely(__pyx_t_6)) {
  9008. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9009. __Pyx_INCREF(__pyx_t_6);
  9010. __Pyx_INCREF(function);
  9011. __Pyx_DECREF_SET(__pyx_t_2, function);
  9012. }
  9013. }
  9014. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9015. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9016. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 939, __pyx_L1_error)
  9017. __Pyx_GOTREF(__pyx_t_1);
  9018. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9019. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9020. /* "gedlibpy.pyx":941
  9021. * self.init_method()
  9022. *
  9023. * resDistance = 0 # <<<<<<<<<<<<<<
  9024. * resMapping = []
  9025. * self.run_method(g, h)
  9026. */
  9027. __Pyx_INCREF(__pyx_int_0);
  9028. __pyx_v_resDistance = __pyx_int_0;
  9029. /* "gedlibpy.pyx":942
  9030. *
  9031. * resDistance = 0
  9032. * resMapping = [] # <<<<<<<<<<<<<<
  9033. * self.run_method(g, h)
  9034. * resDistance = self.get_upper_bound(g, h)
  9035. */
  9036. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 942, __pyx_L1_error)
  9037. __Pyx_GOTREF(__pyx_t_1);
  9038. __pyx_v_resMapping = __pyx_t_1;
  9039. __pyx_t_1 = 0;
  9040. /* "gedlibpy.pyx":943
  9041. * resDistance = 0
  9042. * resMapping = []
  9043. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9044. * resDistance = self.get_upper_bound(g, h)
  9045. * resMapping = self.get_node_map(g, h)
  9046. */
  9047. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 943, __pyx_L1_error)
  9048. __Pyx_GOTREF(__pyx_t_2);
  9049. __pyx_t_6 = NULL;
  9050. __pyx_t_5 = 0;
  9051. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9052. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9053. if (likely(__pyx_t_6)) {
  9054. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9055. __Pyx_INCREF(__pyx_t_6);
  9056. __Pyx_INCREF(function);
  9057. __Pyx_DECREF_SET(__pyx_t_2, function);
  9058. __pyx_t_5 = 1;
  9059. }
  9060. }
  9061. #if CYTHON_FAST_PYCALL
  9062. if (PyFunction_Check(__pyx_t_2)) {
  9063. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9064. __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, 943, __pyx_L1_error)
  9065. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9066. __Pyx_GOTREF(__pyx_t_1);
  9067. } else
  9068. #endif
  9069. #if CYTHON_FAST_PYCCALL
  9070. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9071. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9072. __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, 943, __pyx_L1_error)
  9073. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9074. __Pyx_GOTREF(__pyx_t_1);
  9075. } else
  9076. #endif
  9077. {
  9078. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
  9079. __Pyx_GOTREF(__pyx_t_3);
  9080. if (__pyx_t_6) {
  9081. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9082. }
  9083. __Pyx_INCREF(__pyx_v_g);
  9084. __Pyx_GIVEREF(__pyx_v_g);
  9085. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9086. __Pyx_INCREF(__pyx_v_h);
  9087. __Pyx_GIVEREF(__pyx_v_h);
  9088. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9089. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 943, __pyx_L1_error)
  9090. __Pyx_GOTREF(__pyx_t_1);
  9091. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9092. }
  9093. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9094. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9095. /* "gedlibpy.pyx":944
  9096. * resMapping = []
  9097. * self.run_method(g, h)
  9098. * resDistance = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  9099. * resMapping = self.get_node_map(g, h)
  9100. *
  9101. */
  9102. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 944, __pyx_L1_error)
  9103. __Pyx_GOTREF(__pyx_t_2);
  9104. __pyx_t_3 = NULL;
  9105. __pyx_t_5 = 0;
  9106. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9107. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9108. if (likely(__pyx_t_3)) {
  9109. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9110. __Pyx_INCREF(__pyx_t_3);
  9111. __Pyx_INCREF(function);
  9112. __Pyx_DECREF_SET(__pyx_t_2, function);
  9113. __pyx_t_5 = 1;
  9114. }
  9115. }
  9116. #if CYTHON_FAST_PYCALL
  9117. if (PyFunction_Check(__pyx_t_2)) {
  9118. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9119. __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, 944, __pyx_L1_error)
  9120. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9121. __Pyx_GOTREF(__pyx_t_1);
  9122. } else
  9123. #endif
  9124. #if CYTHON_FAST_PYCCALL
  9125. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9126. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_g, __pyx_v_h};
  9127. __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, 944, __pyx_L1_error)
  9128. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9129. __Pyx_GOTREF(__pyx_t_1);
  9130. } else
  9131. #endif
  9132. {
  9133. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 944, __pyx_L1_error)
  9134. __Pyx_GOTREF(__pyx_t_6);
  9135. if (__pyx_t_3) {
  9136. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9137. }
  9138. __Pyx_INCREF(__pyx_v_g);
  9139. __Pyx_GIVEREF(__pyx_v_g);
  9140. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_g);
  9141. __Pyx_INCREF(__pyx_v_h);
  9142. __Pyx_GIVEREF(__pyx_v_h);
  9143. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_h);
  9144. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 944, __pyx_L1_error)
  9145. __Pyx_GOTREF(__pyx_t_1);
  9146. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  9147. }
  9148. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9149. __Pyx_DECREF_SET(__pyx_v_resDistance, __pyx_t_1);
  9150. __pyx_t_1 = 0;
  9151. /* "gedlibpy.pyx":945
  9152. * self.run_method(g, h)
  9153. * resDistance = self.get_upper_bound(g, h)
  9154. * resMapping = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  9155. *
  9156. * return resDistance, resMapping
  9157. */
  9158. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 945, __pyx_L1_error)
  9159. __Pyx_GOTREF(__pyx_t_2);
  9160. __pyx_t_6 = NULL;
  9161. __pyx_t_5 = 0;
  9162. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9163. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  9164. if (likely(__pyx_t_6)) {
  9165. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9166. __Pyx_INCREF(__pyx_t_6);
  9167. __Pyx_INCREF(function);
  9168. __Pyx_DECREF_SET(__pyx_t_2, function);
  9169. __pyx_t_5 = 1;
  9170. }
  9171. }
  9172. #if CYTHON_FAST_PYCALL
  9173. if (PyFunction_Check(__pyx_t_2)) {
  9174. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9175. __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, 945, __pyx_L1_error)
  9176. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9177. __Pyx_GOTREF(__pyx_t_1);
  9178. } else
  9179. #endif
  9180. #if CYTHON_FAST_PYCCALL
  9181. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9182. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_g, __pyx_v_h};
  9183. __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, 945, __pyx_L1_error)
  9184. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  9185. __Pyx_GOTREF(__pyx_t_1);
  9186. } else
  9187. #endif
  9188. {
  9189. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  9190. __Pyx_GOTREF(__pyx_t_3);
  9191. if (__pyx_t_6) {
  9192. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  9193. }
  9194. __Pyx_INCREF(__pyx_v_g);
  9195. __Pyx_GIVEREF(__pyx_v_g);
  9196. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_g);
  9197. __Pyx_INCREF(__pyx_v_h);
  9198. __Pyx_GIVEREF(__pyx_v_h);
  9199. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_h);
  9200. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 945, __pyx_L1_error)
  9201. __Pyx_GOTREF(__pyx_t_1);
  9202. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9203. }
  9204. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9205. __Pyx_DECREF_SET(__pyx_v_resMapping, __pyx_t_1);
  9206. __pyx_t_1 = 0;
  9207. /* "gedlibpy.pyx":947
  9208. * resMapping = self.get_node_map(g, h)
  9209. *
  9210. * return resDistance, resMapping # <<<<<<<<<<<<<<
  9211. *
  9212. *
  9213. */
  9214. __Pyx_XDECREF(__pyx_r);
  9215. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 947, __pyx_L1_error)
  9216. __Pyx_GOTREF(__pyx_t_1);
  9217. __Pyx_INCREF(__pyx_v_resDistance);
  9218. __Pyx_GIVEREF(__pyx_v_resDistance);
  9219. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_resDistance);
  9220. __Pyx_INCREF(__pyx_v_resMapping);
  9221. __Pyx_GIVEREF(__pyx_v_resMapping);
  9222. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_resMapping);
  9223. __pyx_r = __pyx_t_1;
  9224. __pyx_t_1 = 0;
  9225. goto __pyx_L0;
  9226. /* "gedlibpy.pyx":906
  9227. *
  9228. *
  9229. * def compute_ged_on_two_graphs(self, g1, g2, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9230. * """
  9231. * Computes the edit distance between two NX graphs.
  9232. */
  9233. /* function exit code */
  9234. __pyx_L1_error:;
  9235. __Pyx_XDECREF(__pyx_t_1);
  9236. __Pyx_XDECREF(__pyx_t_2);
  9237. __Pyx_XDECREF(__pyx_t_3);
  9238. __Pyx_XDECREF(__pyx_t_6);
  9239. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_ged_on_two_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9240. __pyx_r = NULL;
  9241. __pyx_L0:;
  9242. __Pyx_XDECREF(__pyx_v_g);
  9243. __Pyx_XDECREF(__pyx_v_h);
  9244. __Pyx_XDECREF(__pyx_v_resDistance);
  9245. __Pyx_XDECREF(__pyx_v_resMapping);
  9246. __Pyx_XGIVEREF(__pyx_r);
  9247. __Pyx_RefNannyFinishContext();
  9248. return __pyx_r;
  9249. }
  9250. /* "gedlibpy.pyx":950
  9251. *
  9252. *
  9253. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  9254. * """
  9255. *
  9256. */
  9257. /* Python wrapper */
  9258. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  9259. 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";
  9260. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_91compute_edit_distance_on_nx_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  9261. PyObject *__pyx_v_dataset = 0;
  9262. PyObject *__pyx_v_classes = 0;
  9263. PyObject *__pyx_v_edit_cost = 0;
  9264. PyObject *__pyx_v_method = 0;
  9265. PyObject *__pyx_v_options = 0;
  9266. PyObject *__pyx_v_init_option = 0;
  9267. PyObject *__pyx_r = 0;
  9268. __Pyx_RefNannyDeclarations
  9269. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs (wrapper)", 0);
  9270. {
  9271. 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};
  9272. PyObject* values[6] = {0,0,0,0,0,0};
  9273. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  9274. if (unlikely(__pyx_kwds)) {
  9275. Py_ssize_t kw_args;
  9276. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  9277. switch (pos_args) {
  9278. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9279. CYTHON_FALLTHROUGH;
  9280. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9281. CYTHON_FALLTHROUGH;
  9282. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9283. CYTHON_FALLTHROUGH;
  9284. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9285. CYTHON_FALLTHROUGH;
  9286. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9287. CYTHON_FALLTHROUGH;
  9288. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9289. CYTHON_FALLTHROUGH;
  9290. case 0: break;
  9291. default: goto __pyx_L5_argtuple_error;
  9292. }
  9293. kw_args = PyDict_Size(__pyx_kwds);
  9294. switch (pos_args) {
  9295. case 0:
  9296. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dataset)) != 0)) kw_args--;
  9297. else goto __pyx_L5_argtuple_error;
  9298. CYTHON_FALLTHROUGH;
  9299. case 1:
  9300. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_classes)) != 0)) kw_args--;
  9301. else {
  9302. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 1); __PYX_ERR(0, 950, __pyx_L3_error)
  9303. }
  9304. CYTHON_FALLTHROUGH;
  9305. case 2:
  9306. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  9307. else {
  9308. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 2); __PYX_ERR(0, 950, __pyx_L3_error)
  9309. }
  9310. CYTHON_FALLTHROUGH;
  9311. case 3:
  9312. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  9313. else {
  9314. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 3); __PYX_ERR(0, 950, __pyx_L3_error)
  9315. }
  9316. CYTHON_FALLTHROUGH;
  9317. case 4:
  9318. if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options)) != 0)) kw_args--;
  9319. else {
  9320. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, 4); __PYX_ERR(0, 950, __pyx_L3_error)
  9321. }
  9322. CYTHON_FALLTHROUGH;
  9323. case 5:
  9324. if (kw_args > 0) {
  9325. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  9326. if (value) { values[5] = value; kw_args--; }
  9327. }
  9328. }
  9329. if (unlikely(kw_args > 0)) {
  9330. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_nx_graphs") < 0)) __PYX_ERR(0, 950, __pyx_L3_error)
  9331. }
  9332. } else {
  9333. switch (PyTuple_GET_SIZE(__pyx_args)) {
  9334. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  9335. CYTHON_FALLTHROUGH;
  9336. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  9337. values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  9338. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  9339. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  9340. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  9341. break;
  9342. default: goto __pyx_L5_argtuple_error;
  9343. }
  9344. }
  9345. __pyx_v_dataset = values[0];
  9346. __pyx_v_classes = values[1];
  9347. __pyx_v_edit_cost = values[2];
  9348. __pyx_v_method = values[3];
  9349. __pyx_v_options = values[4];
  9350. __pyx_v_init_option = values[5];
  9351. }
  9352. goto __pyx_L4_argument_unpacking_done;
  9353. __pyx_L5_argtuple_error:;
  9354. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_nx_graphs", 0, 5, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 950, __pyx_L3_error)
  9355. __pyx_L3_error:;
  9356. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  9357. __Pyx_RefNannyFinishContext();
  9358. return NULL;
  9359. __pyx_L4_argument_unpacking_done:;
  9360. __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);
  9361. /* function exit code */
  9362. __Pyx_RefNannyFinishContext();
  9363. return __pyx_r;
  9364. }
  9365. 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) {
  9366. PyObject *__pyx_v_graph = NULL;
  9367. PyObject *__pyx_v_listID = NULL;
  9368. PyObject *__pyx_v_resDistance = NULL;
  9369. PyObject *__pyx_v_resMapping = NULL;
  9370. PyObject *__pyx_v_g = NULL;
  9371. PyObject *__pyx_v_h = NULL;
  9372. PyObject *__pyx_r = NULL;
  9373. __Pyx_RefNannyDeclarations
  9374. PyObject *__pyx_t_1 = NULL;
  9375. PyObject *__pyx_t_2 = NULL;
  9376. PyObject *__pyx_t_3 = NULL;
  9377. int __pyx_t_4;
  9378. Py_ssize_t __pyx_t_5;
  9379. PyObject *(*__pyx_t_6)(PyObject *);
  9380. PyObject *__pyx_t_7 = NULL;
  9381. int __pyx_t_8;
  9382. PyObject *__pyx_t_9 = NULL;
  9383. Py_ssize_t __pyx_t_10;
  9384. PyObject *(*__pyx_t_11)(PyObject *);
  9385. PyObject *__pyx_t_12 = NULL;
  9386. __Pyx_RefNannySetupContext("compute_edit_distance_on_nx_graphs", 0);
  9387. /* "gedlibpy.pyx":974
  9388. *
  9389. * """
  9390. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9391. * self.restart_env()
  9392. *
  9393. */
  9394. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 974, __pyx_L1_error)
  9395. __Pyx_GOTREF(__pyx_t_2);
  9396. __pyx_t_3 = NULL;
  9397. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9398. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9399. if (likely(__pyx_t_3)) {
  9400. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9401. __Pyx_INCREF(__pyx_t_3);
  9402. __Pyx_INCREF(function);
  9403. __Pyx_DECREF_SET(__pyx_t_2, function);
  9404. }
  9405. }
  9406. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9407. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9408. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 974, __pyx_L1_error)
  9409. __Pyx_GOTREF(__pyx_t_1);
  9410. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9411. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 974, __pyx_L1_error)
  9412. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9413. if (__pyx_t_4) {
  9414. /* "gedlibpy.pyx":975
  9415. * """
  9416. * if self.is_initialized() :
  9417. * self.restart_env() # <<<<<<<<<<<<<<
  9418. *
  9419. * print("Loading graphs in progress...")
  9420. */
  9421. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 975, __pyx_L1_error)
  9422. __Pyx_GOTREF(__pyx_t_2);
  9423. __pyx_t_3 = NULL;
  9424. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9425. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9426. if (likely(__pyx_t_3)) {
  9427. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9428. __Pyx_INCREF(__pyx_t_3);
  9429. __Pyx_INCREF(function);
  9430. __Pyx_DECREF_SET(__pyx_t_2, function);
  9431. }
  9432. }
  9433. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9434. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9435. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  9436. __Pyx_GOTREF(__pyx_t_1);
  9437. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9438. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9439. /* "gedlibpy.pyx":974
  9440. *
  9441. * """
  9442. * if self.is_initialized() : # <<<<<<<<<<<<<<
  9443. * self.restart_env()
  9444. *
  9445. */
  9446. }
  9447. /* "gedlibpy.pyx":977
  9448. * self.restart_env()
  9449. *
  9450. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  9451. * for graph in dataset :
  9452. * self.add_nx_graph(graph, classes)
  9453. */
  9454. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 977, __pyx_L1_error)
  9455. __Pyx_GOTREF(__pyx_t_1);
  9456. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9457. /* "gedlibpy.pyx":978
  9458. *
  9459. * print("Loading graphs in progress...")
  9460. * for graph in dataset : # <<<<<<<<<<<<<<
  9461. * self.add_nx_graph(graph, classes)
  9462. * listID = self.graph_ids()
  9463. */
  9464. if (likely(PyList_CheckExact(__pyx_v_dataset)) || PyTuple_CheckExact(__pyx_v_dataset)) {
  9465. __pyx_t_1 = __pyx_v_dataset; __Pyx_INCREF(__pyx_t_1); __pyx_t_5 = 0;
  9466. __pyx_t_6 = NULL;
  9467. } else {
  9468. __pyx_t_5 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_dataset); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 978, __pyx_L1_error)
  9469. __Pyx_GOTREF(__pyx_t_1);
  9470. __pyx_t_6 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 978, __pyx_L1_error)
  9471. }
  9472. for (;;) {
  9473. if (likely(!__pyx_t_6)) {
  9474. if (likely(PyList_CheckExact(__pyx_t_1))) {
  9475. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_1)) break;
  9476. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9477. __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, 978, __pyx_L1_error)
  9478. #else
  9479. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
  9480. __Pyx_GOTREF(__pyx_t_2);
  9481. #endif
  9482. } else {
  9483. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  9484. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9485. __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, 978, __pyx_L1_error)
  9486. #else
  9487. __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
  9488. __Pyx_GOTREF(__pyx_t_2);
  9489. #endif
  9490. }
  9491. } else {
  9492. __pyx_t_2 = __pyx_t_6(__pyx_t_1);
  9493. if (unlikely(!__pyx_t_2)) {
  9494. PyObject* exc_type = PyErr_Occurred();
  9495. if (exc_type) {
  9496. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9497. else __PYX_ERR(0, 978, __pyx_L1_error)
  9498. }
  9499. break;
  9500. }
  9501. __Pyx_GOTREF(__pyx_t_2);
  9502. }
  9503. __Pyx_XDECREF_SET(__pyx_v_graph, __pyx_t_2);
  9504. __pyx_t_2 = 0;
  9505. /* "gedlibpy.pyx":979
  9506. * print("Loading graphs in progress...")
  9507. * for graph in dataset :
  9508. * self.add_nx_graph(graph, classes) # <<<<<<<<<<<<<<
  9509. * listID = self.graph_ids()
  9510. * print("Graphs loaded ! ")
  9511. */
  9512. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_nx_graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 979, __pyx_L1_error)
  9513. __Pyx_GOTREF(__pyx_t_3);
  9514. __pyx_t_7 = NULL;
  9515. __pyx_t_8 = 0;
  9516. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  9517. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
  9518. if (likely(__pyx_t_7)) {
  9519. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  9520. __Pyx_INCREF(__pyx_t_7);
  9521. __Pyx_INCREF(function);
  9522. __Pyx_DECREF_SET(__pyx_t_3, function);
  9523. __pyx_t_8 = 1;
  9524. }
  9525. }
  9526. #if CYTHON_FAST_PYCALL
  9527. if (PyFunction_Check(__pyx_t_3)) {
  9528. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9529. __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, 979, __pyx_L1_error)
  9530. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9531. __Pyx_GOTREF(__pyx_t_2);
  9532. } else
  9533. #endif
  9534. #if CYTHON_FAST_PYCCALL
  9535. if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
  9536. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_graph, __pyx_v_classes};
  9537. __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, 979, __pyx_L1_error)
  9538. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9539. __Pyx_GOTREF(__pyx_t_2);
  9540. } else
  9541. #endif
  9542. {
  9543. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 979, __pyx_L1_error)
  9544. __Pyx_GOTREF(__pyx_t_9);
  9545. if (__pyx_t_7) {
  9546. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9547. }
  9548. __Pyx_INCREF(__pyx_v_graph);
  9549. __Pyx_GIVEREF(__pyx_v_graph);
  9550. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_graph);
  9551. __Pyx_INCREF(__pyx_v_classes);
  9552. __Pyx_GIVEREF(__pyx_v_classes);
  9553. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_classes);
  9554. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 979, __pyx_L1_error)
  9555. __Pyx_GOTREF(__pyx_t_2);
  9556. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9557. }
  9558. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9559. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9560. /* "gedlibpy.pyx":978
  9561. *
  9562. * print("Loading graphs in progress...")
  9563. * for graph in dataset : # <<<<<<<<<<<<<<
  9564. * self.add_nx_graph(graph, classes)
  9565. * listID = self.graph_ids()
  9566. */
  9567. }
  9568. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9569. /* "gedlibpy.pyx":980
  9570. * for graph in dataset :
  9571. * self.add_nx_graph(graph, classes)
  9572. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  9573. * print("Graphs loaded ! ")
  9574. * print("Number of graphs = " + str(listID[1]))
  9575. */
  9576. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 980, __pyx_L1_error)
  9577. __Pyx_GOTREF(__pyx_t_2);
  9578. __pyx_t_3 = NULL;
  9579. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9580. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  9581. if (likely(__pyx_t_3)) {
  9582. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9583. __Pyx_INCREF(__pyx_t_3);
  9584. __Pyx_INCREF(function);
  9585. __Pyx_DECREF_SET(__pyx_t_2, function);
  9586. }
  9587. }
  9588. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  9589. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9590. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 980, __pyx_L1_error)
  9591. __Pyx_GOTREF(__pyx_t_1);
  9592. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9593. __pyx_v_listID = __pyx_t_1;
  9594. __pyx_t_1 = 0;
  9595. /* "gedlibpy.pyx":981
  9596. * self.add_nx_graph(graph, classes)
  9597. * listID = self.graph_ids()
  9598. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  9599. * print("Number of graphs = " + str(listID[1]))
  9600. *
  9601. */
  9602. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  9603. __Pyx_GOTREF(__pyx_t_1);
  9604. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9605. /* "gedlibpy.pyx":982
  9606. * listID = self.graph_ids()
  9607. * print("Graphs loaded ! ")
  9608. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  9609. *
  9610. * self.set_edit_cost(edit_cost)
  9611. */
  9612. __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, 982, __pyx_L1_error)
  9613. __Pyx_GOTREF(__pyx_t_1);
  9614. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  9615. __Pyx_GOTREF(__pyx_t_2);
  9616. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9617. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 982, __pyx_L1_error)
  9618. __Pyx_GOTREF(__pyx_t_1);
  9619. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9620. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 982, __pyx_L1_error)
  9621. __Pyx_GOTREF(__pyx_t_2);
  9622. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9623. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9624. /* "gedlibpy.pyx":984
  9625. * print("Number of graphs = " + str(listID[1]))
  9626. *
  9627. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  9628. * print("Initialization in progress...")
  9629. * self.init(init_option)
  9630. */
  9631. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 984, __pyx_L1_error)
  9632. __Pyx_GOTREF(__pyx_t_1);
  9633. __pyx_t_3 = NULL;
  9634. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9635. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9636. if (likely(__pyx_t_3)) {
  9637. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9638. __Pyx_INCREF(__pyx_t_3);
  9639. __Pyx_INCREF(function);
  9640. __Pyx_DECREF_SET(__pyx_t_1, function);
  9641. }
  9642. }
  9643. __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);
  9644. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9645. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 984, __pyx_L1_error)
  9646. __Pyx_GOTREF(__pyx_t_2);
  9647. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9648. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9649. /* "gedlibpy.pyx":985
  9650. *
  9651. * self.set_edit_cost(edit_cost)
  9652. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  9653. * self.init(init_option)
  9654. * print("Initialization terminated !")
  9655. */
  9656. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 985, __pyx_L1_error)
  9657. __Pyx_GOTREF(__pyx_t_2);
  9658. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9659. /* "gedlibpy.pyx":986
  9660. * self.set_edit_cost(edit_cost)
  9661. * print("Initialization in progress...")
  9662. * self.init(init_option) # <<<<<<<<<<<<<<
  9663. * print("Initialization terminated !")
  9664. *
  9665. */
  9666. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 986, __pyx_L1_error)
  9667. __Pyx_GOTREF(__pyx_t_1);
  9668. __pyx_t_3 = NULL;
  9669. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9670. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9671. if (likely(__pyx_t_3)) {
  9672. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9673. __Pyx_INCREF(__pyx_t_3);
  9674. __Pyx_INCREF(function);
  9675. __Pyx_DECREF_SET(__pyx_t_1, function);
  9676. }
  9677. }
  9678. __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);
  9679. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9680. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 986, __pyx_L1_error)
  9681. __Pyx_GOTREF(__pyx_t_2);
  9682. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9683. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9684. /* "gedlibpy.pyx":987
  9685. * print("Initialization in progress...")
  9686. * self.init(init_option)
  9687. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  9688. *
  9689. * self.set_method(method, options)
  9690. */
  9691. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
  9692. __Pyx_GOTREF(__pyx_t_2);
  9693. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9694. /* "gedlibpy.pyx":989
  9695. * print("Initialization terminated !")
  9696. *
  9697. * self.set_method(method, options) # <<<<<<<<<<<<<<
  9698. * self.init_method()
  9699. *
  9700. */
  9701. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 989, __pyx_L1_error)
  9702. __Pyx_GOTREF(__pyx_t_1);
  9703. __pyx_t_3 = NULL;
  9704. __pyx_t_8 = 0;
  9705. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9706. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  9707. if (likely(__pyx_t_3)) {
  9708. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9709. __Pyx_INCREF(__pyx_t_3);
  9710. __Pyx_INCREF(function);
  9711. __Pyx_DECREF_SET(__pyx_t_1, function);
  9712. __pyx_t_8 = 1;
  9713. }
  9714. }
  9715. #if CYTHON_FAST_PYCALL
  9716. if (PyFunction_Check(__pyx_t_1)) {
  9717. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9718. __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, 989, __pyx_L1_error)
  9719. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9720. __Pyx_GOTREF(__pyx_t_2);
  9721. } else
  9722. #endif
  9723. #if CYTHON_FAST_PYCCALL
  9724. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  9725. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_method, __pyx_v_options};
  9726. __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, 989, __pyx_L1_error)
  9727. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  9728. __Pyx_GOTREF(__pyx_t_2);
  9729. } else
  9730. #endif
  9731. {
  9732. __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 989, __pyx_L1_error)
  9733. __Pyx_GOTREF(__pyx_t_9);
  9734. if (__pyx_t_3) {
  9735. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3); __pyx_t_3 = NULL;
  9736. }
  9737. __Pyx_INCREF(__pyx_v_method);
  9738. __Pyx_GIVEREF(__pyx_v_method);
  9739. PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_v_method);
  9740. __Pyx_INCREF(__pyx_v_options);
  9741. __Pyx_GIVEREF(__pyx_v_options);
  9742. PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_options);
  9743. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 989, __pyx_L1_error)
  9744. __Pyx_GOTREF(__pyx_t_2);
  9745. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9746. }
  9747. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9748. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9749. /* "gedlibpy.pyx":990
  9750. *
  9751. * self.set_method(method, options)
  9752. * self.init_method() # <<<<<<<<<<<<<<
  9753. *
  9754. * resDistance = [[]]
  9755. */
  9756. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
  9757. __Pyx_GOTREF(__pyx_t_1);
  9758. __pyx_t_9 = NULL;
  9759. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  9760. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_1);
  9761. if (likely(__pyx_t_9)) {
  9762. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  9763. __Pyx_INCREF(__pyx_t_9);
  9764. __Pyx_INCREF(function);
  9765. __Pyx_DECREF_SET(__pyx_t_1, function);
  9766. }
  9767. }
  9768. __pyx_t_2 = (__pyx_t_9) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  9769. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  9770. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 990, __pyx_L1_error)
  9771. __Pyx_GOTREF(__pyx_t_2);
  9772. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9773. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9774. /* "gedlibpy.pyx":992
  9775. * self.init_method()
  9776. *
  9777. * resDistance = [[]] # <<<<<<<<<<<<<<
  9778. * resMapping = [[]]
  9779. * for g in range(listID[0], listID[1]) :
  9780. */
  9781. __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 992, __pyx_L1_error)
  9782. __Pyx_GOTREF(__pyx_t_2);
  9783. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 992, __pyx_L1_error)
  9784. __Pyx_GOTREF(__pyx_t_1);
  9785. __Pyx_GIVEREF(__pyx_t_2);
  9786. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  9787. __pyx_t_2 = 0;
  9788. __pyx_v_resDistance = ((PyObject*)__pyx_t_1);
  9789. __pyx_t_1 = 0;
  9790. /* "gedlibpy.pyx":993
  9791. *
  9792. * resDistance = [[]]
  9793. * resMapping = [[]] # <<<<<<<<<<<<<<
  9794. * for g in range(listID[0], listID[1]) :
  9795. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9796. */
  9797. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 993, __pyx_L1_error)
  9798. __Pyx_GOTREF(__pyx_t_1);
  9799. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 993, __pyx_L1_error)
  9800. __Pyx_GOTREF(__pyx_t_2);
  9801. __Pyx_GIVEREF(__pyx_t_1);
  9802. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  9803. __pyx_t_1 = 0;
  9804. __pyx_v_resMapping = ((PyObject*)__pyx_t_2);
  9805. __pyx_t_2 = 0;
  9806. /* "gedlibpy.pyx":994
  9807. * resDistance = [[]]
  9808. * resMapping = [[]]
  9809. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9810. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9811. * for h in range(listID[0], listID[1]) :
  9812. */
  9813. __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, 994, __pyx_L1_error)
  9814. __Pyx_GOTREF(__pyx_t_2);
  9815. __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, 994, __pyx_L1_error)
  9816. __Pyx_GOTREF(__pyx_t_1);
  9817. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error)
  9818. __Pyx_GOTREF(__pyx_t_9);
  9819. __Pyx_GIVEREF(__pyx_t_2);
  9820. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_2);
  9821. __Pyx_GIVEREF(__pyx_t_1);
  9822. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_1);
  9823. __pyx_t_2 = 0;
  9824. __pyx_t_1 = 0;
  9825. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  9826. __Pyx_GOTREF(__pyx_t_1);
  9827. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  9828. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9829. __pyx_t_9 = __pyx_t_1; __Pyx_INCREF(__pyx_t_9); __pyx_t_5 = 0;
  9830. __pyx_t_6 = NULL;
  9831. } else {
  9832. __pyx_t_5 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 994, __pyx_L1_error)
  9833. __Pyx_GOTREF(__pyx_t_9);
  9834. __pyx_t_6 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 994, __pyx_L1_error)
  9835. }
  9836. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9837. for (;;) {
  9838. if (likely(!__pyx_t_6)) {
  9839. if (likely(PyList_CheckExact(__pyx_t_9))) {
  9840. if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_9)) break;
  9841. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9842. __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, 994, __pyx_L1_error)
  9843. #else
  9844. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  9845. __Pyx_GOTREF(__pyx_t_1);
  9846. #endif
  9847. } else {
  9848. if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
  9849. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9850. __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, 994, __pyx_L1_error)
  9851. #else
  9852. __pyx_t_1 = PySequence_ITEM(__pyx_t_9, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  9853. __Pyx_GOTREF(__pyx_t_1);
  9854. #endif
  9855. }
  9856. } else {
  9857. __pyx_t_1 = __pyx_t_6(__pyx_t_9);
  9858. if (unlikely(!__pyx_t_1)) {
  9859. PyObject* exc_type = PyErr_Occurred();
  9860. if (exc_type) {
  9861. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9862. else __PYX_ERR(0, 994, __pyx_L1_error)
  9863. }
  9864. break;
  9865. }
  9866. __Pyx_GOTREF(__pyx_t_1);
  9867. }
  9868. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  9869. __pyx_t_1 = 0;
  9870. /* "gedlibpy.pyx":995
  9871. * resMapping = [[]]
  9872. * for g in range(listID[0], listID[1]) :
  9873. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  9874. * for h in range(listID[0], listID[1]) :
  9875. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9876. */
  9877. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 995, __pyx_L1_error)
  9878. __Pyx_GOTREF(__pyx_t_1);
  9879. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  9880. __Pyx_GOTREF(__pyx_t_2);
  9881. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9882. __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, 995, __pyx_L1_error)
  9883. __Pyx_GOTREF(__pyx_t_1);
  9884. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9885. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 995, __pyx_L1_error)
  9886. __Pyx_GOTREF(__pyx_t_2);
  9887. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9888. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  9889. /* "gedlibpy.pyx":996
  9890. * for g in range(listID[0], listID[1]) :
  9891. * print("Computation between graph " + str(g) + " with all the others including himself.")
  9892. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  9893. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9894. * self.run_method(g, h)
  9895. */
  9896. __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, 996, __pyx_L1_error)
  9897. __Pyx_GOTREF(__pyx_t_2);
  9898. __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, 996, __pyx_L1_error)
  9899. __Pyx_GOTREF(__pyx_t_1);
  9900. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error)
  9901. __Pyx_GOTREF(__pyx_t_3);
  9902. __Pyx_GIVEREF(__pyx_t_2);
  9903. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  9904. __Pyx_GIVEREF(__pyx_t_1);
  9905. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  9906. __pyx_t_2 = 0;
  9907. __pyx_t_1 = 0;
  9908. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  9909. __Pyx_GOTREF(__pyx_t_1);
  9910. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  9911. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  9912. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_10 = 0;
  9913. __pyx_t_11 = NULL;
  9914. } else {
  9915. __pyx_t_10 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 996, __pyx_L1_error)
  9916. __Pyx_GOTREF(__pyx_t_3);
  9917. __pyx_t_11 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 996, __pyx_L1_error)
  9918. }
  9919. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  9920. for (;;) {
  9921. if (likely(!__pyx_t_11)) {
  9922. if (likely(PyList_CheckExact(__pyx_t_3))) {
  9923. if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_3)) break;
  9924. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9925. __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, 996, __pyx_L1_error)
  9926. #else
  9927. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  9928. __Pyx_GOTREF(__pyx_t_1);
  9929. #endif
  9930. } else {
  9931. if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  9932. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  9933. __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, 996, __pyx_L1_error)
  9934. #else
  9935. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 996, __pyx_L1_error)
  9936. __Pyx_GOTREF(__pyx_t_1);
  9937. #endif
  9938. }
  9939. } else {
  9940. __pyx_t_1 = __pyx_t_11(__pyx_t_3);
  9941. if (unlikely(!__pyx_t_1)) {
  9942. PyObject* exc_type = PyErr_Occurred();
  9943. if (exc_type) {
  9944. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  9945. else __PYX_ERR(0, 996, __pyx_L1_error)
  9946. }
  9947. break;
  9948. }
  9949. __Pyx_GOTREF(__pyx_t_1);
  9950. }
  9951. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  9952. __pyx_t_1 = 0;
  9953. /* "gedlibpy.pyx":998
  9954. * for h in range(listID[0], listID[1]) :
  9955. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  9956. * self.run_method(g, h) # <<<<<<<<<<<<<<
  9957. * resDistance[g][h] = self.get_upper_bound(g, h)
  9958. * resMapping[g][h] = self.get_node_map(g, h)
  9959. */
  9960. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 998, __pyx_L1_error)
  9961. __Pyx_GOTREF(__pyx_t_2);
  9962. __pyx_t_7 = NULL;
  9963. __pyx_t_8 = 0;
  9964. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  9965. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  9966. if (likely(__pyx_t_7)) {
  9967. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  9968. __Pyx_INCREF(__pyx_t_7);
  9969. __Pyx_INCREF(function);
  9970. __Pyx_DECREF_SET(__pyx_t_2, function);
  9971. __pyx_t_8 = 1;
  9972. }
  9973. }
  9974. #if CYTHON_FAST_PYCALL
  9975. if (PyFunction_Check(__pyx_t_2)) {
  9976. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9977. __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, 998, __pyx_L1_error)
  9978. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9979. __Pyx_GOTREF(__pyx_t_1);
  9980. } else
  9981. #endif
  9982. #if CYTHON_FAST_PYCCALL
  9983. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  9984. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  9985. __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, 998, __pyx_L1_error)
  9986. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  9987. __Pyx_GOTREF(__pyx_t_1);
  9988. } else
  9989. #endif
  9990. {
  9991. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 998, __pyx_L1_error)
  9992. __Pyx_GOTREF(__pyx_t_12);
  9993. if (__pyx_t_7) {
  9994. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  9995. }
  9996. __Pyx_INCREF(__pyx_v_g);
  9997. __Pyx_GIVEREF(__pyx_v_g);
  9998. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  9999. __Pyx_INCREF(__pyx_v_h);
  10000. __Pyx_GIVEREF(__pyx_v_h);
  10001. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  10002. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 998, __pyx_L1_error)
  10003. __Pyx_GOTREF(__pyx_t_1);
  10004. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10005. }
  10006. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10007. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10008. /* "gedlibpy.pyx":999
  10009. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10010. * self.run_method(g, h)
  10011. * resDistance[g][h] = self.get_upper_bound(g, h) # <<<<<<<<<<<<<<
  10012. * resMapping[g][h] = self.get_node_map(g, h)
  10013. *
  10014. */
  10015. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_upper_bound); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  10016. __Pyx_GOTREF(__pyx_t_2);
  10017. __pyx_t_12 = NULL;
  10018. __pyx_t_8 = 0;
  10019. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10020. __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_2);
  10021. if (likely(__pyx_t_12)) {
  10022. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10023. __Pyx_INCREF(__pyx_t_12);
  10024. __Pyx_INCREF(function);
  10025. __Pyx_DECREF_SET(__pyx_t_2, function);
  10026. __pyx_t_8 = 1;
  10027. }
  10028. }
  10029. #if CYTHON_FAST_PYCALL
  10030. if (PyFunction_Check(__pyx_t_2)) {
  10031. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10032. __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, 999, __pyx_L1_error)
  10033. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10034. __Pyx_GOTREF(__pyx_t_1);
  10035. } else
  10036. #endif
  10037. #if CYTHON_FAST_PYCCALL
  10038. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10039. PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_v_g, __pyx_v_h};
  10040. __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, 999, __pyx_L1_error)
  10041. __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
  10042. __Pyx_GOTREF(__pyx_t_1);
  10043. } else
  10044. #endif
  10045. {
  10046. __pyx_t_7 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 999, __pyx_L1_error)
  10047. __Pyx_GOTREF(__pyx_t_7);
  10048. if (__pyx_t_12) {
  10049. __Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_12); __pyx_t_12 = NULL;
  10050. }
  10051. __Pyx_INCREF(__pyx_v_g);
  10052. __Pyx_GIVEREF(__pyx_v_g);
  10053. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_8, __pyx_v_g);
  10054. __Pyx_INCREF(__pyx_v_h);
  10055. __Pyx_GIVEREF(__pyx_v_h);
  10056. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_8, __pyx_v_h);
  10057. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 999, __pyx_L1_error)
  10058. __Pyx_GOTREF(__pyx_t_1);
  10059. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  10060. }
  10061. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10062. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resDistance, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 999, __pyx_L1_error)
  10063. __Pyx_GOTREF(__pyx_t_2);
  10064. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 999, __pyx_L1_error)
  10065. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10066. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10067. /* "gedlibpy.pyx":1000
  10068. * self.run_method(g, h)
  10069. * resDistance[g][h] = self.get_upper_bound(g, h)
  10070. * resMapping[g][h] = self.get_node_map(g, h) # <<<<<<<<<<<<<<
  10071. *
  10072. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10073. */
  10074. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_node_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10075. __Pyx_GOTREF(__pyx_t_2);
  10076. __pyx_t_7 = NULL;
  10077. __pyx_t_8 = 0;
  10078. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10079. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  10080. if (likely(__pyx_t_7)) {
  10081. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10082. __Pyx_INCREF(__pyx_t_7);
  10083. __Pyx_INCREF(function);
  10084. __Pyx_DECREF_SET(__pyx_t_2, function);
  10085. __pyx_t_8 = 1;
  10086. }
  10087. }
  10088. #if CYTHON_FAST_PYCALL
  10089. if (PyFunction_Check(__pyx_t_2)) {
  10090. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10091. __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, 1000, __pyx_L1_error)
  10092. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10093. __Pyx_GOTREF(__pyx_t_1);
  10094. } else
  10095. #endif
  10096. #if CYTHON_FAST_PYCCALL
  10097. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10098. PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_v_g, __pyx_v_h};
  10099. __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, 1000, __pyx_L1_error)
  10100. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  10101. __Pyx_GOTREF(__pyx_t_1);
  10102. } else
  10103. #endif
  10104. {
  10105. __pyx_t_12 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10106. __Pyx_GOTREF(__pyx_t_12);
  10107. if (__pyx_t_7) {
  10108. __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
  10109. }
  10110. __Pyx_INCREF(__pyx_v_g);
  10111. __Pyx_GIVEREF(__pyx_v_g);
  10112. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_8, __pyx_v_g);
  10113. __Pyx_INCREF(__pyx_v_h);
  10114. __Pyx_GIVEREF(__pyx_v_h);
  10115. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_8, __pyx_v_h);
  10116. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10117. __Pyx_GOTREF(__pyx_t_1);
  10118. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10119. }
  10120. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10121. __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_resMapping, __pyx_v_g); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10122. __Pyx_GOTREF(__pyx_t_2);
  10123. if (unlikely(PyObject_SetItem(__pyx_t_2, __pyx_v_h, __pyx_t_1) < 0)) __PYX_ERR(0, 1000, __pyx_L1_error)
  10124. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10125. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10126. /* "gedlibpy.pyx":996
  10127. * for g in range(listID[0], listID[1]) :
  10128. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10129. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10130. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10131. * self.run_method(g, h)
  10132. */
  10133. }
  10134. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10135. /* "gedlibpy.pyx":994
  10136. * resDistance = [[]]
  10137. * resMapping = [[]]
  10138. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10139. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10140. * for h in range(listID[0], listID[1]) :
  10141. */
  10142. }
  10143. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10144. /* "gedlibpy.pyx":1002
  10145. * resMapping[g][h] = self.get_node_map(g, h)
  10146. *
  10147. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  10148. * return resDistance, resMapping
  10149. *
  10150. */
  10151. __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1002, __pyx_L1_error)
  10152. __Pyx_GOTREF(__pyx_t_9);
  10153. __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  10154. /* "gedlibpy.pyx":1003
  10155. *
  10156. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment")
  10157. * return resDistance, resMapping # <<<<<<<<<<<<<<
  10158. *
  10159. *
  10160. */
  10161. __Pyx_XDECREF(__pyx_r);
  10162. __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1003, __pyx_L1_error)
  10163. __Pyx_GOTREF(__pyx_t_9);
  10164. __Pyx_INCREF(__pyx_v_resDistance);
  10165. __Pyx_GIVEREF(__pyx_v_resDistance);
  10166. PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_v_resDistance);
  10167. __Pyx_INCREF(__pyx_v_resMapping);
  10168. __Pyx_GIVEREF(__pyx_v_resMapping);
  10169. PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_resMapping);
  10170. __pyx_r = __pyx_t_9;
  10171. __pyx_t_9 = 0;
  10172. goto __pyx_L0;
  10173. /* "gedlibpy.pyx":950
  10174. *
  10175. *
  10176. * def compute_edit_distance_on_nx_graphs(self, dataset, classes, edit_cost, method, options, init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10177. * """
  10178. *
  10179. */
  10180. /* function exit code */
  10181. __pyx_L1_error:;
  10182. __Pyx_XDECREF(__pyx_t_1);
  10183. __Pyx_XDECREF(__pyx_t_2);
  10184. __Pyx_XDECREF(__pyx_t_3);
  10185. __Pyx_XDECREF(__pyx_t_7);
  10186. __Pyx_XDECREF(__pyx_t_9);
  10187. __Pyx_XDECREF(__pyx_t_12);
  10188. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_nx_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10189. __pyx_r = NULL;
  10190. __pyx_L0:;
  10191. __Pyx_XDECREF(__pyx_v_graph);
  10192. __Pyx_XDECREF(__pyx_v_listID);
  10193. __Pyx_XDECREF(__pyx_v_resDistance);
  10194. __Pyx_XDECREF(__pyx_v_resMapping);
  10195. __Pyx_XDECREF(__pyx_v_g);
  10196. __Pyx_XDECREF(__pyx_v_h);
  10197. __Pyx_XGIVEREF(__pyx_r);
  10198. __Pyx_RefNannyFinishContext();
  10199. return __pyx_r;
  10200. }
  10201. /* "gedlibpy.pyx":1006
  10202. *
  10203. *
  10204. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10205. * """
  10206. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10207. */
  10208. /* Python wrapper */
  10209. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  10210. 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";
  10211. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_93compute_edit_distance_on_GXl_graphs(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  10212. PyObject *__pyx_v_path_folder = 0;
  10213. PyObject *__pyx_v_path_XML = 0;
  10214. PyObject *__pyx_v_edit_cost = 0;
  10215. PyObject *__pyx_v_method = 0;
  10216. PyObject *__pyx_v_options = 0;
  10217. PyObject *__pyx_v_init_option = 0;
  10218. PyObject *__pyx_r = 0;
  10219. __Pyx_RefNannyDeclarations
  10220. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs (wrapper)", 0);
  10221. {
  10222. 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};
  10223. PyObject* values[6] = {0,0,0,0,0,0};
  10224. values[4] = ((PyObject *)__pyx_kp_u_);
  10225. values[5] = ((PyObject *)__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES);
  10226. if (unlikely(__pyx_kwds)) {
  10227. Py_ssize_t kw_args;
  10228. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  10229. switch (pos_args) {
  10230. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10231. CYTHON_FALLTHROUGH;
  10232. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10233. CYTHON_FALLTHROUGH;
  10234. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10235. CYTHON_FALLTHROUGH;
  10236. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10237. CYTHON_FALLTHROUGH;
  10238. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10239. CYTHON_FALLTHROUGH;
  10240. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10241. CYTHON_FALLTHROUGH;
  10242. case 0: break;
  10243. default: goto __pyx_L5_argtuple_error;
  10244. }
  10245. kw_args = PyDict_Size(__pyx_kwds);
  10246. switch (pos_args) {
  10247. case 0:
  10248. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_folder)) != 0)) kw_args--;
  10249. else goto __pyx_L5_argtuple_error;
  10250. CYTHON_FALLTHROUGH;
  10251. case 1:
  10252. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_path_XML)) != 0)) kw_args--;
  10253. else {
  10254. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 1); __PYX_ERR(0, 1006, __pyx_L3_error)
  10255. }
  10256. CYTHON_FALLTHROUGH;
  10257. case 2:
  10258. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edit_cost)) != 0)) kw_args--;
  10259. else {
  10260. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 2); __PYX_ERR(0, 1006, __pyx_L3_error)
  10261. }
  10262. CYTHON_FALLTHROUGH;
  10263. case 3:
  10264. if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
  10265. else {
  10266. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, 3); __PYX_ERR(0, 1006, __pyx_L3_error)
  10267. }
  10268. CYTHON_FALLTHROUGH;
  10269. case 4:
  10270. if (kw_args > 0) {
  10271. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_options);
  10272. if (value) { values[4] = value; kw_args--; }
  10273. }
  10274. CYTHON_FALLTHROUGH;
  10275. case 5:
  10276. if (kw_args > 0) {
  10277. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_init_option);
  10278. if (value) { values[5] = value; kw_args--; }
  10279. }
  10280. }
  10281. if (unlikely(kw_args > 0)) {
  10282. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_edit_distance_on_GXl_graphs") < 0)) __PYX_ERR(0, 1006, __pyx_L3_error)
  10283. }
  10284. } else {
  10285. switch (PyTuple_GET_SIZE(__pyx_args)) {
  10286. case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
  10287. CYTHON_FALLTHROUGH;
  10288. case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
  10289. CYTHON_FALLTHROUGH;
  10290. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  10291. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  10292. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  10293. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  10294. break;
  10295. default: goto __pyx_L5_argtuple_error;
  10296. }
  10297. }
  10298. __pyx_v_path_folder = values[0];
  10299. __pyx_v_path_XML = values[1];
  10300. __pyx_v_edit_cost = values[2];
  10301. __pyx_v_method = values[3];
  10302. __pyx_v_options = values[4];
  10303. __pyx_v_init_option = values[5];
  10304. }
  10305. goto __pyx_L4_argument_unpacking_done;
  10306. __pyx_L5_argtuple_error:;
  10307. __Pyx_RaiseArgtupleInvalid("compute_edit_distance_on_GXl_graphs", 0, 4, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1006, __pyx_L3_error)
  10308. __pyx_L3_error:;
  10309. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10310. __Pyx_RefNannyFinishContext();
  10311. return NULL;
  10312. __pyx_L4_argument_unpacking_done:;
  10313. __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);
  10314. /* function exit code */
  10315. __Pyx_RefNannyFinishContext();
  10316. return __pyx_r;
  10317. }
  10318. 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) {
  10319. PyObject *__pyx_v_listID = NULL;
  10320. PyObject *__pyx_v_g = NULL;
  10321. PyObject *__pyx_v_h = NULL;
  10322. PyObject *__pyx_r = NULL;
  10323. __Pyx_RefNannyDeclarations
  10324. PyObject *__pyx_t_1 = NULL;
  10325. PyObject *__pyx_t_2 = NULL;
  10326. PyObject *__pyx_t_3 = NULL;
  10327. int __pyx_t_4;
  10328. int __pyx_t_5;
  10329. PyObject *__pyx_t_6 = NULL;
  10330. Py_ssize_t __pyx_t_7;
  10331. PyObject *(*__pyx_t_8)(PyObject *);
  10332. Py_ssize_t __pyx_t_9;
  10333. PyObject *(*__pyx_t_10)(PyObject *);
  10334. PyObject *__pyx_t_11 = NULL;
  10335. PyObject *__pyx_t_12 = NULL;
  10336. __Pyx_RefNannySetupContext("compute_edit_distance_on_GXl_graphs", 0);
  10337. /* "gedlibpy.pyx":1030
  10338. * """
  10339. *
  10340. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10341. * self.restart_env()
  10342. *
  10343. */
  10344. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_is_initialized); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10345. __Pyx_GOTREF(__pyx_t_2);
  10346. __pyx_t_3 = NULL;
  10347. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10348. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10349. if (likely(__pyx_t_3)) {
  10350. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10351. __Pyx_INCREF(__pyx_t_3);
  10352. __Pyx_INCREF(function);
  10353. __Pyx_DECREF_SET(__pyx_t_2, function);
  10354. }
  10355. }
  10356. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10357. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10358. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10359. __Pyx_GOTREF(__pyx_t_1);
  10360. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10361. __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1030, __pyx_L1_error)
  10362. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10363. if (__pyx_t_4) {
  10364. /* "gedlibpy.pyx":1031
  10365. *
  10366. * if self.is_initialized() :
  10367. * self.restart_env() # <<<<<<<<<<<<<<
  10368. *
  10369. * print("Loading graphs in progress...")
  10370. */
  10371. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_restart_env); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10372. __Pyx_GOTREF(__pyx_t_2);
  10373. __pyx_t_3 = NULL;
  10374. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10375. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10376. if (likely(__pyx_t_3)) {
  10377. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10378. __Pyx_INCREF(__pyx_t_3);
  10379. __Pyx_INCREF(function);
  10380. __Pyx_DECREF_SET(__pyx_t_2, function);
  10381. }
  10382. }
  10383. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10384. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10385. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1031, __pyx_L1_error)
  10386. __Pyx_GOTREF(__pyx_t_1);
  10387. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10388. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10389. /* "gedlibpy.pyx":1030
  10390. * """
  10391. *
  10392. * if self.is_initialized() : # <<<<<<<<<<<<<<
  10393. * self.restart_env()
  10394. *
  10395. */
  10396. }
  10397. /* "gedlibpy.pyx":1033
  10398. * self.restart_env()
  10399. *
  10400. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  10401. * self.load_GXL_graphs(path_folder, path_XML)
  10402. * listID = self.graph_ids()
  10403. */
  10404. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1033, __pyx_L1_error)
  10405. __Pyx_GOTREF(__pyx_t_1);
  10406. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10407. /* "gedlibpy.pyx":1034
  10408. *
  10409. * print("Loading graphs in progress...")
  10410. * self.load_GXL_graphs(path_folder, path_XML) # <<<<<<<<<<<<<<
  10411. * listID = self.graph_ids()
  10412. * print("Graphs loaded ! ")
  10413. */
  10414. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_load_GXL_graphs); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1034, __pyx_L1_error)
  10415. __Pyx_GOTREF(__pyx_t_2);
  10416. __pyx_t_3 = NULL;
  10417. __pyx_t_5 = 0;
  10418. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10419. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  10420. if (likely(__pyx_t_3)) {
  10421. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10422. __Pyx_INCREF(__pyx_t_3);
  10423. __Pyx_INCREF(function);
  10424. __Pyx_DECREF_SET(__pyx_t_2, function);
  10425. __pyx_t_5 = 1;
  10426. }
  10427. }
  10428. #if CYTHON_FAST_PYCALL
  10429. if (PyFunction_Check(__pyx_t_2)) {
  10430. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10431. __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, 1034, __pyx_L1_error)
  10432. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10433. __Pyx_GOTREF(__pyx_t_1);
  10434. } else
  10435. #endif
  10436. #if CYTHON_FAST_PYCCALL
  10437. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10438. PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_path_folder, __pyx_v_path_XML};
  10439. __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, 1034, __pyx_L1_error)
  10440. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10441. __Pyx_GOTREF(__pyx_t_1);
  10442. } else
  10443. #endif
  10444. {
  10445. __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1034, __pyx_L1_error)
  10446. __Pyx_GOTREF(__pyx_t_6);
  10447. if (__pyx_t_3) {
  10448. __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
  10449. }
  10450. __Pyx_INCREF(__pyx_v_path_folder);
  10451. __Pyx_GIVEREF(__pyx_v_path_folder);
  10452. PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_path_folder);
  10453. __Pyx_INCREF(__pyx_v_path_XML);
  10454. __Pyx_GIVEREF(__pyx_v_path_XML);
  10455. PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_path_XML);
  10456. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1034, __pyx_L1_error)
  10457. __Pyx_GOTREF(__pyx_t_1);
  10458. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10459. }
  10460. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10461. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10462. /* "gedlibpy.pyx":1035
  10463. * print("Loading graphs in progress...")
  10464. * self.load_GXL_graphs(path_folder, path_XML)
  10465. * listID = self.graph_ids() # <<<<<<<<<<<<<<
  10466. * print("Graphs loaded ! ")
  10467. * print("Number of graphs = " + str(listID[1]))
  10468. */
  10469. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_graph_ids); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1035, __pyx_L1_error)
  10470. __Pyx_GOTREF(__pyx_t_2);
  10471. __pyx_t_6 = NULL;
  10472. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10473. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  10474. if (likely(__pyx_t_6)) {
  10475. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10476. __Pyx_INCREF(__pyx_t_6);
  10477. __Pyx_INCREF(function);
  10478. __Pyx_DECREF_SET(__pyx_t_2, function);
  10479. }
  10480. }
  10481. __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  10482. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10483. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1035, __pyx_L1_error)
  10484. __Pyx_GOTREF(__pyx_t_1);
  10485. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10486. __pyx_v_listID = __pyx_t_1;
  10487. __pyx_t_1 = 0;
  10488. /* "gedlibpy.pyx":1036
  10489. * self.load_GXL_graphs(path_folder, path_XML)
  10490. * listID = self.graph_ids()
  10491. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  10492. * print("Number of graphs = " + str(listID[1]))
  10493. *
  10494. */
  10495. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1036, __pyx_L1_error)
  10496. __Pyx_GOTREF(__pyx_t_1);
  10497. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10498. /* "gedlibpy.pyx":1037
  10499. * listID = self.graph_ids()
  10500. * print("Graphs loaded ! ")
  10501. * print("Number of graphs = " + str(listID[1])) # <<<<<<<<<<<<<<
  10502. *
  10503. * self.set_edit_cost(edit_cost)
  10504. */
  10505. __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, 1037, __pyx_L1_error)
  10506. __Pyx_GOTREF(__pyx_t_1);
  10507. __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
  10508. __Pyx_GOTREF(__pyx_t_2);
  10509. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10510. __pyx_t_1 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Number_of_graphs, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1037, __pyx_L1_error)
  10511. __Pyx_GOTREF(__pyx_t_1);
  10512. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10513. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1037, __pyx_L1_error)
  10514. __Pyx_GOTREF(__pyx_t_2);
  10515. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10516. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10517. /* "gedlibpy.pyx":1039
  10518. * print("Number of graphs = " + str(listID[1]))
  10519. *
  10520. * self.set_edit_cost(edit_cost) # <<<<<<<<<<<<<<
  10521. * print("Initialization in progress...")
  10522. * self.init(init_option)
  10523. */
  10524. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_edit_cost); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10525. __Pyx_GOTREF(__pyx_t_1);
  10526. __pyx_t_6 = NULL;
  10527. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10528. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10529. if (likely(__pyx_t_6)) {
  10530. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10531. __Pyx_INCREF(__pyx_t_6);
  10532. __Pyx_INCREF(function);
  10533. __Pyx_DECREF_SET(__pyx_t_1, function);
  10534. }
  10535. }
  10536. __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);
  10537. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10538. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
  10539. __Pyx_GOTREF(__pyx_t_2);
  10540. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10541. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10542. /* "gedlibpy.pyx":1040
  10543. *
  10544. * self.set_edit_cost(edit_cost)
  10545. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  10546. * self.init(init_option)
  10547. * print("Initialization terminated !")
  10548. */
  10549. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1040, __pyx_L1_error)
  10550. __Pyx_GOTREF(__pyx_t_2);
  10551. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10552. /* "gedlibpy.pyx":1041
  10553. * self.set_edit_cost(edit_cost)
  10554. * print("Initialization in progress...")
  10555. * self.init(init_option) # <<<<<<<<<<<<<<
  10556. * print("Initialization terminated !")
  10557. *
  10558. */
  10559. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1041, __pyx_L1_error)
  10560. __Pyx_GOTREF(__pyx_t_1);
  10561. __pyx_t_6 = NULL;
  10562. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10563. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10564. if (likely(__pyx_t_6)) {
  10565. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10566. __Pyx_INCREF(__pyx_t_6);
  10567. __Pyx_INCREF(function);
  10568. __Pyx_DECREF_SET(__pyx_t_1, function);
  10569. }
  10570. }
  10571. __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);
  10572. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10573. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1041, __pyx_L1_error)
  10574. __Pyx_GOTREF(__pyx_t_2);
  10575. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10576. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10577. /* "gedlibpy.pyx":1042
  10578. * print("Initialization in progress...")
  10579. * self.init(init_option)
  10580. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  10581. *
  10582. * self.set_method(method, options)
  10583. */
  10584. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
  10585. __Pyx_GOTREF(__pyx_t_2);
  10586. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10587. /* "gedlibpy.pyx":1044
  10588. * print("Initialization terminated !")
  10589. *
  10590. * self.set_method(method, options) # <<<<<<<<<<<<<<
  10591. * self.init_method()
  10592. *
  10593. */
  10594. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1044, __pyx_L1_error)
  10595. __Pyx_GOTREF(__pyx_t_1);
  10596. __pyx_t_6 = NULL;
  10597. __pyx_t_5 = 0;
  10598. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10599. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
  10600. if (likely(__pyx_t_6)) {
  10601. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10602. __Pyx_INCREF(__pyx_t_6);
  10603. __Pyx_INCREF(function);
  10604. __Pyx_DECREF_SET(__pyx_t_1, function);
  10605. __pyx_t_5 = 1;
  10606. }
  10607. }
  10608. #if CYTHON_FAST_PYCALL
  10609. if (PyFunction_Check(__pyx_t_1)) {
  10610. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10611. __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, 1044, __pyx_L1_error)
  10612. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10613. __Pyx_GOTREF(__pyx_t_2);
  10614. } else
  10615. #endif
  10616. #if CYTHON_FAST_PYCCALL
  10617. if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
  10618. PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_method, __pyx_v_options};
  10619. __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, 1044, __pyx_L1_error)
  10620. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  10621. __Pyx_GOTREF(__pyx_t_2);
  10622. } else
  10623. #endif
  10624. {
  10625. __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1044, __pyx_L1_error)
  10626. __Pyx_GOTREF(__pyx_t_3);
  10627. if (__pyx_t_6) {
  10628. __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
  10629. }
  10630. __Pyx_INCREF(__pyx_v_method);
  10631. __Pyx_GIVEREF(__pyx_v_method);
  10632. PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_v_method);
  10633. __Pyx_INCREF(__pyx_v_options);
  10634. __Pyx_GIVEREF(__pyx_v_options);
  10635. PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_options);
  10636. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1044, __pyx_L1_error)
  10637. __Pyx_GOTREF(__pyx_t_2);
  10638. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10639. }
  10640. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10641. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10642. /* "gedlibpy.pyx":1045
  10643. *
  10644. * self.set_method(method, options)
  10645. * self.init_method() # <<<<<<<<<<<<<<
  10646. *
  10647. * #res = []
  10648. */
  10649. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_method); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10650. __Pyx_GOTREF(__pyx_t_1);
  10651. __pyx_t_3 = NULL;
  10652. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
  10653. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
  10654. if (likely(__pyx_t_3)) {
  10655. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
  10656. __Pyx_INCREF(__pyx_t_3);
  10657. __Pyx_INCREF(function);
  10658. __Pyx_DECREF_SET(__pyx_t_1, function);
  10659. }
  10660. }
  10661. __pyx_t_2 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
  10662. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  10663. if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1045, __pyx_L1_error)
  10664. __Pyx_GOTREF(__pyx_t_2);
  10665. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10666. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10667. /* "gedlibpy.pyx":1048
  10668. *
  10669. * #res = []
  10670. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10671. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10672. * for h in range(listID[0], listID[1]) :
  10673. */
  10674. __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, 1048, __pyx_L1_error)
  10675. __Pyx_GOTREF(__pyx_t_2);
  10676. __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, 1048, __pyx_L1_error)
  10677. __Pyx_GOTREF(__pyx_t_1);
  10678. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10679. __Pyx_GOTREF(__pyx_t_3);
  10680. __Pyx_GIVEREF(__pyx_t_2);
  10681. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  10682. __Pyx_GIVEREF(__pyx_t_1);
  10683. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  10684. __pyx_t_2 = 0;
  10685. __pyx_t_1 = 0;
  10686. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10687. __Pyx_GOTREF(__pyx_t_1);
  10688. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10689. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10690. __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
  10691. __pyx_t_8 = NULL;
  10692. } else {
  10693. __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10694. __Pyx_GOTREF(__pyx_t_3);
  10695. __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10696. }
  10697. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10698. for (;;) {
  10699. if (likely(!__pyx_t_8)) {
  10700. if (likely(PyList_CheckExact(__pyx_t_3))) {
  10701. if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
  10702. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10703. __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, 1048, __pyx_L1_error)
  10704. #else
  10705. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10706. __Pyx_GOTREF(__pyx_t_1);
  10707. #endif
  10708. } else {
  10709. if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  10710. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10711. __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, 1048, __pyx_L1_error)
  10712. #else
  10713. __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  10714. __Pyx_GOTREF(__pyx_t_1);
  10715. #endif
  10716. }
  10717. } else {
  10718. __pyx_t_1 = __pyx_t_8(__pyx_t_3);
  10719. if (unlikely(!__pyx_t_1)) {
  10720. PyObject* exc_type = PyErr_Occurred();
  10721. if (exc_type) {
  10722. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10723. else __PYX_ERR(0, 1048, __pyx_L1_error)
  10724. }
  10725. break;
  10726. }
  10727. __Pyx_GOTREF(__pyx_t_1);
  10728. }
  10729. __Pyx_XDECREF_SET(__pyx_v_g, __pyx_t_1);
  10730. __pyx_t_1 = 0;
  10731. /* "gedlibpy.pyx":1049
  10732. * #res = []
  10733. * for g in range(listID[0], listID[1]) :
  10734. * print("Computation between graph " + str(g) + " with all the others including himself.") # <<<<<<<<<<<<<<
  10735. * for h in range(listID[0], listID[1]) :
  10736. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10737. */
  10738. __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_g); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10739. __Pyx_GOTREF(__pyx_t_1);
  10740. __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_Computation_between_graph, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10741. __Pyx_GOTREF(__pyx_t_2);
  10742. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10743. __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, 1049, __pyx_L1_error)
  10744. __Pyx_GOTREF(__pyx_t_1);
  10745. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10746. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_print, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  10747. __Pyx_GOTREF(__pyx_t_2);
  10748. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10749. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10750. /* "gedlibpy.pyx":1050
  10751. * for g in range(listID[0], listID[1]) :
  10752. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10753. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10754. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10755. * self.run_method(g,h)
  10756. */
  10757. __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, 1050, __pyx_L1_error)
  10758. __Pyx_GOTREF(__pyx_t_2);
  10759. __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, 1050, __pyx_L1_error)
  10760. __Pyx_GOTREF(__pyx_t_1);
  10761. __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10762. __Pyx_GOTREF(__pyx_t_6);
  10763. __Pyx_GIVEREF(__pyx_t_2);
  10764. PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
  10765. __Pyx_GIVEREF(__pyx_t_1);
  10766. PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_1);
  10767. __pyx_t_2 = 0;
  10768. __pyx_t_1 = 0;
  10769. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10770. __Pyx_GOTREF(__pyx_t_1);
  10771. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10772. if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
  10773. __pyx_t_6 = __pyx_t_1; __Pyx_INCREF(__pyx_t_6); __pyx_t_9 = 0;
  10774. __pyx_t_10 = NULL;
  10775. } else {
  10776. __pyx_t_9 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10777. __Pyx_GOTREF(__pyx_t_6);
  10778. __pyx_t_10 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10779. }
  10780. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10781. for (;;) {
  10782. if (likely(!__pyx_t_10)) {
  10783. if (likely(PyList_CheckExact(__pyx_t_6))) {
  10784. if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_6)) break;
  10785. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10786. __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, 1050, __pyx_L1_error)
  10787. #else
  10788. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10789. __Pyx_GOTREF(__pyx_t_1);
  10790. #endif
  10791. } else {
  10792. if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
  10793. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  10794. __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, 1050, __pyx_L1_error)
  10795. #else
  10796. __pyx_t_1 = PySequence_ITEM(__pyx_t_6, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  10797. __Pyx_GOTREF(__pyx_t_1);
  10798. #endif
  10799. }
  10800. } else {
  10801. __pyx_t_1 = __pyx_t_10(__pyx_t_6);
  10802. if (unlikely(!__pyx_t_1)) {
  10803. PyObject* exc_type = PyErr_Occurred();
  10804. if (exc_type) {
  10805. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  10806. else __PYX_ERR(0, 1050, __pyx_L1_error)
  10807. }
  10808. break;
  10809. }
  10810. __Pyx_GOTREF(__pyx_t_1);
  10811. }
  10812. __Pyx_XDECREF_SET(__pyx_v_h, __pyx_t_1);
  10813. __pyx_t_1 = 0;
  10814. /* "gedlibpy.pyx":1052
  10815. * for h in range(listID[0], listID[1]) :
  10816. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10817. * self.run_method(g,h) # <<<<<<<<<<<<<<
  10818. * #res.append((get_upper_bound(g,h), get_node_map(g,h), get_runtime(g,h)))
  10819. *
  10820. */
  10821. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_run_method); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10822. __Pyx_GOTREF(__pyx_t_2);
  10823. __pyx_t_11 = NULL;
  10824. __pyx_t_5 = 0;
  10825. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  10826. __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_2);
  10827. if (likely(__pyx_t_11)) {
  10828. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  10829. __Pyx_INCREF(__pyx_t_11);
  10830. __Pyx_INCREF(function);
  10831. __Pyx_DECREF_SET(__pyx_t_2, function);
  10832. __pyx_t_5 = 1;
  10833. }
  10834. }
  10835. #if CYTHON_FAST_PYCALL
  10836. if (PyFunction_Check(__pyx_t_2)) {
  10837. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10838. __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, 1052, __pyx_L1_error)
  10839. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10840. __Pyx_GOTREF(__pyx_t_1);
  10841. } else
  10842. #endif
  10843. #if CYTHON_FAST_PYCCALL
  10844. if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
  10845. PyObject *__pyx_temp[3] = {__pyx_t_11, __pyx_v_g, __pyx_v_h};
  10846. __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, 1052, __pyx_L1_error)
  10847. __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  10848. __Pyx_GOTREF(__pyx_t_1);
  10849. } else
  10850. #endif
  10851. {
  10852. __pyx_t_12 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10853. __Pyx_GOTREF(__pyx_t_12);
  10854. if (__pyx_t_11) {
  10855. __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_11); __pyx_t_11 = NULL;
  10856. }
  10857. __Pyx_INCREF(__pyx_v_g);
  10858. __Pyx_GIVEREF(__pyx_v_g);
  10859. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_5, __pyx_v_g);
  10860. __Pyx_INCREF(__pyx_v_h);
  10861. __Pyx_GIVEREF(__pyx_v_h);
  10862. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_5, __pyx_v_h);
  10863. __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_12, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1052, __pyx_L1_error)
  10864. __Pyx_GOTREF(__pyx_t_1);
  10865. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  10866. }
  10867. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  10868. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  10869. /* "gedlibpy.pyx":1050
  10870. * for g in range(listID[0], listID[1]) :
  10871. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10872. * for h in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10873. * #print("Computation between graph " + str(g) + " and graph " + str(h))
  10874. * self.run_method(g,h)
  10875. */
  10876. }
  10877. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  10878. /* "gedlibpy.pyx":1048
  10879. *
  10880. * #res = []
  10881. * for g in range(listID[0], listID[1]) : # <<<<<<<<<<<<<<
  10882. * print("Computation between graph " + str(g) + " with all the others including himself.")
  10883. * for h in range(listID[0], listID[1]) :
  10884. */
  10885. }
  10886. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10887. /* "gedlibpy.pyx":1057
  10888. * #return res
  10889. *
  10890. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  10891. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10892. * return listID
  10893. */
  10894. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error)
  10895. __Pyx_GOTREF(__pyx_t_3);
  10896. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10897. /* "gedlibpy.pyx":1058
  10898. *
  10899. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10900. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  10901. * return listID
  10902. *
  10903. */
  10904. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_print, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1058, __pyx_L1_error)
  10905. __Pyx_GOTREF(__pyx_t_3);
  10906. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  10907. /* "gedlibpy.pyx":1059
  10908. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  10909. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  10910. * return listID # <<<<<<<<<<<<<<
  10911. *
  10912. *
  10913. */
  10914. __Pyx_XDECREF(__pyx_r);
  10915. __Pyx_INCREF(__pyx_v_listID);
  10916. __pyx_r = __pyx_v_listID;
  10917. goto __pyx_L0;
  10918. /* "gedlibpy.pyx":1006
  10919. *
  10920. *
  10921. * def compute_edit_distance_on_GXl_graphs(self, path_folder, path_XML, edit_cost, method, options="", init_option="EAGER_WITHOUT_SHUFFLED_COPIES") : # <<<<<<<<<<<<<<
  10922. * """
  10923. * Computes all the edit distance between each GXL graphs on the folder and the XMl file.
  10924. */
  10925. /* function exit code */
  10926. __pyx_L1_error:;
  10927. __Pyx_XDECREF(__pyx_t_1);
  10928. __Pyx_XDECREF(__pyx_t_2);
  10929. __Pyx_XDECREF(__pyx_t_3);
  10930. __Pyx_XDECREF(__pyx_t_6);
  10931. __Pyx_XDECREF(__pyx_t_11);
  10932. __Pyx_XDECREF(__pyx_t_12);
  10933. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_edit_distance_on_GXl_graphs", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10934. __pyx_r = NULL;
  10935. __pyx_L0:;
  10936. __Pyx_XDECREF(__pyx_v_listID);
  10937. __Pyx_XDECREF(__pyx_v_g);
  10938. __Pyx_XDECREF(__pyx_v_h);
  10939. __Pyx_XGIVEREF(__pyx_r);
  10940. __Pyx_RefNannyFinishContext();
  10941. return __pyx_r;
  10942. }
  10943. /* "gedlibpy.pyx":1062
  10944. *
  10945. *
  10946. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10947. * """
  10948. * Returns the number of node labels.
  10949. */
  10950. /* Python wrapper */
  10951. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  10952. 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";
  10953. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  10954. PyObject *__pyx_r = 0;
  10955. __Pyx_RefNannyDeclarations
  10956. __Pyx_RefNannySetupContext("get_num_node_labels (wrapper)", 0);
  10957. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  10958. /* function exit code */
  10959. __Pyx_RefNannyFinishContext();
  10960. return __pyx_r;
  10961. }
  10962. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_94get_num_node_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  10963. PyObject *__pyx_r = NULL;
  10964. __Pyx_RefNannyDeclarations
  10965. size_t __pyx_t_1;
  10966. PyObject *__pyx_t_2 = NULL;
  10967. __Pyx_RefNannySetupContext("get_num_node_labels", 0);
  10968. /* "gedlibpy.pyx":1071
  10969. * .. note:: If 1 is returned, the nodes are unlabeled.
  10970. * """
  10971. * return self.c_env.getNumNodeLabels() # <<<<<<<<<<<<<<
  10972. *
  10973. *
  10974. */
  10975. __Pyx_XDECREF(__pyx_r);
  10976. try {
  10977. __pyx_t_1 = __pyx_v_self->c_env->getNumNodeLabels();
  10978. } catch(...) {
  10979. __Pyx_CppExn2PyErr();
  10980. __PYX_ERR(0, 1071, __pyx_L1_error)
  10981. }
  10982. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1071, __pyx_L1_error)
  10983. __Pyx_GOTREF(__pyx_t_2);
  10984. __pyx_r = __pyx_t_2;
  10985. __pyx_t_2 = 0;
  10986. goto __pyx_L0;
  10987. /* "gedlibpy.pyx":1062
  10988. *
  10989. *
  10990. * def get_num_node_labels(self): # <<<<<<<<<<<<<<
  10991. * """
  10992. * Returns the number of node labels.
  10993. */
  10994. /* function exit code */
  10995. __pyx_L1_error:;
  10996. __Pyx_XDECREF(__pyx_t_2);
  10997. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_node_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  10998. __pyx_r = NULL;
  10999. __pyx_L0:;
  11000. __Pyx_XGIVEREF(__pyx_r);
  11001. __Pyx_RefNannyFinishContext();
  11002. return __pyx_r;
  11003. }
  11004. /* "gedlibpy.pyx":1074
  11005. *
  11006. *
  11007. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  11008. * """
  11009. * Returns node label.
  11010. */
  11011. /* Python wrapper */
  11012. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  11013. 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";
  11014. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11015. PyObject *__pyx_r = 0;
  11016. __Pyx_RefNannyDeclarations
  11017. __Pyx_RefNannySetupContext("get_node_label (wrapper)", 0);
  11018. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11019. /* function exit code */
  11020. __Pyx_RefNannyFinishContext();
  11021. return __pyx_r;
  11022. }
  11023. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_96get_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11024. PyObject *__pyx_r = NULL;
  11025. __Pyx_RefNannyDeclarations
  11026. PyObject *__pyx_t_1 = NULL;
  11027. PyObject *__pyx_t_2 = NULL;
  11028. size_t __pyx_t_3;
  11029. std::map<std::string,std::string> __pyx_t_4;
  11030. PyObject *__pyx_t_5 = NULL;
  11031. PyObject *__pyx_t_6 = NULL;
  11032. __Pyx_RefNannySetupContext("get_node_label", 0);
  11033. /* "gedlibpy.pyx":1083
  11034. * :rtype: dict{string : string}
  11035. * """
  11036. * return decode_your_map(self.c_env.getNodeLabel(label_id)) # <<<<<<<<<<<<<<
  11037. *
  11038. *
  11039. */
  11040. __Pyx_XDECREF(__pyx_r);
  11041. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1083, __pyx_L1_error)
  11042. __Pyx_GOTREF(__pyx_t_2);
  11043. __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, 1083, __pyx_L1_error)
  11044. try {
  11045. __pyx_t_4 = __pyx_v_self->c_env->getNodeLabel(__pyx_t_3);
  11046. } catch(...) {
  11047. __Pyx_CppExn2PyErr();
  11048. __PYX_ERR(0, 1083, __pyx_L1_error)
  11049. }
  11050. __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, 1083, __pyx_L1_error)
  11051. __Pyx_GOTREF(__pyx_t_5);
  11052. __pyx_t_6 = NULL;
  11053. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11054. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11055. if (likely(__pyx_t_6)) {
  11056. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11057. __Pyx_INCREF(__pyx_t_6);
  11058. __Pyx_INCREF(function);
  11059. __Pyx_DECREF_SET(__pyx_t_2, function);
  11060. }
  11061. }
  11062. __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);
  11063. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11064. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11065. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1083, __pyx_L1_error)
  11066. __Pyx_GOTREF(__pyx_t_1);
  11067. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11068. __pyx_r = __pyx_t_1;
  11069. __pyx_t_1 = 0;
  11070. goto __pyx_L0;
  11071. /* "gedlibpy.pyx":1074
  11072. *
  11073. *
  11074. * def get_node_label(self, label_id): # <<<<<<<<<<<<<<
  11075. * """
  11076. * Returns node label.
  11077. */
  11078. /* function exit code */
  11079. __pyx_L1_error:;
  11080. __Pyx_XDECREF(__pyx_t_1);
  11081. __Pyx_XDECREF(__pyx_t_2);
  11082. __Pyx_XDECREF(__pyx_t_5);
  11083. __Pyx_XDECREF(__pyx_t_6);
  11084. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11085. __pyx_r = NULL;
  11086. __pyx_L0:;
  11087. __Pyx_XGIVEREF(__pyx_r);
  11088. __Pyx_RefNannyFinishContext();
  11089. return __pyx_r;
  11090. }
  11091. /* "gedlibpy.pyx":1086
  11092. *
  11093. *
  11094. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11095. * """
  11096. * Returns the number of edge labels.
  11097. */
  11098. /* Python wrapper */
  11099. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11100. 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";
  11101. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11102. PyObject *__pyx_r = 0;
  11103. __Pyx_RefNannyDeclarations
  11104. __Pyx_RefNannySetupContext("get_num_edge_labels (wrapper)", 0);
  11105. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11106. /* function exit code */
  11107. __Pyx_RefNannyFinishContext();
  11108. return __pyx_r;
  11109. }
  11110. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_98get_num_edge_labels(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11111. PyObject *__pyx_r = NULL;
  11112. __Pyx_RefNannyDeclarations
  11113. size_t __pyx_t_1;
  11114. PyObject *__pyx_t_2 = NULL;
  11115. __Pyx_RefNannySetupContext("get_num_edge_labels", 0);
  11116. /* "gedlibpy.pyx":1095
  11117. * .. note:: If 1 is returned, the edges are unlabeled.
  11118. * """
  11119. * return self.c_env.getNumEdgeLabels() # <<<<<<<<<<<<<<
  11120. *
  11121. *
  11122. */
  11123. __Pyx_XDECREF(__pyx_r);
  11124. try {
  11125. __pyx_t_1 = __pyx_v_self->c_env->getNumEdgeLabels();
  11126. } catch(...) {
  11127. __Pyx_CppExn2PyErr();
  11128. __PYX_ERR(0, 1095, __pyx_L1_error)
  11129. }
  11130. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1095, __pyx_L1_error)
  11131. __Pyx_GOTREF(__pyx_t_2);
  11132. __pyx_r = __pyx_t_2;
  11133. __pyx_t_2 = 0;
  11134. goto __pyx_L0;
  11135. /* "gedlibpy.pyx":1086
  11136. *
  11137. *
  11138. * def get_num_edge_labels(self): # <<<<<<<<<<<<<<
  11139. * """
  11140. * Returns the number of edge labels.
  11141. */
  11142. /* function exit code */
  11143. __pyx_L1_error:;
  11144. __Pyx_XDECREF(__pyx_t_2);
  11145. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_num_edge_labels", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11146. __pyx_r = NULL;
  11147. __pyx_L0:;
  11148. __Pyx_XGIVEREF(__pyx_r);
  11149. __Pyx_RefNannyFinishContext();
  11150. return __pyx_r;
  11151. }
  11152. /* "gedlibpy.pyx":1098
  11153. *
  11154. *
  11155. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11156. * """
  11157. * Returns edge label.
  11158. */
  11159. /* Python wrapper */
  11160. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id); /*proto*/
  11161. 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";
  11162. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11163. PyObject *__pyx_r = 0;
  11164. __Pyx_RefNannyDeclarations
  11165. __Pyx_RefNannySetupContext("get_edge_label (wrapper)", 0);
  11166. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_label_id));
  11167. /* function exit code */
  11168. __Pyx_RefNannyFinishContext();
  11169. return __pyx_r;
  11170. }
  11171. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_100get_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_label_id) {
  11172. PyObject *__pyx_r = NULL;
  11173. __Pyx_RefNannyDeclarations
  11174. PyObject *__pyx_t_1 = NULL;
  11175. PyObject *__pyx_t_2 = NULL;
  11176. size_t __pyx_t_3;
  11177. std::map<std::string,std::string> __pyx_t_4;
  11178. PyObject *__pyx_t_5 = NULL;
  11179. PyObject *__pyx_t_6 = NULL;
  11180. __Pyx_RefNannySetupContext("get_edge_label", 0);
  11181. /* "gedlibpy.pyx":1107
  11182. * :rtype: dict{string : string}
  11183. * """
  11184. * return decode_your_map(self.c_env.getEdgeLabel(label_id)) # <<<<<<<<<<<<<<
  11185. *
  11186. *
  11187. */
  11188. __Pyx_XDECREF(__pyx_r);
  11189. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1107, __pyx_L1_error)
  11190. __Pyx_GOTREF(__pyx_t_2);
  11191. __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, 1107, __pyx_L1_error)
  11192. try {
  11193. __pyx_t_4 = __pyx_v_self->c_env->getEdgeLabel(__pyx_t_3);
  11194. } catch(...) {
  11195. __Pyx_CppExn2PyErr();
  11196. __PYX_ERR(0, 1107, __pyx_L1_error)
  11197. }
  11198. __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, 1107, __pyx_L1_error)
  11199. __Pyx_GOTREF(__pyx_t_5);
  11200. __pyx_t_6 = NULL;
  11201. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11202. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11203. if (likely(__pyx_t_6)) {
  11204. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11205. __Pyx_INCREF(__pyx_t_6);
  11206. __Pyx_INCREF(function);
  11207. __Pyx_DECREF_SET(__pyx_t_2, function);
  11208. }
  11209. }
  11210. __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);
  11211. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11212. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11213. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1107, __pyx_L1_error)
  11214. __Pyx_GOTREF(__pyx_t_1);
  11215. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11216. __pyx_r = __pyx_t_1;
  11217. __pyx_t_1 = 0;
  11218. goto __pyx_L0;
  11219. /* "gedlibpy.pyx":1098
  11220. *
  11221. *
  11222. * def get_edge_label(self, label_id): # <<<<<<<<<<<<<<
  11223. * """
  11224. * Returns edge label.
  11225. */
  11226. /* function exit code */
  11227. __pyx_L1_error:;
  11228. __Pyx_XDECREF(__pyx_t_1);
  11229. __Pyx_XDECREF(__pyx_t_2);
  11230. __Pyx_XDECREF(__pyx_t_5);
  11231. __Pyx_XDECREF(__pyx_t_6);
  11232. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11233. __pyx_r = NULL;
  11234. __pyx_L0:;
  11235. __Pyx_XGIVEREF(__pyx_r);
  11236. __Pyx_RefNannyFinishContext();
  11237. return __pyx_r;
  11238. }
  11239. /* "gedlibpy.pyx":1121
  11240. * # return self.c_env.getNumNodes(graph_id)
  11241. *
  11242. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11243. * """
  11244. * Returns average number of nodes.
  11245. */
  11246. /* Python wrapper */
  11247. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  11248. 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";
  11249. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  11250. PyObject *__pyx_r = 0;
  11251. __Pyx_RefNannyDeclarations
  11252. __Pyx_RefNannySetupContext("get_avg_num_nodes (wrapper)", 0);
  11253. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  11254. /* function exit code */
  11255. __Pyx_RefNannyFinishContext();
  11256. return __pyx_r;
  11257. }
  11258. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_102get_avg_num_nodes(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  11259. PyObject *__pyx_r = NULL;
  11260. __Pyx_RefNannyDeclarations
  11261. double __pyx_t_1;
  11262. PyObject *__pyx_t_2 = NULL;
  11263. __Pyx_RefNannySetupContext("get_avg_num_nodes", 0);
  11264. /* "gedlibpy.pyx":1128
  11265. * :rtype: double
  11266. * """
  11267. * return self.c_env.getAvgNumNodes() # <<<<<<<<<<<<<<
  11268. *
  11269. * def get_node_rel_cost(self, node_label_1, node_label_2):
  11270. */
  11271. __Pyx_XDECREF(__pyx_r);
  11272. try {
  11273. __pyx_t_1 = __pyx_v_self->c_env->getAvgNumNodes();
  11274. } catch(...) {
  11275. __Pyx_CppExn2PyErr();
  11276. __PYX_ERR(0, 1128, __pyx_L1_error)
  11277. }
  11278. __pyx_t_2 = PyFloat_FromDouble(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1128, __pyx_L1_error)
  11279. __Pyx_GOTREF(__pyx_t_2);
  11280. __pyx_r = __pyx_t_2;
  11281. __pyx_t_2 = 0;
  11282. goto __pyx_L0;
  11283. /* "gedlibpy.pyx":1121
  11284. * # return self.c_env.getNumNodes(graph_id)
  11285. *
  11286. * def get_avg_num_nodes(self): # <<<<<<<<<<<<<<
  11287. * """
  11288. * Returns average number of nodes.
  11289. */
  11290. /* function exit code */
  11291. __pyx_L1_error:;
  11292. __Pyx_XDECREF(__pyx_t_2);
  11293. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_avg_num_nodes", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11294. __pyx_r = NULL;
  11295. __pyx_L0:;
  11296. __Pyx_XGIVEREF(__pyx_r);
  11297. __Pyx_RefNannyFinishContext();
  11298. return __pyx_r;
  11299. }
  11300. /* "gedlibpy.pyx":1130
  11301. * return self.c_env.getAvgNumNodes()
  11302. *
  11303. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11304. * """
  11305. * Returns node relabeling cost.
  11306. */
  11307. /* Python wrapper */
  11308. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11309. 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";
  11310. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_105get_node_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11311. PyObject *__pyx_v_node_label_1 = 0;
  11312. PyObject *__pyx_v_node_label_2 = 0;
  11313. PyObject *__pyx_r = 0;
  11314. __Pyx_RefNannyDeclarations
  11315. __Pyx_RefNannySetupContext("get_node_rel_cost (wrapper)", 0);
  11316. {
  11317. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_node_label_1,&__pyx_n_s_node_label_2,0};
  11318. PyObject* values[2] = {0,0};
  11319. if (unlikely(__pyx_kwds)) {
  11320. Py_ssize_t kw_args;
  11321. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11322. switch (pos_args) {
  11323. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11324. CYTHON_FALLTHROUGH;
  11325. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11326. CYTHON_FALLTHROUGH;
  11327. case 0: break;
  11328. default: goto __pyx_L5_argtuple_error;
  11329. }
  11330. kw_args = PyDict_Size(__pyx_kwds);
  11331. switch (pos_args) {
  11332. case 0:
  11333. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_1)) != 0)) kw_args--;
  11334. else goto __pyx_L5_argtuple_error;
  11335. CYTHON_FALLTHROUGH;
  11336. case 1:
  11337. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_label_2)) != 0)) kw_args--;
  11338. else {
  11339. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1130, __pyx_L3_error)
  11340. }
  11341. }
  11342. if (unlikely(kw_args > 0)) {
  11343. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_node_rel_cost") < 0)) __PYX_ERR(0, 1130, __pyx_L3_error)
  11344. }
  11345. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11346. goto __pyx_L5_argtuple_error;
  11347. } else {
  11348. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11349. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11350. }
  11351. __pyx_v_node_label_1 = values[0];
  11352. __pyx_v_node_label_2 = values[1];
  11353. }
  11354. goto __pyx_L4_argument_unpacking_done;
  11355. __pyx_L5_argtuple_error:;
  11356. __Pyx_RaiseArgtupleInvalid("get_node_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1130, __pyx_L3_error)
  11357. __pyx_L3_error:;
  11358. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11359. __Pyx_RefNannyFinishContext();
  11360. return NULL;
  11361. __pyx_L4_argument_unpacking_done:;
  11362. __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);
  11363. /* function exit code */
  11364. __Pyx_RefNannyFinishContext();
  11365. return __pyx_r;
  11366. }
  11367. 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) {
  11368. PyObject *__pyx_r = NULL;
  11369. __Pyx_RefNannyDeclarations
  11370. PyObject *__pyx_t_1 = NULL;
  11371. PyObject *__pyx_t_2 = NULL;
  11372. PyObject *__pyx_t_3 = NULL;
  11373. std::map<std::string,std::string> __pyx_t_4;
  11374. std::map<std::string,std::string> __pyx_t_5;
  11375. double __pyx_t_6;
  11376. __Pyx_RefNannySetupContext("get_node_rel_cost", 0);
  11377. /* "gedlibpy.pyx":1141
  11378. * :rtype: double
  11379. * """
  11380. * return self.c_env.getNodeRelCost(encode_your_map(node_label_1), encode_your_map(node_label_2)) # <<<<<<<<<<<<<<
  11381. *
  11382. *
  11383. */
  11384. __Pyx_XDECREF(__pyx_r);
  11385. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11386. __Pyx_GOTREF(__pyx_t_2);
  11387. __pyx_t_3 = NULL;
  11388. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11389. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11390. if (likely(__pyx_t_3)) {
  11391. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11392. __Pyx_INCREF(__pyx_t_3);
  11393. __Pyx_INCREF(function);
  11394. __Pyx_DECREF_SET(__pyx_t_2, function);
  11395. }
  11396. }
  11397. __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);
  11398. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11399. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11400. __Pyx_GOTREF(__pyx_t_1);
  11401. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11402. __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, 1141, __pyx_L1_error)
  11403. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11404. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11405. __Pyx_GOTREF(__pyx_t_2);
  11406. __pyx_t_3 = NULL;
  11407. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11408. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11409. if (likely(__pyx_t_3)) {
  11410. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11411. __Pyx_INCREF(__pyx_t_3);
  11412. __Pyx_INCREF(function);
  11413. __Pyx_DECREF_SET(__pyx_t_2, function);
  11414. }
  11415. }
  11416. __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);
  11417. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11418. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11419. __Pyx_GOTREF(__pyx_t_1);
  11420. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11421. __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, 1141, __pyx_L1_error)
  11422. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11423. try {
  11424. __pyx_t_6 = __pyx_v_self->c_env->getNodeRelCost(__pyx_t_4, __pyx_t_5);
  11425. } catch(...) {
  11426. __Pyx_CppExn2PyErr();
  11427. __PYX_ERR(0, 1141, __pyx_L1_error)
  11428. }
  11429. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1141, __pyx_L1_error)
  11430. __Pyx_GOTREF(__pyx_t_1);
  11431. __pyx_r = __pyx_t_1;
  11432. __pyx_t_1 = 0;
  11433. goto __pyx_L0;
  11434. /* "gedlibpy.pyx":1130
  11435. * return self.c_env.getAvgNumNodes()
  11436. *
  11437. * def get_node_rel_cost(self, node_label_1, node_label_2): # <<<<<<<<<<<<<<
  11438. * """
  11439. * Returns node relabeling cost.
  11440. */
  11441. /* function exit code */
  11442. __pyx_L1_error:;
  11443. __Pyx_XDECREF(__pyx_t_1);
  11444. __Pyx_XDECREF(__pyx_t_2);
  11445. __Pyx_XDECREF(__pyx_t_3);
  11446. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11447. __pyx_r = NULL;
  11448. __pyx_L0:;
  11449. __Pyx_XGIVEREF(__pyx_r);
  11450. __Pyx_RefNannyFinishContext();
  11451. return __pyx_r;
  11452. }
  11453. /* "gedlibpy.pyx":1144
  11454. *
  11455. *
  11456. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11457. * """
  11458. * Returns node deletion cost.
  11459. */
  11460. /* Python wrapper */
  11461. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11462. 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";
  11463. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11464. PyObject *__pyx_r = 0;
  11465. __Pyx_RefNannyDeclarations
  11466. __Pyx_RefNannySetupContext("get_node_del_cost (wrapper)", 0);
  11467. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11468. /* function exit code */
  11469. __Pyx_RefNannyFinishContext();
  11470. return __pyx_r;
  11471. }
  11472. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_106get_node_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11473. PyObject *__pyx_r = NULL;
  11474. __Pyx_RefNannyDeclarations
  11475. PyObject *__pyx_t_1 = NULL;
  11476. PyObject *__pyx_t_2 = NULL;
  11477. PyObject *__pyx_t_3 = NULL;
  11478. std::map<std::string,std::string> __pyx_t_4;
  11479. double __pyx_t_5;
  11480. __Pyx_RefNannySetupContext("get_node_del_cost", 0);
  11481. /* "gedlibpy.pyx":1153
  11482. * :rtype: double
  11483. * """
  11484. * return self.c_env.getNodeDelCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11485. *
  11486. *
  11487. */
  11488. __Pyx_XDECREF(__pyx_r);
  11489. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11490. __Pyx_GOTREF(__pyx_t_2);
  11491. __pyx_t_3 = NULL;
  11492. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11493. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11494. if (likely(__pyx_t_3)) {
  11495. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11496. __Pyx_INCREF(__pyx_t_3);
  11497. __Pyx_INCREF(function);
  11498. __Pyx_DECREF_SET(__pyx_t_2, function);
  11499. }
  11500. }
  11501. __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);
  11502. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11503. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11504. __Pyx_GOTREF(__pyx_t_1);
  11505. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11506. __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, 1153, __pyx_L1_error)
  11507. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11508. try {
  11509. __pyx_t_5 = __pyx_v_self->c_env->getNodeDelCost(__pyx_t_4);
  11510. } catch(...) {
  11511. __Pyx_CppExn2PyErr();
  11512. __PYX_ERR(0, 1153, __pyx_L1_error)
  11513. }
  11514. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
  11515. __Pyx_GOTREF(__pyx_t_1);
  11516. __pyx_r = __pyx_t_1;
  11517. __pyx_t_1 = 0;
  11518. goto __pyx_L0;
  11519. /* "gedlibpy.pyx":1144
  11520. *
  11521. *
  11522. * def get_node_del_cost(self, node_label): # <<<<<<<<<<<<<<
  11523. * """
  11524. * Returns node deletion cost.
  11525. */
  11526. /* function exit code */
  11527. __pyx_L1_error:;
  11528. __Pyx_XDECREF(__pyx_t_1);
  11529. __Pyx_XDECREF(__pyx_t_2);
  11530. __Pyx_XDECREF(__pyx_t_3);
  11531. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11532. __pyx_r = NULL;
  11533. __pyx_L0:;
  11534. __Pyx_XGIVEREF(__pyx_r);
  11535. __Pyx_RefNannyFinishContext();
  11536. return __pyx_r;
  11537. }
  11538. /* "gedlibpy.pyx":1156
  11539. *
  11540. *
  11541. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11542. * """
  11543. * Returns node insertion cost.
  11544. */
  11545. /* Python wrapper */
  11546. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label); /*proto*/
  11547. 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";
  11548. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11549. PyObject *__pyx_r = 0;
  11550. __Pyx_RefNannyDeclarations
  11551. __Pyx_RefNannySetupContext("get_node_ins_cost (wrapper)", 0);
  11552. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_label));
  11553. /* function exit code */
  11554. __Pyx_RefNannyFinishContext();
  11555. return __pyx_r;
  11556. }
  11557. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_108get_node_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_label) {
  11558. PyObject *__pyx_r = NULL;
  11559. __Pyx_RefNannyDeclarations
  11560. PyObject *__pyx_t_1 = NULL;
  11561. PyObject *__pyx_t_2 = NULL;
  11562. PyObject *__pyx_t_3 = NULL;
  11563. std::map<std::string,std::string> __pyx_t_4;
  11564. double __pyx_t_5;
  11565. __Pyx_RefNannySetupContext("get_node_ins_cost", 0);
  11566. /* "gedlibpy.pyx":1165
  11567. * :rtype: double
  11568. * """
  11569. * return self.c_env.getNodeInsCost(encode_your_map(node_label)) # <<<<<<<<<<<<<<
  11570. *
  11571. *
  11572. */
  11573. __Pyx_XDECREF(__pyx_r);
  11574. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11575. __Pyx_GOTREF(__pyx_t_2);
  11576. __pyx_t_3 = NULL;
  11577. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11578. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11579. if (likely(__pyx_t_3)) {
  11580. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11581. __Pyx_INCREF(__pyx_t_3);
  11582. __Pyx_INCREF(function);
  11583. __Pyx_DECREF_SET(__pyx_t_2, function);
  11584. }
  11585. }
  11586. __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);
  11587. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11588. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11589. __Pyx_GOTREF(__pyx_t_1);
  11590. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11591. __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, 1165, __pyx_L1_error)
  11592. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11593. try {
  11594. __pyx_t_5 = __pyx_v_self->c_env->getNodeInsCost(__pyx_t_4);
  11595. } catch(...) {
  11596. __Pyx_CppExn2PyErr();
  11597. __PYX_ERR(0, 1165, __pyx_L1_error)
  11598. }
  11599. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1165, __pyx_L1_error)
  11600. __Pyx_GOTREF(__pyx_t_1);
  11601. __pyx_r = __pyx_t_1;
  11602. __pyx_t_1 = 0;
  11603. goto __pyx_L0;
  11604. /* "gedlibpy.pyx":1156
  11605. *
  11606. *
  11607. * def get_node_ins_cost(self, node_label): # <<<<<<<<<<<<<<
  11608. * """
  11609. * Returns node insertion cost.
  11610. */
  11611. /* function exit code */
  11612. __pyx_L1_error:;
  11613. __Pyx_XDECREF(__pyx_t_1);
  11614. __Pyx_XDECREF(__pyx_t_2);
  11615. __Pyx_XDECREF(__pyx_t_3);
  11616. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_node_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11617. __pyx_r = NULL;
  11618. __pyx_L0:;
  11619. __Pyx_XGIVEREF(__pyx_r);
  11620. __Pyx_RefNannyFinishContext();
  11621. return __pyx_r;
  11622. }
  11623. /* "gedlibpy.pyx":1168
  11624. *
  11625. *
  11626. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11627. * """
  11628. * Computes median node label.
  11629. */
  11630. /* Python wrapper */
  11631. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels); /*proto*/
  11632. 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";
  11633. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label(PyObject *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11634. PyObject *__pyx_r = 0;
  11635. __Pyx_RefNannyDeclarations
  11636. __Pyx_RefNannySetupContext("get_median_node_label (wrapper)", 0);
  11637. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_node_labels));
  11638. /* function exit code */
  11639. __Pyx_RefNannyFinishContext();
  11640. return __pyx_r;
  11641. }
  11642. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_110get_median_node_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_node_labels) {
  11643. PyObject *__pyx_v_node_labels_b = NULL;
  11644. PyObject *__pyx_8genexpr9__pyx_v_node_label = NULL;
  11645. PyObject *__pyx_r = NULL;
  11646. __Pyx_RefNannyDeclarations
  11647. PyObject *__pyx_t_1 = NULL;
  11648. PyObject *__pyx_t_2 = NULL;
  11649. Py_ssize_t __pyx_t_3;
  11650. PyObject *(*__pyx_t_4)(PyObject *);
  11651. PyObject *__pyx_t_5 = NULL;
  11652. PyObject *__pyx_t_6 = NULL;
  11653. PyObject *__pyx_t_7 = NULL;
  11654. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  11655. std::map<std::string,std::string> __pyx_t_9;
  11656. __Pyx_RefNannySetupContext("get_median_node_label", 0);
  11657. /* "gedlibpy.pyx":1177
  11658. * :rtype: dict{string : string}
  11659. * """
  11660. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels] # <<<<<<<<<<<<<<
  11661. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b))
  11662. *
  11663. */
  11664. { /* enter inner scope */
  11665. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11666. __Pyx_GOTREF(__pyx_t_1);
  11667. if (likely(PyList_CheckExact(__pyx_v_node_labels)) || PyTuple_CheckExact(__pyx_v_node_labels)) {
  11668. __pyx_t_2 = __pyx_v_node_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  11669. __pyx_t_4 = NULL;
  11670. } else {
  11671. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_node_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11672. __Pyx_GOTREF(__pyx_t_2);
  11673. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11674. }
  11675. for (;;) {
  11676. if (likely(!__pyx_t_4)) {
  11677. if (likely(PyList_CheckExact(__pyx_t_2))) {
  11678. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  11679. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11680. __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, 1177, __pyx_L5_error)
  11681. #else
  11682. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11683. __Pyx_GOTREF(__pyx_t_5);
  11684. #endif
  11685. } else {
  11686. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  11687. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  11688. __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, 1177, __pyx_L5_error)
  11689. #else
  11690. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11691. __Pyx_GOTREF(__pyx_t_5);
  11692. #endif
  11693. }
  11694. } else {
  11695. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  11696. if (unlikely(!__pyx_t_5)) {
  11697. PyObject* exc_type = PyErr_Occurred();
  11698. if (exc_type) {
  11699. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  11700. else __PYX_ERR(0, 1177, __pyx_L5_error)
  11701. }
  11702. break;
  11703. }
  11704. __Pyx_GOTREF(__pyx_t_5);
  11705. }
  11706. __Pyx_XDECREF_SET(__pyx_8genexpr9__pyx_v_node_label, __pyx_t_5);
  11707. __pyx_t_5 = 0;
  11708. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11709. __Pyx_GOTREF(__pyx_t_6);
  11710. __pyx_t_7 = NULL;
  11711. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  11712. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  11713. if (likely(__pyx_t_7)) {
  11714. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  11715. __Pyx_INCREF(__pyx_t_7);
  11716. __Pyx_INCREF(function);
  11717. __Pyx_DECREF_SET(__pyx_t_6, function);
  11718. }
  11719. }
  11720. __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);
  11721. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  11722. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1177, __pyx_L5_error)
  11723. __Pyx_GOTREF(__pyx_t_5);
  11724. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  11725. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1177, __pyx_L5_error)
  11726. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11727. }
  11728. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11729. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11730. goto __pyx_L8_exit_scope;
  11731. __pyx_L5_error:;
  11732. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label); __pyx_8genexpr9__pyx_v_node_label = 0;
  11733. goto __pyx_L1_error;
  11734. __pyx_L8_exit_scope:;
  11735. } /* exit inner scope */
  11736. __pyx_v_node_labels_b = ((PyObject*)__pyx_t_1);
  11737. __pyx_t_1 = 0;
  11738. /* "gedlibpy.pyx":1178
  11739. * """
  11740. * node_labels_b = [encode_your_map(node_label) for node_label in node_labels]
  11741. * return decode_your_map(self.c_env.getMedianNodeLabel(node_labels_b)) # <<<<<<<<<<<<<<
  11742. *
  11743. *
  11744. */
  11745. __Pyx_XDECREF(__pyx_r);
  11746. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1178, __pyx_L1_error)
  11747. __Pyx_GOTREF(__pyx_t_2);
  11748. __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, 1178, __pyx_L1_error)
  11749. try {
  11750. __pyx_t_9 = __pyx_v_self->c_env->getMedianNodeLabel(__pyx_t_8);
  11751. } catch(...) {
  11752. __Pyx_CppExn2PyErr();
  11753. __PYX_ERR(0, 1178, __pyx_L1_error)
  11754. }
  11755. __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, 1178, __pyx_L1_error)
  11756. __Pyx_GOTREF(__pyx_t_5);
  11757. __pyx_t_6 = NULL;
  11758. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11759. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  11760. if (likely(__pyx_t_6)) {
  11761. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11762. __Pyx_INCREF(__pyx_t_6);
  11763. __Pyx_INCREF(function);
  11764. __Pyx_DECREF_SET(__pyx_t_2, function);
  11765. }
  11766. }
  11767. __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);
  11768. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  11769. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  11770. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
  11771. __Pyx_GOTREF(__pyx_t_1);
  11772. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11773. __pyx_r = __pyx_t_1;
  11774. __pyx_t_1 = 0;
  11775. goto __pyx_L0;
  11776. /* "gedlibpy.pyx":1168
  11777. *
  11778. *
  11779. * def get_median_node_label(self, node_labels): # <<<<<<<<<<<<<<
  11780. * """
  11781. * Computes median node label.
  11782. */
  11783. /* function exit code */
  11784. __pyx_L1_error:;
  11785. __Pyx_XDECREF(__pyx_t_1);
  11786. __Pyx_XDECREF(__pyx_t_2);
  11787. __Pyx_XDECREF(__pyx_t_5);
  11788. __Pyx_XDECREF(__pyx_t_6);
  11789. __Pyx_XDECREF(__pyx_t_7);
  11790. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_node_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11791. __pyx_r = NULL;
  11792. __pyx_L0:;
  11793. __Pyx_XDECREF(__pyx_v_node_labels_b);
  11794. __Pyx_XDECREF(__pyx_8genexpr9__pyx_v_node_label);
  11795. __Pyx_XGIVEREF(__pyx_r);
  11796. __Pyx_RefNannyFinishContext();
  11797. return __pyx_r;
  11798. }
  11799. /* "gedlibpy.pyx":1181
  11800. *
  11801. *
  11802. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11803. * """
  11804. * Returns edge relabeling cost.
  11805. */
  11806. /* Python wrapper */
  11807. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  11808. 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";
  11809. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_113get_edge_rel_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  11810. PyObject *__pyx_v_edge_label_1 = 0;
  11811. PyObject *__pyx_v_edge_label_2 = 0;
  11812. PyObject *__pyx_r = 0;
  11813. __Pyx_RefNannyDeclarations
  11814. __Pyx_RefNannySetupContext("get_edge_rel_cost (wrapper)", 0);
  11815. {
  11816. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_edge_label_1,&__pyx_n_s_edge_label_2,0};
  11817. PyObject* values[2] = {0,0};
  11818. if (unlikely(__pyx_kwds)) {
  11819. Py_ssize_t kw_args;
  11820. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  11821. switch (pos_args) {
  11822. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11823. CYTHON_FALLTHROUGH;
  11824. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11825. CYTHON_FALLTHROUGH;
  11826. case 0: break;
  11827. default: goto __pyx_L5_argtuple_error;
  11828. }
  11829. kw_args = PyDict_Size(__pyx_kwds);
  11830. switch (pos_args) {
  11831. case 0:
  11832. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_1)) != 0)) kw_args--;
  11833. else goto __pyx_L5_argtuple_error;
  11834. CYTHON_FALLTHROUGH;
  11835. case 1:
  11836. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_label_2)) != 0)) kw_args--;
  11837. else {
  11838. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, 1); __PYX_ERR(0, 1181, __pyx_L3_error)
  11839. }
  11840. }
  11841. if (unlikely(kw_args > 0)) {
  11842. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_edge_rel_cost") < 0)) __PYX_ERR(0, 1181, __pyx_L3_error)
  11843. }
  11844. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  11845. goto __pyx_L5_argtuple_error;
  11846. } else {
  11847. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  11848. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  11849. }
  11850. __pyx_v_edge_label_1 = values[0];
  11851. __pyx_v_edge_label_2 = values[1];
  11852. }
  11853. goto __pyx_L4_argument_unpacking_done;
  11854. __pyx_L5_argtuple_error:;
  11855. __Pyx_RaiseArgtupleInvalid("get_edge_rel_cost", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1181, __pyx_L3_error)
  11856. __pyx_L3_error:;
  11857. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11858. __Pyx_RefNannyFinishContext();
  11859. return NULL;
  11860. __pyx_L4_argument_unpacking_done:;
  11861. __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);
  11862. /* function exit code */
  11863. __Pyx_RefNannyFinishContext();
  11864. return __pyx_r;
  11865. }
  11866. 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) {
  11867. PyObject *__pyx_r = NULL;
  11868. __Pyx_RefNannyDeclarations
  11869. PyObject *__pyx_t_1 = NULL;
  11870. PyObject *__pyx_t_2 = NULL;
  11871. PyObject *__pyx_t_3 = NULL;
  11872. std::map<std::string,std::string> __pyx_t_4;
  11873. std::map<std::string,std::string> __pyx_t_5;
  11874. double __pyx_t_6;
  11875. __Pyx_RefNannySetupContext("get_edge_rel_cost", 0);
  11876. /* "gedlibpy.pyx":1192
  11877. * :rtype: double
  11878. * """
  11879. * return self.c_env.getEdgeRelCost(encode_your_map(edge_label_1), encode_your_map(edge_label_2)) # <<<<<<<<<<<<<<
  11880. *
  11881. *
  11882. */
  11883. __Pyx_XDECREF(__pyx_r);
  11884. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11885. __Pyx_GOTREF(__pyx_t_2);
  11886. __pyx_t_3 = NULL;
  11887. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11888. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11889. if (likely(__pyx_t_3)) {
  11890. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11891. __Pyx_INCREF(__pyx_t_3);
  11892. __Pyx_INCREF(function);
  11893. __Pyx_DECREF_SET(__pyx_t_2, function);
  11894. }
  11895. }
  11896. __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);
  11897. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11898. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11899. __Pyx_GOTREF(__pyx_t_1);
  11900. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11901. __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, 1192, __pyx_L1_error)
  11902. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11903. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11904. __Pyx_GOTREF(__pyx_t_2);
  11905. __pyx_t_3 = NULL;
  11906. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11907. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11908. if (likely(__pyx_t_3)) {
  11909. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11910. __Pyx_INCREF(__pyx_t_3);
  11911. __Pyx_INCREF(function);
  11912. __Pyx_DECREF_SET(__pyx_t_2, function);
  11913. }
  11914. }
  11915. __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);
  11916. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  11917. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11918. __Pyx_GOTREF(__pyx_t_1);
  11919. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  11920. __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, 1192, __pyx_L1_error)
  11921. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  11922. try {
  11923. __pyx_t_6 = __pyx_v_self->c_env->getEdgeRelCost(__pyx_t_4, __pyx_t_5);
  11924. } catch(...) {
  11925. __Pyx_CppExn2PyErr();
  11926. __PYX_ERR(0, 1192, __pyx_L1_error)
  11927. }
  11928. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1192, __pyx_L1_error)
  11929. __Pyx_GOTREF(__pyx_t_1);
  11930. __pyx_r = __pyx_t_1;
  11931. __pyx_t_1 = 0;
  11932. goto __pyx_L0;
  11933. /* "gedlibpy.pyx":1181
  11934. *
  11935. *
  11936. * def get_edge_rel_cost(self, edge_label_1, edge_label_2): # <<<<<<<<<<<<<<
  11937. * """
  11938. * Returns edge relabeling cost.
  11939. */
  11940. /* function exit code */
  11941. __pyx_L1_error:;
  11942. __Pyx_XDECREF(__pyx_t_1);
  11943. __Pyx_XDECREF(__pyx_t_2);
  11944. __Pyx_XDECREF(__pyx_t_3);
  11945. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_rel_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  11946. __pyx_r = NULL;
  11947. __pyx_L0:;
  11948. __Pyx_XGIVEREF(__pyx_r);
  11949. __Pyx_RefNannyFinishContext();
  11950. return __pyx_r;
  11951. }
  11952. /* "gedlibpy.pyx":1195
  11953. *
  11954. *
  11955. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  11956. * """
  11957. * Returns edge deletion cost.
  11958. */
  11959. /* Python wrapper */
  11960. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  11961. 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";
  11962. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11963. PyObject *__pyx_r = 0;
  11964. __Pyx_RefNannyDeclarations
  11965. __Pyx_RefNannySetupContext("get_edge_del_cost (wrapper)", 0);
  11966. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  11967. /* function exit code */
  11968. __Pyx_RefNannyFinishContext();
  11969. return __pyx_r;
  11970. }
  11971. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_114get_edge_del_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  11972. PyObject *__pyx_r = NULL;
  11973. __Pyx_RefNannyDeclarations
  11974. PyObject *__pyx_t_1 = NULL;
  11975. PyObject *__pyx_t_2 = NULL;
  11976. PyObject *__pyx_t_3 = NULL;
  11977. std::map<std::string,std::string> __pyx_t_4;
  11978. double __pyx_t_5;
  11979. __Pyx_RefNannySetupContext("get_edge_del_cost", 0);
  11980. /* "gedlibpy.pyx":1204
  11981. * :rtype: double
  11982. * """
  11983. * return self.c_env.getEdgeDelCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  11984. *
  11985. *
  11986. */
  11987. __Pyx_XDECREF(__pyx_r);
  11988. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
  11989. __Pyx_GOTREF(__pyx_t_2);
  11990. __pyx_t_3 = NULL;
  11991. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  11992. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  11993. if (likely(__pyx_t_3)) {
  11994. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  11995. __Pyx_INCREF(__pyx_t_3);
  11996. __Pyx_INCREF(function);
  11997. __Pyx_DECREF_SET(__pyx_t_2, function);
  11998. }
  11999. }
  12000. __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);
  12001. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  12002. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  12003. __Pyx_GOTREF(__pyx_t_1);
  12004. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12005. __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, 1204, __pyx_L1_error)
  12006. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12007. try {
  12008. __pyx_t_5 = __pyx_v_self->c_env->getEdgeDelCost(__pyx_t_4);
  12009. } catch(...) {
  12010. __Pyx_CppExn2PyErr();
  12011. __PYX_ERR(0, 1204, __pyx_L1_error)
  12012. }
  12013. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  12014. __Pyx_GOTREF(__pyx_t_1);
  12015. __pyx_r = __pyx_t_1;
  12016. __pyx_t_1 = 0;
  12017. goto __pyx_L0;
  12018. /* "gedlibpy.pyx":1195
  12019. *
  12020. *
  12021. * def get_edge_del_cost(self, edge_label): # <<<<<<<<<<<<<<
  12022. * """
  12023. * Returns edge deletion cost.
  12024. */
  12025. /* function exit code */
  12026. __pyx_L1_error:;
  12027. __Pyx_XDECREF(__pyx_t_1);
  12028. __Pyx_XDECREF(__pyx_t_2);
  12029. __Pyx_XDECREF(__pyx_t_3);
  12030. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_del_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12031. __pyx_r = NULL;
  12032. __pyx_L0:;
  12033. __Pyx_XGIVEREF(__pyx_r);
  12034. __Pyx_RefNannyFinishContext();
  12035. return __pyx_r;
  12036. }
  12037. /* "gedlibpy.pyx":1207
  12038. *
  12039. *
  12040. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12041. * """
  12042. * Returns edge insertion cost.
  12043. */
  12044. /* Python wrapper */
  12045. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label); /*proto*/
  12046. 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";
  12047. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12048. PyObject *__pyx_r = 0;
  12049. __Pyx_RefNannyDeclarations
  12050. __Pyx_RefNannySetupContext("get_edge_ins_cost (wrapper)", 0);
  12051. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_label));
  12052. /* function exit code */
  12053. __Pyx_RefNannyFinishContext();
  12054. return __pyx_r;
  12055. }
  12056. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_116get_edge_ins_cost(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_label) {
  12057. PyObject *__pyx_r = NULL;
  12058. __Pyx_RefNannyDeclarations
  12059. PyObject *__pyx_t_1 = NULL;
  12060. PyObject *__pyx_t_2 = NULL;
  12061. PyObject *__pyx_t_3 = NULL;
  12062. std::map<std::string,std::string> __pyx_t_4;
  12063. double __pyx_t_5;
  12064. __Pyx_RefNannySetupContext("get_edge_ins_cost", 0);
  12065. /* "gedlibpy.pyx":1216
  12066. * :rtype: double
  12067. * """
  12068. * return self.c_env.getEdgeInsCost(encode_your_map(edge_label)) # <<<<<<<<<<<<<<
  12069. *
  12070. *
  12071. */
  12072. __Pyx_XDECREF(__pyx_r);
  12073. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12074. __Pyx_GOTREF(__pyx_t_2);
  12075. __pyx_t_3 = NULL;
  12076. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12077. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  12078. if (likely(__pyx_t_3)) {
  12079. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12080. __Pyx_INCREF(__pyx_t_3);
  12081. __Pyx_INCREF(function);
  12082. __Pyx_DECREF_SET(__pyx_t_2, function);
  12083. }
  12084. }
  12085. __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);
  12086. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  12087. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12088. __Pyx_GOTREF(__pyx_t_1);
  12089. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12090. __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, 1216, __pyx_L1_error)
  12091. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12092. try {
  12093. __pyx_t_5 = __pyx_v_self->c_env->getEdgeInsCost(__pyx_t_4);
  12094. } catch(...) {
  12095. __Pyx_CppExn2PyErr();
  12096. __PYX_ERR(0, 1216, __pyx_L1_error)
  12097. }
  12098. __pyx_t_1 = PyFloat_FromDouble(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
  12099. __Pyx_GOTREF(__pyx_t_1);
  12100. __pyx_r = __pyx_t_1;
  12101. __pyx_t_1 = 0;
  12102. goto __pyx_L0;
  12103. /* "gedlibpy.pyx":1207
  12104. *
  12105. *
  12106. * def get_edge_ins_cost(self, edge_label): # <<<<<<<<<<<<<<
  12107. * """
  12108. * Returns edge insertion cost.
  12109. */
  12110. /* function exit code */
  12111. __pyx_L1_error:;
  12112. __Pyx_XDECREF(__pyx_t_1);
  12113. __Pyx_XDECREF(__pyx_t_2);
  12114. __Pyx_XDECREF(__pyx_t_3);
  12115. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_edge_ins_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12116. __pyx_r = NULL;
  12117. __pyx_L0:;
  12118. __Pyx_XGIVEREF(__pyx_r);
  12119. __Pyx_RefNannyFinishContext();
  12120. return __pyx_r;
  12121. }
  12122. /* "gedlibpy.pyx":1219
  12123. *
  12124. *
  12125. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12126. * """
  12127. * Computes median edge label.
  12128. */
  12129. /* Python wrapper */
  12130. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels); /*proto*/
  12131. 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";
  12132. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label(PyObject *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12133. PyObject *__pyx_r = 0;
  12134. __Pyx_RefNannyDeclarations
  12135. __Pyx_RefNannySetupContext("get_median_edge_label (wrapper)", 0);
  12136. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v_edge_labels));
  12137. /* function exit code */
  12138. __Pyx_RefNannyFinishContext();
  12139. return __pyx_r;
  12140. }
  12141. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_118get_median_edge_label(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self, PyObject *__pyx_v_edge_labels) {
  12142. CYTHON_UNUSED PyObject *__pyx_v_edge_labels_b = NULL;
  12143. PyObject *__pyx_9genexpr10__pyx_v_edge_label = NULL;
  12144. PyObject *__pyx_r = NULL;
  12145. __Pyx_RefNannyDeclarations
  12146. PyObject *__pyx_t_1 = NULL;
  12147. PyObject *__pyx_t_2 = NULL;
  12148. Py_ssize_t __pyx_t_3;
  12149. PyObject *(*__pyx_t_4)(PyObject *);
  12150. PyObject *__pyx_t_5 = NULL;
  12151. PyObject *__pyx_t_6 = NULL;
  12152. PyObject *__pyx_t_7 = NULL;
  12153. std::vector<std::map<std::string,std::string> > __pyx_t_8;
  12154. std::map<std::string,std::string> __pyx_t_9;
  12155. __Pyx_RefNannySetupContext("get_median_edge_label", 0);
  12156. /* "gedlibpy.pyx":1228
  12157. * :rtype: dict{string : string}
  12158. * """
  12159. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels] # <<<<<<<<<<<<<<
  12160. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b))
  12161. *
  12162. */
  12163. { /* enter inner scope */
  12164. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12165. __Pyx_GOTREF(__pyx_t_1);
  12166. if (likely(PyList_CheckExact(__pyx_v_edge_labels)) || PyTuple_CheckExact(__pyx_v_edge_labels)) {
  12167. __pyx_t_2 = __pyx_v_edge_labels; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
  12168. __pyx_t_4 = NULL;
  12169. } else {
  12170. __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_edge_labels); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12171. __Pyx_GOTREF(__pyx_t_2);
  12172. __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12173. }
  12174. for (;;) {
  12175. if (likely(!__pyx_t_4)) {
  12176. if (likely(PyList_CheckExact(__pyx_t_2))) {
  12177. if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
  12178. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12179. __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, 1228, __pyx_L5_error)
  12180. #else
  12181. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12182. __Pyx_GOTREF(__pyx_t_5);
  12183. #endif
  12184. } else {
  12185. if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
  12186. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12187. __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, 1228, __pyx_L5_error)
  12188. #else
  12189. __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12190. __Pyx_GOTREF(__pyx_t_5);
  12191. #endif
  12192. }
  12193. } else {
  12194. __pyx_t_5 = __pyx_t_4(__pyx_t_2);
  12195. if (unlikely(!__pyx_t_5)) {
  12196. PyObject* exc_type = PyErr_Occurred();
  12197. if (exc_type) {
  12198. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12199. else __PYX_ERR(0, 1228, __pyx_L5_error)
  12200. }
  12201. break;
  12202. }
  12203. __Pyx_GOTREF(__pyx_t_5);
  12204. }
  12205. __Pyx_XDECREF_SET(__pyx_9genexpr10__pyx_v_edge_label, __pyx_t_5);
  12206. __pyx_t_5 = 0;
  12207. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_encode_your_map); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12208. __Pyx_GOTREF(__pyx_t_6);
  12209. __pyx_t_7 = NULL;
  12210. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
  12211. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
  12212. if (likely(__pyx_t_7)) {
  12213. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
  12214. __Pyx_INCREF(__pyx_t_7);
  12215. __Pyx_INCREF(function);
  12216. __Pyx_DECREF_SET(__pyx_t_6, function);
  12217. }
  12218. }
  12219. __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);
  12220. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  12221. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1228, __pyx_L5_error)
  12222. __Pyx_GOTREF(__pyx_t_5);
  12223. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12224. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 1228, __pyx_L5_error)
  12225. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12226. }
  12227. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12228. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12229. goto __pyx_L8_exit_scope;
  12230. __pyx_L5_error:;
  12231. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label); __pyx_9genexpr10__pyx_v_edge_label = 0;
  12232. goto __pyx_L1_error;
  12233. __pyx_L8_exit_scope:;
  12234. } /* exit inner scope */
  12235. __pyx_v_edge_labels_b = ((PyObject*)__pyx_t_1);
  12236. __pyx_t_1 = 0;
  12237. /* "gedlibpy.pyx":1229
  12238. * """
  12239. * edge_labels_b = [encode_your_map(edge_label) for edge_label in edge_labels]
  12240. * return decode_your_map(self.c_env.getMedianEdgeLabel(edge_label_b)) # <<<<<<<<<<<<<<
  12241. *
  12242. *
  12243. */
  12244. __Pyx_XDECREF(__pyx_r);
  12245. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12246. __Pyx_GOTREF(__pyx_t_2);
  12247. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_edge_label_b); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12248. __Pyx_GOTREF(__pyx_t_5);
  12249. __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, 1229, __pyx_L1_error)
  12250. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12251. try {
  12252. __pyx_t_9 = __pyx_v_self->c_env->getMedianEdgeLabel(__pyx_t_8);
  12253. } catch(...) {
  12254. __Pyx_CppExn2PyErr();
  12255. __PYX_ERR(0, 1229, __pyx_L1_error)
  12256. }
  12257. __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, 1229, __pyx_L1_error)
  12258. __Pyx_GOTREF(__pyx_t_5);
  12259. __pyx_t_6 = NULL;
  12260. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  12261. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
  12262. if (likely(__pyx_t_6)) {
  12263. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  12264. __Pyx_INCREF(__pyx_t_6);
  12265. __Pyx_INCREF(function);
  12266. __Pyx_DECREF_SET(__pyx_t_2, function);
  12267. }
  12268. }
  12269. __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);
  12270. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12271. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  12272. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1229, __pyx_L1_error)
  12273. __Pyx_GOTREF(__pyx_t_1);
  12274. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12275. __pyx_r = __pyx_t_1;
  12276. __pyx_t_1 = 0;
  12277. goto __pyx_L0;
  12278. /* "gedlibpy.pyx":1219
  12279. *
  12280. *
  12281. * def get_median_edge_label(self, edge_labels): # <<<<<<<<<<<<<<
  12282. * """
  12283. * Computes median edge label.
  12284. */
  12285. /* function exit code */
  12286. __pyx_L1_error:;
  12287. __Pyx_XDECREF(__pyx_t_1);
  12288. __Pyx_XDECREF(__pyx_t_2);
  12289. __Pyx_XDECREF(__pyx_t_5);
  12290. __Pyx_XDECREF(__pyx_t_6);
  12291. __Pyx_XDECREF(__pyx_t_7);
  12292. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_median_edge_label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12293. __pyx_r = NULL;
  12294. __pyx_L0:;
  12295. __Pyx_XDECREF(__pyx_v_edge_labels_b);
  12296. __Pyx_XDECREF(__pyx_9genexpr10__pyx_v_edge_label);
  12297. __Pyx_XGIVEREF(__pyx_r);
  12298. __Pyx_RefNannyFinishContext();
  12299. return __pyx_r;
  12300. }
  12301. /* "gedlibpy.pyx":1232
  12302. *
  12303. *
  12304. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12305. * """
  12306. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12307. */
  12308. /* Python wrapper */
  12309. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12310. 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";
  12311. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12312. PyObject *__pyx_v_graph_id = 0;
  12313. CYTHON_UNUSED PyObject *__pyx_v_adj_matrix = 0;
  12314. CYTHON_UNUSED PyObject *__pyx_v_adj_lists = 0;
  12315. CYTHON_UNUSED PyObject *__pyx_v_edge_list = 0;
  12316. PyObject *__pyx_r = 0;
  12317. __Pyx_RefNannyDeclarations
  12318. __Pyx_RefNannySetupContext("get_nx_graph (wrapper)", 0);
  12319. {
  12320. 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};
  12321. PyObject* values[4] = {0,0,0,0};
  12322. values[1] = ((PyObject *)Py_True);
  12323. values[2] = ((PyObject *)Py_False);
  12324. values[3] = ((PyObject *)Py_False);
  12325. if (unlikely(__pyx_kwds)) {
  12326. Py_ssize_t kw_args;
  12327. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12328. switch (pos_args) {
  12329. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12330. CYTHON_FALLTHROUGH;
  12331. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12332. CYTHON_FALLTHROUGH;
  12333. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12334. CYTHON_FALLTHROUGH;
  12335. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12336. CYTHON_FALLTHROUGH;
  12337. case 0: break;
  12338. default: goto __pyx_L5_argtuple_error;
  12339. }
  12340. kw_args = PyDict_Size(__pyx_kwds);
  12341. switch (pos_args) {
  12342. case 0:
  12343. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12344. else goto __pyx_L5_argtuple_error;
  12345. CYTHON_FALLTHROUGH;
  12346. case 1:
  12347. if (kw_args > 0) {
  12348. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_matrix);
  12349. if (value) { values[1] = value; kw_args--; }
  12350. }
  12351. CYTHON_FALLTHROUGH;
  12352. case 2:
  12353. if (kw_args > 0) {
  12354. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_adj_lists);
  12355. if (value) { values[2] = value; kw_args--; }
  12356. }
  12357. CYTHON_FALLTHROUGH;
  12358. case 3:
  12359. if (kw_args > 0) {
  12360. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_edge_list);
  12361. if (value) { values[3] = value; kw_args--; }
  12362. }
  12363. }
  12364. if (unlikely(kw_args > 0)) {
  12365. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "get_nx_graph") < 0)) __PYX_ERR(0, 1232, __pyx_L3_error)
  12366. }
  12367. } else {
  12368. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12369. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12370. CYTHON_FALLTHROUGH;
  12371. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12372. CYTHON_FALLTHROUGH;
  12373. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12374. CYTHON_FALLTHROUGH;
  12375. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12376. break;
  12377. default: goto __pyx_L5_argtuple_error;
  12378. }
  12379. }
  12380. __pyx_v_graph_id = values[0];
  12381. __pyx_v_adj_matrix = values[1];
  12382. __pyx_v_adj_lists = values[2];
  12383. __pyx_v_edge_list = values[3];
  12384. }
  12385. goto __pyx_L4_argument_unpacking_done;
  12386. __pyx_L5_argtuple_error:;
  12387. __Pyx_RaiseArgtupleInvalid("get_nx_graph", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1232, __pyx_L3_error)
  12388. __pyx_L3_error:;
  12389. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12390. __Pyx_RefNannyFinishContext();
  12391. return NULL;
  12392. __pyx_L4_argument_unpacking_done:;
  12393. __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);
  12394. /* function exit code */
  12395. __Pyx_RefNannyFinishContext();
  12396. return __pyx_r;
  12397. }
  12398. 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) {
  12399. PyObject *__pyx_v_graph = NULL;
  12400. PyObject *__pyx_v_nb_nodes = NULL;
  12401. PyObject *__pyx_v_original_node_ids = NULL;
  12402. PyObject *__pyx_v_node_labels = NULL;
  12403. PyObject *__pyx_v_node_id = NULL;
  12404. PyObject *__pyx_v_edges = NULL;
  12405. PyObject *__pyx_v_head = NULL;
  12406. PyObject *__pyx_v_tail = NULL;
  12407. PyObject *__pyx_v_labels = NULL;
  12408. PyObject *__pyx_r = NULL;
  12409. __Pyx_RefNannyDeclarations
  12410. PyObject *__pyx_t_1 = NULL;
  12411. PyObject *__pyx_t_2 = NULL;
  12412. PyObject *__pyx_t_3 = NULL;
  12413. Py_ssize_t __pyx_t_4;
  12414. PyObject *(*__pyx_t_5)(PyObject *);
  12415. PyObject *__pyx_t_6 = NULL;
  12416. PyObject *__pyx_t_7 = NULL;
  12417. Py_ssize_t __pyx_t_8;
  12418. int __pyx_t_9;
  12419. int __pyx_t_10;
  12420. PyObject *__pyx_t_11 = NULL;
  12421. PyObject *(*__pyx_t_12)(PyObject *);
  12422. __Pyx_RefNannySetupContext("get_nx_graph", 0);
  12423. /* "gedlibpy.pyx":1255
  12424. * The obtained graph.
  12425. * """
  12426. * graph = nx.Graph() # <<<<<<<<<<<<<<
  12427. * graph.graph['id'] = graph_id
  12428. *
  12429. */
  12430. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_nx); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
  12431. __Pyx_GOTREF(__pyx_t_2);
  12432. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_Graph); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1255, __pyx_L1_error)
  12433. __Pyx_GOTREF(__pyx_t_3);
  12434. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12435. __pyx_t_2 = NULL;
  12436. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
  12437. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12438. if (likely(__pyx_t_2)) {
  12439. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12440. __Pyx_INCREF(__pyx_t_2);
  12441. __Pyx_INCREF(function);
  12442. __Pyx_DECREF_SET(__pyx_t_3, function);
  12443. }
  12444. }
  12445. __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  12446. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12447. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
  12448. __Pyx_GOTREF(__pyx_t_1);
  12449. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12450. __pyx_v_graph = __pyx_t_1;
  12451. __pyx_t_1 = 0;
  12452. /* "gedlibpy.pyx":1256
  12453. * """
  12454. * graph = nx.Graph()
  12455. * graph.graph['id'] = graph_id # <<<<<<<<<<<<<<
  12456. *
  12457. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12458. */
  12459. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1256, __pyx_L1_error)
  12460. __Pyx_GOTREF(__pyx_t_1);
  12461. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_id, __pyx_v_graph_id) < 0)) __PYX_ERR(0, 1256, __pyx_L1_error)
  12462. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12463. /* "gedlibpy.pyx":1258
  12464. * graph.graph['id'] = graph_id
  12465. *
  12466. * nb_nodes = self.get_graph_num_nodes(graph_id) # <<<<<<<<<<<<<<
  12467. * original_node_ids = self.get_original_node_ids(graph_id)
  12468. * node_labels = self.get_graph_node_labels(graph_id)
  12469. */
  12470. __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, 1258, __pyx_L1_error)
  12471. __Pyx_GOTREF(__pyx_t_3);
  12472. __pyx_t_2 = NULL;
  12473. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12474. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12475. if (likely(__pyx_t_2)) {
  12476. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12477. __Pyx_INCREF(__pyx_t_2);
  12478. __Pyx_INCREF(function);
  12479. __Pyx_DECREF_SET(__pyx_t_3, function);
  12480. }
  12481. }
  12482. __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);
  12483. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12484. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1258, __pyx_L1_error)
  12485. __Pyx_GOTREF(__pyx_t_1);
  12486. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12487. __pyx_v_nb_nodes = __pyx_t_1;
  12488. __pyx_t_1 = 0;
  12489. /* "gedlibpy.pyx":1259
  12490. *
  12491. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12492. * original_node_ids = self.get_original_node_ids(graph_id) # <<<<<<<<<<<<<<
  12493. * node_labels = self.get_graph_node_labels(graph_id)
  12494. * # print(original_node_ids)
  12495. */
  12496. __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, 1259, __pyx_L1_error)
  12497. __Pyx_GOTREF(__pyx_t_3);
  12498. __pyx_t_2 = NULL;
  12499. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12500. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12501. if (likely(__pyx_t_2)) {
  12502. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12503. __Pyx_INCREF(__pyx_t_2);
  12504. __Pyx_INCREF(function);
  12505. __Pyx_DECREF_SET(__pyx_t_3, function);
  12506. }
  12507. }
  12508. __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);
  12509. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12510. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1259, __pyx_L1_error)
  12511. __Pyx_GOTREF(__pyx_t_1);
  12512. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12513. __pyx_v_original_node_ids = __pyx_t_1;
  12514. __pyx_t_1 = 0;
  12515. /* "gedlibpy.pyx":1260
  12516. * nb_nodes = self.get_graph_num_nodes(graph_id)
  12517. * original_node_ids = self.get_original_node_ids(graph_id)
  12518. * node_labels = self.get_graph_node_labels(graph_id) # <<<<<<<<<<<<<<
  12519. * # print(original_node_ids)
  12520. * # print(node_labels)
  12521. */
  12522. __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, 1260, __pyx_L1_error)
  12523. __Pyx_GOTREF(__pyx_t_3);
  12524. __pyx_t_2 = NULL;
  12525. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
  12526. __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
  12527. if (likely(__pyx_t_2)) {
  12528. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
  12529. __Pyx_INCREF(__pyx_t_2);
  12530. __Pyx_INCREF(function);
  12531. __Pyx_DECREF_SET(__pyx_t_3, function);
  12532. }
  12533. }
  12534. __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);
  12535. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  12536. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1260, __pyx_L1_error)
  12537. __Pyx_GOTREF(__pyx_t_1);
  12538. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12539. __pyx_v_node_labels = __pyx_t_1;
  12540. __pyx_t_1 = 0;
  12541. /* "gedlibpy.pyx":1263
  12542. * # print(original_node_ids)
  12543. * # print(node_labels)
  12544. * graph.graph['original_node_ids'] = original_node_ids # <<<<<<<<<<<<<<
  12545. *
  12546. * for node_id in range(0, nb_nodes):
  12547. */
  12548. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_graph); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1263, __pyx_L1_error)
  12549. __Pyx_GOTREF(__pyx_t_1);
  12550. if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_n_u_original_node_ids, __pyx_v_original_node_ids) < 0)) __PYX_ERR(0, 1263, __pyx_L1_error)
  12551. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12552. /* "gedlibpy.pyx":1265
  12553. * graph.graph['original_node_ids'] = original_node_ids
  12554. *
  12555. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12556. * graph.add_node(node_id, **node_labels[node_id])
  12557. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12558. */
  12559. __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12560. __Pyx_GOTREF(__pyx_t_1);
  12561. __Pyx_INCREF(__pyx_int_0);
  12562. __Pyx_GIVEREF(__pyx_int_0);
  12563. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  12564. __Pyx_INCREF(__pyx_v_nb_nodes);
  12565. __Pyx_GIVEREF(__pyx_v_nb_nodes);
  12566. PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_nb_nodes);
  12567. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12568. __Pyx_GOTREF(__pyx_t_3);
  12569. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12570. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  12571. __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
  12572. __pyx_t_5 = NULL;
  12573. } else {
  12574. __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12575. __Pyx_GOTREF(__pyx_t_1);
  12576. __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12577. }
  12578. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12579. for (;;) {
  12580. if (likely(!__pyx_t_5)) {
  12581. if (likely(PyList_CheckExact(__pyx_t_1))) {
  12582. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
  12583. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12584. __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, 1265, __pyx_L1_error)
  12585. #else
  12586. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12587. __Pyx_GOTREF(__pyx_t_3);
  12588. #endif
  12589. } else {
  12590. if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  12591. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12592. __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, 1265, __pyx_L1_error)
  12593. #else
  12594. __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1265, __pyx_L1_error)
  12595. __Pyx_GOTREF(__pyx_t_3);
  12596. #endif
  12597. }
  12598. } else {
  12599. __pyx_t_3 = __pyx_t_5(__pyx_t_1);
  12600. if (unlikely(!__pyx_t_3)) {
  12601. PyObject* exc_type = PyErr_Occurred();
  12602. if (exc_type) {
  12603. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  12604. else __PYX_ERR(0, 1265, __pyx_L1_error)
  12605. }
  12606. break;
  12607. }
  12608. __Pyx_GOTREF(__pyx_t_3);
  12609. }
  12610. __Pyx_XDECREF_SET(__pyx_v_node_id, __pyx_t_3);
  12611. __pyx_t_3 = 0;
  12612. /* "gedlibpy.pyx":1266
  12613. *
  12614. * for node_id in range(0, nb_nodes):
  12615. * graph.add_node(node_id, **node_labels[node_id]) # <<<<<<<<<<<<<<
  12616. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12617. *
  12618. */
  12619. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12620. __Pyx_GOTREF(__pyx_t_3);
  12621. __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12622. __Pyx_GOTREF(__pyx_t_2);
  12623. __Pyx_INCREF(__pyx_v_node_id);
  12624. __Pyx_GIVEREF(__pyx_v_node_id);
  12625. PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_node_id);
  12626. __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_node_labels, __pyx_v_node_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12627. __Pyx_GOTREF(__pyx_t_7);
  12628. if (unlikely(__pyx_t_7 == Py_None)) {
  12629. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12630. __PYX_ERR(0, 1266, __pyx_L1_error)
  12631. }
  12632. if (likely(PyDict_CheckExact(__pyx_t_7))) {
  12633. __pyx_t_6 = PyDict_Copy(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12634. __Pyx_GOTREF(__pyx_t_6);
  12635. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12636. } else {
  12637. __pyx_t_6 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_t_7, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12638. __Pyx_GOTREF(__pyx_t_6);
  12639. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12640. }
  12641. __pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1266, __pyx_L1_error)
  12642. __Pyx_GOTREF(__pyx_t_7);
  12643. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12644. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12645. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12646. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12647. /* "gedlibpy.pyx":1265
  12648. * graph.graph['original_node_ids'] = original_node_ids
  12649. *
  12650. * for node_id in range(0, nb_nodes): # <<<<<<<<<<<<<<
  12651. * graph.add_node(node_id, **node_labels[node_id])
  12652. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12653. */
  12654. }
  12655. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12656. /* "gedlibpy.pyx":1269
  12657. * # graph.nodes[node_id]['original_node_id'] = original_node_ids[node_id]
  12658. *
  12659. * edges = self.get_graph_edges(graph_id) # <<<<<<<<<<<<<<
  12660. * for (head, tail), labels in edges.items():
  12661. * graph.add_edge(head, tail, **labels)
  12662. */
  12663. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_graph_edges); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1269, __pyx_L1_error)
  12664. __Pyx_GOTREF(__pyx_t_7);
  12665. __pyx_t_6 = NULL;
  12666. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  12667. __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
  12668. if (likely(__pyx_t_6)) {
  12669. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  12670. __Pyx_INCREF(__pyx_t_6);
  12671. __Pyx_INCREF(function);
  12672. __Pyx_DECREF_SET(__pyx_t_7, function);
  12673. }
  12674. }
  12675. __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);
  12676. __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  12677. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  12678. __Pyx_GOTREF(__pyx_t_1);
  12679. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12680. __pyx_v_edges = __pyx_t_1;
  12681. __pyx_t_1 = 0;
  12682. /* "gedlibpy.pyx":1270
  12683. *
  12684. * edges = self.get_graph_edges(graph_id)
  12685. * for (head, tail), labels in edges.items(): # <<<<<<<<<<<<<<
  12686. * graph.add_edge(head, tail, **labels)
  12687. * # print(edges)
  12688. */
  12689. __pyx_t_4 = 0;
  12690. if (unlikely(__pyx_v_edges == Py_None)) {
  12691. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  12692. __PYX_ERR(0, 1270, __pyx_L1_error)
  12693. }
  12694. __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, 1270, __pyx_L1_error)
  12695. __Pyx_GOTREF(__pyx_t_7);
  12696. __Pyx_XDECREF(__pyx_t_1);
  12697. __pyx_t_1 = __pyx_t_7;
  12698. __pyx_t_7 = 0;
  12699. while (1) {
  12700. __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);
  12701. if (unlikely(__pyx_t_10 == 0)) break;
  12702. if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12703. __Pyx_GOTREF(__pyx_t_7);
  12704. __Pyx_GOTREF(__pyx_t_6);
  12705. if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
  12706. PyObject* sequence = __pyx_t_7;
  12707. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  12708. if (unlikely(size != 2)) {
  12709. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  12710. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  12711. __PYX_ERR(0, 1270, __pyx_L1_error)
  12712. }
  12713. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  12714. if (likely(PyTuple_CheckExact(sequence))) {
  12715. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
  12716. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
  12717. } else {
  12718. __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
  12719. __pyx_t_3 = PyList_GET_ITEM(sequence, 1);
  12720. }
  12721. __Pyx_INCREF(__pyx_t_2);
  12722. __Pyx_INCREF(__pyx_t_3);
  12723. #else
  12724. __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12725. __Pyx_GOTREF(__pyx_t_2);
  12726. __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12727. __Pyx_GOTREF(__pyx_t_3);
  12728. #endif
  12729. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12730. } else {
  12731. Py_ssize_t index = -1;
  12732. __pyx_t_11 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1270, __pyx_L1_error)
  12733. __Pyx_GOTREF(__pyx_t_11);
  12734. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12735. __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
  12736. index = 0; __pyx_t_2 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_2)) goto __pyx_L7_unpacking_failed;
  12737. __Pyx_GOTREF(__pyx_t_2);
  12738. index = 1; __pyx_t_3 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_3)) goto __pyx_L7_unpacking_failed;
  12739. __Pyx_GOTREF(__pyx_t_3);
  12740. if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 2) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
  12741. __pyx_t_12 = NULL;
  12742. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12743. goto __pyx_L8_unpacking_done;
  12744. __pyx_L7_unpacking_failed:;
  12745. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  12746. __pyx_t_12 = NULL;
  12747. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  12748. __PYX_ERR(0, 1270, __pyx_L1_error)
  12749. __pyx_L8_unpacking_done:;
  12750. }
  12751. __Pyx_XDECREF_SET(__pyx_v_head, __pyx_t_2);
  12752. __pyx_t_2 = 0;
  12753. __Pyx_XDECREF_SET(__pyx_v_tail, __pyx_t_3);
  12754. __pyx_t_3 = 0;
  12755. __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_6);
  12756. __pyx_t_6 = 0;
  12757. /* "gedlibpy.pyx":1271
  12758. * edges = self.get_graph_edges(graph_id)
  12759. * for (head, tail), labels in edges.items():
  12760. * graph.add_edge(head, tail, **labels) # <<<<<<<<<<<<<<
  12761. * # print(edges)
  12762. *
  12763. */
  12764. __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_graph, __pyx_n_s_add_edge); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12765. __Pyx_GOTREF(__pyx_t_6);
  12766. __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12767. __Pyx_GOTREF(__pyx_t_7);
  12768. __Pyx_INCREF(__pyx_v_head);
  12769. __Pyx_GIVEREF(__pyx_v_head);
  12770. PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_head);
  12771. __Pyx_INCREF(__pyx_v_tail);
  12772. __Pyx_GIVEREF(__pyx_v_tail);
  12773. PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_tail);
  12774. if (unlikely(__pyx_v_labels == Py_None)) {
  12775. PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
  12776. __PYX_ERR(0, 1271, __pyx_L1_error)
  12777. }
  12778. if (likely(PyDict_CheckExact(__pyx_v_labels))) {
  12779. __pyx_t_3 = PyDict_Copy(__pyx_v_labels); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12780. __Pyx_GOTREF(__pyx_t_3);
  12781. } else {
  12782. __pyx_t_3 = PyObject_CallFunctionObjArgs((PyObject*)&PyDict_Type, __pyx_v_labels, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12783. __Pyx_GOTREF(__pyx_t_3);
  12784. }
  12785. __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  12786. __Pyx_GOTREF(__pyx_t_2);
  12787. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  12788. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  12789. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  12790. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  12791. }
  12792. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  12793. /* "gedlibpy.pyx":1274
  12794. * # print(edges)
  12795. *
  12796. * return graph # <<<<<<<<<<<<<<
  12797. *
  12798. *
  12799. */
  12800. __Pyx_XDECREF(__pyx_r);
  12801. __Pyx_INCREF(__pyx_v_graph);
  12802. __pyx_r = __pyx_v_graph;
  12803. goto __pyx_L0;
  12804. /* "gedlibpy.pyx":1232
  12805. *
  12806. *
  12807. * def get_nx_graph(self, graph_id, adj_matrix=True, adj_lists=False, edge_list=False): # @todo # <<<<<<<<<<<<<<
  12808. * """
  12809. * Get graph with id `graph_id` in the form of the NetworkX Graph.
  12810. */
  12811. /* function exit code */
  12812. __pyx_L1_error:;
  12813. __Pyx_XDECREF(__pyx_t_1);
  12814. __Pyx_XDECREF(__pyx_t_2);
  12815. __Pyx_XDECREF(__pyx_t_3);
  12816. __Pyx_XDECREF(__pyx_t_6);
  12817. __Pyx_XDECREF(__pyx_t_7);
  12818. __Pyx_XDECREF(__pyx_t_11);
  12819. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12820. __pyx_r = NULL;
  12821. __pyx_L0:;
  12822. __Pyx_XDECREF(__pyx_v_graph);
  12823. __Pyx_XDECREF(__pyx_v_nb_nodes);
  12824. __Pyx_XDECREF(__pyx_v_original_node_ids);
  12825. __Pyx_XDECREF(__pyx_v_node_labels);
  12826. __Pyx_XDECREF(__pyx_v_node_id);
  12827. __Pyx_XDECREF(__pyx_v_edges);
  12828. __Pyx_XDECREF(__pyx_v_head);
  12829. __Pyx_XDECREF(__pyx_v_tail);
  12830. __Pyx_XDECREF(__pyx_v_labels);
  12831. __Pyx_XGIVEREF(__pyx_r);
  12832. __Pyx_RefNannyFinishContext();
  12833. return __pyx_r;
  12834. }
  12835. /* "gedlibpy.pyx":1277
  12836. *
  12837. *
  12838. * def get_init_type(self): # <<<<<<<<<<<<<<
  12839. * """
  12840. * Returns the initialization type of the last initialization in string.
  12841. */
  12842. /* Python wrapper */
  12843. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  12844. 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";
  12845. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  12846. PyObject *__pyx_r = 0;
  12847. __Pyx_RefNannyDeclarations
  12848. __Pyx_RefNannySetupContext("get_init_type (wrapper)", 0);
  12849. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  12850. /* function exit code */
  12851. __Pyx_RefNannyFinishContext();
  12852. return __pyx_r;
  12853. }
  12854. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_122get_init_type(struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  12855. PyObject *__pyx_r = NULL;
  12856. __Pyx_RefNannyDeclarations
  12857. std::string __pyx_t_1;
  12858. PyObject *__pyx_t_2 = NULL;
  12859. __Pyx_RefNannySetupContext("get_init_type", 0);
  12860. /* "gedlibpy.pyx":1286
  12861. * Initialization type in string.
  12862. * """
  12863. * return self.c_env.getInitType().decode('utf-8') # <<<<<<<<<<<<<<
  12864. *
  12865. *
  12866. */
  12867. __Pyx_XDECREF(__pyx_r);
  12868. try {
  12869. __pyx_t_1 = __pyx_v_self->c_env->getInitType();
  12870. } catch(...) {
  12871. __Pyx_CppExn2PyErr();
  12872. __PYX_ERR(0, 1286, __pyx_L1_error)
  12873. }
  12874. __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, 1286, __pyx_L1_error)
  12875. __Pyx_GOTREF(__pyx_t_2);
  12876. __pyx_r = __pyx_t_2;
  12877. __pyx_t_2 = 0;
  12878. goto __pyx_L0;
  12879. /* "gedlibpy.pyx":1277
  12880. *
  12881. *
  12882. * def get_init_type(self): # <<<<<<<<<<<<<<
  12883. * """
  12884. * Returns the initialization type of the last initialization in string.
  12885. */
  12886. /* function exit code */
  12887. __pyx_L1_error:;
  12888. __Pyx_XDECREF(__pyx_t_2);
  12889. __Pyx_AddTraceback("gedlibpy.GEDEnv.get_init_type", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12890. __pyx_r = NULL;
  12891. __pyx_L0:;
  12892. __Pyx_XGIVEREF(__pyx_r);
  12893. __Pyx_RefNannyFinishContext();
  12894. return __pyx_r;
  12895. }
  12896. /* "gedlibpy.pyx":1308
  12897. *
  12898. *
  12899. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  12900. * """
  12901. * Loads NetworkX Graph into the GED environment.
  12902. */
  12903. /* Python wrapper */
  12904. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  12905. 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";
  12906. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  12907. PyObject *__pyx_v_nx_graph = 0;
  12908. PyObject *__pyx_v_graph_id = 0;
  12909. PyObject *__pyx_v_graph_name = 0;
  12910. PyObject *__pyx_v_graph_class = 0;
  12911. PyObject *__pyx_r = 0;
  12912. __Pyx_RefNannyDeclarations
  12913. __Pyx_RefNannySetupContext("load_nx_graph (wrapper)", 0);
  12914. {
  12915. 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};
  12916. PyObject* values[4] = {0,0,0,0};
  12917. values[2] = ((PyObject *)__pyx_kp_u_);
  12918. values[3] = ((PyObject *)__pyx_kp_u_);
  12919. if (unlikely(__pyx_kwds)) {
  12920. Py_ssize_t kw_args;
  12921. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  12922. switch (pos_args) {
  12923. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12924. CYTHON_FALLTHROUGH;
  12925. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12926. CYTHON_FALLTHROUGH;
  12927. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12928. CYTHON_FALLTHROUGH;
  12929. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12930. CYTHON_FALLTHROUGH;
  12931. case 0: break;
  12932. default: goto __pyx_L5_argtuple_error;
  12933. }
  12934. kw_args = PyDict_Size(__pyx_kwds);
  12935. switch (pos_args) {
  12936. case 0:
  12937. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nx_graph)) != 0)) kw_args--;
  12938. else goto __pyx_L5_argtuple_error;
  12939. CYTHON_FALLTHROUGH;
  12940. case 1:
  12941. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_id)) != 0)) kw_args--;
  12942. else {
  12943. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, 1); __PYX_ERR(0, 1308, __pyx_L3_error)
  12944. }
  12945. CYTHON_FALLTHROUGH;
  12946. case 2:
  12947. if (kw_args > 0) {
  12948. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_name);
  12949. if (value) { values[2] = value; kw_args--; }
  12950. }
  12951. CYTHON_FALLTHROUGH;
  12952. case 3:
  12953. if (kw_args > 0) {
  12954. PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_graph_class);
  12955. if (value) { values[3] = value; kw_args--; }
  12956. }
  12957. }
  12958. if (unlikely(kw_args > 0)) {
  12959. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "load_nx_graph") < 0)) __PYX_ERR(0, 1308, __pyx_L3_error)
  12960. }
  12961. } else {
  12962. switch (PyTuple_GET_SIZE(__pyx_args)) {
  12963. case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
  12964. CYTHON_FALLTHROUGH;
  12965. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  12966. CYTHON_FALLTHROUGH;
  12967. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  12968. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  12969. break;
  12970. default: goto __pyx_L5_argtuple_error;
  12971. }
  12972. }
  12973. __pyx_v_nx_graph = values[0];
  12974. __pyx_v_graph_id = values[1];
  12975. __pyx_v_graph_name = values[2];
  12976. __pyx_v_graph_class = values[3];
  12977. }
  12978. goto __pyx_L4_argument_unpacking_done;
  12979. __pyx_L5_argtuple_error:;
  12980. __Pyx_RaiseArgtupleInvalid("load_nx_graph", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1308, __pyx_L3_error)
  12981. __pyx_L3_error:;
  12982. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  12983. __Pyx_RefNannyFinishContext();
  12984. return NULL;
  12985. __pyx_L4_argument_unpacking_done:;
  12986. __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);
  12987. /* function exit code */
  12988. __Pyx_RefNannyFinishContext();
  12989. return __pyx_r;
  12990. }
  12991. 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) {
  12992. PyObject *__pyx_v_node = NULL;
  12993. PyObject *__pyx_v_edge = NULL;
  12994. PyObject *__pyx_r = NULL;
  12995. __Pyx_RefNannyDeclarations
  12996. int __pyx_t_1;
  12997. int __pyx_t_2;
  12998. PyObject *__pyx_t_3 = NULL;
  12999. PyObject *__pyx_t_4 = NULL;
  13000. PyObject *__pyx_t_5 = NULL;
  13001. int __pyx_t_6;
  13002. PyObject *__pyx_t_7 = NULL;
  13003. Py_ssize_t __pyx_t_8;
  13004. PyObject *(*__pyx_t_9)(PyObject *);
  13005. PyObject *__pyx_t_10 = NULL;
  13006. PyObject *__pyx_t_11 = NULL;
  13007. PyObject *__pyx_t_12 = NULL;
  13008. PyObject *__pyx_t_13 = NULL;
  13009. PyObject *__pyx_t_14 = NULL;
  13010. PyObject *__pyx_t_15 = NULL;
  13011. PyObject *__pyx_t_16 = NULL;
  13012. __Pyx_RefNannySetupContext("load_nx_graph", 0);
  13013. __Pyx_INCREF(__pyx_v_graph_id);
  13014. /* "gedlibpy.pyx":1331
  13015. * The ID of the newly loaded graph.
  13016. * """
  13017. * if graph_id is None: # <<<<<<<<<<<<<<
  13018. * graph_id = self.add_graph(graph_name, graph_class)
  13019. * else:
  13020. */
  13021. __pyx_t_1 = (__pyx_v_graph_id == Py_None);
  13022. __pyx_t_2 = (__pyx_t_1 != 0);
  13023. if (__pyx_t_2) {
  13024. /* "gedlibpy.pyx":1332
  13025. * """
  13026. * if graph_id is None:
  13027. * graph_id = self.add_graph(graph_name, graph_class) # <<<<<<<<<<<<<<
  13028. * else:
  13029. * self.clear_graph(graph_id)
  13030. */
  13031. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1332, __pyx_L1_error)
  13032. __Pyx_GOTREF(__pyx_t_4);
  13033. __pyx_t_5 = NULL;
  13034. __pyx_t_6 = 0;
  13035. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13036. __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
  13037. if (likely(__pyx_t_5)) {
  13038. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13039. __Pyx_INCREF(__pyx_t_5);
  13040. __Pyx_INCREF(function);
  13041. __Pyx_DECREF_SET(__pyx_t_4, function);
  13042. __pyx_t_6 = 1;
  13043. }
  13044. }
  13045. #if CYTHON_FAST_PYCALL
  13046. if (PyFunction_Check(__pyx_t_4)) {
  13047. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13048. __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, 1332, __pyx_L1_error)
  13049. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13050. __Pyx_GOTREF(__pyx_t_3);
  13051. } else
  13052. #endif
  13053. #if CYTHON_FAST_PYCCALL
  13054. if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
  13055. PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_graph_name, __pyx_v_graph_class};
  13056. __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, 1332, __pyx_L1_error)
  13057. __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  13058. __Pyx_GOTREF(__pyx_t_3);
  13059. } else
  13060. #endif
  13061. {
  13062. __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1332, __pyx_L1_error)
  13063. __Pyx_GOTREF(__pyx_t_7);
  13064. if (__pyx_t_5) {
  13065. __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
  13066. }
  13067. __Pyx_INCREF(__pyx_v_graph_name);
  13068. __Pyx_GIVEREF(__pyx_v_graph_name);
  13069. PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_graph_name);
  13070. __Pyx_INCREF(__pyx_v_graph_class);
  13071. __Pyx_GIVEREF(__pyx_v_graph_class);
  13072. PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_graph_class);
  13073. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1332, __pyx_L1_error)
  13074. __Pyx_GOTREF(__pyx_t_3);
  13075. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13076. }
  13077. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13078. __Pyx_DECREF_SET(__pyx_v_graph_id, __pyx_t_3);
  13079. __pyx_t_3 = 0;
  13080. /* "gedlibpy.pyx":1331
  13081. * The ID of the newly loaded graph.
  13082. * """
  13083. * if graph_id is None: # <<<<<<<<<<<<<<
  13084. * graph_id = self.add_graph(graph_name, graph_class)
  13085. * else:
  13086. */
  13087. goto __pyx_L3;
  13088. }
  13089. /* "gedlibpy.pyx":1334
  13090. * graph_id = self.add_graph(graph_name, graph_class)
  13091. * else:
  13092. * self.clear_graph(graph_id) # <<<<<<<<<<<<<<
  13093. * for node in nx_graph.nodes:
  13094. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13095. */
  13096. /*else*/ {
  13097. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear_graph); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1334, __pyx_L1_error)
  13098. __Pyx_GOTREF(__pyx_t_4);
  13099. __pyx_t_7 = NULL;
  13100. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
  13101. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_4);
  13102. if (likely(__pyx_t_7)) {
  13103. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
  13104. __Pyx_INCREF(__pyx_t_7);
  13105. __Pyx_INCREF(function);
  13106. __Pyx_DECREF_SET(__pyx_t_4, function);
  13107. }
  13108. }
  13109. __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);
  13110. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13111. if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1334, __pyx_L1_error)
  13112. __Pyx_GOTREF(__pyx_t_3);
  13113. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13114. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13115. }
  13116. __pyx_L3:;
  13117. /* "gedlibpy.pyx":1335
  13118. * else:
  13119. * self.clear_graph(graph_id)
  13120. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13121. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13122. * for edge in nx_graph.edges:
  13123. */
  13124. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13125. __Pyx_GOTREF(__pyx_t_3);
  13126. if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
  13127. __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
  13128. __pyx_t_9 = NULL;
  13129. } else {
  13130. __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13131. __Pyx_GOTREF(__pyx_t_4);
  13132. __pyx_t_9 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13133. }
  13134. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13135. for (;;) {
  13136. if (likely(!__pyx_t_9)) {
  13137. if (likely(PyList_CheckExact(__pyx_t_4))) {
  13138. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
  13139. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13140. __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, 1335, __pyx_L1_error)
  13141. #else
  13142. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13143. __Pyx_GOTREF(__pyx_t_3);
  13144. #endif
  13145. } else {
  13146. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
  13147. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13148. __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, 1335, __pyx_L1_error)
  13149. #else
  13150. __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1335, __pyx_L1_error)
  13151. __Pyx_GOTREF(__pyx_t_3);
  13152. #endif
  13153. }
  13154. } else {
  13155. __pyx_t_3 = __pyx_t_9(__pyx_t_4);
  13156. if (unlikely(!__pyx_t_3)) {
  13157. PyObject* exc_type = PyErr_Occurred();
  13158. if (exc_type) {
  13159. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13160. else __PYX_ERR(0, 1335, __pyx_L1_error)
  13161. }
  13162. break;
  13163. }
  13164. __Pyx_GOTREF(__pyx_t_3);
  13165. }
  13166. __Pyx_XDECREF_SET(__pyx_v_node, __pyx_t_3);
  13167. __pyx_t_3 = 0;
  13168. /* "gedlibpy.pyx":1336
  13169. * self.clear_graph(graph_id)
  13170. * for node in nx_graph.nodes:
  13171. * self.add_node(graph_id, str(node), nx_graph.nodes[node]) # <<<<<<<<<<<<<<
  13172. * for edge in nx_graph.edges:
  13173. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13174. */
  13175. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_node); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13176. __Pyx_GOTREF(__pyx_t_7);
  13177. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_v_node); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13178. __Pyx_GOTREF(__pyx_t_5);
  13179. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_nodes); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13180. __Pyx_GOTREF(__pyx_t_10);
  13181. __pyx_t_11 = __Pyx_PyObject_GetItem(__pyx_t_10, __pyx_v_node); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13182. __Pyx_GOTREF(__pyx_t_11);
  13183. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13184. __pyx_t_10 = NULL;
  13185. __pyx_t_6 = 0;
  13186. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13187. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13188. if (likely(__pyx_t_10)) {
  13189. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13190. __Pyx_INCREF(__pyx_t_10);
  13191. __Pyx_INCREF(function);
  13192. __Pyx_DECREF_SET(__pyx_t_7, function);
  13193. __pyx_t_6 = 1;
  13194. }
  13195. }
  13196. #if CYTHON_FAST_PYCALL
  13197. if (PyFunction_Check(__pyx_t_7)) {
  13198. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13199. __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, 1336, __pyx_L1_error)
  13200. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13201. __Pyx_GOTREF(__pyx_t_3);
  13202. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13203. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13204. } else
  13205. #endif
  13206. #if CYTHON_FAST_PYCCALL
  13207. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13208. PyObject *__pyx_temp[4] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_5, __pyx_t_11};
  13209. __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, 1336, __pyx_L1_error)
  13210. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13211. __Pyx_GOTREF(__pyx_t_3);
  13212. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13213. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13214. } else
  13215. #endif
  13216. {
  13217. __pyx_t_12 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13218. __Pyx_GOTREF(__pyx_t_12);
  13219. if (__pyx_t_10) {
  13220. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13221. }
  13222. __Pyx_INCREF(__pyx_v_graph_id);
  13223. __Pyx_GIVEREF(__pyx_v_graph_id);
  13224. PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_6, __pyx_v_graph_id);
  13225. __Pyx_GIVEREF(__pyx_t_5);
  13226. PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_6, __pyx_t_5);
  13227. __Pyx_GIVEREF(__pyx_t_11);
  13228. PyTuple_SET_ITEM(__pyx_t_12, 2+__pyx_t_6, __pyx_t_11);
  13229. __pyx_t_5 = 0;
  13230. __pyx_t_11 = 0;
  13231. __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1336, __pyx_L1_error)
  13232. __Pyx_GOTREF(__pyx_t_3);
  13233. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13234. }
  13235. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13236. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13237. /* "gedlibpy.pyx":1335
  13238. * else:
  13239. * self.clear_graph(graph_id)
  13240. * for node in nx_graph.nodes: # <<<<<<<<<<<<<<
  13241. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13242. * for edge in nx_graph.edges:
  13243. */
  13244. }
  13245. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13246. /* "gedlibpy.pyx":1337
  13247. * for node in nx_graph.nodes:
  13248. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13249. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13250. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13251. * return graph_id
  13252. */
  13253. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_edges); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13254. __Pyx_GOTREF(__pyx_t_4);
  13255. if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
  13256. __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
  13257. __pyx_t_9 = NULL;
  13258. } else {
  13259. __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13260. __Pyx_GOTREF(__pyx_t_3);
  13261. __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13262. }
  13263. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13264. for (;;) {
  13265. if (likely(!__pyx_t_9)) {
  13266. if (likely(PyList_CheckExact(__pyx_t_3))) {
  13267. if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
  13268. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13269. __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, 1337, __pyx_L1_error)
  13270. #else
  13271. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13272. __Pyx_GOTREF(__pyx_t_4);
  13273. #endif
  13274. } else {
  13275. if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
  13276. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13277. __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, 1337, __pyx_L1_error)
  13278. #else
  13279. __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1337, __pyx_L1_error)
  13280. __Pyx_GOTREF(__pyx_t_4);
  13281. #endif
  13282. }
  13283. } else {
  13284. __pyx_t_4 = __pyx_t_9(__pyx_t_3);
  13285. if (unlikely(!__pyx_t_4)) {
  13286. PyObject* exc_type = PyErr_Occurred();
  13287. if (exc_type) {
  13288. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  13289. else __PYX_ERR(0, 1337, __pyx_L1_error)
  13290. }
  13291. break;
  13292. }
  13293. __Pyx_GOTREF(__pyx_t_4);
  13294. }
  13295. __Pyx_XDECREF_SET(__pyx_v_edge, __pyx_t_4);
  13296. __pyx_t_4 = 0;
  13297. /* "gedlibpy.pyx":1338
  13298. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13299. * for edge in nx_graph.edges:
  13300. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1])) # <<<<<<<<<<<<<<
  13301. * return graph_id
  13302. *
  13303. */
  13304. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_edge); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13305. __Pyx_GOTREF(__pyx_t_7);
  13306. __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, 1338, __pyx_L1_error)
  13307. __Pyx_GOTREF(__pyx_t_12);
  13308. __pyx_t_11 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13309. __Pyx_GOTREF(__pyx_t_11);
  13310. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13311. __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, 1338, __pyx_L1_error)
  13312. __Pyx_GOTREF(__pyx_t_12);
  13313. __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyUnicode_Type)), __pyx_t_12); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13314. __Pyx_GOTREF(__pyx_t_5);
  13315. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13316. __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_nx_graph, __pyx_n_s_get_edge_data); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13317. __Pyx_GOTREF(__pyx_t_10);
  13318. __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, 1338, __pyx_L1_error)
  13319. __Pyx_GOTREF(__pyx_t_13);
  13320. __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, 1338, __pyx_L1_error)
  13321. __Pyx_GOTREF(__pyx_t_14);
  13322. __pyx_t_15 = NULL;
  13323. __pyx_t_6 = 0;
  13324. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
  13325. __pyx_t_15 = PyMethod_GET_SELF(__pyx_t_10);
  13326. if (likely(__pyx_t_15)) {
  13327. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
  13328. __Pyx_INCREF(__pyx_t_15);
  13329. __Pyx_INCREF(function);
  13330. __Pyx_DECREF_SET(__pyx_t_10, function);
  13331. __pyx_t_6 = 1;
  13332. }
  13333. }
  13334. #if CYTHON_FAST_PYCALL
  13335. if (PyFunction_Check(__pyx_t_10)) {
  13336. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13337. __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, 1338, __pyx_L1_error)
  13338. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13339. __Pyx_GOTREF(__pyx_t_12);
  13340. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13341. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13342. } else
  13343. #endif
  13344. #if CYTHON_FAST_PYCCALL
  13345. if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
  13346. PyObject *__pyx_temp[3] = {__pyx_t_15, __pyx_t_13, __pyx_t_14};
  13347. __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, 1338, __pyx_L1_error)
  13348. __Pyx_XDECREF(__pyx_t_15); __pyx_t_15 = 0;
  13349. __Pyx_GOTREF(__pyx_t_12);
  13350. __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
  13351. __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
  13352. } else
  13353. #endif
  13354. {
  13355. __pyx_t_16 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13356. __Pyx_GOTREF(__pyx_t_16);
  13357. if (__pyx_t_15) {
  13358. __Pyx_GIVEREF(__pyx_t_15); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_15); __pyx_t_15 = NULL;
  13359. }
  13360. __Pyx_GIVEREF(__pyx_t_13);
  13361. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_t_13);
  13362. __Pyx_GIVEREF(__pyx_t_14);
  13363. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_14);
  13364. __pyx_t_13 = 0;
  13365. __pyx_t_14 = 0;
  13366. __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_16, NULL); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13367. __Pyx_GOTREF(__pyx_t_12);
  13368. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13369. }
  13370. __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  13371. __pyx_t_10 = NULL;
  13372. __pyx_t_6 = 0;
  13373. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
  13374. __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
  13375. if (likely(__pyx_t_10)) {
  13376. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
  13377. __Pyx_INCREF(__pyx_t_10);
  13378. __Pyx_INCREF(function);
  13379. __Pyx_DECREF_SET(__pyx_t_7, function);
  13380. __pyx_t_6 = 1;
  13381. }
  13382. }
  13383. #if CYTHON_FAST_PYCALL
  13384. if (PyFunction_Check(__pyx_t_7)) {
  13385. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13386. __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, 1338, __pyx_L1_error)
  13387. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13388. __Pyx_GOTREF(__pyx_t_4);
  13389. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13390. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13391. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13392. } else
  13393. #endif
  13394. #if CYTHON_FAST_PYCCALL
  13395. if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
  13396. PyObject *__pyx_temp[5] = {__pyx_t_10, __pyx_v_graph_id, __pyx_t_11, __pyx_t_5, __pyx_t_12};
  13397. __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, 1338, __pyx_L1_error)
  13398. __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  13399. __Pyx_GOTREF(__pyx_t_4);
  13400. __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
  13401. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13402. __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
  13403. } else
  13404. #endif
  13405. {
  13406. __pyx_t_16 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13407. __Pyx_GOTREF(__pyx_t_16);
  13408. if (__pyx_t_10) {
  13409. __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_10); __pyx_t_10 = NULL;
  13410. }
  13411. __Pyx_INCREF(__pyx_v_graph_id);
  13412. __Pyx_GIVEREF(__pyx_v_graph_id);
  13413. PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_6, __pyx_v_graph_id);
  13414. __Pyx_GIVEREF(__pyx_t_11);
  13415. PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_6, __pyx_t_11);
  13416. __Pyx_GIVEREF(__pyx_t_5);
  13417. PyTuple_SET_ITEM(__pyx_t_16, 2+__pyx_t_6, __pyx_t_5);
  13418. __Pyx_GIVEREF(__pyx_t_12);
  13419. PyTuple_SET_ITEM(__pyx_t_16, 3+__pyx_t_6, __pyx_t_12);
  13420. __pyx_t_11 = 0;
  13421. __pyx_t_5 = 0;
  13422. __pyx_t_12 = 0;
  13423. __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_16, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1338, __pyx_L1_error)
  13424. __Pyx_GOTREF(__pyx_t_4);
  13425. __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
  13426. }
  13427. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13428. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  13429. /* "gedlibpy.pyx":1337
  13430. * for node in nx_graph.nodes:
  13431. * self.add_node(graph_id, str(node), nx_graph.nodes[node])
  13432. * for edge in nx_graph.edges: # <<<<<<<<<<<<<<
  13433. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13434. * return graph_id
  13435. */
  13436. }
  13437. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13438. /* "gedlibpy.pyx":1339
  13439. * for edge in nx_graph.edges:
  13440. * self.add_edge(graph_id, str(edge[0]), str(edge[1]), nx_graph.get_edge_data(edge[0], edge[1]))
  13441. * return graph_id # <<<<<<<<<<<<<<
  13442. *
  13443. *
  13444. */
  13445. __Pyx_XDECREF(__pyx_r);
  13446. __Pyx_INCREF(__pyx_v_graph_id);
  13447. __pyx_r = __pyx_v_graph_id;
  13448. goto __pyx_L0;
  13449. /* "gedlibpy.pyx":1308
  13450. *
  13451. *
  13452. * def load_nx_graph(self, nx_graph, graph_id, graph_name='', graph_class=''): # <<<<<<<<<<<<<<
  13453. * """
  13454. * Loads NetworkX Graph into the GED environment.
  13455. */
  13456. /* function exit code */
  13457. __pyx_L1_error:;
  13458. __Pyx_XDECREF(__pyx_t_3);
  13459. __Pyx_XDECREF(__pyx_t_4);
  13460. __Pyx_XDECREF(__pyx_t_5);
  13461. __Pyx_XDECREF(__pyx_t_7);
  13462. __Pyx_XDECREF(__pyx_t_10);
  13463. __Pyx_XDECREF(__pyx_t_11);
  13464. __Pyx_XDECREF(__pyx_t_12);
  13465. __Pyx_XDECREF(__pyx_t_13);
  13466. __Pyx_XDECREF(__pyx_t_14);
  13467. __Pyx_XDECREF(__pyx_t_15);
  13468. __Pyx_XDECREF(__pyx_t_16);
  13469. __Pyx_AddTraceback("gedlibpy.GEDEnv.load_nx_graph", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13470. __pyx_r = NULL;
  13471. __pyx_L0:;
  13472. __Pyx_XDECREF(__pyx_v_node);
  13473. __Pyx_XDECREF(__pyx_v_edge);
  13474. __Pyx_XDECREF(__pyx_v_graph_id);
  13475. __Pyx_XGIVEREF(__pyx_r);
  13476. __Pyx_RefNannyFinishContext();
  13477. return __pyx_r;
  13478. }
  13479. /* "gedlibpy.pyx":1342
  13480. *
  13481. *
  13482. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13483. * """
  13484. * Computes the edit cost between two graphs induced by a node map.
  13485. */
  13486. /* Python wrapper */
  13487. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13488. 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";
  13489. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13490. PyObject *__pyx_v_g_id = 0;
  13491. PyObject *__pyx_v_h_id = 0;
  13492. PyObject *__pyx_v_node_map = 0;
  13493. PyObject *__pyx_r = 0;
  13494. __Pyx_RefNannyDeclarations
  13495. __Pyx_RefNannySetupContext("compute_induced_cost (wrapper)", 0);
  13496. {
  13497. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_g_id,&__pyx_n_s_h_id,&__pyx_n_s_node_map,0};
  13498. PyObject* values[3] = {0,0,0};
  13499. if (unlikely(__pyx_kwds)) {
  13500. Py_ssize_t kw_args;
  13501. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13502. switch (pos_args) {
  13503. case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13504. CYTHON_FALLTHROUGH;
  13505. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13506. CYTHON_FALLTHROUGH;
  13507. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13508. CYTHON_FALLTHROUGH;
  13509. case 0: break;
  13510. default: goto __pyx_L5_argtuple_error;
  13511. }
  13512. kw_args = PyDict_Size(__pyx_kwds);
  13513. switch (pos_args) {
  13514. case 0:
  13515. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g_id)) != 0)) kw_args--;
  13516. else goto __pyx_L5_argtuple_error;
  13517. CYTHON_FALLTHROUGH;
  13518. case 1:
  13519. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_h_id)) != 0)) kw_args--;
  13520. else {
  13521. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 1); __PYX_ERR(0, 1342, __pyx_L3_error)
  13522. }
  13523. CYTHON_FALLTHROUGH;
  13524. case 2:
  13525. if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_node_map)) != 0)) kw_args--;
  13526. else {
  13527. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, 2); __PYX_ERR(0, 1342, __pyx_L3_error)
  13528. }
  13529. }
  13530. if (unlikely(kw_args > 0)) {
  13531. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "compute_induced_cost") < 0)) __PYX_ERR(0, 1342, __pyx_L3_error)
  13532. }
  13533. } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
  13534. goto __pyx_L5_argtuple_error;
  13535. } else {
  13536. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13537. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13538. values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
  13539. }
  13540. __pyx_v_g_id = values[0];
  13541. __pyx_v_h_id = values[1];
  13542. __pyx_v_node_map = values[2];
  13543. }
  13544. goto __pyx_L4_argument_unpacking_done;
  13545. __pyx_L5_argtuple_error:;
  13546. __Pyx_RaiseArgtupleInvalid("compute_induced_cost", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1342, __pyx_L3_error)
  13547. __pyx_L3_error:;
  13548. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13549. __Pyx_RefNannyFinishContext();
  13550. return NULL;
  13551. __pyx_L4_argument_unpacking_done:;
  13552. __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);
  13553. /* function exit code */
  13554. __Pyx_RefNannyFinishContext();
  13555. return __pyx_r;
  13556. }
  13557. 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) {
  13558. PyObject *__pyx_v_relation = NULL;
  13559. PyObject *__pyx_v_dummy_node = NULL;
  13560. PyObject *__pyx_v_i = NULL;
  13561. PyObject *__pyx_v_val = NULL;
  13562. PyObject *__pyx_v_val1 = NULL;
  13563. PyObject *__pyx_v_val2 = NULL;
  13564. double __pyx_v_induced_cost;
  13565. PyObject *__pyx_r = NULL;
  13566. __Pyx_RefNannyDeclarations
  13567. PyObject *__pyx_t_1 = NULL;
  13568. PyObject *__pyx_t_2 = NULL;
  13569. PyObject *__pyx_t_3 = NULL;
  13570. Py_ssize_t __pyx_t_4;
  13571. PyObject *__pyx_t_5 = NULL;
  13572. PyObject *__pyx_t_6 = NULL;
  13573. PyObject *__pyx_t_7 = NULL;
  13574. int __pyx_t_8;
  13575. size_t __pyx_t_9;
  13576. size_t __pyx_t_10;
  13577. std::vector<std::pair<size_t,size_t> > __pyx_t_11;
  13578. double __pyx_t_12;
  13579. __Pyx_RefNannySetupContext("compute_induced_cost", 0);
  13580. /* "gedlibpy.pyx":1359
  13581. * None.
  13582. * """
  13583. * relation = [] # <<<<<<<<<<<<<<
  13584. * node_map.as_relation(relation)
  13585. * # print(relation)
  13586. */
  13587. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error)
  13588. __Pyx_GOTREF(__pyx_t_1);
  13589. __pyx_v_relation = ((PyObject*)__pyx_t_1);
  13590. __pyx_t_1 = 0;
  13591. /* "gedlibpy.pyx":1360
  13592. * """
  13593. * relation = []
  13594. * node_map.as_relation(relation) # <<<<<<<<<<<<<<
  13595. * # print(relation)
  13596. * dummy_node = get_dummy_node()
  13597. */
  13598. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_as_relation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1360, __pyx_L1_error)
  13599. __Pyx_GOTREF(__pyx_t_2);
  13600. __pyx_t_3 = NULL;
  13601. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  13602. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  13603. if (likely(__pyx_t_3)) {
  13604. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13605. __Pyx_INCREF(__pyx_t_3);
  13606. __Pyx_INCREF(function);
  13607. __Pyx_DECREF_SET(__pyx_t_2, function);
  13608. }
  13609. }
  13610. __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);
  13611. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  13612. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
  13613. __Pyx_GOTREF(__pyx_t_1);
  13614. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13615. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13616. /* "gedlibpy.pyx":1362
  13617. * node_map.as_relation(relation)
  13618. * # print(relation)
  13619. * dummy_node = get_dummy_node() # <<<<<<<<<<<<<<
  13620. * # print(dummy_node)
  13621. * for i, val in enumerate(relation):
  13622. */
  13623. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_get_dummy_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1362, __pyx_L1_error)
  13624. __Pyx_GOTREF(__pyx_t_2);
  13625. __pyx_t_3 = NULL;
  13626. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
  13627. __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
  13628. if (likely(__pyx_t_3)) {
  13629. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13630. __Pyx_INCREF(__pyx_t_3);
  13631. __Pyx_INCREF(function);
  13632. __Pyx_DECREF_SET(__pyx_t_2, function);
  13633. }
  13634. }
  13635. __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  13636. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  13637. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1362, __pyx_L1_error)
  13638. __Pyx_GOTREF(__pyx_t_1);
  13639. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13640. __pyx_v_dummy_node = __pyx_t_1;
  13641. __pyx_t_1 = 0;
  13642. /* "gedlibpy.pyx":1364
  13643. * dummy_node = get_dummy_node()
  13644. * # print(dummy_node)
  13645. * for i, val in enumerate(relation): # <<<<<<<<<<<<<<
  13646. * val1 = dummy_node if val[0] == np.inf else val[0]
  13647. * val2 = dummy_node if val[1] == np.inf else val[1]
  13648. */
  13649. __Pyx_INCREF(__pyx_int_0);
  13650. __pyx_t_1 = __pyx_int_0;
  13651. __pyx_t_2 = __pyx_v_relation; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
  13652. for (;;) {
  13653. if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
  13654. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  13655. __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, 1364, __pyx_L1_error)
  13656. #else
  13657. __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error)
  13658. __Pyx_GOTREF(__pyx_t_3);
  13659. #endif
  13660. __Pyx_XDECREF_SET(__pyx_v_val, __pyx_t_3);
  13661. __pyx_t_3 = 0;
  13662. __Pyx_INCREF(__pyx_t_1);
  13663. __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
  13664. __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1364, __pyx_L1_error)
  13665. __Pyx_GOTREF(__pyx_t_3);
  13666. __Pyx_DECREF(__pyx_t_1);
  13667. __pyx_t_1 = __pyx_t_3;
  13668. __pyx_t_3 = 0;
  13669. /* "gedlibpy.pyx":1365
  13670. * # print(dummy_node)
  13671. * for i, val in enumerate(relation):
  13672. * val1 = dummy_node if val[0] == np.inf else val[0] # <<<<<<<<<<<<<<
  13673. * val2 = dummy_node if val[1] == np.inf else val[1]
  13674. * relation[i] = tuple((val1, val2))
  13675. */
  13676. __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, 1365, __pyx_L1_error)
  13677. __Pyx_GOTREF(__pyx_t_5);
  13678. __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1365, __pyx_L1_error)
  13679. __Pyx_GOTREF(__pyx_t_6);
  13680. __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inf); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1365, __pyx_L1_error)
  13681. __Pyx_GOTREF(__pyx_t_7);
  13682. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13683. __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, 1365, __pyx_L1_error)
  13684. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13685. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13686. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1365, __pyx_L1_error)
  13687. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13688. if (__pyx_t_8) {
  13689. __Pyx_INCREF(__pyx_v_dummy_node);
  13690. __pyx_t_3 = __pyx_v_dummy_node;
  13691. } else {
  13692. __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, 1365, __pyx_L1_error)
  13693. __Pyx_GOTREF(__pyx_t_6);
  13694. __pyx_t_3 = __pyx_t_6;
  13695. __pyx_t_6 = 0;
  13696. }
  13697. __Pyx_XDECREF_SET(__pyx_v_val1, __pyx_t_3);
  13698. __pyx_t_3 = 0;
  13699. /* "gedlibpy.pyx":1366
  13700. * for i, val in enumerate(relation):
  13701. * val1 = dummy_node if val[0] == np.inf else val[0]
  13702. * val2 = dummy_node if val[1] == np.inf else val[1] # <<<<<<<<<<<<<<
  13703. * relation[i] = tuple((val1, val2))
  13704. * # print(relation)
  13705. */
  13706. __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, 1366, __pyx_L1_error)
  13707. __Pyx_GOTREF(__pyx_t_6);
  13708. __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_np); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1366, __pyx_L1_error)
  13709. __Pyx_GOTREF(__pyx_t_7);
  13710. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1366, __pyx_L1_error)
  13711. __Pyx_GOTREF(__pyx_t_5);
  13712. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13713. __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, 1366, __pyx_L1_error)
  13714. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  13715. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  13716. __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1366, __pyx_L1_error)
  13717. __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  13718. if (__pyx_t_8) {
  13719. __Pyx_INCREF(__pyx_v_dummy_node);
  13720. __pyx_t_3 = __pyx_v_dummy_node;
  13721. } else {
  13722. __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, 1366, __pyx_L1_error)
  13723. __Pyx_GOTREF(__pyx_t_7);
  13724. __pyx_t_3 = __pyx_t_7;
  13725. __pyx_t_7 = 0;
  13726. }
  13727. __Pyx_XDECREF_SET(__pyx_v_val2, __pyx_t_3);
  13728. __pyx_t_3 = 0;
  13729. /* "gedlibpy.pyx":1367
  13730. * val1 = dummy_node if val[0] == np.inf else val[0]
  13731. * val2 = dummy_node if val[1] == np.inf else val[1]
  13732. * relation[i] = tuple((val1, val2)) # <<<<<<<<<<<<<<
  13733. * # print(relation)
  13734. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation)
  13735. */
  13736. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error)
  13737. __Pyx_GOTREF(__pyx_t_3);
  13738. __Pyx_INCREF(__pyx_v_val1);
  13739. __Pyx_GIVEREF(__pyx_v_val1);
  13740. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_val1);
  13741. __Pyx_INCREF(__pyx_v_val2);
  13742. __Pyx_GIVEREF(__pyx_v_val2);
  13743. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_val2);
  13744. if (unlikely(PyObject_SetItem(__pyx_v_relation, __pyx_v_i, __pyx_t_3) < 0)) __PYX_ERR(0, 1367, __pyx_L1_error)
  13745. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13746. /* "gedlibpy.pyx":1364
  13747. * dummy_node = get_dummy_node()
  13748. * # print(dummy_node)
  13749. * for i, val in enumerate(relation): # <<<<<<<<<<<<<<
  13750. * val1 = dummy_node if val[0] == np.inf else val[0]
  13751. * val2 = dummy_node if val[1] == np.inf else val[1]
  13752. */
  13753. }
  13754. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13755. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13756. /* "gedlibpy.pyx":1369
  13757. * relation[i] = tuple((val1, val2))
  13758. * # print(relation)
  13759. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation) # <<<<<<<<<<<<<<
  13760. * node_map.set_induced_cost(induced_cost)
  13761. *
  13762. */
  13763. __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, 1369, __pyx_L1_error)
  13764. __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, 1369, __pyx_L1_error)
  13765. __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, 1369, __pyx_L1_error)
  13766. try {
  13767. __pyx_t_12 = __pyx_v_self->c_env->computeInducedCost(__pyx_t_9, __pyx_t_10, __pyx_t_11);
  13768. } catch(...) {
  13769. __Pyx_CppExn2PyErr();
  13770. __PYX_ERR(0, 1369, __pyx_L1_error)
  13771. }
  13772. __pyx_v_induced_cost = __pyx_t_12;
  13773. /* "gedlibpy.pyx":1370
  13774. * # print(relation)
  13775. * induced_cost = self.c_env.computeInducedCost(g_id, h_id, relation)
  13776. * node_map.set_induced_cost(induced_cost) # <<<<<<<<<<<<<<
  13777. *
  13778. *
  13779. */
  13780. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_node_map, __pyx_n_s_set_induced_cost); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1370, __pyx_L1_error)
  13781. __Pyx_GOTREF(__pyx_t_2);
  13782. __pyx_t_3 = PyFloat_FromDouble(__pyx_v_induced_cost); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error)
  13783. __Pyx_GOTREF(__pyx_t_3);
  13784. __pyx_t_7 = NULL;
  13785. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
  13786. __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
  13787. if (likely(__pyx_t_7)) {
  13788. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
  13789. __Pyx_INCREF(__pyx_t_7);
  13790. __Pyx_INCREF(function);
  13791. __Pyx_DECREF_SET(__pyx_t_2, function);
  13792. }
  13793. }
  13794. __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);
  13795. __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  13796. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  13797. if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1370, __pyx_L1_error)
  13798. __Pyx_GOTREF(__pyx_t_1);
  13799. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  13800. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13801. /* "gedlibpy.pyx":1342
  13802. *
  13803. *
  13804. * def compute_induced_cost(self, g_id, h_id, node_map): # <<<<<<<<<<<<<<
  13805. * """
  13806. * Computes the edit cost between two graphs induced by a node map.
  13807. */
  13808. /* function exit code */
  13809. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  13810. goto __pyx_L0;
  13811. __pyx_L1_error:;
  13812. __Pyx_XDECREF(__pyx_t_1);
  13813. __Pyx_XDECREF(__pyx_t_2);
  13814. __Pyx_XDECREF(__pyx_t_3);
  13815. __Pyx_XDECREF(__pyx_t_5);
  13816. __Pyx_XDECREF(__pyx_t_6);
  13817. __Pyx_XDECREF(__pyx_t_7);
  13818. __Pyx_AddTraceback("gedlibpy.GEDEnv.compute_induced_cost", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13819. __pyx_r = NULL;
  13820. __pyx_L0:;
  13821. __Pyx_XDECREF(__pyx_v_relation);
  13822. __Pyx_XDECREF(__pyx_v_dummy_node);
  13823. __Pyx_XDECREF(__pyx_v_i);
  13824. __Pyx_XDECREF(__pyx_v_val);
  13825. __Pyx_XDECREF(__pyx_v_val1);
  13826. __Pyx_XDECREF(__pyx_v_val2);
  13827. __Pyx_XGIVEREF(__pyx_r);
  13828. __Pyx_RefNannyFinishContext();
  13829. return __pyx_r;
  13830. }
  13831. /* "(tree fragment)":1
  13832. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13833. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13834. * def __setstate_cython__(self, __pyx_state):
  13835. */
  13836. /* Python wrapper */
  13837. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
  13838. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  13839. PyObject *__pyx_r = 0;
  13840. __Pyx_RefNannyDeclarations
  13841. __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  13842. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self));
  13843. /* function exit code */
  13844. __Pyx_RefNannyFinishContext();
  13845. return __pyx_r;
  13846. }
  13847. static PyObject *__pyx_pf_8gedlibpy_6GEDEnv_128__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8gedlibpy_GEDEnv *__pyx_v_self) {
  13848. PyObject *__pyx_r = NULL;
  13849. __Pyx_RefNannyDeclarations
  13850. PyObject *__pyx_t_1 = NULL;
  13851. __Pyx_RefNannySetupContext("__reduce_cython__", 0);
  13852. /* "(tree fragment)":2
  13853. * def __reduce_cython__(self):
  13854. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13855. * def __setstate_cython__(self, __pyx_state):
  13856. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13857. */
  13858. __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)
  13859. __Pyx_GOTREF(__pyx_t_1);
  13860. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13861. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13862. __PYX_ERR(1, 2, __pyx_L1_error)
  13863. /* "(tree fragment)":1
  13864. * def __reduce_cython__(self): # <<<<<<<<<<<<<<
  13865. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13866. * def __setstate_cython__(self, __pyx_state):
  13867. */
  13868. /* function exit code */
  13869. __pyx_L1_error:;
  13870. __Pyx_XDECREF(__pyx_t_1);
  13871. __Pyx_AddTraceback("gedlibpy.GEDEnv.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13872. __pyx_r = NULL;
  13873. __Pyx_XGIVEREF(__pyx_r);
  13874. __Pyx_RefNannyFinishContext();
  13875. return __pyx_r;
  13876. }
  13877. /* "(tree fragment)":3
  13878. * def __reduce_cython__(self):
  13879. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13880. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13881. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13882. */
  13883. /* Python wrapper */
  13884. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
  13885. static PyObject *__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  13886. PyObject *__pyx_r = 0;
  13887. __Pyx_RefNannyDeclarations
  13888. __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  13889. __pyx_r = __pyx_pf_8gedlibpy_6GEDEnv_130__setstate_cython__(((struct __pyx_obj_8gedlibpy_GEDEnv *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
  13890. /* function exit code */
  13891. __Pyx_RefNannyFinishContext();
  13892. return __pyx_r;
  13893. }
  13894. 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) {
  13895. PyObject *__pyx_r = NULL;
  13896. __Pyx_RefNannyDeclarations
  13897. PyObject *__pyx_t_1 = NULL;
  13898. __Pyx_RefNannySetupContext("__setstate_cython__", 0);
  13899. /* "(tree fragment)":4
  13900. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13901. * def __setstate_cython__(self, __pyx_state):
  13902. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  13903. */
  13904. __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)
  13905. __Pyx_GOTREF(__pyx_t_1);
  13906. __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  13907. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  13908. __PYX_ERR(1, 4, __pyx_L1_error)
  13909. /* "(tree fragment)":3
  13910. * def __reduce_cython__(self):
  13911. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13912. * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
  13913. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  13914. */
  13915. /* function exit code */
  13916. __pyx_L1_error:;
  13917. __Pyx_XDECREF(__pyx_t_1);
  13918. __Pyx_AddTraceback("gedlibpy.GEDEnv.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13919. __pyx_r = NULL;
  13920. __Pyx_XGIVEREF(__pyx_r);
  13921. __Pyx_RefNannyFinishContext();
  13922. return __pyx_r;
  13923. }
  13924. /* "gedlibpy.pyx":1400
  13925. * :type message: string
  13926. * """
  13927. * def __init__(self, message): # <<<<<<<<<<<<<<
  13928. * """
  13929. * Inits the error with its message.
  13930. */
  13931. /* Python wrapper */
  13932. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  13933. 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";
  13934. 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__};
  13935. static PyObject *__pyx_pw_8gedlibpy_13EditCostError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  13936. PyObject *__pyx_v_self = 0;
  13937. PyObject *__pyx_v_message = 0;
  13938. PyObject *__pyx_r = 0;
  13939. __Pyx_RefNannyDeclarations
  13940. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  13941. {
  13942. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  13943. PyObject* values[2] = {0,0};
  13944. if (unlikely(__pyx_kwds)) {
  13945. Py_ssize_t kw_args;
  13946. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  13947. switch (pos_args) {
  13948. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13949. CYTHON_FALLTHROUGH;
  13950. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13951. CYTHON_FALLTHROUGH;
  13952. case 0: break;
  13953. default: goto __pyx_L5_argtuple_error;
  13954. }
  13955. kw_args = PyDict_Size(__pyx_kwds);
  13956. switch (pos_args) {
  13957. case 0:
  13958. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  13959. else goto __pyx_L5_argtuple_error;
  13960. CYTHON_FALLTHROUGH;
  13961. case 1:
  13962. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  13963. else {
  13964. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1400, __pyx_L3_error)
  13965. }
  13966. }
  13967. if (unlikely(kw_args > 0)) {
  13968. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1400, __pyx_L3_error)
  13969. }
  13970. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  13971. goto __pyx_L5_argtuple_error;
  13972. } else {
  13973. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  13974. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  13975. }
  13976. __pyx_v_self = values[0];
  13977. __pyx_v_message = values[1];
  13978. }
  13979. goto __pyx_L4_argument_unpacking_done;
  13980. __pyx_L5_argtuple_error:;
  13981. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1400, __pyx_L3_error)
  13982. __pyx_L3_error:;
  13983. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  13984. __Pyx_RefNannyFinishContext();
  13985. return NULL;
  13986. __pyx_L4_argument_unpacking_done:;
  13987. __pyx_r = __pyx_pf_8gedlibpy_13EditCostError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  13988. /* function exit code */
  13989. __Pyx_RefNannyFinishContext();
  13990. return __pyx_r;
  13991. }
  13992. static PyObject *__pyx_pf_8gedlibpy_13EditCostError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  13993. PyObject *__pyx_r = NULL;
  13994. __Pyx_RefNannyDeclarations
  13995. __Pyx_RefNannySetupContext("__init__", 0);
  13996. /* "gedlibpy.pyx":1407
  13997. * :type message: string
  13998. * """
  13999. * self.message = message # <<<<<<<<<<<<<<
  14000. *
  14001. *
  14002. */
  14003. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1407, __pyx_L1_error)
  14004. /* "gedlibpy.pyx":1400
  14005. * :type message: string
  14006. * """
  14007. * def __init__(self, message): # <<<<<<<<<<<<<<
  14008. * """
  14009. * Inits the error with its message.
  14010. */
  14011. /* function exit code */
  14012. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14013. goto __pyx_L0;
  14014. __pyx_L1_error:;
  14015. __Pyx_AddTraceback("gedlibpy.EditCostError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14016. __pyx_r = NULL;
  14017. __pyx_L0:;
  14018. __Pyx_XGIVEREF(__pyx_r);
  14019. __Pyx_RefNannyFinishContext();
  14020. return __pyx_r;
  14021. }
  14022. /* "gedlibpy.pyx":1417
  14023. * :type message: string
  14024. * """
  14025. * def __init__(self, message): # <<<<<<<<<<<<<<
  14026. * """
  14027. * Inits the error with its message.
  14028. */
  14029. /* Python wrapper */
  14030. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  14031. 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";
  14032. 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__};
  14033. static PyObject *__pyx_pw_8gedlibpy_11MethodError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  14034. PyObject *__pyx_v_self = 0;
  14035. PyObject *__pyx_v_message = 0;
  14036. PyObject *__pyx_r = 0;
  14037. __Pyx_RefNannyDeclarations
  14038. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  14039. {
  14040. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  14041. PyObject* values[2] = {0,0};
  14042. if (unlikely(__pyx_kwds)) {
  14043. Py_ssize_t kw_args;
  14044. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  14045. switch (pos_args) {
  14046. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14047. CYTHON_FALLTHROUGH;
  14048. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14049. CYTHON_FALLTHROUGH;
  14050. case 0: break;
  14051. default: goto __pyx_L5_argtuple_error;
  14052. }
  14053. kw_args = PyDict_Size(__pyx_kwds);
  14054. switch (pos_args) {
  14055. case 0:
  14056. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  14057. else goto __pyx_L5_argtuple_error;
  14058. CYTHON_FALLTHROUGH;
  14059. case 1:
  14060. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  14061. else {
  14062. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1417, __pyx_L3_error)
  14063. }
  14064. }
  14065. if (unlikely(kw_args > 0)) {
  14066. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1417, __pyx_L3_error)
  14067. }
  14068. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  14069. goto __pyx_L5_argtuple_error;
  14070. } else {
  14071. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14072. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14073. }
  14074. __pyx_v_self = values[0];
  14075. __pyx_v_message = values[1];
  14076. }
  14077. goto __pyx_L4_argument_unpacking_done;
  14078. __pyx_L5_argtuple_error:;
  14079. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1417, __pyx_L3_error)
  14080. __pyx_L3_error:;
  14081. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14082. __Pyx_RefNannyFinishContext();
  14083. return NULL;
  14084. __pyx_L4_argument_unpacking_done:;
  14085. __pyx_r = __pyx_pf_8gedlibpy_11MethodError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  14086. /* function exit code */
  14087. __Pyx_RefNannyFinishContext();
  14088. return __pyx_r;
  14089. }
  14090. static PyObject *__pyx_pf_8gedlibpy_11MethodError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  14091. PyObject *__pyx_r = NULL;
  14092. __Pyx_RefNannyDeclarations
  14093. __Pyx_RefNannySetupContext("__init__", 0);
  14094. /* "gedlibpy.pyx":1424
  14095. * :type message: string
  14096. * """
  14097. * self.message = message # <<<<<<<<<<<<<<
  14098. *
  14099. *
  14100. */
  14101. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1424, __pyx_L1_error)
  14102. /* "gedlibpy.pyx":1417
  14103. * :type message: string
  14104. * """
  14105. * def __init__(self, message): # <<<<<<<<<<<<<<
  14106. * """
  14107. * Inits the error with its message.
  14108. */
  14109. /* function exit code */
  14110. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14111. goto __pyx_L0;
  14112. __pyx_L1_error:;
  14113. __Pyx_AddTraceback("gedlibpy.MethodError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14114. __pyx_r = NULL;
  14115. __pyx_L0:;
  14116. __Pyx_XGIVEREF(__pyx_r);
  14117. __Pyx_RefNannyFinishContext();
  14118. return __pyx_r;
  14119. }
  14120. /* "gedlibpy.pyx":1434
  14121. * :type message: string
  14122. * """
  14123. * def __init__(self, message): # <<<<<<<<<<<<<<
  14124. * """
  14125. * Inits the error with its message.
  14126. */
  14127. /* Python wrapper */
  14128. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
  14129. 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";
  14130. 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__};
  14131. static PyObject *__pyx_pw_8gedlibpy_9InitError_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  14132. PyObject *__pyx_v_self = 0;
  14133. PyObject *__pyx_v_message = 0;
  14134. PyObject *__pyx_r = 0;
  14135. __Pyx_RefNannyDeclarations
  14136. __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  14137. {
  14138. static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_message,0};
  14139. PyObject* values[2] = {0,0};
  14140. if (unlikely(__pyx_kwds)) {
  14141. Py_ssize_t kw_args;
  14142. const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
  14143. switch (pos_args) {
  14144. case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14145. CYTHON_FALLTHROUGH;
  14146. case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14147. CYTHON_FALLTHROUGH;
  14148. case 0: break;
  14149. default: goto __pyx_L5_argtuple_error;
  14150. }
  14151. kw_args = PyDict_Size(__pyx_kwds);
  14152. switch (pos_args) {
  14153. case 0:
  14154. if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
  14155. else goto __pyx_L5_argtuple_error;
  14156. CYTHON_FALLTHROUGH;
  14157. case 1:
  14158. if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_message)) != 0)) kw_args--;
  14159. else {
  14160. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 1434, __pyx_L3_error)
  14161. }
  14162. }
  14163. if (unlikely(kw_args > 0)) {
  14164. if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1434, __pyx_L3_error)
  14165. }
  14166. } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
  14167. goto __pyx_L5_argtuple_error;
  14168. } else {
  14169. values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
  14170. values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
  14171. }
  14172. __pyx_v_self = values[0];
  14173. __pyx_v_message = values[1];
  14174. }
  14175. goto __pyx_L4_argument_unpacking_done;
  14176. __pyx_L5_argtuple_error:;
  14177. __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1434, __pyx_L3_error)
  14178. __pyx_L3_error:;
  14179. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14180. __Pyx_RefNannyFinishContext();
  14181. return NULL;
  14182. __pyx_L4_argument_unpacking_done:;
  14183. __pyx_r = __pyx_pf_8gedlibpy_9InitError___init__(__pyx_self, __pyx_v_self, __pyx_v_message);
  14184. /* function exit code */
  14185. __Pyx_RefNannyFinishContext();
  14186. return __pyx_r;
  14187. }
  14188. static PyObject *__pyx_pf_8gedlibpy_9InitError___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_message) {
  14189. PyObject *__pyx_r = NULL;
  14190. __Pyx_RefNannyDeclarations
  14191. __Pyx_RefNannySetupContext("__init__", 0);
  14192. /* "gedlibpy.pyx":1441
  14193. * :type message: string
  14194. * """
  14195. * self.message = message # <<<<<<<<<<<<<<
  14196. *
  14197. *
  14198. */
  14199. if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_message, __pyx_v_message) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  14200. /* "gedlibpy.pyx":1434
  14201. * :type message: string
  14202. * """
  14203. * def __init__(self, message): # <<<<<<<<<<<<<<
  14204. * """
  14205. * Inits the error with its message.
  14206. */
  14207. /* function exit code */
  14208. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  14209. goto __pyx_L0;
  14210. __pyx_L1_error:;
  14211. __Pyx_AddTraceback("gedlibpy.InitError.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14212. __pyx_r = NULL;
  14213. __pyx_L0:;
  14214. __Pyx_XGIVEREF(__pyx_r);
  14215. __Pyx_RefNannyFinishContext();
  14216. return __pyx_r;
  14217. }
  14218. /* "gedlibpy.pyx":1448
  14219. * #########################################
  14220. *
  14221. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14222. * """
  14223. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14224. */
  14225. /* Python wrapper */
  14226. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u); /*proto*/
  14227. 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";
  14228. 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};
  14229. static PyObject *__pyx_pw_8gedlibpy_9encode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14230. PyObject *__pyx_r = 0;
  14231. __Pyx_RefNannyDeclarations
  14232. __Pyx_RefNannySetupContext("encode_your_map (wrapper)", 0);
  14233. __pyx_r = __pyx_pf_8gedlibpy_8encode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_u));
  14234. /* function exit code */
  14235. __Pyx_RefNannyFinishContext();
  14236. return __pyx_r;
  14237. }
  14238. static PyObject *__pyx_pf_8gedlibpy_8encode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_u) {
  14239. PyObject *__pyx_v_res = NULL;
  14240. PyObject *__pyx_v_key = NULL;
  14241. PyObject *__pyx_v_value = NULL;
  14242. PyObject *__pyx_r = NULL;
  14243. __Pyx_RefNannyDeclarations
  14244. PyObject *__pyx_t_1 = NULL;
  14245. Py_ssize_t __pyx_t_2;
  14246. Py_ssize_t __pyx_t_3;
  14247. int __pyx_t_4;
  14248. PyObject *__pyx_t_5 = NULL;
  14249. PyObject *__pyx_t_6 = NULL;
  14250. int __pyx_t_7;
  14251. PyObject *__pyx_t_8 = NULL;
  14252. PyObject *__pyx_t_9 = NULL;
  14253. __Pyx_RefNannySetupContext("encode_your_map", 0);
  14254. /* "gedlibpy.pyx":1460
  14255. *
  14256. * """
  14257. * res = {} # <<<<<<<<<<<<<<
  14258. * for key, value in map_u.items():
  14259. * res[key.encode('utf-8')] = value.encode('utf-8')
  14260. */
  14261. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1460, __pyx_L1_error)
  14262. __Pyx_GOTREF(__pyx_t_1);
  14263. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14264. __pyx_t_1 = 0;
  14265. /* "gedlibpy.pyx":1461
  14266. * """
  14267. * res = {}
  14268. * for key, value in map_u.items(): # <<<<<<<<<<<<<<
  14269. * res[key.encode('utf-8')] = value.encode('utf-8')
  14270. * return res
  14271. */
  14272. __pyx_t_2 = 0;
  14273. if (unlikely(__pyx_v_map_u == Py_None)) {
  14274. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14275. __PYX_ERR(0, 1461, __pyx_L1_error)
  14276. }
  14277. __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, 1461, __pyx_L1_error)
  14278. __Pyx_GOTREF(__pyx_t_5);
  14279. __Pyx_XDECREF(__pyx_t_1);
  14280. __pyx_t_1 = __pyx_t_5;
  14281. __pyx_t_5 = 0;
  14282. while (1) {
  14283. __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);
  14284. if (unlikely(__pyx_t_7 == 0)) break;
  14285. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1461, __pyx_L1_error)
  14286. __Pyx_GOTREF(__pyx_t_5);
  14287. __Pyx_GOTREF(__pyx_t_6);
  14288. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14289. __pyx_t_5 = 0;
  14290. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14291. __pyx_t_6 = 0;
  14292. /* "gedlibpy.pyx":1462
  14293. * res = {}
  14294. * for key, value in map_u.items():
  14295. * res[key.encode('utf-8')] = value.encode('utf-8') # <<<<<<<<<<<<<<
  14296. * return res
  14297. *
  14298. */
  14299. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __pyx_L1_error)
  14300. __Pyx_GOTREF(__pyx_t_5);
  14301. __pyx_t_8 = NULL;
  14302. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14303. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14304. if (likely(__pyx_t_8)) {
  14305. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14306. __Pyx_INCREF(__pyx_t_8);
  14307. __Pyx_INCREF(function);
  14308. __Pyx_DECREF_SET(__pyx_t_5, function);
  14309. }
  14310. }
  14311. __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);
  14312. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14313. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1462, __pyx_L1_error)
  14314. __Pyx_GOTREF(__pyx_t_6);
  14315. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14316. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_encode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1462, __pyx_L1_error)
  14317. __Pyx_GOTREF(__pyx_t_8);
  14318. __pyx_t_9 = NULL;
  14319. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14320. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14321. if (likely(__pyx_t_9)) {
  14322. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14323. __Pyx_INCREF(__pyx_t_9);
  14324. __Pyx_INCREF(function);
  14325. __Pyx_DECREF_SET(__pyx_t_8, function);
  14326. }
  14327. }
  14328. __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);
  14329. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14330. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1462, __pyx_L1_error)
  14331. __Pyx_GOTREF(__pyx_t_5);
  14332. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14333. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1462, __pyx_L1_error)
  14334. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14335. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14336. }
  14337. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14338. /* "gedlibpy.pyx":1463
  14339. * for key, value in map_u.items():
  14340. * res[key.encode('utf-8')] = value.encode('utf-8')
  14341. * return res # <<<<<<<<<<<<<<
  14342. *
  14343. *
  14344. */
  14345. __Pyx_XDECREF(__pyx_r);
  14346. __Pyx_INCREF(__pyx_v_res);
  14347. __pyx_r = __pyx_v_res;
  14348. goto __pyx_L0;
  14349. /* "gedlibpy.pyx":1448
  14350. * #########################################
  14351. *
  14352. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  14353. * """
  14354. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  14355. */
  14356. /* function exit code */
  14357. __pyx_L1_error:;
  14358. __Pyx_XDECREF(__pyx_t_1);
  14359. __Pyx_XDECREF(__pyx_t_5);
  14360. __Pyx_XDECREF(__pyx_t_6);
  14361. __Pyx_XDECREF(__pyx_t_8);
  14362. __Pyx_XDECREF(__pyx_t_9);
  14363. __Pyx_AddTraceback("gedlibpy.encode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14364. __pyx_r = NULL;
  14365. __pyx_L0:;
  14366. __Pyx_XDECREF(__pyx_v_res);
  14367. __Pyx_XDECREF(__pyx_v_key);
  14368. __Pyx_XDECREF(__pyx_v_value);
  14369. __Pyx_XGIVEREF(__pyx_r);
  14370. __Pyx_RefNannyFinishContext();
  14371. return __pyx_r;
  14372. }
  14373. /* "gedlibpy.pyx":1466
  14374. *
  14375. *
  14376. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14377. * """
  14378. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14379. */
  14380. /* Python wrapper */
  14381. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b); /*proto*/
  14382. 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";
  14383. 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};
  14384. static PyObject *__pyx_pw_8gedlibpy_11decode_your_map(PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14385. PyObject *__pyx_r = 0;
  14386. __Pyx_RefNannyDeclarations
  14387. __Pyx_RefNannySetupContext("decode_your_map (wrapper)", 0);
  14388. __pyx_r = __pyx_pf_8gedlibpy_10decode_your_map(__pyx_self, ((PyObject *)__pyx_v_map_b));
  14389. /* function exit code */
  14390. __Pyx_RefNannyFinishContext();
  14391. return __pyx_r;
  14392. }
  14393. static PyObject *__pyx_pf_8gedlibpy_10decode_your_map(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_b) {
  14394. PyObject *__pyx_v_res = NULL;
  14395. PyObject *__pyx_v_key = NULL;
  14396. PyObject *__pyx_v_value = NULL;
  14397. PyObject *__pyx_r = NULL;
  14398. __Pyx_RefNannyDeclarations
  14399. PyObject *__pyx_t_1 = NULL;
  14400. Py_ssize_t __pyx_t_2;
  14401. Py_ssize_t __pyx_t_3;
  14402. int __pyx_t_4;
  14403. PyObject *__pyx_t_5 = NULL;
  14404. PyObject *__pyx_t_6 = NULL;
  14405. int __pyx_t_7;
  14406. PyObject *__pyx_t_8 = NULL;
  14407. PyObject *__pyx_t_9 = NULL;
  14408. __Pyx_RefNannySetupContext("decode_your_map", 0);
  14409. /* "gedlibpy.pyx":1478
  14410. *
  14411. * """
  14412. * res = {} # <<<<<<<<<<<<<<
  14413. * for key, value in map_b.items():
  14414. * res[key.decode('utf-8')] = value.decode('utf-8')
  14415. */
  14416. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1478, __pyx_L1_error)
  14417. __Pyx_GOTREF(__pyx_t_1);
  14418. __pyx_v_res = ((PyObject*)__pyx_t_1);
  14419. __pyx_t_1 = 0;
  14420. /* "gedlibpy.pyx":1479
  14421. * """
  14422. * res = {}
  14423. * for key, value in map_b.items(): # <<<<<<<<<<<<<<
  14424. * res[key.decode('utf-8')] = value.decode('utf-8')
  14425. * return res
  14426. */
  14427. __pyx_t_2 = 0;
  14428. if (unlikely(__pyx_v_map_b == Py_None)) {
  14429. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14430. __PYX_ERR(0, 1479, __pyx_L1_error)
  14431. }
  14432. __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, 1479, __pyx_L1_error)
  14433. __Pyx_GOTREF(__pyx_t_5);
  14434. __Pyx_XDECREF(__pyx_t_1);
  14435. __pyx_t_1 = __pyx_t_5;
  14436. __pyx_t_5 = 0;
  14437. while (1) {
  14438. __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);
  14439. if (unlikely(__pyx_t_7 == 0)) break;
  14440. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1479, __pyx_L1_error)
  14441. __Pyx_GOTREF(__pyx_t_5);
  14442. __Pyx_GOTREF(__pyx_t_6);
  14443. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14444. __pyx_t_5 = 0;
  14445. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14446. __pyx_t_6 = 0;
  14447. /* "gedlibpy.pyx":1480
  14448. * res = {}
  14449. * for key, value in map_b.items():
  14450. * res[key.decode('utf-8')] = value.decode('utf-8') # <<<<<<<<<<<<<<
  14451. * return res
  14452. *
  14453. */
  14454. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_value, __pyx_n_s_decode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error)
  14455. __Pyx_GOTREF(__pyx_t_5);
  14456. __pyx_t_8 = NULL;
  14457. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
  14458. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14459. if (likely(__pyx_t_8)) {
  14460. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14461. __Pyx_INCREF(__pyx_t_8);
  14462. __Pyx_INCREF(function);
  14463. __Pyx_DECREF_SET(__pyx_t_5, function);
  14464. }
  14465. }
  14466. __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);
  14467. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14468. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1480, __pyx_L1_error)
  14469. __Pyx_GOTREF(__pyx_t_6);
  14470. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14471. __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_decode); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1480, __pyx_L1_error)
  14472. __Pyx_GOTREF(__pyx_t_8);
  14473. __pyx_t_9 = NULL;
  14474. if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
  14475. __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
  14476. if (likely(__pyx_t_9)) {
  14477. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
  14478. __Pyx_INCREF(__pyx_t_9);
  14479. __Pyx_INCREF(function);
  14480. __Pyx_DECREF_SET(__pyx_t_8, function);
  14481. }
  14482. }
  14483. __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);
  14484. __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
  14485. if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1480, __pyx_L1_error)
  14486. __Pyx_GOTREF(__pyx_t_5);
  14487. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  14488. if (unlikely(PyDict_SetItem(__pyx_v_res, __pyx_t_5, __pyx_t_6) < 0)) __PYX_ERR(0, 1480, __pyx_L1_error)
  14489. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14490. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14491. }
  14492. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14493. /* "gedlibpy.pyx":1481
  14494. * for key, value in map_b.items():
  14495. * res[key.decode('utf-8')] = value.decode('utf-8')
  14496. * return res # <<<<<<<<<<<<<<
  14497. *
  14498. *
  14499. */
  14500. __Pyx_XDECREF(__pyx_r);
  14501. __Pyx_INCREF(__pyx_v_res);
  14502. __pyx_r = __pyx_v_res;
  14503. goto __pyx_L0;
  14504. /* "gedlibpy.pyx":1466
  14505. *
  14506. *
  14507. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  14508. * """
  14509. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  14510. */
  14511. /* function exit code */
  14512. __pyx_L1_error:;
  14513. __Pyx_XDECREF(__pyx_t_1);
  14514. __Pyx_XDECREF(__pyx_t_5);
  14515. __Pyx_XDECREF(__pyx_t_6);
  14516. __Pyx_XDECREF(__pyx_t_8);
  14517. __Pyx_XDECREF(__pyx_t_9);
  14518. __Pyx_AddTraceback("gedlibpy.decode_your_map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14519. __pyx_r = NULL;
  14520. __pyx_L0:;
  14521. __Pyx_XDECREF(__pyx_v_res);
  14522. __Pyx_XDECREF(__pyx_v_key);
  14523. __Pyx_XDECREF(__pyx_v_value);
  14524. __Pyx_XGIVEREF(__pyx_r);
  14525. __Pyx_RefNannyFinishContext();
  14526. return __pyx_r;
  14527. }
  14528. /* "gedlibpy.pyx":1484
  14529. *
  14530. *
  14531. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14532. * """
  14533. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14534. */
  14535. /* Python wrapper */
  14536. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b); /*proto*/
  14537. 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";
  14538. 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};
  14539. static PyObject *__pyx_pw_8gedlibpy_13decode_graph_edges(PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14540. PyObject *__pyx_r = 0;
  14541. __Pyx_RefNannyDeclarations
  14542. __Pyx_RefNannySetupContext("decode_graph_edges (wrapper)", 0);
  14543. __pyx_r = __pyx_pf_8gedlibpy_12decode_graph_edges(__pyx_self, ((PyObject *)__pyx_v_map_edge_b));
  14544. /* function exit code */
  14545. __Pyx_RefNannyFinishContext();
  14546. return __pyx_r;
  14547. }
  14548. static PyObject *__pyx_pf_8gedlibpy_12decode_graph_edges(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_map_edge_b) {
  14549. PyObject *__pyx_v_map_edges = NULL;
  14550. PyObject *__pyx_v_key = NULL;
  14551. PyObject *__pyx_v_value = NULL;
  14552. PyObject *__pyx_r = NULL;
  14553. __Pyx_RefNannyDeclarations
  14554. PyObject *__pyx_t_1 = NULL;
  14555. Py_ssize_t __pyx_t_2;
  14556. Py_ssize_t __pyx_t_3;
  14557. int __pyx_t_4;
  14558. PyObject *__pyx_t_5 = NULL;
  14559. PyObject *__pyx_t_6 = NULL;
  14560. int __pyx_t_7;
  14561. PyObject *__pyx_t_8 = NULL;
  14562. __Pyx_RefNannySetupContext("decode_graph_edges", 0);
  14563. /* "gedlibpy.pyx":1502
  14564. * This is a helper function for function `GEDEnv.get_graph_edges()`.
  14565. * """
  14566. * map_edges = {} # <<<<<<<<<<<<<<
  14567. * for key, value in map_edge_b.items():
  14568. * map_edges[key] = decode_your_map(value)
  14569. */
  14570. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1502, __pyx_L1_error)
  14571. __Pyx_GOTREF(__pyx_t_1);
  14572. __pyx_v_map_edges = ((PyObject*)__pyx_t_1);
  14573. __pyx_t_1 = 0;
  14574. /* "gedlibpy.pyx":1503
  14575. * """
  14576. * map_edges = {}
  14577. * for key, value in map_edge_b.items(): # <<<<<<<<<<<<<<
  14578. * map_edges[key] = decode_your_map(value)
  14579. * return map_edges
  14580. */
  14581. __pyx_t_2 = 0;
  14582. if (unlikely(__pyx_v_map_edge_b == Py_None)) {
  14583. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
  14584. __PYX_ERR(0, 1503, __pyx_L1_error)
  14585. }
  14586. __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, 1503, __pyx_L1_error)
  14587. __Pyx_GOTREF(__pyx_t_5);
  14588. __Pyx_XDECREF(__pyx_t_1);
  14589. __pyx_t_1 = __pyx_t_5;
  14590. __pyx_t_5 = 0;
  14591. while (1) {
  14592. __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);
  14593. if (unlikely(__pyx_t_7 == 0)) break;
  14594. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 1503, __pyx_L1_error)
  14595. __Pyx_GOTREF(__pyx_t_5);
  14596. __Pyx_GOTREF(__pyx_t_6);
  14597. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  14598. __pyx_t_5 = 0;
  14599. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  14600. __pyx_t_6 = 0;
  14601. /* "gedlibpy.pyx":1504
  14602. * map_edges = {}
  14603. * for key, value in map_edge_b.items():
  14604. * map_edges[key] = decode_your_map(value) # <<<<<<<<<<<<<<
  14605. * return map_edges
  14606. *
  14607. */
  14608. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_decode_your_map); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1504, __pyx_L1_error)
  14609. __Pyx_GOTREF(__pyx_t_5);
  14610. __pyx_t_8 = NULL;
  14611. if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
  14612. __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
  14613. if (likely(__pyx_t_8)) {
  14614. PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
  14615. __Pyx_INCREF(__pyx_t_8);
  14616. __Pyx_INCREF(function);
  14617. __Pyx_DECREF_SET(__pyx_t_5, function);
  14618. }
  14619. }
  14620. __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);
  14621. __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  14622. if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1504, __pyx_L1_error)
  14623. __Pyx_GOTREF(__pyx_t_6);
  14624. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  14625. if (unlikely(PyDict_SetItem(__pyx_v_map_edges, __pyx_v_key, __pyx_t_6) < 0)) __PYX_ERR(0, 1504, __pyx_L1_error)
  14626. __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  14627. }
  14628. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  14629. /* "gedlibpy.pyx":1505
  14630. * for key, value in map_edge_b.items():
  14631. * map_edges[key] = decode_your_map(value)
  14632. * return map_edges # <<<<<<<<<<<<<<
  14633. *
  14634. *
  14635. */
  14636. __Pyx_XDECREF(__pyx_r);
  14637. __Pyx_INCREF(__pyx_v_map_edges);
  14638. __pyx_r = __pyx_v_map_edges;
  14639. goto __pyx_L0;
  14640. /* "gedlibpy.pyx":1484
  14641. *
  14642. *
  14643. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  14644. * """
  14645. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  14646. */
  14647. /* function exit code */
  14648. __pyx_L1_error:;
  14649. __Pyx_XDECREF(__pyx_t_1);
  14650. __Pyx_XDECREF(__pyx_t_5);
  14651. __Pyx_XDECREF(__pyx_t_6);
  14652. __Pyx_XDECREF(__pyx_t_8);
  14653. __Pyx_AddTraceback("gedlibpy.decode_graph_edges", __pyx_clineno, __pyx_lineno, __pyx_filename);
  14654. __pyx_r = NULL;
  14655. __pyx_L0:;
  14656. __Pyx_XDECREF(__pyx_v_map_edges);
  14657. __Pyx_XDECREF(__pyx_v_key);
  14658. __Pyx_XDECREF(__pyx_v_value);
  14659. __Pyx_XGIVEREF(__pyx_r);
  14660. __Pyx_RefNannyFinishContext();
  14661. return __pyx_r;
  14662. }
  14663. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  14664. * # experimental exception made for __getbuffer__ and __releasebuffer__
  14665. * # -- the details of this may change.
  14666. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  14667. * # This implementation of getbuffer is geared towards Cython
  14668. * # requirements, and does not yet fulfill the PEP.
  14669. */
  14670. /* Python wrapper */
  14671. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
  14672. static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14673. int __pyx_r;
  14674. __Pyx_RefNannyDeclarations
  14675. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  14676. __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  14677. /* function exit code */
  14678. __Pyx_RefNannyFinishContext();
  14679. return __pyx_r;
  14680. }
  14681. static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  14682. int __pyx_v_i;
  14683. int __pyx_v_ndim;
  14684. int __pyx_v_endian_detector;
  14685. int __pyx_v_little_endian;
  14686. int __pyx_v_t;
  14687. char *__pyx_v_f;
  14688. PyArray_Descr *__pyx_v_descr = 0;
  14689. int __pyx_v_offset;
  14690. int __pyx_r;
  14691. __Pyx_RefNannyDeclarations
  14692. int __pyx_t_1;
  14693. int __pyx_t_2;
  14694. PyObject *__pyx_t_3 = NULL;
  14695. int __pyx_t_4;
  14696. int __pyx_t_5;
  14697. int __pyx_t_6;
  14698. PyArray_Descr *__pyx_t_7;
  14699. PyObject *__pyx_t_8 = NULL;
  14700. char *__pyx_t_9;
  14701. if (__pyx_v_info == NULL) {
  14702. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  14703. return -1;
  14704. }
  14705. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  14706. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  14707. __Pyx_GIVEREF(__pyx_v_info->obj);
  14708. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":265
  14709. *
  14710. * cdef int i, ndim
  14711. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  14712. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14713. *
  14714. */
  14715. __pyx_v_endian_detector = 1;
  14716. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":266
  14717. * cdef int i, ndim
  14718. * cdef int endian_detector = 1
  14719. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  14720. *
  14721. * ndim = PyArray_NDIM(self)
  14722. */
  14723. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  14724. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":268
  14725. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  14726. *
  14727. * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
  14728. *
  14729. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14730. */
  14731. __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
  14732. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14733. * ndim = PyArray_NDIM(self)
  14734. *
  14735. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14736. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14737. * raise ValueError(u"ndarray is not C contiguous")
  14738. */
  14739. __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
  14740. if (__pyx_t_2) {
  14741. } else {
  14742. __pyx_t_1 = __pyx_t_2;
  14743. goto __pyx_L4_bool_binop_done;
  14744. }
  14745. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":271
  14746. *
  14747. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14748. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14749. * raise ValueError(u"ndarray is not C contiguous")
  14750. *
  14751. */
  14752. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_C_CONTIGUOUS) != 0)) != 0);
  14753. __pyx_t_1 = __pyx_t_2;
  14754. __pyx_L4_bool_binop_done:;
  14755. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14756. * ndim = PyArray_NDIM(self)
  14757. *
  14758. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14759. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14760. * raise ValueError(u"ndarray is not C contiguous")
  14761. */
  14762. if (unlikely(__pyx_t_1)) {
  14763. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  14764. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  14765. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14766. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  14767. *
  14768. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14769. */
  14770. __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)
  14771. __Pyx_GOTREF(__pyx_t_3);
  14772. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14773. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14774. __PYX_ERR(2, 272, __pyx_L1_error)
  14775. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":270
  14776. * ndim = PyArray_NDIM(self)
  14777. *
  14778. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
  14779. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  14780. * raise ValueError(u"ndarray is not C contiguous")
  14781. */
  14782. }
  14783. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14784. * raise ValueError(u"ndarray is not C contiguous")
  14785. *
  14786. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14787. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14788. * raise ValueError(u"ndarray is not Fortran contiguous")
  14789. */
  14790. __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
  14791. if (__pyx_t_2) {
  14792. } else {
  14793. __pyx_t_1 = __pyx_t_2;
  14794. goto __pyx_L7_bool_binop_done;
  14795. }
  14796. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":275
  14797. *
  14798. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14799. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
  14800. * raise ValueError(u"ndarray is not Fortran contiguous")
  14801. *
  14802. */
  14803. __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_ARRAY_F_CONTIGUOUS) != 0)) != 0);
  14804. __pyx_t_1 = __pyx_t_2;
  14805. __pyx_L7_bool_binop_done:;
  14806. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14807. * raise ValueError(u"ndarray is not C contiguous")
  14808. *
  14809. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14810. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14811. * raise ValueError(u"ndarray is not Fortran contiguous")
  14812. */
  14813. if (unlikely(__pyx_t_1)) {
  14814. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  14815. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  14816. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14817. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  14818. *
  14819. * info.buf = PyArray_DATA(self)
  14820. */
  14821. __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)
  14822. __Pyx_GOTREF(__pyx_t_3);
  14823. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  14824. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  14825. __PYX_ERR(2, 276, __pyx_L1_error)
  14826. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":274
  14827. * raise ValueError(u"ndarray is not C contiguous")
  14828. *
  14829. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
  14830. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  14831. * raise ValueError(u"ndarray is not Fortran contiguous")
  14832. */
  14833. }
  14834. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":278
  14835. * raise ValueError(u"ndarray is not Fortran contiguous")
  14836. *
  14837. * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
  14838. * info.ndim = ndim
  14839. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14840. */
  14841. __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
  14842. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":279
  14843. *
  14844. * info.buf = PyArray_DATA(self)
  14845. * info.ndim = ndim # <<<<<<<<<<<<<<
  14846. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  14847. * # Allocate new buffer for strides and shape info.
  14848. */
  14849. __pyx_v_info->ndim = __pyx_v_ndim;
  14850. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14851. * info.buf = PyArray_DATA(self)
  14852. * info.ndim = ndim
  14853. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14854. * # Allocate new buffer for strides and shape info.
  14855. * # This is allocated as one block, strides first.
  14856. */
  14857. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  14858. if (__pyx_t_1) {
  14859. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":283
  14860. * # Allocate new buffer for strides and shape info.
  14861. * # This is allocated as one block, strides first.
  14862. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
  14863. * info.shape = info.strides + ndim
  14864. * for i in range(ndim):
  14865. */
  14866. __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
  14867. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":284
  14868. * # This is allocated as one block, strides first.
  14869. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14870. * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
  14871. * for i in range(ndim):
  14872. * info.strides[i] = PyArray_STRIDES(self)[i]
  14873. */
  14874. __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
  14875. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":285
  14876. * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
  14877. * info.shape = info.strides + ndim
  14878. * for i in range(ndim): # <<<<<<<<<<<<<<
  14879. * info.strides[i] = PyArray_STRIDES(self)[i]
  14880. * info.shape[i] = PyArray_DIMS(self)[i]
  14881. */
  14882. __pyx_t_4 = __pyx_v_ndim;
  14883. __pyx_t_5 = __pyx_t_4;
  14884. for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
  14885. __pyx_v_i = __pyx_t_6;
  14886. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":286
  14887. * info.shape = info.strides + ndim
  14888. * for i in range(ndim):
  14889. * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
  14890. * info.shape[i] = PyArray_DIMS(self)[i]
  14891. * else:
  14892. */
  14893. (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
  14894. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":287
  14895. * for i in range(ndim):
  14896. * info.strides[i] = PyArray_STRIDES(self)[i]
  14897. * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
  14898. * else:
  14899. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14900. */
  14901. (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
  14902. }
  14903. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":280
  14904. * info.buf = PyArray_DATA(self)
  14905. * info.ndim = ndim
  14906. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  14907. * # Allocate new buffer for strides and shape info.
  14908. * # This is allocated as one block, strides first.
  14909. */
  14910. goto __pyx_L9;
  14911. }
  14912. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":289
  14913. * info.shape[i] = PyArray_DIMS(self)[i]
  14914. * else:
  14915. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
  14916. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14917. * info.suboffsets = NULL
  14918. */
  14919. /*else*/ {
  14920. __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
  14921. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":290
  14922. * else:
  14923. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14924. * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
  14925. * info.suboffsets = NULL
  14926. * info.itemsize = PyArray_ITEMSIZE(self)
  14927. */
  14928. __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
  14929. }
  14930. __pyx_L9:;
  14931. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":291
  14932. * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
  14933. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14934. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  14935. * info.itemsize = PyArray_ITEMSIZE(self)
  14936. * info.readonly = not PyArray_ISWRITEABLE(self)
  14937. */
  14938. __pyx_v_info->suboffsets = NULL;
  14939. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":292
  14940. * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
  14941. * info.suboffsets = NULL
  14942. * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
  14943. * info.readonly = not PyArray_ISWRITEABLE(self)
  14944. *
  14945. */
  14946. __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
  14947. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":293
  14948. * info.suboffsets = NULL
  14949. * info.itemsize = PyArray_ITEMSIZE(self)
  14950. * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
  14951. *
  14952. * cdef int t
  14953. */
  14954. __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
  14955. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":296
  14956. *
  14957. * cdef int t
  14958. * cdef char* f = NULL # <<<<<<<<<<<<<<
  14959. * cdef dtype descr = <dtype>PyArray_DESCR(self)
  14960. * cdef int offset
  14961. */
  14962. __pyx_v_f = NULL;
  14963. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":297
  14964. * cdef int t
  14965. * cdef char* f = NULL
  14966. * cdef dtype descr = <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
  14967. * cdef int offset
  14968. *
  14969. */
  14970. __pyx_t_7 = PyArray_DESCR(__pyx_v_self);
  14971. __pyx_t_3 = ((PyObject *)__pyx_t_7);
  14972. __Pyx_INCREF(__pyx_t_3);
  14973. __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
  14974. __pyx_t_3 = 0;
  14975. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":300
  14976. * cdef int offset
  14977. *
  14978. * info.obj = self # <<<<<<<<<<<<<<
  14979. *
  14980. * if not PyDataType_HASFIELDS(descr):
  14981. */
  14982. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  14983. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  14984. __Pyx_GOTREF(__pyx_v_info->obj);
  14985. __Pyx_DECREF(__pyx_v_info->obj);
  14986. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  14987. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  14988. * info.obj = self
  14989. *
  14990. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  14991. * t = descr.type_num
  14992. * if ((descr.byteorder == c'>' and little_endian) or
  14993. */
  14994. __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
  14995. if (__pyx_t_1) {
  14996. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":303
  14997. *
  14998. * if not PyDataType_HASFIELDS(descr):
  14999. * t = descr.type_num # <<<<<<<<<<<<<<
  15000. * if ((descr.byteorder == c'>' and little_endian) or
  15001. * (descr.byteorder == c'<' and not little_endian)):
  15002. */
  15003. __pyx_t_4 = __pyx_v_descr->type_num;
  15004. __pyx_v_t = __pyx_t_4;
  15005. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15006. * if not PyDataType_HASFIELDS(descr):
  15007. * t = descr.type_num
  15008. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15009. * (descr.byteorder == c'<' and not little_endian)):
  15010. * raise ValueError(u"Non-native byte order not supported")
  15011. */
  15012. __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
  15013. if (!__pyx_t_2) {
  15014. goto __pyx_L15_next_or;
  15015. } else {
  15016. }
  15017. __pyx_t_2 = (__pyx_v_little_endian != 0);
  15018. if (!__pyx_t_2) {
  15019. } else {
  15020. __pyx_t_1 = __pyx_t_2;
  15021. goto __pyx_L14_bool_binop_done;
  15022. }
  15023. __pyx_L15_next_or:;
  15024. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":305
  15025. * t = descr.type_num
  15026. * if ((descr.byteorder == c'>' and little_endian) or
  15027. * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15028. * raise ValueError(u"Non-native byte order not supported")
  15029. * if t == NPY_BYTE: f = "b"
  15030. */
  15031. __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
  15032. if (__pyx_t_2) {
  15033. } else {
  15034. __pyx_t_1 = __pyx_t_2;
  15035. goto __pyx_L14_bool_binop_done;
  15036. }
  15037. __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
  15038. __pyx_t_1 = __pyx_t_2;
  15039. __pyx_L14_bool_binop_done:;
  15040. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15041. * if not PyDataType_HASFIELDS(descr):
  15042. * t = descr.type_num
  15043. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15044. * (descr.byteorder == c'<' and not little_endian)):
  15045. * raise ValueError(u"Non-native byte order not supported")
  15046. */
  15047. if (unlikely(__pyx_t_1)) {
  15048. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  15049. * if ((descr.byteorder == c'>' and little_endian) or
  15050. * (descr.byteorder == c'<' and not little_endian)):
  15051. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15052. * if t == NPY_BYTE: f = "b"
  15053. * elif t == NPY_UBYTE: f = "B"
  15054. */
  15055. __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)
  15056. __Pyx_GOTREF(__pyx_t_3);
  15057. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15058. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15059. __PYX_ERR(2, 306, __pyx_L1_error)
  15060. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":304
  15061. * if not PyDataType_HASFIELDS(descr):
  15062. * t = descr.type_num
  15063. * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15064. * (descr.byteorder == c'<' and not little_endian)):
  15065. * raise ValueError(u"Non-native byte order not supported")
  15066. */
  15067. }
  15068. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":307
  15069. * (descr.byteorder == c'<' and not little_endian)):
  15070. * raise ValueError(u"Non-native byte order not supported")
  15071. * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
  15072. * elif t == NPY_UBYTE: f = "B"
  15073. * elif t == NPY_SHORT: f = "h"
  15074. */
  15075. switch (__pyx_v_t) {
  15076. case NPY_BYTE:
  15077. __pyx_v_f = ((char *)"b");
  15078. break;
  15079. case NPY_UBYTE:
  15080. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":308
  15081. * raise ValueError(u"Non-native byte order not supported")
  15082. * if t == NPY_BYTE: f = "b"
  15083. * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
  15084. * elif t == NPY_SHORT: f = "h"
  15085. * elif t == NPY_USHORT: f = "H"
  15086. */
  15087. __pyx_v_f = ((char *)"B");
  15088. break;
  15089. case NPY_SHORT:
  15090. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":309
  15091. * if t == NPY_BYTE: f = "b"
  15092. * elif t == NPY_UBYTE: f = "B"
  15093. * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
  15094. * elif t == NPY_USHORT: f = "H"
  15095. * elif t == NPY_INT: f = "i"
  15096. */
  15097. __pyx_v_f = ((char *)"h");
  15098. break;
  15099. case NPY_USHORT:
  15100. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":310
  15101. * elif t == NPY_UBYTE: f = "B"
  15102. * elif t == NPY_SHORT: f = "h"
  15103. * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
  15104. * elif t == NPY_INT: f = "i"
  15105. * elif t == NPY_UINT: f = "I"
  15106. */
  15107. __pyx_v_f = ((char *)"H");
  15108. break;
  15109. case NPY_INT:
  15110. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":311
  15111. * elif t == NPY_SHORT: f = "h"
  15112. * elif t == NPY_USHORT: f = "H"
  15113. * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
  15114. * elif t == NPY_UINT: f = "I"
  15115. * elif t == NPY_LONG: f = "l"
  15116. */
  15117. __pyx_v_f = ((char *)"i");
  15118. break;
  15119. case NPY_UINT:
  15120. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":312
  15121. * elif t == NPY_USHORT: f = "H"
  15122. * elif t == NPY_INT: f = "i"
  15123. * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
  15124. * elif t == NPY_LONG: f = "l"
  15125. * elif t == NPY_ULONG: f = "L"
  15126. */
  15127. __pyx_v_f = ((char *)"I");
  15128. break;
  15129. case NPY_LONG:
  15130. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":313
  15131. * elif t == NPY_INT: f = "i"
  15132. * elif t == NPY_UINT: f = "I"
  15133. * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
  15134. * elif t == NPY_ULONG: f = "L"
  15135. * elif t == NPY_LONGLONG: f = "q"
  15136. */
  15137. __pyx_v_f = ((char *)"l");
  15138. break;
  15139. case NPY_ULONG:
  15140. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":314
  15141. * elif t == NPY_UINT: f = "I"
  15142. * elif t == NPY_LONG: f = "l"
  15143. * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
  15144. * elif t == NPY_LONGLONG: f = "q"
  15145. * elif t == NPY_ULONGLONG: f = "Q"
  15146. */
  15147. __pyx_v_f = ((char *)"L");
  15148. break;
  15149. case NPY_LONGLONG:
  15150. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":315
  15151. * elif t == NPY_LONG: f = "l"
  15152. * elif t == NPY_ULONG: f = "L"
  15153. * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
  15154. * elif t == NPY_ULONGLONG: f = "Q"
  15155. * elif t == NPY_FLOAT: f = "f"
  15156. */
  15157. __pyx_v_f = ((char *)"q");
  15158. break;
  15159. case NPY_ULONGLONG:
  15160. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":316
  15161. * elif t == NPY_ULONG: f = "L"
  15162. * elif t == NPY_LONGLONG: f = "q"
  15163. * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
  15164. * elif t == NPY_FLOAT: f = "f"
  15165. * elif t == NPY_DOUBLE: f = "d"
  15166. */
  15167. __pyx_v_f = ((char *)"Q");
  15168. break;
  15169. case NPY_FLOAT:
  15170. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":317
  15171. * elif t == NPY_LONGLONG: f = "q"
  15172. * elif t == NPY_ULONGLONG: f = "Q"
  15173. * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
  15174. * elif t == NPY_DOUBLE: f = "d"
  15175. * elif t == NPY_LONGDOUBLE: f = "g"
  15176. */
  15177. __pyx_v_f = ((char *)"f");
  15178. break;
  15179. case NPY_DOUBLE:
  15180. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":318
  15181. * elif t == NPY_ULONGLONG: f = "Q"
  15182. * elif t == NPY_FLOAT: f = "f"
  15183. * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
  15184. * elif t == NPY_LONGDOUBLE: f = "g"
  15185. * elif t == NPY_CFLOAT: f = "Zf"
  15186. */
  15187. __pyx_v_f = ((char *)"d");
  15188. break;
  15189. case NPY_LONGDOUBLE:
  15190. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":319
  15191. * elif t == NPY_FLOAT: f = "f"
  15192. * elif t == NPY_DOUBLE: f = "d"
  15193. * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
  15194. * elif t == NPY_CFLOAT: f = "Zf"
  15195. * elif t == NPY_CDOUBLE: f = "Zd"
  15196. */
  15197. __pyx_v_f = ((char *)"g");
  15198. break;
  15199. case NPY_CFLOAT:
  15200. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":320
  15201. * elif t == NPY_DOUBLE: f = "d"
  15202. * elif t == NPY_LONGDOUBLE: f = "g"
  15203. * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
  15204. * elif t == NPY_CDOUBLE: f = "Zd"
  15205. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15206. */
  15207. __pyx_v_f = ((char *)"Zf");
  15208. break;
  15209. case NPY_CDOUBLE:
  15210. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":321
  15211. * elif t == NPY_LONGDOUBLE: f = "g"
  15212. * elif t == NPY_CFLOAT: f = "Zf"
  15213. * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
  15214. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15215. * elif t == NPY_OBJECT: f = "O"
  15216. */
  15217. __pyx_v_f = ((char *)"Zd");
  15218. break;
  15219. case NPY_CLONGDOUBLE:
  15220. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":322
  15221. * elif t == NPY_CFLOAT: f = "Zf"
  15222. * elif t == NPY_CDOUBLE: f = "Zd"
  15223. * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
  15224. * elif t == NPY_OBJECT: f = "O"
  15225. * else:
  15226. */
  15227. __pyx_v_f = ((char *)"Zg");
  15228. break;
  15229. case NPY_OBJECT:
  15230. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":323
  15231. * elif t == NPY_CDOUBLE: f = "Zd"
  15232. * elif t == NPY_CLONGDOUBLE: f = "Zg"
  15233. * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
  15234. * else:
  15235. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15236. */
  15237. __pyx_v_f = ((char *)"O");
  15238. break;
  15239. default:
  15240. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":325
  15241. * elif t == NPY_OBJECT: f = "O"
  15242. * else:
  15243. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  15244. * info.format = f
  15245. * return
  15246. */
  15247. __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15248. __Pyx_GOTREF(__pyx_t_3);
  15249. __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)
  15250. __Pyx_GOTREF(__pyx_t_8);
  15251. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15252. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_8); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 325, __pyx_L1_error)
  15253. __Pyx_GOTREF(__pyx_t_3);
  15254. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  15255. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15256. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15257. __PYX_ERR(2, 325, __pyx_L1_error)
  15258. break;
  15259. }
  15260. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":326
  15261. * else:
  15262. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15263. * info.format = f # <<<<<<<<<<<<<<
  15264. * return
  15265. * else:
  15266. */
  15267. __pyx_v_info->format = __pyx_v_f;
  15268. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":327
  15269. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  15270. * info.format = f
  15271. * return # <<<<<<<<<<<<<<
  15272. * else:
  15273. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15274. */
  15275. __pyx_r = 0;
  15276. goto __pyx_L0;
  15277. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":302
  15278. * info.obj = self
  15279. *
  15280. * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
  15281. * t = descr.type_num
  15282. * if ((descr.byteorder == c'>' and little_endian) or
  15283. */
  15284. }
  15285. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":329
  15286. * return
  15287. * else:
  15288. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
  15289. * info.format[0] = c'^' # Native data types, manual alignment
  15290. * offset = 0
  15291. */
  15292. /*else*/ {
  15293. __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
  15294. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":330
  15295. * else:
  15296. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15297. * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
  15298. * offset = 0
  15299. * f = _util_dtypestring(descr, info.format + 1,
  15300. */
  15301. (__pyx_v_info->format[0]) = '^';
  15302. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":331
  15303. * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
  15304. * info.format[0] = c'^' # Native data types, manual alignment
  15305. * offset = 0 # <<<<<<<<<<<<<<
  15306. * f = _util_dtypestring(descr, info.format + 1,
  15307. * info.format + _buffer_format_string_len,
  15308. */
  15309. __pyx_v_offset = 0;
  15310. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":332
  15311. * info.format[0] = c'^' # Native data types, manual alignment
  15312. * offset = 0
  15313. * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
  15314. * info.format + _buffer_format_string_len,
  15315. * &offset)
  15316. */
  15317. __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)
  15318. __pyx_v_f = __pyx_t_9;
  15319. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":335
  15320. * info.format + _buffer_format_string_len,
  15321. * &offset)
  15322. * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
  15323. *
  15324. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15325. */
  15326. (__pyx_v_f[0]) = '\x00';
  15327. }
  15328. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":258
  15329. * # experimental exception made for __getbuffer__ and __releasebuffer__
  15330. * # -- the details of this may change.
  15331. * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  15332. * # This implementation of getbuffer is geared towards Cython
  15333. * # requirements, and does not yet fulfill the PEP.
  15334. */
  15335. /* function exit code */
  15336. __pyx_r = 0;
  15337. goto __pyx_L0;
  15338. __pyx_L1_error:;
  15339. __Pyx_XDECREF(__pyx_t_3);
  15340. __Pyx_XDECREF(__pyx_t_8);
  15341. __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15342. __pyx_r = -1;
  15343. if (__pyx_v_info->obj != NULL) {
  15344. __Pyx_GOTREF(__pyx_v_info->obj);
  15345. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15346. }
  15347. goto __pyx_L2;
  15348. __pyx_L0:;
  15349. if (__pyx_v_info->obj == Py_None) {
  15350. __Pyx_GOTREF(__pyx_v_info->obj);
  15351. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  15352. }
  15353. __pyx_L2:;
  15354. __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  15355. __Pyx_RefNannyFinishContext();
  15356. return __pyx_r;
  15357. }
  15358. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15359. * f[0] = c'\0' # Terminate format string
  15360. *
  15361. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15362. * if PyArray_HASFIELDS(self):
  15363. * PyObject_Free(info.format)
  15364. */
  15365. /* Python wrapper */
  15366. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  15367. static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15368. __Pyx_RefNannyDeclarations
  15369. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  15370. __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  15371. /* function exit code */
  15372. __Pyx_RefNannyFinishContext();
  15373. }
  15374. static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  15375. __Pyx_RefNannyDeclarations
  15376. int __pyx_t_1;
  15377. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  15378. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15379. *
  15380. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15381. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15382. * PyObject_Free(info.format)
  15383. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15384. */
  15385. __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
  15386. if (__pyx_t_1) {
  15387. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":339
  15388. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15389. * if PyArray_HASFIELDS(self):
  15390. * PyObject_Free(info.format) # <<<<<<<<<<<<<<
  15391. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15392. * PyObject_Free(info.strides)
  15393. */
  15394. PyObject_Free(__pyx_v_info->format);
  15395. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":338
  15396. *
  15397. * def __releasebuffer__(ndarray self, Py_buffer* info):
  15398. * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
  15399. * PyObject_Free(info.format)
  15400. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15401. */
  15402. }
  15403. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15404. * if PyArray_HASFIELDS(self):
  15405. * PyObject_Free(info.format)
  15406. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15407. * PyObject_Free(info.strides)
  15408. * # info.shape was stored after info.strides in the same block
  15409. */
  15410. __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
  15411. if (__pyx_t_1) {
  15412. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":341
  15413. * PyObject_Free(info.format)
  15414. * if sizeof(npy_intp) != sizeof(Py_ssize_t):
  15415. * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
  15416. * # info.shape was stored after info.strides in the same block
  15417. *
  15418. */
  15419. PyObject_Free(__pyx_v_info->strides);
  15420. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":340
  15421. * if PyArray_HASFIELDS(self):
  15422. * PyObject_Free(info.format)
  15423. * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
  15424. * PyObject_Free(info.strides)
  15425. * # info.shape was stored after info.strides in the same block
  15426. */
  15427. }
  15428. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":337
  15429. * f[0] = c'\0' # Terminate format string
  15430. *
  15431. * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
  15432. * if PyArray_HASFIELDS(self):
  15433. * PyObject_Free(info.format)
  15434. */
  15435. /* function exit code */
  15436. __Pyx_RefNannyFinishContext();
  15437. }
  15438. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15439. * ctypedef npy_cdouble complex_t
  15440. *
  15441. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15442. * return PyArray_MultiIterNew(1, <void*>a)
  15443. *
  15444. */
  15445. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
  15446. PyObject *__pyx_r = NULL;
  15447. __Pyx_RefNannyDeclarations
  15448. PyObject *__pyx_t_1 = NULL;
  15449. __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
  15450. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":822
  15451. *
  15452. * cdef inline object PyArray_MultiIterNew1(a):
  15453. * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
  15454. *
  15455. * cdef inline object PyArray_MultiIterNew2(a, b):
  15456. */
  15457. __Pyx_XDECREF(__pyx_r);
  15458. __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 822, __pyx_L1_error)
  15459. __Pyx_GOTREF(__pyx_t_1);
  15460. __pyx_r = __pyx_t_1;
  15461. __pyx_t_1 = 0;
  15462. goto __pyx_L0;
  15463. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":821
  15464. * ctypedef npy_cdouble complex_t
  15465. *
  15466. * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
  15467. * return PyArray_MultiIterNew(1, <void*>a)
  15468. *
  15469. */
  15470. /* function exit code */
  15471. __pyx_L1_error:;
  15472. __Pyx_XDECREF(__pyx_t_1);
  15473. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15474. __pyx_r = 0;
  15475. __pyx_L0:;
  15476. __Pyx_XGIVEREF(__pyx_r);
  15477. __Pyx_RefNannyFinishContext();
  15478. return __pyx_r;
  15479. }
  15480. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15481. * return PyArray_MultiIterNew(1, <void*>a)
  15482. *
  15483. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15484. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15485. *
  15486. */
  15487. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  15488. PyObject *__pyx_r = NULL;
  15489. __Pyx_RefNannyDeclarations
  15490. PyObject *__pyx_t_1 = NULL;
  15491. __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
  15492. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":825
  15493. *
  15494. * cdef inline object PyArray_MultiIterNew2(a, b):
  15495. * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
  15496. *
  15497. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15498. */
  15499. __Pyx_XDECREF(__pyx_r);
  15500. __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)
  15501. __Pyx_GOTREF(__pyx_t_1);
  15502. __pyx_r = __pyx_t_1;
  15503. __pyx_t_1 = 0;
  15504. goto __pyx_L0;
  15505. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":824
  15506. * return PyArray_MultiIterNew(1, <void*>a)
  15507. *
  15508. * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
  15509. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15510. *
  15511. */
  15512. /* function exit code */
  15513. __pyx_L1_error:;
  15514. __Pyx_XDECREF(__pyx_t_1);
  15515. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15516. __pyx_r = 0;
  15517. __pyx_L0:;
  15518. __Pyx_XGIVEREF(__pyx_r);
  15519. __Pyx_RefNannyFinishContext();
  15520. return __pyx_r;
  15521. }
  15522. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15523. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15524. *
  15525. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15526. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15527. *
  15528. */
  15529. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
  15530. PyObject *__pyx_r = NULL;
  15531. __Pyx_RefNannyDeclarations
  15532. PyObject *__pyx_t_1 = NULL;
  15533. __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
  15534. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":828
  15535. *
  15536. * cdef inline object PyArray_MultiIterNew3(a, b, c):
  15537. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
  15538. *
  15539. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15540. */
  15541. __Pyx_XDECREF(__pyx_r);
  15542. __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)
  15543. __Pyx_GOTREF(__pyx_t_1);
  15544. __pyx_r = __pyx_t_1;
  15545. __pyx_t_1 = 0;
  15546. goto __pyx_L0;
  15547. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":827
  15548. * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
  15549. *
  15550. * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
  15551. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15552. *
  15553. */
  15554. /* function exit code */
  15555. __pyx_L1_error:;
  15556. __Pyx_XDECREF(__pyx_t_1);
  15557. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15558. __pyx_r = 0;
  15559. __pyx_L0:;
  15560. __Pyx_XGIVEREF(__pyx_r);
  15561. __Pyx_RefNannyFinishContext();
  15562. return __pyx_r;
  15563. }
  15564. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15565. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15566. *
  15567. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15568. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15569. *
  15570. */
  15571. 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) {
  15572. PyObject *__pyx_r = NULL;
  15573. __Pyx_RefNannyDeclarations
  15574. PyObject *__pyx_t_1 = NULL;
  15575. __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
  15576. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":831
  15577. *
  15578. * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
  15579. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
  15580. *
  15581. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15582. */
  15583. __Pyx_XDECREF(__pyx_r);
  15584. __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)
  15585. __Pyx_GOTREF(__pyx_t_1);
  15586. __pyx_r = __pyx_t_1;
  15587. __pyx_t_1 = 0;
  15588. goto __pyx_L0;
  15589. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":830
  15590. * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
  15591. *
  15592. * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
  15593. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15594. *
  15595. */
  15596. /* function exit code */
  15597. __pyx_L1_error:;
  15598. __Pyx_XDECREF(__pyx_t_1);
  15599. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15600. __pyx_r = 0;
  15601. __pyx_L0:;
  15602. __Pyx_XGIVEREF(__pyx_r);
  15603. __Pyx_RefNannyFinishContext();
  15604. return __pyx_r;
  15605. }
  15606. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15607. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15608. *
  15609. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15610. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15611. *
  15612. */
  15613. 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) {
  15614. PyObject *__pyx_r = NULL;
  15615. __Pyx_RefNannyDeclarations
  15616. PyObject *__pyx_t_1 = NULL;
  15617. __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
  15618. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":834
  15619. *
  15620. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
  15621. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
  15622. *
  15623. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15624. */
  15625. __Pyx_XDECREF(__pyx_r);
  15626. __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)
  15627. __Pyx_GOTREF(__pyx_t_1);
  15628. __pyx_r = __pyx_t_1;
  15629. __pyx_t_1 = 0;
  15630. goto __pyx_L0;
  15631. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":833
  15632. * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
  15633. *
  15634. * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
  15635. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15636. *
  15637. */
  15638. /* function exit code */
  15639. __pyx_L1_error:;
  15640. __Pyx_XDECREF(__pyx_t_1);
  15641. __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
  15642. __pyx_r = 0;
  15643. __pyx_L0:;
  15644. __Pyx_XGIVEREF(__pyx_r);
  15645. __Pyx_RefNannyFinishContext();
  15646. return __pyx_r;
  15647. }
  15648. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15649. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15650. *
  15651. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15652. * if PyDataType_HASSUBARRAY(d):
  15653. * return <tuple>d.subarray.shape
  15654. */
  15655. static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
  15656. PyObject *__pyx_r = NULL;
  15657. __Pyx_RefNannyDeclarations
  15658. int __pyx_t_1;
  15659. __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
  15660. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15661. *
  15662. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15663. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15664. * return <tuple>d.subarray.shape
  15665. * else:
  15666. */
  15667. __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
  15668. if (__pyx_t_1) {
  15669. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":838
  15670. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15671. * if PyDataType_HASSUBARRAY(d):
  15672. * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
  15673. * else:
  15674. * return ()
  15675. */
  15676. __Pyx_XDECREF(__pyx_r);
  15677. __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
  15678. __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
  15679. goto __pyx_L0;
  15680. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":837
  15681. *
  15682. * cdef inline tuple PyDataType_SHAPE(dtype d):
  15683. * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
  15684. * return <tuple>d.subarray.shape
  15685. * else:
  15686. */
  15687. }
  15688. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":840
  15689. * return <tuple>d.subarray.shape
  15690. * else:
  15691. * return () # <<<<<<<<<<<<<<
  15692. *
  15693. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
  15694. */
  15695. /*else*/ {
  15696. __Pyx_XDECREF(__pyx_r);
  15697. __Pyx_INCREF(__pyx_empty_tuple);
  15698. __pyx_r = __pyx_empty_tuple;
  15699. goto __pyx_L0;
  15700. }
  15701. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":836
  15702. * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
  15703. *
  15704. * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
  15705. * if PyDataType_HASSUBARRAY(d):
  15706. * return <tuple>d.subarray.shape
  15707. */
  15708. /* function exit code */
  15709. __pyx_L0:;
  15710. __Pyx_XGIVEREF(__pyx_r);
  15711. __Pyx_RefNannyFinishContext();
  15712. return __pyx_r;
  15713. }
  15714. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  15715. * return ()
  15716. *
  15717. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  15718. * # Recursive utility function used in __getbuffer__ to get format
  15719. * # string. The new location in the format string is returned.
  15720. */
  15721. 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) {
  15722. PyArray_Descr *__pyx_v_child = 0;
  15723. int __pyx_v_endian_detector;
  15724. int __pyx_v_little_endian;
  15725. PyObject *__pyx_v_fields = 0;
  15726. PyObject *__pyx_v_childname = NULL;
  15727. PyObject *__pyx_v_new_offset = NULL;
  15728. PyObject *__pyx_v_t = NULL;
  15729. char *__pyx_r;
  15730. __Pyx_RefNannyDeclarations
  15731. PyObject *__pyx_t_1 = NULL;
  15732. Py_ssize_t __pyx_t_2;
  15733. PyObject *__pyx_t_3 = NULL;
  15734. PyObject *__pyx_t_4 = NULL;
  15735. int __pyx_t_5;
  15736. int __pyx_t_6;
  15737. int __pyx_t_7;
  15738. long __pyx_t_8;
  15739. char *__pyx_t_9;
  15740. __Pyx_RefNannySetupContext("_util_dtypestring", 0);
  15741. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":847
  15742. *
  15743. * cdef dtype child
  15744. * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
  15745. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
  15746. * cdef tuple fields
  15747. */
  15748. __pyx_v_endian_detector = 1;
  15749. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":848
  15750. * cdef dtype child
  15751. * cdef int endian_detector = 1
  15752. * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
  15753. * cdef tuple fields
  15754. *
  15755. */
  15756. __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
  15757. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  15758. * cdef tuple fields
  15759. *
  15760. * for childname in descr.names: # <<<<<<<<<<<<<<
  15761. * fields = descr.fields[childname]
  15762. * child, new_offset = fields
  15763. */
  15764. if (unlikely(__pyx_v_descr->names == Py_None)) {
  15765. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  15766. __PYX_ERR(2, 851, __pyx_L1_error)
  15767. }
  15768. __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  15769. for (;;) {
  15770. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  15771. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15772. __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)
  15773. #else
  15774. __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)
  15775. __Pyx_GOTREF(__pyx_t_3);
  15776. #endif
  15777. __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
  15778. __pyx_t_3 = 0;
  15779. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":852
  15780. *
  15781. * for childname in descr.names:
  15782. * fields = descr.fields[childname] # <<<<<<<<<<<<<<
  15783. * child, new_offset = fields
  15784. *
  15785. */
  15786. if (unlikely(__pyx_v_descr->fields == Py_None)) {
  15787. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
  15788. __PYX_ERR(2, 852, __pyx_L1_error)
  15789. }
  15790. __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)
  15791. __Pyx_GOTREF(__pyx_t_3);
  15792. 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)
  15793. __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
  15794. __pyx_t_3 = 0;
  15795. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":853
  15796. * for childname in descr.names:
  15797. * fields = descr.fields[childname]
  15798. * child, new_offset = fields # <<<<<<<<<<<<<<
  15799. *
  15800. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15801. */
  15802. if (likely(__pyx_v_fields != Py_None)) {
  15803. PyObject* sequence = __pyx_v_fields;
  15804. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  15805. if (unlikely(size != 2)) {
  15806. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  15807. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  15808. __PYX_ERR(2, 853, __pyx_L1_error)
  15809. }
  15810. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  15811. __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
  15812. __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
  15813. __Pyx_INCREF(__pyx_t_3);
  15814. __Pyx_INCREF(__pyx_t_4);
  15815. #else
  15816. __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 853, __pyx_L1_error)
  15817. __Pyx_GOTREF(__pyx_t_3);
  15818. __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 853, __pyx_L1_error)
  15819. __Pyx_GOTREF(__pyx_t_4);
  15820. #endif
  15821. } else {
  15822. __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 853, __pyx_L1_error)
  15823. }
  15824. if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(2, 853, __pyx_L1_error)
  15825. __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
  15826. __pyx_t_3 = 0;
  15827. __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
  15828. __pyx_t_4 = 0;
  15829. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15830. * child, new_offset = fields
  15831. *
  15832. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15833. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15834. *
  15835. */
  15836. __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 855, __pyx_L1_error)
  15837. __Pyx_GOTREF(__pyx_t_4);
  15838. __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 855, __pyx_L1_error)
  15839. __Pyx_GOTREF(__pyx_t_3);
  15840. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15841. __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)
  15842. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15843. __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
  15844. if (unlikely(__pyx_t_6)) {
  15845. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  15846. *
  15847. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  15848. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  15849. *
  15850. * if ((child.byteorder == c'>' and little_endian) or
  15851. */
  15852. __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)
  15853. __Pyx_GOTREF(__pyx_t_3);
  15854. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15855. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15856. __PYX_ERR(2, 856, __pyx_L1_error)
  15857. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":855
  15858. * child, new_offset = fields
  15859. *
  15860. * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
  15861. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15862. *
  15863. */
  15864. }
  15865. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15866. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15867. *
  15868. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15869. * (child.byteorder == c'<' and not little_endian)):
  15870. * raise ValueError(u"Non-native byte order not supported")
  15871. */
  15872. __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
  15873. if (!__pyx_t_7) {
  15874. goto __pyx_L8_next_or;
  15875. } else {
  15876. }
  15877. __pyx_t_7 = (__pyx_v_little_endian != 0);
  15878. if (!__pyx_t_7) {
  15879. } else {
  15880. __pyx_t_6 = __pyx_t_7;
  15881. goto __pyx_L7_bool_binop_done;
  15882. }
  15883. __pyx_L8_next_or:;
  15884. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":859
  15885. *
  15886. * if ((child.byteorder == c'>' and little_endian) or
  15887. * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
  15888. * raise ValueError(u"Non-native byte order not supported")
  15889. * # One could encode it in the format string and have Cython
  15890. */
  15891. __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
  15892. if (__pyx_t_7) {
  15893. } else {
  15894. __pyx_t_6 = __pyx_t_7;
  15895. goto __pyx_L7_bool_binop_done;
  15896. }
  15897. __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
  15898. __pyx_t_6 = __pyx_t_7;
  15899. __pyx_L7_bool_binop_done:;
  15900. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15901. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15902. *
  15903. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15904. * (child.byteorder == c'<' and not little_endian)):
  15905. * raise ValueError(u"Non-native byte order not supported")
  15906. */
  15907. if (unlikely(__pyx_t_6)) {
  15908. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":860
  15909. * if ((child.byteorder == c'>' and little_endian) or
  15910. * (child.byteorder == c'<' and not little_endian)):
  15911. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  15912. * # One could encode it in the format string and have Cython
  15913. * # complain instead, BUT: < and > in format strings also imply
  15914. */
  15915. __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)
  15916. __Pyx_GOTREF(__pyx_t_3);
  15917. __Pyx_Raise(__pyx_t_3, 0, 0, 0);
  15918. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15919. __PYX_ERR(2, 860, __pyx_L1_error)
  15920. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":858
  15921. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
  15922. *
  15923. * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
  15924. * (child.byteorder == c'<' and not little_endian)):
  15925. * raise ValueError(u"Non-native byte order not supported")
  15926. */
  15927. }
  15928. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":870
  15929. *
  15930. * # Output padding bytes
  15931. * while offset[0] < new_offset: # <<<<<<<<<<<<<<
  15932. * f[0] = 120 # "x"; pad byte
  15933. * f += 1
  15934. */
  15935. while (1) {
  15936. __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 870, __pyx_L1_error)
  15937. __Pyx_GOTREF(__pyx_t_3);
  15938. __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)
  15939. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  15940. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 870, __pyx_L1_error)
  15941. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  15942. if (!__pyx_t_6) break;
  15943. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":871
  15944. * # Output padding bytes
  15945. * while offset[0] < new_offset:
  15946. * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
  15947. * f += 1
  15948. * offset[0] += 1
  15949. */
  15950. (__pyx_v_f[0]) = 0x78;
  15951. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":872
  15952. * while offset[0] < new_offset:
  15953. * f[0] = 120 # "x"; pad byte
  15954. * f += 1 # <<<<<<<<<<<<<<
  15955. * offset[0] += 1
  15956. *
  15957. */
  15958. __pyx_v_f = (__pyx_v_f + 1);
  15959. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":873
  15960. * f[0] = 120 # "x"; pad byte
  15961. * f += 1
  15962. * offset[0] += 1 # <<<<<<<<<<<<<<
  15963. *
  15964. * offset[0] += child.itemsize
  15965. */
  15966. __pyx_t_8 = 0;
  15967. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
  15968. }
  15969. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":875
  15970. * offset[0] += 1
  15971. *
  15972. * offset[0] += child.itemsize # <<<<<<<<<<<<<<
  15973. *
  15974. * if not PyDataType_HASFIELDS(child):
  15975. */
  15976. __pyx_t_8 = 0;
  15977. (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
  15978. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  15979. * offset[0] += child.itemsize
  15980. *
  15981. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  15982. * t = child.type_num
  15983. * if end - f < 5:
  15984. */
  15985. __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
  15986. if (__pyx_t_6) {
  15987. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":878
  15988. *
  15989. * if not PyDataType_HASFIELDS(child):
  15990. * t = child.type_num # <<<<<<<<<<<<<<
  15991. * if end - f < 5:
  15992. * raise RuntimeError(u"Format string allocated too short.")
  15993. */
  15994. __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 878, __pyx_L1_error)
  15995. __Pyx_GOTREF(__pyx_t_4);
  15996. __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
  15997. __pyx_t_4 = 0;
  15998. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  15999. * if not PyDataType_HASFIELDS(child):
  16000. * t = child.type_num
  16001. * if end - f < 5: # <<<<<<<<<<<<<<
  16002. * raise RuntimeError(u"Format string allocated too short.")
  16003. *
  16004. */
  16005. __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
  16006. if (unlikely(__pyx_t_6)) {
  16007. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  16008. * t = child.type_num
  16009. * if end - f < 5:
  16010. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  16011. *
  16012. * # Until ticket #99 is fixed, use integers to avoid warnings
  16013. */
  16014. __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)
  16015. __Pyx_GOTREF(__pyx_t_4);
  16016. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  16017. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16018. __PYX_ERR(2, 880, __pyx_L1_error)
  16019. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":879
  16020. * if not PyDataType_HASFIELDS(child):
  16021. * t = child.type_num
  16022. * if end - f < 5: # <<<<<<<<<<<<<<
  16023. * raise RuntimeError(u"Format string allocated too short.")
  16024. *
  16025. */
  16026. }
  16027. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":883
  16028. *
  16029. * # Until ticket #99 is fixed, use integers to avoid warnings
  16030. * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
  16031. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16032. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16033. */
  16034. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 883, __pyx_L1_error)
  16035. __Pyx_GOTREF(__pyx_t_4);
  16036. __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)
  16037. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16038. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 883, __pyx_L1_error)
  16039. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16040. if (__pyx_t_6) {
  16041. (__pyx_v_f[0]) = 98;
  16042. goto __pyx_L15;
  16043. }
  16044. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":884
  16045. * # Until ticket #99 is fixed, use integers to avoid warnings
  16046. * if t == NPY_BYTE: f[0] = 98 #"b"
  16047. * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
  16048. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16049. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16050. */
  16051. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 884, __pyx_L1_error)
  16052. __Pyx_GOTREF(__pyx_t_3);
  16053. __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)
  16054. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16055. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 884, __pyx_L1_error)
  16056. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16057. if (__pyx_t_6) {
  16058. (__pyx_v_f[0]) = 66;
  16059. goto __pyx_L15;
  16060. }
  16061. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":885
  16062. * if t == NPY_BYTE: f[0] = 98 #"b"
  16063. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16064. * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
  16065. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16066. * elif t == NPY_INT: f[0] = 105 #"i"
  16067. */
  16068. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 885, __pyx_L1_error)
  16069. __Pyx_GOTREF(__pyx_t_4);
  16070. __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)
  16071. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16072. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 885, __pyx_L1_error)
  16073. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16074. if (__pyx_t_6) {
  16075. (__pyx_v_f[0]) = 0x68;
  16076. goto __pyx_L15;
  16077. }
  16078. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":886
  16079. * elif t == NPY_UBYTE: f[0] = 66 #"B"
  16080. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16081. * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
  16082. * elif t == NPY_INT: f[0] = 105 #"i"
  16083. * elif t == NPY_UINT: f[0] = 73 #"I"
  16084. */
  16085. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 886, __pyx_L1_error)
  16086. __Pyx_GOTREF(__pyx_t_3);
  16087. __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)
  16088. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16089. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 886, __pyx_L1_error)
  16090. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16091. if (__pyx_t_6) {
  16092. (__pyx_v_f[0]) = 72;
  16093. goto __pyx_L15;
  16094. }
  16095. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":887
  16096. * elif t == NPY_SHORT: f[0] = 104 #"h"
  16097. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16098. * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
  16099. * elif t == NPY_UINT: f[0] = 73 #"I"
  16100. * elif t == NPY_LONG: f[0] = 108 #"l"
  16101. */
  16102. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 887, __pyx_L1_error)
  16103. __Pyx_GOTREF(__pyx_t_4);
  16104. __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)
  16105. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16106. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 887, __pyx_L1_error)
  16107. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16108. if (__pyx_t_6) {
  16109. (__pyx_v_f[0]) = 0x69;
  16110. goto __pyx_L15;
  16111. }
  16112. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":888
  16113. * elif t == NPY_USHORT: f[0] = 72 #"H"
  16114. * elif t == NPY_INT: f[0] = 105 #"i"
  16115. * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
  16116. * elif t == NPY_LONG: f[0] = 108 #"l"
  16117. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16118. */
  16119. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 888, __pyx_L1_error)
  16120. __Pyx_GOTREF(__pyx_t_3);
  16121. __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)
  16122. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16123. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 888, __pyx_L1_error)
  16124. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16125. if (__pyx_t_6) {
  16126. (__pyx_v_f[0]) = 73;
  16127. goto __pyx_L15;
  16128. }
  16129. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":889
  16130. * elif t == NPY_INT: f[0] = 105 #"i"
  16131. * elif t == NPY_UINT: f[0] = 73 #"I"
  16132. * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
  16133. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16134. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16135. */
  16136. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 889, __pyx_L1_error)
  16137. __Pyx_GOTREF(__pyx_t_4);
  16138. __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)
  16139. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16140. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 889, __pyx_L1_error)
  16141. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16142. if (__pyx_t_6) {
  16143. (__pyx_v_f[0]) = 0x6C;
  16144. goto __pyx_L15;
  16145. }
  16146. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":890
  16147. * elif t == NPY_UINT: f[0] = 73 #"I"
  16148. * elif t == NPY_LONG: f[0] = 108 #"l"
  16149. * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
  16150. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16151. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16152. */
  16153. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 890, __pyx_L1_error)
  16154. __Pyx_GOTREF(__pyx_t_3);
  16155. __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)
  16156. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16157. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 890, __pyx_L1_error)
  16158. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16159. if (__pyx_t_6) {
  16160. (__pyx_v_f[0]) = 76;
  16161. goto __pyx_L15;
  16162. }
  16163. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":891
  16164. * elif t == NPY_LONG: f[0] = 108 #"l"
  16165. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16166. * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
  16167. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16168. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16169. */
  16170. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 891, __pyx_L1_error)
  16171. __Pyx_GOTREF(__pyx_t_4);
  16172. __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)
  16173. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16174. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 891, __pyx_L1_error)
  16175. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16176. if (__pyx_t_6) {
  16177. (__pyx_v_f[0]) = 0x71;
  16178. goto __pyx_L15;
  16179. }
  16180. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":892
  16181. * elif t == NPY_ULONG: f[0] = 76 #"L"
  16182. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16183. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
  16184. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16185. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16186. */
  16187. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 892, __pyx_L1_error)
  16188. __Pyx_GOTREF(__pyx_t_3);
  16189. __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)
  16190. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16191. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 892, __pyx_L1_error)
  16192. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16193. if (__pyx_t_6) {
  16194. (__pyx_v_f[0]) = 81;
  16195. goto __pyx_L15;
  16196. }
  16197. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":893
  16198. * elif t == NPY_LONGLONG: f[0] = 113 #"q"
  16199. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16200. * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
  16201. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16202. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16203. */
  16204. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 893, __pyx_L1_error)
  16205. __Pyx_GOTREF(__pyx_t_4);
  16206. __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)
  16207. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16208. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 893, __pyx_L1_error)
  16209. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16210. if (__pyx_t_6) {
  16211. (__pyx_v_f[0]) = 0x66;
  16212. goto __pyx_L15;
  16213. }
  16214. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":894
  16215. * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
  16216. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16217. * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
  16218. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16219. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16220. */
  16221. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 894, __pyx_L1_error)
  16222. __Pyx_GOTREF(__pyx_t_3);
  16223. __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)
  16224. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16225. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 894, __pyx_L1_error)
  16226. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16227. if (__pyx_t_6) {
  16228. (__pyx_v_f[0]) = 0x64;
  16229. goto __pyx_L15;
  16230. }
  16231. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":895
  16232. * elif t == NPY_FLOAT: f[0] = 102 #"f"
  16233. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16234. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
  16235. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16236. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16237. */
  16238. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 895, __pyx_L1_error)
  16239. __Pyx_GOTREF(__pyx_t_4);
  16240. __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)
  16241. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16242. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 895, __pyx_L1_error)
  16243. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16244. if (__pyx_t_6) {
  16245. (__pyx_v_f[0]) = 0x67;
  16246. goto __pyx_L15;
  16247. }
  16248. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":896
  16249. * elif t == NPY_DOUBLE: f[0] = 100 #"d"
  16250. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16251. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
  16252. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16253. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16254. */
  16255. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 896, __pyx_L1_error)
  16256. __Pyx_GOTREF(__pyx_t_3);
  16257. __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)
  16258. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16259. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 896, __pyx_L1_error)
  16260. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16261. if (__pyx_t_6) {
  16262. (__pyx_v_f[0]) = 90;
  16263. (__pyx_v_f[1]) = 0x66;
  16264. __pyx_v_f = (__pyx_v_f + 1);
  16265. goto __pyx_L15;
  16266. }
  16267. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":897
  16268. * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
  16269. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16270. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
  16271. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16272. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16273. */
  16274. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 897, __pyx_L1_error)
  16275. __Pyx_GOTREF(__pyx_t_4);
  16276. __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)
  16277. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16278. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 897, __pyx_L1_error)
  16279. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16280. if (__pyx_t_6) {
  16281. (__pyx_v_f[0]) = 90;
  16282. (__pyx_v_f[1]) = 0x64;
  16283. __pyx_v_f = (__pyx_v_f + 1);
  16284. goto __pyx_L15;
  16285. }
  16286. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":898
  16287. * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
  16288. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16289. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
  16290. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16291. * else:
  16292. */
  16293. __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 898, __pyx_L1_error)
  16294. __Pyx_GOTREF(__pyx_t_3);
  16295. __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)
  16296. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16297. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 898, __pyx_L1_error)
  16298. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16299. if (__pyx_t_6) {
  16300. (__pyx_v_f[0]) = 90;
  16301. (__pyx_v_f[1]) = 0x67;
  16302. __pyx_v_f = (__pyx_v_f + 1);
  16303. goto __pyx_L15;
  16304. }
  16305. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":899
  16306. * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
  16307. * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
  16308. * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
  16309. * else:
  16310. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16311. */
  16312. __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 899, __pyx_L1_error)
  16313. __Pyx_GOTREF(__pyx_t_4);
  16314. __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)
  16315. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16316. __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(2, 899, __pyx_L1_error)
  16317. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16318. if (likely(__pyx_t_6)) {
  16319. (__pyx_v_f[0]) = 79;
  16320. goto __pyx_L15;
  16321. }
  16322. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":901
  16323. * elif t == NPY_OBJECT: f[0] = 79 #"O"
  16324. * else:
  16325. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
  16326. * f += 1
  16327. * else:
  16328. */
  16329. /*else*/ {
  16330. __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)
  16331. __Pyx_GOTREF(__pyx_t_3);
  16332. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 901, __pyx_L1_error)
  16333. __Pyx_GOTREF(__pyx_t_4);
  16334. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  16335. __Pyx_Raise(__pyx_t_4, 0, 0, 0);
  16336. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16337. __PYX_ERR(2, 901, __pyx_L1_error)
  16338. }
  16339. __pyx_L15:;
  16340. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":902
  16341. * else:
  16342. * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
  16343. * f += 1 # <<<<<<<<<<<<<<
  16344. * else:
  16345. * # Cython ignores struct boundary information ("T{...}"),
  16346. */
  16347. __pyx_v_f = (__pyx_v_f + 1);
  16348. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":877
  16349. * offset[0] += child.itemsize
  16350. *
  16351. * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
  16352. * t = child.type_num
  16353. * if end - f < 5:
  16354. */
  16355. goto __pyx_L13;
  16356. }
  16357. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":906
  16358. * # Cython ignores struct boundary information ("T{...}"),
  16359. * # so don't output it
  16360. * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
  16361. * return f
  16362. *
  16363. */
  16364. /*else*/ {
  16365. __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)
  16366. __pyx_v_f = __pyx_t_9;
  16367. }
  16368. __pyx_L13:;
  16369. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":851
  16370. * cdef tuple fields
  16371. *
  16372. * for childname in descr.names: # <<<<<<<<<<<<<<
  16373. * fields = descr.fields[childname]
  16374. * child, new_offset = fields
  16375. */
  16376. }
  16377. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16378. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":907
  16379. * # so don't output it
  16380. * f = _util_dtypestring(child, f, end, offset)
  16381. * return f # <<<<<<<<<<<<<<
  16382. *
  16383. *
  16384. */
  16385. __pyx_r = __pyx_v_f;
  16386. goto __pyx_L0;
  16387. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":842
  16388. * return ()
  16389. *
  16390. * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
  16391. * # Recursive utility function used in __getbuffer__ to get format
  16392. * # string. The new location in the format string is returned.
  16393. */
  16394. /* function exit code */
  16395. __pyx_L1_error:;
  16396. __Pyx_XDECREF(__pyx_t_1);
  16397. __Pyx_XDECREF(__pyx_t_3);
  16398. __Pyx_XDECREF(__pyx_t_4);
  16399. __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16400. __pyx_r = NULL;
  16401. __pyx_L0:;
  16402. __Pyx_XDECREF((PyObject *)__pyx_v_child);
  16403. __Pyx_XDECREF(__pyx_v_fields);
  16404. __Pyx_XDECREF(__pyx_v_childname);
  16405. __Pyx_XDECREF(__pyx_v_new_offset);
  16406. __Pyx_XDECREF(__pyx_v_t);
  16407. __Pyx_RefNannyFinishContext();
  16408. return __pyx_r;
  16409. }
  16410. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16411. * int _import_umath() except -1
  16412. *
  16413. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16414. * Py_INCREF(base) # important to do this before stealing the reference below!
  16415. * PyArray_SetBaseObject(arr, base)
  16416. */
  16417. static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
  16418. __Pyx_RefNannyDeclarations
  16419. __Pyx_RefNannySetupContext("set_array_base", 0);
  16420. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1023
  16421. *
  16422. * cdef inline void set_array_base(ndarray arr, object base):
  16423. * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
  16424. * PyArray_SetBaseObject(arr, base)
  16425. *
  16426. */
  16427. Py_INCREF(__pyx_v_base);
  16428. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1024
  16429. * cdef inline void set_array_base(ndarray arr, object base):
  16430. * Py_INCREF(base) # important to do this before stealing the reference below!
  16431. * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
  16432. *
  16433. * cdef inline object get_array_base(ndarray arr):
  16434. */
  16435. (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
  16436. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1022
  16437. * int _import_umath() except -1
  16438. *
  16439. * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
  16440. * Py_INCREF(base) # important to do this before stealing the reference below!
  16441. * PyArray_SetBaseObject(arr, base)
  16442. */
  16443. /* function exit code */
  16444. __Pyx_RefNannyFinishContext();
  16445. }
  16446. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16447. * PyArray_SetBaseObject(arr, base)
  16448. *
  16449. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16450. * base = PyArray_BASE(arr)
  16451. * if base is NULL:
  16452. */
  16453. static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
  16454. PyObject *__pyx_v_base;
  16455. PyObject *__pyx_r = NULL;
  16456. __Pyx_RefNannyDeclarations
  16457. int __pyx_t_1;
  16458. __Pyx_RefNannySetupContext("get_array_base", 0);
  16459. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1027
  16460. *
  16461. * cdef inline object get_array_base(ndarray arr):
  16462. * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
  16463. * if base is NULL:
  16464. * return None
  16465. */
  16466. __pyx_v_base = PyArray_BASE(__pyx_v_arr);
  16467. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16468. * cdef inline object get_array_base(ndarray arr):
  16469. * base = PyArray_BASE(arr)
  16470. * if base is NULL: # <<<<<<<<<<<<<<
  16471. * return None
  16472. * return <object>base
  16473. */
  16474. __pyx_t_1 = ((__pyx_v_base == NULL) != 0);
  16475. if (__pyx_t_1) {
  16476. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1029
  16477. * base = PyArray_BASE(arr)
  16478. * if base is NULL:
  16479. * return None # <<<<<<<<<<<<<<
  16480. * return <object>base
  16481. *
  16482. */
  16483. __Pyx_XDECREF(__pyx_r);
  16484. __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  16485. goto __pyx_L0;
  16486. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1028
  16487. * cdef inline object get_array_base(ndarray arr):
  16488. * base = PyArray_BASE(arr)
  16489. * if base is NULL: # <<<<<<<<<<<<<<
  16490. * return None
  16491. * return <object>base
  16492. */
  16493. }
  16494. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1030
  16495. * if base is NULL:
  16496. * return None
  16497. * return <object>base # <<<<<<<<<<<<<<
  16498. *
  16499. * # Versions of the import_* functions which are more suitable for
  16500. */
  16501. __Pyx_XDECREF(__pyx_r);
  16502. __Pyx_INCREF(((PyObject *)__pyx_v_base));
  16503. __pyx_r = ((PyObject *)__pyx_v_base);
  16504. goto __pyx_L0;
  16505. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1026
  16506. * PyArray_SetBaseObject(arr, base)
  16507. *
  16508. * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
  16509. * base = PyArray_BASE(arr)
  16510. * if base is NULL:
  16511. */
  16512. /* function exit code */
  16513. __pyx_L0:;
  16514. __Pyx_XGIVEREF(__pyx_r);
  16515. __Pyx_RefNannyFinishContext();
  16516. return __pyx_r;
  16517. }
  16518. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16519. * # Versions of the import_* functions which are more suitable for
  16520. * # Cython code.
  16521. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16522. * try:
  16523. * _import_array()
  16524. */
  16525. static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
  16526. int __pyx_r;
  16527. __Pyx_RefNannyDeclarations
  16528. PyObject *__pyx_t_1 = NULL;
  16529. PyObject *__pyx_t_2 = NULL;
  16530. PyObject *__pyx_t_3 = NULL;
  16531. int __pyx_t_4;
  16532. PyObject *__pyx_t_5 = NULL;
  16533. PyObject *__pyx_t_6 = NULL;
  16534. PyObject *__pyx_t_7 = NULL;
  16535. PyObject *__pyx_t_8 = NULL;
  16536. __Pyx_RefNannySetupContext("import_array", 0);
  16537. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16538. * # Cython code.
  16539. * cdef inline int import_array() except -1:
  16540. * try: # <<<<<<<<<<<<<<
  16541. * _import_array()
  16542. * except Exception:
  16543. */
  16544. {
  16545. __Pyx_PyThreadState_declare
  16546. __Pyx_PyThreadState_assign
  16547. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16548. __Pyx_XGOTREF(__pyx_t_1);
  16549. __Pyx_XGOTREF(__pyx_t_2);
  16550. __Pyx_XGOTREF(__pyx_t_3);
  16551. /*try:*/ {
  16552. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1036
  16553. * cdef inline int import_array() except -1:
  16554. * try:
  16555. * _import_array() # <<<<<<<<<<<<<<
  16556. * except Exception:
  16557. * raise ImportError("numpy.core.multiarray failed to import")
  16558. */
  16559. __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1036, __pyx_L3_error)
  16560. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16561. * # Cython code.
  16562. * cdef inline int import_array() except -1:
  16563. * try: # <<<<<<<<<<<<<<
  16564. * _import_array()
  16565. * except Exception:
  16566. */
  16567. }
  16568. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16569. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16570. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16571. goto __pyx_L8_try_end;
  16572. __pyx_L3_error:;
  16573. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1037
  16574. * try:
  16575. * _import_array()
  16576. * except Exception: # <<<<<<<<<<<<<<
  16577. * raise ImportError("numpy.core.multiarray failed to import")
  16578. *
  16579. */
  16580. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16581. if (__pyx_t_4) {
  16582. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16583. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1037, __pyx_L5_except_error)
  16584. __Pyx_GOTREF(__pyx_t_5);
  16585. __Pyx_GOTREF(__pyx_t_6);
  16586. __Pyx_GOTREF(__pyx_t_7);
  16587. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  16588. * _import_array()
  16589. * except Exception:
  16590. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  16591. *
  16592. * cdef inline int import_umath() except -1:
  16593. */
  16594. __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)
  16595. __Pyx_GOTREF(__pyx_t_8);
  16596. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16597. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16598. __PYX_ERR(2, 1038, __pyx_L5_except_error)
  16599. }
  16600. goto __pyx_L5_except_error;
  16601. __pyx_L5_except_error:;
  16602. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1035
  16603. * # Cython code.
  16604. * cdef inline int import_array() except -1:
  16605. * try: # <<<<<<<<<<<<<<
  16606. * _import_array()
  16607. * except Exception:
  16608. */
  16609. __Pyx_XGIVEREF(__pyx_t_1);
  16610. __Pyx_XGIVEREF(__pyx_t_2);
  16611. __Pyx_XGIVEREF(__pyx_t_3);
  16612. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16613. goto __pyx_L1_error;
  16614. __pyx_L8_try_end:;
  16615. }
  16616. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1034
  16617. * # Versions of the import_* functions which are more suitable for
  16618. * # Cython code.
  16619. * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
  16620. * try:
  16621. * _import_array()
  16622. */
  16623. /* function exit code */
  16624. __pyx_r = 0;
  16625. goto __pyx_L0;
  16626. __pyx_L1_error:;
  16627. __Pyx_XDECREF(__pyx_t_5);
  16628. __Pyx_XDECREF(__pyx_t_6);
  16629. __Pyx_XDECREF(__pyx_t_7);
  16630. __Pyx_XDECREF(__pyx_t_8);
  16631. __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16632. __pyx_r = -1;
  16633. __pyx_L0:;
  16634. __Pyx_RefNannyFinishContext();
  16635. return __pyx_r;
  16636. }
  16637. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16638. * raise ImportError("numpy.core.multiarray failed to import")
  16639. *
  16640. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16641. * try:
  16642. * _import_umath()
  16643. */
  16644. static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
  16645. int __pyx_r;
  16646. __Pyx_RefNannyDeclarations
  16647. PyObject *__pyx_t_1 = NULL;
  16648. PyObject *__pyx_t_2 = NULL;
  16649. PyObject *__pyx_t_3 = NULL;
  16650. int __pyx_t_4;
  16651. PyObject *__pyx_t_5 = NULL;
  16652. PyObject *__pyx_t_6 = NULL;
  16653. PyObject *__pyx_t_7 = NULL;
  16654. PyObject *__pyx_t_8 = NULL;
  16655. __Pyx_RefNannySetupContext("import_umath", 0);
  16656. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16657. *
  16658. * cdef inline int import_umath() except -1:
  16659. * try: # <<<<<<<<<<<<<<
  16660. * _import_umath()
  16661. * except Exception:
  16662. */
  16663. {
  16664. __Pyx_PyThreadState_declare
  16665. __Pyx_PyThreadState_assign
  16666. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16667. __Pyx_XGOTREF(__pyx_t_1);
  16668. __Pyx_XGOTREF(__pyx_t_2);
  16669. __Pyx_XGOTREF(__pyx_t_3);
  16670. /*try:*/ {
  16671. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1042
  16672. * cdef inline int import_umath() except -1:
  16673. * try:
  16674. * _import_umath() # <<<<<<<<<<<<<<
  16675. * except Exception:
  16676. * raise ImportError("numpy.core.umath failed to import")
  16677. */
  16678. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1042, __pyx_L3_error)
  16679. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16680. *
  16681. * cdef inline int import_umath() except -1:
  16682. * try: # <<<<<<<<<<<<<<
  16683. * _import_umath()
  16684. * except Exception:
  16685. */
  16686. }
  16687. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16688. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16689. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16690. goto __pyx_L8_try_end;
  16691. __pyx_L3_error:;
  16692. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1043
  16693. * try:
  16694. * _import_umath()
  16695. * except Exception: # <<<<<<<<<<<<<<
  16696. * raise ImportError("numpy.core.umath failed to import")
  16697. *
  16698. */
  16699. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16700. if (__pyx_t_4) {
  16701. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16702. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1043, __pyx_L5_except_error)
  16703. __Pyx_GOTREF(__pyx_t_5);
  16704. __Pyx_GOTREF(__pyx_t_6);
  16705. __Pyx_GOTREF(__pyx_t_7);
  16706. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  16707. * _import_umath()
  16708. * except Exception:
  16709. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16710. *
  16711. * cdef inline int import_ufunc() except -1:
  16712. */
  16713. __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)
  16714. __Pyx_GOTREF(__pyx_t_8);
  16715. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16716. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16717. __PYX_ERR(2, 1044, __pyx_L5_except_error)
  16718. }
  16719. goto __pyx_L5_except_error;
  16720. __pyx_L5_except_error:;
  16721. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1041
  16722. *
  16723. * cdef inline int import_umath() except -1:
  16724. * try: # <<<<<<<<<<<<<<
  16725. * _import_umath()
  16726. * except Exception:
  16727. */
  16728. __Pyx_XGIVEREF(__pyx_t_1);
  16729. __Pyx_XGIVEREF(__pyx_t_2);
  16730. __Pyx_XGIVEREF(__pyx_t_3);
  16731. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16732. goto __pyx_L1_error;
  16733. __pyx_L8_try_end:;
  16734. }
  16735. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1040
  16736. * raise ImportError("numpy.core.multiarray failed to import")
  16737. *
  16738. * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
  16739. * try:
  16740. * _import_umath()
  16741. */
  16742. /* function exit code */
  16743. __pyx_r = 0;
  16744. goto __pyx_L0;
  16745. __pyx_L1_error:;
  16746. __Pyx_XDECREF(__pyx_t_5);
  16747. __Pyx_XDECREF(__pyx_t_6);
  16748. __Pyx_XDECREF(__pyx_t_7);
  16749. __Pyx_XDECREF(__pyx_t_8);
  16750. __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16751. __pyx_r = -1;
  16752. __pyx_L0:;
  16753. __Pyx_RefNannyFinishContext();
  16754. return __pyx_r;
  16755. }
  16756. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16757. * raise ImportError("numpy.core.umath failed to import")
  16758. *
  16759. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16760. * try:
  16761. * _import_umath()
  16762. */
  16763. static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
  16764. int __pyx_r;
  16765. __Pyx_RefNannyDeclarations
  16766. PyObject *__pyx_t_1 = NULL;
  16767. PyObject *__pyx_t_2 = NULL;
  16768. PyObject *__pyx_t_3 = NULL;
  16769. int __pyx_t_4;
  16770. PyObject *__pyx_t_5 = NULL;
  16771. PyObject *__pyx_t_6 = NULL;
  16772. PyObject *__pyx_t_7 = NULL;
  16773. PyObject *__pyx_t_8 = NULL;
  16774. __Pyx_RefNannySetupContext("import_ufunc", 0);
  16775. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16776. *
  16777. * cdef inline int import_ufunc() except -1:
  16778. * try: # <<<<<<<<<<<<<<
  16779. * _import_umath()
  16780. * except Exception:
  16781. */
  16782. {
  16783. __Pyx_PyThreadState_declare
  16784. __Pyx_PyThreadState_assign
  16785. __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
  16786. __Pyx_XGOTREF(__pyx_t_1);
  16787. __Pyx_XGOTREF(__pyx_t_2);
  16788. __Pyx_XGOTREF(__pyx_t_3);
  16789. /*try:*/ {
  16790. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1048
  16791. * cdef inline int import_ufunc() except -1:
  16792. * try:
  16793. * _import_umath() # <<<<<<<<<<<<<<
  16794. * except Exception:
  16795. * raise ImportError("numpy.core.umath failed to import")
  16796. */
  16797. __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 1048, __pyx_L3_error)
  16798. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16799. *
  16800. * cdef inline int import_ufunc() except -1:
  16801. * try: # <<<<<<<<<<<<<<
  16802. * _import_umath()
  16803. * except Exception:
  16804. */
  16805. }
  16806. __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  16807. __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  16808. __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  16809. goto __pyx_L8_try_end;
  16810. __pyx_L3_error:;
  16811. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1049
  16812. * try:
  16813. * _import_umath()
  16814. * except Exception: # <<<<<<<<<<<<<<
  16815. * raise ImportError("numpy.core.umath failed to import")
  16816. */
  16817. __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  16818. if (__pyx_t_4) {
  16819. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16820. if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(2, 1049, __pyx_L5_except_error)
  16821. __Pyx_GOTREF(__pyx_t_5);
  16822. __Pyx_GOTREF(__pyx_t_6);
  16823. __Pyx_GOTREF(__pyx_t_7);
  16824. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1050
  16825. * _import_umath()
  16826. * except Exception:
  16827. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  16828. */
  16829. __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)
  16830. __Pyx_GOTREF(__pyx_t_8);
  16831. __Pyx_Raise(__pyx_t_8, 0, 0, 0);
  16832. __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  16833. __PYX_ERR(2, 1050, __pyx_L5_except_error)
  16834. }
  16835. goto __pyx_L5_except_error;
  16836. __pyx_L5_except_error:;
  16837. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1047
  16838. *
  16839. * cdef inline int import_ufunc() except -1:
  16840. * try: # <<<<<<<<<<<<<<
  16841. * _import_umath()
  16842. * except Exception:
  16843. */
  16844. __Pyx_XGIVEREF(__pyx_t_1);
  16845. __Pyx_XGIVEREF(__pyx_t_2);
  16846. __Pyx_XGIVEREF(__pyx_t_3);
  16847. __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
  16848. goto __pyx_L1_error;
  16849. __pyx_L8_try_end:;
  16850. }
  16851. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1046
  16852. * raise ImportError("numpy.core.umath failed to import")
  16853. *
  16854. * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
  16855. * try:
  16856. * _import_umath()
  16857. */
  16858. /* function exit code */
  16859. __pyx_r = 0;
  16860. goto __pyx_L0;
  16861. __pyx_L1_error:;
  16862. __Pyx_XDECREF(__pyx_t_5);
  16863. __Pyx_XDECREF(__pyx_t_6);
  16864. __Pyx_XDECREF(__pyx_t_7);
  16865. __Pyx_XDECREF(__pyx_t_8);
  16866. __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
  16867. __pyx_r = -1;
  16868. __pyx_L0:;
  16869. __Pyx_RefNannyFinishContext();
  16870. return __pyx_r;
  16871. }
  16872. /* "array.pxd":93
  16873. * __data_union data
  16874. *
  16875. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  16876. * # This implementation of getbuffer is geared towards Cython
  16877. * # requirements, and does not yet fulfill the PEP.
  16878. */
  16879. /* Python wrapper */
  16880. 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*/
  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) {
  16882. int __pyx_r;
  16883. __Pyx_RefNannyDeclarations
  16884. __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
  16885. __pyx_r = __pyx_pf_7cpython_5array_5array___getbuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
  16886. /* function exit code */
  16887. __Pyx_RefNannyFinishContext();
  16888. return __pyx_r;
  16889. }
  16890. static int __pyx_pf_7cpython_5array_5array___getbuffer__(arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info, CYTHON_UNUSED int __pyx_v_flags) {
  16891. PyObject *__pyx_v_item_count = NULL;
  16892. int __pyx_r;
  16893. __Pyx_RefNannyDeclarations
  16894. PyObject *__pyx_t_1 = NULL;
  16895. char *__pyx_t_2;
  16896. int __pyx_t_3;
  16897. PyObject *__pyx_t_4 = NULL;
  16898. Py_ssize_t __pyx_t_5;
  16899. int __pyx_t_6;
  16900. char __pyx_t_7;
  16901. if (__pyx_v_info == NULL) {
  16902. PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
  16903. return -1;
  16904. }
  16905. __Pyx_RefNannySetupContext("__getbuffer__", 0);
  16906. __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  16907. __Pyx_GIVEREF(__pyx_v_info->obj);
  16908. /* "array.pxd":98
  16909. * # In particular strided access is always provided regardless
  16910. * # of flags
  16911. * item_count = Py_SIZE(self) # <<<<<<<<<<<<<<
  16912. *
  16913. * info.suboffsets = NULL
  16914. */
  16915. __pyx_t_1 = PyInt_FromSsize_t(Py_SIZE(((PyObject *)__pyx_v_self))); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
  16916. __Pyx_GOTREF(__pyx_t_1);
  16917. __pyx_v_item_count = __pyx_t_1;
  16918. __pyx_t_1 = 0;
  16919. /* "array.pxd":100
  16920. * item_count = Py_SIZE(self)
  16921. *
  16922. * info.suboffsets = NULL # <<<<<<<<<<<<<<
  16923. * info.buf = self.data.as_chars
  16924. * info.readonly = 0
  16925. */
  16926. __pyx_v_info->suboffsets = NULL;
  16927. /* "array.pxd":101
  16928. *
  16929. * info.suboffsets = NULL
  16930. * info.buf = self.data.as_chars # <<<<<<<<<<<<<<
  16931. * info.readonly = 0
  16932. * info.ndim = 1
  16933. */
  16934. __pyx_t_2 = __pyx_v_self->data.as_chars;
  16935. __pyx_v_info->buf = __pyx_t_2;
  16936. /* "array.pxd":102
  16937. * info.suboffsets = NULL
  16938. * info.buf = self.data.as_chars
  16939. * info.readonly = 0 # <<<<<<<<<<<<<<
  16940. * info.ndim = 1
  16941. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16942. */
  16943. __pyx_v_info->readonly = 0;
  16944. /* "array.pxd":103
  16945. * info.buf = self.data.as_chars
  16946. * info.readonly = 0
  16947. * info.ndim = 1 # <<<<<<<<<<<<<<
  16948. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16949. * info.len = info.itemsize * item_count
  16950. */
  16951. __pyx_v_info->ndim = 1;
  16952. /* "array.pxd":104
  16953. * info.readonly = 0
  16954. * info.ndim = 1
  16955. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float) # <<<<<<<<<<<<<<
  16956. * info.len = info.itemsize * item_count
  16957. *
  16958. */
  16959. __pyx_t_3 = __pyx_v_self->ob_descr->itemsize;
  16960. __pyx_v_info->itemsize = __pyx_t_3;
  16961. /* "array.pxd":105
  16962. * info.ndim = 1
  16963. * info.itemsize = self.ob_descr.itemsize # e.g. sizeof(float)
  16964. * info.len = info.itemsize * item_count # <<<<<<<<<<<<<<
  16965. *
  16966. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16967. */
  16968. __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_info->itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 105, __pyx_L1_error)
  16969. __Pyx_GOTREF(__pyx_t_1);
  16970. __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_item_count); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 105, __pyx_L1_error)
  16971. __Pyx_GOTREF(__pyx_t_4);
  16972. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  16973. __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)
  16974. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  16975. __pyx_v_info->len = __pyx_t_5;
  16976. /* "array.pxd":107
  16977. * info.len = info.itemsize * item_count
  16978. *
  16979. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2) # <<<<<<<<<<<<<<
  16980. * if not info.shape:
  16981. * raise MemoryError()
  16982. */
  16983. __pyx_v_info->shape = ((Py_ssize_t *)PyObject_Malloc(((sizeof(Py_ssize_t)) + 2)));
  16984. /* "array.pxd":108
  16985. *
  16986. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16987. * if not info.shape: # <<<<<<<<<<<<<<
  16988. * raise MemoryError()
  16989. * info.shape[0] = item_count # constant regardless of resizing
  16990. */
  16991. __pyx_t_6 = ((!(__pyx_v_info->shape != 0)) != 0);
  16992. if (unlikely(__pyx_t_6)) {
  16993. /* "array.pxd":109
  16994. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  16995. * if not info.shape:
  16996. * raise MemoryError() # <<<<<<<<<<<<<<
  16997. * info.shape[0] = item_count # constant regardless of resizing
  16998. * info.strides = &info.itemsize
  16999. */
  17000. PyErr_NoMemory(); __PYX_ERR(3, 109, __pyx_L1_error)
  17001. /* "array.pxd":108
  17002. *
  17003. * info.shape = <Py_ssize_t*> PyObject_Malloc(sizeof(Py_ssize_t) + 2)
  17004. * if not info.shape: # <<<<<<<<<<<<<<
  17005. * raise MemoryError()
  17006. * info.shape[0] = item_count # constant regardless of resizing
  17007. */
  17008. }
  17009. /* "array.pxd":110
  17010. * if not info.shape:
  17011. * raise MemoryError()
  17012. * info.shape[0] = item_count # constant regardless of resizing # <<<<<<<<<<<<<<
  17013. * info.strides = &info.itemsize
  17014. *
  17015. */
  17016. __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)
  17017. (__pyx_v_info->shape[0]) = __pyx_t_5;
  17018. /* "array.pxd":111
  17019. * raise MemoryError()
  17020. * info.shape[0] = item_count # constant regardless of resizing
  17021. * info.strides = &info.itemsize # <<<<<<<<<<<<<<
  17022. *
  17023. * info.format = <char*> (info.shape + 1)
  17024. */
  17025. __pyx_v_info->strides = (&__pyx_v_info->itemsize);
  17026. /* "array.pxd":113
  17027. * info.strides = &info.itemsize
  17028. *
  17029. * info.format = <char*> (info.shape + 1) # <<<<<<<<<<<<<<
  17030. * info.format[0] = self.ob_descr.typecode
  17031. * info.format[1] = 0
  17032. */
  17033. __pyx_v_info->format = ((char *)(__pyx_v_info->shape + 1));
  17034. /* "array.pxd":114
  17035. *
  17036. * info.format = <char*> (info.shape + 1)
  17037. * info.format[0] = self.ob_descr.typecode # <<<<<<<<<<<<<<
  17038. * info.format[1] = 0
  17039. * info.obj = self
  17040. */
  17041. __pyx_t_7 = __pyx_v_self->ob_descr->typecode;
  17042. (__pyx_v_info->format[0]) = __pyx_t_7;
  17043. /* "array.pxd":115
  17044. * info.format = <char*> (info.shape + 1)
  17045. * info.format[0] = self.ob_descr.typecode
  17046. * info.format[1] = 0 # <<<<<<<<<<<<<<
  17047. * info.obj = self
  17048. *
  17049. */
  17050. (__pyx_v_info->format[1]) = 0;
  17051. /* "array.pxd":116
  17052. * info.format[0] = self.ob_descr.typecode
  17053. * info.format[1] = 0
  17054. * info.obj = self # <<<<<<<<<<<<<<
  17055. *
  17056. * def __releasebuffer__(self, Py_buffer* info):
  17057. */
  17058. __Pyx_INCREF(((PyObject *)__pyx_v_self));
  17059. __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  17060. __Pyx_GOTREF(__pyx_v_info->obj);
  17061. __Pyx_DECREF(__pyx_v_info->obj);
  17062. __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
  17063. /* "array.pxd":93
  17064. * __data_union data
  17065. *
  17066. * def __getbuffer__(self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
  17067. * # This implementation of getbuffer is geared towards Cython
  17068. * # requirements, and does not yet fulfill the PEP.
  17069. */
  17070. /* function exit code */
  17071. __pyx_r = 0;
  17072. goto __pyx_L0;
  17073. __pyx_L1_error:;
  17074. __Pyx_XDECREF(__pyx_t_1);
  17075. __Pyx_XDECREF(__pyx_t_4);
  17076. __Pyx_AddTraceback("cpython.array.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17077. __pyx_r = -1;
  17078. if (__pyx_v_info->obj != NULL) {
  17079. __Pyx_GOTREF(__pyx_v_info->obj);
  17080. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  17081. }
  17082. goto __pyx_L2;
  17083. __pyx_L0:;
  17084. if (__pyx_v_info->obj == Py_None) {
  17085. __Pyx_GOTREF(__pyx_v_info->obj);
  17086. __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
  17087. }
  17088. __pyx_L2:;
  17089. __Pyx_XDECREF(__pyx_v_item_count);
  17090. __Pyx_RefNannyFinishContext();
  17091. return __pyx_r;
  17092. }
  17093. /* "array.pxd":118
  17094. * info.obj = self
  17095. *
  17096. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  17097. * PyObject_Free(info.shape)
  17098. *
  17099. */
  17100. /* Python wrapper */
  17101. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
  17102. static CYTHON_UNUSED void __pyx_pw_7cpython_5array_5array_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  17103. __Pyx_RefNannyDeclarations
  17104. __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
  17105. __pyx_pf_7cpython_5array_5array_2__releasebuffer__(((arrayobject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
  17106. /* function exit code */
  17107. __Pyx_RefNannyFinishContext();
  17108. }
  17109. static void __pyx_pf_7cpython_5array_5array_2__releasebuffer__(CYTHON_UNUSED arrayobject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  17110. __Pyx_RefNannyDeclarations
  17111. __Pyx_RefNannySetupContext("__releasebuffer__", 0);
  17112. /* "array.pxd":119
  17113. *
  17114. * def __releasebuffer__(self, Py_buffer* info):
  17115. * PyObject_Free(info.shape) # <<<<<<<<<<<<<<
  17116. *
  17117. * array newarrayobject(PyTypeObject* type, Py_ssize_t size, arraydescr *descr)
  17118. */
  17119. PyObject_Free(__pyx_v_info->shape);
  17120. /* "array.pxd":118
  17121. * info.obj = self
  17122. *
  17123. * def __releasebuffer__(self, Py_buffer* info): # <<<<<<<<<<<<<<
  17124. * PyObject_Free(info.shape)
  17125. *
  17126. */
  17127. /* function exit code */
  17128. __Pyx_RefNannyFinishContext();
  17129. }
  17130. /* "array.pxd":130
  17131. *
  17132. *
  17133. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  17134. * """ fast creation of a new array, given a template array.
  17135. * type will be same as template.
  17136. */
  17137. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_clone(arrayobject *__pyx_v_template, Py_ssize_t __pyx_v_length, int __pyx_v_zero) {
  17138. arrayobject *__pyx_v_op = NULL;
  17139. arrayobject *__pyx_r = NULL;
  17140. __Pyx_RefNannyDeclarations
  17141. PyObject *__pyx_t_1 = NULL;
  17142. int __pyx_t_2;
  17143. int __pyx_t_3;
  17144. int __pyx_t_4;
  17145. __Pyx_RefNannySetupContext("clone", 0);
  17146. /* "array.pxd":134
  17147. * type will be same as template.
  17148. * if zero is true, new array will be initialized with zeroes."""
  17149. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr) # <<<<<<<<<<<<<<
  17150. * if zero and op is not None:
  17151. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17152. */
  17153. __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)
  17154. __Pyx_GOTREF(__pyx_t_1);
  17155. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  17156. __pyx_t_1 = 0;
  17157. /* "array.pxd":135
  17158. * if zero is true, new array will be initialized with zeroes."""
  17159. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17160. * if zero and op is not None: # <<<<<<<<<<<<<<
  17161. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17162. * return op
  17163. */
  17164. __pyx_t_3 = (__pyx_v_zero != 0);
  17165. if (__pyx_t_3) {
  17166. } else {
  17167. __pyx_t_2 = __pyx_t_3;
  17168. goto __pyx_L4_bool_binop_done;
  17169. }
  17170. __pyx_t_3 = (((PyObject *)__pyx_v_op) != Py_None);
  17171. __pyx_t_4 = (__pyx_t_3 != 0);
  17172. __pyx_t_2 = __pyx_t_4;
  17173. __pyx_L4_bool_binop_done:;
  17174. if (__pyx_t_2) {
  17175. /* "array.pxd":136
  17176. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17177. * if zero and op is not None:
  17178. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17179. * return op
  17180. *
  17181. */
  17182. (void)(memset(__pyx_v_op->data.as_chars, 0, (__pyx_v_length * __pyx_v_op->ob_descr->itemsize)));
  17183. /* "array.pxd":135
  17184. * if zero is true, new array will be initialized with zeroes."""
  17185. * op = newarrayobject(Py_TYPE(template), length, template.ob_descr)
  17186. * if zero and op is not None: # <<<<<<<<<<<<<<
  17187. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17188. * return op
  17189. */
  17190. }
  17191. /* "array.pxd":137
  17192. * if zero and op is not None:
  17193. * memset(op.data.as_chars, 0, length * op.ob_descr.itemsize)
  17194. * return op # <<<<<<<<<<<<<<
  17195. *
  17196. * cdef inline array copy(array self):
  17197. */
  17198. __Pyx_XDECREF(((PyObject *)__pyx_r));
  17199. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  17200. __pyx_r = __pyx_v_op;
  17201. goto __pyx_L0;
  17202. /* "array.pxd":130
  17203. *
  17204. *
  17205. * cdef inline array clone(array template, Py_ssize_t length, bint zero): # <<<<<<<<<<<<<<
  17206. * """ fast creation of a new array, given a template array.
  17207. * type will be same as template.
  17208. */
  17209. /* function exit code */
  17210. __pyx_L1_error:;
  17211. __Pyx_XDECREF(__pyx_t_1);
  17212. __Pyx_AddTraceback("cpython.array.clone", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17213. __pyx_r = 0;
  17214. __pyx_L0:;
  17215. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17216. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17217. __Pyx_RefNannyFinishContext();
  17218. return __pyx_r;
  17219. }
  17220. /* "array.pxd":139
  17221. * return op
  17222. *
  17223. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17224. * """ make a copy of an array. """
  17225. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17226. */
  17227. static CYTHON_INLINE arrayobject *__pyx_f_7cpython_5array_copy(arrayobject *__pyx_v_self) {
  17228. arrayobject *__pyx_v_op = NULL;
  17229. arrayobject *__pyx_r = NULL;
  17230. __Pyx_RefNannyDeclarations
  17231. PyObject *__pyx_t_1 = NULL;
  17232. __Pyx_RefNannySetupContext("copy", 0);
  17233. /* "array.pxd":141
  17234. * cdef inline array copy(array self):
  17235. * """ make a copy of an array. """
  17236. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr) # <<<<<<<<<<<<<<
  17237. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17238. * return op
  17239. */
  17240. __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)
  17241. __Pyx_GOTREF(__pyx_t_1);
  17242. __pyx_v_op = ((arrayobject *)__pyx_t_1);
  17243. __pyx_t_1 = 0;
  17244. /* "array.pxd":142
  17245. * """ make a copy of an array. """
  17246. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17247. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17248. * return op
  17249. *
  17250. */
  17251. (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)));
  17252. /* "array.pxd":143
  17253. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17254. * memcpy(op.data.as_chars, self.data.as_chars, Py_SIZE(op) * op.ob_descr.itemsize)
  17255. * return op # <<<<<<<<<<<<<<
  17256. *
  17257. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1:
  17258. */
  17259. __Pyx_XDECREF(((PyObject *)__pyx_r));
  17260. __Pyx_INCREF(((PyObject *)__pyx_v_op));
  17261. __pyx_r = __pyx_v_op;
  17262. goto __pyx_L0;
  17263. /* "array.pxd":139
  17264. * return op
  17265. *
  17266. * cdef inline array copy(array self): # <<<<<<<<<<<<<<
  17267. * """ make a copy of an array. """
  17268. * op = newarrayobject(Py_TYPE(self), Py_SIZE(self), self.ob_descr)
  17269. */
  17270. /* function exit code */
  17271. __pyx_L1_error:;
  17272. __Pyx_XDECREF(__pyx_t_1);
  17273. __Pyx_AddTraceback("cpython.array.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17274. __pyx_r = 0;
  17275. __pyx_L0:;
  17276. __Pyx_XDECREF((PyObject *)__pyx_v_op);
  17277. __Pyx_XGIVEREF((PyObject *)__pyx_r);
  17278. __Pyx_RefNannyFinishContext();
  17279. return __pyx_r;
  17280. }
  17281. /* "array.pxd":145
  17282. * return op
  17283. *
  17284. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17285. * """ efficient appending of new stuff of same type
  17286. * (e.g. of same array type)
  17287. */
  17288. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend_buffer(arrayobject *__pyx_v_self, char *__pyx_v_stuff, Py_ssize_t __pyx_v_n) {
  17289. Py_ssize_t __pyx_v_itemsize;
  17290. Py_ssize_t __pyx_v_origsize;
  17291. int __pyx_r;
  17292. __Pyx_RefNannyDeclarations
  17293. int __pyx_t_1;
  17294. __Pyx_RefNannySetupContext("extend_buffer", 0);
  17295. /* "array.pxd":149
  17296. * (e.g. of same array type)
  17297. * n: number of elements (not number of bytes!) """
  17298. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize # <<<<<<<<<<<<<<
  17299. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17300. * resize_smart(self, origsize + n)
  17301. */
  17302. __pyx_t_1 = __pyx_v_self->ob_descr->itemsize;
  17303. __pyx_v_itemsize = __pyx_t_1;
  17304. /* "array.pxd":150
  17305. * n: number of elements (not number of bytes!) """
  17306. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17307. * cdef Py_ssize_t origsize = Py_SIZE(self) # <<<<<<<<<<<<<<
  17308. * resize_smart(self, origsize + n)
  17309. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17310. */
  17311. __pyx_v_origsize = Py_SIZE(((PyObject *)__pyx_v_self));
  17312. /* "array.pxd":151
  17313. * cdef Py_ssize_t itemsize = self.ob_descr.itemsize
  17314. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17315. * resize_smart(self, origsize + n) # <<<<<<<<<<<<<<
  17316. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17317. * return 0
  17318. */
  17319. __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)
  17320. /* "array.pxd":152
  17321. * cdef Py_ssize_t origsize = Py_SIZE(self)
  17322. * resize_smart(self, origsize + n)
  17323. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize) # <<<<<<<<<<<<<<
  17324. * return 0
  17325. *
  17326. */
  17327. (void)(memcpy((__pyx_v_self->data.as_chars + (__pyx_v_origsize * __pyx_v_itemsize)), __pyx_v_stuff, (__pyx_v_n * __pyx_v_itemsize)));
  17328. /* "array.pxd":153
  17329. * resize_smart(self, origsize + n)
  17330. * memcpy(self.data.as_chars + origsize * itemsize, stuff, n * itemsize)
  17331. * return 0 # <<<<<<<<<<<<<<
  17332. *
  17333. * cdef inline int extend(array self, array other) except -1:
  17334. */
  17335. __pyx_r = 0;
  17336. goto __pyx_L0;
  17337. /* "array.pxd":145
  17338. * return op
  17339. *
  17340. * cdef inline int extend_buffer(array self, char* stuff, Py_ssize_t n) except -1: # <<<<<<<<<<<<<<
  17341. * """ efficient appending of new stuff of same type
  17342. * (e.g. of same array type)
  17343. */
  17344. /* function exit code */
  17345. __pyx_L1_error:;
  17346. __Pyx_AddTraceback("cpython.array.extend_buffer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17347. __pyx_r = -1;
  17348. __pyx_L0:;
  17349. __Pyx_RefNannyFinishContext();
  17350. return __pyx_r;
  17351. }
  17352. /* "array.pxd":155
  17353. * return 0
  17354. *
  17355. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17356. * """ extend array with data from another array; types must match. """
  17357. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17358. */
  17359. static CYTHON_INLINE int __pyx_f_7cpython_5array_extend(arrayobject *__pyx_v_self, arrayobject *__pyx_v_other) {
  17360. int __pyx_r;
  17361. __Pyx_RefNannyDeclarations
  17362. int __pyx_t_1;
  17363. int __pyx_t_2;
  17364. __Pyx_RefNannySetupContext("extend", 0);
  17365. /* "array.pxd":157
  17366. * cdef inline int extend(array self, array other) except -1:
  17367. * """ extend array with data from another array; types must match. """
  17368. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17369. * PyErr_BadArgument()
  17370. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17371. */
  17372. __pyx_t_1 = ((__pyx_v_self->ob_descr->typecode != __pyx_v_other->ob_descr->typecode) != 0);
  17373. if (__pyx_t_1) {
  17374. /* "array.pxd":158
  17375. * """ extend array with data from another array; types must match. """
  17376. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17377. * PyErr_BadArgument() # <<<<<<<<<<<<<<
  17378. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17379. *
  17380. */
  17381. __pyx_t_2 = PyErr_BadArgument(); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(3, 158, __pyx_L1_error)
  17382. /* "array.pxd":157
  17383. * cdef inline int extend(array self, array other) except -1:
  17384. * """ extend array with data from another array; types must match. """
  17385. * if self.ob_descr.typecode != other.ob_descr.typecode: # <<<<<<<<<<<<<<
  17386. * PyErr_BadArgument()
  17387. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17388. */
  17389. }
  17390. /* "array.pxd":159
  17391. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17392. * PyErr_BadArgument()
  17393. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other)) # <<<<<<<<<<<<<<
  17394. *
  17395. * cdef inline void zero(array self):
  17396. */
  17397. __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)
  17398. __pyx_r = __pyx_t_2;
  17399. goto __pyx_L0;
  17400. /* "array.pxd":155
  17401. * return 0
  17402. *
  17403. * cdef inline int extend(array self, array other) except -1: # <<<<<<<<<<<<<<
  17404. * """ extend array with data from another array; types must match. """
  17405. * if self.ob_descr.typecode != other.ob_descr.typecode:
  17406. */
  17407. /* function exit code */
  17408. __pyx_L1_error:;
  17409. __Pyx_AddTraceback("cpython.array.extend", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17410. __pyx_r = -1;
  17411. __pyx_L0:;
  17412. __Pyx_RefNannyFinishContext();
  17413. return __pyx_r;
  17414. }
  17415. /* "array.pxd":161
  17416. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17417. *
  17418. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17419. * """ set all elements of array to zero. """
  17420. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17421. */
  17422. static CYTHON_INLINE void __pyx_f_7cpython_5array_zero(arrayobject *__pyx_v_self) {
  17423. __Pyx_RefNannyDeclarations
  17424. __Pyx_RefNannySetupContext("zero", 0);
  17425. /* "array.pxd":163
  17426. * cdef inline void zero(array self):
  17427. * """ set all elements of array to zero. """
  17428. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize) # <<<<<<<<<<<<<<
  17429. */
  17430. (void)(memset(__pyx_v_self->data.as_chars, 0, (Py_SIZE(((PyObject *)__pyx_v_self)) * __pyx_v_self->ob_descr->itemsize)));
  17431. /* "array.pxd":161
  17432. * return extend_buffer(self, other.data.as_chars, Py_SIZE(other))
  17433. *
  17434. * cdef inline void zero(array self): # <<<<<<<<<<<<<<
  17435. * """ set all elements of array to zero. """
  17436. * memset(self.data.as_chars, 0, Py_SIZE(self) * self.ob_descr.itemsize)
  17437. */
  17438. /* function exit code */
  17439. __Pyx_RefNannyFinishContext();
  17440. }
  17441. /* "string.to_py":31
  17442. *
  17443. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17444. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17445. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17446. * cdef extern from *:
  17447. */
  17448. static CYTHON_INLINE PyObject *__pyx_convert_PyObject_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17449. PyObject *__pyx_r = NULL;
  17450. __Pyx_RefNannyDeclarations
  17451. PyObject *__pyx_t_1 = NULL;
  17452. __Pyx_RefNannySetupContext("__pyx_convert_PyObject_string_to_py_std__in_string", 0);
  17453. /* "string.to_py":32
  17454. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17455. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s):
  17456. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17457. * cdef extern from *:
  17458. * cdef object __Pyx_PyUnicode_FromStringAndSize(const char*, size_t)
  17459. */
  17460. __Pyx_XDECREF(__pyx_r);
  17461. __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)
  17462. __Pyx_GOTREF(__pyx_t_1);
  17463. __pyx_r = __pyx_t_1;
  17464. __pyx_t_1 = 0;
  17465. goto __pyx_L0;
  17466. /* "string.to_py":31
  17467. *
  17468. * @cname("__pyx_convert_PyObject_string_to_py_std__in_string")
  17469. * cdef inline object __pyx_convert_PyObject_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17470. * return __Pyx_PyObject_FromStringAndSize(s.data(), s.size())
  17471. * cdef extern from *:
  17472. */
  17473. /* function exit code */
  17474. __pyx_L1_error:;
  17475. __Pyx_XDECREF(__pyx_t_1);
  17476. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyObject_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17477. __pyx_r = 0;
  17478. __pyx_L0:;
  17479. __Pyx_XGIVEREF(__pyx_r);
  17480. __Pyx_RefNannyFinishContext();
  17481. return __pyx_r;
  17482. }
  17483. /* "string.to_py":37
  17484. *
  17485. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17486. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17487. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17488. * cdef extern from *:
  17489. */
  17490. static CYTHON_INLINE PyObject *__pyx_convert_PyUnicode_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17491. PyObject *__pyx_r = NULL;
  17492. __Pyx_RefNannyDeclarations
  17493. PyObject *__pyx_t_1 = NULL;
  17494. __Pyx_RefNannySetupContext("__pyx_convert_PyUnicode_string_to_py_std__in_string", 0);
  17495. /* "string.to_py":38
  17496. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17497. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s):
  17498. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17499. * cdef extern from *:
  17500. * cdef object __Pyx_PyStr_FromStringAndSize(const char*, size_t)
  17501. */
  17502. __Pyx_XDECREF(__pyx_r);
  17503. __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)
  17504. __Pyx_GOTREF(__pyx_t_1);
  17505. __pyx_r = __pyx_t_1;
  17506. __pyx_t_1 = 0;
  17507. goto __pyx_L0;
  17508. /* "string.to_py":37
  17509. *
  17510. * @cname("__pyx_convert_PyUnicode_string_to_py_std__in_string")
  17511. * cdef inline object __pyx_convert_PyUnicode_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17512. * return __Pyx_PyUnicode_FromStringAndSize(s.data(), s.size())
  17513. * cdef extern from *:
  17514. */
  17515. /* function exit code */
  17516. __pyx_L1_error:;
  17517. __Pyx_XDECREF(__pyx_t_1);
  17518. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyUnicode_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17519. __pyx_r = 0;
  17520. __pyx_L0:;
  17521. __Pyx_XGIVEREF(__pyx_r);
  17522. __Pyx_RefNannyFinishContext();
  17523. return __pyx_r;
  17524. }
  17525. /* "string.to_py":43
  17526. *
  17527. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17528. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17529. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17530. * cdef extern from *:
  17531. */
  17532. static CYTHON_INLINE PyObject *__pyx_convert_PyStr_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17533. PyObject *__pyx_r = NULL;
  17534. __Pyx_RefNannyDeclarations
  17535. PyObject *__pyx_t_1 = NULL;
  17536. __Pyx_RefNannySetupContext("__pyx_convert_PyStr_string_to_py_std__in_string", 0);
  17537. /* "string.to_py":44
  17538. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17539. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s):
  17540. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17541. * cdef extern from *:
  17542. * cdef object __Pyx_PyBytes_FromStringAndSize(const char*, size_t)
  17543. */
  17544. __Pyx_XDECREF(__pyx_r);
  17545. __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)
  17546. __Pyx_GOTREF(__pyx_t_1);
  17547. __pyx_r = __pyx_t_1;
  17548. __pyx_t_1 = 0;
  17549. goto __pyx_L0;
  17550. /* "string.to_py":43
  17551. *
  17552. * @cname("__pyx_convert_PyStr_string_to_py_std__in_string")
  17553. * cdef inline object __pyx_convert_PyStr_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17554. * return __Pyx_PyStr_FromStringAndSize(s.data(), s.size())
  17555. * cdef extern from *:
  17556. */
  17557. /* function exit code */
  17558. __pyx_L1_error:;
  17559. __Pyx_XDECREF(__pyx_t_1);
  17560. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyStr_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17561. __pyx_r = 0;
  17562. __pyx_L0:;
  17563. __Pyx_XGIVEREF(__pyx_r);
  17564. __Pyx_RefNannyFinishContext();
  17565. return __pyx_r;
  17566. }
  17567. /* "string.to_py":49
  17568. *
  17569. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17570. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17571. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17572. * cdef extern from *:
  17573. */
  17574. static CYTHON_INLINE PyObject *__pyx_convert_PyBytes_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17575. PyObject *__pyx_r = NULL;
  17576. __Pyx_RefNannyDeclarations
  17577. PyObject *__pyx_t_1 = NULL;
  17578. __Pyx_RefNannySetupContext("__pyx_convert_PyBytes_string_to_py_std__in_string", 0);
  17579. /* "string.to_py":50
  17580. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17581. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s):
  17582. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17583. * cdef extern from *:
  17584. * cdef object __Pyx_PyByteArray_FromStringAndSize(const char*, size_t)
  17585. */
  17586. __Pyx_XDECREF(__pyx_r);
  17587. __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)
  17588. __Pyx_GOTREF(__pyx_t_1);
  17589. __pyx_r = __pyx_t_1;
  17590. __pyx_t_1 = 0;
  17591. goto __pyx_L0;
  17592. /* "string.to_py":49
  17593. *
  17594. * @cname("__pyx_convert_PyBytes_string_to_py_std__in_string")
  17595. * cdef inline object __pyx_convert_PyBytes_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17596. * return __Pyx_PyBytes_FromStringAndSize(s.data(), s.size())
  17597. * cdef extern from *:
  17598. */
  17599. /* function exit code */
  17600. __pyx_L1_error:;
  17601. __Pyx_XDECREF(__pyx_t_1);
  17602. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyBytes_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17603. __pyx_r = 0;
  17604. __pyx_L0:;
  17605. __Pyx_XGIVEREF(__pyx_r);
  17606. __Pyx_RefNannyFinishContext();
  17607. return __pyx_r;
  17608. }
  17609. /* "string.to_py":55
  17610. *
  17611. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17612. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17613. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17614. *
  17615. */
  17616. static CYTHON_INLINE PyObject *__pyx_convert_PyByteArray_string_to_py_std__in_string(std::string const &__pyx_v_s) {
  17617. PyObject *__pyx_r = NULL;
  17618. __Pyx_RefNannyDeclarations
  17619. PyObject *__pyx_t_1 = NULL;
  17620. __Pyx_RefNannySetupContext("__pyx_convert_PyByteArray_string_to_py_std__in_string", 0);
  17621. /* "string.to_py":56
  17622. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17623. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s):
  17624. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size()) # <<<<<<<<<<<<<<
  17625. *
  17626. */
  17627. __Pyx_XDECREF(__pyx_r);
  17628. __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)
  17629. __Pyx_GOTREF(__pyx_t_1);
  17630. __pyx_r = __pyx_t_1;
  17631. __pyx_t_1 = 0;
  17632. goto __pyx_L0;
  17633. /* "string.to_py":55
  17634. *
  17635. * @cname("__pyx_convert_PyByteArray_string_to_py_std__in_string")
  17636. * cdef inline object __pyx_convert_PyByteArray_string_to_py_std__in_string(const string& s): # <<<<<<<<<<<<<<
  17637. * return __Pyx_PyByteArray_FromStringAndSize(s.data(), s.size())
  17638. *
  17639. */
  17640. /* function exit code */
  17641. __pyx_L1_error:;
  17642. __Pyx_XDECREF(__pyx_t_1);
  17643. __Pyx_AddTraceback("string.to_py.__pyx_convert_PyByteArray_string_to_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17644. __pyx_r = 0;
  17645. __pyx_L0:;
  17646. __Pyx_XGIVEREF(__pyx_r);
  17647. __Pyx_RefNannyFinishContext();
  17648. return __pyx_r;
  17649. }
  17650. /* "string.from_py":13
  17651. *
  17652. * @cname("__pyx_convert_string_from_py_std__in_string")
  17653. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17654. * cdef Py_ssize_t length = 0
  17655. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17656. */
  17657. static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  17658. Py_ssize_t __pyx_v_length;
  17659. char const *__pyx_v_data;
  17660. std::string __pyx_r;
  17661. __Pyx_RefNannyDeclarations
  17662. char const *__pyx_t_1;
  17663. __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);
  17664. /* "string.from_py":14
  17665. * @cname("__pyx_convert_string_from_py_std__in_string")
  17666. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17667. * cdef Py_ssize_t length = 0 # <<<<<<<<<<<<<<
  17668. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17669. * return string(data, length)
  17670. */
  17671. __pyx_v_length = 0;
  17672. /* "string.from_py":15
  17673. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
  17674. * cdef Py_ssize_t length = 0
  17675. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length) # <<<<<<<<<<<<<<
  17676. * return string(data, length)
  17677. *
  17678. */
  17679. __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)
  17680. __pyx_v_data = __pyx_t_1;
  17681. /* "string.from_py":16
  17682. * cdef Py_ssize_t length = 0
  17683. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17684. * return string(data, length) # <<<<<<<<<<<<<<
  17685. *
  17686. *
  17687. */
  17688. __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  17689. goto __pyx_L0;
  17690. /* "string.from_py":13
  17691. *
  17692. * @cname("__pyx_convert_string_from_py_std__in_string")
  17693. * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *: # <<<<<<<<<<<<<<
  17694. * cdef Py_ssize_t length = 0
  17695. * cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
  17696. */
  17697. /* function exit code */
  17698. __pyx_L1_error:;
  17699. __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17700. __Pyx_pretend_to_initialize(&__pyx_r);
  17701. __pyx_L0:;
  17702. __Pyx_RefNannyFinishContext();
  17703. return __pyx_r;
  17704. }
  17705. /* "pair.to_py":158
  17706. *
  17707. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17708. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17709. * return p.first, p.second
  17710. *
  17711. */
  17712. static PyObject *__pyx_convert_pair_to_py_size_t____size_t(std::pair<size_t,size_t> const &__pyx_v_p) {
  17713. PyObject *__pyx_r = NULL;
  17714. __Pyx_RefNannyDeclarations
  17715. PyObject *__pyx_t_1 = NULL;
  17716. PyObject *__pyx_t_2 = NULL;
  17717. PyObject *__pyx_t_3 = NULL;
  17718. __Pyx_RefNannySetupContext("__pyx_convert_pair_to_py_size_t____size_t", 0);
  17719. /* "pair.to_py":159
  17720. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17721. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p):
  17722. * return p.first, p.second # <<<<<<<<<<<<<<
  17723. *
  17724. *
  17725. */
  17726. __Pyx_XDECREF(__pyx_r);
  17727. __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_p.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 159, __pyx_L1_error)
  17728. __Pyx_GOTREF(__pyx_t_1);
  17729. __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_p.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 159, __pyx_L1_error)
  17730. __Pyx_GOTREF(__pyx_t_2);
  17731. __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 159, __pyx_L1_error)
  17732. __Pyx_GOTREF(__pyx_t_3);
  17733. __Pyx_GIVEREF(__pyx_t_1);
  17734. PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  17735. __Pyx_GIVEREF(__pyx_t_2);
  17736. PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  17737. __pyx_t_1 = 0;
  17738. __pyx_t_2 = 0;
  17739. __pyx_r = __pyx_t_3;
  17740. __pyx_t_3 = 0;
  17741. goto __pyx_L0;
  17742. /* "pair.to_py":158
  17743. *
  17744. * @cname("__pyx_convert_pair_to_py_size_t____size_t")
  17745. * cdef object __pyx_convert_pair_to_py_size_t____size_t(const pair[X,Y]& p): # <<<<<<<<<<<<<<
  17746. * return p.first, p.second
  17747. *
  17748. */
  17749. /* function exit code */
  17750. __pyx_L1_error:;
  17751. __Pyx_XDECREF(__pyx_t_1);
  17752. __Pyx_XDECREF(__pyx_t_2);
  17753. __Pyx_XDECREF(__pyx_t_3);
  17754. __Pyx_AddTraceback("pair.to_py.__pyx_convert_pair_to_py_size_t____size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17755. __pyx_r = 0;
  17756. __pyx_L0:;
  17757. __Pyx_XGIVEREF(__pyx_r);
  17758. __Pyx_RefNannyFinishContext();
  17759. return __pyx_r;
  17760. }
  17761. /* "vector.to_py":60
  17762. *
  17763. * @cname("__pyx_convert_vector_to_py_size_t")
  17764. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17765. * return [v[i] for i in range(v.size())]
  17766. *
  17767. */
  17768. static PyObject *__pyx_convert_vector_to_py_size_t(const std::vector<size_t> &__pyx_v_v) {
  17769. size_t __pyx_v_i;
  17770. PyObject *__pyx_r = NULL;
  17771. __Pyx_RefNannyDeclarations
  17772. PyObject *__pyx_t_1 = NULL;
  17773. size_t __pyx_t_2;
  17774. size_t __pyx_t_3;
  17775. size_t __pyx_t_4;
  17776. PyObject *__pyx_t_5 = NULL;
  17777. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_size_t", 0);
  17778. /* "vector.to_py":61
  17779. * @cname("__pyx_convert_vector_to_py_size_t")
  17780. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v):
  17781. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  17782. *
  17783. *
  17784. */
  17785. __Pyx_XDECREF(__pyx_r);
  17786. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  17787. __Pyx_GOTREF(__pyx_t_1);
  17788. __pyx_t_2 = __pyx_v_v.size();
  17789. __pyx_t_3 = __pyx_t_2;
  17790. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  17791. __pyx_v_i = __pyx_t_4;
  17792. __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)
  17793. __Pyx_GOTREF(__pyx_t_5);
  17794. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  17795. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  17796. }
  17797. __pyx_r = __pyx_t_1;
  17798. __pyx_t_1 = 0;
  17799. goto __pyx_L0;
  17800. /* "vector.to_py":60
  17801. *
  17802. * @cname("__pyx_convert_vector_to_py_size_t")
  17803. * cdef object __pyx_convert_vector_to_py_size_t(vector[X]& v): # <<<<<<<<<<<<<<
  17804. * return [v[i] for i in range(v.size())]
  17805. *
  17806. */
  17807. /* function exit code */
  17808. __pyx_L1_error:;
  17809. __Pyx_XDECREF(__pyx_t_1);
  17810. __Pyx_XDECREF(__pyx_t_5);
  17811. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  17812. __pyx_r = 0;
  17813. __pyx_L0:;
  17814. __Pyx_XGIVEREF(__pyx_r);
  17815. __Pyx_RefNannyFinishContext();
  17816. return __pyx_r;
  17817. }
  17818. /* "map.from_py":174
  17819. *
  17820. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17821. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17822. * cdef dict d = o
  17823. * cdef map[X,Y] m
  17824. */
  17825. 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) {
  17826. PyObject *__pyx_v_d = 0;
  17827. std::map<std::string,std::string> __pyx_v_m;
  17828. PyObject *__pyx_v_key = NULL;
  17829. PyObject *__pyx_v_value = NULL;
  17830. std::map<std::string,std::string> __pyx_r;
  17831. __Pyx_RefNannyDeclarations
  17832. PyObject *__pyx_t_1 = NULL;
  17833. Py_ssize_t __pyx_t_2;
  17834. Py_ssize_t __pyx_t_3;
  17835. int __pyx_t_4;
  17836. PyObject *__pyx_t_5 = NULL;
  17837. PyObject *__pyx_t_6 = NULL;
  17838. int __pyx_t_7;
  17839. std::string __pyx_t_8;
  17840. std::string __pyx_t_9;
  17841. __Pyx_RefNannySetupContext("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string", 0);
  17842. /* "map.from_py":175
  17843. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17844. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *:
  17845. * cdef dict d = o # <<<<<<<<<<<<<<
  17846. * cdef map[X,Y] m
  17847. * for key, value in d.iteritems():
  17848. */
  17849. 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)
  17850. __pyx_t_1 = __pyx_v_o;
  17851. __Pyx_INCREF(__pyx_t_1);
  17852. __pyx_v_d = ((PyObject*)__pyx_t_1);
  17853. __pyx_t_1 = 0;
  17854. /* "map.from_py":177
  17855. * cdef dict d = o
  17856. * cdef map[X,Y] m
  17857. * for key, value in d.iteritems(): # <<<<<<<<<<<<<<
  17858. * m.insert(pair[X,Y](<X>key, <Y>value))
  17859. * return m
  17860. */
  17861. __pyx_t_2 = 0;
  17862. if (unlikely(__pyx_v_d == Py_None)) {
  17863. PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
  17864. __PYX_ERR(1, 177, __pyx_L1_error)
  17865. }
  17866. __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)
  17867. __Pyx_GOTREF(__pyx_t_5);
  17868. __Pyx_XDECREF(__pyx_t_1);
  17869. __pyx_t_1 = __pyx_t_5;
  17870. __pyx_t_5 = 0;
  17871. while (1) {
  17872. __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);
  17873. if (unlikely(__pyx_t_7 == 0)) break;
  17874. if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(1, 177, __pyx_L1_error)
  17875. __Pyx_GOTREF(__pyx_t_5);
  17876. __Pyx_GOTREF(__pyx_t_6);
  17877. __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_5);
  17878. __pyx_t_5 = 0;
  17879. __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_6);
  17880. __pyx_t_6 = 0;
  17881. /* "map.from_py":178
  17882. * cdef map[X,Y] m
  17883. * for key, value in d.iteritems():
  17884. * m.insert(pair[X,Y](<X>key, <Y>value)) # <<<<<<<<<<<<<<
  17885. * return m
  17886. *
  17887. */
  17888. __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)
  17889. __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)
  17890. __pyx_v_m.insert(std::pair<std::string,std::string> (((std::string)__pyx_t_8), ((std::string)__pyx_t_9)));
  17891. }
  17892. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17893. /* "map.from_py":179
  17894. * for key, value in d.iteritems():
  17895. * m.insert(pair[X,Y](<X>key, <Y>value))
  17896. * return m # <<<<<<<<<<<<<<
  17897. *
  17898. *
  17899. */
  17900. __pyx_r = __pyx_v_m;
  17901. goto __pyx_L0;
  17902. /* "map.from_py":174
  17903. *
  17904. * @cname("__pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string")
  17905. * cdef map[X,Y] __pyx_convert_map_from_py_std_3a__3a_string__and_std_3a__3a_string(object o) except *: # <<<<<<<<<<<<<<
  17906. * cdef dict d = o
  17907. * cdef map[X,Y] m
  17908. */
  17909. /* function exit code */
  17910. __pyx_L1_error:;
  17911. __Pyx_XDECREF(__pyx_t_1);
  17912. __Pyx_XDECREF(__pyx_t_5);
  17913. __Pyx_XDECREF(__pyx_t_6);
  17914. __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);
  17915. __Pyx_pretend_to_initialize(&__pyx_r);
  17916. __pyx_L0:;
  17917. __Pyx_XDECREF(__pyx_v_d);
  17918. __Pyx_XDECREF(__pyx_v_key);
  17919. __Pyx_XDECREF(__pyx_v_value);
  17920. __Pyx_RefNannyFinishContext();
  17921. return __pyx_r;
  17922. }
  17923. /* "map.to_py":201
  17924. *
  17925. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17926. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  17927. * o = {}
  17928. * cdef const map[X,Y].value_type *key_value
  17929. */
  17930. 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) {
  17931. PyObject *__pyx_v_o = NULL;
  17932. std::map<std::string,std::string> ::value_type const *__pyx_v_key_value;
  17933. std::map<std::string,std::string> ::const_iterator __pyx_v_iter;
  17934. PyObject *__pyx_r = NULL;
  17935. __Pyx_RefNannyDeclarations
  17936. PyObject *__pyx_t_1 = NULL;
  17937. int __pyx_t_2;
  17938. PyObject *__pyx_t_3 = NULL;
  17939. __Pyx_RefNannySetupContext("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", 0);
  17940. /* "map.to_py":202
  17941. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  17942. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s):
  17943. * o = {} # <<<<<<<<<<<<<<
  17944. * cdef const map[X,Y].value_type *key_value
  17945. * cdef map[X,Y].const_iterator iter = s.begin()
  17946. */
  17947. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  17948. __Pyx_GOTREF(__pyx_t_1);
  17949. __pyx_v_o = ((PyObject*)__pyx_t_1);
  17950. __pyx_t_1 = 0;
  17951. /* "map.to_py":204
  17952. * o = {}
  17953. * cdef const map[X,Y].value_type *key_value
  17954. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  17955. * while iter != s.end():
  17956. * key_value = &cython.operator.dereference(iter)
  17957. */
  17958. __pyx_v_iter = __pyx_v_s.begin();
  17959. /* "map.to_py":205
  17960. * cdef const map[X,Y].value_type *key_value
  17961. * cdef map[X,Y].const_iterator iter = s.begin()
  17962. * while iter != s.end(): # <<<<<<<<<<<<<<
  17963. * key_value = &cython.operator.dereference(iter)
  17964. * o[key_value.first] = key_value.second
  17965. */
  17966. while (1) {
  17967. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  17968. if (!__pyx_t_2) break;
  17969. /* "map.to_py":206
  17970. * cdef map[X,Y].const_iterator iter = s.begin()
  17971. * while iter != s.end():
  17972. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  17973. * o[key_value.first] = key_value.second
  17974. * cython.operator.preincrement(iter)
  17975. */
  17976. __pyx_v_key_value = (&(*__pyx_v_iter));
  17977. /* "map.to_py":207
  17978. * while iter != s.end():
  17979. * key_value = &cython.operator.dereference(iter)
  17980. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  17981. * cython.operator.preincrement(iter)
  17982. * return o
  17983. */
  17984. __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)
  17985. __Pyx_GOTREF(__pyx_t_1);
  17986. __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)
  17987. __Pyx_GOTREF(__pyx_t_3);
  17988. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  17989. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  17990. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  17991. /* "map.to_py":208
  17992. * key_value = &cython.operator.dereference(iter)
  17993. * o[key_value.first] = key_value.second
  17994. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  17995. * return o
  17996. *
  17997. */
  17998. (void)((++__pyx_v_iter));
  17999. }
  18000. /* "map.to_py":209
  18001. * o[key_value.first] = key_value.second
  18002. * cython.operator.preincrement(iter)
  18003. * return o # <<<<<<<<<<<<<<
  18004. *
  18005. *
  18006. */
  18007. __Pyx_XDECREF(__pyx_r);
  18008. __Pyx_INCREF(__pyx_v_o);
  18009. __pyx_r = __pyx_v_o;
  18010. goto __pyx_L0;
  18011. /* "map.to_py":201
  18012. *
  18013. * @cname("__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string")
  18014. * cdef object __pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string(const map[X,Y]& s): # <<<<<<<<<<<<<<
  18015. * o = {}
  18016. * cdef const map[X,Y].value_type *key_value
  18017. */
  18018. /* function exit code */
  18019. __pyx_L1_error:;
  18020. __Pyx_XDECREF(__pyx_t_1);
  18021. __Pyx_XDECREF(__pyx_t_3);
  18022. __Pyx_AddTraceback("map.to_py.__pyx_convert_map_to_py_std_3a__3a_string____std_3a__3a_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18023. __pyx_r = 0;
  18024. __pyx_L0:;
  18025. __Pyx_XDECREF(__pyx_v_o);
  18026. __Pyx_XGIVEREF(__pyx_r);
  18027. __Pyx_RefNannyFinishContext();
  18028. return __pyx_r;
  18029. }
  18030. 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) {
  18031. PyObject *__pyx_v_o = NULL;
  18032. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::value_type const *__pyx_v_key_value;
  18033. std::map<std::pair<size_t,size_t> ,std::map<std::string,std::string> > ::const_iterator __pyx_v_iter;
  18034. PyObject *__pyx_r = NULL;
  18035. __Pyx_RefNannyDeclarations
  18036. PyObject *__pyx_t_1 = NULL;
  18037. int __pyx_t_2;
  18038. PyObject *__pyx_t_3 = NULL;
  18039. __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);
  18040. /* "map.to_py":202
  18041. * @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___")
  18042. * 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):
  18043. * o = {} # <<<<<<<<<<<<<<
  18044. * cdef const map[X,Y].value_type *key_value
  18045. * cdef map[X,Y].const_iterator iter = s.begin()
  18046. */
  18047. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 202, __pyx_L1_error)
  18048. __Pyx_GOTREF(__pyx_t_1);
  18049. __pyx_v_o = ((PyObject*)__pyx_t_1);
  18050. __pyx_t_1 = 0;
  18051. /* "map.to_py":204
  18052. * o = {}
  18053. * cdef const map[X,Y].value_type *key_value
  18054. * cdef map[X,Y].const_iterator iter = s.begin() # <<<<<<<<<<<<<<
  18055. * while iter != s.end():
  18056. * key_value = &cython.operator.dereference(iter)
  18057. */
  18058. __pyx_v_iter = __pyx_v_s.begin();
  18059. /* "map.to_py":205
  18060. * cdef const map[X,Y].value_type *key_value
  18061. * cdef map[X,Y].const_iterator iter = s.begin()
  18062. * while iter != s.end(): # <<<<<<<<<<<<<<
  18063. * key_value = &cython.operator.dereference(iter)
  18064. * o[key_value.first] = key_value.second
  18065. */
  18066. while (1) {
  18067. __pyx_t_2 = ((__pyx_v_iter != __pyx_v_s.end()) != 0);
  18068. if (!__pyx_t_2) break;
  18069. /* "map.to_py":206
  18070. * cdef map[X,Y].const_iterator iter = s.begin()
  18071. * while iter != s.end():
  18072. * key_value = &cython.operator.dereference(iter) # <<<<<<<<<<<<<<
  18073. * o[key_value.first] = key_value.second
  18074. * cython.operator.preincrement(iter)
  18075. */
  18076. __pyx_v_key_value = (&(*__pyx_v_iter));
  18077. /* "map.to_py":207
  18078. * while iter != s.end():
  18079. * key_value = &cython.operator.dereference(iter)
  18080. * o[key_value.first] = key_value.second # <<<<<<<<<<<<<<
  18081. * cython.operator.preincrement(iter)
  18082. * return o
  18083. */
  18084. __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)
  18085. __Pyx_GOTREF(__pyx_t_1);
  18086. __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)
  18087. __Pyx_GOTREF(__pyx_t_3);
  18088. if (unlikely(PyDict_SetItem(__pyx_v_o, __pyx_t_3, __pyx_t_1) < 0)) __PYX_ERR(1, 207, __pyx_L1_error)
  18089. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  18090. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18091. /* "map.to_py":208
  18092. * key_value = &cython.operator.dereference(iter)
  18093. * o[key_value.first] = key_value.second
  18094. * cython.operator.preincrement(iter) # <<<<<<<<<<<<<<
  18095. * return o
  18096. *
  18097. */
  18098. (void)((++__pyx_v_iter));
  18099. }
  18100. /* "map.to_py":209
  18101. * o[key_value.first] = key_value.second
  18102. * cython.operator.preincrement(iter)
  18103. * return o # <<<<<<<<<<<<<<
  18104. *
  18105. *
  18106. */
  18107. __Pyx_XDECREF(__pyx_r);
  18108. __Pyx_INCREF(__pyx_v_o);
  18109. __pyx_r = __pyx_v_o;
  18110. goto __pyx_L0;
  18111. /* "map.to_py":201
  18112. *
  18113. * @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___")
  18114. * 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): # <<<<<<<<<<<<<<
  18115. * o = {}
  18116. * cdef const map[X,Y].value_type *key_value
  18117. */
  18118. /* function exit code */
  18119. __pyx_L1_error:;
  18120. __Pyx_XDECREF(__pyx_t_1);
  18121. __Pyx_XDECREF(__pyx_t_3);
  18122. __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);
  18123. __pyx_r = 0;
  18124. __pyx_L0:;
  18125. __Pyx_XDECREF(__pyx_v_o);
  18126. __Pyx_XGIVEREF(__pyx_r);
  18127. __Pyx_RefNannyFinishContext();
  18128. return __pyx_r;
  18129. }
  18130. /* "vector.to_py":60
  18131. *
  18132. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18133. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18134. * return [v[i] for i in range(v.size())]
  18135. *
  18136. */
  18137. 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) {
  18138. size_t __pyx_v_i;
  18139. PyObject *__pyx_r = NULL;
  18140. __Pyx_RefNannyDeclarations
  18141. PyObject *__pyx_t_1 = NULL;
  18142. size_t __pyx_t_2;
  18143. size_t __pyx_t_3;
  18144. size_t __pyx_t_4;
  18145. PyObject *__pyx_t_5 = NULL;
  18146. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18147. /* "vector.to_py":61
  18148. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18149. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v):
  18150. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18151. *
  18152. *
  18153. */
  18154. __Pyx_XDECREF(__pyx_r);
  18155. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18156. __Pyx_GOTREF(__pyx_t_1);
  18157. __pyx_t_2 = __pyx_v_v.size();
  18158. __pyx_t_3 = __pyx_t_2;
  18159. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18160. __pyx_v_i = __pyx_t_4;
  18161. __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)
  18162. __Pyx_GOTREF(__pyx_t_5);
  18163. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18164. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18165. }
  18166. __pyx_r = __pyx_t_1;
  18167. __pyx_t_1 = 0;
  18168. goto __pyx_L0;
  18169. /* "vector.to_py":60
  18170. *
  18171. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___")
  18172. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18173. * return [v[i] for i in range(v.size())]
  18174. *
  18175. */
  18176. /* function exit code */
  18177. __pyx_L1_error:;
  18178. __Pyx_XDECREF(__pyx_t_1);
  18179. __Pyx_XDECREF(__pyx_t_5);
  18180. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18181. __pyx_r = 0;
  18182. __pyx_L0:;
  18183. __Pyx_XGIVEREF(__pyx_r);
  18184. __Pyx_RefNannyFinishContext();
  18185. return __pyx_r;
  18186. }
  18187. /* "vector.from_py":45
  18188. *
  18189. * @cname("__pyx_convert_vector_from_py_double")
  18190. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  18191. * cdef vector[X] v
  18192. * for item in o:
  18193. */
  18194. static std::vector<double> __pyx_convert_vector_from_py_double(PyObject *__pyx_v_o) {
  18195. std::vector<double> __pyx_v_v;
  18196. PyObject *__pyx_v_item = NULL;
  18197. std::vector<double> __pyx_r;
  18198. __Pyx_RefNannyDeclarations
  18199. PyObject *__pyx_t_1 = NULL;
  18200. Py_ssize_t __pyx_t_2;
  18201. PyObject *(*__pyx_t_3)(PyObject *);
  18202. PyObject *__pyx_t_4 = NULL;
  18203. double __pyx_t_5;
  18204. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_double", 0);
  18205. /* "vector.from_py":47
  18206. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  18207. * cdef vector[X] v
  18208. * for item in o: # <<<<<<<<<<<<<<
  18209. * v.push_back(<X>item)
  18210. * return v
  18211. */
  18212. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18213. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18214. __pyx_t_3 = NULL;
  18215. } else {
  18216. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18217. __Pyx_GOTREF(__pyx_t_1);
  18218. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18219. }
  18220. for (;;) {
  18221. if (likely(!__pyx_t_3)) {
  18222. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18223. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18224. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18225. __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)
  18226. #else
  18227. __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)
  18228. __Pyx_GOTREF(__pyx_t_4);
  18229. #endif
  18230. } else {
  18231. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18232. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18233. __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)
  18234. #else
  18235. __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)
  18236. __Pyx_GOTREF(__pyx_t_4);
  18237. #endif
  18238. }
  18239. } else {
  18240. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18241. if (unlikely(!__pyx_t_4)) {
  18242. PyObject* exc_type = PyErr_Occurred();
  18243. if (exc_type) {
  18244. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18245. else __PYX_ERR(1, 47, __pyx_L1_error)
  18246. }
  18247. break;
  18248. }
  18249. __Pyx_GOTREF(__pyx_t_4);
  18250. }
  18251. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18252. __pyx_t_4 = 0;
  18253. /* "vector.from_py":48
  18254. * cdef vector[X] v
  18255. * for item in o:
  18256. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18257. * return v
  18258. *
  18259. */
  18260. __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)
  18261. __pyx_v_v.push_back(((double)__pyx_t_5));
  18262. /* "vector.from_py":47
  18263. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *:
  18264. * cdef vector[X] v
  18265. * for item in o: # <<<<<<<<<<<<<<
  18266. * v.push_back(<X>item)
  18267. * return v
  18268. */
  18269. }
  18270. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18271. /* "vector.from_py":49
  18272. * for item in o:
  18273. * v.push_back(<X>item)
  18274. * return v # <<<<<<<<<<<<<<
  18275. *
  18276. *
  18277. */
  18278. __pyx_r = __pyx_v_v;
  18279. goto __pyx_L0;
  18280. /* "vector.from_py":45
  18281. *
  18282. * @cname("__pyx_convert_vector_from_py_double")
  18283. * cdef vector[X] __pyx_convert_vector_from_py_double(object o) except *: # <<<<<<<<<<<<<<
  18284. * cdef vector[X] v
  18285. * for item in o:
  18286. */
  18287. /* function exit code */
  18288. __pyx_L1_error:;
  18289. __Pyx_XDECREF(__pyx_t_1);
  18290. __Pyx_XDECREF(__pyx_t_4);
  18291. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18292. __Pyx_pretend_to_initialize(&__pyx_r);
  18293. __pyx_L0:;
  18294. __Pyx_XDECREF(__pyx_v_item);
  18295. __Pyx_RefNannyFinishContext();
  18296. return __pyx_r;
  18297. }
  18298. /* "vector.to_py":60
  18299. *
  18300. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18301. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18302. * return [v[i] for i in range(v.size())]
  18303. *
  18304. */
  18305. static PyObject *__pyx_convert_vector_to_py_npy_uint64(const std::vector<npy_uint64> &__pyx_v_v) {
  18306. size_t __pyx_v_i;
  18307. PyObject *__pyx_r = NULL;
  18308. __Pyx_RefNannyDeclarations
  18309. PyObject *__pyx_t_1 = NULL;
  18310. size_t __pyx_t_2;
  18311. size_t __pyx_t_3;
  18312. size_t __pyx_t_4;
  18313. PyObject *__pyx_t_5 = NULL;
  18314. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_npy_uint64", 0);
  18315. /* "vector.to_py":61
  18316. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18317. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v):
  18318. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18319. *
  18320. *
  18321. */
  18322. __Pyx_XDECREF(__pyx_r);
  18323. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18324. __Pyx_GOTREF(__pyx_t_1);
  18325. __pyx_t_2 = __pyx_v_v.size();
  18326. __pyx_t_3 = __pyx_t_2;
  18327. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18328. __pyx_v_i = __pyx_t_4;
  18329. __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)
  18330. __Pyx_GOTREF(__pyx_t_5);
  18331. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18332. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18333. }
  18334. __pyx_r = __pyx_t_1;
  18335. __pyx_t_1 = 0;
  18336. goto __pyx_L0;
  18337. /* "vector.to_py":60
  18338. *
  18339. * @cname("__pyx_convert_vector_to_py_npy_uint64")
  18340. * cdef object __pyx_convert_vector_to_py_npy_uint64(vector[X]& v): # <<<<<<<<<<<<<<
  18341. * return [v[i] for i in range(v.size())]
  18342. *
  18343. */
  18344. /* function exit code */
  18345. __pyx_L1_error:;
  18346. __Pyx_XDECREF(__pyx_t_1);
  18347. __Pyx_XDECREF(__pyx_t_5);
  18348. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_npy_uint64", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18349. __pyx_r = 0;
  18350. __pyx_L0:;
  18351. __Pyx_XGIVEREF(__pyx_r);
  18352. __Pyx_RefNannyFinishContext();
  18353. return __pyx_r;
  18354. }
  18355. 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) {
  18356. size_t __pyx_v_i;
  18357. PyObject *__pyx_r = NULL;
  18358. __Pyx_RefNannyDeclarations
  18359. PyObject *__pyx_t_1 = NULL;
  18360. size_t __pyx_t_2;
  18361. size_t __pyx_t_3;
  18362. size_t __pyx_t_4;
  18363. PyObject *__pyx_t_5 = NULL;
  18364. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  18365. /* "vector.to_py":61
  18366. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18367. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v):
  18368. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18369. *
  18370. *
  18371. */
  18372. __Pyx_XDECREF(__pyx_r);
  18373. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18374. __Pyx_GOTREF(__pyx_t_1);
  18375. __pyx_t_2 = __pyx_v_v.size();
  18376. __pyx_t_3 = __pyx_t_2;
  18377. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18378. __pyx_v_i = __pyx_t_4;
  18379. __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)
  18380. __Pyx_GOTREF(__pyx_t_5);
  18381. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18382. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18383. }
  18384. __pyx_r = __pyx_t_1;
  18385. __pyx_t_1 = 0;
  18386. goto __pyx_L0;
  18387. /* "vector.to_py":60
  18388. *
  18389. * @cname("__pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  18390. * cdef object __pyx_convert_vector_to_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18391. * return [v[i] for i in range(v.size())]
  18392. *
  18393. */
  18394. /* function exit code */
  18395. __pyx_L1_error:;
  18396. __Pyx_XDECREF(__pyx_t_1);
  18397. __Pyx_XDECREF(__pyx_t_5);
  18398. __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);
  18399. __pyx_r = 0;
  18400. __pyx_L0:;
  18401. __Pyx_XGIVEREF(__pyx_r);
  18402. __Pyx_RefNannyFinishContext();
  18403. return __pyx_r;
  18404. }
  18405. static PyObject *__pyx_convert_vector_to_py_int(const std::vector<int> &__pyx_v_v) {
  18406. size_t __pyx_v_i;
  18407. PyObject *__pyx_r = NULL;
  18408. __Pyx_RefNannyDeclarations
  18409. PyObject *__pyx_t_1 = NULL;
  18410. size_t __pyx_t_2;
  18411. size_t __pyx_t_3;
  18412. size_t __pyx_t_4;
  18413. PyObject *__pyx_t_5 = NULL;
  18414. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_int", 0);
  18415. /* "vector.to_py":61
  18416. * @cname("__pyx_convert_vector_to_py_int")
  18417. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v):
  18418. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18419. *
  18420. *
  18421. */
  18422. __Pyx_XDECREF(__pyx_r);
  18423. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18424. __Pyx_GOTREF(__pyx_t_1);
  18425. __pyx_t_2 = __pyx_v_v.size();
  18426. __pyx_t_3 = __pyx_t_2;
  18427. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18428. __pyx_v_i = __pyx_t_4;
  18429. __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)
  18430. __Pyx_GOTREF(__pyx_t_5);
  18431. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18432. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18433. }
  18434. __pyx_r = __pyx_t_1;
  18435. __pyx_t_1 = 0;
  18436. goto __pyx_L0;
  18437. /* "vector.to_py":60
  18438. *
  18439. * @cname("__pyx_convert_vector_to_py_int")
  18440. * cdef object __pyx_convert_vector_to_py_int(vector[X]& v): # <<<<<<<<<<<<<<
  18441. * return [v[i] for i in range(v.size())]
  18442. *
  18443. */
  18444. /* function exit code */
  18445. __pyx_L1_error:;
  18446. __Pyx_XDECREF(__pyx_t_1);
  18447. __Pyx_XDECREF(__pyx_t_5);
  18448. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18449. __pyx_r = 0;
  18450. __pyx_L0:;
  18451. __Pyx_XGIVEREF(__pyx_r);
  18452. __Pyx_RefNannyFinishContext();
  18453. return __pyx_r;
  18454. }
  18455. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(const std::vector<std::vector<int> > &__pyx_v_v) {
  18456. size_t __pyx_v_i;
  18457. PyObject *__pyx_r = NULL;
  18458. __Pyx_RefNannyDeclarations
  18459. PyObject *__pyx_t_1 = NULL;
  18460. size_t __pyx_t_2;
  18461. size_t __pyx_t_3;
  18462. size_t __pyx_t_4;
  18463. PyObject *__pyx_t_5 = NULL;
  18464. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", 0);
  18465. /* "vector.to_py":61
  18466. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18467. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v):
  18468. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18469. *
  18470. *
  18471. */
  18472. __Pyx_XDECREF(__pyx_r);
  18473. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18474. __Pyx_GOTREF(__pyx_t_1);
  18475. __pyx_t_2 = __pyx_v_v.size();
  18476. __pyx_t_3 = __pyx_t_2;
  18477. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18478. __pyx_v_i = __pyx_t_4;
  18479. __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)
  18480. __Pyx_GOTREF(__pyx_t_5);
  18481. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18482. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18483. }
  18484. __pyx_r = __pyx_t_1;
  18485. __pyx_t_1 = 0;
  18486. goto __pyx_L0;
  18487. /* "vector.to_py":60
  18488. *
  18489. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___")
  18490. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18491. * return [v[i] for i in range(v.size())]
  18492. *
  18493. */
  18494. /* function exit code */
  18495. __pyx_L1_error:;
  18496. __Pyx_XDECREF(__pyx_t_1);
  18497. __Pyx_XDECREF(__pyx_t_5);
  18498. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_int_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18499. __pyx_r = 0;
  18500. __pyx_L0:;
  18501. __Pyx_XGIVEREF(__pyx_r);
  18502. __Pyx_RefNannyFinishContext();
  18503. return __pyx_r;
  18504. }
  18505. 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) {
  18506. size_t __pyx_v_i;
  18507. PyObject *__pyx_r = NULL;
  18508. __Pyx_RefNannyDeclarations
  18509. PyObject *__pyx_t_1 = NULL;
  18510. size_t __pyx_t_2;
  18511. size_t __pyx_t_3;
  18512. size_t __pyx_t_4;
  18513. PyObject *__pyx_t_5 = NULL;
  18514. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", 0);
  18515. /* "vector.to_py":61
  18516. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18517. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v):
  18518. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18519. *
  18520. *
  18521. */
  18522. __Pyx_XDECREF(__pyx_r);
  18523. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18524. __Pyx_GOTREF(__pyx_t_1);
  18525. __pyx_t_2 = __pyx_v_v.size();
  18526. __pyx_t_3 = __pyx_t_2;
  18527. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18528. __pyx_v_i = __pyx_t_4;
  18529. __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)
  18530. __Pyx_GOTREF(__pyx_t_5);
  18531. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18532. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18533. }
  18534. __pyx_r = __pyx_t_1;
  18535. __pyx_t_1 = 0;
  18536. goto __pyx_L0;
  18537. /* "vector.to_py":60
  18538. *
  18539. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___")
  18540. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18541. * return [v[i] for i in range(v.size())]
  18542. *
  18543. */
  18544. /* function exit code */
  18545. __pyx_L1_error:;
  18546. __Pyx_XDECREF(__pyx_t_1);
  18547. __Pyx_XDECREF(__pyx_t_5);
  18548. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_npy_uint64_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18549. __pyx_r = 0;
  18550. __pyx_L0:;
  18551. __Pyx_XGIVEREF(__pyx_r);
  18552. __Pyx_RefNannyFinishContext();
  18553. return __pyx_r;
  18554. }
  18555. /* "vector.from_py":45
  18556. *
  18557. * @cname("__pyx_convert_vector_from_py_size_t")
  18558. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18559. * cdef vector[X] v
  18560. * for item in o:
  18561. */
  18562. static std::vector<size_t> __pyx_convert_vector_from_py_size_t(PyObject *__pyx_v_o) {
  18563. std::vector<size_t> __pyx_v_v;
  18564. PyObject *__pyx_v_item = NULL;
  18565. std::vector<size_t> __pyx_r;
  18566. __Pyx_RefNannyDeclarations
  18567. PyObject *__pyx_t_1 = NULL;
  18568. Py_ssize_t __pyx_t_2;
  18569. PyObject *(*__pyx_t_3)(PyObject *);
  18570. PyObject *__pyx_t_4 = NULL;
  18571. size_t __pyx_t_5;
  18572. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_size_t", 0);
  18573. /* "vector.from_py":47
  18574. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18575. * cdef vector[X] v
  18576. * for item in o: # <<<<<<<<<<<<<<
  18577. * v.push_back(<X>item)
  18578. * return v
  18579. */
  18580. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18581. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18582. __pyx_t_3 = NULL;
  18583. } else {
  18584. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18585. __Pyx_GOTREF(__pyx_t_1);
  18586. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18587. }
  18588. for (;;) {
  18589. if (likely(!__pyx_t_3)) {
  18590. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18591. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18592. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18593. __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)
  18594. #else
  18595. __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)
  18596. __Pyx_GOTREF(__pyx_t_4);
  18597. #endif
  18598. } else {
  18599. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18600. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18601. __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)
  18602. #else
  18603. __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)
  18604. __Pyx_GOTREF(__pyx_t_4);
  18605. #endif
  18606. }
  18607. } else {
  18608. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18609. if (unlikely(!__pyx_t_4)) {
  18610. PyObject* exc_type = PyErr_Occurred();
  18611. if (exc_type) {
  18612. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18613. else __PYX_ERR(1, 47, __pyx_L1_error)
  18614. }
  18615. break;
  18616. }
  18617. __Pyx_GOTREF(__pyx_t_4);
  18618. }
  18619. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18620. __pyx_t_4 = 0;
  18621. /* "vector.from_py":48
  18622. * cdef vector[X] v
  18623. * for item in o:
  18624. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18625. * return v
  18626. *
  18627. */
  18628. __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)
  18629. __pyx_v_v.push_back(((size_t)__pyx_t_5));
  18630. /* "vector.from_py":47
  18631. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *:
  18632. * cdef vector[X] v
  18633. * for item in o: # <<<<<<<<<<<<<<
  18634. * v.push_back(<X>item)
  18635. * return v
  18636. */
  18637. }
  18638. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18639. /* "vector.from_py":49
  18640. * for item in o:
  18641. * v.push_back(<X>item)
  18642. * return v # <<<<<<<<<<<<<<
  18643. *
  18644. *
  18645. */
  18646. __pyx_r = __pyx_v_v;
  18647. goto __pyx_L0;
  18648. /* "vector.from_py":45
  18649. *
  18650. * @cname("__pyx_convert_vector_from_py_size_t")
  18651. * cdef vector[X] __pyx_convert_vector_from_py_size_t(object o) except *: # <<<<<<<<<<<<<<
  18652. * cdef vector[X] v
  18653. * for item in o:
  18654. */
  18655. /* function exit code */
  18656. __pyx_L1_error:;
  18657. __Pyx_XDECREF(__pyx_t_1);
  18658. __Pyx_XDECREF(__pyx_t_4);
  18659. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18660. __Pyx_pretend_to_initialize(&__pyx_r);
  18661. __pyx_L0:;
  18662. __Pyx_XDECREF(__pyx_v_item);
  18663. __Pyx_RefNannyFinishContext();
  18664. return __pyx_r;
  18665. }
  18666. static std::vector<std::vector<size_t> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(PyObject *__pyx_v_o) {
  18667. std::vector<std::vector<size_t> > __pyx_v_v;
  18668. PyObject *__pyx_v_item = NULL;
  18669. std::vector<std::vector<size_t> > __pyx_r;
  18670. __Pyx_RefNannyDeclarations
  18671. PyObject *__pyx_t_1 = NULL;
  18672. Py_ssize_t __pyx_t_2;
  18673. PyObject *(*__pyx_t_3)(PyObject *);
  18674. PyObject *__pyx_t_4 = NULL;
  18675. std::vector<size_t> __pyx_t_5;
  18676. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", 0);
  18677. /* "vector.from_py":47
  18678. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18679. * cdef vector[X] v
  18680. * for item in o: # <<<<<<<<<<<<<<
  18681. * v.push_back(<X>item)
  18682. * return v
  18683. */
  18684. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18685. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18686. __pyx_t_3 = NULL;
  18687. } else {
  18688. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18689. __Pyx_GOTREF(__pyx_t_1);
  18690. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18691. }
  18692. for (;;) {
  18693. if (likely(!__pyx_t_3)) {
  18694. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18695. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18696. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18697. __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)
  18698. #else
  18699. __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)
  18700. __Pyx_GOTREF(__pyx_t_4);
  18701. #endif
  18702. } else {
  18703. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18704. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18705. __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)
  18706. #else
  18707. __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)
  18708. __Pyx_GOTREF(__pyx_t_4);
  18709. #endif
  18710. }
  18711. } else {
  18712. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18713. if (unlikely(!__pyx_t_4)) {
  18714. PyObject* exc_type = PyErr_Occurred();
  18715. if (exc_type) {
  18716. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18717. else __PYX_ERR(1, 47, __pyx_L1_error)
  18718. }
  18719. break;
  18720. }
  18721. __Pyx_GOTREF(__pyx_t_4);
  18722. }
  18723. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18724. __pyx_t_4 = 0;
  18725. /* "vector.from_py":48
  18726. * cdef vector[X] v
  18727. * for item in o:
  18728. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18729. * return v
  18730. *
  18731. */
  18732. __pyx_t_5 = __pyx_convert_vector_from_py_size_t(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18733. __pyx_v_v.push_back(((std::vector<size_t> )__pyx_t_5));
  18734. /* "vector.from_py":47
  18735. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *:
  18736. * cdef vector[X] v
  18737. * for item in o: # <<<<<<<<<<<<<<
  18738. * v.push_back(<X>item)
  18739. * return v
  18740. */
  18741. }
  18742. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18743. /* "vector.from_py":49
  18744. * for item in o:
  18745. * v.push_back(<X>item)
  18746. * return v # <<<<<<<<<<<<<<
  18747. *
  18748. *
  18749. */
  18750. __pyx_r = __pyx_v_v;
  18751. goto __pyx_L0;
  18752. /* "vector.from_py":45
  18753. *
  18754. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___")
  18755. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  18756. * cdef vector[X] v
  18757. * for item in o:
  18758. */
  18759. /* function exit code */
  18760. __pyx_L1_error:;
  18761. __Pyx_XDECREF(__pyx_t_1);
  18762. __Pyx_XDECREF(__pyx_t_4);
  18763. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_size_t_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18764. __Pyx_pretend_to_initialize(&__pyx_r);
  18765. __pyx_L0:;
  18766. __Pyx_XDECREF(__pyx_v_item);
  18767. __Pyx_RefNannyFinishContext();
  18768. return __pyx_r;
  18769. }
  18770. static std::vector<std::vector<double> > __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(PyObject *__pyx_v_o) {
  18771. std::vector<std::vector<double> > __pyx_v_v;
  18772. PyObject *__pyx_v_item = NULL;
  18773. std::vector<std::vector<double> > __pyx_r;
  18774. __Pyx_RefNannyDeclarations
  18775. PyObject *__pyx_t_1 = NULL;
  18776. Py_ssize_t __pyx_t_2;
  18777. PyObject *(*__pyx_t_3)(PyObject *);
  18778. PyObject *__pyx_t_4 = NULL;
  18779. std::vector<double> __pyx_t_5;
  18780. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", 0);
  18781. /* "vector.from_py":47
  18782. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18783. * cdef vector[X] v
  18784. * for item in o: # <<<<<<<<<<<<<<
  18785. * v.push_back(<X>item)
  18786. * return v
  18787. */
  18788. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  18789. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  18790. __pyx_t_3 = NULL;
  18791. } else {
  18792. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  18793. __Pyx_GOTREF(__pyx_t_1);
  18794. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  18795. }
  18796. for (;;) {
  18797. if (likely(!__pyx_t_3)) {
  18798. if (likely(PyList_CheckExact(__pyx_t_1))) {
  18799. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  18800. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18801. __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)
  18802. #else
  18803. __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)
  18804. __Pyx_GOTREF(__pyx_t_4);
  18805. #endif
  18806. } else {
  18807. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  18808. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  18809. __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)
  18810. #else
  18811. __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)
  18812. __Pyx_GOTREF(__pyx_t_4);
  18813. #endif
  18814. }
  18815. } else {
  18816. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  18817. if (unlikely(!__pyx_t_4)) {
  18818. PyObject* exc_type = PyErr_Occurred();
  18819. if (exc_type) {
  18820. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  18821. else __PYX_ERR(1, 47, __pyx_L1_error)
  18822. }
  18823. break;
  18824. }
  18825. __Pyx_GOTREF(__pyx_t_4);
  18826. }
  18827. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  18828. __pyx_t_4 = 0;
  18829. /* "vector.from_py":48
  18830. * cdef vector[X] v
  18831. * for item in o:
  18832. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  18833. * return v
  18834. *
  18835. */
  18836. __pyx_t_5 = __pyx_convert_vector_from_py_double(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 48, __pyx_L1_error)
  18837. __pyx_v_v.push_back(((std::vector<double> )__pyx_t_5));
  18838. /* "vector.from_py":47
  18839. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *:
  18840. * cdef vector[X] v
  18841. * for item in o: # <<<<<<<<<<<<<<
  18842. * v.push_back(<X>item)
  18843. * return v
  18844. */
  18845. }
  18846. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  18847. /* "vector.from_py":49
  18848. * for item in o:
  18849. * v.push_back(<X>item)
  18850. * return v # <<<<<<<<<<<<<<
  18851. *
  18852. *
  18853. */
  18854. __pyx_r = __pyx_v_v;
  18855. goto __pyx_L0;
  18856. /* "vector.from_py":45
  18857. *
  18858. * @cname("__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___")
  18859. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___(object o) except *: # <<<<<<<<<<<<<<
  18860. * cdef vector[X] v
  18861. * for item in o:
  18862. */
  18863. /* function exit code */
  18864. __pyx_L1_error:;
  18865. __Pyx_XDECREF(__pyx_t_1);
  18866. __Pyx_XDECREF(__pyx_t_4);
  18867. __Pyx_AddTraceback("vector.from_py.__pyx_convert_vector_from_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18868. __Pyx_pretend_to_initialize(&__pyx_r);
  18869. __pyx_L0:;
  18870. __Pyx_XDECREF(__pyx_v_item);
  18871. __Pyx_RefNannyFinishContext();
  18872. return __pyx_r;
  18873. }
  18874. /* "vector.to_py":60
  18875. *
  18876. * @cname("__pyx_convert_vector_to_py_double")
  18877. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18878. * return [v[i] for i in range(v.size())]
  18879. *
  18880. */
  18881. static PyObject *__pyx_convert_vector_to_py_double(const std::vector<double> &__pyx_v_v) {
  18882. size_t __pyx_v_i;
  18883. PyObject *__pyx_r = NULL;
  18884. __Pyx_RefNannyDeclarations
  18885. PyObject *__pyx_t_1 = NULL;
  18886. size_t __pyx_t_2;
  18887. size_t __pyx_t_3;
  18888. size_t __pyx_t_4;
  18889. PyObject *__pyx_t_5 = NULL;
  18890. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_double", 0);
  18891. /* "vector.to_py":61
  18892. * @cname("__pyx_convert_vector_to_py_double")
  18893. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v):
  18894. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18895. *
  18896. *
  18897. */
  18898. __Pyx_XDECREF(__pyx_r);
  18899. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18900. __Pyx_GOTREF(__pyx_t_1);
  18901. __pyx_t_2 = __pyx_v_v.size();
  18902. __pyx_t_3 = __pyx_t_2;
  18903. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18904. __pyx_v_i = __pyx_t_4;
  18905. __pyx_t_5 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
  18906. __Pyx_GOTREF(__pyx_t_5);
  18907. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18908. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18909. }
  18910. __pyx_r = __pyx_t_1;
  18911. __pyx_t_1 = 0;
  18912. goto __pyx_L0;
  18913. /* "vector.to_py":60
  18914. *
  18915. * @cname("__pyx_convert_vector_to_py_double")
  18916. * cdef object __pyx_convert_vector_to_py_double(vector[X]& v): # <<<<<<<<<<<<<<
  18917. * return [v[i] for i in range(v.size())]
  18918. *
  18919. */
  18920. /* function exit code */
  18921. __pyx_L1_error:;
  18922. __Pyx_XDECREF(__pyx_t_1);
  18923. __Pyx_XDECREF(__pyx_t_5);
  18924. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18925. __pyx_r = 0;
  18926. __pyx_L0:;
  18927. __Pyx_XGIVEREF(__pyx_r);
  18928. __Pyx_RefNannyFinishContext();
  18929. return __pyx_r;
  18930. }
  18931. static PyObject *__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(const std::vector<std::vector<double> > &__pyx_v_v) {
  18932. size_t __pyx_v_i;
  18933. PyObject *__pyx_r = NULL;
  18934. __Pyx_RefNannyDeclarations
  18935. PyObject *__pyx_t_1 = NULL;
  18936. size_t __pyx_t_2;
  18937. size_t __pyx_t_3;
  18938. size_t __pyx_t_4;
  18939. PyObject *__pyx_t_5 = NULL;
  18940. __Pyx_RefNannySetupContext("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", 0);
  18941. /* "vector.to_py":61
  18942. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18943. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v):
  18944. * return [v[i] for i in range(v.size())] # <<<<<<<<<<<<<<
  18945. *
  18946. *
  18947. */
  18948. __Pyx_XDECREF(__pyx_r);
  18949. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
  18950. __Pyx_GOTREF(__pyx_t_1);
  18951. __pyx_t_2 = __pyx_v_v.size();
  18952. __pyx_t_3 = __pyx_t_2;
  18953. for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
  18954. __pyx_v_i = __pyx_t_4;
  18955. __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)
  18956. __Pyx_GOTREF(__pyx_t_5);
  18957. if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 61, __pyx_L1_error)
  18958. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  18959. }
  18960. __pyx_r = __pyx_t_1;
  18961. __pyx_t_1 = 0;
  18962. goto __pyx_L0;
  18963. /* "vector.to_py":60
  18964. *
  18965. * @cname("__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___")
  18966. * cdef object __pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___(vector[X]& v): # <<<<<<<<<<<<<<
  18967. * return [v[i] for i in range(v.size())]
  18968. *
  18969. */
  18970. /* function exit code */
  18971. __pyx_L1_error:;
  18972. __Pyx_XDECREF(__pyx_t_1);
  18973. __Pyx_XDECREF(__pyx_t_5);
  18974. __Pyx_AddTraceback("vector.to_py.__pyx_convert_vector_to_py_std_3a__3a_vector_3c_double_3e___", __pyx_clineno, __pyx_lineno, __pyx_filename);
  18975. __pyx_r = 0;
  18976. __pyx_L0:;
  18977. __Pyx_XGIVEREF(__pyx_r);
  18978. __Pyx_RefNannyFinishContext();
  18979. return __pyx_r;
  18980. }
  18981. /* "vector.from_py":45
  18982. *
  18983. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  18984. * 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 *: # <<<<<<<<<<<<<<
  18985. * cdef vector[X] v
  18986. * for item in o:
  18987. */
  18988. 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) {
  18989. std::vector<std::map<std::string,std::string> > __pyx_v_v;
  18990. PyObject *__pyx_v_item = NULL;
  18991. std::vector<std::map<std::string,std::string> > __pyx_r;
  18992. __Pyx_RefNannyDeclarations
  18993. PyObject *__pyx_t_1 = NULL;
  18994. Py_ssize_t __pyx_t_2;
  18995. PyObject *(*__pyx_t_3)(PyObject *);
  18996. PyObject *__pyx_t_4 = NULL;
  18997. std::map<std::string,std::string> __pyx_t_5;
  18998. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___", 0);
  18999. /* "vector.from_py":47
  19000. * 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 *:
  19001. * cdef vector[X] v
  19002. * for item in o: # <<<<<<<<<<<<<<
  19003. * v.push_back(<X>item)
  19004. * return v
  19005. */
  19006. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  19007. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  19008. __pyx_t_3 = NULL;
  19009. } else {
  19010. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  19011. __Pyx_GOTREF(__pyx_t_1);
  19012. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  19013. }
  19014. for (;;) {
  19015. if (likely(!__pyx_t_3)) {
  19016. if (likely(PyList_CheckExact(__pyx_t_1))) {
  19017. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  19018. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19019. __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)
  19020. #else
  19021. __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)
  19022. __Pyx_GOTREF(__pyx_t_4);
  19023. #endif
  19024. } else {
  19025. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  19026. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19027. __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)
  19028. #else
  19029. __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)
  19030. __Pyx_GOTREF(__pyx_t_4);
  19031. #endif
  19032. }
  19033. } else {
  19034. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  19035. if (unlikely(!__pyx_t_4)) {
  19036. PyObject* exc_type = PyErr_Occurred();
  19037. if (exc_type) {
  19038. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  19039. else __PYX_ERR(1, 47, __pyx_L1_error)
  19040. }
  19041. break;
  19042. }
  19043. __Pyx_GOTREF(__pyx_t_4);
  19044. }
  19045. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  19046. __pyx_t_4 = 0;
  19047. /* "vector.from_py":48
  19048. * cdef vector[X] v
  19049. * for item in o:
  19050. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  19051. * return v
  19052. *
  19053. */
  19054. __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)
  19055. __pyx_v_v.push_back(((std::map<std::string,std::string> )__pyx_t_5));
  19056. /* "vector.from_py":47
  19057. * 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 *:
  19058. * cdef vector[X] v
  19059. * for item in o: # <<<<<<<<<<<<<<
  19060. * v.push_back(<X>item)
  19061. * return v
  19062. */
  19063. }
  19064. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19065. /* "vector.from_py":49
  19066. * for item in o:
  19067. * v.push_back(<X>item)
  19068. * return v # <<<<<<<<<<<<<<
  19069. *
  19070. *
  19071. */
  19072. __pyx_r = __pyx_v_v;
  19073. goto __pyx_L0;
  19074. /* "vector.from_py":45
  19075. *
  19076. * @cname("__pyx_convert_vector_from_py_std_3a__3a_map_3c_std_3a__3a_string_2c_std_3a__3a_string_3e___")
  19077. * 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 *: # <<<<<<<<<<<<<<
  19078. * cdef vector[X] v
  19079. * for item in o:
  19080. */
  19081. /* function exit code */
  19082. __pyx_L1_error:;
  19083. __Pyx_XDECREF(__pyx_t_1);
  19084. __Pyx_XDECREF(__pyx_t_4);
  19085. __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);
  19086. __Pyx_pretend_to_initialize(&__pyx_r);
  19087. __pyx_L0:;
  19088. __Pyx_XDECREF(__pyx_v_item);
  19089. __Pyx_RefNannyFinishContext();
  19090. return __pyx_r;
  19091. }
  19092. /* "pair.from_py":145
  19093. *
  19094. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19095. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<<
  19096. * x, y = o
  19097. * return pair[X,Y](<X>x, <Y>y)
  19098. */
  19099. static std::pair<size_t,size_t> __pyx_convert_pair_from_py_size_t__and_size_t(PyObject *__pyx_v_o) {
  19100. PyObject *__pyx_v_x = NULL;
  19101. PyObject *__pyx_v_y = NULL;
  19102. std::pair<size_t,size_t> __pyx_r;
  19103. __Pyx_RefNannyDeclarations
  19104. PyObject *__pyx_t_1 = NULL;
  19105. PyObject *__pyx_t_2 = NULL;
  19106. PyObject *__pyx_t_3 = NULL;
  19107. PyObject *(*__pyx_t_4)(PyObject *);
  19108. size_t __pyx_t_5;
  19109. size_t __pyx_t_6;
  19110. __Pyx_RefNannySetupContext("__pyx_convert_pair_from_py_size_t__and_size_t", 0);
  19111. /* "pair.from_py":146
  19112. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19113. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *:
  19114. * x, y = o # <<<<<<<<<<<<<<
  19115. * return pair[X,Y](<X>x, <Y>y)
  19116. *
  19117. */
  19118. if ((likely(PyTuple_CheckExact(__pyx_v_o))) || (PyList_CheckExact(__pyx_v_o))) {
  19119. PyObject* sequence = __pyx_v_o;
  19120. Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
  19121. if (unlikely(size != 2)) {
  19122. if (size > 2) __Pyx_RaiseTooManyValuesError(2);
  19123. else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
  19124. __PYX_ERR(1, 146, __pyx_L1_error)
  19125. }
  19126. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19127. if (likely(PyTuple_CheckExact(sequence))) {
  19128. __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
  19129. __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1);
  19130. } else {
  19131. __pyx_t_1 = PyList_GET_ITEM(sequence, 0);
  19132. __pyx_t_2 = PyList_GET_ITEM(sequence, 1);
  19133. }
  19134. __Pyx_INCREF(__pyx_t_1);
  19135. __Pyx_INCREF(__pyx_t_2);
  19136. #else
  19137. __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 146, __pyx_L1_error)
  19138. __Pyx_GOTREF(__pyx_t_1);
  19139. __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 146, __pyx_L1_error)
  19140. __Pyx_GOTREF(__pyx_t_2);
  19141. #endif
  19142. } else {
  19143. Py_ssize_t index = -1;
  19144. __pyx_t_3 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 146, __pyx_L1_error)
  19145. __Pyx_GOTREF(__pyx_t_3);
  19146. __pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
  19147. index = 0; __pyx_t_1 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
  19148. __Pyx_GOTREF(__pyx_t_1);
  19149. index = 1; __pyx_t_2 = __pyx_t_4(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
  19150. __Pyx_GOTREF(__pyx_t_2);
  19151. if (__Pyx_IternextUnpackEndCheck(__pyx_t_4(__pyx_t_3), 2) < 0) __PYX_ERR(1, 146, __pyx_L1_error)
  19152. __pyx_t_4 = NULL;
  19153. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19154. goto __pyx_L4_unpacking_done;
  19155. __pyx_L3_unpacking_failed:;
  19156. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  19157. __pyx_t_4 = NULL;
  19158. if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
  19159. __PYX_ERR(1, 146, __pyx_L1_error)
  19160. __pyx_L4_unpacking_done:;
  19161. }
  19162. __pyx_v_x = __pyx_t_1;
  19163. __pyx_t_1 = 0;
  19164. __pyx_v_y = __pyx_t_2;
  19165. __pyx_t_2 = 0;
  19166. /* "pair.from_py":147
  19167. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *:
  19168. * x, y = o
  19169. * return pair[X,Y](<X>x, <Y>y) # <<<<<<<<<<<<<<
  19170. *
  19171. *
  19172. */
  19173. __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)
  19174. __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)
  19175. __pyx_r = std::pair<size_t,size_t> (((size_t)__pyx_t_5), ((size_t)__pyx_t_6));
  19176. goto __pyx_L0;
  19177. /* "pair.from_py":145
  19178. *
  19179. * @cname("__pyx_convert_pair_from_py_size_t__and_size_t")
  19180. * cdef pair[X,Y] __pyx_convert_pair_from_py_size_t__and_size_t(object o) except *: # <<<<<<<<<<<<<<
  19181. * x, y = o
  19182. * return pair[X,Y](<X>x, <Y>y)
  19183. */
  19184. /* function exit code */
  19185. __pyx_L1_error:;
  19186. __Pyx_XDECREF(__pyx_t_1);
  19187. __Pyx_XDECREF(__pyx_t_2);
  19188. __Pyx_XDECREF(__pyx_t_3);
  19189. __Pyx_AddTraceback("pair.from_py.__pyx_convert_pair_from_py_size_t__and_size_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  19190. __Pyx_pretend_to_initialize(&__pyx_r);
  19191. __pyx_L0:;
  19192. __Pyx_XDECREF(__pyx_v_x);
  19193. __Pyx_XDECREF(__pyx_v_y);
  19194. __Pyx_RefNannyFinishContext();
  19195. return __pyx_r;
  19196. }
  19197. /* "vector.from_py":45
  19198. *
  19199. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  19200. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  19201. * cdef vector[X] v
  19202. * for item in o:
  19203. */
  19204. 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) {
  19205. std::vector<std::pair<size_t,size_t> > __pyx_v_v;
  19206. PyObject *__pyx_v_item = NULL;
  19207. std::vector<std::pair<size_t,size_t> > __pyx_r;
  19208. __Pyx_RefNannyDeclarations
  19209. PyObject *__pyx_t_1 = NULL;
  19210. Py_ssize_t __pyx_t_2;
  19211. PyObject *(*__pyx_t_3)(PyObject *);
  19212. PyObject *__pyx_t_4 = NULL;
  19213. std::pair<size_t,size_t> __pyx_t_5;
  19214. __Pyx_RefNannySetupContext("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___", 0);
  19215. /* "vector.from_py":47
  19216. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *:
  19217. * cdef vector[X] v
  19218. * for item in o: # <<<<<<<<<<<<<<
  19219. * v.push_back(<X>item)
  19220. * return v
  19221. */
  19222. if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
  19223. __pyx_t_1 = __pyx_v_o; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
  19224. __pyx_t_3 = NULL;
  19225. } else {
  19226. __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
  19227. __Pyx_GOTREF(__pyx_t_1);
  19228. __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 47, __pyx_L1_error)
  19229. }
  19230. for (;;) {
  19231. if (likely(!__pyx_t_3)) {
  19232. if (likely(PyList_CheckExact(__pyx_t_1))) {
  19233. if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
  19234. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19235. __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)
  19236. #else
  19237. __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)
  19238. __Pyx_GOTREF(__pyx_t_4);
  19239. #endif
  19240. } else {
  19241. if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
  19242. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  19243. __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)
  19244. #else
  19245. __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)
  19246. __Pyx_GOTREF(__pyx_t_4);
  19247. #endif
  19248. }
  19249. } else {
  19250. __pyx_t_4 = __pyx_t_3(__pyx_t_1);
  19251. if (unlikely(!__pyx_t_4)) {
  19252. PyObject* exc_type = PyErr_Occurred();
  19253. if (exc_type) {
  19254. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
  19255. else __PYX_ERR(1, 47, __pyx_L1_error)
  19256. }
  19257. break;
  19258. }
  19259. __Pyx_GOTREF(__pyx_t_4);
  19260. }
  19261. __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_4);
  19262. __pyx_t_4 = 0;
  19263. /* "vector.from_py":48
  19264. * cdef vector[X] v
  19265. * for item in o:
  19266. * v.push_back(<X>item) # <<<<<<<<<<<<<<
  19267. * return v
  19268. *
  19269. */
  19270. __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)
  19271. __pyx_v_v.push_back(((std::pair<size_t,size_t> )__pyx_t_5));
  19272. /* "vector.from_py":47
  19273. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *:
  19274. * cdef vector[X] v
  19275. * for item in o: # <<<<<<<<<<<<<<
  19276. * v.push_back(<X>item)
  19277. * return v
  19278. */
  19279. }
  19280. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  19281. /* "vector.from_py":49
  19282. * for item in o:
  19283. * v.push_back(<X>item)
  19284. * return v # <<<<<<<<<<<<<<
  19285. *
  19286. *
  19287. */
  19288. __pyx_r = __pyx_v_v;
  19289. goto __pyx_L0;
  19290. /* "vector.from_py":45
  19291. *
  19292. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  19293. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  19294. * cdef vector[X] v
  19295. * for item in o:
  19296. */
  19297. /* function exit code */
  19298. __pyx_L1_error:;
  19299. __Pyx_XDECREF(__pyx_t_1);
  19300. __Pyx_XDECREF(__pyx_t_4);
  19301. __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);
  19302. __Pyx_pretend_to_initialize(&__pyx_r);
  19303. __pyx_L0:;
  19304. __Pyx_XDECREF(__pyx_v_item);
  19305. __Pyx_RefNannyFinishContext();
  19306. return __pyx_r;
  19307. }
  19308. static PyObject *__pyx_tp_new_8gedlibpy_GEDEnv(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  19309. PyObject *o;
  19310. if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
  19311. o = (*t->tp_alloc)(t, 0);
  19312. } else {
  19313. o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  19314. }
  19315. if (unlikely(!o)) return 0;
  19316. if (unlikely(__pyx_pw_8gedlibpy_6GEDEnv_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  19317. return o;
  19318. bad:
  19319. Py_DECREF(o); o = 0;
  19320. return NULL;
  19321. }
  19322. static void __pyx_tp_dealloc_8gedlibpy_GEDEnv(PyObject *o) {
  19323. #if CYTHON_USE_TP_FINALIZE
  19324. 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))) {
  19325. if (PyObject_CallFinalizerFromDealloc(o)) return;
  19326. }
  19327. #endif
  19328. {
  19329. PyObject *etype, *eval, *etb;
  19330. PyErr_Fetch(&etype, &eval, &etb);
  19331. ++Py_REFCNT(o);
  19332. __pyx_pw_8gedlibpy_6GEDEnv_3__dealloc__(o);
  19333. --Py_REFCNT(o);
  19334. PyErr_Restore(etype, eval, etb);
  19335. }
  19336. (*Py_TYPE(o)->tp_free)(o);
  19337. }
  19338. static PyMethodDef __pyx_methods_8gedlibpy_GEDEnv[] = {
  19339. {"is_initialized", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_5is_initialized, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_4is_initialized},
  19340. {"restart_env", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_7restart_env, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_6restart_env},
  19341. {"load_GXL_graphs", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_9load_GXL_graphs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_8load_GXL_graphs},
  19342. {"graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_11graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_10graph_ids},
  19343. {"get_all_graph_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_13get_all_graph_ids, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_12get_all_graph_ids},
  19344. {"get_graph_class", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_15get_graph_class, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_14get_graph_class},
  19345. {"get_graph_name", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_17get_graph_name, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_16get_graph_name},
  19346. {"add_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_19add_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_18add_graph},
  19347. {"add_node", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_21add_node, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_20add_node},
  19348. {"add_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_23add_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_22add_edge},
  19349. {"add_symmetrical_edge", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_25add_symmetrical_edge, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_24add_symmetrical_edge},
  19350. {"clear_graph", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_27clear_graph, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_26clear_graph},
  19351. {"get_graph_internal_id", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_29get_graph_internal_id, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_28get_graph_internal_id},
  19352. {"get_graph_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_31get_graph_num_nodes, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_30get_graph_num_nodes},
  19353. {"get_graph_num_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_33get_graph_num_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_32get_graph_num_edges},
  19354. {"get_original_node_ids", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_35get_original_node_ids, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_34get_original_node_ids},
  19355. {"get_graph_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_37get_graph_node_labels, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_36get_graph_node_labels},
  19356. {"get_graph_edges", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_39get_graph_edges, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_38get_graph_edges},
  19357. {"get_graph_adjacence_matrix", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_41get_graph_adjacence_matrix, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_40get_graph_adjacence_matrix},
  19358. {"set_edit_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_43set_edit_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_42set_edit_cost},
  19359. {"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},
  19360. {"init", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_47init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_46init},
  19361. {"set_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_49set_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_48set_method},
  19362. {"init_method", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_51init_method, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_50init_method},
  19363. {"get_init_time", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_53get_init_time, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_52get_init_time},
  19364. {"run_method", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_55run_method, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_54run_method},
  19365. {"get_upper_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_57get_upper_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_56get_upper_bound},
  19366. {"get_lower_bound", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_59get_lower_bound, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_58get_lower_bound},
  19367. {"get_forward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_61get_forward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_60get_forward_map},
  19368. {"get_backward_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_63get_backward_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_62get_backward_map},
  19369. {"get_node_image", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_65get_node_image, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_64get_node_image},
  19370. {"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},
  19371. {"get_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_69get_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_68get_induced_cost},
  19372. {"get_node_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_71get_node_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_70get_node_map},
  19373. {"get_assignment_matrix", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_73get_assignment_matrix, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_72get_assignment_matrix},
  19374. {"get_all_map", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_75get_all_map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_74get_all_map},
  19375. {"get_runtime", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_77get_runtime, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_76get_runtime},
  19376. {"quasimetric_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_79quasimetric_cost, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_78quasimetric_cost},
  19377. {"hungarian_LSAP", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_81hungarian_LSAP, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_80hungarian_LSAP},
  19378. {"hungarian_LSAPE", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_83hungarian_LSAPE, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_82hungarian_LSAPE},
  19379. {"add_random_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_85add_random_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_84add_random_graph},
  19380. {"add_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_87add_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_86add_nx_graph},
  19381. {"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},
  19382. {"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},
  19383. {"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},
  19384. {"get_num_node_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_95get_num_node_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_94get_num_node_labels},
  19385. {"get_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_97get_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_96get_node_label},
  19386. {"get_num_edge_labels", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_99get_num_edge_labels, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_98get_num_edge_labels},
  19387. {"get_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_101get_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_100get_edge_label},
  19388. {"get_avg_num_nodes", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_103get_avg_num_nodes, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_102get_avg_num_nodes},
  19389. {"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},
  19390. {"get_node_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_107get_node_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_106get_node_del_cost},
  19391. {"get_node_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_109get_node_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_108get_node_ins_cost},
  19392. {"get_median_node_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_111get_median_node_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_110get_median_node_label},
  19393. {"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},
  19394. {"get_edge_del_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_115get_edge_del_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_114get_edge_del_cost},
  19395. {"get_edge_ins_cost", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_117get_edge_ins_cost, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_116get_edge_ins_cost},
  19396. {"get_median_edge_label", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_119get_median_edge_label, METH_O, __pyx_doc_8gedlibpy_6GEDEnv_118get_median_edge_label},
  19397. {"get_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_121get_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_120get_nx_graph},
  19398. {"get_init_type", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_123get_init_type, METH_NOARGS, __pyx_doc_8gedlibpy_6GEDEnv_122get_init_type},
  19399. {"load_nx_graph", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_125load_nx_graph, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_124load_nx_graph},
  19400. {"compute_induced_cost", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8gedlibpy_6GEDEnv_127compute_induced_cost, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8gedlibpy_6GEDEnv_126compute_induced_cost},
  19401. {"__reduce_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_129__reduce_cython__, METH_NOARGS, 0},
  19402. {"__setstate_cython__", (PyCFunction)__pyx_pw_8gedlibpy_6GEDEnv_131__setstate_cython__, METH_O, 0},
  19403. {0, 0, 0, 0}
  19404. };
  19405. static PyTypeObject __pyx_type_8gedlibpy_GEDEnv = {
  19406. PyVarObject_HEAD_INIT(0, 0)
  19407. "gedlibpy.GEDEnv", /*tp_name*/
  19408. sizeof(struct __pyx_obj_8gedlibpy_GEDEnv), /*tp_basicsize*/
  19409. 0, /*tp_itemsize*/
  19410. __pyx_tp_dealloc_8gedlibpy_GEDEnv, /*tp_dealloc*/
  19411. #if PY_VERSION_HEX < 0x030800b4
  19412. 0, /*tp_print*/
  19413. #endif
  19414. #if PY_VERSION_HEX >= 0x030800b4
  19415. 0, /*tp_vectorcall_offset*/
  19416. #endif
  19417. 0, /*tp_getattr*/
  19418. 0, /*tp_setattr*/
  19419. #if PY_MAJOR_VERSION < 3
  19420. 0, /*tp_compare*/
  19421. #endif
  19422. #if PY_MAJOR_VERSION >= 3
  19423. 0, /*tp_as_async*/
  19424. #endif
  19425. 0, /*tp_repr*/
  19426. 0, /*tp_as_number*/
  19427. 0, /*tp_as_sequence*/
  19428. 0, /*tp_as_mapping*/
  19429. 0, /*tp_hash*/
  19430. 0, /*tp_call*/
  19431. 0, /*tp_str*/
  19432. 0, /*tp_getattro*/
  19433. 0, /*tp_setattro*/
  19434. 0, /*tp_as_buffer*/
  19435. Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  19436. "Cython wrapper class for C++ class PyGEDEnv\n\t", /*tp_doc*/
  19437. 0, /*tp_traverse*/
  19438. 0, /*tp_clear*/
  19439. 0, /*tp_richcompare*/
  19440. 0, /*tp_weaklistoffset*/
  19441. 0, /*tp_iter*/
  19442. 0, /*tp_iternext*/
  19443. __pyx_methods_8gedlibpy_GEDEnv, /*tp_methods*/
  19444. 0, /*tp_members*/
  19445. 0, /*tp_getset*/
  19446. 0, /*tp_base*/
  19447. 0, /*tp_dict*/
  19448. 0, /*tp_descr_get*/
  19449. 0, /*tp_descr_set*/
  19450. 0, /*tp_dictoffset*/
  19451. 0, /*tp_init*/
  19452. 0, /*tp_alloc*/
  19453. __pyx_tp_new_8gedlibpy_GEDEnv, /*tp_new*/
  19454. 0, /*tp_free*/
  19455. 0, /*tp_is_gc*/
  19456. 0, /*tp_bases*/
  19457. 0, /*tp_mro*/
  19458. 0, /*tp_cache*/
  19459. 0, /*tp_subclasses*/
  19460. 0, /*tp_weaklist*/
  19461. 0, /*tp_del*/
  19462. 0, /*tp_version_tag*/
  19463. #if PY_VERSION_HEX >= 0x030400a1
  19464. 0, /*tp_finalize*/
  19465. #endif
  19466. #if PY_VERSION_HEX >= 0x030800b1
  19467. 0, /*tp_vectorcall*/
  19468. #endif
  19469. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  19470. 0, /*tp_print*/
  19471. #endif
  19472. };
  19473. static PyMethodDef __pyx_methods[] = {
  19474. {0, 0, 0, 0}
  19475. };
  19476. static int __pyx_import_star_set(PyObject *o, PyObject* py_name, char *name) {
  19477. static const char* internal_type_names[] = {
  19478. "GEDEnv",
  19479. "PyGEDEnv",
  19480. "UINT32_t",
  19481. "X",
  19482. "Y",
  19483. "__pyx_ctuple_Py_ssize_t",
  19484. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t",
  19485. "__pyx_ctuple_Py_ssize_t__and_Py_ssize_t_struct",
  19486. "__pyx_ctuple_Py_ssize_t_struct",
  19487. "__pyx_ctuple_bfa21__6a9b6__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",
  19488. "__pyx_ctuple_bfa21__6a9b6__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",
  19489. "__pyx_ctuple_double",
  19490. "__pyx_ctuple_double_struct",
  19491. "__pyx_ctuple_size_t",
  19492. "__pyx_ctuple_size_t__space___const___and_size_t__space___const_",
  19493. "__pyx_ctuple_size_t__space___const___and_size_t__space___const__struct",
  19494. "__pyx_ctuple_size_t_struct",
  19495. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng",
  19496. "__pyx_ctuple_std__in_map__lAngstd__in_string__comma_std__in_string__rAng_struct",
  19497. "bool",
  19498. "list",
  19499. "map",
  19500. "pair",
  19501. "string",
  19502. "vector",
  19503. 0
  19504. };
  19505. const char** type_name = internal_type_names;
  19506. while (*type_name) {
  19507. if (__Pyx_StrEq(name, *type_name)) {
  19508. PyErr_Format(PyExc_TypeError, "Cannot overwrite C type %s", name);
  19509. goto bad;
  19510. }
  19511. type_name++;
  19512. }
  19513. if (0);
  19514. else {
  19515. if (PyObject_SetAttr(__pyx_m, py_name, o) < 0) goto bad;
  19516. }
  19517. return 0;
  19518. bad:
  19519. return -1;
  19520. }
  19521. static int
  19522. __Pyx_import_all_from(PyObject *locals, PyObject *v)
  19523. {
  19524. PyObject *all = PyObject_GetAttrString(v, "__all__");
  19525. PyObject *dict, *name, *value;
  19526. int skip_leading_underscores = 0;
  19527. int pos, err;
  19528. if (all == NULL) {
  19529. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19530. return -1;
  19531. PyErr_Clear();
  19532. dict = PyObject_GetAttrString(v, "__dict__");
  19533. if (dict == NULL) {
  19534. if (!PyErr_ExceptionMatches(PyExc_AttributeError))
  19535. return -1;
  19536. PyErr_SetString(PyExc_ImportError,
  19537. "from-import-* object has no __dict__ and no __all__");
  19538. return -1;
  19539. }
  19540. #if PY_MAJOR_VERSION < 3
  19541. all = PyObject_CallMethod(dict, (char *)"keys", NULL);
  19542. #else
  19543. all = PyMapping_Keys(dict);
  19544. #endif
  19545. Py_DECREF(dict);
  19546. if (all == NULL)
  19547. return -1;
  19548. skip_leading_underscores = 1;
  19549. }
  19550. for (pos = 0, err = 0; ; pos++) {
  19551. name = PySequence_GetItem(all, pos);
  19552. if (name == NULL) {
  19553. if (!PyErr_ExceptionMatches(PyExc_IndexError))
  19554. err = -1;
  19555. else
  19556. PyErr_Clear();
  19557. break;
  19558. }
  19559. if (skip_leading_underscores &&
  19560. #if PY_MAJOR_VERSION < 3
  19561. PyString_Check(name) &&
  19562. PyString_AS_STRING(name)[0] == '_')
  19563. #else
  19564. PyUnicode_Check(name) &&
  19565. PyUnicode_AS_UNICODE(name)[0] == '_')
  19566. #endif
  19567. {
  19568. Py_DECREF(name);
  19569. continue;
  19570. }
  19571. value = PyObject_GetAttr(v, name);
  19572. if (value == NULL)
  19573. err = -1;
  19574. else if (PyDict_CheckExact(locals))
  19575. err = PyDict_SetItem(locals, name, value);
  19576. else
  19577. err = PyObject_SetItem(locals, name, value);
  19578. Py_DECREF(name);
  19579. Py_XDECREF(value);
  19580. if (err != 0)
  19581. break;
  19582. }
  19583. Py_DECREF(all);
  19584. return err;
  19585. }
  19586. static int __pyx_import_star(PyObject* m) {
  19587. int i;
  19588. int ret = -1;
  19589. char* s;
  19590. PyObject *locals = 0;
  19591. PyObject *list = 0;
  19592. #if PY_MAJOR_VERSION >= 3
  19593. PyObject *utf8_name = 0;
  19594. #endif
  19595. PyObject *name;
  19596. PyObject *item;
  19597. locals = PyDict_New(); if (!locals) goto bad;
  19598. if (__Pyx_import_all_from(locals, m) < 0) goto bad;
  19599. list = PyDict_Items(locals); if (!list) goto bad;
  19600. for(i=0; i<PyList_GET_SIZE(list); i++) {
  19601. name = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 0);
  19602. item = PyTuple_GET_ITEM(PyList_GET_ITEM(list, i), 1);
  19603. #if PY_MAJOR_VERSION >= 3
  19604. utf8_name = PyUnicode_AsUTF8String(name);
  19605. if (!utf8_name) goto bad;
  19606. s = PyBytes_AS_STRING(utf8_name);
  19607. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19608. Py_DECREF(utf8_name); utf8_name = 0;
  19609. #else
  19610. s = PyString_AsString(name);
  19611. if (!s) goto bad;
  19612. if (__pyx_import_star_set(item, name, s) < 0) goto bad;
  19613. #endif
  19614. }
  19615. ret = 0;
  19616. bad:
  19617. Py_XDECREF(locals);
  19618. Py_XDECREF(list);
  19619. #if PY_MAJOR_VERSION >= 3
  19620. Py_XDECREF(utf8_name);
  19621. #endif
  19622. return ret;
  19623. }
  19624. #if PY_MAJOR_VERSION >= 3
  19625. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19626. static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
  19627. static int __pyx_pymod_exec_gedlibpy(PyObject* module); /*proto*/
  19628. static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  19629. {Py_mod_create, (void*)__pyx_pymod_create},
  19630. {Py_mod_exec, (void*)__pyx_pymod_exec_gedlibpy},
  19631. {0, NULL}
  19632. };
  19633. #endif
  19634. static struct PyModuleDef __pyx_moduledef = {
  19635. PyModuleDef_HEAD_INIT,
  19636. "gedlibpy",
  19637. __pyx_k_Python_GedLib_module_This_modul, /* m_doc */
  19638. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19639. 0, /* m_size */
  19640. #else
  19641. -1, /* m_size */
  19642. #endif
  19643. __pyx_methods /* m_methods */,
  19644. #if CYTHON_PEP489_MULTI_PHASE_INIT
  19645. __pyx_moduledef_slots, /* m_slots */
  19646. #else
  19647. NULL, /* m_reload */
  19648. #endif
  19649. NULL, /* m_traverse */
  19650. NULL, /* m_clear */
  19651. NULL /* m_free */
  19652. };
  19653. #endif
  19654. #ifndef CYTHON_SMALL_CODE
  19655. #if defined(__clang__)
  19656. #define CYTHON_SMALL_CODE
  19657. #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
  19658. #define CYTHON_SMALL_CODE __attribute__((cold))
  19659. #else
  19660. #define CYTHON_SMALL_CODE
  19661. #endif
  19662. #endif
  19663. static __Pyx_StringTabEntry __pyx_string_tab[] = {
  19664. {&__pyx_kp_u_, __pyx_k_, sizeof(__pyx_k_), 0, 1, 0, 0},
  19665. {&__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},
  19666. {&__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},
  19667. {&__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},
  19668. {&__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},
  19669. {&__pyx_kp_u_Computation_between_graph, __pyx_k_Computation_between_graph, sizeof(__pyx_k_Computation_between_graph), 0, 1, 0, 0},
  19670. {&__pyx_n_u_EAGER_WITHOUT_SHUFFLED_COPIES, __pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES, sizeof(__pyx_k_EAGER_WITHOUT_SHUFFLED_COPIES), 0, 1, 0, 1},
  19671. {&__pyx_n_s_EditCostError, __pyx_k_EditCostError, sizeof(__pyx_k_EditCostError), 0, 0, 1, 1},
  19672. {&__pyx_n_s_EditCostError___init, __pyx_k_EditCostError___init, sizeof(__pyx_k_EditCostError___init), 0, 0, 1, 1},
  19673. {&__pyx_n_s_Error, __pyx_k_Error, sizeof(__pyx_k_Error), 0, 0, 1, 1},
  19674. {&__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},
  19675. {&__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},
  19676. {&__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},
  19677. {&__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},
  19678. {&__pyx_n_s_GEDEnv, __pyx_k_GEDEnv, sizeof(__pyx_k_GEDEnv), 0, 0, 1, 1},
  19679. {&__pyx_n_s_Graph, __pyx_k_Graph, sizeof(__pyx_k_Graph), 0, 0, 1, 1},
  19680. {&__pyx_kp_u_Graphs_loaded, __pyx_k_Graphs_loaded, sizeof(__pyx_k_Graphs_loaded), 0, 1, 0, 0},
  19681. {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
  19682. {&__pyx_n_s_InitError, __pyx_k_InitError, sizeof(__pyx_k_InitError), 0, 0, 1, 1},
  19683. {&__pyx_n_s_InitError___init, __pyx_k_InitError___init, sizeof(__pyx_k_InitError___init), 0, 0, 1, 1},
  19684. {&__pyx_kp_u_Initialization_in_progress, __pyx_k_Initialization_in_progress, sizeof(__pyx_k_Initialization_in_progress), 0, 1, 0, 0},
  19685. {&__pyx_kp_u_Initialization_terminated, __pyx_k_Initialization_terminated, sizeof(__pyx_k_Initialization_terminated), 0, 1, 0, 0},
  19686. {&__pyx_n_s_LoadLibrary, __pyx_k_LoadLibrary, sizeof(__pyx_k_LoadLibrary), 0, 0, 1, 1},
  19687. {&__pyx_kp_u_Loading_graphs_in_progress, __pyx_k_Loading_graphs_in_progress, sizeof(__pyx_k_Loading_graphs_in_progress), 0, 1, 0, 0},
  19688. {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
  19689. {&__pyx_n_s_MethodError, __pyx_k_MethodError, sizeof(__pyx_k_MethodError), 0, 0, 1, 1},
  19690. {&__pyx_n_s_MethodError___init, __pyx_k_MethodError___init, sizeof(__pyx_k_MethodError___init), 0, 0, 1, 1},
  19691. {&__pyx_n_s_NodeMap, __pyx_k_NodeMap, sizeof(__pyx_k_NodeMap), 0, 0, 1, 1},
  19692. {&__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},
  19693. {&__pyx_kp_u_Number_of_graphs, __pyx_k_Number_of_graphs, sizeof(__pyx_k_Number_of_graphs), 0, 1, 0, 0},
  19694. {&__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},
  19695. {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  19696. {&__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},
  19697. {&__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},
  19698. {&__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},
  19699. {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  19700. {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  19701. {&__pyx_n_s__20, __pyx_k__20, sizeof(__pyx_k__20), 0, 0, 1, 1},
  19702. {&__pyx_n_s_add_assignment, __pyx_k_add_assignment, sizeof(__pyx_k_add_assignment), 0, 0, 1, 1},
  19703. {&__pyx_n_s_add_edge, __pyx_k_add_edge, sizeof(__pyx_k_add_edge), 0, 0, 1, 1},
  19704. {&__pyx_n_s_add_graph, __pyx_k_add_graph, sizeof(__pyx_k_add_graph), 0, 0, 1, 1},
  19705. {&__pyx_n_s_add_node, __pyx_k_add_node, sizeof(__pyx_k_add_node), 0, 0, 1, 1},
  19706. {&__pyx_n_s_add_nx_graph, __pyx_k_add_nx_graph, sizeof(__pyx_k_add_nx_graph), 0, 0, 1, 1},
  19707. {&__pyx_n_s_adj_lists, __pyx_k_adj_lists, sizeof(__pyx_k_adj_lists), 0, 0, 1, 1},
  19708. {&__pyx_n_s_adj_matrix, __pyx_k_adj_matrix, sizeof(__pyx_k_adj_matrix), 0, 0, 1, 1},
  19709. {&__pyx_n_s_as_relation, __pyx_k_as_relation, sizeof(__pyx_k_as_relation), 0, 0, 1, 1},
  19710. {&__pyx_n_s_cdll, __pyx_k_cdll, sizeof(__pyx_k_cdll), 0, 0, 1, 1},
  19711. {&__pyx_n_s_classe, __pyx_k_classe, sizeof(__pyx_k_classe), 0, 0, 1, 1},
  19712. {&__pyx_n_s_classes, __pyx_k_classes, sizeof(__pyx_k_classes), 0, 0, 1, 1},
  19713. {&__pyx_n_s_clear_graph, __pyx_k_clear_graph, sizeof(__pyx_k_clear_graph), 0, 0, 1, 1},
  19714. {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  19715. {&__pyx_n_s_ctypes, __pyx_k_ctypes, sizeof(__pyx_k_ctypes), 0, 0, 1, 1},
  19716. {&__pyx_n_s_dataset, __pyx_k_dataset, sizeof(__pyx_k_dataset), 0, 0, 1, 1},
  19717. {&__pyx_n_s_decode, __pyx_k_decode, sizeof(__pyx_k_decode), 0, 0, 1, 1},
  19718. {&__pyx_n_s_decode_graph_edges, __pyx_k_decode_graph_edges, sizeof(__pyx_k_decode_graph_edges), 0, 0, 1, 1},
  19719. {&__pyx_n_s_decode_your_map, __pyx_k_decode_your_map, sizeof(__pyx_k_decode_your_map), 0, 0, 1, 1},
  19720. {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  19721. {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  19722. {&__pyx_n_s_edge_label, __pyx_k_edge_label, sizeof(__pyx_k_edge_label), 0, 0, 1, 1},
  19723. {&__pyx_n_s_edge_label_1, __pyx_k_edge_label_1, sizeof(__pyx_k_edge_label_1), 0, 0, 1, 1},
  19724. {&__pyx_n_s_edge_label_2, __pyx_k_edge_label_2, sizeof(__pyx_k_edge_label_2), 0, 0, 1, 1},
  19725. {&__pyx_n_s_edge_label_b, __pyx_k_edge_label_b, sizeof(__pyx_k_edge_label_b), 0, 0, 1, 1},
  19726. {&__pyx_n_s_edge_list, __pyx_k_edge_list, sizeof(__pyx_k_edge_list), 0, 0, 1, 1},
  19727. {&__pyx_n_s_edge_type, __pyx_k_edge_type, sizeof(__pyx_k_edge_type), 0, 0, 1, 1},
  19728. {&__pyx_n_s_edges, __pyx_k_edges, sizeof(__pyx_k_edges), 0, 0, 1, 1},
  19729. {&__pyx_n_s_edit_cost, __pyx_k_edit_cost, sizeof(__pyx_k_edit_cost), 0, 0, 1, 1},
  19730. {&__pyx_n_s_edit_cost_constant, __pyx_k_edit_cost_constant, sizeof(__pyx_k_edit_cost_constant), 0, 0, 1, 1},
  19731. {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
  19732. {&__pyx_n_s_encode_your_map, __pyx_k_encode_your_map, sizeof(__pyx_k_encode_your_map), 0, 0, 1, 1},
  19733. {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  19734. {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  19735. {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  19736. {&__pyx_n_s_g1, __pyx_k_g1, sizeof(__pyx_k_g1), 0, 0, 1, 1},
  19737. {&__pyx_n_s_g2, __pyx_k_g2, sizeof(__pyx_k_g2), 0, 0, 1, 1},
  19738. {&__pyx_n_s_g_id, __pyx_k_g_id, sizeof(__pyx_k_g_id), 0, 0, 1, 1},
  19739. {&__pyx_n_s_gedlibpy, __pyx_k_gedlibpy, sizeof(__pyx_k_gedlibpy), 0, 0, 1, 1},
  19740. {&__pyx_kp_s_gedlibpy_pyx, __pyx_k_gedlibpy_pyx, sizeof(__pyx_k_gedlibpy_pyx), 0, 0, 1, 0},
  19741. {&__pyx_n_s_get_dummy_node, __pyx_k_get_dummy_node, sizeof(__pyx_k_get_dummy_node), 0, 0, 1, 1},
  19742. {&__pyx_n_s_get_edge_data, __pyx_k_get_edge_data, sizeof(__pyx_k_get_edge_data), 0, 0, 1, 1},
  19743. {&__pyx_n_s_get_edit_cost_options, __pyx_k_get_edit_cost_options, sizeof(__pyx_k_get_edit_cost_options), 0, 0, 1, 1},
  19744. {&__pyx_n_s_get_graph_edges, __pyx_k_get_graph_edges, sizeof(__pyx_k_get_graph_edges), 0, 0, 1, 1},
  19745. {&__pyx_n_s_get_graph_node_labels, __pyx_k_get_graph_node_labels, sizeof(__pyx_k_get_graph_node_labels), 0, 0, 1, 1},
  19746. {&__pyx_n_s_get_graph_num_nodes, __pyx_k_get_graph_num_nodes, sizeof(__pyx_k_get_graph_num_nodes), 0, 0, 1, 1},
  19747. {&__pyx_n_s_get_init_options, __pyx_k_get_init_options, sizeof(__pyx_k_get_init_options), 0, 0, 1, 1},
  19748. {&__pyx_n_s_get_method_options, __pyx_k_get_method_options, sizeof(__pyx_k_get_method_options), 0, 0, 1, 1},
  19749. {&__pyx_n_s_get_node_map, __pyx_k_get_node_map, sizeof(__pyx_k_get_node_map), 0, 0, 1, 1},
  19750. {&__pyx_n_s_get_original_node_ids, __pyx_k_get_original_node_ids, sizeof(__pyx_k_get_original_node_ids), 0, 0, 1, 1},
  19751. {&__pyx_n_s_get_upper_bound, __pyx_k_get_upper_bound, sizeof(__pyx_k_get_upper_bound), 0, 0, 1, 1},
  19752. {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  19753. {&__pyx_n_s_gklearn_ged_env, __pyx_k_gklearn_ged_env, sizeof(__pyx_k_gklearn_ged_env), 0, 0, 1, 1},
  19754. {&__pyx_n_s_graph, __pyx_k_graph, sizeof(__pyx_k_graph), 0, 0, 1, 1},
  19755. {&__pyx_n_s_graph_class, __pyx_k_graph_class, sizeof(__pyx_k_graph_class), 0, 0, 1, 1},
  19756. {&__pyx_n_s_graph_id, __pyx_k_graph_id, sizeof(__pyx_k_graph_id), 0, 0, 1, 1},
  19757. {&__pyx_n_s_graph_ids, __pyx_k_graph_ids, sizeof(__pyx_k_graph_ids), 0, 0, 1, 1},
  19758. {&__pyx_n_s_graph_name, __pyx_k_graph_name, sizeof(__pyx_k_graph_name), 0, 0, 1, 1},
  19759. {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  19760. {&__pyx_n_s_h_id, __pyx_k_h_id, sizeof(__pyx_k_h_id), 0, 0, 1, 1},
  19761. {&__pyx_n_s_head, __pyx_k_head, sizeof(__pyx_k_head), 0, 0, 1, 1},
  19762. {&__pyx_n_u_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 1, 0, 1},
  19763. {&__pyx_n_s_ignore_duplicates, __pyx_k_ignore_duplicates, sizeof(__pyx_k_ignore_duplicates), 0, 0, 1, 1},
  19764. {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  19765. {&__pyx_n_s_inf, __pyx_k_inf, sizeof(__pyx_k_inf), 0, 0, 1, 1},
  19766. {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  19767. {&__pyx_n_s_init_2, __pyx_k_init_2, sizeof(__pyx_k_init_2), 0, 0, 1, 1},
  19768. {&__pyx_n_s_init_method, __pyx_k_init_method, sizeof(__pyx_k_init_method), 0, 0, 1, 1},
  19769. {&__pyx_n_s_init_option, __pyx_k_init_option, sizeof(__pyx_k_init_option), 0, 0, 1, 1},
  19770. {&__pyx_n_s_is_initialized, __pyx_k_is_initialized, sizeof(__pyx_k_is_initialized), 0, 0, 1, 1},
  19771. {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  19772. {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  19773. {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  19774. {&__pyx_n_s_lib1, __pyx_k_lib1, sizeof(__pyx_k_lib1), 0, 0, 1, 1},
  19775. {&__pyx_n_s_lib2, __pyx_k_lib2, sizeof(__pyx_k_lib2), 0, 0, 1, 1},
  19776. {&__pyx_n_s_lib3, __pyx_k_lib3, sizeof(__pyx_k_lib3), 0, 0, 1, 1},
  19777. {&__pyx_n_s_lib4, __pyx_k_lib4, sizeof(__pyx_k_lib4), 0, 0, 1, 1},
  19778. {&__pyx_kp_u_lib_fann_libdoublefann_so, __pyx_k_lib_fann_libdoublefann_so, sizeof(__pyx_k_lib_fann_libdoublefann_so), 0, 1, 0, 0},
  19779. {&__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},
  19780. {&__pyx_kp_u_lib_nomad_libnomad_so, __pyx_k_lib_nomad_libnomad_so, sizeof(__pyx_k_lib_nomad_libnomad_so), 0, 1, 0, 0},
  19781. {&__pyx_kp_u_lib_nomad_libsgtelib_so, __pyx_k_lib_nomad_libsgtelib_so, sizeof(__pyx_k_lib_nomad_libsgtelib_so), 0, 1, 0, 0},
  19782. {&__pyx_n_s_list_of_edges, __pyx_k_list_of_edges, sizeof(__pyx_k_list_of_edges), 0, 0, 1, 1},
  19783. {&__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},
  19784. {&__pyx_n_s_list_of_init_options, __pyx_k_list_of_init_options, sizeof(__pyx_k_list_of_init_options), 0, 0, 1, 1},
  19785. {&__pyx_n_s_list_of_method_options, __pyx_k_list_of_method_options, sizeof(__pyx_k_list_of_method_options), 0, 0, 1, 1},
  19786. {&__pyx_n_s_list_of_nodes, __pyx_k_list_of_nodes, sizeof(__pyx_k_list_of_nodes), 0, 0, 1, 1},
  19787. {&__pyx_n_s_load_GXL_graphs, __pyx_k_load_GXL_graphs, sizeof(__pyx_k_load_GXL_graphs), 0, 0, 1, 1},
  19788. {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  19789. {&__pyx_n_s_map_b, __pyx_k_map_b, sizeof(__pyx_k_map_b), 0, 0, 1, 1},
  19790. {&__pyx_n_s_map_edge_b, __pyx_k_map_edge_b, sizeof(__pyx_k_map_edge_b), 0, 0, 1, 1},
  19791. {&__pyx_n_s_map_edges, __pyx_k_map_edges, sizeof(__pyx_k_map_edges), 0, 0, 1, 1},
  19792. {&__pyx_n_s_map_u, __pyx_k_map_u, sizeof(__pyx_k_map_u), 0, 0, 1, 1},
  19793. {&__pyx_n_s_message, __pyx_k_message, sizeof(__pyx_k_message), 0, 0, 1, 1},
  19794. {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  19795. {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  19796. {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  19797. {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  19798. {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  19799. {&__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},
  19800. {&__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},
  19801. {&__pyx_n_s_networkx, __pyx_k_networkx, sizeof(__pyx_k_networkx), 0, 0, 1, 1},
  19802. {&__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},
  19803. {&__pyx_n_s_node_id, __pyx_k_node_id, sizeof(__pyx_k_node_id), 0, 0, 1, 1},
  19804. {&__pyx_n_s_node_label, __pyx_k_node_label, sizeof(__pyx_k_node_label), 0, 0, 1, 1},
  19805. {&__pyx_n_s_node_label_1, __pyx_k_node_label_1, sizeof(__pyx_k_node_label_1), 0, 0, 1, 1},
  19806. {&__pyx_n_s_node_label_2, __pyx_k_node_label_2, sizeof(__pyx_k_node_label_2), 0, 0, 1, 1},
  19807. {&__pyx_n_s_node_map, __pyx_k_node_map, sizeof(__pyx_k_node_map), 0, 0, 1, 1},
  19808. {&__pyx_n_s_node_type, __pyx_k_node_type, sizeof(__pyx_k_node_type), 0, 0, 1, 1},
  19809. {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  19810. {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
  19811. {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
  19812. {&__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},
  19813. {&__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},
  19814. {&__pyx_n_s_nx, __pyx_k_nx, sizeof(__pyx_k_nx), 0, 0, 1, 1},
  19815. {&__pyx_n_s_nx_graph, __pyx_k_nx_graph, sizeof(__pyx_k_nx_graph), 0, 0, 1, 1},
  19816. {&__pyx_n_s_option, __pyx_k_option, sizeof(__pyx_k_option), 0, 0, 1, 1},
  19817. {&__pyx_n_s_options, __pyx_k_options, sizeof(__pyx_k_options), 0, 0, 1, 1},
  19818. {&__pyx_n_u_original_node_ids, __pyx_k_original_node_ids, sizeof(__pyx_k_original_node_ids), 0, 1, 0, 1},
  19819. {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  19820. {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  19821. {&__pyx_n_s_path_XML, __pyx_k_path_XML, sizeof(__pyx_k_path_XML), 0, 0, 1, 1},
  19822. {&__pyx_n_s_path_folder, __pyx_k_path_folder, sizeof(__pyx_k_path_folder), 0, 0, 1, 1},
  19823. {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  19824. {&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
  19825. {&__pyx_n_s_print_to_stdout, __pyx_k_print_to_stdout, sizeof(__pyx_k_print_to_stdout), 0, 0, 1, 1},
  19826. {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  19827. {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  19828. {&__pyx_n_s_realpath, __pyx_k_realpath, sizeof(__pyx_k_realpath), 0, 0, 1, 1},
  19829. {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  19830. {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  19831. {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  19832. {&__pyx_n_s_res, __pyx_k_res, sizeof(__pyx_k_res), 0, 0, 1, 1},
  19833. {&__pyx_n_s_restart_env, __pyx_k_restart_env, sizeof(__pyx_k_restart_env), 0, 0, 1, 1},
  19834. {&__pyx_n_s_run_method, __pyx_k_run_method, sizeof(__pyx_k_run_method), 0, 0, 1, 1},
  19835. {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  19836. {&__pyx_n_s_set_edit_cost, __pyx_k_set_edit_cost, sizeof(__pyx_k_set_edit_cost), 0, 0, 1, 1},
  19837. {&__pyx_n_s_set_induced_cost, __pyx_k_set_induced_cost, sizeof(__pyx_k_set_induced_cost), 0, 0, 1, 1},
  19838. {&__pyx_n_s_set_method, __pyx_k_set_method, sizeof(__pyx_k_set_method), 0, 0, 1, 1},
  19839. {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  19840. {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  19841. {&__pyx_n_s_tail, __pyx_k_tail, sizeof(__pyx_k_tail), 0, 0, 1, 1},
  19842. {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  19843. {&__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},
  19844. {&__pyx_kp_u_utf_8, __pyx_k_utf_8, sizeof(__pyx_k_utf_8), 0, 1, 0, 0},
  19845. {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  19846. {&__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},
  19847. {0, 0, 0, 0, 0, 0, 0}
  19848. };
  19849. static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  19850. __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 750, __pyx_L1_error)
  19851. __pyx_builtin_print = __Pyx_GetBuiltinName(__pyx_n_s_print); if (!__pyx_builtin_print) __PYX_ERR(0, 977, __pyx_L1_error)
  19852. __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 1364, __pyx_L1_error)
  19853. __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  19854. __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(2, 272, __pyx_L1_error)
  19855. __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(2, 856, __pyx_L1_error)
  19856. __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(2, 1038, __pyx_L1_error)
  19857. __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(3, 109, __pyx_L1_error)
  19858. return 0;
  19859. __pyx_L1_error:;
  19860. return -1;
  19861. }
  19862. static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  19863. __Pyx_RefNannyDeclarations
  19864. __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
  19865. /* "gedlibpy.pyx":977
  19866. * self.restart_env()
  19867. *
  19868. * print("Loading graphs in progress...") # <<<<<<<<<<<<<<
  19869. * for graph in dataset :
  19870. * self.add_nx_graph(graph, classes)
  19871. */
  19872. __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_Loading_graphs_in_progress); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 977, __pyx_L1_error)
  19873. __Pyx_GOTREF(__pyx_tuple__4);
  19874. __Pyx_GIVEREF(__pyx_tuple__4);
  19875. /* "gedlibpy.pyx":981
  19876. * self.add_nx_graph(graph, classes)
  19877. * listID = self.graph_ids()
  19878. * print("Graphs loaded ! ") # <<<<<<<<<<<<<<
  19879. * print("Number of graphs = " + str(listID[1]))
  19880. *
  19881. */
  19882. __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Graphs_loaded); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 981, __pyx_L1_error)
  19883. __Pyx_GOTREF(__pyx_tuple__5);
  19884. __Pyx_GIVEREF(__pyx_tuple__5);
  19885. /* "gedlibpy.pyx":985
  19886. *
  19887. * self.set_edit_cost(edit_cost)
  19888. * print("Initialization in progress...") # <<<<<<<<<<<<<<
  19889. * self.init(init_option)
  19890. * print("Initialization terminated !")
  19891. */
  19892. __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Initialization_in_progress); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 985, __pyx_L1_error)
  19893. __Pyx_GOTREF(__pyx_tuple__6);
  19894. __Pyx_GIVEREF(__pyx_tuple__6);
  19895. /* "gedlibpy.pyx":987
  19896. * print("Initialization in progress...")
  19897. * self.init(init_option)
  19898. * print("Initialization terminated !") # <<<<<<<<<<<<<<
  19899. *
  19900. * self.set_method(method, options)
  19901. */
  19902. __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Initialization_terminated); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 987, __pyx_L1_error)
  19903. __Pyx_GOTREF(__pyx_tuple__7);
  19904. __Pyx_GIVEREF(__pyx_tuple__7);
  19905. /* "gedlibpy.pyx":1002
  19906. * resMapping[g][h] = self.get_node_map(g, h)
  19907. *
  19908. * print("Finish ! The return contains edit distances and NodeMap but you can check the result with graphs'ID until you restart the environment") # <<<<<<<<<<<<<<
  19909. * return resDistance, resMapping
  19910. *
  19911. */
  19912. __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Finish_The_return_contains_edit); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 1002, __pyx_L1_error)
  19913. __Pyx_GOTREF(__pyx_tuple__8);
  19914. __Pyx_GIVEREF(__pyx_tuple__8);
  19915. /* "gedlibpy.pyx":1057
  19916. * #return res
  19917. *
  19918. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return") # <<<<<<<<<<<<<<
  19919. * print ("Please don't restart the environment or recall this function, you will lose your results !")
  19920. * return listID
  19921. */
  19922. __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Finish_You_can_check_the_result); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 1057, __pyx_L1_error)
  19923. __Pyx_GOTREF(__pyx_tuple__9);
  19924. __Pyx_GIVEREF(__pyx_tuple__9);
  19925. /* "gedlibpy.pyx":1058
  19926. *
  19927. * print ("Finish ! You can check the result with each ID of graphs ! There are in the return")
  19928. * print ("Please don't restart the environment or recall this function, you will lose your results !") # <<<<<<<<<<<<<<
  19929. * return listID
  19930. *
  19931. */
  19932. __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Please_don_t_restart_the_environ); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 1058, __pyx_L1_error)
  19933. __Pyx_GOTREF(__pyx_tuple__10);
  19934. __Pyx_GIVEREF(__pyx_tuple__10);
  19935. /* "(tree fragment)":2
  19936. * def __reduce_cython__(self):
  19937. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19938. * def __setstate_cython__(self, __pyx_state):
  19939. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19940. */
  19941. __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)
  19942. __Pyx_GOTREF(__pyx_tuple__11);
  19943. __Pyx_GIVEREF(__pyx_tuple__11);
  19944. /* "(tree fragment)":4
  19945. * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
  19946. * def __setstate_cython__(self, __pyx_state):
  19947. * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
  19948. */
  19949. __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)
  19950. __Pyx_GOTREF(__pyx_tuple__12);
  19951. __Pyx_GIVEREF(__pyx_tuple__12);
  19952. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":272
  19953. * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
  19954. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_C_CONTIGUOUS)):
  19955. * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
  19956. *
  19957. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19958. */
  19959. __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)
  19960. __Pyx_GOTREF(__pyx_tuple__13);
  19961. __Pyx_GIVEREF(__pyx_tuple__13);
  19962. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":276
  19963. * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
  19964. * and not PyArray_CHKFLAGS(self, NPY_ARRAY_F_CONTIGUOUS)):
  19965. * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
  19966. *
  19967. * info.buf = PyArray_DATA(self)
  19968. */
  19969. __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)
  19970. __Pyx_GOTREF(__pyx_tuple__14);
  19971. __Pyx_GIVEREF(__pyx_tuple__14);
  19972. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":306
  19973. * if ((descr.byteorder == c'>' and little_endian) or
  19974. * (descr.byteorder == c'<' and not little_endian)):
  19975. * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
  19976. * if t == NPY_BYTE: f = "b"
  19977. * elif t == NPY_UBYTE: f = "B"
  19978. */
  19979. __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)
  19980. __Pyx_GOTREF(__pyx_tuple__15);
  19981. __Pyx_GIVEREF(__pyx_tuple__15);
  19982. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":856
  19983. *
  19984. * if (end - f) - <int>(new_offset - offset[0]) < 15:
  19985. * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
  19986. *
  19987. * if ((child.byteorder == c'>' and little_endian) or
  19988. */
  19989. __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)
  19990. __Pyx_GOTREF(__pyx_tuple__16);
  19991. __Pyx_GIVEREF(__pyx_tuple__16);
  19992. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":880
  19993. * t = child.type_num
  19994. * if end - f < 5:
  19995. * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
  19996. *
  19997. * # Until ticket #99 is fixed, use integers to avoid warnings
  19998. */
  19999. __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)
  20000. __Pyx_GOTREF(__pyx_tuple__17);
  20001. __Pyx_GIVEREF(__pyx_tuple__17);
  20002. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1038
  20003. * _import_array()
  20004. * except Exception:
  20005. * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
  20006. *
  20007. * cdef inline int import_umath() except -1:
  20008. */
  20009. __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)
  20010. __Pyx_GOTREF(__pyx_tuple__18);
  20011. __Pyx_GIVEREF(__pyx_tuple__18);
  20012. /* "../../virtualenv/v0.2_latest_requirements_versions/lib/python3.6/site-packages/Cython/Includes/numpy/__init__.pxd":1044
  20013. * _import_umath()
  20014. * except Exception:
  20015. * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
  20016. *
  20017. * cdef inline int import_ufunc() except -1:
  20018. */
  20019. __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)
  20020. __Pyx_GOTREF(__pyx_tuple__19);
  20021. __Pyx_GIVEREF(__pyx_tuple__19);
  20022. /* "gedlibpy.pyx":128
  20023. *
  20024. *
  20025. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  20026. * """
  20027. * Searchs the differents edit cost functions and returns the result.
  20028. */
  20029. __pyx_tuple__21 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 128, __pyx_L1_error)
  20030. __Pyx_GOTREF(__pyx_tuple__21);
  20031. __Pyx_GIVEREF(__pyx_tuple__21);
  20032. __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, 128, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 128, __pyx_L1_error)
  20033. /* "gedlibpy.pyx":142
  20034. *
  20035. *
  20036. * def get_method_options() : # <<<<<<<<<<<<<<
  20037. * """
  20038. * Searchs the differents method for edit distance computation between graphs and returns the result.
  20039. */
  20040. __pyx_tuple__23 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 142, __pyx_L1_error)
  20041. __Pyx_GOTREF(__pyx_tuple__23);
  20042. __Pyx_GIVEREF(__pyx_tuple__23);
  20043. __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, 142, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__24)) __PYX_ERR(0, 142, __pyx_L1_error)
  20044. /* "gedlibpy.pyx":155
  20045. *
  20046. *
  20047. * def get_init_options() : # <<<<<<<<<<<<<<
  20048. * """
  20049. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  20050. */
  20051. __pyx_tuple__25 = PyTuple_Pack(1, __pyx_n_s_option); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 155, __pyx_L1_error)
  20052. __Pyx_GOTREF(__pyx_tuple__25);
  20053. __Pyx_GIVEREF(__pyx_tuple__25);
  20054. __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, 155, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__26)) __PYX_ERR(0, 155, __pyx_L1_error)
  20055. /* "gedlibpy.pyx":168
  20056. *
  20057. *
  20058. * def get_dummy_node() : # <<<<<<<<<<<<<<
  20059. * """
  20060. * Returns the ID of a dummy node.
  20061. */
  20062. __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, 168, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__27)) __PYX_ERR(0, 168, __pyx_L1_error)
  20063. /* "gedlibpy.pyx":1400
  20064. * :type message: string
  20065. * """
  20066. * def __init__(self, message): # <<<<<<<<<<<<<<
  20067. * """
  20068. * Inits the error with its message.
  20069. */
  20070. __pyx_tuple__28 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(0, 1400, __pyx_L1_error)
  20071. __Pyx_GOTREF(__pyx_tuple__28);
  20072. __Pyx_GIVEREF(__pyx_tuple__28);
  20073. __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, 1400, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__29)) __PYX_ERR(0, 1400, __pyx_L1_error)
  20074. /* "gedlibpy.pyx":1417
  20075. * :type message: string
  20076. * """
  20077. * def __init__(self, message): # <<<<<<<<<<<<<<
  20078. * """
  20079. * Inits the error with its message.
  20080. */
  20081. __pyx_tuple__30 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 1417, __pyx_L1_error)
  20082. __Pyx_GOTREF(__pyx_tuple__30);
  20083. __Pyx_GIVEREF(__pyx_tuple__30);
  20084. __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, 1417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__31)) __PYX_ERR(0, 1417, __pyx_L1_error)
  20085. /* "gedlibpy.pyx":1434
  20086. * :type message: string
  20087. * """
  20088. * def __init__(self, message): # <<<<<<<<<<<<<<
  20089. * """
  20090. * Inits the error with its message.
  20091. */
  20092. __pyx_tuple__32 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_message); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 1434, __pyx_L1_error)
  20093. __Pyx_GOTREF(__pyx_tuple__32);
  20094. __Pyx_GIVEREF(__pyx_tuple__32);
  20095. __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, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__33)) __PYX_ERR(0, 1434, __pyx_L1_error)
  20096. /* "gedlibpy.pyx":1448
  20097. * #########################################
  20098. *
  20099. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20100. * """
  20101. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20102. */
  20103. __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, 1448, __pyx_L1_error)
  20104. __Pyx_GOTREF(__pyx_tuple__34);
  20105. __Pyx_GIVEREF(__pyx_tuple__34);
  20106. __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, 1448, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__35)) __PYX_ERR(0, 1448, __pyx_L1_error)
  20107. /* "gedlibpy.pyx":1466
  20108. *
  20109. *
  20110. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20111. * """
  20112. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20113. */
  20114. __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, 1466, __pyx_L1_error)
  20115. __Pyx_GOTREF(__pyx_tuple__36);
  20116. __Pyx_GIVEREF(__pyx_tuple__36);
  20117. __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, 1466, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__37)) __PYX_ERR(0, 1466, __pyx_L1_error)
  20118. /* "gedlibpy.pyx":1484
  20119. *
  20120. *
  20121. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20122. * """
  20123. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  20124. */
  20125. __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, 1484, __pyx_L1_error)
  20126. __Pyx_GOTREF(__pyx_tuple__38);
  20127. __Pyx_GIVEREF(__pyx_tuple__38);
  20128. __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, 1484, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__39)) __PYX_ERR(0, 1484, __pyx_L1_error)
  20129. __Pyx_RefNannyFinishContext();
  20130. return 0;
  20131. __pyx_L1_error:;
  20132. __Pyx_RefNannyFinishContext();
  20133. return -1;
  20134. }
  20135. static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  20136. if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  20137. __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  20138. __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  20139. return 0;
  20140. __pyx_L1_error:;
  20141. return -1;
  20142. }
  20143. static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
  20144. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
  20145. static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
  20146. static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
  20147. static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
  20148. static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
  20149. static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
  20150. static int __Pyx_modinit_global_init_code(void) {
  20151. __Pyx_RefNannyDeclarations
  20152. __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  20153. /*--- Global init code ---*/
  20154. __Pyx_RefNannyFinishContext();
  20155. return 0;
  20156. }
  20157. static int __Pyx_modinit_variable_export_code(void) {
  20158. __Pyx_RefNannyDeclarations
  20159. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  20160. /*--- Variable export code ---*/
  20161. __Pyx_RefNannyFinishContext();
  20162. return 0;
  20163. }
  20164. static int __Pyx_modinit_function_export_code(void) {
  20165. __Pyx_RefNannyDeclarations
  20166. __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  20167. /*--- Function export code ---*/
  20168. __Pyx_RefNannyFinishContext();
  20169. return 0;
  20170. }
  20171. static int __Pyx_modinit_type_init_code(void) {
  20172. __Pyx_RefNannyDeclarations
  20173. __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  20174. /*--- Type init code ---*/
  20175. if (PyType_Ready(&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  20176. #if PY_VERSION_HEX < 0x030800B1
  20177. __pyx_type_8gedlibpy_GEDEnv.tp_print = 0;
  20178. #endif
  20179. if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8gedlibpy_GEDEnv.tp_dictoffset && __pyx_type_8gedlibpy_GEDEnv.tp_getattro == PyObject_GenericGetAttr)) {
  20180. __pyx_type_8gedlibpy_GEDEnv.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  20181. }
  20182. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GEDEnv, (PyObject *)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  20183. if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8gedlibpy_GEDEnv) < 0) __PYX_ERR(0, 180, __pyx_L1_error)
  20184. __pyx_ptype_8gedlibpy_GEDEnv = &__pyx_type_8gedlibpy_GEDEnv;
  20185. __Pyx_RefNannyFinishContext();
  20186. return 0;
  20187. __pyx_L1_error:;
  20188. __Pyx_RefNannyFinishContext();
  20189. return -1;
  20190. }
  20191. static int __Pyx_modinit_type_import_code(void) {
  20192. __Pyx_RefNannyDeclarations
  20193. PyObject *__pyx_t_1 = NULL;
  20194. __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  20195. /*--- Type import code ---*/
  20196. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 9, __pyx_L1_error)
  20197. __Pyx_GOTREF(__pyx_t_1);
  20198. __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "type",
  20199. #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  20200. sizeof(PyTypeObject),
  20201. #else
  20202. sizeof(PyHeapTypeObject),
  20203. #endif
  20204. __Pyx_ImportType_CheckSize_Warn);
  20205. if (!__pyx_ptype_7cpython_4type_type) __PYX_ERR(4, 9, __pyx_L1_error)
  20206. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20207. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 8, __pyx_L1_error)
  20208. __Pyx_GOTREF(__pyx_t_1);
  20209. __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), __Pyx_ImportType_CheckSize_Warn);
  20210. if (!__pyx_ptype_7cpython_4bool_bool) __PYX_ERR(5, 8, __pyx_L1_error)
  20211. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20212. __pyx_t_1 = PyImport_ImportModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 15, __pyx_L1_error)
  20213. __Pyx_GOTREF(__pyx_t_1);
  20214. __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__pyx_t_1, __Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), __Pyx_ImportType_CheckSize_Warn);
  20215. if (!__pyx_ptype_7cpython_7complex_complex) __PYX_ERR(6, 15, __pyx_L1_error)
  20216. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20217. __pyx_t_1 = PyImport_ImportModule("numpy"); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 206, __pyx_L1_error)
  20218. __Pyx_GOTREF(__pyx_t_1);
  20219. __pyx_ptype_5numpy_dtype = __Pyx_ImportType(__pyx_t_1, "numpy", "dtype", sizeof(PyArray_Descr), __Pyx_ImportType_CheckSize_Ignore);
  20220. if (!__pyx_ptype_5numpy_dtype) __PYX_ERR(2, 206, __pyx_L1_error)
  20221. __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(__pyx_t_1, "numpy", "flatiter", sizeof(PyArrayIterObject), __Pyx_ImportType_CheckSize_Warn);
  20222. if (!__pyx_ptype_5numpy_flatiter) __PYX_ERR(2, 229, __pyx_L1_error)
  20223. __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(__pyx_t_1, "numpy", "broadcast", sizeof(PyArrayMultiIterObject), __Pyx_ImportType_CheckSize_Warn);
  20224. if (!__pyx_ptype_5numpy_broadcast) __PYX_ERR(2, 233, __pyx_L1_error)
  20225. __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(__pyx_t_1, "numpy", "ndarray", sizeof(PyArrayObject), __Pyx_ImportType_CheckSize_Ignore);
  20226. if (!__pyx_ptype_5numpy_ndarray) __PYX_ERR(2, 242, __pyx_L1_error)
  20227. __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(__pyx_t_1, "numpy", "ufunc", sizeof(PyUFuncObject), __Pyx_ImportType_CheckSize_Warn);
  20228. if (!__pyx_ptype_5numpy_ufunc) __PYX_ERR(2, 918, __pyx_L1_error)
  20229. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20230. __pyx_t_1 = PyImport_ImportModule("array"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 58, __pyx_L1_error)
  20231. __Pyx_GOTREF(__pyx_t_1);
  20232. __pyx_ptype_7cpython_5array_array = __Pyx_ImportType(__pyx_t_1, "array", "array", sizeof(arrayobject), __Pyx_ImportType_CheckSize_Warn);
  20233. if (!__pyx_ptype_7cpython_5array_array) __PYX_ERR(3, 58, __pyx_L1_error)
  20234. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20235. __Pyx_RefNannyFinishContext();
  20236. return 0;
  20237. __pyx_L1_error:;
  20238. __Pyx_XDECREF(__pyx_t_1);
  20239. __Pyx_RefNannyFinishContext();
  20240. return -1;
  20241. }
  20242. static int __Pyx_modinit_variable_import_code(void) {
  20243. __Pyx_RefNannyDeclarations
  20244. __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  20245. /*--- Variable import code ---*/
  20246. __Pyx_RefNannyFinishContext();
  20247. return 0;
  20248. }
  20249. static int __Pyx_modinit_function_import_code(void) {
  20250. __Pyx_RefNannyDeclarations
  20251. __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  20252. /*--- Function import code ---*/
  20253. __Pyx_RefNannyFinishContext();
  20254. return 0;
  20255. }
  20256. #if PY_MAJOR_VERSION < 3
  20257. #ifdef CYTHON_NO_PYINIT_EXPORT
  20258. #define __Pyx_PyMODINIT_FUNC void
  20259. #else
  20260. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  20261. #endif
  20262. #else
  20263. #ifdef CYTHON_NO_PYINIT_EXPORT
  20264. #define __Pyx_PyMODINIT_FUNC PyObject *
  20265. #else
  20266. #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
  20267. #endif
  20268. #endif
  20269. #if PY_MAJOR_VERSION < 3
  20270. __Pyx_PyMODINIT_FUNC initgedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  20271. __Pyx_PyMODINIT_FUNC initgedlibpy(void)
  20272. #else
  20273. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void) CYTHON_SMALL_CODE; /*proto*/
  20274. __Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)
  20275. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20276. {
  20277. return PyModuleDef_Init(&__pyx_moduledef);
  20278. }
  20279. static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
  20280. #if PY_VERSION_HEX >= 0x030700A1
  20281. static PY_INT64_T main_interpreter_id = -1;
  20282. PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
  20283. if (main_interpreter_id == -1) {
  20284. main_interpreter_id = current_id;
  20285. return (unlikely(current_id == -1)) ? -1 : 0;
  20286. } else if (unlikely(main_interpreter_id != current_id))
  20287. #else
  20288. static PyInterpreterState *main_interpreter = NULL;
  20289. PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
  20290. if (!main_interpreter) {
  20291. main_interpreter = current_interpreter;
  20292. } else if (unlikely(main_interpreter != current_interpreter))
  20293. #endif
  20294. {
  20295. PyErr_SetString(
  20296. PyExc_ImportError,
  20297. "Interpreter change detected - this module can only be loaded into one interpreter per process.");
  20298. return -1;
  20299. }
  20300. return 0;
  20301. }
  20302. 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) {
  20303. PyObject *value = PyObject_GetAttrString(spec, from_name);
  20304. int result = 0;
  20305. if (likely(value)) {
  20306. if (allow_none || value != Py_None) {
  20307. result = PyDict_SetItemString(moddict, to_name, value);
  20308. }
  20309. Py_DECREF(value);
  20310. } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
  20311. PyErr_Clear();
  20312. } else {
  20313. result = -1;
  20314. }
  20315. return result;
  20316. }
  20317. static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
  20318. PyObject *module = NULL, *moddict, *modname;
  20319. if (__Pyx_check_single_interpreter())
  20320. return NULL;
  20321. if (__pyx_m)
  20322. return __Pyx_NewRef(__pyx_m);
  20323. modname = PyObject_GetAttrString(spec, "name");
  20324. if (unlikely(!modname)) goto bad;
  20325. module = PyModule_NewObject(modname);
  20326. Py_DECREF(modname);
  20327. if (unlikely(!module)) goto bad;
  20328. moddict = PyModule_GetDict(module);
  20329. if (unlikely(!moddict)) goto bad;
  20330. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
  20331. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
  20332. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
  20333. if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
  20334. return module;
  20335. bad:
  20336. Py_XDECREF(module);
  20337. return NULL;
  20338. }
  20339. static CYTHON_SMALL_CODE int __pyx_pymod_exec_gedlibpy(PyObject *__pyx_pyinit_module)
  20340. #endif
  20341. #endif
  20342. {
  20343. PyObject *__pyx_t_1 = NULL;
  20344. PyObject *__pyx_t_2 = NULL;
  20345. PyObject *__pyx_t_3 = NULL;
  20346. PyObject *__pyx_t_4 = NULL;
  20347. PyObject *__pyx_t_5 = NULL;
  20348. __Pyx_RefNannyDeclarations
  20349. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20350. if (__pyx_m) {
  20351. if (__pyx_m == __pyx_pyinit_module) return 0;
  20352. PyErr_SetString(PyExc_RuntimeError, "Module 'gedlibpy' has already been imported. Re-initialisation is not supported.");
  20353. return -1;
  20354. }
  20355. #elif PY_MAJOR_VERSION >= 3
  20356. if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  20357. #endif
  20358. #if CYTHON_REFNANNY
  20359. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
  20360. if (!__Pyx_RefNanny) {
  20361. PyErr_Clear();
  20362. __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  20363. if (!__Pyx_RefNanny)
  20364. Py_FatalError("failed to import 'refnanny' module");
  20365. }
  20366. #endif
  20367. __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_gedlibpy(void)", 0);
  20368. if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20369. #ifdef __Pxy_PyFrame_Initialize_Offsets
  20370. __Pxy_PyFrame_Initialize_Offsets();
  20371. #endif
  20372. __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  20373. __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  20374. __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  20375. #ifdef __Pyx_CyFunction_USED
  20376. if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20377. #endif
  20378. #ifdef __Pyx_FusedFunction_USED
  20379. if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20380. #endif
  20381. #ifdef __Pyx_Coroutine_USED
  20382. if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20383. #endif
  20384. #ifdef __Pyx_Generator_USED
  20385. if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20386. #endif
  20387. #ifdef __Pyx_AsyncGen_USED
  20388. if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20389. #endif
  20390. #ifdef __Pyx_StopAsyncIteration_USED
  20391. if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20392. #endif
  20393. /*--- Library function declarations ---*/
  20394. /*--- Threads initialization code ---*/
  20395. #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  20396. #ifdef WITH_THREAD /* Python build with threading support? */
  20397. PyEval_InitThreads();
  20398. #endif
  20399. #endif
  20400. /*--- Module creation code ---*/
  20401. #if CYTHON_PEP489_MULTI_PHASE_INIT
  20402. __pyx_m = __pyx_pyinit_module;
  20403. Py_INCREF(__pyx_m);
  20404. #else
  20405. #if PY_MAJOR_VERSION < 3
  20406. __pyx_m = Py_InitModule4("gedlibpy", __pyx_methods, __pyx_k_Python_GedLib_module_This_modul, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  20407. #else
  20408. __pyx_m = PyModule_Create(&__pyx_moduledef);
  20409. #endif
  20410. if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  20411. #endif
  20412. __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  20413. Py_INCREF(__pyx_d);
  20414. __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  20415. Py_INCREF(__pyx_b);
  20416. __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  20417. Py_INCREF(__pyx_cython_runtime);
  20418. if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  20419. /*--- Initialize various global constants etc. ---*/
  20420. if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20421. #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  20422. if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20423. #endif
  20424. if (__pyx_module_is_main_gedlibpy) {
  20425. if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20426. }
  20427. #if PY_MAJOR_VERSION >= 3
  20428. {
  20429. PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
  20430. if (!PyDict_GetItemString(modules, "gedlibpy")) {
  20431. if (unlikely(PyDict_SetItemString(modules, "gedlibpy", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
  20432. }
  20433. }
  20434. #endif
  20435. /*--- Builtin init code ---*/
  20436. if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  20437. /*--- Constants init code ---*/
  20438. if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  20439. /*--- Global type/function init code ---*/
  20440. (void)__Pyx_modinit_global_init_code();
  20441. (void)__Pyx_modinit_variable_export_code();
  20442. (void)__Pyx_modinit_function_export_code();
  20443. if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  20444. if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  20445. (void)__Pyx_modinit_variable_import_code();
  20446. (void)__Pyx_modinit_function_import_code();
  20447. /*--- Execution code ---*/
  20448. #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  20449. if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  20450. #endif
  20451. /* "gedlibpy.pyx":115
  20452. * #############################
  20453. *
  20454. * import numpy as np # <<<<<<<<<<<<<<
  20455. * import networkx as nx
  20456. * from gklearn.ged.env import NodeMap
  20457. */
  20458. __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 115, __pyx_L1_error)
  20459. __Pyx_GOTREF(__pyx_t_1);
  20460. if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 115, __pyx_L1_error)
  20461. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20462. /* "gedlibpy.pyx":116
  20463. *
  20464. * import numpy as np
  20465. * import networkx as nx # <<<<<<<<<<<<<<
  20466. * from gklearn.ged.env import NodeMap
  20467. *
  20468. */
  20469. __pyx_t_1 = __Pyx_Import(__pyx_n_s_networkx, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 116, __pyx_L1_error)
  20470. __Pyx_GOTREF(__pyx_t_1);
  20471. if (PyDict_SetItem(__pyx_d, __pyx_n_s_nx, __pyx_t_1) < 0) __PYX_ERR(0, 116, __pyx_L1_error)
  20472. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20473. /* "gedlibpy.pyx":117
  20474. * import numpy as np
  20475. * import networkx as nx
  20476. * from gklearn.ged.env import NodeMap # <<<<<<<<<<<<<<
  20477. *
  20478. * # import librariesImport
  20479. */
  20480. __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  20481. __Pyx_GOTREF(__pyx_t_1);
  20482. __Pyx_INCREF(__pyx_n_s_NodeMap);
  20483. __Pyx_GIVEREF(__pyx_n_s_NodeMap);
  20484. PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_NodeMap);
  20485. __pyx_t_2 = __Pyx_Import(__pyx_n_s_gklearn_ged_env, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
  20486. __Pyx_GOTREF(__pyx_t_2);
  20487. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20488. __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_NodeMap); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 117, __pyx_L1_error)
  20489. __Pyx_GOTREF(__pyx_t_1);
  20490. if (PyDict_SetItem(__pyx_d, __pyx_n_s_NodeMap, __pyx_t_1) < 0) __PYX_ERR(0, 117, __pyx_L1_error)
  20491. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20492. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20493. /* "gedlibpy.pyx":120
  20494. *
  20495. * # import librariesImport
  20496. * from ctypes import * # <<<<<<<<<<<<<<
  20497. * import os
  20498. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20499. */
  20500. __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 120, __pyx_L1_error)
  20501. __Pyx_GOTREF(__pyx_t_2);
  20502. __Pyx_INCREF(__pyx_n_s__20);
  20503. __Pyx_GIVEREF(__pyx_n_s__20);
  20504. PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s__20);
  20505. __pyx_t_1 = __Pyx_Import(__pyx_n_s_ctypes, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 120, __pyx_L1_error)
  20506. __Pyx_GOTREF(__pyx_t_1);
  20507. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20508. if (__pyx_import_star(__pyx_t_1) < 0) __PYX_ERR(0, 120, __pyx_L1_error);
  20509. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20510. /* "gedlibpy.pyx":121
  20511. * # import librariesImport
  20512. * from ctypes import *
  20513. * import os # <<<<<<<<<<<<<<
  20514. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20515. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20516. */
  20517. __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 121, __pyx_L1_error)
  20518. __Pyx_GOTREF(__pyx_t_1);
  20519. if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 121, __pyx_L1_error)
  20520. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20521. /* "gedlibpy.pyx":122
  20522. * from ctypes import *
  20523. * import os
  20524. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so') # <<<<<<<<<<<<<<
  20525. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20526. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20527. */
  20528. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20529. __Pyx_GOTREF(__pyx_t_1);
  20530. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  20531. __Pyx_GOTREF(__pyx_t_2);
  20532. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20533. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20534. __Pyx_GOTREF(__pyx_t_1);
  20535. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  20536. __Pyx_GOTREF(__pyx_t_3);
  20537. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20538. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  20539. __Pyx_GOTREF(__pyx_t_1);
  20540. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20541. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  20542. __Pyx_GOTREF(__pyx_t_3);
  20543. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20544. __Pyx_GOTREF(__pyx_t_4);
  20545. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20546. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 122, __pyx_L1_error)
  20547. __Pyx_GOTREF(__pyx_t_3);
  20548. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20549. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20550. __Pyx_GOTREF(__pyx_t_4);
  20551. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  20552. __Pyx_GOTREF(__pyx_t_5);
  20553. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20554. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20555. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20556. __Pyx_GOTREF(__pyx_t_4);
  20557. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20558. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20559. __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_fann_libdoublefann_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 122, __pyx_L1_error)
  20560. __Pyx_GOTREF(__pyx_t_5);
  20561. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20562. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 122, __pyx_L1_error)
  20563. __Pyx_GOTREF(__pyx_t_4);
  20564. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20565. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20566. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib1, __pyx_t_4) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  20567. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20568. /* "gedlibpy.pyx":123
  20569. * import os
  20570. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20571. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so') # <<<<<<<<<<<<<<
  20572. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20573. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20574. */
  20575. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20576. __Pyx_GOTREF(__pyx_t_4);
  20577. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 123, __pyx_L1_error)
  20578. __Pyx_GOTREF(__pyx_t_5);
  20579. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20580. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20581. __Pyx_GOTREF(__pyx_t_4);
  20582. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  20583. __Pyx_GOTREF(__pyx_t_2);
  20584. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20585. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 123, __pyx_L1_error)
  20586. __Pyx_GOTREF(__pyx_t_4);
  20587. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20588. __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  20589. __Pyx_GOTREF(__pyx_t_2);
  20590. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20591. __Pyx_GOTREF(__pyx_t_1);
  20592. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20593. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  20594. __Pyx_GOTREF(__pyx_t_2);
  20595. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20596. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20597. __Pyx_GOTREF(__pyx_t_1);
  20598. __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 123, __pyx_L1_error)
  20599. __Pyx_GOTREF(__pyx_t_3);
  20600. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20601. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20602. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20603. __Pyx_GOTREF(__pyx_t_1);
  20604. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20605. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20606. __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, 123, __pyx_L1_error)
  20607. __Pyx_GOTREF(__pyx_t_3);
  20608. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20609. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
  20610. __Pyx_GOTREF(__pyx_t_1);
  20611. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20612. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20613. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib2, __pyx_t_1) < 0) __PYX_ERR(0, 123, __pyx_L1_error)
  20614. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20615. /* "gedlibpy.pyx":124
  20616. * lib1 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/fann/libdoublefann.so')
  20617. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20618. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so') # <<<<<<<<<<<<<<
  20619. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so')
  20620. *
  20621. */
  20622. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_cdll); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20623. __Pyx_GOTREF(__pyx_t_1);
  20624. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 124, __pyx_L1_error)
  20625. __Pyx_GOTREF(__pyx_t_3);
  20626. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20627. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20628. __Pyx_GOTREF(__pyx_t_1);
  20629. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
  20630. __Pyx_GOTREF(__pyx_t_5);
  20631. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20632. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
  20633. __Pyx_GOTREF(__pyx_t_1);
  20634. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20635. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_os); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
  20636. __Pyx_GOTREF(__pyx_t_5);
  20637. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_path); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20638. __Pyx_GOTREF(__pyx_t_4);
  20639. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20640. __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_realpath); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 124, __pyx_L1_error)
  20641. __Pyx_GOTREF(__pyx_t_5);
  20642. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20643. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_file); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20644. __Pyx_GOTREF(__pyx_t_4);
  20645. __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20646. __Pyx_GOTREF(__pyx_t_2);
  20647. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20648. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20649. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20650. __Pyx_GOTREF(__pyx_t_4);
  20651. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20652. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20653. __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_u_lib_nomad_libnomad_so); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  20654. __Pyx_GOTREF(__pyx_t_2);
  20655. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20656. __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 124, __pyx_L1_error)
  20657. __Pyx_GOTREF(__pyx_t_4);
  20658. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20659. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20660. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib3, __pyx_t_4) < 0) __PYX_ERR(0, 124, __pyx_L1_error)
  20661. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20662. /* "gedlibpy.pyx":125
  20663. * lib2 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/libsvm.3.22/libsvm.so')
  20664. * lib3 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libnomad.so')
  20665. * lib4 = cdll.LoadLibrary(os.path.dirname(os.path.realpath(__file__)) + '/lib/nomad/libsgtelib.so') # <<<<<<<<<<<<<<
  20666. *
  20667. *
  20668. */
  20669. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cdll); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20670. __Pyx_GOTREF(__pyx_t_4);
  20671. __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_LoadLibrary); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  20672. __Pyx_GOTREF(__pyx_t_2);
  20673. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20674. __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_os); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20675. __Pyx_GOTREF(__pyx_t_4);
  20676. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  20677. __Pyx_GOTREF(__pyx_t_3);
  20678. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20679. __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 125, __pyx_L1_error)
  20680. __Pyx_GOTREF(__pyx_t_4);
  20681. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20682. __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_os); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  20683. __Pyx_GOTREF(__pyx_t_3);
  20684. __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20685. __Pyx_GOTREF(__pyx_t_1);
  20686. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20687. __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_realpath); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 125, __pyx_L1_error)
  20688. __Pyx_GOTREF(__pyx_t_3);
  20689. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20690. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_file); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20691. __Pyx_GOTREF(__pyx_t_1);
  20692. __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20693. __Pyx_GOTREF(__pyx_t_5);
  20694. __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  20695. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20696. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20697. __Pyx_GOTREF(__pyx_t_1);
  20698. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20699. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20700. __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_kp_u_lib_nomad_libsgtelib_so); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 125, __pyx_L1_error)
  20701. __Pyx_GOTREF(__pyx_t_5);
  20702. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20703. __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 125, __pyx_L1_error)
  20704. __Pyx_GOTREF(__pyx_t_1);
  20705. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20706. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20707. if (PyDict_SetItem(__pyx_d, __pyx_n_s_lib4, __pyx_t_1) < 0) __PYX_ERR(0, 125, __pyx_L1_error)
  20708. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20709. /* "gedlibpy.pyx":128
  20710. *
  20711. *
  20712. * def get_edit_cost_options() : # <<<<<<<<<<<<<<
  20713. * """
  20714. * Searchs the differents edit cost functions and returns the result.
  20715. */
  20716. __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, 128, __pyx_L1_error)
  20717. __Pyx_GOTREF(__pyx_t_1);
  20718. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_edit_cost_options, __pyx_t_1) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
  20719. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20720. /* "gedlibpy.pyx":142
  20721. *
  20722. *
  20723. * def get_method_options() : # <<<<<<<<<<<<<<
  20724. * """
  20725. * Searchs the differents method for edit distance computation between graphs and returns the result.
  20726. */
  20727. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_3get_method_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 142, __pyx_L1_error)
  20728. __Pyx_GOTREF(__pyx_t_1);
  20729. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 142, __pyx_L1_error)
  20730. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20731. /* "gedlibpy.pyx":155
  20732. *
  20733. *
  20734. * def get_init_options() : # <<<<<<<<<<<<<<
  20735. * """
  20736. * Searchs the differents initialization parameters for the environment computation for graphs and returns the result.
  20737. */
  20738. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_5get_init_options, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 155, __pyx_L1_error)
  20739. __Pyx_GOTREF(__pyx_t_1);
  20740. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_init_options, __pyx_t_1) < 0) __PYX_ERR(0, 155, __pyx_L1_error)
  20741. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20742. /* "gedlibpy.pyx":168
  20743. *
  20744. *
  20745. * def get_dummy_node() : # <<<<<<<<<<<<<<
  20746. * """
  20747. * Returns the ID of a dummy node.
  20748. */
  20749. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_7get_dummy_node, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 168, __pyx_L1_error)
  20750. __Pyx_GOTREF(__pyx_t_1);
  20751. if (PyDict_SetItem(__pyx_d, __pyx_n_s_get_dummy_node, __pyx_t_1) < 0) __PYX_ERR(0, 168, __pyx_L1_error)
  20752. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20753. /* "gedlibpy.pyx":485
  20754. *
  20755. *
  20756. * def set_edit_cost(self, edit_cost, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20757. * """
  20758. * Sets an edit cost function to the environment, if it exists.
  20759. */
  20760. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 485, __pyx_L1_error)
  20761. __Pyx_GOTREF(__pyx_t_1);
  20762. __pyx_k__2 = __pyx_t_1;
  20763. __Pyx_GIVEREF(__pyx_t_1);
  20764. __pyx_t_1 = 0;
  20765. /* "gedlibpy.pyx":504
  20766. *
  20767. *
  20768. * def set_personal_edit_cost(self, edit_cost_constant = []) : # <<<<<<<<<<<<<<
  20769. * """
  20770. * Sets an personal edit cost function to the environment.
  20771. */
  20772. __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  20773. __Pyx_GOTREF(__pyx_t_1);
  20774. __pyx_k__3 = __pyx_t_1;
  20775. __Pyx_GIVEREF(__pyx_t_1);
  20776. __pyx_t_1 = 0;
  20777. /* "gedlibpy.pyx":1377
  20778. * #####################################################################
  20779. *
  20780. * list_of_edit_cost_options = get_edit_cost_options() # <<<<<<<<<<<<<<
  20781. * list_of_method_options = get_method_options()
  20782. * list_of_init_options = get_init_options()
  20783. */
  20784. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_edit_cost_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1377, __pyx_L1_error)
  20785. __Pyx_GOTREF(__pyx_t_1);
  20786. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1377, __pyx_L1_error)
  20787. __Pyx_GOTREF(__pyx_t_5);
  20788. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20789. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_edit_cost_options, __pyx_t_5) < 0) __PYX_ERR(0, 1377, __pyx_L1_error)
  20790. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20791. /* "gedlibpy.pyx":1378
  20792. *
  20793. * list_of_edit_cost_options = get_edit_cost_options()
  20794. * list_of_method_options = get_method_options() # <<<<<<<<<<<<<<
  20795. * list_of_init_options = get_init_options()
  20796. *
  20797. */
  20798. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_get_method_options); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1378, __pyx_L1_error)
  20799. __Pyx_GOTREF(__pyx_t_5);
  20800. __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1378, __pyx_L1_error)
  20801. __Pyx_GOTREF(__pyx_t_1);
  20802. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20803. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_method_options, __pyx_t_1) < 0) __PYX_ERR(0, 1378, __pyx_L1_error)
  20804. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20805. /* "gedlibpy.pyx":1379
  20806. * list_of_edit_cost_options = get_edit_cost_options()
  20807. * list_of_method_options = get_method_options()
  20808. * list_of_init_options = get_init_options() # <<<<<<<<<<<<<<
  20809. *
  20810. *
  20811. */
  20812. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_get_init_options); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1379, __pyx_L1_error)
  20813. __Pyx_GOTREF(__pyx_t_1);
  20814. __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1379, __pyx_L1_error)
  20815. __Pyx_GOTREF(__pyx_t_5);
  20816. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20817. if (PyDict_SetItem(__pyx_d, __pyx_n_s_list_of_init_options, __pyx_t_5) < 0) __PYX_ERR(0, 1379, __pyx_L1_error)
  20818. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20819. /* "gedlibpy.pyx":1386
  20820. * #####################
  20821. *
  20822. * class Error(Exception): # <<<<<<<<<<<<<<
  20823. * """
  20824. * Class for error's management. This one is general.
  20825. */
  20826. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1386, __pyx_L1_error)
  20827. __Pyx_GOTREF(__pyx_t_5);
  20828. __Pyx_INCREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20829. __Pyx_GIVEREF(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20830. PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
  20831. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1386, __pyx_L1_error)
  20832. __Pyx_GOTREF(__pyx_t_1);
  20833. __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, 1386, __pyx_L1_error)
  20834. __Pyx_GOTREF(__pyx_t_2);
  20835. __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, 1386, __pyx_L1_error)
  20836. __Pyx_GOTREF(__pyx_t_4);
  20837. if (PyDict_SetItem(__pyx_d, __pyx_n_s_Error, __pyx_t_4) < 0) __PYX_ERR(0, 1386, __pyx_L1_error)
  20838. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20839. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20840. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20841. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20842. /* "gedlibpy.pyx":1393
  20843. *
  20844. *
  20845. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20846. * """
  20847. * 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).
  20848. */
  20849. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
  20850. __Pyx_GOTREF(__pyx_t_5);
  20851. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  20852. __Pyx_GOTREF(__pyx_t_1);
  20853. __Pyx_GIVEREF(__pyx_t_5);
  20854. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20855. __pyx_t_5 = 0;
  20856. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1393, __pyx_L1_error)
  20857. __Pyx_GOTREF(__pyx_t_5);
  20858. __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, 1393, __pyx_L1_error)
  20859. __Pyx_GOTREF(__pyx_t_2);
  20860. /* "gedlibpy.pyx":1400
  20861. * :type message: string
  20862. * """
  20863. * def __init__(self, message): # <<<<<<<<<<<<<<
  20864. * """
  20865. * Inits the error with its message.
  20866. */
  20867. __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, 1400, __pyx_L1_error)
  20868. __Pyx_GOTREF(__pyx_t_4);
  20869. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1400, __pyx_L1_error)
  20870. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20871. /* "gedlibpy.pyx":1393
  20872. *
  20873. *
  20874. * class EditCostError(Error) : # <<<<<<<<<<<<<<
  20875. * """
  20876. * 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).
  20877. */
  20878. __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, 1393, __pyx_L1_error)
  20879. __Pyx_GOTREF(__pyx_t_4);
  20880. if (PyDict_SetItem(__pyx_d, __pyx_n_s_EditCostError, __pyx_t_4) < 0) __PYX_ERR(0, 1393, __pyx_L1_error)
  20881. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20882. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20883. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20884. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20885. /* "gedlibpy.pyx":1410
  20886. *
  20887. *
  20888. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20889. * """
  20890. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20891. */
  20892. __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Error); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
  20893. __Pyx_GOTREF(__pyx_t_1);
  20894. __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1410, __pyx_L1_error)
  20895. __Pyx_GOTREF(__pyx_t_5);
  20896. __Pyx_GIVEREF(__pyx_t_1);
  20897. PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  20898. __pyx_t_1 = 0;
  20899. __pyx_t_1 = __Pyx_CalculateMetaclass(NULL, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1410, __pyx_L1_error)
  20900. __Pyx_GOTREF(__pyx_t_1);
  20901. __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, 1410, __pyx_L1_error)
  20902. __Pyx_GOTREF(__pyx_t_2);
  20903. /* "gedlibpy.pyx":1417
  20904. * :type message: string
  20905. * """
  20906. * def __init__(self, message): # <<<<<<<<<<<<<<
  20907. * """
  20908. * Inits the error with its message.
  20909. */
  20910. __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, 1417, __pyx_L1_error)
  20911. __Pyx_GOTREF(__pyx_t_4);
  20912. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
  20913. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20914. /* "gedlibpy.pyx":1410
  20915. *
  20916. *
  20917. * class MethodError(Error) : # <<<<<<<<<<<<<<
  20918. * """
  20919. * Class for Method Error. Raise an error if a computation method doesn't exist in the library (not in list_of_method_options).
  20920. */
  20921. __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, 1410, __pyx_L1_error)
  20922. __Pyx_GOTREF(__pyx_t_4);
  20923. if (PyDict_SetItem(__pyx_d, __pyx_n_s_MethodError, __pyx_t_4) < 0) __PYX_ERR(0, 1410, __pyx_L1_error)
  20924. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20925. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20926. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20927. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20928. /* "gedlibpy.pyx":1427
  20929. *
  20930. *
  20931. * class InitError(Error) : # <<<<<<<<<<<<<<
  20932. * """
  20933. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20934. */
  20935. __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_Error); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error)
  20936. __Pyx_GOTREF(__pyx_t_5);
  20937. __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1427, __pyx_L1_error)
  20938. __Pyx_GOTREF(__pyx_t_1);
  20939. __Pyx_GIVEREF(__pyx_t_5);
  20940. PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
  20941. __pyx_t_5 = 0;
  20942. __pyx_t_5 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1427, __pyx_L1_error)
  20943. __Pyx_GOTREF(__pyx_t_5);
  20944. __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, 1427, __pyx_L1_error)
  20945. __Pyx_GOTREF(__pyx_t_2);
  20946. /* "gedlibpy.pyx":1434
  20947. * :type message: string
  20948. * """
  20949. * def __init__(self, message): # <<<<<<<<<<<<<<
  20950. * """
  20951. * Inits the error with its message.
  20952. */
  20953. __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, 1434, __pyx_L1_error)
  20954. __Pyx_GOTREF(__pyx_t_4);
  20955. if (__Pyx_SetNameInClass(__pyx_t_2, __pyx_n_s_init_2, __pyx_t_4) < 0) __PYX_ERR(0, 1434, __pyx_L1_error)
  20956. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20957. /* "gedlibpy.pyx":1427
  20958. *
  20959. *
  20960. * class InitError(Error) : # <<<<<<<<<<<<<<
  20961. * """
  20962. * Class for Init Error. Raise an error if an init option doesn't exist in the library (not in list_of_init_options).
  20963. */
  20964. __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, 1427, __pyx_L1_error)
  20965. __Pyx_GOTREF(__pyx_t_4);
  20966. if (PyDict_SetItem(__pyx_d, __pyx_n_s_InitError, __pyx_t_4) < 0) __PYX_ERR(0, 1427, __pyx_L1_error)
  20967. __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  20968. __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  20969. __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  20970. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20971. /* "gedlibpy.pyx":1448
  20972. * #########################################
  20973. *
  20974. * def encode_your_map(map_u): # <<<<<<<<<<<<<<
  20975. * """
  20976. * Encodes Python unicode strings in dictionnary `map` to utf-8 byte strings for C++ functions.
  20977. */
  20978. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_9encode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1448, __pyx_L1_error)
  20979. __Pyx_GOTREF(__pyx_t_1);
  20980. if (PyDict_SetItem(__pyx_d, __pyx_n_s_encode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1448, __pyx_L1_error)
  20981. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20982. /* "gedlibpy.pyx":1466
  20983. *
  20984. *
  20985. * def decode_your_map(map_b): # <<<<<<<<<<<<<<
  20986. * """
  20987. * Decodes utf-8 byte strings in `map` from C++ functions to Python unicode strings.
  20988. */
  20989. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_11decode_your_map, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1466, __pyx_L1_error)
  20990. __Pyx_GOTREF(__pyx_t_1);
  20991. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_your_map, __pyx_t_1) < 0) __PYX_ERR(0, 1466, __pyx_L1_error)
  20992. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  20993. /* "gedlibpy.pyx":1484
  20994. *
  20995. *
  20996. * def decode_graph_edges(map_edge_b): # <<<<<<<<<<<<<<
  20997. * """
  20998. * Decode utf-8 byte strings in graph edges `map` from C++ functions to Python unicode strings.
  20999. */
  21000. __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_8gedlibpy_13decode_graph_edges, NULL, __pyx_n_s_gedlibpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1484, __pyx_L1_error)
  21001. __Pyx_GOTREF(__pyx_t_1);
  21002. if (PyDict_SetItem(__pyx_d, __pyx_n_s_decode_graph_edges, __pyx_t_1) < 0) __PYX_ERR(0, 1484, __pyx_L1_error)
  21003. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  21004. /* "gedlibpy.pyx":1
  21005. * # distutils: language = c++ # <<<<<<<<<<<<<<
  21006. *
  21007. * """
  21008. */
  21009. __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  21010. __Pyx_GOTREF(__pyx_t_1);
  21011. if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  21012. __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  21013. /* "vector.from_py":45
  21014. *
  21015. * @cname("__pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___")
  21016. * cdef vector[X] __pyx_convert_vector_from_py_std_3a__3a_pair_3c_size_t_2c_size_t_3e___(object o) except *: # <<<<<<<<<<<<<<
  21017. * cdef vector[X] v
  21018. * for item in o:
  21019. */
  21020. /*--- Wrapped vars code ---*/
  21021. goto __pyx_L0;
  21022. __pyx_L1_error:;
  21023. __Pyx_XDECREF(__pyx_t_1);
  21024. __Pyx_XDECREF(__pyx_t_2);
  21025. __Pyx_XDECREF(__pyx_t_3);
  21026. __Pyx_XDECREF(__pyx_t_4);
  21027. __Pyx_XDECREF(__pyx_t_5);
  21028. if (__pyx_m) {
  21029. if (__pyx_d) {
  21030. __Pyx_AddTraceback("init gedlibpy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  21031. }
  21032. Py_CLEAR(__pyx_m);
  21033. } else if (!PyErr_Occurred()) {
  21034. PyErr_SetString(PyExc_ImportError, "init gedlibpy");
  21035. }
  21036. __pyx_L0:;
  21037. __Pyx_RefNannyFinishContext();
  21038. #if CYTHON_PEP489_MULTI_PHASE_INIT
  21039. return (__pyx_m != NULL) ? 0 : -1;
  21040. #elif PY_MAJOR_VERSION >= 3
  21041. return __pyx_m;
  21042. #else
  21043. return;
  21044. #endif
  21045. }
  21046. /* --- Runtime support code --- */
  21047. /* Refnanny */
  21048. #if CYTHON_REFNANNY
  21049. static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
  21050. PyObject *m = NULL, *p = NULL;
  21051. void *r = NULL;
  21052. m = PyImport_ImportModule(modname);
  21053. if (!m) goto end;
  21054. p = PyObject_GetAttrString(m, "RefNannyAPI");
  21055. if (!p) goto end;
  21056. r = PyLong_AsVoidPtr(p);
  21057. end:
  21058. Py_XDECREF(p);
  21059. Py_XDECREF(m);
  21060. return (__Pyx_RefNannyAPIStruct *)r;
  21061. }
  21062. #endif
  21063. /* PyObjectGetAttrStr */
  21064. #if CYTHON_USE_TYPE_SLOTS
  21065. static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
  21066. PyTypeObject* tp = Py_TYPE(obj);
  21067. if (likely(tp->tp_getattro))
  21068. return tp->tp_getattro(obj, attr_name);
  21069. #if PY_MAJOR_VERSION < 3
  21070. if (likely(tp->tp_getattr))
  21071. return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
  21072. #endif
  21073. return PyObject_GetAttr(obj, attr_name);
  21074. }
  21075. #endif
  21076. /* GetBuiltinName */
  21077. static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
  21078. PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
  21079. if (unlikely(!result)) {
  21080. PyErr_Format(PyExc_NameError,
  21081. #if PY_MAJOR_VERSION >= 3
  21082. "name '%U' is not defined", name);
  21083. #else
  21084. "name '%.200s' is not defined", PyString_AS_STRING(name));
  21085. #endif
  21086. }
  21087. return result;
  21088. }
  21089. /* decode_c_bytes */
  21090. static CYTHON_INLINE PyObject* __Pyx_decode_c_bytes(
  21091. const char* cstring, Py_ssize_t length, Py_ssize_t start, Py_ssize_t stop,
  21092. const char* encoding, const char* errors,
  21093. PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
  21094. if (unlikely((start < 0) | (stop < 0))) {
  21095. if (start < 0) {
  21096. start += length;
  21097. if (start < 0)
  21098. start = 0;
  21099. }
  21100. if (stop < 0)
  21101. stop += length;
  21102. }
  21103. if (stop > length)
  21104. stop = length;
  21105. length = stop - start;
  21106. if (unlikely(length <= 0))
  21107. return PyUnicode_FromUnicode(NULL, 0);
  21108. cstring += start;
  21109. if (decode_func) {
  21110. return decode_func(cstring, length, errors);
  21111. } else {
  21112. return PyUnicode_Decode(cstring, length, encoding, errors);
  21113. }
  21114. }
  21115. /* RaiseArgTupleInvalid */
  21116. static void __Pyx_RaiseArgtupleInvalid(
  21117. const char* func_name,
  21118. int exact,
  21119. Py_ssize_t num_min,
  21120. Py_ssize_t num_max,
  21121. Py_ssize_t num_found)
  21122. {
  21123. Py_ssize_t num_expected;
  21124. const char *more_or_less;
  21125. if (num_found < num_min) {
  21126. num_expected = num_min;
  21127. more_or_less = "at least";
  21128. } else {
  21129. num_expected = num_max;
  21130. more_or_less = "at most";
  21131. }
  21132. if (exact) {
  21133. more_or_less = "exactly";
  21134. }
  21135. PyErr_Format(PyExc_TypeError,
  21136. "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
  21137. func_name, more_or_less, num_expected,
  21138. (num_expected == 1) ? "" : "s", num_found);
  21139. }
  21140. /* KeywordStringCheck */
  21141. static int __Pyx_CheckKeywordStrings(
  21142. PyObject *kwdict,
  21143. const char* function_name,
  21144. int kw_allowed)
  21145. {
  21146. PyObject* key = 0;
  21147. Py_ssize_t pos = 0;
  21148. #if CYTHON_COMPILING_IN_PYPY
  21149. if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
  21150. goto invalid_keyword;
  21151. return 1;
  21152. #else
  21153. while (PyDict_Next(kwdict, &pos, &key, 0)) {
  21154. #if PY_MAJOR_VERSION < 3
  21155. if (unlikely(!PyString_Check(key)))
  21156. #endif
  21157. if (unlikely(!PyUnicode_Check(key)))
  21158. goto invalid_keyword_type;
  21159. }
  21160. if ((!kw_allowed) && unlikely(key))
  21161. goto invalid_keyword;
  21162. return 1;
  21163. invalid_keyword_type:
  21164. PyErr_Format(PyExc_TypeError,
  21165. "%.200s() keywords must be strings", function_name);
  21166. return 0;
  21167. #endif
  21168. invalid_keyword:
  21169. PyErr_Format(PyExc_TypeError,
  21170. #if PY_MAJOR_VERSION < 3
  21171. "%.200s() got an unexpected keyword argument '%.200s'",
  21172. function_name, PyString_AsString(key));
  21173. #else
  21174. "%s() got an unexpected keyword argument '%U'",
  21175. function_name, key);
  21176. #endif
  21177. return 0;
  21178. }
  21179. /* RaiseDoubleKeywords */
  21180. static void __Pyx_RaiseDoubleKeywordsError(
  21181. const char* func_name,
  21182. PyObject* kw_name)
  21183. {
  21184. PyErr_Format(PyExc_TypeError,
  21185. #if PY_MAJOR_VERSION >= 3
  21186. "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
  21187. #else
  21188. "%s() got multiple values for keyword argument '%s'", func_name,
  21189. PyString_AsString(kw_name));
  21190. #endif
  21191. }
  21192. /* ParseKeywords */
  21193. static int __Pyx_ParseOptionalKeywords(
  21194. PyObject *kwds,
  21195. PyObject **argnames[],
  21196. PyObject *kwds2,
  21197. PyObject *values[],
  21198. Py_ssize_t num_pos_args,
  21199. const char* function_name)
  21200. {
  21201. PyObject *key = 0, *value = 0;
  21202. Py_ssize_t pos = 0;
  21203. PyObject*** name;
  21204. PyObject*** first_kw_arg = argnames + num_pos_args;
  21205. while (PyDict_Next(kwds, &pos, &key, &value)) {
  21206. name = first_kw_arg;
  21207. while (*name && (**name != key)) name++;
  21208. if (*name) {
  21209. values[name-argnames] = value;
  21210. continue;
  21211. }
  21212. name = first_kw_arg;
  21213. #if PY_MAJOR_VERSION < 3
  21214. if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
  21215. while (*name) {
  21216. if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
  21217. && _PyString_Eq(**name, key)) {
  21218. values[name-argnames] = value;
  21219. break;
  21220. }
  21221. name++;
  21222. }
  21223. if (*name) continue;
  21224. else {
  21225. PyObject*** argname = argnames;
  21226. while (argname != first_kw_arg) {
  21227. if ((**argname == key) || (
  21228. (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
  21229. && _PyString_Eq(**argname, key))) {
  21230. goto arg_passed_twice;
  21231. }
  21232. argname++;
  21233. }
  21234. }
  21235. } else
  21236. #endif
  21237. if (likely(PyUnicode_Check(key))) {
  21238. while (*name) {
  21239. int cmp = (**name == key) ? 0 :
  21240. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  21241. (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
  21242. #endif
  21243. PyUnicode_Compare(**name, key);
  21244. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  21245. if (cmp == 0) {
  21246. values[name-argnames] = value;
  21247. break;
  21248. }
  21249. name++;
  21250. }
  21251. if (*name) continue;
  21252. else {
  21253. PyObject*** argname = argnames;
  21254. while (argname != first_kw_arg) {
  21255. int cmp = (**argname == key) ? 0 :
  21256. #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
  21257. (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
  21258. #endif
  21259. PyUnicode_Compare(**argname, key);
  21260. if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
  21261. if (cmp == 0) goto arg_passed_twice;
  21262. argname++;
  21263. }
  21264. }
  21265. } else
  21266. goto invalid_keyword_type;
  21267. if (kwds2) {
  21268. if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
  21269. } else {
  21270. goto invalid_keyword;
  21271. }
  21272. }
  21273. return 0;
  21274. arg_passed_twice:
  21275. __Pyx_RaiseDoubleKeywordsError(function_name, key);
  21276. goto bad;
  21277. invalid_keyword_type:
  21278. PyErr_Format(PyExc_TypeError,
  21279. "%.200s() keywords must be strings", function_name);
  21280. goto bad;
  21281. invalid_keyword:
  21282. PyErr_Format(PyExc_TypeError,
  21283. #if PY_MAJOR_VERSION < 3
  21284. "%.200s() got an unexpected keyword argument '%.200s'",
  21285. function_name, PyString_AsString(key));
  21286. #else
  21287. "%s() got an unexpected keyword argument '%U'",
  21288. function_name, key);
  21289. #endif
  21290. bad:
  21291. return -1;
  21292. }
  21293. /* PyCFunctionFastCall */
  21294. #if CYTHON_FAST_PYCCALL
  21295. static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
  21296. PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
  21297. PyCFunction meth = PyCFunction_GET_FUNCTION(func);
  21298. PyObject *self = PyCFunction_GET_SELF(func);
  21299. int flags = PyCFunction_GET_FLAGS(func);
  21300. assert(PyCFunction_Check(func));
  21301. assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
  21302. assert(nargs >= 0);
  21303. assert(nargs == 0 || args != NULL);
  21304. /* _PyCFunction_FastCallDict() must not be called with an exception set,
  21305. because it may clear it (directly or indirectly) and so the
  21306. caller loses its exception */
  21307. assert(!PyErr_Occurred());
  21308. if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
  21309. return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
  21310. } else {
  21311. return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
  21312. }
  21313. }
  21314. #endif
  21315. /* PyFunctionFastCall */
  21316. #if CYTHON_FAST_PYCALL
  21317. static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
  21318. PyObject *globals) {
  21319. PyFrameObject *f;
  21320. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21321. PyObject **fastlocals;
  21322. Py_ssize_t i;
  21323. PyObject *result;
  21324. assert(globals != NULL);
  21325. /* XXX Perhaps we should create a specialized
  21326. PyFrame_New() that doesn't take locals, but does
  21327. take builtins without sanity checking them.
  21328. */
  21329. assert(tstate != NULL);
  21330. f = PyFrame_New(tstate, co, globals, NULL);
  21331. if (f == NULL) {
  21332. return NULL;
  21333. }
  21334. fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  21335. for (i = 0; i < na; i++) {
  21336. Py_INCREF(*args);
  21337. fastlocals[i] = *args++;
  21338. }
  21339. result = PyEval_EvalFrameEx(f,0);
  21340. ++tstate->recursion_depth;
  21341. Py_DECREF(f);
  21342. --tstate->recursion_depth;
  21343. return result;
  21344. }
  21345. #if 1 || PY_VERSION_HEX < 0x030600B1
  21346. static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
  21347. PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
  21348. PyObject *globals = PyFunction_GET_GLOBALS(func);
  21349. PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
  21350. PyObject *closure;
  21351. #if PY_MAJOR_VERSION >= 3
  21352. PyObject *kwdefs;
  21353. #endif
  21354. PyObject *kwtuple, **k;
  21355. PyObject **d;
  21356. Py_ssize_t nd;
  21357. Py_ssize_t nk;
  21358. PyObject *result;
  21359. assert(kwargs == NULL || PyDict_Check(kwargs));
  21360. nk = kwargs ? PyDict_Size(kwargs) : 0;
  21361. if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
  21362. return NULL;
  21363. }
  21364. if (
  21365. #if PY_MAJOR_VERSION >= 3
  21366. co->co_kwonlyargcount == 0 &&
  21367. #endif
  21368. likely(kwargs == NULL || nk == 0) &&
  21369. co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  21370. if (argdefs == NULL && co->co_argcount == nargs) {
  21371. result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  21372. goto done;
  21373. }
  21374. else if (nargs == 0 && argdefs != NULL
  21375. && co->co_argcount == Py_SIZE(argdefs)) {
  21376. /* function called with no arguments, but all parameters have
  21377. a default value: use default values as arguments .*/
  21378. args = &PyTuple_GET_ITEM(argdefs, 0);
  21379. result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
  21380. goto done;
  21381. }
  21382. }
  21383. if (kwargs != NULL) {
  21384. Py_ssize_t pos, i;
  21385. kwtuple = PyTuple_New(2 * nk);
  21386. if (kwtuple == NULL) {
  21387. result = NULL;
  21388. goto done;
  21389. }
  21390. k = &PyTuple_GET_ITEM(kwtuple, 0);
  21391. pos = i = 0;
  21392. while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
  21393. Py_INCREF(k[i]);
  21394. Py_INCREF(k[i+1]);
  21395. i += 2;
  21396. }
  21397. nk = i / 2;
  21398. }
  21399. else {
  21400. kwtuple = NULL;
  21401. k = NULL;
  21402. }
  21403. closure = PyFunction_GET_CLOSURE(func);
  21404. #if PY_MAJOR_VERSION >= 3
  21405. kwdefs = PyFunction_GET_KW_DEFAULTS(func);
  21406. #endif
  21407. if (argdefs != NULL) {
  21408. d = &PyTuple_GET_ITEM(argdefs, 0);
  21409. nd = Py_SIZE(argdefs);
  21410. }
  21411. else {
  21412. d = NULL;
  21413. nd = 0;
  21414. }
  21415. #if PY_MAJOR_VERSION >= 3
  21416. result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
  21417. args, (int)nargs,
  21418. k, (int)nk,
  21419. d, (int)nd, kwdefs, closure);
  21420. #else
  21421. result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
  21422. args, (int)nargs,
  21423. k, (int)nk,
  21424. d, (int)nd, closure);
  21425. #endif
  21426. Py_XDECREF(kwtuple);
  21427. done:
  21428. Py_LeaveRecursiveCall();
  21429. return result;
  21430. }
  21431. #endif
  21432. #endif
  21433. /* PyObjectCall */
  21434. #if CYTHON_COMPILING_IN_CPYTHON
  21435. static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  21436. PyObject *result;
  21437. ternaryfunc call = func->ob_type->tp_call;
  21438. if (unlikely(!call))
  21439. return PyObject_Call(func, arg, kw);
  21440. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21441. return NULL;
  21442. result = (*call)(func, arg, kw);
  21443. Py_LeaveRecursiveCall();
  21444. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21445. PyErr_SetString(
  21446. PyExc_SystemError,
  21447. "NULL result without error in PyObject_Call");
  21448. }
  21449. return result;
  21450. }
  21451. #endif
  21452. /* PyObjectCall2Args */
  21453. static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
  21454. PyObject *args, *result = NULL;
  21455. #if CYTHON_FAST_PYCALL
  21456. if (PyFunction_Check(function)) {
  21457. PyObject *args[2] = {arg1, arg2};
  21458. return __Pyx_PyFunction_FastCall(function, args, 2);
  21459. }
  21460. #endif
  21461. #if CYTHON_FAST_PYCCALL
  21462. if (__Pyx_PyFastCFunction_Check(function)) {
  21463. PyObject *args[2] = {arg1, arg2};
  21464. return __Pyx_PyCFunction_FastCall(function, args, 2);
  21465. }
  21466. #endif
  21467. args = PyTuple_New(2);
  21468. if (unlikely(!args)) goto done;
  21469. Py_INCREF(arg1);
  21470. PyTuple_SET_ITEM(args, 0, arg1);
  21471. Py_INCREF(arg2);
  21472. PyTuple_SET_ITEM(args, 1, arg2);
  21473. Py_INCREF(function);
  21474. result = __Pyx_PyObject_Call(function, args, NULL);
  21475. Py_DECREF(args);
  21476. Py_DECREF(function);
  21477. done:
  21478. return result;
  21479. }
  21480. /* PyObjectCallMethO */
  21481. #if CYTHON_COMPILING_IN_CPYTHON
  21482. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
  21483. PyObject *self, *result;
  21484. PyCFunction cfunc;
  21485. cfunc = PyCFunction_GET_FUNCTION(func);
  21486. self = PyCFunction_GET_SELF(func);
  21487. if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
  21488. return NULL;
  21489. result = cfunc(self, arg);
  21490. Py_LeaveRecursiveCall();
  21491. if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
  21492. PyErr_SetString(
  21493. PyExc_SystemError,
  21494. "NULL result without error in PyObject_Call");
  21495. }
  21496. return result;
  21497. }
  21498. #endif
  21499. /* PyObjectCallOneArg */
  21500. #if CYTHON_COMPILING_IN_CPYTHON
  21501. static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21502. PyObject *result;
  21503. PyObject *args = PyTuple_New(1);
  21504. if (unlikely(!args)) return NULL;
  21505. Py_INCREF(arg);
  21506. PyTuple_SET_ITEM(args, 0, arg);
  21507. result = __Pyx_PyObject_Call(func, args, NULL);
  21508. Py_DECREF(args);
  21509. return result;
  21510. }
  21511. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21512. #if CYTHON_FAST_PYCALL
  21513. if (PyFunction_Check(func)) {
  21514. return __Pyx_PyFunction_FastCall(func, &arg, 1);
  21515. }
  21516. #endif
  21517. if (likely(PyCFunction_Check(func))) {
  21518. if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
  21519. return __Pyx_PyObject_CallMethO(func, arg);
  21520. #if CYTHON_FAST_PYCCALL
  21521. } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
  21522. return __Pyx_PyCFunction_FastCall(func, &arg, 1);
  21523. #endif
  21524. }
  21525. }
  21526. return __Pyx__PyObject_CallOneArg(func, arg);
  21527. }
  21528. #else
  21529. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  21530. PyObject *result;
  21531. PyObject *args = PyTuple_Pack(1, arg);
  21532. if (unlikely(!args)) return NULL;
  21533. result = __Pyx_PyObject_Call(func, args, NULL);
  21534. Py_DECREF(args);
  21535. return result;
  21536. }
  21537. #endif
  21538. /* PyDictVersioning */
  21539. #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
  21540. static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
  21541. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21542. return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
  21543. }
  21544. static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
  21545. PyObject **dictptr = NULL;
  21546. Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
  21547. if (offset) {
  21548. #if CYTHON_COMPILING_IN_CPYTHON
  21549. dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
  21550. #else
  21551. dictptr = _PyObject_GetDictPtr(obj);
  21552. #endif
  21553. }
  21554. return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
  21555. }
  21556. static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
  21557. PyObject *dict = Py_TYPE(obj)->tp_dict;
  21558. if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
  21559. return 0;
  21560. return obj_dict_version == __Pyx_get_object_dict_version(obj);
  21561. }
  21562. #endif
  21563. /* GetModuleGlobalName */
  21564. #if CYTHON_USE_DICT_VERSIONS
  21565. static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
  21566. #else
  21567. static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
  21568. #endif
  21569. {
  21570. PyObject *result;
  21571. #if !CYTHON_AVOID_BORROWED_REFS
  21572. #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
  21573. result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
  21574. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21575. if (likely(result)) {
  21576. return __Pyx_NewRef(result);
  21577. } else if (unlikely(PyErr_Occurred())) {
  21578. return NULL;
  21579. }
  21580. #else
  21581. result = PyDict_GetItem(__pyx_d, name);
  21582. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21583. if (likely(result)) {
  21584. return __Pyx_NewRef(result);
  21585. }
  21586. #endif
  21587. #else
  21588. result = PyObject_GetItem(__pyx_d, name);
  21589. __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
  21590. if (likely(result)) {
  21591. return __Pyx_NewRef(result);
  21592. }
  21593. PyErr_Clear();
  21594. #endif
  21595. return __Pyx_GetBuiltinName(name);
  21596. }
  21597. /* PyErrFetchRestore */
  21598. #if CYTHON_FAST_THREAD_STATE
  21599. static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  21600. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21601. tmp_type = tstate->curexc_type;
  21602. tmp_value = tstate->curexc_value;
  21603. tmp_tb = tstate->curexc_traceback;
  21604. tstate->curexc_type = type;
  21605. tstate->curexc_value = value;
  21606. tstate->curexc_traceback = tb;
  21607. Py_XDECREF(tmp_type);
  21608. Py_XDECREF(tmp_value);
  21609. Py_XDECREF(tmp_tb);
  21610. }
  21611. static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  21612. *type = tstate->curexc_type;
  21613. *value = tstate->curexc_value;
  21614. *tb = tstate->curexc_traceback;
  21615. tstate->curexc_type = 0;
  21616. tstate->curexc_value = 0;
  21617. tstate->curexc_traceback = 0;
  21618. }
  21619. #endif
  21620. /* RaiseException */
  21621. #if PY_MAJOR_VERSION < 3
  21622. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
  21623. CYTHON_UNUSED PyObject *cause) {
  21624. __Pyx_PyThreadState_declare
  21625. Py_XINCREF(type);
  21626. if (!value || value == Py_None)
  21627. value = NULL;
  21628. else
  21629. Py_INCREF(value);
  21630. if (!tb || tb == Py_None)
  21631. tb = NULL;
  21632. else {
  21633. Py_INCREF(tb);
  21634. if (!PyTraceBack_Check(tb)) {
  21635. PyErr_SetString(PyExc_TypeError,
  21636. "raise: arg 3 must be a traceback or None");
  21637. goto raise_error;
  21638. }
  21639. }
  21640. if (PyType_Check(type)) {
  21641. #if CYTHON_COMPILING_IN_PYPY
  21642. if (!value) {
  21643. Py_INCREF(Py_None);
  21644. value = Py_None;
  21645. }
  21646. #endif
  21647. PyErr_NormalizeException(&type, &value, &tb);
  21648. } else {
  21649. if (value) {
  21650. PyErr_SetString(PyExc_TypeError,
  21651. "instance exception may not have a separate value");
  21652. goto raise_error;
  21653. }
  21654. value = type;
  21655. type = (PyObject*) Py_TYPE(type);
  21656. Py_INCREF(type);
  21657. if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
  21658. PyErr_SetString(PyExc_TypeError,
  21659. "raise: exception class must be a subclass of BaseException");
  21660. goto raise_error;
  21661. }
  21662. }
  21663. __Pyx_PyThreadState_assign
  21664. __Pyx_ErrRestore(type, value, tb);
  21665. return;
  21666. raise_error:
  21667. Py_XDECREF(value);
  21668. Py_XDECREF(type);
  21669. Py_XDECREF(tb);
  21670. return;
  21671. }
  21672. #else
  21673. static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
  21674. PyObject* owned_instance = NULL;
  21675. if (tb == Py_None) {
  21676. tb = 0;
  21677. } else if (tb && !PyTraceBack_Check(tb)) {
  21678. PyErr_SetString(PyExc_TypeError,
  21679. "raise: arg 3 must be a traceback or None");
  21680. goto bad;
  21681. }
  21682. if (value == Py_None)
  21683. value = 0;
  21684. if (PyExceptionInstance_Check(type)) {
  21685. if (value) {
  21686. PyErr_SetString(PyExc_TypeError,
  21687. "instance exception may not have a separate value");
  21688. goto bad;
  21689. }
  21690. value = type;
  21691. type = (PyObject*) Py_TYPE(value);
  21692. } else if (PyExceptionClass_Check(type)) {
  21693. PyObject *instance_class = NULL;
  21694. if (value && PyExceptionInstance_Check(value)) {
  21695. instance_class = (PyObject*) Py_TYPE(value);
  21696. if (instance_class != type) {
  21697. int is_subclass = PyObject_IsSubclass(instance_class, type);
  21698. if (!is_subclass) {
  21699. instance_class = NULL;
  21700. } else if (unlikely(is_subclass == -1)) {
  21701. goto bad;
  21702. } else {
  21703. type = instance_class;
  21704. }
  21705. }
  21706. }
  21707. if (!instance_class) {
  21708. PyObject *args;
  21709. if (!value)
  21710. args = PyTuple_New(0);
  21711. else if (PyTuple_Check(value)) {
  21712. Py_INCREF(value);
  21713. args = value;
  21714. } else
  21715. args = PyTuple_Pack(1, value);
  21716. if (!args)
  21717. goto bad;
  21718. owned_instance = PyObject_Call(type, args, NULL);
  21719. Py_DECREF(args);
  21720. if (!owned_instance)
  21721. goto bad;
  21722. value = owned_instance;
  21723. if (!PyExceptionInstance_Check(value)) {
  21724. PyErr_Format(PyExc_TypeError,
  21725. "calling %R should have returned an instance of "
  21726. "BaseException, not %R",
  21727. type, Py_TYPE(value));
  21728. goto bad;
  21729. }
  21730. }
  21731. } else {
  21732. PyErr_SetString(PyExc_TypeError,
  21733. "raise: exception class must be a subclass of BaseException");
  21734. goto bad;
  21735. }
  21736. if (cause) {
  21737. PyObject *fixed_cause;
  21738. if (cause == Py_None) {
  21739. fixed_cause = NULL;
  21740. } else if (PyExceptionClass_Check(cause)) {
  21741. fixed_cause = PyObject_CallObject(cause, NULL);
  21742. if (fixed_cause == NULL)
  21743. goto bad;
  21744. } else if (PyExceptionInstance_Check(cause)) {
  21745. fixed_cause = cause;
  21746. Py_INCREF(fixed_cause);
  21747. } else {
  21748. PyErr_SetString(PyExc_TypeError,
  21749. "exception causes must derive from "
  21750. "BaseException");
  21751. goto bad;
  21752. }
  21753. PyException_SetCause(value, fixed_cause);
  21754. }
  21755. PyErr_SetObject(type, value);
  21756. if (tb) {
  21757. #if CYTHON_COMPILING_IN_PYPY
  21758. PyObject *tmp_type, *tmp_value, *tmp_tb;
  21759. PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
  21760. Py_INCREF(tb);
  21761. PyErr_Restore(tmp_type, tmp_value, tb);
  21762. Py_XDECREF(tmp_tb);
  21763. #else
  21764. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21765. PyObject* tmp_tb = tstate->curexc_traceback;
  21766. if (tb != tmp_tb) {
  21767. Py_INCREF(tb);
  21768. tstate->curexc_traceback = tb;
  21769. Py_XDECREF(tmp_tb);
  21770. }
  21771. #endif
  21772. }
  21773. bad:
  21774. Py_XDECREF(owned_instance);
  21775. return;
  21776. }
  21777. #endif
  21778. /* GetItemInt */
  21779. static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
  21780. PyObject *r;
  21781. if (!j) return NULL;
  21782. r = PyObject_GetItem(o, j);
  21783. Py_DECREF(j);
  21784. return r;
  21785. }
  21786. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
  21787. CYTHON_NCP_UNUSED int wraparound,
  21788. CYTHON_NCP_UNUSED int boundscheck) {
  21789. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21790. Py_ssize_t wrapped_i = i;
  21791. if (wraparound & unlikely(i < 0)) {
  21792. wrapped_i += PyList_GET_SIZE(o);
  21793. }
  21794. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
  21795. PyObject *r = PyList_GET_ITEM(o, wrapped_i);
  21796. Py_INCREF(r);
  21797. return r;
  21798. }
  21799. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21800. #else
  21801. return PySequence_GetItem(o, i);
  21802. #endif
  21803. }
  21804. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
  21805. CYTHON_NCP_UNUSED int wraparound,
  21806. CYTHON_NCP_UNUSED int boundscheck) {
  21807. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  21808. Py_ssize_t wrapped_i = i;
  21809. if (wraparound & unlikely(i < 0)) {
  21810. wrapped_i += PyTuple_GET_SIZE(o);
  21811. }
  21812. if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
  21813. PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
  21814. Py_INCREF(r);
  21815. return r;
  21816. }
  21817. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21818. #else
  21819. return PySequence_GetItem(o, i);
  21820. #endif
  21821. }
  21822. static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
  21823. CYTHON_NCP_UNUSED int wraparound,
  21824. CYTHON_NCP_UNUSED int boundscheck) {
  21825. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
  21826. if (is_list || PyList_CheckExact(o)) {
  21827. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
  21828. if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
  21829. PyObject *r = PyList_GET_ITEM(o, n);
  21830. Py_INCREF(r);
  21831. return r;
  21832. }
  21833. }
  21834. else if (PyTuple_CheckExact(o)) {
  21835. Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
  21836. if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
  21837. PyObject *r = PyTuple_GET_ITEM(o, n);
  21838. Py_INCREF(r);
  21839. return r;
  21840. }
  21841. } else {
  21842. PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
  21843. if (likely(m && m->sq_item)) {
  21844. if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
  21845. Py_ssize_t l = m->sq_length(o);
  21846. if (likely(l >= 0)) {
  21847. i += l;
  21848. } else {
  21849. if (!PyErr_ExceptionMatches(PyExc_OverflowError))
  21850. return NULL;
  21851. PyErr_Clear();
  21852. }
  21853. }
  21854. return m->sq_item(o, i);
  21855. }
  21856. }
  21857. #else
  21858. if (is_list || PySequence_Check(o)) {
  21859. return PySequence_GetItem(o, i);
  21860. }
  21861. #endif
  21862. return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
  21863. }
  21864. /* ObjectGetItem */
  21865. #if CYTHON_USE_TYPE_SLOTS
  21866. static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
  21867. PyObject *runerr;
  21868. Py_ssize_t key_value;
  21869. PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
  21870. if (unlikely(!(m && m->sq_item))) {
  21871. PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
  21872. return NULL;
  21873. }
  21874. key_value = __Pyx_PyIndex_AsSsize_t(index);
  21875. if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
  21876. return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
  21877. }
  21878. if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
  21879. PyErr_Clear();
  21880. PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
  21881. }
  21882. return NULL;
  21883. }
  21884. static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
  21885. PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
  21886. if (likely(m && m->mp_subscript)) {
  21887. return m->mp_subscript(obj, key);
  21888. }
  21889. return __Pyx_PyObject_GetIndex(obj, key);
  21890. }
  21891. #endif
  21892. /* PyObjectCallNoArg */
  21893. #if CYTHON_COMPILING_IN_CPYTHON
  21894. static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
  21895. #if CYTHON_FAST_PYCALL
  21896. if (PyFunction_Check(func)) {
  21897. return __Pyx_PyFunction_FastCall(func, NULL, 0);
  21898. }
  21899. #endif
  21900. #ifdef __Pyx_CyFunction_USED
  21901. if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
  21902. #else
  21903. if (likely(PyCFunction_Check(func)))
  21904. #endif
  21905. {
  21906. if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
  21907. return __Pyx_PyObject_CallMethO(func, NULL);
  21908. }
  21909. }
  21910. return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
  21911. }
  21912. #endif
  21913. /* IterFinish */
  21914. static CYTHON_INLINE int __Pyx_IterFinish(void) {
  21915. #if CYTHON_FAST_THREAD_STATE
  21916. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  21917. PyObject* exc_type = tstate->curexc_type;
  21918. if (unlikely(exc_type)) {
  21919. if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
  21920. PyObject *exc_value, *exc_tb;
  21921. exc_value = tstate->curexc_value;
  21922. exc_tb = tstate->curexc_traceback;
  21923. tstate->curexc_type = 0;
  21924. tstate->curexc_value = 0;
  21925. tstate->curexc_traceback = 0;
  21926. Py_DECREF(exc_type);
  21927. Py_XDECREF(exc_value);
  21928. Py_XDECREF(exc_tb);
  21929. return 0;
  21930. } else {
  21931. return -1;
  21932. }
  21933. }
  21934. return 0;
  21935. #else
  21936. if (unlikely(PyErr_Occurred())) {
  21937. if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
  21938. PyErr_Clear();
  21939. return 0;
  21940. } else {
  21941. return -1;
  21942. }
  21943. }
  21944. return 0;
  21945. #endif
  21946. }
  21947. /* PyObjectGetMethod */
  21948. static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
  21949. PyObject *attr;
  21950. #if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
  21951. PyTypeObject *tp = Py_TYPE(obj);
  21952. PyObject *descr;
  21953. descrgetfunc f = NULL;
  21954. PyObject **dictptr, *dict;
  21955. int meth_found = 0;
  21956. assert (*method == NULL);
  21957. if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
  21958. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  21959. goto try_unpack;
  21960. }
  21961. if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
  21962. return 0;
  21963. }
  21964. descr = _PyType_Lookup(tp, name);
  21965. if (likely(descr != NULL)) {
  21966. Py_INCREF(descr);
  21967. #if PY_MAJOR_VERSION >= 3
  21968. #ifdef __Pyx_CyFunction_USED
  21969. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
  21970. #else
  21971. if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
  21972. #endif
  21973. #else
  21974. #ifdef __Pyx_CyFunction_USED
  21975. if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
  21976. #else
  21977. if (likely(PyFunction_Check(descr)))
  21978. #endif
  21979. #endif
  21980. {
  21981. meth_found = 1;
  21982. } else {
  21983. f = Py_TYPE(descr)->tp_descr_get;
  21984. if (f != NULL && PyDescr_IsData(descr)) {
  21985. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  21986. Py_DECREF(descr);
  21987. goto try_unpack;
  21988. }
  21989. }
  21990. }
  21991. dictptr = _PyObject_GetDictPtr(obj);
  21992. if (dictptr != NULL && (dict = *dictptr) != NULL) {
  21993. Py_INCREF(dict);
  21994. attr = __Pyx_PyDict_GetItemStr(dict, name);
  21995. if (attr != NULL) {
  21996. Py_INCREF(attr);
  21997. Py_DECREF(dict);
  21998. Py_XDECREF(descr);
  21999. goto try_unpack;
  22000. }
  22001. Py_DECREF(dict);
  22002. }
  22003. if (meth_found) {
  22004. *method = descr;
  22005. return 1;
  22006. }
  22007. if (f != NULL) {
  22008. attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
  22009. Py_DECREF(descr);
  22010. goto try_unpack;
  22011. }
  22012. if (descr != NULL) {
  22013. *method = descr;
  22014. return 0;
  22015. }
  22016. PyErr_Format(PyExc_AttributeError,
  22017. #if PY_MAJOR_VERSION >= 3
  22018. "'%.50s' object has no attribute '%U'",
  22019. tp->tp_name, name);
  22020. #else
  22021. "'%.50s' object has no attribute '%.400s'",
  22022. tp->tp_name, PyString_AS_STRING(name));
  22023. #endif
  22024. return 0;
  22025. #else
  22026. attr = __Pyx_PyObject_GetAttrStr(obj, name);
  22027. goto try_unpack;
  22028. #endif
  22029. try_unpack:
  22030. #if CYTHON_UNPACK_METHODS
  22031. if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
  22032. PyObject *function = PyMethod_GET_FUNCTION(attr);
  22033. Py_INCREF(function);
  22034. Py_DECREF(attr);
  22035. *method = function;
  22036. return 1;
  22037. }
  22038. #endif
  22039. *method = attr;
  22040. return 0;
  22041. }
  22042. /* PyObjectCallMethod0 */
  22043. static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
  22044. PyObject *method = NULL, *result = NULL;
  22045. int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
  22046. if (likely(is_method)) {
  22047. result = __Pyx_PyObject_CallOneArg(method, obj);
  22048. Py_DECREF(method);
  22049. return result;
  22050. }
  22051. if (unlikely(!method)) goto bad;
  22052. result = __Pyx_PyObject_CallNoArg(method);
  22053. Py_DECREF(method);
  22054. bad:
  22055. return result;
  22056. }
  22057. /* RaiseNeedMoreValuesToUnpack */
  22058. static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
  22059. PyErr_Format(PyExc_ValueError,
  22060. "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
  22061. index, (index == 1) ? "" : "s");
  22062. }
  22063. /* RaiseTooManyValuesToUnpack */
  22064. static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
  22065. PyErr_Format(PyExc_ValueError,
  22066. "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
  22067. }
  22068. /* UnpackItemEndCheck */
  22069. static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
  22070. if (unlikely(retval)) {
  22071. Py_DECREF(retval);
  22072. __Pyx_RaiseTooManyValuesError(expected);
  22073. return -1;
  22074. } else {
  22075. return __Pyx_IterFinish();
  22076. }
  22077. return 0;
  22078. }
  22079. /* RaiseNoneIterError */
  22080. static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
  22081. PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
  22082. }
  22083. /* UnpackTupleError */
  22084. static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
  22085. if (t == Py_None) {
  22086. __Pyx_RaiseNoneNotIterableError();
  22087. } else if (PyTuple_GET_SIZE(t) < index) {
  22088. __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
  22089. } else {
  22090. __Pyx_RaiseTooManyValuesError(index);
  22091. }
  22092. }
  22093. /* UnpackTuple2 */
  22094. static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
  22095. PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
  22096. PyObject *value1 = NULL, *value2 = NULL;
  22097. #if CYTHON_COMPILING_IN_PYPY
  22098. value1 = PySequence_ITEM(tuple, 0); if (unlikely(!value1)) goto bad;
  22099. value2 = PySequence_ITEM(tuple, 1); if (unlikely(!value2)) goto bad;
  22100. #else
  22101. value1 = PyTuple_GET_ITEM(tuple, 0); Py_INCREF(value1);
  22102. value2 = PyTuple_GET_ITEM(tuple, 1); Py_INCREF(value2);
  22103. #endif
  22104. if (decref_tuple) {
  22105. Py_DECREF(tuple);
  22106. }
  22107. *pvalue1 = value1;
  22108. *pvalue2 = value2;
  22109. return 0;
  22110. #if CYTHON_COMPILING_IN_PYPY
  22111. bad:
  22112. Py_XDECREF(value1);
  22113. Py_XDECREF(value2);
  22114. if (decref_tuple) { Py_XDECREF(tuple); }
  22115. return -1;
  22116. #endif
  22117. }
  22118. static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
  22119. int has_known_size, int decref_tuple) {
  22120. Py_ssize_t index;
  22121. PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
  22122. iternextfunc iternext;
  22123. iter = PyObject_GetIter(tuple);
  22124. if (unlikely(!iter)) goto bad;
  22125. if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
  22126. iternext = Py_TYPE(iter)->tp_iternext;
  22127. value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
  22128. value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
  22129. if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
  22130. Py_DECREF(iter);
  22131. *pvalue1 = value1;
  22132. *pvalue2 = value2;
  22133. return 0;
  22134. unpacking_failed:
  22135. if (!has_known_size && __Pyx_IterFinish() == 0)
  22136. __Pyx_RaiseNeedMoreValuesError(index);
  22137. bad:
  22138. Py_XDECREF(iter);
  22139. Py_XDECREF(value1);
  22140. Py_XDECREF(value2);
  22141. if (decref_tuple) { Py_XDECREF(tuple); }
  22142. return -1;
  22143. }
  22144. /* dict_iter */
  22145. static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
  22146. Py_ssize_t* p_orig_length, int* p_source_is_dict) {
  22147. is_dict = is_dict || likely(PyDict_CheckExact(iterable));
  22148. *p_source_is_dict = is_dict;
  22149. if (is_dict) {
  22150. #if !CYTHON_COMPILING_IN_PYPY
  22151. *p_orig_length = PyDict_Size(iterable);
  22152. Py_INCREF(iterable);
  22153. return iterable;
  22154. #elif PY_MAJOR_VERSION >= 3
  22155. static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
  22156. PyObject **pp = NULL;
  22157. if (method_name) {
  22158. const char *name = PyUnicode_AsUTF8(method_name);
  22159. if (strcmp(name, "iteritems") == 0) pp = &py_items;
  22160. else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
  22161. else if (strcmp(name, "itervalues") == 0) pp = &py_values;
  22162. if (pp) {
  22163. if (!*pp) {
  22164. *pp = PyUnicode_FromString(name + 4);
  22165. if (!*pp)
  22166. return NULL;
  22167. }
  22168. method_name = *pp;
  22169. }
  22170. }
  22171. #endif
  22172. }
  22173. *p_orig_length = 0;
  22174. if (method_name) {
  22175. PyObject* iter;
  22176. iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
  22177. if (!iterable)
  22178. return NULL;
  22179. #if !CYTHON_COMPILING_IN_PYPY
  22180. if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
  22181. return iterable;
  22182. #endif
  22183. iter = PyObject_GetIter(iterable);
  22184. Py_DECREF(iterable);
  22185. return iter;
  22186. }
  22187. return PyObject_GetIter(iterable);
  22188. }
  22189. static CYTHON_INLINE int __Pyx_dict_iter_next(
  22190. PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
  22191. PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
  22192. PyObject* next_item;
  22193. #if !CYTHON_COMPILING_IN_PYPY
  22194. if (source_is_dict) {
  22195. PyObject *key, *value;
  22196. if (unlikely(orig_length != PyDict_Size(iter_obj))) {
  22197. PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
  22198. return -1;
  22199. }
  22200. if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
  22201. return 0;
  22202. }
  22203. if (pitem) {
  22204. PyObject* tuple = PyTuple_New(2);
  22205. if (unlikely(!tuple)) {
  22206. return -1;
  22207. }
  22208. Py_INCREF(key);
  22209. Py_INCREF(value);
  22210. PyTuple_SET_ITEM(tuple, 0, key);
  22211. PyTuple_SET_ITEM(tuple, 1, value);
  22212. *pitem = tuple;
  22213. } else {
  22214. if (pkey) {
  22215. Py_INCREF(key);
  22216. *pkey = key;
  22217. }
  22218. if (pvalue) {
  22219. Py_INCREF(value);
  22220. *pvalue = value;
  22221. }
  22222. }
  22223. return 1;
  22224. } else if (PyTuple_CheckExact(iter_obj)) {
  22225. Py_ssize_t pos = *ppos;
  22226. if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
  22227. *ppos = pos + 1;
  22228. next_item = PyTuple_GET_ITEM(iter_obj, pos);
  22229. Py_INCREF(next_item);
  22230. } else if (PyList_CheckExact(iter_obj)) {
  22231. Py_ssize_t pos = *ppos;
  22232. if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
  22233. *ppos = pos + 1;
  22234. next_item = PyList_GET_ITEM(iter_obj, pos);
  22235. Py_INCREF(next_item);
  22236. } else
  22237. #endif
  22238. {
  22239. next_item = PyIter_Next(iter_obj);
  22240. if (unlikely(!next_item)) {
  22241. return __Pyx_IterFinish();
  22242. }
  22243. }
  22244. if (pitem) {
  22245. *pitem = next_item;
  22246. } else if (pkey && pvalue) {
  22247. if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
  22248. return -1;
  22249. } else if (pkey) {
  22250. *pkey = next_item;
  22251. } else {
  22252. *pvalue = next_item;
  22253. }
  22254. return 1;
  22255. }
  22256. /* PyIntBinop */
  22257. #if !CYTHON_COMPILING_IN_PYPY
  22258. static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
  22259. (void)inplace;
  22260. (void)zerodivision_check;
  22261. #if PY_MAJOR_VERSION < 3
  22262. if (likely(PyInt_CheckExact(op1))) {
  22263. const long b = intval;
  22264. long x;
  22265. long a = PyInt_AS_LONG(op1);
  22266. x = (long)((unsigned long)a + b);
  22267. if (likely((x^a) >= 0 || (x^b) >= 0))
  22268. return PyInt_FromLong(x);
  22269. return PyLong_Type.tp_as_number->nb_add(op1, op2);
  22270. }
  22271. #endif
  22272. #if CYTHON_USE_PYLONG_INTERNALS
  22273. if (likely(PyLong_CheckExact(op1))) {
  22274. const long b = intval;
  22275. long a, x;
  22276. #ifdef HAVE_LONG_LONG
  22277. const PY_LONG_LONG llb = intval;
  22278. PY_LONG_LONG lla, llx;
  22279. #endif
  22280. const digit* digits = ((PyLongObject*)op1)->ob_digit;
  22281. const Py_ssize_t size = Py_SIZE(op1);
  22282. if (likely(__Pyx_sst_abs(size) <= 1)) {
  22283. a = likely(size) ? digits[0] : 0;
  22284. if (size == -1) a = -a;
  22285. } else {
  22286. switch (size) {
  22287. case -2:
  22288. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  22289. a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22290. break;
  22291. #ifdef HAVE_LONG_LONG
  22292. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
  22293. lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22294. goto long_long;
  22295. #endif
  22296. }
  22297. CYTHON_FALLTHROUGH;
  22298. case 2:
  22299. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  22300. a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22301. break;
  22302. #ifdef HAVE_LONG_LONG
  22303. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
  22304. lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
  22305. goto long_long;
  22306. #endif
  22307. }
  22308. CYTHON_FALLTHROUGH;
  22309. case -3:
  22310. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  22311. a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22312. break;
  22313. #ifdef HAVE_LONG_LONG
  22314. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
  22315. 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]));
  22316. goto long_long;
  22317. #endif
  22318. }
  22319. CYTHON_FALLTHROUGH;
  22320. case 3:
  22321. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  22322. a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22323. break;
  22324. #ifdef HAVE_LONG_LONG
  22325. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
  22326. 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]));
  22327. goto long_long;
  22328. #endif
  22329. }
  22330. CYTHON_FALLTHROUGH;
  22331. case -4:
  22332. if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  22333. a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22334. break;
  22335. #ifdef HAVE_LONG_LONG
  22336. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
  22337. 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]));
  22338. goto long_long;
  22339. #endif
  22340. }
  22341. CYTHON_FALLTHROUGH;
  22342. case 4:
  22343. if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  22344. a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
  22345. break;
  22346. #ifdef HAVE_LONG_LONG
  22347. } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
  22348. 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]));
  22349. goto long_long;
  22350. #endif
  22351. }
  22352. CYTHON_FALLTHROUGH;
  22353. default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
  22354. }
  22355. }
  22356. x = a + b;
  22357. return PyLong_FromLong(x);
  22358. #ifdef HAVE_LONG_LONG
  22359. long_long:
  22360. llx = lla + llb;
  22361. return PyLong_FromLongLong(llx);
  22362. #endif
  22363. }
  22364. #endif
  22365. if (PyFloat_CheckExact(op1)) {
  22366. const long b = intval;
  22367. double a = PyFloat_AS_DOUBLE(op1);
  22368. double result;
  22369. PyFPE_START_PROTECT("add", return NULL)
  22370. result = ((double)a) + (double)b;
  22371. PyFPE_END_PROTECT(result)
  22372. return PyFloat_FromDouble(result);
  22373. }
  22374. return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
  22375. }
  22376. #endif
  22377. /* PyObjectSetAttrStr */
  22378. #if CYTHON_USE_TYPE_SLOTS
  22379. static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
  22380. PyTypeObject* tp = Py_TYPE(obj);
  22381. if (likely(tp->tp_setattro))
  22382. return tp->tp_setattro(obj, attr_name, value);
  22383. #if PY_MAJOR_VERSION < 3
  22384. if (likely(tp->tp_setattr))
  22385. return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
  22386. #endif
  22387. return PyObject_SetAttr(obj, attr_name, value);
  22388. }
  22389. #endif
  22390. /* DictGetItem */
  22391. #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
  22392. static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
  22393. PyObject *value;
  22394. value = PyDict_GetItemWithError(d, key);
  22395. if (unlikely(!value)) {
  22396. if (!PyErr_Occurred()) {
  22397. if (unlikely(PyTuple_Check(key))) {
  22398. PyObject* args = PyTuple_Pack(1, key);
  22399. if (likely(args)) {
  22400. PyErr_SetObject(PyExc_KeyError, args);
  22401. Py_DECREF(args);
  22402. }
  22403. } else {
  22404. PyErr_SetObject(PyExc_KeyError, key);
  22405. }
  22406. }
  22407. return NULL;
  22408. }
  22409. Py_INCREF(value);
  22410. return value;
  22411. }
  22412. #endif
  22413. /* ExtTypeTest */
  22414. static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
  22415. if (unlikely(!type)) {
  22416. PyErr_SetString(PyExc_SystemError, "Missing type object");
  22417. return 0;
  22418. }
  22419. if (likely(__Pyx_TypeCheck(obj, type)))
  22420. return 1;
  22421. PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
  22422. Py_TYPE(obj)->tp_name, type->tp_name);
  22423. return 0;
  22424. }
  22425. /* GetTopmostException */
  22426. #if CYTHON_USE_EXC_INFO_STACK
  22427. static _PyErr_StackItem *
  22428. __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
  22429. {
  22430. _PyErr_StackItem *exc_info = tstate->exc_info;
  22431. while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
  22432. exc_info->previous_item != NULL)
  22433. {
  22434. exc_info = exc_info->previous_item;
  22435. }
  22436. return exc_info;
  22437. }
  22438. #endif
  22439. /* SaveResetException */
  22440. #if CYTHON_FAST_THREAD_STATE
  22441. static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
  22442. #if CYTHON_USE_EXC_INFO_STACK
  22443. _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
  22444. *type = exc_info->exc_type;
  22445. *value = exc_info->exc_value;
  22446. *tb = exc_info->exc_traceback;
  22447. #else
  22448. *type = tstate->exc_type;
  22449. *value = tstate->exc_value;
  22450. *tb = tstate->exc_traceback;
  22451. #endif
  22452. Py_XINCREF(*type);
  22453. Py_XINCREF(*value);
  22454. Py_XINCREF(*tb);
  22455. }
  22456. static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
  22457. PyObject *tmp_type, *tmp_value, *tmp_tb;
  22458. #if CYTHON_USE_EXC_INFO_STACK
  22459. _PyErr_StackItem *exc_info = tstate->exc_info;
  22460. tmp_type = exc_info->exc_type;
  22461. tmp_value = exc_info->exc_value;
  22462. tmp_tb = exc_info->exc_traceback;
  22463. exc_info->exc_type = type;
  22464. exc_info->exc_value = value;
  22465. exc_info->exc_traceback = tb;
  22466. #else
  22467. tmp_type = tstate->exc_type;
  22468. tmp_value = tstate->exc_value;
  22469. tmp_tb = tstate->exc_traceback;
  22470. tstate->exc_type = type;
  22471. tstate->exc_value = value;
  22472. tstate->exc_traceback = tb;
  22473. #endif
  22474. Py_XDECREF(tmp_type);
  22475. Py_XDECREF(tmp_value);
  22476. Py_XDECREF(tmp_tb);
  22477. }
  22478. #endif
  22479. /* PyErrExceptionMatches */
  22480. #if CYTHON_FAST_THREAD_STATE
  22481. static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  22482. Py_ssize_t i, n;
  22483. n = PyTuple_GET_SIZE(tuple);
  22484. #if PY_MAJOR_VERSION >= 3
  22485. for (i=0; i<n; i++) {
  22486. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  22487. }
  22488. #endif
  22489. for (i=0; i<n; i++) {
  22490. if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
  22491. }
  22492. return 0;
  22493. }
  22494. static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
  22495. PyObject *exc_type = tstate->curexc_type;
  22496. if (exc_type == err) return 1;
  22497. if (unlikely(!exc_type)) return 0;
  22498. if (unlikely(PyTuple_Check(err)))
  22499. return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
  22500. return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
  22501. }
  22502. #endif
  22503. /* GetException */
  22504. #if CYTHON_FAST_THREAD_STATE
  22505. static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
  22506. #else
  22507. static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
  22508. #endif
  22509. {
  22510. PyObject *local_type, *local_value, *local_tb;
  22511. #if CYTHON_FAST_THREAD_STATE
  22512. PyObject *tmp_type, *tmp_value, *tmp_tb;
  22513. local_type = tstate->curexc_type;
  22514. local_value = tstate->curexc_value;
  22515. local_tb = tstate->curexc_traceback;
  22516. tstate->curexc_type = 0;
  22517. tstate->curexc_value = 0;
  22518. tstate->curexc_traceback = 0;
  22519. #else
  22520. PyErr_Fetch(&local_type, &local_value, &local_tb);
  22521. #endif
  22522. PyErr_NormalizeException(&local_type, &local_value, &local_tb);
  22523. #if CYTHON_FAST_THREAD_STATE
  22524. if (unlikely(tstate->curexc_type))
  22525. #else
  22526. if (unlikely(PyErr_Occurred()))
  22527. #endif
  22528. goto bad;
  22529. #if PY_MAJOR_VERSION >= 3
  22530. if (local_tb) {
  22531. if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
  22532. goto bad;
  22533. }
  22534. #endif
  22535. Py_XINCREF(local_tb);
  22536. Py_XINCREF(local_type);
  22537. Py_XINCREF(local_value);
  22538. *type = local_type;
  22539. *value = local_value;
  22540. *tb = local_tb;
  22541. #if CYTHON_FAST_THREAD_STATE
  22542. #if CYTHON_USE_EXC_INFO_STACK
  22543. {
  22544. _PyErr_StackItem *exc_info = tstate->exc_info;
  22545. tmp_type = exc_info->exc_type;
  22546. tmp_value = exc_info->exc_value;
  22547. tmp_tb = exc_info->exc_traceback;
  22548. exc_info->exc_type = local_type;
  22549. exc_info->exc_value = local_value;
  22550. exc_info->exc_traceback = local_tb;
  22551. }
  22552. #else
  22553. tmp_type = tstate->exc_type;
  22554. tmp_value = tstate->exc_value;
  22555. tmp_tb = tstate->exc_traceback;
  22556. tstate->exc_type = local_type;
  22557. tstate->exc_value = local_value;
  22558. tstate->exc_traceback = local_tb;
  22559. #endif
  22560. Py_XDECREF(tmp_type);
  22561. Py_XDECREF(tmp_value);
  22562. Py_XDECREF(tmp_tb);
  22563. #else
  22564. PyErr_SetExcInfo(local_type, local_value, local_tb);
  22565. #endif
  22566. return 0;
  22567. bad:
  22568. *type = 0;
  22569. *value = 0;
  22570. *tb = 0;
  22571. Py_XDECREF(local_type);
  22572. Py_XDECREF(local_value);
  22573. Py_XDECREF(local_tb);
  22574. return -1;
  22575. }
  22576. /* PyObject_GenericGetAttrNoDict */
  22577. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22578. static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
  22579. PyErr_Format(PyExc_AttributeError,
  22580. #if PY_MAJOR_VERSION >= 3
  22581. "'%.50s' object has no attribute '%U'",
  22582. tp->tp_name, attr_name);
  22583. #else
  22584. "'%.50s' object has no attribute '%.400s'",
  22585. tp->tp_name, PyString_AS_STRING(attr_name));
  22586. #endif
  22587. return NULL;
  22588. }
  22589. static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
  22590. PyObject *descr;
  22591. PyTypeObject *tp = Py_TYPE(obj);
  22592. if (unlikely(!PyString_Check(attr_name))) {
  22593. return PyObject_GenericGetAttr(obj, attr_name);
  22594. }
  22595. assert(!tp->tp_dictoffset);
  22596. descr = _PyType_Lookup(tp, attr_name);
  22597. if (unlikely(!descr)) {
  22598. return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
  22599. }
  22600. Py_INCREF(descr);
  22601. #if PY_MAJOR_VERSION < 3
  22602. if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
  22603. #endif
  22604. {
  22605. descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
  22606. if (unlikely(f)) {
  22607. PyObject *res = f(descr, obj, (PyObject *)tp);
  22608. Py_DECREF(descr);
  22609. return res;
  22610. }
  22611. }
  22612. return descr;
  22613. }
  22614. #endif
  22615. /* PyObject_GenericGetAttr */
  22616. #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
  22617. static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
  22618. if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
  22619. return PyObject_GenericGetAttr(obj, attr_name);
  22620. }
  22621. return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
  22622. }
  22623. #endif
  22624. /* SetupReduce */
  22625. static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  22626. int ret;
  22627. PyObject *name_attr;
  22628. name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  22629. if (likely(name_attr)) {
  22630. ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  22631. } else {
  22632. ret = -1;
  22633. }
  22634. if (unlikely(ret < 0)) {
  22635. PyErr_Clear();
  22636. ret = 0;
  22637. }
  22638. Py_XDECREF(name_attr);
  22639. return ret;
  22640. }
  22641. static int __Pyx_setup_reduce(PyObject* type_obj) {
  22642. int ret = 0;
  22643. PyObject *object_reduce = NULL;
  22644. PyObject *object_reduce_ex = NULL;
  22645. PyObject *reduce = NULL;
  22646. PyObject *reduce_ex = NULL;
  22647. PyObject *reduce_cython = NULL;
  22648. PyObject *setstate = NULL;
  22649. PyObject *setstate_cython = NULL;
  22650. #if CYTHON_USE_PYTYPE_LOOKUP
  22651. if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22652. #else
  22653. if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
  22654. #endif
  22655. #if CYTHON_USE_PYTYPE_LOOKUP
  22656. object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22657. #else
  22658. object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
  22659. #endif
  22660. reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
  22661. if (reduce_ex == object_reduce_ex) {
  22662. #if CYTHON_USE_PYTYPE_LOOKUP
  22663. object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22664. #else
  22665. object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
  22666. #endif
  22667. reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
  22668. if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
  22669. reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto __PYX_BAD;
  22670. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22671. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22672. setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
  22673. if (!setstate) PyErr_Clear();
  22674. if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
  22675. setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto __PYX_BAD;
  22676. ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22677. ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
  22678. }
  22679. PyType_Modified((PyTypeObject*)type_obj);
  22680. }
  22681. }
  22682. goto __PYX_GOOD;
  22683. __PYX_BAD:
  22684. if (!PyErr_Occurred())
  22685. PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
  22686. ret = -1;
  22687. __PYX_GOOD:
  22688. #if !CYTHON_USE_PYTYPE_LOOKUP
  22689. Py_XDECREF(object_reduce);
  22690. Py_XDECREF(object_reduce_ex);
  22691. #endif
  22692. Py_XDECREF(reduce);
  22693. Py_XDECREF(reduce_ex);
  22694. Py_XDECREF(reduce_cython);
  22695. Py_XDECREF(setstate);
  22696. Py_XDECREF(setstate_cython);
  22697. return ret;
  22698. }
  22699. /* TypeImport */
  22700. #ifndef __PYX_HAVE_RT_ImportType
  22701. #define __PYX_HAVE_RT_ImportType
  22702. static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
  22703. size_t size, enum __Pyx_ImportType_CheckSize check_size)
  22704. {
  22705. PyObject *result = 0;
  22706. char warning[200];
  22707. Py_ssize_t basicsize;
  22708. #ifdef Py_LIMITED_API
  22709. PyObject *py_basicsize;
  22710. #endif
  22711. result = PyObject_GetAttrString(module, class_name);
  22712. if (!result)
  22713. goto bad;
  22714. if (!PyType_Check(result)) {
  22715. PyErr_Format(PyExc_TypeError,
  22716. "%.200s.%.200s is not a type object",
  22717. module_name, class_name);
  22718. goto bad;
  22719. }
  22720. #ifndef Py_LIMITED_API
  22721. basicsize = ((PyTypeObject *)result)->tp_basicsize;
  22722. #else
  22723. py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
  22724. if (!py_basicsize)
  22725. goto bad;
  22726. basicsize = PyLong_AsSsize_t(py_basicsize);
  22727. Py_DECREF(py_basicsize);
  22728. py_basicsize = 0;
  22729. if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
  22730. goto bad;
  22731. #endif
  22732. if ((size_t)basicsize < size) {
  22733. PyErr_Format(PyExc_ValueError,
  22734. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22735. "Expected %zd from C header, got %zd from PyObject",
  22736. module_name, class_name, size, basicsize);
  22737. goto bad;
  22738. }
  22739. if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
  22740. PyErr_Format(PyExc_ValueError,
  22741. "%.200s.%.200s size changed, may indicate binary incompatibility. "
  22742. "Expected %zd from C header, got %zd from PyObject",
  22743. module_name, class_name, size, basicsize);
  22744. goto bad;
  22745. }
  22746. else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
  22747. PyOS_snprintf(warning, sizeof(warning),
  22748. "%s.%s size changed, may indicate binary incompatibility. "
  22749. "Expected %zd from C header, got %zd from PyObject",
  22750. module_name, class_name, size, basicsize);
  22751. if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
  22752. }
  22753. return (PyTypeObject *)result;
  22754. bad:
  22755. Py_XDECREF(result);
  22756. return NULL;
  22757. }
  22758. #endif
  22759. /* Import */
  22760. static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
  22761. PyObject *empty_list = 0;
  22762. PyObject *module = 0;
  22763. PyObject *global_dict = 0;
  22764. PyObject *empty_dict = 0;
  22765. PyObject *list;
  22766. #if PY_MAJOR_VERSION < 3
  22767. PyObject *py_import;
  22768. py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
  22769. if (!py_import)
  22770. goto bad;
  22771. #endif
  22772. if (from_list)
  22773. list = from_list;
  22774. else {
  22775. empty_list = PyList_New(0);
  22776. if (!empty_list)
  22777. goto bad;
  22778. list = empty_list;
  22779. }
  22780. global_dict = PyModule_GetDict(__pyx_m);
  22781. if (!global_dict)
  22782. goto bad;
  22783. empty_dict = PyDict_New();
  22784. if (!empty_dict)
  22785. goto bad;
  22786. {
  22787. #if PY_MAJOR_VERSION >= 3
  22788. if (level == -1) {
  22789. if (strchr(__Pyx_MODULE_NAME, '.')) {
  22790. module = PyImport_ImportModuleLevelObject(
  22791. name, global_dict, empty_dict, list, 1);
  22792. if (!module) {
  22793. if (!PyErr_ExceptionMatches(PyExc_ImportError))
  22794. goto bad;
  22795. PyErr_Clear();
  22796. }
  22797. }
  22798. level = 0;
  22799. }
  22800. #endif
  22801. if (!module) {
  22802. #if PY_MAJOR_VERSION < 3
  22803. PyObject *py_level = PyInt_FromLong(level);
  22804. if (!py_level)
  22805. goto bad;
  22806. module = PyObject_CallFunctionObjArgs(py_import,
  22807. name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
  22808. Py_DECREF(py_level);
  22809. #else
  22810. module = PyImport_ImportModuleLevelObject(
  22811. name, global_dict, empty_dict, list, level);
  22812. #endif
  22813. }
  22814. }
  22815. bad:
  22816. #if PY_MAJOR_VERSION < 3
  22817. Py_XDECREF(py_import);
  22818. #endif
  22819. Py_XDECREF(empty_list);
  22820. Py_XDECREF(empty_dict);
  22821. return module;
  22822. }
  22823. /* ImportFrom */
  22824. static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
  22825. PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
  22826. if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
  22827. PyErr_Format(PyExc_ImportError,
  22828. #if PY_MAJOR_VERSION < 3
  22829. "cannot import name %.230s", PyString_AS_STRING(name));
  22830. #else
  22831. "cannot import name %S", name);
  22832. #endif
  22833. }
  22834. return value;
  22835. }
  22836. /* CalculateMetaclass */
  22837. static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
  22838. Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
  22839. for (i=0; i < nbases; i++) {
  22840. PyTypeObject *tmptype;
  22841. PyObject *tmp = PyTuple_GET_ITEM(bases, i);
  22842. tmptype = Py_TYPE(tmp);
  22843. #if PY_MAJOR_VERSION < 3
  22844. if (tmptype == &PyClass_Type)
  22845. continue;
  22846. #endif
  22847. if (!metaclass) {
  22848. metaclass = tmptype;
  22849. continue;
  22850. }
  22851. if (PyType_IsSubtype(metaclass, tmptype))
  22852. continue;
  22853. if (PyType_IsSubtype(tmptype, metaclass)) {
  22854. metaclass = tmptype;
  22855. continue;
  22856. }
  22857. PyErr_SetString(PyExc_TypeError,
  22858. "metaclass conflict: "
  22859. "the metaclass of a derived class "
  22860. "must be a (non-strict) subclass "
  22861. "of the metaclasses of all its bases");
  22862. return NULL;
  22863. }
  22864. if (!metaclass) {
  22865. #if PY_MAJOR_VERSION < 3
  22866. metaclass = &PyClass_Type;
  22867. #else
  22868. metaclass = &PyType_Type;
  22869. #endif
  22870. }
  22871. Py_INCREF((PyObject*) metaclass);
  22872. return (PyObject*) metaclass;
  22873. }
  22874. /* Py3ClassCreate */
  22875. static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
  22876. PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
  22877. PyObject *ns;
  22878. if (metaclass) {
  22879. PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
  22880. if (prep) {
  22881. PyObject *pargs = PyTuple_Pack(2, name, bases);
  22882. if (unlikely(!pargs)) {
  22883. Py_DECREF(prep);
  22884. return NULL;
  22885. }
  22886. ns = PyObject_Call(prep, pargs, mkw);
  22887. Py_DECREF(prep);
  22888. Py_DECREF(pargs);
  22889. } else {
  22890. if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
  22891. return NULL;
  22892. PyErr_Clear();
  22893. ns = PyDict_New();
  22894. }
  22895. } else {
  22896. ns = PyDict_New();
  22897. }
  22898. if (unlikely(!ns))
  22899. return NULL;
  22900. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
  22901. if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
  22902. if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
  22903. return ns;
  22904. bad:
  22905. Py_DECREF(ns);
  22906. return NULL;
  22907. }
  22908. static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
  22909. PyObject *dict, PyObject *mkw,
  22910. int calculate_metaclass, int allow_py2_metaclass) {
  22911. PyObject *result, *margs;
  22912. PyObject *owned_metaclass = NULL;
  22913. if (allow_py2_metaclass) {
  22914. owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
  22915. if (owned_metaclass) {
  22916. metaclass = owned_metaclass;
  22917. } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
  22918. PyErr_Clear();
  22919. } else {
  22920. return NULL;
  22921. }
  22922. }
  22923. if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
  22924. metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
  22925. Py_XDECREF(owned_metaclass);
  22926. if (unlikely(!metaclass))
  22927. return NULL;
  22928. owned_metaclass = metaclass;
  22929. }
  22930. margs = PyTuple_Pack(3, name, bases, dict);
  22931. if (unlikely(!margs)) {
  22932. result = NULL;
  22933. } else {
  22934. result = PyObject_Call(metaclass, margs, mkw);
  22935. Py_DECREF(margs);
  22936. }
  22937. Py_XDECREF(owned_metaclass);
  22938. return result;
  22939. }
  22940. /* FetchCommonType */
  22941. static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
  22942. PyObject* fake_module;
  22943. PyTypeObject* cached_type = NULL;
  22944. fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
  22945. if (!fake_module) return NULL;
  22946. Py_INCREF(fake_module);
  22947. cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
  22948. if (cached_type) {
  22949. if (!PyType_Check((PyObject*)cached_type)) {
  22950. PyErr_Format(PyExc_TypeError,
  22951. "Shared Cython type %.200s is not a type object",
  22952. type->tp_name);
  22953. goto bad;
  22954. }
  22955. if (cached_type->tp_basicsize != type->tp_basicsize) {
  22956. PyErr_Format(PyExc_TypeError,
  22957. "Shared Cython type %.200s has the wrong size, try recompiling",
  22958. type->tp_name);
  22959. goto bad;
  22960. }
  22961. } else {
  22962. if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
  22963. PyErr_Clear();
  22964. if (PyType_Ready(type) < 0) goto bad;
  22965. if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
  22966. goto bad;
  22967. Py_INCREF(type);
  22968. cached_type = type;
  22969. }
  22970. done:
  22971. Py_DECREF(fake_module);
  22972. return cached_type;
  22973. bad:
  22974. Py_XDECREF(cached_type);
  22975. cached_type = NULL;
  22976. goto done;
  22977. }
  22978. /* CythonFunction */
  22979. #include <structmember.h>
  22980. static PyObject *
  22981. __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
  22982. {
  22983. if (unlikely(op->func_doc == NULL)) {
  22984. if (op->func.m_ml->ml_doc) {
  22985. #if PY_MAJOR_VERSION >= 3
  22986. op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
  22987. #else
  22988. op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
  22989. #endif
  22990. if (unlikely(op->func_doc == NULL))
  22991. return NULL;
  22992. } else {
  22993. Py_INCREF(Py_None);
  22994. return Py_None;
  22995. }
  22996. }
  22997. Py_INCREF(op->func_doc);
  22998. return op->func_doc;
  22999. }
  23000. static int
  23001. __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23002. {
  23003. PyObject *tmp = op->func_doc;
  23004. if (value == NULL) {
  23005. value = Py_None;
  23006. }
  23007. Py_INCREF(value);
  23008. op->func_doc = value;
  23009. Py_XDECREF(tmp);
  23010. return 0;
  23011. }
  23012. static PyObject *
  23013. __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23014. {
  23015. if (unlikely(op->func_name == NULL)) {
  23016. #if PY_MAJOR_VERSION >= 3
  23017. op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
  23018. #else
  23019. op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
  23020. #endif
  23021. if (unlikely(op->func_name == NULL))
  23022. return NULL;
  23023. }
  23024. Py_INCREF(op->func_name);
  23025. return op->func_name;
  23026. }
  23027. static int
  23028. __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23029. {
  23030. PyObject *tmp;
  23031. #if PY_MAJOR_VERSION >= 3
  23032. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  23033. #else
  23034. if (unlikely(value == NULL || !PyString_Check(value)))
  23035. #endif
  23036. {
  23037. PyErr_SetString(PyExc_TypeError,
  23038. "__name__ must be set to a string object");
  23039. return -1;
  23040. }
  23041. tmp = op->func_name;
  23042. Py_INCREF(value);
  23043. op->func_name = value;
  23044. Py_XDECREF(tmp);
  23045. return 0;
  23046. }
  23047. static PyObject *
  23048. __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23049. {
  23050. Py_INCREF(op->func_qualname);
  23051. return op->func_qualname;
  23052. }
  23053. static int
  23054. __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23055. {
  23056. PyObject *tmp;
  23057. #if PY_MAJOR_VERSION >= 3
  23058. if (unlikely(value == NULL || !PyUnicode_Check(value)))
  23059. #else
  23060. if (unlikely(value == NULL || !PyString_Check(value)))
  23061. #endif
  23062. {
  23063. PyErr_SetString(PyExc_TypeError,
  23064. "__qualname__ must be set to a string object");
  23065. return -1;
  23066. }
  23067. tmp = op->func_qualname;
  23068. Py_INCREF(value);
  23069. op->func_qualname = value;
  23070. Py_XDECREF(tmp);
  23071. return 0;
  23072. }
  23073. static PyObject *
  23074. __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
  23075. {
  23076. PyObject *self;
  23077. self = m->func_closure;
  23078. if (self == NULL)
  23079. self = Py_None;
  23080. Py_INCREF(self);
  23081. return self;
  23082. }
  23083. static PyObject *
  23084. __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23085. {
  23086. if (unlikely(op->func_dict == NULL)) {
  23087. op->func_dict = PyDict_New();
  23088. if (unlikely(op->func_dict == NULL))
  23089. return NULL;
  23090. }
  23091. Py_INCREF(op->func_dict);
  23092. return op->func_dict;
  23093. }
  23094. static int
  23095. __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
  23096. {
  23097. PyObject *tmp;
  23098. if (unlikely(value == NULL)) {
  23099. PyErr_SetString(PyExc_TypeError,
  23100. "function's dictionary may not be deleted");
  23101. return -1;
  23102. }
  23103. if (unlikely(!PyDict_Check(value))) {
  23104. PyErr_SetString(PyExc_TypeError,
  23105. "setting function's dictionary to a non-dict");
  23106. return -1;
  23107. }
  23108. tmp = op->func_dict;
  23109. Py_INCREF(value);
  23110. op->func_dict = value;
  23111. Py_XDECREF(tmp);
  23112. return 0;
  23113. }
  23114. static PyObject *
  23115. __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23116. {
  23117. Py_INCREF(op->func_globals);
  23118. return op->func_globals;
  23119. }
  23120. static PyObject *
  23121. __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23122. {
  23123. Py_INCREF(Py_None);
  23124. return Py_None;
  23125. }
  23126. static PyObject *
  23127. __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
  23128. {
  23129. PyObject* result = (op->func_code) ? op->func_code : Py_None;
  23130. Py_INCREF(result);
  23131. return result;
  23132. }
  23133. static int
  23134. __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
  23135. int result = 0;
  23136. PyObject *res = op->defaults_getter((PyObject *) op);
  23137. if (unlikely(!res))
  23138. return -1;
  23139. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  23140. op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
  23141. Py_INCREF(op->defaults_tuple);
  23142. op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
  23143. Py_INCREF(op->defaults_kwdict);
  23144. #else
  23145. op->defaults_tuple = PySequence_ITEM(res, 0);
  23146. if (unlikely(!op->defaults_tuple)) result = -1;
  23147. else {
  23148. op->defaults_kwdict = PySequence_ITEM(res, 1);
  23149. if (unlikely(!op->defaults_kwdict)) result = -1;
  23150. }
  23151. #endif
  23152. Py_DECREF(res);
  23153. return result;
  23154. }
  23155. static int
  23156. __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23157. PyObject* tmp;
  23158. if (!value) {
  23159. value = Py_None;
  23160. } else if (value != Py_None && !PyTuple_Check(value)) {
  23161. PyErr_SetString(PyExc_TypeError,
  23162. "__defaults__ must be set to a tuple object");
  23163. return -1;
  23164. }
  23165. Py_INCREF(value);
  23166. tmp = op->defaults_tuple;
  23167. op->defaults_tuple = value;
  23168. Py_XDECREF(tmp);
  23169. return 0;
  23170. }
  23171. static PyObject *
  23172. __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23173. PyObject* result = op->defaults_tuple;
  23174. if (unlikely(!result)) {
  23175. if (op->defaults_getter) {
  23176. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  23177. result = op->defaults_tuple;
  23178. } else {
  23179. result = Py_None;
  23180. }
  23181. }
  23182. Py_INCREF(result);
  23183. return result;
  23184. }
  23185. static int
  23186. __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23187. PyObject* tmp;
  23188. if (!value) {
  23189. value = Py_None;
  23190. } else if (value != Py_None && !PyDict_Check(value)) {
  23191. PyErr_SetString(PyExc_TypeError,
  23192. "__kwdefaults__ must be set to a dict object");
  23193. return -1;
  23194. }
  23195. Py_INCREF(value);
  23196. tmp = op->defaults_kwdict;
  23197. op->defaults_kwdict = value;
  23198. Py_XDECREF(tmp);
  23199. return 0;
  23200. }
  23201. static PyObject *
  23202. __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23203. PyObject* result = op->defaults_kwdict;
  23204. if (unlikely(!result)) {
  23205. if (op->defaults_getter) {
  23206. if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
  23207. result = op->defaults_kwdict;
  23208. } else {
  23209. result = Py_None;
  23210. }
  23211. }
  23212. Py_INCREF(result);
  23213. return result;
  23214. }
  23215. static int
  23216. __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
  23217. PyObject* tmp;
  23218. if (!value || value == Py_None) {
  23219. value = NULL;
  23220. } else if (!PyDict_Check(value)) {
  23221. PyErr_SetString(PyExc_TypeError,
  23222. "__annotations__ must be set to a dict object");
  23223. return -1;
  23224. }
  23225. Py_XINCREF(value);
  23226. tmp = op->func_annotations;
  23227. op->func_annotations = value;
  23228. Py_XDECREF(tmp);
  23229. return 0;
  23230. }
  23231. static PyObject *
  23232. __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
  23233. PyObject* result = op->func_annotations;
  23234. if (unlikely(!result)) {
  23235. result = PyDict_New();
  23236. if (unlikely(!result)) return NULL;
  23237. op->func_annotations = result;
  23238. }
  23239. Py_INCREF(result);
  23240. return result;
  23241. }
  23242. static PyGetSetDef __pyx_CyFunction_getsets[] = {
  23243. {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  23244. {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
  23245. {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  23246. {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
  23247. {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
  23248. {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
  23249. {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  23250. {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
  23251. {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  23252. {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
  23253. {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  23254. {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
  23255. {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  23256. {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
  23257. {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  23258. {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
  23259. {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
  23260. {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
  23261. {0, 0, 0, 0, 0}
  23262. };
  23263. static PyMemberDef __pyx_CyFunction_members[] = {
  23264. {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
  23265. {0, 0, 0, 0, 0}
  23266. };
  23267. static PyObject *
  23268. __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
  23269. {
  23270. #if PY_MAJOR_VERSION >= 3
  23271. return PyUnicode_FromString(m->func.m_ml->ml_name);
  23272. #else
  23273. return PyString_FromString(m->func.m_ml->ml_name);
  23274. #endif
  23275. }
  23276. static PyMethodDef __pyx_CyFunction_methods[] = {
  23277. {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
  23278. {0, 0, 0, 0}
  23279. };
  23280. #if PY_VERSION_HEX < 0x030500A0
  23281. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
  23282. #else
  23283. #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
  23284. #endif
  23285. static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
  23286. PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
  23287. __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
  23288. if (op == NULL)
  23289. return NULL;
  23290. op->flags = flags;
  23291. __Pyx_CyFunction_weakreflist(op) = NULL;
  23292. op->func.m_ml = ml;
  23293. op->func.m_self = (PyObject *) op;
  23294. Py_XINCREF(closure);
  23295. op->func_closure = closure;
  23296. Py_XINCREF(module);
  23297. op->func.m_module = module;
  23298. op->func_dict = NULL;
  23299. op->func_name = NULL;
  23300. Py_INCREF(qualname);
  23301. op->func_qualname = qualname;
  23302. op->func_doc = NULL;
  23303. op->func_classobj = NULL;
  23304. op->func_globals = globals;
  23305. Py_INCREF(op->func_globals);
  23306. Py_XINCREF(code);
  23307. op->func_code = code;
  23308. op->defaults_pyobjects = 0;
  23309. op->defaults_size = 0;
  23310. op->defaults = NULL;
  23311. op->defaults_tuple = NULL;
  23312. op->defaults_kwdict = NULL;
  23313. op->defaults_getter = NULL;
  23314. op->func_annotations = NULL;
  23315. PyObject_GC_Track(op);
  23316. return (PyObject *) op;
  23317. }
  23318. static int
  23319. __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
  23320. {
  23321. Py_CLEAR(m->func_closure);
  23322. Py_CLEAR(m->func.m_module);
  23323. Py_CLEAR(m->func_dict);
  23324. Py_CLEAR(m->func_name);
  23325. Py_CLEAR(m->func_qualname);
  23326. Py_CLEAR(m->func_doc);
  23327. Py_CLEAR(m->func_globals);
  23328. Py_CLEAR(m->func_code);
  23329. Py_CLEAR(m->func_classobj);
  23330. Py_CLEAR(m->defaults_tuple);
  23331. Py_CLEAR(m->defaults_kwdict);
  23332. Py_CLEAR(m->func_annotations);
  23333. if (m->defaults) {
  23334. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  23335. int i;
  23336. for (i = 0; i < m->defaults_pyobjects; i++)
  23337. Py_XDECREF(pydefaults[i]);
  23338. PyObject_Free(m->defaults);
  23339. m->defaults = NULL;
  23340. }
  23341. return 0;
  23342. }
  23343. static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
  23344. {
  23345. if (__Pyx_CyFunction_weakreflist(m) != NULL)
  23346. PyObject_ClearWeakRefs((PyObject *) m);
  23347. __Pyx_CyFunction_clear(m);
  23348. PyObject_GC_Del(m);
  23349. }
  23350. static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
  23351. {
  23352. PyObject_GC_UnTrack(m);
  23353. __Pyx__CyFunction_dealloc(m);
  23354. }
  23355. static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
  23356. {
  23357. Py_VISIT(m->func_closure);
  23358. Py_VISIT(m->func.m_module);
  23359. Py_VISIT(m->func_dict);
  23360. Py_VISIT(m->func_name);
  23361. Py_VISIT(m->func_qualname);
  23362. Py_VISIT(m->func_doc);
  23363. Py_VISIT(m->func_globals);
  23364. Py_VISIT(m->func_code);
  23365. Py_VISIT(m->func_classobj);
  23366. Py_VISIT(m->defaults_tuple);
  23367. Py_VISIT(m->defaults_kwdict);
  23368. if (m->defaults) {
  23369. PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
  23370. int i;
  23371. for (i = 0; i < m->defaults_pyobjects; i++)
  23372. Py_VISIT(pydefaults[i]);
  23373. }
  23374. return 0;
  23375. }
  23376. static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
  23377. {
  23378. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23379. if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
  23380. Py_INCREF(func);
  23381. return func;
  23382. }
  23383. if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
  23384. if (type == NULL)
  23385. type = (PyObject *)(Py_TYPE(obj));
  23386. return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
  23387. }
  23388. if (obj == Py_None)
  23389. obj = NULL;
  23390. return __Pyx_PyMethod_New(func, obj, type);
  23391. }
  23392. static PyObject*
  23393. __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
  23394. {
  23395. #if PY_MAJOR_VERSION >= 3
  23396. return PyUnicode_FromFormat("<cyfunction %U at %p>",
  23397. op->func_qualname, (void *)op);
  23398. #else
  23399. return PyString_FromFormat("<cyfunction %s at %p>",
  23400. PyString_AsString(op->func_qualname), (void *)op);
  23401. #endif
  23402. }
  23403. static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
  23404. PyCFunctionObject* f = (PyCFunctionObject*)func;
  23405. PyCFunction meth = f->m_ml->ml_meth;
  23406. Py_ssize_t size;
  23407. switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
  23408. case METH_VARARGS:
  23409. if (likely(kw == NULL || PyDict_Size(kw) == 0))
  23410. return (*meth)(self, arg);
  23411. break;
  23412. case METH_VARARGS | METH_KEYWORDS:
  23413. return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
  23414. case METH_NOARGS:
  23415. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  23416. size = PyTuple_GET_SIZE(arg);
  23417. if (likely(size == 0))
  23418. return (*meth)(self, NULL);
  23419. PyErr_Format(PyExc_TypeError,
  23420. "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
  23421. f->m_ml->ml_name, size);
  23422. return NULL;
  23423. }
  23424. break;
  23425. case METH_O:
  23426. if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
  23427. size = PyTuple_GET_SIZE(arg);
  23428. if (likely(size == 1)) {
  23429. PyObject *result, *arg0;
  23430. #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
  23431. arg0 = PyTuple_GET_ITEM(arg, 0);
  23432. #else
  23433. arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
  23434. #endif
  23435. result = (*meth)(self, arg0);
  23436. #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
  23437. Py_DECREF(arg0);
  23438. #endif
  23439. return result;
  23440. }
  23441. PyErr_Format(PyExc_TypeError,
  23442. "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
  23443. f->m_ml->ml_name, size);
  23444. return NULL;
  23445. }
  23446. break;
  23447. default:
  23448. PyErr_SetString(PyExc_SystemError, "Bad call flags in "
  23449. "__Pyx_CyFunction_Call. METH_OLDARGS is no "
  23450. "longer supported!");
  23451. return NULL;
  23452. }
  23453. PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
  23454. f->m_ml->ml_name);
  23455. return NULL;
  23456. }
  23457. static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
  23458. return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
  23459. }
  23460. static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
  23461. PyObject *result;
  23462. __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
  23463. if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
  23464. Py_ssize_t argc;
  23465. PyObject *new_args;
  23466. PyObject *self;
  23467. argc = PyTuple_GET_SIZE(args);
  23468. new_args = PyTuple_GetSlice(args, 1, argc);
  23469. if (unlikely(!new_args))
  23470. return NULL;
  23471. self = PyTuple_GetItem(args, 0);
  23472. if (unlikely(!self)) {
  23473. Py_DECREF(new_args);
  23474. return NULL;
  23475. }
  23476. result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
  23477. Py_DECREF(new_args);
  23478. } else {
  23479. result = __Pyx_CyFunction_Call(func, args, kw);
  23480. }
  23481. return result;
  23482. }
  23483. static PyTypeObject __pyx_CyFunctionType_type = {
  23484. PyVarObject_HEAD_INIT(0, 0)
  23485. "cython_function_or_method",
  23486. sizeof(__pyx_CyFunctionObject),
  23487. 0,
  23488. (destructor) __Pyx_CyFunction_dealloc,
  23489. 0,
  23490. 0,
  23491. 0,
  23492. #if PY_MAJOR_VERSION < 3
  23493. 0,
  23494. #else
  23495. 0,
  23496. #endif
  23497. (reprfunc) __Pyx_CyFunction_repr,
  23498. 0,
  23499. 0,
  23500. 0,
  23501. 0,
  23502. __Pyx_CyFunction_CallAsMethod,
  23503. 0,
  23504. 0,
  23505. 0,
  23506. 0,
  23507. Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
  23508. 0,
  23509. (traverseproc) __Pyx_CyFunction_traverse,
  23510. (inquiry) __Pyx_CyFunction_clear,
  23511. 0,
  23512. #if PY_VERSION_HEX < 0x030500A0
  23513. offsetof(__pyx_CyFunctionObject, func_weakreflist),
  23514. #else
  23515. offsetof(PyCFunctionObject, m_weakreflist),
  23516. #endif
  23517. 0,
  23518. 0,
  23519. __pyx_CyFunction_methods,
  23520. __pyx_CyFunction_members,
  23521. __pyx_CyFunction_getsets,
  23522. 0,
  23523. 0,
  23524. __Pyx_CyFunction_descr_get,
  23525. 0,
  23526. offsetof(__pyx_CyFunctionObject, func_dict),
  23527. 0,
  23528. 0,
  23529. 0,
  23530. 0,
  23531. 0,
  23532. 0,
  23533. 0,
  23534. 0,
  23535. 0,
  23536. 0,
  23537. 0,
  23538. 0,
  23539. #if PY_VERSION_HEX >= 0x030400a1
  23540. 0,
  23541. #endif
  23542. #if PY_VERSION_HEX >= 0x030800b1
  23543. 0,
  23544. #endif
  23545. #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  23546. 0,
  23547. #endif
  23548. };
  23549. static int __pyx_CyFunction_init(void) {
  23550. __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
  23551. if (unlikely(__pyx_CyFunctionType == NULL)) {
  23552. return -1;
  23553. }
  23554. return 0;
  23555. }
  23556. static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
  23557. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23558. m->defaults = PyObject_Malloc(size);
  23559. if (unlikely(!m->defaults))
  23560. return PyErr_NoMemory();
  23561. memset(m->defaults, 0, size);
  23562. m->defaults_pyobjects = pyobjects;
  23563. m->defaults_size = size;
  23564. return m->defaults;
  23565. }
  23566. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
  23567. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23568. m->defaults_tuple = tuple;
  23569. Py_INCREF(tuple);
  23570. }
  23571. static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
  23572. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23573. m->defaults_kwdict = dict;
  23574. Py_INCREF(dict);
  23575. }
  23576. static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
  23577. __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
  23578. m->func_annotations = dict;
  23579. Py_INCREF(dict);
  23580. }
  23581. /* CLineInTraceback */
  23582. #ifndef CYTHON_CLINE_IN_TRACEBACK
  23583. static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
  23584. PyObject *use_cline;
  23585. PyObject *ptype, *pvalue, *ptraceback;
  23586. #if CYTHON_COMPILING_IN_CPYTHON
  23587. PyObject **cython_runtime_dict;
  23588. #endif
  23589. if (unlikely(!__pyx_cython_runtime)) {
  23590. return c_line;
  23591. }
  23592. __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
  23593. #if CYTHON_COMPILING_IN_CPYTHON
  23594. cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
  23595. if (likely(cython_runtime_dict)) {
  23596. __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
  23597. use_cline, *cython_runtime_dict,
  23598. __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
  23599. } else
  23600. #endif
  23601. {
  23602. PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
  23603. if (use_cline_obj) {
  23604. use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
  23605. Py_DECREF(use_cline_obj);
  23606. } else {
  23607. PyErr_Clear();
  23608. use_cline = NULL;
  23609. }
  23610. }
  23611. if (!use_cline) {
  23612. c_line = 0;
  23613. PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
  23614. }
  23615. else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
  23616. c_line = 0;
  23617. }
  23618. __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
  23619. return c_line;
  23620. }
  23621. #endif
  23622. /* CodeObjectCache */
  23623. static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
  23624. int start = 0, mid = 0, end = count - 1;
  23625. if (end >= 0 && code_line > entries[end].code_line) {
  23626. return count;
  23627. }
  23628. while (start < end) {
  23629. mid = start + (end - start) / 2;
  23630. if (code_line < entries[mid].code_line) {
  23631. end = mid;
  23632. } else if (code_line > entries[mid].code_line) {
  23633. start = mid + 1;
  23634. } else {
  23635. return mid;
  23636. }
  23637. }
  23638. if (code_line <= entries[mid].code_line) {
  23639. return mid;
  23640. } else {
  23641. return mid + 1;
  23642. }
  23643. }
  23644. static PyCodeObject *__pyx_find_code_object(int code_line) {
  23645. PyCodeObject* code_object;
  23646. int pos;
  23647. if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
  23648. return NULL;
  23649. }
  23650. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23651. if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
  23652. return NULL;
  23653. }
  23654. code_object = __pyx_code_cache.entries[pos].code_object;
  23655. Py_INCREF(code_object);
  23656. return code_object;
  23657. }
  23658. static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
  23659. int pos, i;
  23660. __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
  23661. if (unlikely(!code_line)) {
  23662. return;
  23663. }
  23664. if (unlikely(!entries)) {
  23665. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
  23666. if (likely(entries)) {
  23667. __pyx_code_cache.entries = entries;
  23668. __pyx_code_cache.max_count = 64;
  23669. __pyx_code_cache.count = 1;
  23670. entries[0].code_line = code_line;
  23671. entries[0].code_object = code_object;
  23672. Py_INCREF(code_object);
  23673. }
  23674. return;
  23675. }
  23676. pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
  23677. if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
  23678. PyCodeObject* tmp = entries[pos].code_object;
  23679. entries[pos].code_object = code_object;
  23680. Py_DECREF(tmp);
  23681. return;
  23682. }
  23683. if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
  23684. int new_max = __pyx_code_cache.max_count + 64;
  23685. entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
  23686. __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
  23687. if (unlikely(!entries)) {
  23688. return;
  23689. }
  23690. __pyx_code_cache.entries = entries;
  23691. __pyx_code_cache.max_count = new_max;
  23692. }
  23693. for (i=__pyx_code_cache.count; i>pos; i--) {
  23694. entries[i] = entries[i-1];
  23695. }
  23696. entries[pos].code_line = code_line;
  23697. entries[pos].code_object = code_object;
  23698. __pyx_code_cache.count++;
  23699. Py_INCREF(code_object);
  23700. }
  23701. /* AddTraceback */
  23702. #include "compile.h"
  23703. #include "frameobject.h"
  23704. #include "traceback.h"
  23705. static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
  23706. const char *funcname, int c_line,
  23707. int py_line, const char *filename) {
  23708. PyCodeObject *py_code = 0;
  23709. PyObject *py_srcfile = 0;
  23710. PyObject *py_funcname = 0;
  23711. #if PY_MAJOR_VERSION < 3
  23712. py_srcfile = PyString_FromString(filename);
  23713. #else
  23714. py_srcfile = PyUnicode_FromString(filename);
  23715. #endif
  23716. if (!py_srcfile) goto bad;
  23717. if (c_line) {
  23718. #if PY_MAJOR_VERSION < 3
  23719. py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23720. #else
  23721. py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
  23722. #endif
  23723. }
  23724. else {
  23725. #if PY_MAJOR_VERSION < 3
  23726. py_funcname = PyString_FromString(funcname);
  23727. #else
  23728. py_funcname = PyUnicode_FromString(funcname);
  23729. #endif
  23730. }
  23731. if (!py_funcname) goto bad;
  23732. py_code = __Pyx_PyCode_New(
  23733. 0,
  23734. 0,
  23735. 0,
  23736. 0,
  23737. 0,
  23738. __pyx_empty_bytes, /*PyObject *code,*/
  23739. __pyx_empty_tuple, /*PyObject *consts,*/
  23740. __pyx_empty_tuple, /*PyObject *names,*/
  23741. __pyx_empty_tuple, /*PyObject *varnames,*/
  23742. __pyx_empty_tuple, /*PyObject *freevars,*/
  23743. __pyx_empty_tuple, /*PyObject *cellvars,*/
  23744. py_srcfile, /*PyObject *filename,*/
  23745. py_funcname, /*PyObject *name,*/
  23746. py_line,
  23747. __pyx_empty_bytes /*PyObject *lnotab*/
  23748. );
  23749. Py_DECREF(py_srcfile);
  23750. Py_DECREF(py_funcname);
  23751. return py_code;
  23752. bad:
  23753. Py_XDECREF(py_srcfile);
  23754. Py_XDECREF(py_funcname);
  23755. return NULL;
  23756. }
  23757. static void __Pyx_AddTraceback(const char *funcname, int c_line,
  23758. int py_line, const char *filename) {
  23759. PyCodeObject *py_code = 0;
  23760. PyFrameObject *py_frame = 0;
  23761. PyThreadState *tstate = __Pyx_PyThreadState_Current;
  23762. if (c_line) {
  23763. c_line = __Pyx_CLineForTraceback(tstate, c_line);
  23764. }
  23765. py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
  23766. if (!py_code) {
  23767. py_code = __Pyx_CreateCodeObjectForTraceback(
  23768. funcname, c_line, py_line, filename);
  23769. if (!py_code) goto bad;
  23770. __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
  23771. }
  23772. py_frame = PyFrame_New(
  23773. tstate, /*PyThreadState *tstate,*/
  23774. py_code, /*PyCodeObject *code,*/
  23775. __pyx_d, /*PyObject *globals,*/
  23776. 0 /*PyObject *locals*/
  23777. );
  23778. if (!py_frame) goto bad;
  23779. __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
  23780. PyTraceBack_Here(py_frame);
  23781. bad:
  23782. Py_XDECREF(py_code);
  23783. Py_XDECREF(py_frame);
  23784. }
  23785. /* CIntFromPyVerify */
  23786. #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
  23787. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
  23788. #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
  23789. __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
  23790. #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
  23791. {\
  23792. func_type value = func_value;\
  23793. if (sizeof(target_type) < sizeof(func_type)) {\
  23794. if (unlikely(value != (func_type) (target_type) value)) {\
  23795. func_type zero = 0;\
  23796. if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
  23797. return (target_type) -1;\
  23798. if (is_unsigned && unlikely(value < zero))\
  23799. goto raise_neg_overflow;\
  23800. else\
  23801. goto raise_overflow;\
  23802. }\
  23803. }\
  23804. return (target_type) value;\
  23805. }
  23806. /* CIntToPy */
  23807. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_npy_uint64(npy_uint64 value) {
  23808. const npy_uint64 neg_one = (npy_uint64) ((npy_uint64) 0 - (npy_uint64) 1), const_zero = (npy_uint64) 0;
  23809. const int is_unsigned = neg_one > const_zero;
  23810. if (is_unsigned) {
  23811. if (sizeof(npy_uint64) < sizeof(long)) {
  23812. return PyInt_FromLong((long) value);
  23813. } else if (sizeof(npy_uint64) <= sizeof(unsigned long)) {
  23814. return PyLong_FromUnsignedLong((unsigned long) value);
  23815. #ifdef HAVE_LONG_LONG
  23816. } else if (sizeof(npy_uint64) <= sizeof(unsigned PY_LONG_LONG)) {
  23817. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23818. #endif
  23819. }
  23820. } else {
  23821. if (sizeof(npy_uint64) <= sizeof(long)) {
  23822. return PyInt_FromLong((long) value);
  23823. #ifdef HAVE_LONG_LONG
  23824. } else if (sizeof(npy_uint64) <= sizeof(PY_LONG_LONG)) {
  23825. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23826. #endif
  23827. }
  23828. }
  23829. {
  23830. int one = 1; int little = (int)*(unsigned char *)&one;
  23831. unsigned char *bytes = (unsigned char *)&value;
  23832. return _PyLong_FromByteArray(bytes, sizeof(npy_uint64),
  23833. little, !is_unsigned);
  23834. }
  23835. }
  23836. /* CIntToPy */
  23837. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
  23838. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  23839. const int is_unsigned = neg_one > const_zero;
  23840. if (is_unsigned) {
  23841. if (sizeof(int) < sizeof(long)) {
  23842. return PyInt_FromLong((long) value);
  23843. } else if (sizeof(int) <= sizeof(unsigned long)) {
  23844. return PyLong_FromUnsignedLong((unsigned long) value);
  23845. #ifdef HAVE_LONG_LONG
  23846. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  23847. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23848. #endif
  23849. }
  23850. } else {
  23851. if (sizeof(int) <= sizeof(long)) {
  23852. return PyInt_FromLong((long) value);
  23853. #ifdef HAVE_LONG_LONG
  23854. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  23855. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23856. #endif
  23857. }
  23858. }
  23859. {
  23860. int one = 1; int little = (int)*(unsigned char *)&one;
  23861. unsigned char *bytes = (unsigned char *)&value;
  23862. return _PyLong_FromByteArray(bytes, sizeof(int),
  23863. little, !is_unsigned);
  23864. }
  23865. }
  23866. /* CIntToPy */
  23867. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
  23868. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  23869. const int is_unsigned = neg_one > const_zero;
  23870. if (is_unsigned) {
  23871. if (sizeof(long) < sizeof(long)) {
  23872. return PyInt_FromLong((long) value);
  23873. } else if (sizeof(long) <= sizeof(unsigned long)) {
  23874. return PyLong_FromUnsignedLong((unsigned long) value);
  23875. #ifdef HAVE_LONG_LONG
  23876. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  23877. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  23878. #endif
  23879. }
  23880. } else {
  23881. if (sizeof(long) <= sizeof(long)) {
  23882. return PyInt_FromLong((long) value);
  23883. #ifdef HAVE_LONG_LONG
  23884. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  23885. return PyLong_FromLongLong((PY_LONG_LONG) value);
  23886. #endif
  23887. }
  23888. }
  23889. {
  23890. int one = 1; int little = (int)*(unsigned char *)&one;
  23891. unsigned char *bytes = (unsigned char *)&value;
  23892. return _PyLong_FromByteArray(bytes, sizeof(long),
  23893. little, !is_unsigned);
  23894. }
  23895. }
  23896. /* Declarations */
  23897. #if CYTHON_CCOMPLEX
  23898. #ifdef __cplusplus
  23899. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23900. return ::std::complex< float >(x, y);
  23901. }
  23902. #else
  23903. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23904. return x + y*(__pyx_t_float_complex)_Complex_I;
  23905. }
  23906. #endif
  23907. #else
  23908. static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
  23909. __pyx_t_float_complex z;
  23910. z.real = x;
  23911. z.imag = y;
  23912. return z;
  23913. }
  23914. #endif
  23915. /* Arithmetic */
  23916. #if CYTHON_CCOMPLEX
  23917. #else
  23918. static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23919. return (a.real == b.real) && (a.imag == b.imag);
  23920. }
  23921. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23922. __pyx_t_float_complex z;
  23923. z.real = a.real + b.real;
  23924. z.imag = a.imag + b.imag;
  23925. return z;
  23926. }
  23927. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23928. __pyx_t_float_complex z;
  23929. z.real = a.real - b.real;
  23930. z.imag = a.imag - b.imag;
  23931. return z;
  23932. }
  23933. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23934. __pyx_t_float_complex z;
  23935. z.real = a.real * b.real - a.imag * b.imag;
  23936. z.imag = a.real * b.imag + a.imag * b.real;
  23937. return z;
  23938. }
  23939. #if 1
  23940. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23941. if (b.imag == 0) {
  23942. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23943. } else if (fabsf(b.real) >= fabsf(b.imag)) {
  23944. if (b.real == 0 && b.imag == 0) {
  23945. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
  23946. } else {
  23947. float r = b.imag / b.real;
  23948. float s = (float)(1.0) / (b.real + b.imag * r);
  23949. return __pyx_t_float_complex_from_parts(
  23950. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  23951. }
  23952. } else {
  23953. float r = b.real / b.imag;
  23954. float s = (float)(1.0) / (b.imag + b.real * r);
  23955. return __pyx_t_float_complex_from_parts(
  23956. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  23957. }
  23958. }
  23959. #else
  23960. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23961. if (b.imag == 0) {
  23962. return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
  23963. } else {
  23964. float denom = b.real * b.real + b.imag * b.imag;
  23965. return __pyx_t_float_complex_from_parts(
  23966. (a.real * b.real + a.imag * b.imag) / denom,
  23967. (a.imag * b.real - a.real * b.imag) / denom);
  23968. }
  23969. }
  23970. #endif
  23971. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
  23972. __pyx_t_float_complex z;
  23973. z.real = -a.real;
  23974. z.imag = -a.imag;
  23975. return z;
  23976. }
  23977. static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
  23978. return (a.real == 0) && (a.imag == 0);
  23979. }
  23980. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
  23981. __pyx_t_float_complex z;
  23982. z.real = a.real;
  23983. z.imag = -a.imag;
  23984. return z;
  23985. }
  23986. #if 1
  23987. static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
  23988. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  23989. return sqrtf(z.real*z.real + z.imag*z.imag);
  23990. #else
  23991. return hypotf(z.real, z.imag);
  23992. #endif
  23993. }
  23994. static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
  23995. __pyx_t_float_complex z;
  23996. float r, lnr, theta, z_r, z_theta;
  23997. if (b.imag == 0 && b.real == (int)b.real) {
  23998. if (b.real < 0) {
  23999. float denom = a.real * a.real + a.imag * a.imag;
  24000. a.real = a.real / denom;
  24001. a.imag = -a.imag / denom;
  24002. b.real = -b.real;
  24003. }
  24004. switch ((int)b.real) {
  24005. case 0:
  24006. z.real = 1;
  24007. z.imag = 0;
  24008. return z;
  24009. case 1:
  24010. return a;
  24011. case 2:
  24012. return __Pyx_c_prod_float(a, a);
  24013. case 3:
  24014. z = __Pyx_c_prod_float(a, a);
  24015. return __Pyx_c_prod_float(z, a);
  24016. case 4:
  24017. z = __Pyx_c_prod_float(a, a);
  24018. return __Pyx_c_prod_float(z, z);
  24019. }
  24020. }
  24021. if (a.imag == 0) {
  24022. if (a.real == 0) {
  24023. return a;
  24024. } else if (b.imag == 0) {
  24025. z.real = powf(a.real, b.real);
  24026. z.imag = 0;
  24027. return z;
  24028. } else if (a.real > 0) {
  24029. r = a.real;
  24030. theta = 0;
  24031. } else {
  24032. r = -a.real;
  24033. theta = atan2f(0.0, -1.0);
  24034. }
  24035. } else {
  24036. r = __Pyx_c_abs_float(a);
  24037. theta = atan2f(a.imag, a.real);
  24038. }
  24039. lnr = logf(r);
  24040. z_r = expf(lnr * b.real - theta * b.imag);
  24041. z_theta = theta * b.real + lnr * b.imag;
  24042. z.real = z_r * cosf(z_theta);
  24043. z.imag = z_r * sinf(z_theta);
  24044. return z;
  24045. }
  24046. #endif
  24047. #endif
  24048. /* Declarations */
  24049. #if CYTHON_CCOMPLEX
  24050. #ifdef __cplusplus
  24051. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24052. return ::std::complex< double >(x, y);
  24053. }
  24054. #else
  24055. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24056. return x + y*(__pyx_t_double_complex)_Complex_I;
  24057. }
  24058. #endif
  24059. #else
  24060. static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
  24061. __pyx_t_double_complex z;
  24062. z.real = x;
  24063. z.imag = y;
  24064. return z;
  24065. }
  24066. #endif
  24067. /* Arithmetic */
  24068. #if CYTHON_CCOMPLEX
  24069. #else
  24070. static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24071. return (a.real == b.real) && (a.imag == b.imag);
  24072. }
  24073. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24074. __pyx_t_double_complex z;
  24075. z.real = a.real + b.real;
  24076. z.imag = a.imag + b.imag;
  24077. return z;
  24078. }
  24079. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24080. __pyx_t_double_complex z;
  24081. z.real = a.real - b.real;
  24082. z.imag = a.imag - b.imag;
  24083. return z;
  24084. }
  24085. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24086. __pyx_t_double_complex z;
  24087. z.real = a.real * b.real - a.imag * b.imag;
  24088. z.imag = a.real * b.imag + a.imag * b.real;
  24089. return z;
  24090. }
  24091. #if 1
  24092. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24093. if (b.imag == 0) {
  24094. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  24095. } else if (fabs(b.real) >= fabs(b.imag)) {
  24096. if (b.real == 0 && b.imag == 0) {
  24097. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
  24098. } else {
  24099. double r = b.imag / b.real;
  24100. double s = (double)(1.0) / (b.real + b.imag * r);
  24101. return __pyx_t_double_complex_from_parts(
  24102. (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
  24103. }
  24104. } else {
  24105. double r = b.real / b.imag;
  24106. double s = (double)(1.0) / (b.imag + b.real * r);
  24107. return __pyx_t_double_complex_from_parts(
  24108. (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
  24109. }
  24110. }
  24111. #else
  24112. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24113. if (b.imag == 0) {
  24114. return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
  24115. } else {
  24116. double denom = b.real * b.real + b.imag * b.imag;
  24117. return __pyx_t_double_complex_from_parts(
  24118. (a.real * b.real + a.imag * b.imag) / denom,
  24119. (a.imag * b.real - a.real * b.imag) / denom);
  24120. }
  24121. }
  24122. #endif
  24123. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
  24124. __pyx_t_double_complex z;
  24125. z.real = -a.real;
  24126. z.imag = -a.imag;
  24127. return z;
  24128. }
  24129. static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
  24130. return (a.real == 0) && (a.imag == 0);
  24131. }
  24132. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
  24133. __pyx_t_double_complex z;
  24134. z.real = a.real;
  24135. z.imag = -a.imag;
  24136. return z;
  24137. }
  24138. #if 1
  24139. static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
  24140. #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
  24141. return sqrt(z.real*z.real + z.imag*z.imag);
  24142. #else
  24143. return hypot(z.real, z.imag);
  24144. #endif
  24145. }
  24146. static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
  24147. __pyx_t_double_complex z;
  24148. double r, lnr, theta, z_r, z_theta;
  24149. if (b.imag == 0 && b.real == (int)b.real) {
  24150. if (b.real < 0) {
  24151. double denom = a.real * a.real + a.imag * a.imag;
  24152. a.real = a.real / denom;
  24153. a.imag = -a.imag / denom;
  24154. b.real = -b.real;
  24155. }
  24156. switch ((int)b.real) {
  24157. case 0:
  24158. z.real = 1;
  24159. z.imag = 0;
  24160. return z;
  24161. case 1:
  24162. return a;
  24163. case 2:
  24164. return __Pyx_c_prod_double(a, a);
  24165. case 3:
  24166. z = __Pyx_c_prod_double(a, a);
  24167. return __Pyx_c_prod_double(z, a);
  24168. case 4:
  24169. z = __Pyx_c_prod_double(a, a);
  24170. return __Pyx_c_prod_double(z, z);
  24171. }
  24172. }
  24173. if (a.imag == 0) {
  24174. if (a.real == 0) {
  24175. return a;
  24176. } else if (b.imag == 0) {
  24177. z.real = pow(a.real, b.real);
  24178. z.imag = 0;
  24179. return z;
  24180. } else if (a.real > 0) {
  24181. r = a.real;
  24182. theta = 0;
  24183. } else {
  24184. r = -a.real;
  24185. theta = atan2(0.0, -1.0);
  24186. }
  24187. } else {
  24188. r = __Pyx_c_abs_double(a);
  24189. theta = atan2(a.imag, a.real);
  24190. }
  24191. lnr = log(r);
  24192. z_r = exp(lnr * b.real - theta * b.imag);
  24193. z_theta = theta * b.real + lnr * b.imag;
  24194. z.real = z_r * cos(z_theta);
  24195. z.imag = z_r * sin(z_theta);
  24196. return z;
  24197. }
  24198. #endif
  24199. #endif
  24200. /* CIntToPy */
  24201. static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
  24202. const enum NPY_TYPES neg_one = (enum NPY_TYPES) ((enum NPY_TYPES) 0 - (enum NPY_TYPES) 1), const_zero = (enum NPY_TYPES) 0;
  24203. const int is_unsigned = neg_one > const_zero;
  24204. if (is_unsigned) {
  24205. if (sizeof(enum NPY_TYPES) < sizeof(long)) {
  24206. return PyInt_FromLong((long) value);
  24207. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
  24208. return PyLong_FromUnsignedLong((unsigned long) value);
  24209. #ifdef HAVE_LONG_LONG
  24210. } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
  24211. return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
  24212. #endif
  24213. }
  24214. } else {
  24215. if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
  24216. return PyInt_FromLong((long) value);
  24217. #ifdef HAVE_LONG_LONG
  24218. } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
  24219. return PyLong_FromLongLong((PY_LONG_LONG) value);
  24220. #endif
  24221. }
  24222. }
  24223. {
  24224. int one = 1; int little = (int)*(unsigned char *)&one;
  24225. unsigned char *bytes = (unsigned char *)&value;
  24226. return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
  24227. little, !is_unsigned);
  24228. }
  24229. }
  24230. /* CIntFromPy */
  24231. static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
  24232. const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
  24233. const int is_unsigned = neg_one > const_zero;
  24234. #if PY_MAJOR_VERSION < 3
  24235. if (likely(PyInt_Check(x))) {
  24236. if (sizeof(size_t) < sizeof(long)) {
  24237. __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
  24238. } else {
  24239. long val = PyInt_AS_LONG(x);
  24240. if (is_unsigned && unlikely(val < 0)) {
  24241. goto raise_neg_overflow;
  24242. }
  24243. return (size_t) val;
  24244. }
  24245. } else
  24246. #endif
  24247. if (likely(PyLong_Check(x))) {
  24248. if (is_unsigned) {
  24249. #if CYTHON_USE_PYLONG_INTERNALS
  24250. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24251. switch (Py_SIZE(x)) {
  24252. case 0: return (size_t) 0;
  24253. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
  24254. case 2:
  24255. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  24256. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24257. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24258. } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
  24259. return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24260. }
  24261. }
  24262. break;
  24263. case 3:
  24264. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  24265. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24266. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24267. } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
  24268. return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  24269. }
  24270. }
  24271. break;
  24272. case 4:
  24273. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  24274. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24275. __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])))
  24276. } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
  24277. 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]));
  24278. }
  24279. }
  24280. break;
  24281. }
  24282. #endif
  24283. #if CYTHON_COMPILING_IN_CPYTHON
  24284. if (unlikely(Py_SIZE(x) < 0)) {
  24285. goto raise_neg_overflow;
  24286. }
  24287. #else
  24288. {
  24289. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24290. if (unlikely(result < 0))
  24291. return (size_t) -1;
  24292. if (unlikely(result == 1))
  24293. goto raise_neg_overflow;
  24294. }
  24295. #endif
  24296. if (sizeof(size_t) <= sizeof(unsigned long)) {
  24297. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
  24298. #ifdef HAVE_LONG_LONG
  24299. } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
  24300. __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24301. #endif
  24302. }
  24303. } else {
  24304. #if CYTHON_USE_PYLONG_INTERNALS
  24305. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24306. switch (Py_SIZE(x)) {
  24307. case 0: return (size_t) 0;
  24308. case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
  24309. case 1: __PYX_VERIFY_RETURN_INT(size_t, digit, +digits[0])
  24310. case -2:
  24311. if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
  24312. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24313. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24314. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24315. return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24316. }
  24317. }
  24318. break;
  24319. case 2:
  24320. if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
  24321. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24322. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24323. } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24324. return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24325. }
  24326. }
  24327. break;
  24328. case -3:
  24329. if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
  24330. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24331. __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24332. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24333. return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24334. }
  24335. }
  24336. break;
  24337. case 3:
  24338. if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
  24339. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24340. __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24341. } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24342. return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
  24343. }
  24344. }
  24345. break;
  24346. case -4:
  24347. if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
  24348. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24349. __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])))
  24350. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  24351. 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])));
  24352. }
  24353. }
  24354. break;
  24355. case 4:
  24356. if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
  24357. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24358. __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])))
  24359. } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
  24360. 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])));
  24361. }
  24362. }
  24363. break;
  24364. }
  24365. #endif
  24366. if (sizeof(size_t) <= sizeof(long)) {
  24367. __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
  24368. #ifdef HAVE_LONG_LONG
  24369. } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
  24370. __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
  24371. #endif
  24372. }
  24373. }
  24374. {
  24375. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24376. PyErr_SetString(PyExc_RuntimeError,
  24377. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24378. #else
  24379. size_t val;
  24380. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24381. #if PY_MAJOR_VERSION < 3
  24382. if (likely(v) && !PyLong_Check(v)) {
  24383. PyObject *tmp = v;
  24384. v = PyNumber_Long(tmp);
  24385. Py_DECREF(tmp);
  24386. }
  24387. #endif
  24388. if (likely(v)) {
  24389. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24390. unsigned char *bytes = (unsigned char *)&val;
  24391. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24392. bytes, sizeof(val),
  24393. is_little, !is_unsigned);
  24394. Py_DECREF(v);
  24395. if (likely(!ret))
  24396. return val;
  24397. }
  24398. #endif
  24399. return (size_t) -1;
  24400. }
  24401. } else {
  24402. size_t val;
  24403. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24404. if (!tmp) return (size_t) -1;
  24405. val = __Pyx_PyInt_As_size_t(tmp);
  24406. Py_DECREF(tmp);
  24407. return val;
  24408. }
  24409. raise_overflow:
  24410. PyErr_SetString(PyExc_OverflowError,
  24411. "value too large to convert to size_t");
  24412. return (size_t) -1;
  24413. raise_neg_overflow:
  24414. PyErr_SetString(PyExc_OverflowError,
  24415. "can't convert negative value to size_t");
  24416. return (size_t) -1;
  24417. }
  24418. /* CIntFromPy */
  24419. static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
  24420. const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
  24421. const int is_unsigned = neg_one > const_zero;
  24422. #if PY_MAJOR_VERSION < 3
  24423. if (likely(PyInt_Check(x))) {
  24424. if (sizeof(int) < sizeof(long)) {
  24425. __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
  24426. } else {
  24427. long val = PyInt_AS_LONG(x);
  24428. if (is_unsigned && unlikely(val < 0)) {
  24429. goto raise_neg_overflow;
  24430. }
  24431. return (int) val;
  24432. }
  24433. } else
  24434. #endif
  24435. if (likely(PyLong_Check(x))) {
  24436. if (is_unsigned) {
  24437. #if CYTHON_USE_PYLONG_INTERNALS
  24438. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24439. switch (Py_SIZE(x)) {
  24440. case 0: return (int) 0;
  24441. case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
  24442. case 2:
  24443. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  24444. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24445. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24446. } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
  24447. return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24448. }
  24449. }
  24450. break;
  24451. case 3:
  24452. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  24453. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24454. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24455. } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
  24456. return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24457. }
  24458. }
  24459. break;
  24460. case 4:
  24461. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  24462. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24463. __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])))
  24464. } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
  24465. return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
  24466. }
  24467. }
  24468. break;
  24469. }
  24470. #endif
  24471. #if CYTHON_COMPILING_IN_CPYTHON
  24472. if (unlikely(Py_SIZE(x) < 0)) {
  24473. goto raise_neg_overflow;
  24474. }
  24475. #else
  24476. {
  24477. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24478. if (unlikely(result < 0))
  24479. return (int) -1;
  24480. if (unlikely(result == 1))
  24481. goto raise_neg_overflow;
  24482. }
  24483. #endif
  24484. if (sizeof(int) <= sizeof(unsigned long)) {
  24485. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
  24486. #ifdef HAVE_LONG_LONG
  24487. } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
  24488. __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24489. #endif
  24490. }
  24491. } else {
  24492. #if CYTHON_USE_PYLONG_INTERNALS
  24493. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24494. switch (Py_SIZE(x)) {
  24495. case 0: return (int) 0;
  24496. case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
  24497. case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
  24498. case -2:
  24499. if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
  24500. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24501. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24502. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24503. return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24504. }
  24505. }
  24506. break;
  24507. case 2:
  24508. if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
  24509. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24510. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24511. } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24512. return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24513. }
  24514. }
  24515. break;
  24516. case -3:
  24517. if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
  24518. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24519. __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24520. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24521. return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24522. }
  24523. }
  24524. break;
  24525. case 3:
  24526. if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
  24527. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24528. __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24529. } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24530. return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24531. }
  24532. }
  24533. break;
  24534. case -4:
  24535. if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
  24536. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24537. __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])))
  24538. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  24539. return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24540. }
  24541. }
  24542. break;
  24543. case 4:
  24544. if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
  24545. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24546. __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])))
  24547. } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
  24548. return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
  24549. }
  24550. }
  24551. break;
  24552. }
  24553. #endif
  24554. if (sizeof(int) <= sizeof(long)) {
  24555. __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
  24556. #ifdef HAVE_LONG_LONG
  24557. } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
  24558. __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
  24559. #endif
  24560. }
  24561. }
  24562. {
  24563. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24564. PyErr_SetString(PyExc_RuntimeError,
  24565. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24566. #else
  24567. int val;
  24568. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24569. #if PY_MAJOR_VERSION < 3
  24570. if (likely(v) && !PyLong_Check(v)) {
  24571. PyObject *tmp = v;
  24572. v = PyNumber_Long(tmp);
  24573. Py_DECREF(tmp);
  24574. }
  24575. #endif
  24576. if (likely(v)) {
  24577. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24578. unsigned char *bytes = (unsigned char *)&val;
  24579. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24580. bytes, sizeof(val),
  24581. is_little, !is_unsigned);
  24582. Py_DECREF(v);
  24583. if (likely(!ret))
  24584. return val;
  24585. }
  24586. #endif
  24587. return (int) -1;
  24588. }
  24589. } else {
  24590. int val;
  24591. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24592. if (!tmp) return (int) -1;
  24593. val = __Pyx_PyInt_As_int(tmp);
  24594. Py_DECREF(tmp);
  24595. return val;
  24596. }
  24597. raise_overflow:
  24598. PyErr_SetString(PyExc_OverflowError,
  24599. "value too large to convert to int");
  24600. return (int) -1;
  24601. raise_neg_overflow:
  24602. PyErr_SetString(PyExc_OverflowError,
  24603. "can't convert negative value to int");
  24604. return (int) -1;
  24605. }
  24606. /* CIntFromPy */
  24607. static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
  24608. const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
  24609. const int is_unsigned = neg_one > const_zero;
  24610. #if PY_MAJOR_VERSION < 3
  24611. if (likely(PyInt_Check(x))) {
  24612. if (sizeof(long) < sizeof(long)) {
  24613. __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
  24614. } else {
  24615. long val = PyInt_AS_LONG(x);
  24616. if (is_unsigned && unlikely(val < 0)) {
  24617. goto raise_neg_overflow;
  24618. }
  24619. return (long) val;
  24620. }
  24621. } else
  24622. #endif
  24623. if (likely(PyLong_Check(x))) {
  24624. if (is_unsigned) {
  24625. #if CYTHON_USE_PYLONG_INTERNALS
  24626. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24627. switch (Py_SIZE(x)) {
  24628. case 0: return (long) 0;
  24629. case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
  24630. case 2:
  24631. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24632. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24633. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24634. } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
  24635. return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24636. }
  24637. }
  24638. break;
  24639. case 3:
  24640. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24641. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24642. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24643. } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
  24644. return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24645. }
  24646. }
  24647. break;
  24648. case 4:
  24649. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24650. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24651. __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])))
  24652. } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
  24653. return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
  24654. }
  24655. }
  24656. break;
  24657. }
  24658. #endif
  24659. #if CYTHON_COMPILING_IN_CPYTHON
  24660. if (unlikely(Py_SIZE(x) < 0)) {
  24661. goto raise_neg_overflow;
  24662. }
  24663. #else
  24664. {
  24665. int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
  24666. if (unlikely(result < 0))
  24667. return (long) -1;
  24668. if (unlikely(result == 1))
  24669. goto raise_neg_overflow;
  24670. }
  24671. #endif
  24672. if (sizeof(long) <= sizeof(unsigned long)) {
  24673. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
  24674. #ifdef HAVE_LONG_LONG
  24675. } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
  24676. __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
  24677. #endif
  24678. }
  24679. } else {
  24680. #if CYTHON_USE_PYLONG_INTERNALS
  24681. const digit* digits = ((PyLongObject*)x)->ob_digit;
  24682. switch (Py_SIZE(x)) {
  24683. case 0: return (long) 0;
  24684. case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
  24685. case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
  24686. case -2:
  24687. if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
  24688. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24689. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24690. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24691. return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24692. }
  24693. }
  24694. break;
  24695. case 2:
  24696. if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
  24697. if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
  24698. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24699. } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24700. return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24701. }
  24702. }
  24703. break;
  24704. case -3:
  24705. if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
  24706. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24707. __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24708. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24709. return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24710. }
  24711. }
  24712. break;
  24713. case 3:
  24714. if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
  24715. if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
  24716. __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
  24717. } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24718. return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24719. }
  24720. }
  24721. break;
  24722. case -4:
  24723. if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
  24724. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24725. __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])))
  24726. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24727. return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24728. }
  24729. }
  24730. break;
  24731. case 4:
  24732. if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
  24733. if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
  24734. __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])))
  24735. } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
  24736. return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
  24737. }
  24738. }
  24739. break;
  24740. }
  24741. #endif
  24742. if (sizeof(long) <= sizeof(long)) {
  24743. __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
  24744. #ifdef HAVE_LONG_LONG
  24745. } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
  24746. __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
  24747. #endif
  24748. }
  24749. }
  24750. {
  24751. #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
  24752. PyErr_SetString(PyExc_RuntimeError,
  24753. "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
  24754. #else
  24755. long val;
  24756. PyObject *v = __Pyx_PyNumber_IntOrLong(x);
  24757. #if PY_MAJOR_VERSION < 3
  24758. if (likely(v) && !PyLong_Check(v)) {
  24759. PyObject *tmp = v;
  24760. v = PyNumber_Long(tmp);
  24761. Py_DECREF(tmp);
  24762. }
  24763. #endif
  24764. if (likely(v)) {
  24765. int one = 1; int is_little = (int)*(unsigned char *)&one;
  24766. unsigned char *bytes = (unsigned char *)&val;
  24767. int ret = _PyLong_AsByteArray((PyLongObject *)v,
  24768. bytes, sizeof(val),
  24769. is_little, !is_unsigned);
  24770. Py_DECREF(v);
  24771. if (likely(!ret))
  24772. return val;
  24773. }
  24774. #endif
  24775. return (long) -1;
  24776. }
  24777. } else {
  24778. long val;
  24779. PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
  24780. if (!tmp) return (long) -1;
  24781. val = __Pyx_PyInt_As_long(tmp);
  24782. Py_DECREF(tmp);
  24783. return val;
  24784. }
  24785. raise_overflow:
  24786. PyErr_SetString(PyExc_OverflowError,
  24787. "value too large to convert to long");
  24788. return (long) -1;
  24789. raise_neg_overflow:
  24790. PyErr_SetString(PyExc_OverflowError,
  24791. "can't convert negative value to long");
  24792. return (long) -1;
  24793. }
  24794. /* FastTypeChecks */
  24795. #if CYTHON_COMPILING_IN_CPYTHON
  24796. static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
  24797. while (a) {
  24798. a = a->tp_base;
  24799. if (a == b)
  24800. return 1;
  24801. }
  24802. return b == &PyBaseObject_Type;
  24803. }
  24804. static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
  24805. PyObject *mro;
  24806. if (a == b) return 1;
  24807. mro = a->tp_mro;
  24808. if (likely(mro)) {
  24809. Py_ssize_t i, n;
  24810. n = PyTuple_GET_SIZE(mro);
  24811. for (i = 0; i < n; i++) {
  24812. if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
  24813. return 1;
  24814. }
  24815. return 0;
  24816. }
  24817. return __Pyx_InBases(a, b);
  24818. }
  24819. #if PY_MAJOR_VERSION == 2
  24820. static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
  24821. PyObject *exception, *value, *tb;
  24822. int res;
  24823. __Pyx_PyThreadState_declare
  24824. __Pyx_PyThreadState_assign
  24825. __Pyx_ErrFetch(&exception, &value, &tb);
  24826. res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
  24827. if (unlikely(res == -1)) {
  24828. PyErr_WriteUnraisable(err);
  24829. res = 0;
  24830. }
  24831. if (!res) {
  24832. res = PyObject_IsSubclass(err, exc_type2);
  24833. if (unlikely(res == -1)) {
  24834. PyErr_WriteUnraisable(err);
  24835. res = 0;
  24836. }
  24837. }
  24838. __Pyx_ErrRestore(exception, value, tb);
  24839. return res;
  24840. }
  24841. #else
  24842. static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
  24843. int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
  24844. if (!res) {
  24845. res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
  24846. }
  24847. return res;
  24848. }
  24849. #endif
  24850. static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
  24851. Py_ssize_t i, n;
  24852. assert(PyExceptionClass_Check(exc_type));
  24853. n = PyTuple_GET_SIZE(tuple);
  24854. #if PY_MAJOR_VERSION >= 3
  24855. for (i=0; i<n; i++) {
  24856. if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
  24857. }
  24858. #endif
  24859. for (i=0; i<n; i++) {
  24860. PyObject *t = PyTuple_GET_ITEM(tuple, i);
  24861. #if PY_MAJOR_VERSION < 3
  24862. if (likely(exc_type == t)) return 1;
  24863. #endif
  24864. if (likely(PyExceptionClass_Check(t))) {
  24865. if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
  24866. } else {
  24867. }
  24868. }
  24869. return 0;
  24870. }
  24871. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
  24872. if (likely(err == exc_type)) return 1;
  24873. if (likely(PyExceptionClass_Check(err))) {
  24874. if (likely(PyExceptionClass_Check(exc_type))) {
  24875. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
  24876. } else if (likely(PyTuple_Check(exc_type))) {
  24877. return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
  24878. } else {
  24879. }
  24880. }
  24881. return PyErr_GivenExceptionMatches(err, exc_type);
  24882. }
  24883. static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
  24884. assert(PyExceptionClass_Check(exc_type1));
  24885. assert(PyExceptionClass_Check(exc_type2));
  24886. if (likely(err == exc_type1 || err == exc_type2)) return 1;
  24887. if (likely(PyExceptionClass_Check(err))) {
  24888. return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
  24889. }
  24890. return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
  24891. }
  24892. #endif
  24893. /* CStringEquals */
  24894. static CYTHON_INLINE int __Pyx_StrEq(const char *s1, const char *s2) {
  24895. while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
  24896. return *s1 == *s2;
  24897. }
  24898. /* CheckBinaryVersion */
  24899. static int __Pyx_check_binary_version(void) {
  24900. char ctversion[4], rtversion[4];
  24901. PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
  24902. PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
  24903. if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
  24904. char message[200];
  24905. PyOS_snprintf(message, sizeof(message),
  24906. "compiletime version %s of module '%.100s' "
  24907. "does not match runtime version %s",
  24908. ctversion, __Pyx_MODULE_NAME, rtversion);
  24909. return PyErr_WarnEx(NULL, message, 1);
  24910. }
  24911. return 0;
  24912. }
  24913. /* InitStrings */
  24914. static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
  24915. while (t->p) {
  24916. #if PY_MAJOR_VERSION < 3
  24917. if (t->is_unicode) {
  24918. *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
  24919. } else if (t->intern) {
  24920. *t->p = PyString_InternFromString(t->s);
  24921. } else {
  24922. *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
  24923. }
  24924. #else
  24925. if (t->is_unicode | t->is_str) {
  24926. if (t->intern) {
  24927. *t->p = PyUnicode_InternFromString(t->s);
  24928. } else if (t->encoding) {
  24929. *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
  24930. } else {
  24931. *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
  24932. }
  24933. } else {
  24934. *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
  24935. }
  24936. #endif
  24937. if (!*t->p)
  24938. return -1;
  24939. if (PyObject_Hash(*t->p) == -1)
  24940. return -1;
  24941. ++t;
  24942. }
  24943. return 0;
  24944. }
  24945. static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
  24946. return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
  24947. }
  24948. static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
  24949. Py_ssize_t ignore;
  24950. return __Pyx_PyObject_AsStringAndSize(o, &ignore);
  24951. }
  24952. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24953. #if !CYTHON_PEP393_ENABLED
  24954. static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24955. char* defenc_c;
  24956. PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
  24957. if (!defenc) return NULL;
  24958. defenc_c = PyBytes_AS_STRING(defenc);
  24959. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24960. {
  24961. char* end = defenc_c + PyBytes_GET_SIZE(defenc);
  24962. char* c;
  24963. for (c = defenc_c; c < end; c++) {
  24964. if ((unsigned char) (*c) >= 128) {
  24965. PyUnicode_AsASCIIString(o);
  24966. return NULL;
  24967. }
  24968. }
  24969. }
  24970. #endif
  24971. *length = PyBytes_GET_SIZE(defenc);
  24972. return defenc_c;
  24973. }
  24974. #else
  24975. static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24976. if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
  24977. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24978. if (likely(PyUnicode_IS_ASCII(o))) {
  24979. *length = PyUnicode_GET_LENGTH(o);
  24980. return PyUnicode_AsUTF8(o);
  24981. } else {
  24982. PyUnicode_AsASCIIString(o);
  24983. return NULL;
  24984. }
  24985. #else
  24986. return PyUnicode_AsUTF8AndSize(o, length);
  24987. #endif
  24988. }
  24989. #endif
  24990. #endif
  24991. static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
  24992. #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
  24993. if (
  24994. #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
  24995. __Pyx_sys_getdefaultencoding_not_ascii &&
  24996. #endif
  24997. PyUnicode_Check(o)) {
  24998. return __Pyx_PyUnicode_AsStringAndSize(o, length);
  24999. } else
  25000. #endif
  25001. #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
  25002. if (PyByteArray_Check(o)) {
  25003. *length = PyByteArray_GET_SIZE(o);
  25004. return PyByteArray_AS_STRING(o);
  25005. } else
  25006. #endif
  25007. {
  25008. char* result;
  25009. int r = PyBytes_AsStringAndSize(o, &result, length);
  25010. if (unlikely(r < 0)) {
  25011. return NULL;
  25012. } else {
  25013. return result;
  25014. }
  25015. }
  25016. }
  25017. static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
  25018. int is_true = x == Py_True;
  25019. if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
  25020. else return PyObject_IsTrue(x);
  25021. }
  25022. static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
  25023. int retval;
  25024. if (unlikely(!x)) return -1;
  25025. retval = __Pyx_PyObject_IsTrue(x);
  25026. Py_DECREF(x);
  25027. return retval;
  25028. }
  25029. static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
  25030. #if PY_MAJOR_VERSION >= 3
  25031. if (PyLong_Check(result)) {
  25032. if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
  25033. "__int__ returned non-int (type %.200s). "
  25034. "The ability to return an instance of a strict subclass of int "
  25035. "is deprecated, and may be removed in a future version of Python.",
  25036. Py_TYPE(result)->tp_name)) {
  25037. Py_DECREF(result);
  25038. return NULL;
  25039. }
  25040. return result;
  25041. }
  25042. #endif
  25043. PyErr_Format(PyExc_TypeError,
  25044. "__%.4s__ returned non-%.4s (type %.200s)",
  25045. type_name, type_name, Py_TYPE(result)->tp_name);
  25046. Py_DECREF(result);
  25047. return NULL;
  25048. }
  25049. static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
  25050. #if CYTHON_USE_TYPE_SLOTS
  25051. PyNumberMethods *m;
  25052. #endif
  25053. const char *name = NULL;
  25054. PyObject *res = NULL;
  25055. #if PY_MAJOR_VERSION < 3
  25056. if (likely(PyInt_Check(x) || PyLong_Check(x)))
  25057. #else
  25058. if (likely(PyLong_Check(x)))
  25059. #endif
  25060. return __Pyx_NewRef(x);
  25061. #if CYTHON_USE_TYPE_SLOTS
  25062. m = Py_TYPE(x)->tp_as_number;
  25063. #if PY_MAJOR_VERSION < 3
  25064. if (m && m->nb_int) {
  25065. name = "int";
  25066. res = m->nb_int(x);
  25067. }
  25068. else if (m && m->nb_long) {
  25069. name = "long";
  25070. res = m->nb_long(x);
  25071. }
  25072. #else
  25073. if (likely(m && m->nb_int)) {
  25074. name = "int";
  25075. res = m->nb_int(x);
  25076. }
  25077. #endif
  25078. #else
  25079. if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
  25080. res = PyNumber_Int(x);
  25081. }
  25082. #endif
  25083. if (likely(res)) {
  25084. #if PY_MAJOR_VERSION < 3
  25085. if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
  25086. #else
  25087. if (unlikely(!PyLong_CheckExact(res))) {
  25088. #endif
  25089. return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
  25090. }
  25091. }
  25092. else if (!PyErr_Occurred()) {
  25093. PyErr_SetString(PyExc_TypeError,
  25094. "an integer is required");
  25095. }
  25096. return res;
  25097. }
  25098. static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  25099. Py_ssize_t ival;
  25100. PyObject *x;
  25101. #if PY_MAJOR_VERSION < 3
  25102. if (likely(PyInt_CheckExact(b))) {
  25103. if (sizeof(Py_ssize_t) >= sizeof(long))
  25104. return PyInt_AS_LONG(b);
  25105. else
  25106. return PyInt_AsSsize_t(b);
  25107. }
  25108. #endif
  25109. if (likely(PyLong_CheckExact(b))) {
  25110. #if CYTHON_USE_PYLONG_INTERNALS
  25111. const digit* digits = ((PyLongObject*)b)->ob_digit;
  25112. const Py_ssize_t size = Py_SIZE(b);
  25113. if (likely(__Pyx_sst_abs(size) <= 1)) {
  25114. ival = likely(size) ? digits[0] : 0;
  25115. if (size == -1) ival = -ival;
  25116. return ival;
  25117. } else {
  25118. switch (size) {
  25119. case 2:
  25120. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  25121. return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25122. }
  25123. break;
  25124. case -2:
  25125. if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
  25126. return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25127. }
  25128. break;
  25129. case 3:
  25130. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  25131. return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25132. }
  25133. break;
  25134. case -3:
  25135. if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
  25136. return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
  25137. }
  25138. break;
  25139. case 4:
  25140. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  25141. 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]));
  25142. }
  25143. break;
  25144. case -4:
  25145. if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
  25146. 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]));
  25147. }
  25148. break;
  25149. }
  25150. }
  25151. #endif
  25152. return PyLong_AsSsize_t(b);
  25153. }
  25154. x = PyNumber_Index(b);
  25155. if (!x) return -1;
  25156. ival = PyInt_AsSsize_t(x);
  25157. Py_DECREF(x);
  25158. return ival;
  25159. }
  25160. static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  25161. return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
  25162. }
  25163. static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
  25164. return PyInt_FromSize_t(ival);
  25165. }
  25166. #endif /* Py_PYTHON_H */

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